@triadxyz/triad-protocol 3.1.3-beta → 3.1.4-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 CHANGED
@@ -418,9 +418,20 @@ export default class TriadProtocolClient {
418
418
  * @param args.markets.customerFeeRecipient - The address of the customer fee recipient
419
419
  */
420
420
  collectMarketFee({ markets }: CollectMarketFeeArgs): Promise<string>;
421
+ /**
422
+ * Collect Market Order Fee
423
+ * @param marketAddress - The address of the market
424
+ */
425
+ collectMarketOrderFee(marketAddress: PublicKey[]): Promise<string>;
421
426
  /**
422
427
  * Close Order Book
423
428
  * @param marketIds - Market IDs
424
429
  */
425
430
  closeOrderBook(marketIds: number[]): Promise<string>;
431
+ /**
432
+ * Update Pool Question
433
+ * @param poolId - Pool ID
434
+ * @param question - Question
435
+ */
436
+ updatePoolQuestion(poolId: number, question: string): Promise<string>;
426
437
  }
package/dist/index.js CHANGED
@@ -1080,10 +1080,27 @@ class TriadProtocolClient {
1080
1080
  .accounts({
1081
1081
  signer: this.program.provider.publicKey,
1082
1082
  market: market.marketAddress,
1083
- mint: constants_1.USDC_MINT,
1084
1083
  customer: (0, pda_1.getCustomerPDA)(this.program.programId, market.customerId),
1085
- customerFeeRecipient: market.customerFeeRecipient,
1086
- tokenProgram: spl_token_1.TOKEN_PROGRAM_ID
1084
+ customerFeeRecipient: market.customerFeeRecipient
1085
+ })
1086
+ .instruction());
1087
+ }
1088
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
1089
+ });
1090
+ }
1091
+ /**
1092
+ * Collect Market Order Fee
1093
+ * @param marketAddress - The address of the market
1094
+ */
1095
+ collectMarketOrderFee(marketAddress) {
1096
+ return __awaiter(this, void 0, void 0, function* () {
1097
+ const ixs = [];
1098
+ for (const market of marketAddress) {
1099
+ ixs.push(yield this.program.methods
1100
+ .collectMarketOrderFee()
1101
+ .accounts({
1102
+ signer: this.program.provider.publicKey,
1103
+ market: market
1087
1104
  })
1088
1105
  .instruction());
1089
1106
  }
@@ -1110,5 +1127,23 @@ class TriadProtocolClient {
1110
1127
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
1111
1128
  });
1112
1129
  }
1130
+ /**
1131
+ * Update Pool Question
1132
+ * @param poolId - Pool ID
1133
+ * @param question - Question
1134
+ */
1135
+ updatePoolQuestion(poolId, question) {
1136
+ return __awaiter(this, void 0, void 0, function* () {
1137
+ const ixs = [];
1138
+ ixs.push(yield this.program.methods
1139
+ .updatePoolQuestion((0, helpers_1.encodeString)(question, 80))
1140
+ .accounts({
1141
+ signer: this.program.provider.publicKey,
1142
+ pool: (0, pda_1.getPoolPDA)(this.program.programId, poolId)
1143
+ })
1144
+ .instruction());
1145
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
1146
+ });
1147
+ }
1113
1148
  }
1114
1149
  exports.default = TriadProtocolClient;
@@ -712,7 +712,8 @@
712
712
  },
713
713
  {
714
714
  "name": "mint",
715
- "writable": true
715
+ "writable": true,
716
+ "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
716
717
  },
717
718
  {
718
719
  "name": "market_ata",
@@ -799,7 +800,130 @@
799
800
  }
800
801
  },
801
802
  {
802
- "name": "token_program"
803
+ "name": "stake_vault_ata",
804
+ "writable": true,
805
+ "pda": {
806
+ "seeds": [
807
+ {
808
+ "kind": "account",
809
+ "path": "stake_vault"
810
+ },
811
+ {
812
+ "kind": "account",
813
+ "path": "token_program"
814
+ },
815
+ {
816
+ "kind": "account",
817
+ "path": "mint"
818
+ }
819
+ ],
820
+ "program": {
821
+ "kind": "const",
822
+ "value": [
823
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
824
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
825
+ 219, 233, 248, 89
826
+ ]
827
+ }
828
+ }
829
+ },
830
+ {
831
+ "name": "token_program",
832
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
833
+ },
834
+ {
835
+ "name": "associated_token_program",
836
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
837
+ },
838
+ {
839
+ "name": "system_program",
840
+ "address": "11111111111111111111111111111111"
841
+ }
842
+ ],
843
+ "args": []
844
+ },
845
+ {
846
+ "name": "collect_market_order_fee",
847
+ "discriminator": [127, 95, 245, 217, 143, 141, 206, 34],
848
+ "accounts": [
849
+ {
850
+ "name": "signer",
851
+ "writable": true,
852
+ "signer": true
853
+ },
854
+ {
855
+ "name": "squads",
856
+ "writable": true,
857
+ "address": "Hk1r2NUL4LbUhx1agg1w44tyZiNr72mbeLsg6suF5MA4"
858
+ },
859
+ {
860
+ "name": "market",
861
+ "writable": true
862
+ },
863
+ {
864
+ "name": "mint",
865
+ "writable": true,
866
+ "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
867
+ },
868
+ {
869
+ "name": "market_ata",
870
+ "writable": true,
871
+ "pda": {
872
+ "seeds": [
873
+ {
874
+ "kind": "account",
875
+ "path": "market"
876
+ },
877
+ {
878
+ "kind": "account",
879
+ "path": "token_program"
880
+ },
881
+ {
882
+ "kind": "account",
883
+ "path": "mint"
884
+ }
885
+ ],
886
+ "program": {
887
+ "kind": "const",
888
+ "value": [
889
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
890
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
891
+ 219, 233, 248, 89
892
+ ]
893
+ }
894
+ }
895
+ },
896
+ {
897
+ "name": "squads_ata",
898
+ "writable": true,
899
+ "pda": {
900
+ "seeds": [
901
+ {
902
+ "kind": "account",
903
+ "path": "squads"
904
+ },
905
+ {
906
+ "kind": "account",
907
+ "path": "token_program"
908
+ },
909
+ {
910
+ "kind": "account",
911
+ "path": "mint"
912
+ }
913
+ ],
914
+ "program": {
915
+ "kind": "const",
916
+ "value": [
917
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
918
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
919
+ 219, 233, 248, 89
920
+ ]
921
+ }
922
+ }
923
+ },
924
+ {
925
+ "name": "token_program",
926
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
803
927
  },
804
928
  {
805
929
  "name": "associated_token_program",
@@ -2553,6 +2677,33 @@
2553
2677
  }
2554
2678
  ]
2555
2679
  },
2680
+ {
2681
+ "name": "update_pool_question",
2682
+ "discriminator": [248, 60, 128, 181, 157, 182, 51, 166],
2683
+ "accounts": [
2684
+ {
2685
+ "name": "signer",
2686
+ "writable": true,
2687
+ "signer": true
2688
+ },
2689
+ {
2690
+ "name": "pool",
2691
+ "writable": true
2692
+ },
2693
+ {
2694
+ "name": "system_program",
2695
+ "address": "11111111111111111111111111111111"
2696
+ }
2697
+ ],
2698
+ "args": [
2699
+ {
2700
+ "name": "question",
2701
+ "type": {
2702
+ "array": ["u8", 80]
2703
+ }
2704
+ }
2705
+ ]
2706
+ },
2556
2707
  {
2557
2708
  "name": "update_stake_vault_is_locked",
2558
2709
  "discriminator": [239, 65, 219, 190, 157, 173, 139, 226],
@@ -2704,6 +2855,10 @@
2704
2855
  "name": "CollectMarketFeeEvent",
2705
2856
  "discriminator": [210, 147, 203, 216, 158, 111, 59, 143]
2706
2857
  },
2858
+ {
2859
+ "name": "CollectMarketOrderFeeEvent",
2860
+ "discriminator": [161, 42, 44, 15, 110, 57, 203, 165]
2861
+ },
2707
2862
  {
2708
2863
  "name": "MarketEvent",
2709
2864
  "discriminator": [212, 67, 145, 23, 58, 104, 52, 83]
@@ -3291,6 +3446,26 @@
3291
3446
  ]
3292
3447
  }
3293
3448
  },
3449
+ {
3450
+ "name": "CollectMarketOrderFeeEvent",
3451
+ "type": {
3452
+ "kind": "struct",
3453
+ "fields": [
3454
+ {
3455
+ "name": "market_id",
3456
+ "type": "u64"
3457
+ },
3458
+ {
3459
+ "name": "fee",
3460
+ "type": "u64"
3461
+ },
3462
+ {
3463
+ "name": "timestamp",
3464
+ "type": "i64"
3465
+ }
3466
+ ]
3467
+ }
3468
+ },
3294
3469
  {
3295
3470
  "name": "Collection",
3296
3471
  "type": {
@@ -1043,6 +1043,7 @@ export type TriadProtocol = {
1043
1043
  {
1044
1044
  name: 'mint';
1045
1045
  writable: true;
1046
+ address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
1046
1047
  },
1047
1048
  {
1048
1049
  name: 'marketAta';
@@ -1215,8 +1216,218 @@ export type TriadProtocol = {
1215
1216
  };
1216
1217
  };
1217
1218
  },
1219
+ {
1220
+ name: 'stakeVaultAta';
1221
+ writable: true;
1222
+ pda: {
1223
+ seeds: [
1224
+ {
1225
+ kind: 'account';
1226
+ path: 'stakeVault';
1227
+ },
1228
+ {
1229
+ kind: 'account';
1230
+ path: 'tokenProgram';
1231
+ },
1232
+ {
1233
+ kind: 'account';
1234
+ path: 'mint';
1235
+ }
1236
+ ];
1237
+ program: {
1238
+ kind: 'const';
1239
+ value: [
1240
+ 140,
1241
+ 151,
1242
+ 37,
1243
+ 143,
1244
+ 78,
1245
+ 36,
1246
+ 137,
1247
+ 241,
1248
+ 187,
1249
+ 61,
1250
+ 16,
1251
+ 41,
1252
+ 20,
1253
+ 142,
1254
+ 13,
1255
+ 131,
1256
+ 11,
1257
+ 90,
1258
+ 19,
1259
+ 153,
1260
+ 218,
1261
+ 255,
1262
+ 16,
1263
+ 132,
1264
+ 4,
1265
+ 142,
1266
+ 123,
1267
+ 216,
1268
+ 219,
1269
+ 233,
1270
+ 248,
1271
+ 89
1272
+ ];
1273
+ };
1274
+ };
1275
+ },
1218
1276
  {
1219
1277
  name: 'tokenProgram';
1278
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
1279
+ },
1280
+ {
1281
+ name: 'associatedTokenProgram';
1282
+ address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
1283
+ },
1284
+ {
1285
+ name: 'systemProgram';
1286
+ address: '11111111111111111111111111111111';
1287
+ }
1288
+ ];
1289
+ args: [];
1290
+ },
1291
+ {
1292
+ name: 'collectMarketOrderFee';
1293
+ discriminator: [127, 95, 245, 217, 143, 141, 206, 34];
1294
+ accounts: [
1295
+ {
1296
+ name: 'signer';
1297
+ writable: true;
1298
+ signer: true;
1299
+ },
1300
+ {
1301
+ name: 'squads';
1302
+ writable: true;
1303
+ address: 'Hk1r2NUL4LbUhx1agg1w44tyZiNr72mbeLsg6suF5MA4';
1304
+ },
1305
+ {
1306
+ name: 'market';
1307
+ writable: true;
1308
+ },
1309
+ {
1310
+ name: 'mint';
1311
+ writable: true;
1312
+ address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
1313
+ },
1314
+ {
1315
+ name: 'marketAta';
1316
+ writable: true;
1317
+ pda: {
1318
+ seeds: [
1319
+ {
1320
+ kind: 'account';
1321
+ path: 'market';
1322
+ },
1323
+ {
1324
+ kind: 'account';
1325
+ path: 'tokenProgram';
1326
+ },
1327
+ {
1328
+ kind: 'account';
1329
+ path: 'mint';
1330
+ }
1331
+ ];
1332
+ program: {
1333
+ kind: 'const';
1334
+ value: [
1335
+ 140,
1336
+ 151,
1337
+ 37,
1338
+ 143,
1339
+ 78,
1340
+ 36,
1341
+ 137,
1342
+ 241,
1343
+ 187,
1344
+ 61,
1345
+ 16,
1346
+ 41,
1347
+ 20,
1348
+ 142,
1349
+ 13,
1350
+ 131,
1351
+ 11,
1352
+ 90,
1353
+ 19,
1354
+ 153,
1355
+ 218,
1356
+ 255,
1357
+ 16,
1358
+ 132,
1359
+ 4,
1360
+ 142,
1361
+ 123,
1362
+ 216,
1363
+ 219,
1364
+ 233,
1365
+ 248,
1366
+ 89
1367
+ ];
1368
+ };
1369
+ };
1370
+ },
1371
+ {
1372
+ name: 'squadsAta';
1373
+ writable: true;
1374
+ pda: {
1375
+ seeds: [
1376
+ {
1377
+ kind: 'account';
1378
+ path: 'squads';
1379
+ },
1380
+ {
1381
+ kind: 'account';
1382
+ path: 'tokenProgram';
1383
+ },
1384
+ {
1385
+ kind: 'account';
1386
+ path: 'mint';
1387
+ }
1388
+ ];
1389
+ program: {
1390
+ kind: 'const';
1391
+ value: [
1392
+ 140,
1393
+ 151,
1394
+ 37,
1395
+ 143,
1396
+ 78,
1397
+ 36,
1398
+ 137,
1399
+ 241,
1400
+ 187,
1401
+ 61,
1402
+ 16,
1403
+ 41,
1404
+ 20,
1405
+ 142,
1406
+ 13,
1407
+ 131,
1408
+ 11,
1409
+ 90,
1410
+ 19,
1411
+ 153,
1412
+ 218,
1413
+ 255,
1414
+ 16,
1415
+ 132,
1416
+ 4,
1417
+ 142,
1418
+ 123,
1419
+ 216,
1420
+ 219,
1421
+ 233,
1422
+ 248,
1423
+ 89
1424
+ ];
1425
+ };
1426
+ };
1427
+ },
1428
+ {
1429
+ name: 'tokenProgram';
1430
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
1220
1431
  },
1221
1432
  {
1222
1433
  name: 'associatedTokenProgram';
@@ -3499,6 +3710,33 @@ export type TriadProtocol = {
3499
3710
  }
3500
3711
  ];
3501
3712
  },
3713
+ {
3714
+ name: 'updatePoolQuestion';
3715
+ discriminator: [248, 60, 128, 181, 157, 182, 51, 166];
3716
+ accounts: [
3717
+ {
3718
+ name: 'signer';
3719
+ writable: true;
3720
+ signer: true;
3721
+ },
3722
+ {
3723
+ name: 'pool';
3724
+ writable: true;
3725
+ },
3726
+ {
3727
+ name: 'systemProgram';
3728
+ address: '11111111111111111111111111111111';
3729
+ }
3730
+ ];
3731
+ args: [
3732
+ {
3733
+ name: 'question';
3734
+ type: {
3735
+ array: ['u8', 80];
3736
+ };
3737
+ }
3738
+ ];
3739
+ },
3502
3740
  {
3503
3741
  name: 'updateStakeVaultIsLocked';
3504
3742
  discriminator: [239, 65, 219, 190, 157, 173, 139, 226];
@@ -3662,6 +3900,10 @@ export type TriadProtocol = {
3662
3900
  name: 'collectMarketFeeEvent';
3663
3901
  discriminator: [210, 147, 203, 216, 158, 111, 59, 143];
3664
3902
  },
3903
+ {
3904
+ name: 'collectMarketOrderFeeEvent';
3905
+ discriminator: [161, 42, 44, 15, 110, 57, 203, 165];
3906
+ },
3665
3907
  {
3666
3908
  name: 'marketEvent';
3667
3909
  discriminator: [212, 67, 145, 23, 58, 104, 52, 83];
@@ -4249,6 +4491,26 @@ export type TriadProtocol = {
4249
4491
  ];
4250
4492
  };
4251
4493
  },
4494
+ {
4495
+ name: 'collectMarketOrderFeeEvent';
4496
+ type: {
4497
+ kind: 'struct';
4498
+ fields: [
4499
+ {
4500
+ name: 'marketId';
4501
+ type: 'u64';
4502
+ },
4503
+ {
4504
+ name: 'fee';
4505
+ type: 'u64';
4506
+ },
4507
+ {
4508
+ name: 'timestamp';
4509
+ type: 'i64';
4510
+ }
4511
+ ];
4512
+ };
4513
+ },
4252
4514
  {
4253
4515
  name: 'collection';
4254
4516
  type: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "3.1.3-beta",
3
+ "version": "3.1.4-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",