@triadxyz/triad-protocol 1.3.8-beta → 1.3.9-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 +1 -1
- package/dist/index.js +12 -18
- package/dist/local-test.js +0 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -82,5 +82,5 @@ export default class TriadProtocolClient {
|
|
|
82
82
|
* @param verifier - Verifier keypair
|
|
83
83
|
* @param options - RPC options
|
|
84
84
|
*/
|
|
85
|
-
spinWheel(isSol: boolean, options?: RpcOptions): Promise<
|
|
85
|
+
spinWheel(isSol: boolean, amount: number, options?: RpcOptions): Promise<string>;
|
|
86
86
|
}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
16
16
|
const web3_js_1 = require("@solana/web3.js");
|
|
17
|
-
const base64_js_1 = require("base64-js");
|
|
18
17
|
const idl_triad_protocol_json_1 = __importDefault(require("./types/idl_triad_protocol.json"));
|
|
19
18
|
const trade_1 = __importDefault(require("./trade"));
|
|
20
19
|
const helpers_1 = require("./utils/helpers");
|
|
@@ -228,26 +227,21 @@ class TriadProtocolClient {
|
|
|
228
227
|
* @param verifier - Verifier keypair
|
|
229
228
|
* @param options - RPC options
|
|
230
229
|
*/
|
|
231
|
-
spinWheel(isSol, options) {
|
|
232
|
-
var _a, _b, _c;
|
|
230
|
+
spinWheel(isSol, amount, options) {
|
|
233
231
|
return __awaiter(this, void 0, void 0, function* () {
|
|
234
232
|
const spinPDA = (0, pda_1.getSpinPDA)(this.program.programId, constants_1.SPIN_NAME);
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const returnData = (_b = (_a = txResult.meta) === null || _a === void 0 ? void 0 : _a.returnData) === null || _b === void 0 ? void 0 : _b.data;
|
|
246
|
-
if (!returnData) {
|
|
247
|
-
throw new Error('No return data found in transaction');
|
|
233
|
+
const ixs = [];
|
|
234
|
+
for (let i = 0; i < amount; i++) {
|
|
235
|
+
ixs.push(yield this.program.methods
|
|
236
|
+
.spinWheel(isSol)
|
|
237
|
+
.accounts({
|
|
238
|
+
signer: this.provider.wallet.publicKey,
|
|
239
|
+
spin: spinPDA,
|
|
240
|
+
mint: constants_1.TCMAS_MINT
|
|
241
|
+
})
|
|
242
|
+
.instruction());
|
|
248
243
|
}
|
|
249
|
-
|
|
250
|
-
return new anchor_1.BN((0, base64_js_1.toByteArray)(value), 'le').toNumber();
|
|
244
|
+
return (0, sendVersionedTransaction_1.default)(this.provider, ixs, options);
|
|
251
245
|
});
|
|
252
246
|
}
|
|
253
247
|
}
|
package/dist/local-test.js
CHANGED
|
@@ -445,8 +445,3 @@ 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(false);
|
|
450
|
-
console.log(response);
|
|
451
|
-
});
|
|
452
|
-
spinWheel();
|