@triadxyz/poseidons-protocol 0.3.2 → 0.3.4
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/game/wheel.js
CHANGED
|
@@ -106,13 +106,15 @@ class Wheel {
|
|
|
106
106
|
var _a, _b;
|
|
107
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
108
|
const userPDA = (0, pda_1.getUserPDA)(user);
|
|
109
|
+
const wheelPDA = (0, pda_1.getWheelPDA)(id);
|
|
109
110
|
const instructions = [];
|
|
110
111
|
for (let i = 0; i < spins; i++) {
|
|
111
112
|
instructions.push(yield this.program.methods
|
|
112
|
-
.spinWheel(
|
|
113
|
+
.spinWheel()
|
|
113
114
|
.accounts({
|
|
114
115
|
signer: this.program.provider.publicKey,
|
|
115
|
-
user: userPDA
|
|
116
|
+
user: userPDA,
|
|
117
|
+
wheel: wheelPDA
|
|
116
118
|
})
|
|
117
119
|
.instruction());
|
|
118
120
|
}
|
|
@@ -140,11 +142,13 @@ class Wheel {
|
|
|
140
142
|
*/
|
|
141
143
|
closeWheel(id) {
|
|
142
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const wheelPDA = (0, pda_1.getWheelPDA)(id);
|
|
143
146
|
const instructions = [
|
|
144
147
|
yield this.program.methods
|
|
145
|
-
.closeWheel(
|
|
148
|
+
.closeWheel()
|
|
146
149
|
.accounts({
|
|
147
|
-
signer: this.program.provider.publicKey
|
|
150
|
+
signer: this.program.provider.publicKey,
|
|
151
|
+
wheel: wheelPDA
|
|
148
152
|
})
|
|
149
153
|
.instruction()
|
|
150
154
|
];
|
|
@@ -553,31 +553,14 @@
|
|
|
553
553
|
},
|
|
554
554
|
{
|
|
555
555
|
"name": "wheel",
|
|
556
|
-
"writable": true
|
|
557
|
-
"pda": {
|
|
558
|
-
"seeds": [
|
|
559
|
-
{
|
|
560
|
-
"kind": "const",
|
|
561
|
-
"value": [119, 104, 101, 101, 108]
|
|
562
|
-
},
|
|
563
|
-
{
|
|
564
|
-
"kind": "arg",
|
|
565
|
-
"path": "id"
|
|
566
|
-
}
|
|
567
|
-
]
|
|
568
|
-
}
|
|
556
|
+
"writable": true
|
|
569
557
|
},
|
|
570
558
|
{
|
|
571
559
|
"name": "system_program",
|
|
572
560
|
"address": "11111111111111111111111111111111"
|
|
573
561
|
}
|
|
574
562
|
],
|
|
575
|
-
"args": [
|
|
576
|
-
{
|
|
577
|
-
"name": "id",
|
|
578
|
-
"type": "u8"
|
|
579
|
-
}
|
|
580
|
-
]
|
|
563
|
+
"args": []
|
|
581
564
|
},
|
|
582
565
|
{
|
|
583
566
|
"name": "create_chest",
|
|
@@ -913,6 +896,38 @@
|
|
|
913
896
|
}
|
|
914
897
|
]
|
|
915
898
|
},
|
|
899
|
+
{
|
|
900
|
+
"name": "send_core_nft",
|
|
901
|
+
"discriminator": [126, 77, 224, 79, 238, 78, 141, 32],
|
|
902
|
+
"accounts": [
|
|
903
|
+
{
|
|
904
|
+
"name": "signer",
|
|
905
|
+
"writable": true,
|
|
906
|
+
"signer": true
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
"name": "system_program",
|
|
910
|
+
"address": "11111111111111111111111111111111"
|
|
911
|
+
}
|
|
912
|
+
],
|
|
913
|
+
"args": []
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"name": "send_token",
|
|
917
|
+
"discriminator": [157, 183, 177, 53, 196, 251, 54, 185],
|
|
918
|
+
"accounts": [
|
|
919
|
+
{
|
|
920
|
+
"name": "signer",
|
|
921
|
+
"writable": true,
|
|
922
|
+
"signer": true
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
"name": "system_program",
|
|
926
|
+
"address": "11111111111111111111111111111111"
|
|
927
|
+
}
|
|
928
|
+
],
|
|
929
|
+
"args": []
|
|
930
|
+
},
|
|
916
931
|
{
|
|
917
932
|
"name": "spin_wheel",
|
|
918
933
|
"discriminator": [25, 214, 214, 83, 131, 150, 190, 91],
|
|
@@ -924,19 +939,7 @@
|
|
|
924
939
|
},
|
|
925
940
|
{
|
|
926
941
|
"name": "wheel",
|
|
927
|
-
"writable": true
|
|
928
|
-
"pda": {
|
|
929
|
-
"seeds": [
|
|
930
|
-
{
|
|
931
|
-
"kind": "const",
|
|
932
|
-
"value": [119, 104, 101, 101, 108]
|
|
933
|
-
},
|
|
934
|
-
{
|
|
935
|
-
"kind": "arg",
|
|
936
|
-
"path": "id"
|
|
937
|
-
}
|
|
938
|
-
]
|
|
939
|
-
}
|
|
942
|
+
"writable": true
|
|
940
943
|
},
|
|
941
944
|
{
|
|
942
945
|
"name": "user",
|
|
@@ -947,12 +950,7 @@
|
|
|
947
950
|
"address": "11111111111111111111111111111111"
|
|
948
951
|
}
|
|
949
952
|
],
|
|
950
|
-
"args": [
|
|
951
|
-
{
|
|
952
|
-
"name": "id",
|
|
953
|
-
"type": "u8"
|
|
954
|
-
}
|
|
955
|
-
],
|
|
953
|
+
"args": [],
|
|
956
954
|
"returns": "u8"
|
|
957
955
|
}
|
|
958
956
|
],
|
|
@@ -1797,7 +1795,7 @@
|
|
|
1797
1795
|
"kind": "struct",
|
|
1798
1796
|
"fields": [
|
|
1799
1797
|
{
|
|
1800
|
-
"name": "
|
|
1798
|
+
"name": "authority",
|
|
1801
1799
|
"type": "pubkey"
|
|
1802
1800
|
},
|
|
1803
1801
|
{
|
|
@@ -729,30 +729,13 @@ export type PoseidonsProtocol = {
|
|
|
729
729
|
{
|
|
730
730
|
name: 'wheel';
|
|
731
731
|
writable: true;
|
|
732
|
-
pda: {
|
|
733
|
-
seeds: [
|
|
734
|
-
{
|
|
735
|
-
kind: 'const';
|
|
736
|
-
value: [119, 104, 101, 101, 108];
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
kind: 'arg';
|
|
740
|
-
path: 'id';
|
|
741
|
-
}
|
|
742
|
-
];
|
|
743
|
-
};
|
|
744
732
|
},
|
|
745
733
|
{
|
|
746
734
|
name: 'systemProgram';
|
|
747
735
|
address: '11111111111111111111111111111111';
|
|
748
736
|
}
|
|
749
737
|
];
|
|
750
|
-
args: [
|
|
751
|
-
{
|
|
752
|
-
name: 'id';
|
|
753
|
-
type: 'u8';
|
|
754
|
-
}
|
|
755
|
-
];
|
|
738
|
+
args: [];
|
|
756
739
|
},
|
|
757
740
|
{
|
|
758
741
|
name: 'createChest';
|
|
@@ -1204,6 +1187,38 @@ export type PoseidonsProtocol = {
|
|
|
1204
1187
|
}
|
|
1205
1188
|
];
|
|
1206
1189
|
},
|
|
1190
|
+
{
|
|
1191
|
+
name: 'sendCoreNft';
|
|
1192
|
+
discriminator: [126, 77, 224, 79, 238, 78, 141, 32];
|
|
1193
|
+
accounts: [
|
|
1194
|
+
{
|
|
1195
|
+
name: 'signer';
|
|
1196
|
+
writable: true;
|
|
1197
|
+
signer: true;
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
name: 'systemProgram';
|
|
1201
|
+
address: '11111111111111111111111111111111';
|
|
1202
|
+
}
|
|
1203
|
+
];
|
|
1204
|
+
args: [];
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
name: 'sendToken';
|
|
1208
|
+
discriminator: [157, 183, 177, 53, 196, 251, 54, 185];
|
|
1209
|
+
accounts: [
|
|
1210
|
+
{
|
|
1211
|
+
name: 'signer';
|
|
1212
|
+
writable: true;
|
|
1213
|
+
signer: true;
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
name: 'systemProgram';
|
|
1217
|
+
address: '11111111111111111111111111111111';
|
|
1218
|
+
}
|
|
1219
|
+
];
|
|
1220
|
+
args: [];
|
|
1221
|
+
},
|
|
1207
1222
|
{
|
|
1208
1223
|
name: 'spinWheel';
|
|
1209
1224
|
discriminator: [25, 214, 214, 83, 131, 150, 190, 91];
|
|
@@ -1216,18 +1231,6 @@ export type PoseidonsProtocol = {
|
|
|
1216
1231
|
{
|
|
1217
1232
|
name: 'wheel';
|
|
1218
1233
|
writable: true;
|
|
1219
|
-
pda: {
|
|
1220
|
-
seeds: [
|
|
1221
|
-
{
|
|
1222
|
-
kind: 'const';
|
|
1223
|
-
value: [119, 104, 101, 101, 108];
|
|
1224
|
-
},
|
|
1225
|
-
{
|
|
1226
|
-
kind: 'arg';
|
|
1227
|
-
path: 'id';
|
|
1228
|
-
}
|
|
1229
|
-
];
|
|
1230
|
-
};
|
|
1231
1234
|
},
|
|
1232
1235
|
{
|
|
1233
1236
|
name: 'user';
|
|
@@ -1238,12 +1241,7 @@ export type PoseidonsProtocol = {
|
|
|
1238
1241
|
address: '11111111111111111111111111111111';
|
|
1239
1242
|
}
|
|
1240
1243
|
];
|
|
1241
|
-
args: [
|
|
1242
|
-
{
|
|
1243
|
-
name: 'id';
|
|
1244
|
-
type: 'u8';
|
|
1245
|
-
}
|
|
1246
|
-
];
|
|
1244
|
+
args: [];
|
|
1247
1245
|
returns: 'u8';
|
|
1248
1246
|
}
|
|
1249
1247
|
];
|
|
@@ -2088,7 +2086,7 @@ export type PoseidonsProtocol = {
|
|
|
2088
2086
|
kind: 'struct';
|
|
2089
2087
|
fields: [
|
|
2090
2088
|
{
|
|
2091
|
-
name: '
|
|
2089
|
+
name: 'authority';
|
|
2092
2090
|
type: 'pubkey';
|
|
2093
2091
|
},
|
|
2094
2092
|
{
|