@triadxyz/triad-protocol 1.4.2-beta → 1.4.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.js CHANGED
@@ -208,13 +208,14 @@ class TriadProtocolClient {
208
208
  */
209
209
  claimSpinToken(amount, verifier, options) {
210
210
  return __awaiter(this, void 0, void 0, function* () {
211
- const spinPDA = (0, pda_1.getSpinPDA)(this.program.programId, constants_1.SPIN_NAME);
212
211
  const ix = yield this.program.methods
213
- .claimSpinToken(new anchor_1.BN(amount))
212
+ .claimSpinToken({
213
+ name: constants_1.SPIN_NAME,
214
+ amount: new anchor_1.BN(amount * Math.pow(10, 6))
215
+ })
214
216
  .accounts({
215
217
  signer: this.provider.wallet.publicKey,
216
218
  verifier: verifier.publicKey,
217
- spin: spinPDA,
218
219
  mint: constants_1.TCMAS_MINT
219
220
  })
220
221
  .instruction();
@@ -435,6 +435,14 @@ const addSpinPrize = () => __awaiter(void 0, void 0, void 0, function* () {
435
435
  });
436
436
  console.log(response);
437
437
  });
438
+ const spinWheel = () => __awaiter(void 0, void 0, void 0, function* () {
439
+ const response = yield triadProtocol.spinWheel({
440
+ isSol: false,
441
+ prizeType: { none: {} },
442
+ verifier: keypair
443
+ });
444
+ console.log(response);
445
+ });
438
446
  const getSpinPrize = () => __awaiter(void 0, void 0, void 0, function* () {
439
447
  let response = yield triadProtocol.program.account.spin.fetch(new web3_js_1.PublicKey('EQ6ZJbdT2V8ZYcHRpJx6wBkGWmM1e3mimtPKshTVuw8h'));
440
448
  const prizes = response.prizes.map((prize) => ({
@@ -445,11 +453,4 @@ const getSpinPrize = () => __awaiter(void 0, void 0, void 0, function* () {
445
453
  }));
446
454
  console.log(prizes);
447
455
  });
448
- const spinWheel = () => __awaiter(void 0, void 0, void 0, function* () {
449
- const response = yield triadProtocol.spinWheel({
450
- isSol: false,
451
- prizeType: { none: {} },
452
- verifier: keypair
453
- });
454
- console.log(response);
455
- });
456
+ getSpinPrize();
@@ -161,7 +161,19 @@
161
161
  },
162
162
  {
163
163
  "name": "spin",
164
- "writable": true
164
+ "writable": true,
165
+ "pda": {
166
+ "seeds": [
167
+ {
168
+ "kind": "const",
169
+ "value": [115, 112, 105, 110]
170
+ },
171
+ {
172
+ "kind": "arg",
173
+ "path": "args.name"
174
+ }
175
+ ]
176
+ }
165
177
  },
166
178
  {
167
179
  "name": "mint",
@@ -238,8 +250,12 @@
238
250
  ],
239
251
  "args": [
240
252
  {
241
- "name": "amount",
242
- "type": "u64"
253
+ "name": "args",
254
+ "type": {
255
+ "defined": {
256
+ "name": "ClaimSpinTokenArgs"
257
+ }
258
+ }
243
259
  }
244
260
  ]
245
261
  },
@@ -1951,6 +1967,22 @@
1951
1967
  ]
1952
1968
  }
1953
1969
  },
1970
+ {
1971
+ "name": "ClaimSpinTokenArgs",
1972
+ "type": {
1973
+ "kind": "struct",
1974
+ "fields": [
1975
+ {
1976
+ "name": "name",
1977
+ "type": "string"
1978
+ },
1979
+ {
1980
+ "name": "amount",
1981
+ "type": "u64"
1982
+ }
1983
+ ]
1984
+ }
1985
+ },
1954
1986
  {
1955
1987
  "name": "ClaimSpinTokenUpdate",
1956
1988
  "type": {
@@ -226,6 +226,18 @@ export type TriadProtocol = {
226
226
  {
227
227
  name: 'spin';
228
228
  writable: true;
229
+ pda: {
230
+ seeds: [
231
+ {
232
+ kind: 'const';
233
+ value: [115, 112, 105, 110];
234
+ },
235
+ {
236
+ kind: 'arg';
237
+ path: 'args.name';
238
+ }
239
+ ];
240
+ };
229
241
  },
230
242
  {
231
243
  name: 'mint';
@@ -360,8 +372,12 @@ export type TriadProtocol = {
360
372
  ];
361
373
  args: [
362
374
  {
363
- name: 'amount';
364
- type: 'u64';
375
+ name: 'args';
376
+ type: {
377
+ defined: {
378
+ name: 'claimSpinTokenArgs';
379
+ };
380
+ };
365
381
  }
366
382
  ];
367
383
  },
@@ -2711,6 +2727,22 @@ export type TriadProtocol = {
2711
2727
  ];
2712
2728
  };
2713
2729
  },
2730
+ {
2731
+ name: 'claimSpinTokenArgs';
2732
+ type: {
2733
+ kind: 'struct';
2734
+ fields: [
2735
+ {
2736
+ name: 'name';
2737
+ type: 'string';
2738
+ },
2739
+ {
2740
+ name: 'amount';
2741
+ type: 'u64';
2742
+ }
2743
+ ];
2744
+ };
2745
+ },
2714
2746
  {
2715
2747
  name: 'claimSpinTokenUpdate';
2716
2748
  type: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.4.2-beta",
3
+ "version": "1.4.3-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",