@triadxyz/poseidons-protocol 0.2.2 → 0.2.3
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
|
@@ -105,18 +105,16 @@ class Wheel {
|
|
|
105
105
|
spinWheel({ user, id, spins }) {
|
|
106
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
107
|
const userPDA = (0, pda_1.getUserPDA)(user);
|
|
108
|
-
const instructions = [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
id
|
|
112
|
-
spins: new anchor_1.BN(spins)
|
|
113
|
-
})
|
|
108
|
+
const instructions = [];
|
|
109
|
+
for (let i = 0; i < spins; i++) {
|
|
110
|
+
instructions.push(yield this.program.methods
|
|
111
|
+
.spinWheel(id)
|
|
114
112
|
.accounts({
|
|
115
113
|
signer: this.program.provider.publicKey,
|
|
116
114
|
user: userPDA
|
|
117
115
|
})
|
|
118
|
-
.instruction()
|
|
119
|
-
|
|
116
|
+
.instruction());
|
|
117
|
+
}
|
|
120
118
|
return (0, sendVersionedTransaction_1.default)(this.program, instructions, this.rpcOptions);
|
|
121
119
|
});
|
|
122
120
|
}
|
|
@@ -883,7 +883,7 @@
|
|
|
883
883
|
},
|
|
884
884
|
{
|
|
885
885
|
"kind": "arg",
|
|
886
|
-
"path": "
|
|
886
|
+
"path": "id"
|
|
887
887
|
}
|
|
888
888
|
]
|
|
889
889
|
}
|
|
@@ -899,12 +899,8 @@
|
|
|
899
899
|
],
|
|
900
900
|
"args": [
|
|
901
901
|
{
|
|
902
|
-
"name": "
|
|
903
|
-
"type":
|
|
904
|
-
"defined": {
|
|
905
|
-
"name": "SpinWheelArgs"
|
|
906
|
-
}
|
|
907
|
-
}
|
|
902
|
+
"name": "id",
|
|
903
|
+
"type": "u8"
|
|
908
904
|
}
|
|
909
905
|
],
|
|
910
906
|
"returns": "u8"
|
|
@@ -1735,22 +1731,6 @@
|
|
|
1735
1731
|
]
|
|
1736
1732
|
}
|
|
1737
1733
|
},
|
|
1738
|
-
{
|
|
1739
|
-
"name": "SpinWheelArgs",
|
|
1740
|
-
"type": {
|
|
1741
|
-
"kind": "struct",
|
|
1742
|
-
"fields": [
|
|
1743
|
-
{
|
|
1744
|
-
"name": "id",
|
|
1745
|
-
"type": "u8"
|
|
1746
|
-
},
|
|
1747
|
-
{
|
|
1748
|
-
"name": "spins",
|
|
1749
|
-
"type": "u64"
|
|
1750
|
-
}
|
|
1751
|
-
]
|
|
1752
|
-
}
|
|
1753
|
-
},
|
|
1754
1734
|
{
|
|
1755
1735
|
"name": "SpinWheelEvent",
|
|
1756
1736
|
"type": {
|
|
@@ -1174,7 +1174,7 @@ export type PoseidonsProtocol = {
|
|
|
1174
1174
|
},
|
|
1175
1175
|
{
|
|
1176
1176
|
kind: 'arg';
|
|
1177
|
-
path: '
|
|
1177
|
+
path: 'id';
|
|
1178
1178
|
}
|
|
1179
1179
|
];
|
|
1180
1180
|
};
|
|
@@ -1190,12 +1190,8 @@ export type PoseidonsProtocol = {
|
|
|
1190
1190
|
];
|
|
1191
1191
|
args: [
|
|
1192
1192
|
{
|
|
1193
|
-
name: '
|
|
1194
|
-
type:
|
|
1195
|
-
defined: {
|
|
1196
|
-
name: 'spinWheelArgs';
|
|
1197
|
-
};
|
|
1198
|
-
};
|
|
1193
|
+
name: 'id';
|
|
1194
|
+
type: 'u8';
|
|
1199
1195
|
}
|
|
1200
1196
|
];
|
|
1201
1197
|
returns: 'u8';
|
|
@@ -2026,22 +2022,6 @@ export type PoseidonsProtocol = {
|
|
|
2026
2022
|
];
|
|
2027
2023
|
};
|
|
2028
2024
|
},
|
|
2029
|
-
{
|
|
2030
|
-
name: 'spinWheelArgs';
|
|
2031
|
-
type: {
|
|
2032
|
-
kind: 'struct';
|
|
2033
|
-
fields: [
|
|
2034
|
-
{
|
|
2035
|
-
name: 'id';
|
|
2036
|
-
type: 'u8';
|
|
2037
|
-
},
|
|
2038
|
-
{
|
|
2039
|
-
name: 'spins';
|
|
2040
|
-
type: 'u64';
|
|
2041
|
-
}
|
|
2042
|
-
];
|
|
2043
|
-
};
|
|
2044
|
-
},
|
|
2045
2025
|
{
|
|
2046
2026
|
name: 'spinWheelEvent';
|
|
2047
2027
|
type: {
|