@rolly-dev/wasm-signer 1.29.0 → 1.30.0
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/node/rolly_wasm_signer.d.ts +27 -0
- package/dist/node/rolly_wasm_signer.js +52 -0
- package/dist/node/rolly_wasm_signer_bg.wasm +0 -0
- package/dist/node/rolly_wasm_signer_bg.wasm.d.ts +1 -0
- package/dist/node-inline/rolly_wasm_signer.d.ts +27 -0
- package/dist/node-inline/rolly_wasm_signer.js +53 -1
- package/dist/node-inline/rolly_wasm_signer.mjs +53 -2
- package/dist/node-inline/rolly_wasm_signer_bg.wasm.d.ts +1 -0
- package/dist/web/rolly_wasm_signer.d.ts +28 -0
- package/dist/web/rolly_wasm_signer.js +51 -0
- package/dist/web/rolly_wasm_signer_bg.wasm +0 -0
- package/dist/web/rolly_wasm_signer_bg.wasm.d.ts +1 -0
- package/js/browser.mjs +1 -0
- package/js/index.d.ts +1 -0
- package/js/node-inline.cjs +1 -0
- package/js/node-inline.mjs +1 -0
- package/js/node.cjs +1 -0
- package/js/node.mjs +1 -0
- package/js/react.mjs +2 -0
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ export const compute_crash_point: (a: number, b: number) => number;
|
|
|
12
12
|
export const compute_drawn_keno: (a: number, b: number, c: number) => void;
|
|
13
13
|
export const compute_multi_dice: (a: number) => bigint;
|
|
14
14
|
export const compute_payout_aviato: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
15
|
+
export const compute_payout_blackjack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint) => void;
|
|
15
16
|
export const compute_payout_coinflip: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
16
17
|
export const compute_payout_crash: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
17
18
|
export const compute_payout_dice: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
@@ -103,6 +103,33 @@ export function compute_multi_dice(win_numbers: number): bigint;
|
|
|
103
103
|
*/
|
|
104
104
|
export function compute_payout_aviato(random: BigUint64Array, bet_atomic: bigint, cashout_x100: number): BigUint64Array;
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Client-side provably-fair verification of a full Blackjack round.
|
|
108
|
+
*
|
|
109
|
+
* Reconstructs the fair shoe from `(server_seed ‖ user_secret_random)` (see
|
|
110
|
+
* [`blackjack_deal_shoe`]), decodes the base-8 `prediction_lo` / `prediction_hi`
|
|
111
|
+
* action halves, and replays the exact same state machine the circuit and the
|
|
112
|
+
* tx-validator run (`rolly_game_core::blackjack::replay_full`). This lets a
|
|
113
|
+
* player independently confirm the settled `win`/`bet` off-chain; it is NOT on
|
|
114
|
+
* the tx/settlement path.
|
|
115
|
+
*
|
|
116
|
+
* `server_seed` must be 8 elements (the revealed fairness preimage);
|
|
117
|
+
* `user_secret_random` must be 4 elements (`string_to_user_seed(...)`).
|
|
118
|
+
* `base_bet` is the base stake in atomic units. The returned `total_staked`
|
|
119
|
+
* grows with double/split/insurance exactly as the engine books them.
|
|
120
|
+
*
|
|
121
|
+
* **Output**: a JS object matching [`BlackjackVerifyResult`].
|
|
122
|
+
*
|
|
123
|
+
* Returns an error if the decoded action list contains an invalid code
|
|
124
|
+
* (outside `1..=6`), mirroring the tx-validator's typed rejection.
|
|
125
|
+
*
|
|
126
|
+
* ```js
|
|
127
|
+
* const res = compute_payout_blackjack(serverSeed8, userSecret4, lo, hi, betAtomic);
|
|
128
|
+
* // res.win_amount, res.total_staked, res.shoe (length 30), ...
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export function compute_payout_blackjack(server_seed: BigUint64Array, user_secret_random: BigUint64Array, prediction_lo: number, prediction_hi: number, base_bet: bigint): any;
|
|
132
|
+
|
|
106
133
|
/**
|
|
107
134
|
* Full coinflip payout computation — pure integer arithmetic, zero floats.
|
|
108
135
|
*
|
|
@@ -551,6 +578,7 @@ export interface InitOutput {
|
|
|
551
578
|
readonly compute_drawn_keno: (a: number, b: number, c: number) => void;
|
|
552
579
|
readonly compute_multi_dice: (a: number) => bigint;
|
|
553
580
|
readonly compute_payout_aviato: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
581
|
+
readonly compute_payout_blackjack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint) => void;
|
|
554
582
|
readonly compute_payout_coinflip: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
555
583
|
readonly compute_payout_crash: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
556
584
|
readonly compute_payout_dice: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
@@ -232,6 +232,57 @@ export function compute_payout_aviato(random, bet_atomic, cashout_x100) {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Client-side provably-fair verification of a full Blackjack round.
|
|
237
|
+
*
|
|
238
|
+
* Reconstructs the fair shoe from `(server_seed ‖ user_secret_random)` (see
|
|
239
|
+
* [`blackjack_deal_shoe`]), decodes the base-8 `prediction_lo` / `prediction_hi`
|
|
240
|
+
* action halves, and replays the exact same state machine the circuit and the
|
|
241
|
+
* tx-validator run (`rolly_game_core::blackjack::replay_full`). This lets a
|
|
242
|
+
* player independently confirm the settled `win`/`bet` off-chain; it is NOT on
|
|
243
|
+
* the tx/settlement path.
|
|
244
|
+
*
|
|
245
|
+
* `server_seed` must be 8 elements (the revealed fairness preimage);
|
|
246
|
+
* `user_secret_random` must be 4 elements (`string_to_user_seed(...)`).
|
|
247
|
+
* `base_bet` is the base stake in atomic units. The returned `total_staked`
|
|
248
|
+
* grows with double/split/insurance exactly as the engine books them.
|
|
249
|
+
*
|
|
250
|
+
* **Output**: a JS object matching [`BlackjackVerifyResult`].
|
|
251
|
+
*
|
|
252
|
+
* Returns an error if the decoded action list contains an invalid code
|
|
253
|
+
* (outside `1..=6`), mirroring the tx-validator's typed rejection.
|
|
254
|
+
*
|
|
255
|
+
* ```js
|
|
256
|
+
* const res = compute_payout_blackjack(serverSeed8, userSecret4, lo, hi, betAtomic);
|
|
257
|
+
* // res.win_amount, res.total_staked, res.shoe (length 30), ...
|
|
258
|
+
* ```
|
|
259
|
+
* @param {BigUint64Array} server_seed
|
|
260
|
+
* @param {BigUint64Array} user_secret_random
|
|
261
|
+
* @param {number} prediction_lo
|
|
262
|
+
* @param {number} prediction_hi
|
|
263
|
+
* @param {bigint} base_bet
|
|
264
|
+
* @returns {any}
|
|
265
|
+
*/
|
|
266
|
+
export function compute_payout_blackjack(server_seed, user_secret_random, prediction_lo, prediction_hi, base_bet) {
|
|
267
|
+
try {
|
|
268
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
269
|
+
const ptr0 = passArray64ToWasm0(server_seed, wasm.__wbindgen_export);
|
|
270
|
+
const len0 = WASM_VECTOR_LEN;
|
|
271
|
+
const ptr1 = passArray64ToWasm0(user_secret_random, wasm.__wbindgen_export);
|
|
272
|
+
const len1 = WASM_VECTOR_LEN;
|
|
273
|
+
wasm.compute_payout_blackjack(retptr, ptr0, len0, ptr1, len1, prediction_lo, prediction_hi, base_bet);
|
|
274
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
275
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
276
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
277
|
+
if (r2) {
|
|
278
|
+
throw takeObject(r1);
|
|
279
|
+
}
|
|
280
|
+
return takeObject(r0);
|
|
281
|
+
} finally {
|
|
282
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
235
286
|
/**
|
|
236
287
|
* Full coinflip payout computation — pure integer arithmetic, zero floats.
|
|
237
288
|
*
|
|
Binary file
|
|
@@ -12,6 +12,7 @@ export const compute_crash_point: (a: number, b: number) => number;
|
|
|
12
12
|
export const compute_drawn_keno: (a: number, b: number, c: number) => void;
|
|
13
13
|
export const compute_multi_dice: (a: number) => bigint;
|
|
14
14
|
export const compute_payout_aviato: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
15
|
+
export const compute_payout_blackjack: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint) => void;
|
|
15
16
|
export const compute_payout_coinflip: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
16
17
|
export const compute_payout_crash: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
17
18
|
export const compute_payout_dice: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
package/js/browser.mjs
CHANGED
package/js/index.d.ts
CHANGED
package/js/node-inline.cjs
CHANGED
|
@@ -15,6 +15,7 @@ module.exports = {
|
|
|
15
15
|
compute_drawn_keno: wasm.compute_drawn_keno,
|
|
16
16
|
compute_multi_dice: wasm.compute_multi_dice,
|
|
17
17
|
compute_payout_aviato: wasm.compute_payout_aviato,
|
|
18
|
+
compute_payout_blackjack: wasm.compute_payout_blackjack,
|
|
18
19
|
compute_payout_coinflip: wasm.compute_payout_coinflip,
|
|
19
20
|
compute_payout_crash: wasm.compute_payout_crash,
|
|
20
21
|
compute_payout_dice: wasm.compute_payout_dice,
|
package/js/node-inline.mjs
CHANGED
package/js/node.cjs
CHANGED
|
@@ -15,6 +15,7 @@ module.exports = {
|
|
|
15
15
|
compute_drawn_keno: wasm.compute_drawn_keno,
|
|
16
16
|
compute_multi_dice: wasm.compute_multi_dice,
|
|
17
17
|
compute_payout_aviato: wasm.compute_payout_aviato,
|
|
18
|
+
compute_payout_blackjack: wasm.compute_payout_blackjack,
|
|
18
19
|
compute_payout_coinflip: wasm.compute_payout_coinflip,
|
|
19
20
|
compute_payout_crash: wasm.compute_payout_crash,
|
|
20
21
|
compute_payout_dice: wasm.compute_payout_dice,
|
package/js/node.mjs
CHANGED
package/js/react.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import init, {
|
|
|
12
12
|
compute_drawn_keno,
|
|
13
13
|
compute_multi_dice,
|
|
14
14
|
compute_payout_aviato,
|
|
15
|
+
compute_payout_blackjack,
|
|
15
16
|
compute_payout_coinflip,
|
|
16
17
|
compute_payout_crash,
|
|
17
18
|
compute_payout_dice,
|
|
@@ -85,6 +86,7 @@ const fns = {
|
|
|
85
86
|
compute_drawn_keno: guard(compute_drawn_keno),
|
|
86
87
|
compute_multi_dice: guard(compute_multi_dice),
|
|
87
88
|
compute_payout_aviato: guard(compute_payout_aviato),
|
|
89
|
+
compute_payout_blackjack: guard(compute_payout_blackjack),
|
|
88
90
|
compute_payout_coinflip: guard(compute_payout_coinflip),
|
|
89
91
|
compute_payout_crash: guard(compute_payout_crash),
|
|
90
92
|
compute_payout_dice: guard(compute_payout_dice),
|