@triadxyz/triad-protocol 3.1.6-beta → 3.1.7-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.
@@ -197,6 +197,11 @@
197
197
  "writable": true,
198
198
  "signer": true
199
199
  },
200
+ {
201
+ "name": "payer",
202
+ "writable": true,
203
+ "signer": true
204
+ },
200
205
  {
201
206
  "name": "market",
202
207
  "writable": true
@@ -544,6 +549,11 @@
544
549
  "writable": true,
545
550
  "signer": true
546
551
  },
552
+ {
553
+ "name": "payer",
554
+ "writable": true,
555
+ "signer": true
556
+ },
547
557
  {
548
558
  "name": "squads",
549
559
  "writable": true,
@@ -1317,6 +1327,11 @@
1317
1327
  "writable": true,
1318
1328
  "signer": true
1319
1329
  },
1330
+ {
1331
+ "name": "payer",
1332
+ "writable": true,
1333
+ "signer": true
1334
+ },
1320
1335
  {
1321
1336
  "name": "user_trade",
1322
1337
  "writable": true,
@@ -1370,6 +1385,11 @@
1370
1385
  "writable": true,
1371
1386
  "signer": true
1372
1387
  },
1388
+ {
1389
+ "name": "payer",
1390
+ "writable": true,
1391
+ "signer": true
1392
+ },
1373
1393
  {
1374
1394
  "name": "user_trade",
1375
1395
  "writable": true,
@@ -1402,6 +1422,11 @@
1402
1422
  "writable": true,
1403
1423
  "signer": true
1404
1424
  },
1425
+ {
1426
+ "name": "payer",
1427
+ "writable": true,
1428
+ "signer": true
1429
+ },
1405
1430
  {
1406
1431
  "name": "market",
1407
1432
  "writable": true
@@ -1585,6 +1610,11 @@
1585
1610
  "writable": true,
1586
1611
  "signer": true
1587
1612
  },
1613
+ {
1614
+ "name": "payer",
1615
+ "writable": true,
1616
+ "signer": true
1617
+ },
1588
1618
  {
1589
1619
  "name": "market",
1590
1620
  "writable": true
@@ -1776,6 +1806,11 @@
1776
1806
  "writable": true,
1777
1807
  "signer": true
1778
1808
  },
1809
+ {
1810
+ "name": "payer",
1811
+ "writable": true,
1812
+ "signer": true
1813
+ },
1779
1814
  {
1780
1815
  "name": "squads",
1781
1816
  "writable": true,
@@ -1882,6 +1917,11 @@
1882
1917
  "writable": true,
1883
1918
  "signer": true
1884
1919
  },
1920
+ {
1921
+ "name": "payer",
1922
+ "writable": true,
1923
+ "signer": true
1924
+ },
1885
1925
  {
1886
1926
  "name": "squads",
1887
1927
  "writable": true,
@@ -2522,6 +2562,102 @@
2522
2562
  ],
2523
2563
  "args": []
2524
2564
  },
2565
+ {
2566
+ "name": "update_claim_vault_amount",
2567
+ "discriminator": [97, 2, 93, 198, 31, 248, 174, 52],
2568
+ "accounts": [
2569
+ {
2570
+ "name": "signer",
2571
+ "writable": true,
2572
+ "signer": true
2573
+ },
2574
+ {
2575
+ "name": "claim_vault",
2576
+ "writable": true
2577
+ },
2578
+ {
2579
+ "name": "mint",
2580
+ "writable": true
2581
+ },
2582
+ {
2583
+ "name": "signer_ata",
2584
+ "writable": true,
2585
+ "pda": {
2586
+ "seeds": [
2587
+ {
2588
+ "kind": "account",
2589
+ "path": "signer"
2590
+ },
2591
+ {
2592
+ "kind": "account",
2593
+ "path": "token_program"
2594
+ },
2595
+ {
2596
+ "kind": "account",
2597
+ "path": "mint"
2598
+ }
2599
+ ],
2600
+ "program": {
2601
+ "kind": "const",
2602
+ "value": [
2603
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
2604
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
2605
+ 219, 233, 248, 89
2606
+ ]
2607
+ }
2608
+ }
2609
+ },
2610
+ {
2611
+ "name": "claim_vault_ata",
2612
+ "writable": true,
2613
+ "pda": {
2614
+ "seeds": [
2615
+ {
2616
+ "kind": "account",
2617
+ "path": "claim_vault"
2618
+ },
2619
+ {
2620
+ "kind": "account",
2621
+ "path": "token_program"
2622
+ },
2623
+ {
2624
+ "kind": "account",
2625
+ "path": "mint"
2626
+ }
2627
+ ],
2628
+ "program": {
2629
+ "kind": "const",
2630
+ "value": [
2631
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
2632
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
2633
+ 219, 233, 248, 89
2634
+ ]
2635
+ }
2636
+ }
2637
+ },
2638
+ {
2639
+ "name": "token_program"
2640
+ },
2641
+ {
2642
+ "name": "associated_token_program",
2643
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
2644
+ },
2645
+ {
2646
+ "name": "system_program",
2647
+ "address": "11111111111111111111111111111111"
2648
+ }
2649
+ ],
2650
+ "args": [
2651
+ {
2652
+ "name": "args",
2653
+ "type": {
2654
+ "defined": {
2655
+ "name": "UpdateClaimVaultAmountArgs"
2656
+ }
2657
+ }
2658
+ }
2659
+ ]
2660
+ },
2525
2661
  {
2526
2662
  "name": "update_claim_vault_is_active",
2527
2663
  "discriminator": [122, 240, 207, 89, 71, 29, 176, 103],
@@ -4754,6 +4890,22 @@
4754
4890
  ]
4755
4891
  }
4756
4892
  },
4893
+ {
4894
+ "name": "UpdateClaimVaultAmountArgs",
4895
+ "type": {
4896
+ "kind": "struct",
4897
+ "fields": [
4898
+ {
4899
+ "name": "amount",
4900
+ "type": "u64"
4901
+ },
4902
+ {
4903
+ "name": "new_users",
4904
+ "type": "u64"
4905
+ }
4906
+ ]
4907
+ }
4908
+ },
4757
4909
  {
4758
4910
  "name": "UpdateCustomerFeeArgs",
4759
4911
  "type": {
@@ -4,6 +4,7 @@ export type RpcOptions = {
4
4
  microLamports?: number;
5
5
  computeBudget?: number;
6
6
  commitment?: Commitment;
7
+ payer?: PublicKey;
7
8
  };
8
9
  export type Pool = {
9
10
  address: string;
@@ -44,6 +45,8 @@ export type Market = {
44
45
  customer: string;
45
46
  poolId: number;
46
47
  feeRecipient: string;
48
+ marketOrderFeeAvailable: string;
49
+ marketOrderFeeClaimed: string;
47
50
  };
48
51
  export type UserTrade = {
49
52
  user: string;
@@ -224,6 +227,7 @@ export type PlaceBidOrderArgs = {
224
227
  orderDirection: OrderDirectionEncoded;
225
228
  }[];
226
229
  isTrdPayout: boolean;
230
+ feePayer: PublicKey;
227
231
  };
228
232
  export type PlaceAskOrderArgs = {
229
233
  marketId: number;
@@ -301,7 +305,6 @@ export type MarketBidOrderArgs = {
301
305
  marketId: number;
302
306
  amount: number;
303
307
  orderDirection: OrderDirectionEncoded;
304
- feeBps: number;
305
308
  isTrdPayout: boolean;
306
309
  };
307
310
  export type MarketAskOrderArgs = {
@@ -315,13 +318,6 @@ export type MarketAskOrderArgs = {
315
318
  isTrdPayout: boolean;
316
319
  feeBps: number;
317
320
  };
318
- export type CollectMarketFeeArgs = {
319
- markets: {
320
- marketAddress: PublicKey;
321
- customerId: number;
322
- customerFeeRecipient: PublicKey;
323
- }[];
324
- };
325
321
  export type CreateClaimVaultArgs = {
326
322
  totalAmount: number;
327
323
  totalUsers: number;
@@ -333,17 +329,32 @@ export type CreateClaimVaultArgs = {
333
329
  };
334
330
  export type ClaimTokenArgs = {
335
331
  amount: number;
336
- vaultName: string;
332
+ claimVaultName: string;
337
333
  mint: PublicKey;
338
- payer: PublicKey;
339
334
  claimData: ClaimData[];
340
335
  isFirstComeFirstServed: boolean;
341
336
  };
342
337
  export type UpdateClaimVaultIsActiveArgs = {
343
338
  isActive: boolean;
344
- claimVault: PublicKey;
339
+ claimVaultName: string;
345
340
  };
346
341
  export type UpdateClaimVaultMerkleRootArgs = {
347
342
  merkleRoot: number[];
348
- claimVault: PublicKey;
343
+ claimVaultName: string;
344
+ };
345
+ export type UpdateMarketWinningDirectionArgs = {
346
+ marketId: number;
347
+ poolId?: number;
348
+ winningDirection: WinningDirectionEncoded;
349
+ };
350
+ export type CloseOrderArgs = {
351
+ marketId: number;
352
+ orderId: number;
353
+ userNonce: number;
354
+ };
355
+ export type UpdateClaimVaultAmountArgs = {
356
+ amount: number;
357
+ newUsers: number;
358
+ claimVaultName: string;
359
+ mint: PublicKey;
349
360
  };
@@ -273,6 +273,11 @@ export type TriadProtocol = {
273
273
  writable: true;
274
274
  signer: true;
275
275
  },
276
+ {
277
+ name: 'payer';
278
+ writable: true;
279
+ signer: true;
280
+ },
276
281
  {
277
282
  name: 'market';
278
283
  writable: true;
@@ -804,6 +809,11 @@ export type TriadProtocol = {
804
809
  writable: true;
805
810
  signer: true;
806
811
  },
812
+ {
813
+ name: 'payer';
814
+ writable: true;
815
+ signer: true;
816
+ },
807
817
  {
808
818
  name: 'squads';
809
819
  writable: true;
@@ -1908,6 +1918,11 @@ export type TriadProtocol = {
1908
1918
  writable: true;
1909
1919
  signer: true;
1910
1920
  },
1921
+ {
1922
+ name: 'payer';
1923
+ writable: true;
1924
+ signer: true;
1925
+ },
1911
1926
  {
1912
1927
  name: 'userTrade';
1913
1928
  writable: true;
@@ -1961,6 +1976,11 @@ export type TriadProtocol = {
1961
1976
  writable: true;
1962
1977
  signer: true;
1963
1978
  },
1979
+ {
1980
+ name: 'payer';
1981
+ writable: true;
1982
+ signer: true;
1983
+ },
1964
1984
  {
1965
1985
  name: 'userTrade';
1966
1986
  writable: true;
@@ -1993,6 +2013,11 @@ export type TriadProtocol = {
1993
2013
  writable: true;
1994
2014
  signer: true;
1995
2015
  },
2016
+ {
2017
+ name: 'payer';
2018
+ writable: true;
2019
+ signer: true;
2020
+ },
1996
2021
  {
1997
2022
  name: 'market';
1998
2023
  writable: true;
@@ -2234,6 +2259,11 @@ export type TriadProtocol = {
2234
2259
  writable: true;
2235
2260
  signer: true;
2236
2261
  },
2262
+ {
2263
+ name: 'payer';
2264
+ writable: true;
2265
+ signer: true;
2266
+ },
2237
2267
  {
2238
2268
  name: 'market';
2239
2269
  writable: true;
@@ -2483,6 +2513,11 @@ export type TriadProtocol = {
2483
2513
  writable: true;
2484
2514
  signer: true;
2485
2515
  },
2516
+ {
2517
+ name: 'payer';
2518
+ writable: true;
2519
+ signer: true;
2520
+ },
2486
2521
  {
2487
2522
  name: 'squads';
2488
2523
  writable: true;
@@ -2647,6 +2682,11 @@ export type TriadProtocol = {
2647
2682
  writable: true;
2648
2683
  signer: true;
2649
2684
  },
2685
+ {
2686
+ name: 'payer';
2687
+ writable: true;
2688
+ signer: true;
2689
+ },
2650
2690
  {
2651
2691
  name: 'squads';
2652
2692
  writable: true;
@@ -3555,6 +3595,160 @@ export type TriadProtocol = {
3555
3595
  ];
3556
3596
  args: [];
3557
3597
  },
3598
+ {
3599
+ name: 'updateClaimVaultAmount';
3600
+ discriminator: [97, 2, 93, 198, 31, 248, 174, 52];
3601
+ accounts: [
3602
+ {
3603
+ name: 'signer';
3604
+ writable: true;
3605
+ signer: true;
3606
+ },
3607
+ {
3608
+ name: 'claimVault';
3609
+ writable: true;
3610
+ },
3611
+ {
3612
+ name: 'mint';
3613
+ writable: true;
3614
+ },
3615
+ {
3616
+ name: 'signerAta';
3617
+ writable: true;
3618
+ pda: {
3619
+ seeds: [
3620
+ {
3621
+ kind: 'account';
3622
+ path: 'signer';
3623
+ },
3624
+ {
3625
+ kind: 'account';
3626
+ path: 'tokenProgram';
3627
+ },
3628
+ {
3629
+ kind: 'account';
3630
+ path: 'mint';
3631
+ }
3632
+ ];
3633
+ program: {
3634
+ kind: 'const';
3635
+ value: [
3636
+ 140,
3637
+ 151,
3638
+ 37,
3639
+ 143,
3640
+ 78,
3641
+ 36,
3642
+ 137,
3643
+ 241,
3644
+ 187,
3645
+ 61,
3646
+ 16,
3647
+ 41,
3648
+ 20,
3649
+ 142,
3650
+ 13,
3651
+ 131,
3652
+ 11,
3653
+ 90,
3654
+ 19,
3655
+ 153,
3656
+ 218,
3657
+ 255,
3658
+ 16,
3659
+ 132,
3660
+ 4,
3661
+ 142,
3662
+ 123,
3663
+ 216,
3664
+ 219,
3665
+ 233,
3666
+ 248,
3667
+ 89
3668
+ ];
3669
+ };
3670
+ };
3671
+ },
3672
+ {
3673
+ name: 'claimVaultAta';
3674
+ writable: true;
3675
+ pda: {
3676
+ seeds: [
3677
+ {
3678
+ kind: 'account';
3679
+ path: 'claimVault';
3680
+ },
3681
+ {
3682
+ kind: 'account';
3683
+ path: 'tokenProgram';
3684
+ },
3685
+ {
3686
+ kind: 'account';
3687
+ path: 'mint';
3688
+ }
3689
+ ];
3690
+ program: {
3691
+ kind: 'const';
3692
+ value: [
3693
+ 140,
3694
+ 151,
3695
+ 37,
3696
+ 143,
3697
+ 78,
3698
+ 36,
3699
+ 137,
3700
+ 241,
3701
+ 187,
3702
+ 61,
3703
+ 16,
3704
+ 41,
3705
+ 20,
3706
+ 142,
3707
+ 13,
3708
+ 131,
3709
+ 11,
3710
+ 90,
3711
+ 19,
3712
+ 153,
3713
+ 218,
3714
+ 255,
3715
+ 16,
3716
+ 132,
3717
+ 4,
3718
+ 142,
3719
+ 123,
3720
+ 216,
3721
+ 219,
3722
+ 233,
3723
+ 248,
3724
+ 89
3725
+ ];
3726
+ };
3727
+ };
3728
+ },
3729
+ {
3730
+ name: 'tokenProgram';
3731
+ },
3732
+ {
3733
+ name: 'associatedTokenProgram';
3734
+ address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
3735
+ },
3736
+ {
3737
+ name: 'systemProgram';
3738
+ address: '11111111111111111111111111111111';
3739
+ }
3740
+ ];
3741
+ args: [
3742
+ {
3743
+ name: 'args';
3744
+ type: {
3745
+ defined: {
3746
+ name: 'updateClaimVaultAmountArgs';
3747
+ };
3748
+ };
3749
+ }
3750
+ ];
3751
+ },
3558
3752
  {
3559
3753
  name: 'updateClaimVaultIsActive';
3560
3754
  discriminator: [122, 240, 207, 89, 71, 29, 176, 103];
@@ -5799,6 +5993,22 @@ export type TriadProtocol = {
5799
5993
  ];
5800
5994
  };
5801
5995
  },
5996
+ {
5997
+ name: 'updateClaimVaultAmountArgs';
5998
+ type: {
5999
+ kind: 'struct';
6000
+ fields: [
6001
+ {
6002
+ name: 'amount';
6003
+ type: 'u64';
6004
+ },
6005
+ {
6006
+ name: 'newUsers';
6007
+ type: 'u64';
6008
+ }
6009
+ ];
6010
+ };
6011
+ },
5802
6012
  {
5803
6013
  name: 'updateCustomerFeeArgs';
5804
6014
  type: {
@@ -101,7 +101,9 @@ const formatMarket = (account, address) => {
101
101
  payoutFee: account.payoutFee,
102
102
  customer: account.customerId === 0 ? 'Triad' : account.customerId.toString(),
103
103
  poolId: account.poolId.toNumber(),
104
- feeRecipient: account.feeRecipient.toString()
104
+ feeRecipient: account.feeRecipient.toString(),
105
+ marketOrderFeeAvailable: account.marketOrderFeeAvailable.toString(),
106
+ marketOrderFeeClaimed: account.marketOrderFeeClaimed.toString()
105
107
  };
106
108
  };
107
109
  exports.formatMarket = formatMarket;
@@ -1,6 +1,6 @@
1
- import { TransactionInstruction, AddressLookupTableAccount } from '@solana/web3.js';
1
+ import { TransactionInstruction, VersionedTransaction, AddressLookupTableAccount } from '@solana/web3.js';
2
2
  import { Program } from '@coral-xyz/anchor';
3
3
  import { RpcOptions } from '../types';
4
4
  import { TriadProtocol } from '../types/triad_protocol';
5
- declare const sendVersionedTransaction: (program: Program<TriadProtocol>, ixs: TransactionInstruction[], options?: RpcOptions, addressLookupTableAccounts?: AddressLookupTableAccount[]) => Promise<string>;
5
+ declare const sendVersionedTransaction: (program: Program<TriadProtocol>, ixs: TransactionInstruction[], options?: RpcOptions, addressLookupTableAccounts?: AddressLookupTableAccount[]) => Promise<VersionedTransaction | string>;
6
6
  export default sendVersionedTransaction;
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const web3_js_1 = require("@solana/web3.js");
16
16
  const getPriorityFee_1 = __importDefault(require("./getPriorityFee"));
17
17
  const sendVersionedTransaction = (program, ixs, options, addressLookupTableAccounts) => __awaiter(void 0, void 0, void 0, function* () {
18
+ var _a;
18
19
  if (options === null || options === void 0 ? void 0 : options.microLamports) {
19
20
  ixs.push(web3_js_1.ComputeBudgetProgram.setComputeUnitPrice({
20
21
  microLamports: options.microLamports
@@ -27,6 +28,13 @@ const sendVersionedTransaction = (program, ixs, options, addressLookupTableAccou
27
28
  }));
28
29
  }
29
30
  const { blockhash } = yield program.provider.connection.getLatestBlockhash();
31
+ if (program.provider.publicKey.toBase58() !== ((_a = options === null || options === void 0 ? void 0 : options.payer) === null || _a === void 0 ? void 0 : _a.toBase58())) {
32
+ return new web3_js_1.VersionedTransaction(new web3_js_1.TransactionMessage({
33
+ instructions: ixs,
34
+ recentBlockhash: blockhash,
35
+ payerKey: options === null || options === void 0 ? void 0 : options.payer
36
+ }).compileToV0Message(addressLookupTableAccounts));
37
+ }
30
38
  return program.provider.sendAndConfirm(new web3_js_1.VersionedTransaction(new web3_js_1.TransactionMessage({
31
39
  instructions: ixs,
32
40
  recentBlockhash: blockhash,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "3.1.6-beta",
3
+ "version": "3.1.7-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",