Skip to content

Commit

Permalink
Add bond size to order book
Browse files Browse the repository at this point in the history
  • Loading branch information
Reckless-Satoshi committed Oct 2, 2022
1 parent 9a6d3d3 commit 0a10080
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class Meta:
"maker",
"taker",
"escrow_duration",
"bond_size"
)


Expand Down
23 changes: 22 additions & 1 deletion frontend/src/components/BookTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,19 @@ const BookTable = ({
};
};

const bondObj = function (width: number, hide: boolean) {
return {
hide,
field: 'bond_size',
headerName: t('Bond'),
type: 'number',
width: width * fontSize,
renderCell: (params:any) => {
return <div style={{ cursor: 'pointer' }}>{`${Number(params.row.bond_size)}%`}</div>;
},
};
};

const columnSpecs = {
amount: {
priority: 1,
Expand Down Expand Up @@ -546,8 +559,16 @@ const BookTable = ({
object: typeObj,
},
},
id: {
bond: {
priority: 11,
order: 10,
normal: {
width: 4.2,
object: bondObj,
},
},
id: {
priority: 12,
order: 12,
normal: {
width: 4.8,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/models/Order.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface Order {
satoshis: number;
satoshis_now: number;
bondless_taker: boolean;
bond_size: number;
maker: number;
escrow_duration: number;
maker_nick: string;
Expand Down

0 comments on commit 0a10080

Please sign in to comment.