@rolly-dev/wasm-signer 1.12.0 → 1.13.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 +7 -9
- package/dist/node/rolly_wasm_signer.js +9 -13
- package/dist/node/rolly_wasm_signer_bg.wasm +0 -0
- package/dist/node/rolly_wasm_signer_bg.wasm.d.ts +2 -2
- package/dist/node-inline/rolly_wasm_signer.d.ts +7 -9
- package/dist/node-inline/rolly_wasm_signer.js +10 -14
- package/dist/node-inline/rolly_wasm_signer.mjs +10 -14
- package/dist/node-inline/rolly_wasm_signer_bg.wasm.d.ts +2 -2
- package/dist/web/rolly_wasm_signer.d.ts +9 -11
- package/dist/web/rolly_wasm_signer.js +9 -13
- package/dist/web/rolly_wasm_signer_bg.wasm +0 -0
- package/dist/web/rolly_wasm_signer_bg.wasm.d.ts +2 -2
- package/package.json +1 -1
|
@@ -8,13 +8,13 @@ export const compute_multi_dice: (a: number) => bigint;
|
|
|
8
8
|
export const compute_payout_coinflip: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
9
9
|
export const compute_payout_dice: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
10
10
|
export const compute_payout_keno: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
11
|
-
export const compute_payout_limbo: (a: number, b: number, c: number, d: bigint, e: number
|
|
11
|
+
export const compute_payout_limbo: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
12
12
|
export const compute_payout_plinko: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
13
13
|
export const compute_prediction_hash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
14
14
|
export const compute_prediction_hash_keno: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
15
15
|
export const compute_roll_coinflip: (a: number, b: number) => number;
|
|
16
16
|
export const compute_roll_dice: (a: number, b: number) => number;
|
|
17
|
-
export const compute_roll_limbo: (a: number, b: number
|
|
17
|
+
export const compute_roll_limbo: (a: number, b: number) => number;
|
|
18
18
|
export const compute_roll_plinko: (a: number, b: number, c: number) => number;
|
|
19
19
|
export const compute_server_seed_hash: (a: number, b: number, c: number) => void;
|
|
20
20
|
export const compute_user_seed_binding: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
@@ -75,12 +75,11 @@ export function compute_payout_keno(random: BigUint64Array, bet_atomic: bigint,
|
|
|
75
75
|
*
|
|
76
76
|
* `random`: 4 Goldilocks field elements (Poseidon2 output).
|
|
77
77
|
* `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
|
|
78
|
-
* `prediction_x100`: target multiplier
|
|
79
|
-
* `rtp_numer`: RTP numerator for this bet (90–99). Stored per-bet, included in prediction_hash.
|
|
78
|
+
* `prediction_x100`: target multiplier x 100 (101..999999, i.e. 1.01x-9999.99x).
|
|
80
79
|
*
|
|
81
|
-
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier
|
|
80
|
+
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier x10000]`.
|
|
82
81
|
*/
|
|
83
|
-
export function compute_payout_limbo(random: BigUint64Array, bet_atomic: bigint, prediction_x100: number
|
|
82
|
+
export function compute_payout_limbo(random: BigUint64Array, bet_atomic: bigint, prediction_x100: number): BigUint64Array;
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
85
|
* Full plinko payout computation — pure integer arithmetic, zero floats.
|
|
@@ -102,7 +101,7 @@ export function compute_payout_plinko(random: BigUint64Array, bet_atomic: bigint
|
|
|
102
101
|
* and the in-circuit `build_prediction_hash`.
|
|
103
102
|
*
|
|
104
103
|
* Semantics of p0–p2 depend on the game:
|
|
105
|
-
* Limbo: `(
|
|
104
|
+
* Limbo: `(99, prediction_x100, 0)` — RTP hardcoded at 99
|
|
106
105
|
* Dice: `(mode, pred_lo, pred_hi)`
|
|
107
106
|
* Plinko: `(sector, rows, is_extreme)`
|
|
108
107
|
* CoinFlip: `(prediction, 0, 0)`
|
|
@@ -135,13 +134,12 @@ export function compute_roll_coinflip(random: BigUint64Array): number;
|
|
|
135
134
|
export function compute_roll_dice(random: BigUint64Array): number;
|
|
136
135
|
|
|
137
136
|
/**
|
|
138
|
-
* Extract limbo result multiplier
|
|
137
|
+
* Extract limbo result multiplier x 100 from Poseidon2 random output.
|
|
139
138
|
*
|
|
140
139
|
* `random` must be exactly 4 elements.
|
|
141
|
-
*
|
|
142
|
-
* Returns the clamped multiplier × 100 (101..999999).
|
|
140
|
+
* Returns the clamped multiplier x 100 (101..999999).
|
|
143
141
|
*/
|
|
144
|
-
export function compute_roll_limbo(random: BigUint64Array
|
|
142
|
+
export function compute_roll_limbo(random: BigUint64Array): number;
|
|
145
143
|
|
|
146
144
|
/**
|
|
147
145
|
* Extract plinko bucket index from Poseidon2 random output.
|
|
@@ -371,13 +369,13 @@ export interface InitOutput {
|
|
|
371
369
|
readonly compute_payout_coinflip: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
372
370
|
readonly compute_payout_dice: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
373
371
|
readonly compute_payout_keno: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
374
|
-
readonly compute_payout_limbo: (a: number, b: number, c: number, d: bigint, e: number
|
|
372
|
+
readonly compute_payout_limbo: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
375
373
|
readonly compute_payout_plinko: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
376
374
|
readonly compute_prediction_hash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
377
375
|
readonly compute_prediction_hash_keno: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
378
376
|
readonly compute_roll_coinflip: (a: number, b: number) => number;
|
|
379
377
|
readonly compute_roll_dice: (a: number, b: number) => number;
|
|
380
|
-
readonly compute_roll_limbo: (a: number, b: number
|
|
378
|
+
readonly compute_roll_limbo: (a: number, b: number) => number;
|
|
381
379
|
readonly compute_roll_plinko: (a: number, b: number, c: number) => number;
|
|
382
380
|
readonly compute_server_seed_hash: (a: number, b: number, c: number) => void;
|
|
383
381
|
readonly compute_user_seed_binding: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
@@ -184,22 +184,20 @@ export function compute_payout_keno(random, bet_atomic, risk, selected) {
|
|
|
184
184
|
*
|
|
185
185
|
* `random`: 4 Goldilocks field elements (Poseidon2 output).
|
|
186
186
|
* `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
|
|
187
|
-
* `prediction_x100`: target multiplier
|
|
188
|
-
* `rtp_numer`: RTP numerator for this bet (90–99). Stored per-bet, included in prediction_hash.
|
|
187
|
+
* `prediction_x100`: target multiplier x 100 (101..999999, i.e. 1.01x-9999.99x).
|
|
189
188
|
*
|
|
190
|
-
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier
|
|
189
|
+
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier x10000]`.
|
|
191
190
|
* @param {BigUint64Array} random
|
|
192
191
|
* @param {bigint} bet_atomic
|
|
193
192
|
* @param {number} prediction_x100
|
|
194
|
-
* @param {number} rtp_numer
|
|
195
193
|
* @returns {BigUint64Array}
|
|
196
194
|
*/
|
|
197
|
-
export function compute_payout_limbo(random, bet_atomic, prediction_x100
|
|
195
|
+
export function compute_payout_limbo(random, bet_atomic, prediction_x100) {
|
|
198
196
|
try {
|
|
199
197
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
200
198
|
const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
|
|
201
199
|
const len0 = WASM_VECTOR_LEN;
|
|
202
|
-
wasm.compute_payout_limbo(retptr, ptr0, len0, bet_atomic, prediction_x100
|
|
200
|
+
wasm.compute_payout_limbo(retptr, ptr0, len0, bet_atomic, prediction_x100);
|
|
203
201
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
204
202
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
205
203
|
var v2 = getArrayU64FromWasm0(r0, r1).slice();
|
|
@@ -250,7 +248,7 @@ export function compute_payout_plinko(random, bet_atomic, sector, rows, is_extre
|
|
|
250
248
|
* and the in-circuit `build_prediction_hash`.
|
|
251
249
|
*
|
|
252
250
|
* Semantics of p0–p2 depend on the game:
|
|
253
|
-
* Limbo: `(
|
|
251
|
+
* Limbo: `(99, prediction_x100, 0)` — RTP hardcoded at 99
|
|
254
252
|
* Dice: `(mode, pred_lo, pred_hi)`
|
|
255
253
|
* Plinko: `(sector, rows, is_extreme)`
|
|
256
254
|
* CoinFlip: `(prediction, 0, 0)`
|
|
@@ -333,19 +331,17 @@ export function compute_roll_dice(random) {
|
|
|
333
331
|
}
|
|
334
332
|
|
|
335
333
|
/**
|
|
336
|
-
* Extract limbo result multiplier
|
|
334
|
+
* Extract limbo result multiplier x 100 from Poseidon2 random output.
|
|
337
335
|
*
|
|
338
336
|
* `random` must be exactly 4 elements.
|
|
339
|
-
*
|
|
340
|
-
* Returns the clamped multiplier × 100 (101..999999).
|
|
337
|
+
* Returns the clamped multiplier x 100 (101..999999).
|
|
341
338
|
* @param {BigUint64Array} random
|
|
342
|
-
* @param {number} rtp_numer
|
|
343
339
|
* @returns {number}
|
|
344
340
|
*/
|
|
345
|
-
export function compute_roll_limbo(random
|
|
341
|
+
export function compute_roll_limbo(random) {
|
|
346
342
|
const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
|
|
347
343
|
const len0 = WASM_VECTOR_LEN;
|
|
348
|
-
const ret = wasm.compute_roll_limbo(ptr0, len0
|
|
344
|
+
const ret = wasm.compute_roll_limbo(ptr0, len0);
|
|
349
345
|
return ret >>> 0;
|
|
350
346
|
}
|
|
351
347
|
|
|
Binary file
|
|
@@ -8,13 +8,13 @@ export const compute_multi_dice: (a: number) => bigint;
|
|
|
8
8
|
export const compute_payout_coinflip: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
9
9
|
export const compute_payout_dice: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
10
10
|
export const compute_payout_keno: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
11
|
-
export const compute_payout_limbo: (a: number, b: number, c: number, d: bigint, e: number
|
|
11
|
+
export const compute_payout_limbo: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
12
12
|
export const compute_payout_plinko: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
13
13
|
export const compute_prediction_hash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
14
14
|
export const compute_prediction_hash_keno: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
15
15
|
export const compute_roll_coinflip: (a: number, b: number) => number;
|
|
16
16
|
export const compute_roll_dice: (a: number, b: number) => number;
|
|
17
|
-
export const compute_roll_limbo: (a: number, b: number
|
|
17
|
+
export const compute_roll_limbo: (a: number, b: number) => number;
|
|
18
18
|
export const compute_roll_plinko: (a: number, b: number, c: number) => number;
|
|
19
19
|
export const compute_server_seed_hash: (a: number, b: number, c: number) => void;
|
|
20
20
|
export const compute_user_seed_binding: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|