@triadxyz/triad-protocol 2.7.1-beta → 2.7.3-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/index.d.ts +3 -2
- package/dist/index.js +5 -10
- package/dist/stake.js +2 -2
- package/dist/types/idl_triad_protocol.json +35 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/triad_protocol.d.ts +33 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -190,6 +190,7 @@ export default class TriadProtocolClient {
|
|
|
190
190
|
padding2: number[];
|
|
191
191
|
createdAt: BN;
|
|
192
192
|
padding3: number[];
|
|
193
|
+
isTrdPayout: boolean;
|
|
193
194
|
padding: number[];
|
|
194
195
|
}[];
|
|
195
196
|
nonce: number;
|
|
@@ -328,7 +329,7 @@ export default class TriadProtocolClient {
|
|
|
328
329
|
* @param options - RPC options
|
|
329
330
|
*
|
|
330
331
|
*/
|
|
331
|
-
createCustomer({ id, name, authority, feeRecipient
|
|
332
|
+
createCustomer({ id, name, authority, feeRecipient }: CreateCustomerArgs, options?: RpcOptions): Promise<string>;
|
|
332
333
|
/**
|
|
333
334
|
* Get User Trade Nonce With Slots
|
|
334
335
|
* @param userTrades - User Trades
|
|
@@ -403,7 +404,7 @@ export default class TriadProtocolClient {
|
|
|
403
404
|
*
|
|
404
405
|
* @param options - RPC options
|
|
405
406
|
*/
|
|
406
|
-
marketBidOrder({ marketId, amount, direction, mint, feeBps }: MarketBidOrderArgs, options?: RpcOptions): Promise<string>;
|
|
407
|
+
marketBidOrder({ marketId, amount, direction, mint, feeBps, isTrdPayout }: MarketBidOrderArgs, options?: RpcOptions): Promise<string>;
|
|
407
408
|
/**
|
|
408
409
|
* Market Ask Order
|
|
409
410
|
* @param args.marketId - The ID of the Market
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,6 @@ const sendVersionedTransaction_1 = __importDefault(require("./utils/sendVersione
|
|
|
38
38
|
const swap_1 = require("./utils/swap");
|
|
39
39
|
const stake_1 = __importDefault(require("./stake"));
|
|
40
40
|
const poseidon_1 = __importDefault(require("./poseidon"));
|
|
41
|
-
const stake_2 = require("./utils/pda/stake");
|
|
42
41
|
__exportStar(require("./types"), exports);
|
|
43
42
|
__exportStar(require("./types/stake"), exports);
|
|
44
43
|
__exportStar(require("./types/poseidon"), exports);
|
|
@@ -576,18 +575,13 @@ class TriadProtocolClient {
|
|
|
576
575
|
* @param options - RPC options
|
|
577
576
|
*
|
|
578
577
|
*/
|
|
579
|
-
createCustomer({ id, name, authority, feeRecipient
|
|
578
|
+
createCustomer({ id, name, authority, feeRecipient }, options) {
|
|
580
579
|
return __awaiter(this, void 0, void 0, function* () {
|
|
581
580
|
const ixs = [];
|
|
582
|
-
let stakePDA = null;
|
|
583
|
-
if (isStaked) {
|
|
584
|
-
stakePDA = (0, stake_2.getStakePDA)(this.program.programId, this.program.provider.publicKey);
|
|
585
|
-
}
|
|
586
581
|
ixs.push(yield this.program.methods
|
|
587
582
|
.createCustomer({ id, name, authority, feeRecipient })
|
|
588
583
|
.accounts({
|
|
589
|
-
signer: this.program.provider.publicKey
|
|
590
|
-
stake: stakePDA
|
|
584
|
+
signer: this.program.provider.publicKey
|
|
591
585
|
})
|
|
592
586
|
.instruction());
|
|
593
587
|
return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
|
|
@@ -798,7 +792,7 @@ class TriadProtocolClient {
|
|
|
798
792
|
*
|
|
799
793
|
* @param options - RPC options
|
|
800
794
|
*/
|
|
801
|
-
marketBidOrder({ marketId, amount, direction, mint, feeBps = 0 }, options) {
|
|
795
|
+
marketBidOrder({ marketId, amount, direction, mint, feeBps = 0, isTrdPayout }, options) {
|
|
802
796
|
return __awaiter(this, void 0, void 0, function* () {
|
|
803
797
|
const marketPDA = (0, pda_1.getMarketPDA)(this.program.programId, marketId);
|
|
804
798
|
const ixs = [];
|
|
@@ -841,7 +835,8 @@ class TriadProtocolClient {
|
|
|
841
835
|
.marketBidOrder({
|
|
842
836
|
amount: new bn_js_1.default(usdcAmount),
|
|
843
837
|
orderDirection: direction,
|
|
844
|
-
askOrderId: new bn_js_1.default(order.id)
|
|
838
|
+
askOrderId: new bn_js_1.default(order.id),
|
|
839
|
+
isTrdPayout
|
|
845
840
|
})
|
|
846
841
|
.accounts({
|
|
847
842
|
signer: this.program.provider.publicKey,
|
package/dist/stake.js
CHANGED
|
@@ -169,8 +169,8 @@ class Stake {
|
|
|
169
169
|
ixs.push(yield this.program.methods
|
|
170
170
|
.claimStakeRewards()
|
|
171
171
|
.accounts({
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
signer: this.program.provider.publicKey,
|
|
173
|
+
mint: constants_1.TRD_MINT
|
|
174
174
|
})
|
|
175
175
|
.instruction());
|
|
176
176
|
return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
|
|
@@ -214,7 +214,19 @@
|
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
"name": "stake",
|
|
217
|
-
"writable": true
|
|
217
|
+
"writable": true,
|
|
218
|
+
"pda": {
|
|
219
|
+
"seeds": [
|
|
220
|
+
{
|
|
221
|
+
"kind": "const",
|
|
222
|
+
"value": [115, 116, 97, 107, 101, 95, 118, 51]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"kind": "account",
|
|
226
|
+
"path": "signer"
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
218
230
|
},
|
|
219
231
|
{
|
|
220
232
|
"name": "mint",
|
|
@@ -660,7 +672,19 @@
|
|
|
660
672
|
{
|
|
661
673
|
"name": "stake",
|
|
662
674
|
"writable": true,
|
|
663
|
-
"optional": true
|
|
675
|
+
"optional": true,
|
|
676
|
+
"pda": {
|
|
677
|
+
"seeds": [
|
|
678
|
+
{
|
|
679
|
+
"kind": "const",
|
|
680
|
+
"value": [115, 116, 97, 107, 101, 95, 118, 51]
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
"kind": "account",
|
|
684
|
+
"path": "signer"
|
|
685
|
+
}
|
|
686
|
+
]
|
|
687
|
+
}
|
|
664
688
|
},
|
|
665
689
|
{
|
|
666
690
|
"name": "system_program",
|
|
@@ -2884,6 +2908,10 @@
|
|
|
2884
2908
|
"name": "ask_order_id",
|
|
2885
2909
|
"type": "u64"
|
|
2886
2910
|
},
|
|
2911
|
+
{
|
|
2912
|
+
"name": "is_trd_payout",
|
|
2913
|
+
"type": "bool"
|
|
2914
|
+
},
|
|
2887
2915
|
{
|
|
2888
2916
|
"name": "order_direction",
|
|
2889
2917
|
"type": {
|
|
@@ -3263,10 +3291,14 @@
|
|
|
3263
3291
|
"array": ["u8", 8]
|
|
3264
3292
|
}
|
|
3265
3293
|
},
|
|
3294
|
+
{
|
|
3295
|
+
"name": "is_trd_payout",
|
|
3296
|
+
"type": "bool"
|
|
3297
|
+
},
|
|
3266
3298
|
{
|
|
3267
3299
|
"name": "padding",
|
|
3268
3300
|
"type": {
|
|
3269
|
-
"array": ["u8",
|
|
3301
|
+
"array": ["u8", 2]
|
|
3270
3302
|
}
|
|
3271
3303
|
}
|
|
3272
3304
|
]
|
package/dist/types/index.d.ts
CHANGED
|
@@ -291,6 +291,18 @@ export type TriadProtocol = {
|
|
|
291
291
|
{
|
|
292
292
|
name: 'stake';
|
|
293
293
|
writable: true;
|
|
294
|
+
pda: {
|
|
295
|
+
seeds: [
|
|
296
|
+
{
|
|
297
|
+
kind: 'const';
|
|
298
|
+
value: [115, 116, 97, 107, 101, 95, 118, 51];
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
kind: 'account';
|
|
302
|
+
path: 'signer';
|
|
303
|
+
}
|
|
304
|
+
];
|
|
305
|
+
};
|
|
294
306
|
},
|
|
295
307
|
{
|
|
296
308
|
name: 'mint';
|
|
@@ -969,6 +981,18 @@ export type TriadProtocol = {
|
|
|
969
981
|
name: 'stake';
|
|
970
982
|
writable: true;
|
|
971
983
|
optional: true;
|
|
984
|
+
pda: {
|
|
985
|
+
seeds: [
|
|
986
|
+
{
|
|
987
|
+
kind: 'const';
|
|
988
|
+
value: [115, 116, 97, 107, 101, 95, 118, 51];
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
kind: 'account';
|
|
992
|
+
path: 'signer';
|
|
993
|
+
}
|
|
994
|
+
];
|
|
995
|
+
};
|
|
972
996
|
},
|
|
973
997
|
{
|
|
974
998
|
name: 'systemProgram';
|
|
@@ -3675,6 +3699,10 @@ export type TriadProtocol = {
|
|
|
3675
3699
|
name: 'askOrderId';
|
|
3676
3700
|
type: 'u64';
|
|
3677
3701
|
},
|
|
3702
|
+
{
|
|
3703
|
+
name: 'isTrdPayout';
|
|
3704
|
+
type: 'bool';
|
|
3705
|
+
},
|
|
3678
3706
|
{
|
|
3679
3707
|
name: 'orderDirection';
|
|
3680
3708
|
type: {
|
|
@@ -4054,10 +4082,14 @@ export type TriadProtocol = {
|
|
|
4054
4082
|
array: ['u8', 8];
|
|
4055
4083
|
};
|
|
4056
4084
|
},
|
|
4085
|
+
{
|
|
4086
|
+
name: 'isTrdPayout';
|
|
4087
|
+
type: 'bool';
|
|
4088
|
+
},
|
|
4057
4089
|
{
|
|
4058
4090
|
name: 'padding';
|
|
4059
4091
|
type: {
|
|
4060
|
-
array: ['u8',
|
|
4092
|
+
array: ['u8', 2];
|
|
4061
4093
|
};
|
|
4062
4094
|
}
|
|
4063
4095
|
];
|