Add bond size to order book

This commit is contained in:
Reckless_Satoshi 2022-10-02 13:54:45 -07:00
parent 9a6d3d33a4
commit 0a100802f2
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 24 additions and 1 deletions

View File

@ -54,6 +54,7 @@ class ListOrderSerializer(serializers.ModelSerializer):
"maker",
"taker",
"escrow_duration",
"bond_size"
)

View File

@ -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,
@ -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,

View File

@ -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;