@triadxyz/triad-protocol 1.3.9-beta → 1.4.1-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.d.ts +4 -1
- package/dist/index.js +13 -13
- package/dist/local-test.js +8 -0
- package/dist/types/idl_triad_protocol.json +55 -2
- package/dist/types/triad_protocol.d.ts +55 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -82,5 +82,8 @@ export default class TriadProtocolClient {
|
|
|
82
82
|
* @param verifier - Verifier keypair
|
|
83
83
|
* @param options - RPC options
|
|
84
84
|
*/
|
|
85
|
-
spinWheel(
|
|
85
|
+
spinWheel(args: {
|
|
86
|
+
isSol: boolean;
|
|
87
|
+
prizeType: PrizeType;
|
|
88
|
+
}, options?: RpcOptions): Promise<string>;
|
|
86
89
|
}
|
package/dist/index.js
CHANGED
|
@@ -227,21 +227,21 @@ class TriadProtocolClient {
|
|
|
227
227
|
* @param verifier - Verifier keypair
|
|
228
228
|
* @param options - RPC options
|
|
229
229
|
*/
|
|
230
|
-
spinWheel(
|
|
230
|
+
spinWheel(args, options) {
|
|
231
231
|
return __awaiter(this, void 0, void 0, function* () {
|
|
232
232
|
const spinPDA = (0, pda_1.getSpinPDA)(this.program.programId, constants_1.SPIN_NAME);
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
return (0,
|
|
233
|
+
const method = this.program.methods
|
|
234
|
+
.spinWheel({
|
|
235
|
+
isSol: args.isSol,
|
|
236
|
+
prizeType: args.prizeType
|
|
237
|
+
})
|
|
238
|
+
.accounts({
|
|
239
|
+
signer: this.provider.wallet.publicKey,
|
|
240
|
+
verifier: constants_1.VERIFIER,
|
|
241
|
+
spin: spinPDA,
|
|
242
|
+
mint: constants_1.TCMAS_MINT
|
|
243
|
+
});
|
|
244
|
+
return (0, sendTransactionWithOptions_1.default)(method, options);
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
}
|
package/dist/local-test.js
CHANGED
|
@@ -445,3 +445,11 @@ const getSpinPrize = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
445
445
|
}));
|
|
446
446
|
console.log(prizes);
|
|
447
447
|
});
|
|
448
|
+
const spinWheel = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
449
|
+
const response = yield triadProtocol.spinWheel({
|
|
450
|
+
isSol: false,
|
|
451
|
+
prizeType: { none: {} }
|
|
452
|
+
});
|
|
453
|
+
console.log(response);
|
|
454
|
+
});
|
|
455
|
+
spinWheel();
|
|
@@ -1239,6 +1239,11 @@
|
|
|
1239
1239
|
"writable": true,
|
|
1240
1240
|
"signer": true
|
|
1241
1241
|
},
|
|
1242
|
+
{
|
|
1243
|
+
"name": "verifier",
|
|
1244
|
+
"writable": true,
|
|
1245
|
+
"signer": true
|
|
1246
|
+
},
|
|
1242
1247
|
{
|
|
1243
1248
|
"name": "tresuary_account",
|
|
1244
1249
|
"writable": true,
|
|
@@ -1323,8 +1328,12 @@
|
|
|
1323
1328
|
],
|
|
1324
1329
|
"args": [
|
|
1325
1330
|
{
|
|
1326
|
-
"name": "
|
|
1327
|
-
"type":
|
|
1331
|
+
"name": "args",
|
|
1332
|
+
"type": {
|
|
1333
|
+
"defined": {
|
|
1334
|
+
"name": "SpinWheelArgs"
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1328
1337
|
}
|
|
1329
1338
|
],
|
|
1330
1339
|
"returns": {
|
|
@@ -1711,6 +1720,10 @@
|
|
|
1711
1720
|
}
|
|
1712
1721
|
],
|
|
1713
1722
|
"events": [
|
|
1723
|
+
{
|
|
1724
|
+
"name": "ClaimSpinTokenUpdate",
|
|
1725
|
+
"discriminator": [162, 70, 212, 35, 0, 49, 120, 75]
|
|
1726
|
+
},
|
|
1714
1727
|
{
|
|
1715
1728
|
"name": "MarketUpdate",
|
|
1716
1729
|
"discriminator": [170, 101, 124, 32, 249, 253, 251, 96]
|
|
@@ -1938,6 +1951,26 @@
|
|
|
1938
1951
|
]
|
|
1939
1952
|
}
|
|
1940
1953
|
},
|
|
1954
|
+
{
|
|
1955
|
+
"name": "ClaimSpinTokenUpdate",
|
|
1956
|
+
"type": {
|
|
1957
|
+
"kind": "struct",
|
|
1958
|
+
"fields": [
|
|
1959
|
+
{
|
|
1960
|
+
"name": "player",
|
|
1961
|
+
"type": "pubkey"
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
"name": "amount",
|
|
1965
|
+
"type": "u64"
|
|
1966
|
+
},
|
|
1967
|
+
{
|
|
1968
|
+
"name": "timestamp",
|
|
1969
|
+
"type": "i64"
|
|
1970
|
+
}
|
|
1971
|
+
]
|
|
1972
|
+
}
|
|
1973
|
+
},
|
|
1941
1974
|
{
|
|
1942
1975
|
"name": "ClaimStakeRewardsArgs",
|
|
1943
1976
|
"type": {
|
|
@@ -2970,6 +3003,26 @@
|
|
|
2970
3003
|
]
|
|
2971
3004
|
}
|
|
2972
3005
|
},
|
|
3006
|
+
{
|
|
3007
|
+
"name": "SpinWheelArgs",
|
|
3008
|
+
"type": {
|
|
3009
|
+
"kind": "struct",
|
|
3010
|
+
"fields": [
|
|
3011
|
+
{
|
|
3012
|
+
"name": "is_sol",
|
|
3013
|
+
"type": "bool"
|
|
3014
|
+
},
|
|
3015
|
+
{
|
|
3016
|
+
"name": "prize_type",
|
|
3017
|
+
"type": {
|
|
3018
|
+
"defined": {
|
|
3019
|
+
"name": "PrizeType"
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
]
|
|
3024
|
+
}
|
|
3025
|
+
},
|
|
2973
3026
|
{
|
|
2974
3027
|
"name": "SpinWheelResult",
|
|
2975
3028
|
"type": {
|
|
@@ -1767,6 +1767,11 @@ export type TriadProtocol = {
|
|
|
1767
1767
|
writable: true;
|
|
1768
1768
|
signer: true;
|
|
1769
1769
|
},
|
|
1770
|
+
{
|
|
1771
|
+
name: 'verifier';
|
|
1772
|
+
writable: true;
|
|
1773
|
+
signer: true;
|
|
1774
|
+
},
|
|
1770
1775
|
{
|
|
1771
1776
|
name: 'tresuaryAccount';
|
|
1772
1777
|
writable: true;
|
|
@@ -1909,8 +1914,12 @@ export type TriadProtocol = {
|
|
|
1909
1914
|
];
|
|
1910
1915
|
args: [
|
|
1911
1916
|
{
|
|
1912
|
-
name: '
|
|
1913
|
-
type:
|
|
1917
|
+
name: 'args';
|
|
1918
|
+
type: {
|
|
1919
|
+
defined: {
|
|
1920
|
+
name: 'spinWheelArgs';
|
|
1921
|
+
};
|
|
1922
|
+
};
|
|
1914
1923
|
}
|
|
1915
1924
|
];
|
|
1916
1925
|
returns: {
|
|
@@ -2471,6 +2480,10 @@ export type TriadProtocol = {
|
|
|
2471
2480
|
}
|
|
2472
2481
|
];
|
|
2473
2482
|
events: [
|
|
2483
|
+
{
|
|
2484
|
+
name: 'claimSpinTokenUpdate';
|
|
2485
|
+
discriminator: [162, 70, 212, 35, 0, 49, 120, 75];
|
|
2486
|
+
},
|
|
2474
2487
|
{
|
|
2475
2488
|
name: 'marketUpdate';
|
|
2476
2489
|
discriminator: [170, 101, 124, 32, 249, 253, 251, 96];
|
|
@@ -2698,6 +2711,26 @@ export type TriadProtocol = {
|
|
|
2698
2711
|
];
|
|
2699
2712
|
};
|
|
2700
2713
|
},
|
|
2714
|
+
{
|
|
2715
|
+
name: 'claimSpinTokenUpdate';
|
|
2716
|
+
type: {
|
|
2717
|
+
kind: 'struct';
|
|
2718
|
+
fields: [
|
|
2719
|
+
{
|
|
2720
|
+
name: 'player';
|
|
2721
|
+
type: 'pubkey';
|
|
2722
|
+
},
|
|
2723
|
+
{
|
|
2724
|
+
name: 'amount';
|
|
2725
|
+
type: 'u64';
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
name: 'timestamp';
|
|
2729
|
+
type: 'i64';
|
|
2730
|
+
}
|
|
2731
|
+
];
|
|
2732
|
+
};
|
|
2733
|
+
},
|
|
2701
2734
|
{
|
|
2702
2735
|
name: 'claimStakeRewardsArgs';
|
|
2703
2736
|
type: {
|
|
@@ -3726,6 +3759,26 @@ export type TriadProtocol = {
|
|
|
3726
3759
|
];
|
|
3727
3760
|
};
|
|
3728
3761
|
},
|
|
3762
|
+
{
|
|
3763
|
+
name: 'spinWheelArgs';
|
|
3764
|
+
type: {
|
|
3765
|
+
kind: 'struct';
|
|
3766
|
+
fields: [
|
|
3767
|
+
{
|
|
3768
|
+
name: 'isSol';
|
|
3769
|
+
type: 'bool';
|
|
3770
|
+
},
|
|
3771
|
+
{
|
|
3772
|
+
name: 'prizeType';
|
|
3773
|
+
type: {
|
|
3774
|
+
defined: {
|
|
3775
|
+
name: 'prizeType';
|
|
3776
|
+
};
|
|
3777
|
+
};
|
|
3778
|
+
}
|
|
3779
|
+
];
|
|
3780
|
+
};
|
|
3781
|
+
},
|
|
3729
3782
|
{
|
|
3730
3783
|
name: 'spinWheelResult';
|
|
3731
3784
|
type: {
|