@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
|
@@ -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.
|
|
@@ -191,22 +191,20 @@ exports.compute_payout_keno = compute_payout_keno;
|
|
|
191
191
|
*
|
|
192
192
|
* `random`: 4 Goldilocks field elements (Poseidon2 output).
|
|
193
193
|
* `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
|
|
194
|
-
* `prediction_x100`: target multiplier
|
|
195
|
-
* `rtp_numer`: RTP numerator for this bet (90–99). Stored per-bet, included in prediction_hash.
|
|
194
|
+
* `prediction_x100`: target multiplier x 100 (101..999999, i.e. 1.01x-9999.99x).
|
|
196
195
|
*
|
|
197
|
-
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier
|
|
196
|
+
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier x10000]`.
|
|
198
197
|
* @param {BigUint64Array} random
|
|
199
198
|
* @param {bigint} bet_atomic
|
|
200
199
|
* @param {number} prediction_x100
|
|
201
|
-
* @param {number} rtp_numer
|
|
202
200
|
* @returns {BigUint64Array}
|
|
203
201
|
*/
|
|
204
|
-
function compute_payout_limbo(random, bet_atomic, prediction_x100
|
|
202
|
+
function compute_payout_limbo(random, bet_atomic, prediction_x100) {
|
|
205
203
|
try {
|
|
206
204
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
207
205
|
const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
|
|
208
206
|
const len0 = WASM_VECTOR_LEN;
|
|
209
|
-
wasm.compute_payout_limbo(retptr, ptr0, len0, bet_atomic, prediction_x100
|
|
207
|
+
wasm.compute_payout_limbo(retptr, ptr0, len0, bet_atomic, prediction_x100);
|
|
210
208
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
211
209
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
212
210
|
var v2 = getArrayU64FromWasm0(r0, r1).slice();
|
|
@@ -259,7 +257,7 @@ exports.compute_payout_plinko = compute_payout_plinko;
|
|
|
259
257
|
* and the in-circuit `build_prediction_hash`.
|
|
260
258
|
*
|
|
261
259
|
* Semantics of p0–p2 depend on the game:
|
|
262
|
-
* Limbo: `(
|
|
260
|
+
* Limbo: `(99, prediction_x100, 0)` — RTP hardcoded at 99
|
|
263
261
|
* Dice: `(mode, pred_lo, pred_hi)`
|
|
264
262
|
* Plinko: `(sector, rows, is_extreme)`
|
|
265
263
|
* CoinFlip: `(prediction, 0, 0)`
|
|
@@ -346,19 +344,17 @@ function compute_roll_dice(random) {
|
|
|
346
344
|
exports.compute_roll_dice = compute_roll_dice;
|
|
347
345
|
|
|
348
346
|
/**
|
|
349
|
-
* Extract limbo result multiplier
|
|
347
|
+
* Extract limbo result multiplier x 100 from Poseidon2 random output.
|
|
350
348
|
*
|
|
351
349
|
* `random` must be exactly 4 elements.
|
|
352
|
-
*
|
|
353
|
-
* Returns the clamped multiplier × 100 (101..999999).
|
|
350
|
+
* Returns the clamped multiplier x 100 (101..999999).
|
|
354
351
|
* @param {BigUint64Array} random
|
|
355
|
-
* @param {number} rtp_numer
|
|
356
352
|
* @returns {number}
|
|
357
353
|
*/
|
|
358
|
-
function compute_roll_limbo(random
|
|
354
|
+
function compute_roll_limbo(random) {
|
|
359
355
|
const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
|
|
360
356
|
const len0 = WASM_VECTOR_LEN;
|
|
361
|
-
const ret = wasm.compute_roll_limbo(ptr0, len0
|
|
357
|
+
const ret = wasm.compute_roll_limbo(ptr0, len0);
|
|
362
358
|
return ret >>> 0;
|
|
363
359
|
}
|
|
364
360
|
exports.compute_roll_limbo = compute_roll_limbo;
|
|
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;
|
|
@@ -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.
|