@triadxyz/triad-protocol 2.0.6-beta → 2.0.8-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/trade.d.ts
CHANGED
|
@@ -2537,7 +2537,6 @@
|
|
|
2537
2537
|
},
|
|
2538
2538
|
{
|
|
2539
2539
|
"name": "filled_shares",
|
|
2540
|
-
"docs": ["The number of shares that have been filled"],
|
|
2541
2540
|
"type": "u64"
|
|
2542
2541
|
},
|
|
2543
2542
|
{
|
|
@@ -2554,17 +2553,16 @@
|
|
|
2554
2553
|
},
|
|
2555
2554
|
{
|
|
2556
2555
|
"name": "price",
|
|
2557
|
-
"docs": ["The price of the order"],
|
|
2558
2556
|
"type": "u64"
|
|
2559
2557
|
},
|
|
2560
2558
|
{
|
|
2561
|
-
"name": "
|
|
2562
|
-
"
|
|
2563
|
-
|
|
2559
|
+
"name": "padding_1",
|
|
2560
|
+
"type": {
|
|
2561
|
+
"array": ["u8", 8]
|
|
2562
|
+
}
|
|
2564
2563
|
},
|
|
2565
2564
|
{
|
|
2566
2565
|
"name": "total_shares",
|
|
2567
|
-
"docs": ["The total number of shares to be purchased"],
|
|
2568
2566
|
"type": "u64"
|
|
2569
2567
|
},
|
|
2570
2568
|
{
|
|
@@ -2687,18 +2685,6 @@
|
|
|
2687
2685
|
"name": "total_shares",
|
|
2688
2686
|
"type": "u64"
|
|
2689
2687
|
},
|
|
2690
|
-
{
|
|
2691
|
-
"name": "total_amount",
|
|
2692
|
-
"type": "u64"
|
|
2693
|
-
},
|
|
2694
|
-
{
|
|
2695
|
-
"name": "refund_amount",
|
|
2696
|
-
"type": "u64"
|
|
2697
|
-
},
|
|
2698
|
-
{
|
|
2699
|
-
"name": "pnl",
|
|
2700
|
-
"type": "i64"
|
|
2701
|
-
},
|
|
2702
2688
|
{
|
|
2703
2689
|
"name": "user_nonce",
|
|
2704
2690
|
"type": "u32"
|
package/dist/types/trade.d.ts
CHANGED
|
@@ -41,12 +41,11 @@ export type UserTrade = {
|
|
|
41
41
|
export type Order = {
|
|
42
42
|
ts: string;
|
|
43
43
|
orderId: string;
|
|
44
|
-
filledShares: string;
|
|
45
44
|
marketId: string;
|
|
46
45
|
orderStatus: OrderStatus;
|
|
47
46
|
price: string;
|
|
48
|
-
totalAmount: string;
|
|
49
47
|
totalShares: string;
|
|
48
|
+
filledShares: string;
|
|
50
49
|
orderType: OrderType;
|
|
51
50
|
orderDirection: OrderDirection;
|
|
52
51
|
orderSide: OrderSide;
|
|
@@ -3258,7 +3258,6 @@ export type TriadProtocol = {
|
|
|
3258
3258
|
},
|
|
3259
3259
|
{
|
|
3260
3260
|
name: 'filledShares';
|
|
3261
|
-
docs: ['The number of shares that have been filled'];
|
|
3262
3261
|
type: 'u64';
|
|
3263
3262
|
},
|
|
3264
3263
|
{
|
|
@@ -3275,17 +3274,16 @@ export type TriadProtocol = {
|
|
|
3275
3274
|
},
|
|
3276
3275
|
{
|
|
3277
3276
|
name: 'price';
|
|
3278
|
-
docs: ['The price of the order'];
|
|
3279
3277
|
type: 'u64';
|
|
3280
3278
|
},
|
|
3281
3279
|
{
|
|
3282
|
-
name: '
|
|
3283
|
-
|
|
3284
|
-
|
|
3280
|
+
name: 'padding1';
|
|
3281
|
+
type: {
|
|
3282
|
+
array: ['u8', 8];
|
|
3283
|
+
};
|
|
3285
3284
|
},
|
|
3286
3285
|
{
|
|
3287
3286
|
name: 'totalShares';
|
|
3288
|
-
docs: ['The total number of shares to be purchased'];
|
|
3289
3287
|
type: 'u64';
|
|
3290
3288
|
},
|
|
3291
3289
|
{
|
|
@@ -3408,18 +3406,6 @@ export type TriadProtocol = {
|
|
|
3408
3406
|
name: 'totalShares';
|
|
3409
3407
|
type: 'u64';
|
|
3410
3408
|
},
|
|
3411
|
-
{
|
|
3412
|
-
name: 'totalAmount';
|
|
3413
|
-
type: 'u64';
|
|
3414
|
-
},
|
|
3415
|
-
{
|
|
3416
|
-
name: 'refundAmount';
|
|
3417
|
-
type: 'u64';
|
|
3418
|
-
},
|
|
3419
|
-
{
|
|
3420
|
-
name: 'pnl';
|
|
3421
|
-
type: 'i64';
|
|
3422
|
-
},
|
|
3423
3409
|
{
|
|
3424
3410
|
name: 'userNonce';
|
|
3425
3411
|
type: 'u32';
|
package/dist/utils/helpers.js
CHANGED
|
@@ -102,23 +102,22 @@ exports.formatUserTrade = formatUserTrade;
|
|
|
102
102
|
const formatOrder = (order, authority) => {
|
|
103
103
|
return {
|
|
104
104
|
ts: order.ts.toString(),
|
|
105
|
+
authority: authority ? authority : '',
|
|
106
|
+
userNonce: order.userNonce.toString(),
|
|
107
|
+
createdAt: order.createdAt ? order.createdAt.toString() : '',
|
|
105
108
|
orderId: order.orderId.toString(),
|
|
106
109
|
marketId: order.marketId.toString(),
|
|
107
110
|
orderStatus: (0, exports.getOrderStatus)(order.orderStatus),
|
|
108
|
-
price: order.price.toString(),
|
|
109
|
-
totalAmount: order.totalAmount.toString(),
|
|
110
|
-
totalShares: order.totalShares.toString(),
|
|
111
111
|
orderType: (0, exports.getOrderType)(order.orderType),
|
|
112
112
|
orderDirection: (0, exports.getOrderDirection)(order.orderDirection),
|
|
113
113
|
orderSide: (0, exports.getOrderSide)(order.orderSide),
|
|
114
|
-
|
|
114
|
+
price: order.price.toString(),
|
|
115
|
+
totalShares: order.totalShares.toString(),
|
|
116
|
+
filledShares: order.filledShares ? order.filledShares.toString() : '',
|
|
115
117
|
linkedOrderId: order.linkedOrderId ? order.linkedOrderId.toString() : '',
|
|
116
118
|
linkedBidOrderId: order.linkedBidOrderId
|
|
117
119
|
? order.linkedBidOrderId.toString()
|
|
118
|
-
: ''
|
|
119
|
-
filledShares: order.filledShares ? order.filledShares.toString() : '',
|
|
120
|
-
authority: authority ? authority : '',
|
|
121
|
-
createdAt: order.createdAt ? order.createdAt.toString() : ''
|
|
120
|
+
: ''
|
|
122
121
|
};
|
|
123
122
|
};
|
|
124
123
|
exports.formatOrder = formatOrder;
|