@triadxyz/triad-protocol 3.1.6-beta → 3.1.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.
@@ -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];
@@ -3937,6 +4131,10 @@ export type TriadProtocol = {
3937
4131
  name: 'claimTokenEvent';
3938
4132
  discriminator: [127, 10, 14, 49, 47, 171, 31, 127];
3939
4133
  },
4134
+ {
4135
+ name: 'claimVaultEvent';
4136
+ discriminator: [106, 57, 180, 175, 87, 6, 132, 91];
4137
+ },
3940
4138
  {
3941
4139
  name: 'collectMarketFeeEvent';
3942
4140
  discriminator: [210, 147, 203, 216, 158, 111, 59, 143];
@@ -4472,6 +4670,68 @@ export type TriadProtocol = {
4472
4670
  ];
4473
4671
  };
4474
4672
  },
4673
+ {
4674
+ name: 'claimVaultEvent';
4675
+ type: {
4676
+ kind: 'struct';
4677
+ fields: [
4678
+ {
4679
+ name: 'authority';
4680
+ type: 'pubkey';
4681
+ },
4682
+ {
4683
+ name: 'initTs';
4684
+ type: 'i64';
4685
+ },
4686
+ {
4687
+ name: 'endTs';
4688
+ type: 'i64';
4689
+ },
4690
+ {
4691
+ name: 'totalAmount';
4692
+ type: 'u64';
4693
+ },
4694
+ {
4695
+ name: 'totalClaimed';
4696
+ type: 'u64';
4697
+ },
4698
+ {
4699
+ name: 'totalUsers';
4700
+ type: 'u64';
4701
+ },
4702
+ {
4703
+ name: 'claimedUsers';
4704
+ type: 'u64';
4705
+ },
4706
+ {
4707
+ name: 'tokenPerUser';
4708
+ type: 'u64';
4709
+ },
4710
+ {
4711
+ name: 'mint';
4712
+ type: 'pubkey';
4713
+ },
4714
+ {
4715
+ name: 'isActive';
4716
+ type: 'bool';
4717
+ },
4718
+ {
4719
+ name: 'name';
4720
+ type: 'string';
4721
+ },
4722
+ {
4723
+ name: 'isFirstComeFirstServed';
4724
+ type: 'bool';
4725
+ },
4726
+ {
4727
+ name: 'merkleRoot';
4728
+ type: {
4729
+ array: ['u8', 32];
4730
+ };
4731
+ }
4732
+ ];
4733
+ };
4734
+ },
4475
4735
  {
4476
4736
  name: 'claimedUser';
4477
4737
  type: {
@@ -5799,6 +6059,22 @@ export type TriadProtocol = {
5799
6059
  ];
5800
6060
  };
5801
6061
  },
6062
+ {
6063
+ name: 'updateClaimVaultAmountArgs';
6064
+ type: {
6065
+ kind: 'struct';
6066
+ fields: [
6067
+ {
6068
+ name: 'amount';
6069
+ type: 'u64';
6070
+ },
6071
+ {
6072
+ name: 'newUsers';
6073
+ type: 'u64';
6074
+ }
6075
+ ];
6076
+ };
6077
+ },
5802
6078
  {
5803
6079
  name: 'updateCustomerFeeArgs';
5804
6080
  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.8-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",