@triadxyz/triad-protocol 1.4.4-beta → 1.4.6-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 +6 -1
- package/dist/local-test.js +73 -74
- package/dist/stake.d.ts +1 -1
- package/dist/stake.js +3 -7
- package/dist/types/idl_triad_protocol.json +23 -3
- package/dist/types/stake.d.ts +1 -3
- package/dist/types/triad_protocol.d.ts +23 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -273,7 +273,12 @@ class TriadProtocolClient {
|
|
|
273
273
|
*/
|
|
274
274
|
buyToken(amount, options) {
|
|
275
275
|
return __awaiter(this, void 0, void 0, function* () {
|
|
276
|
-
const method = this.program.methods
|
|
276
|
+
const method = this.program.methods
|
|
277
|
+
.buyToken({
|
|
278
|
+
name: constants_1.SPIN_NAME,
|
|
279
|
+
amount: new anchor_1.BN(amount)
|
|
280
|
+
})
|
|
281
|
+
.accounts({
|
|
277
282
|
signer: this.provider.wallet.publicKey,
|
|
278
283
|
mint: constants_1.TCMAS_MINT
|
|
279
284
|
});
|
package/dist/local-test.js
CHANGED
|
@@ -428,78 +428,78 @@ const getMinteds = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
428
428
|
// ];
|
|
429
429
|
const addSpinPrize = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
430
430
|
const data = [
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
431
|
+
// {
|
|
432
|
+
// rangeMin: 1,
|
|
433
|
+
// rangeMax: 9,
|
|
434
|
+
// prizeType: { trd10000: {} },
|
|
435
|
+
// availableQuantity: 1
|
|
436
|
+
// },
|
|
437
|
+
// {
|
|
438
|
+
// rangeMin: 10,
|
|
439
|
+
// rangeMax: 15,
|
|
440
|
+
// prizeType: { undead: {} },
|
|
441
|
+
// availableQuantity: 1
|
|
442
|
+
// },
|
|
443
|
+
// {
|
|
444
|
+
// rangeMin: 16,
|
|
445
|
+
// rangeMax: 116,
|
|
446
|
+
// prizeType: { ticket: {} },
|
|
447
|
+
// availableQuantity: 2
|
|
448
|
+
// }
|
|
449
|
+
// {
|
|
450
|
+
// rangeMin: 117,
|
|
451
|
+
// rangeMax: 617,
|
|
452
|
+
// prizeType: { honeyland: {} },
|
|
453
|
+
// availableQuantity: 2
|
|
454
|
+
// }
|
|
455
|
+
// {
|
|
456
|
+
// rangeMin: 618,
|
|
457
|
+
// rangeMax: 5618,
|
|
458
|
+
// prizeType: { trd50: {} },
|
|
459
|
+
// availableQuantity: 100
|
|
460
|
+
// },
|
|
461
|
+
// {
|
|
462
|
+
// rangeMin: 5619,
|
|
463
|
+
// rangeMax: 15619,
|
|
464
|
+
// prizeType: { flip: {} },
|
|
465
|
+
// availableQuantity: 30
|
|
466
|
+
// }
|
|
467
|
+
// {
|
|
468
|
+
// rangeMin: 15620,
|
|
469
|
+
// rangeMax: 25620,
|
|
470
|
+
// prizeType: { pengu: {} },
|
|
471
|
+
// availableQuantity: 100
|
|
472
|
+
// }
|
|
473
|
+
// {
|
|
474
|
+
// rangeMin: 25621,
|
|
475
|
+
// rangeMax: 65621,
|
|
476
|
+
// prizeType: { ore: {} },
|
|
477
|
+
// availableQuantity: 200
|
|
478
|
+
// }
|
|
479
|
+
// {
|
|
480
|
+
// rangeMin: 65622,
|
|
481
|
+
// rangeMax: 165622,
|
|
482
|
+
// prizeType: { lucksea: {} },
|
|
483
|
+
// availableQuantity: 2000
|
|
484
|
+
// },
|
|
485
|
+
// {
|
|
486
|
+
// rangeMin: 165623,
|
|
487
|
+
// rangeMax: 285623,
|
|
488
|
+
// prizeType: { trd5: {} },
|
|
489
|
+
// availableQuantity: 10000
|
|
490
|
+
// },
|
|
491
|
+
// {
|
|
492
|
+
// rangeMin: 285624,
|
|
493
|
+
// rangeMax: 499999,
|
|
494
|
+
// prizeType: { trident2000: {} },
|
|
495
|
+
// availableQuantity: 5000000
|
|
496
|
+
// },
|
|
497
|
+
// {
|
|
498
|
+
// rangeMin: 500000,
|
|
499
|
+
// rangeMax: 1000000,
|
|
500
|
+
// prizeType: { trident500: {} },
|
|
501
|
+
// availableQuantity: 5000000
|
|
502
|
+
// }
|
|
503
503
|
];
|
|
504
504
|
for (const item of data) {
|
|
505
505
|
const response = yield triadProtocol.addSpinPrize(item);
|
|
@@ -522,6 +522,5 @@ const getSpinPrize = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
522
522
|
prizeType: prize.prizeType,
|
|
523
523
|
availableQuantity: prize.availableQuantity.toNumber()
|
|
524
524
|
}));
|
|
525
|
-
console.log(prizes);
|
|
525
|
+
console.log(prizes.filter((prize) => !prize.prizeType.none));
|
|
526
526
|
});
|
|
527
|
-
getSpinPrize();
|
package/dist/stake.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export default class Stake {
|
|
|
15
15
|
/**
|
|
16
16
|
* Get Stake Rewards
|
|
17
17
|
*/
|
|
18
|
-
getStakeRewards({
|
|
18
|
+
getStakeRewards({ stake, collections }: ClaimStakeRewardsArgs): Promise<number>;
|
|
19
19
|
/**
|
|
20
20
|
* Get all Stakes
|
|
21
21
|
*/
|
package/dist/stake.js
CHANGED
|
@@ -38,11 +38,9 @@ class Stake {
|
|
|
38
38
|
/**
|
|
39
39
|
* Get Stake Rewards
|
|
40
40
|
*/
|
|
41
|
-
getStakeRewards({
|
|
41
|
+
getStakeRewards({ stake, collections }) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
|
|
44
|
-
const stake = yield this.program.account.stakeV2.fetch(stakePDA);
|
|
45
|
-
return (0, helpers_1.calculateStakeRewards)((0, helpers_1.formatStake)(stake), collections);
|
|
43
|
+
return (0, helpers_1.calculateStakeRewards)(stake, collections);
|
|
46
44
|
});
|
|
47
45
|
}
|
|
48
46
|
/**
|
|
@@ -84,9 +82,7 @@ class Stake {
|
|
|
84
82
|
let available = 0;
|
|
85
83
|
try {
|
|
86
84
|
available = yield this.getStakeRewards({
|
|
87
|
-
|
|
88
|
-
nftName: stake.name,
|
|
89
|
-
rank: 963,
|
|
85
|
+
stake,
|
|
90
86
|
collections
|
|
91
87
|
});
|
|
92
88
|
}
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
"kind": "arg",
|
|
168
|
-
"path": "name"
|
|
168
|
+
"path": "args.name"
|
|
169
169
|
}
|
|
170
170
|
]
|
|
171
171
|
}
|
|
@@ -250,8 +250,12 @@
|
|
|
250
250
|
],
|
|
251
251
|
"args": [
|
|
252
252
|
{
|
|
253
|
-
"name": "
|
|
254
|
-
"type":
|
|
253
|
+
"name": "args",
|
|
254
|
+
"type": {
|
|
255
|
+
"defined": {
|
|
256
|
+
"name": "BuyTokenArgs"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
255
259
|
}
|
|
256
260
|
]
|
|
257
261
|
},
|
|
@@ -2077,6 +2081,22 @@
|
|
|
2077
2081
|
]
|
|
2078
2082
|
}
|
|
2079
2083
|
},
|
|
2084
|
+
{
|
|
2085
|
+
"name": "BuyTokenArgs",
|
|
2086
|
+
"type": {
|
|
2087
|
+
"kind": "struct",
|
|
2088
|
+
"fields": [
|
|
2089
|
+
{
|
|
2090
|
+
"name": "name",
|
|
2091
|
+
"type": "string"
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
"name": "amount",
|
|
2095
|
+
"type": "u64"
|
|
2096
|
+
}
|
|
2097
|
+
]
|
|
2098
|
+
}
|
|
2099
|
+
},
|
|
2080
2100
|
{
|
|
2081
2101
|
"name": "ClaimSpinTokenArgs",
|
|
2082
2102
|
"type": {
|
package/dist/types/stake.d.ts
CHANGED
|
@@ -37,10 +37,8 @@ export type WithdrawArgs = {
|
|
|
37
37
|
mint: PublicKey;
|
|
38
38
|
};
|
|
39
39
|
export type ClaimStakeRewardsArgs = {
|
|
40
|
-
|
|
41
|
-
nftName: string;
|
|
40
|
+
stake: Stake;
|
|
42
41
|
collections: number;
|
|
43
|
-
rank: number;
|
|
44
42
|
};
|
|
45
43
|
export type UpdateBoostArgs = {
|
|
46
44
|
wallet: PublicKey;
|
|
@@ -229,7 +229,7 @@ export type TriadProtocol = {
|
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
231
|
kind: 'arg';
|
|
232
|
-
path: 'name';
|
|
232
|
+
path: 'args.name';
|
|
233
233
|
}
|
|
234
234
|
];
|
|
235
235
|
};
|
|
@@ -372,8 +372,12 @@ export type TriadProtocol = {
|
|
|
372
372
|
];
|
|
373
373
|
args: [
|
|
374
374
|
{
|
|
375
|
-
name: '
|
|
376
|
-
type:
|
|
375
|
+
name: 'args';
|
|
376
|
+
type: {
|
|
377
|
+
defined: {
|
|
378
|
+
name: 'buyTokenArgs';
|
|
379
|
+
};
|
|
380
|
+
};
|
|
377
381
|
}
|
|
378
382
|
];
|
|
379
383
|
},
|
|
@@ -2895,6 +2899,22 @@ export type TriadProtocol = {
|
|
|
2895
2899
|
];
|
|
2896
2900
|
};
|
|
2897
2901
|
},
|
|
2902
|
+
{
|
|
2903
|
+
name: 'buyTokenArgs';
|
|
2904
|
+
type: {
|
|
2905
|
+
kind: 'struct';
|
|
2906
|
+
fields: [
|
|
2907
|
+
{
|
|
2908
|
+
name: 'name';
|
|
2909
|
+
type: 'string';
|
|
2910
|
+
},
|
|
2911
|
+
{
|
|
2912
|
+
name: 'amount';
|
|
2913
|
+
type: 'u64';
|
|
2914
|
+
}
|
|
2915
|
+
];
|
|
2916
|
+
};
|
|
2917
|
+
},
|
|
2898
2918
|
{
|
|
2899
2919
|
name: 'claimSpinTokenArgs';
|
|
2900
2920
|
type: {
|