@triadxyz/triad-protocol 3.2.9-beta → 3.3.0-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/claim.d.ts CHANGED
@@ -49,7 +49,7 @@ export default class Claim {
49
49
  * @param claimVaultName - Claim vault name
50
50
  * @param mint - Mint
51
51
  */
52
- updateClaimVaultAmount({ amount, newUsers, claimVaultName, mint, merkleRoot }: UpdateClaimVaultAmountArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
52
+ updateClaimVaultAmount({ amount, newUsers, claimVaultName, mint, claimData }: UpdateClaimVaultAmountArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
53
53
  /**
54
54
  * Update Claim Vault End Ts
55
55
  * @param endTs - End ts
package/dist/claim.js CHANGED
@@ -94,7 +94,11 @@ class Claim {
94
94
  */
95
95
  createClaimVault({ totalAmount, totalUsers, name, isFirstComeFirstServed, endTs, claimData, mint }) {
96
96
  return __awaiter(this, void 0, void 0, function* () {
97
- const { merkleRoot } = (0, merkle_1.generateMerkleTree)(claimData);
97
+ let merkleRoot = null;
98
+ if (claimData) {
99
+ const { merkleRoot: root } = (0, merkle_1.generateMerkleTree)(claimData);
100
+ merkleRoot = root;
101
+ }
98
102
  const ixs = [
99
103
  yield this.program.methods
100
104
  .createClaimVault({
@@ -141,8 +145,13 @@ class Claim {
141
145
  * @param claimVaultName - Claim vault name
142
146
  * @param mint - Mint
143
147
  */
144
- updateClaimVaultAmount({ amount, newUsers, claimVaultName, mint, merkleRoot }) {
148
+ updateClaimVaultAmount({ amount, newUsers, claimVaultName, mint, claimData }) {
145
149
  return __awaiter(this, void 0, void 0, function* () {
150
+ let merkleRoot = null;
151
+ if (claimData) {
152
+ const { merkleRoot: root } = (0, merkle_1.generateMerkleTree)(claimData);
153
+ merkleRoot = root;
154
+ }
146
155
  const ixs = [
147
156
  yield this.program.methods
148
157
  .updateClaimVaultAmount({
@@ -351,7 +351,7 @@ export type UpdateClaimVaultAmountArgs = {
351
351
  newUsers: number;
352
352
  claimVaultName: string;
353
353
  mint: PublicKey;
354
- merkleRoot: number[];
354
+ claimData: ClaimData[];
355
355
  };
356
356
  export type UpdateClaimVaultEndTsArgs = {
357
357
  endTs: number;
@@ -9,7 +9,7 @@ export declare const swap: ({ connection, wallet, inToken, outToken, amount, pay
9
9
  }) => Promise<{
10
10
  swapIxs: TransactionInstruction[];
11
11
  addressLookupTableAccounts: AddressLookupTableAccount[];
12
- setupInstructions: TransactionInstruction[];
12
+ setupInstructions: any[];
13
13
  outAmount: any;
14
14
  }>;
15
15
  export declare const getPrice: (token: string) => Promise<any>;
@@ -37,7 +37,7 @@ const swap = ({ connection, wallet, inToken, outToken, amount, payer }) => __awa
37
37
  swapIxs: [deserializeInstruction(swapInstruction)],
38
38
  addressLookupTableAccounts: yield getAddressLookupTableAccounts(connection, addressLookupTableAddresses),
39
39
  setupInstructions: setupInstructions.length > 0
40
- ? [deserializeInstruction(setupInstructions)]
40
+ ? [...setupInstructions.map(deserializeInstruction)]
41
41
  : [],
42
42
  outAmount: quoteData.otherAmountThreshold
43
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "3.2.9-beta",
3
+ "version": "3.3.0-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",