@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.
@@ -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, f: number) => void;
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, c: number) => 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 × 100 (101..999999, i.e. 1.01x9999.99x).
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×10000]`.
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, rtp_numer: number): BigUint64Array;
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: `(rtp_numer, prediction_x100, 0)`
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 × 100 from Poseidon2 random output.
137
+ * Extract limbo result multiplier x 100 from Poseidon2 random output.
139
138
  *
140
139
  * `random` must be exactly 4 elements.
141
- * `rtp_numer` must be in [90, 99].
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, rtp_numer: number): number;
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, f: number) => void;
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, c: number) => 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 × 100 (101..999999, i.e. 1.01x9999.99x).
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×10000]`.
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, rtp_numer) {
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, rtp_numer);
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: `(rtp_numer, prediction_x100, 0)`
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 × 100 from Poseidon2 random output.
334
+ * Extract limbo result multiplier x 100 from Poseidon2 random output.
337
335
  *
338
336
  * `random` must be exactly 4 elements.
339
- * `rtp_numer` must be in [90, 99].
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, rtp_numer) {
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, rtp_numer);
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, f: number) => void;
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, c: number) => 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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolly-dev/wasm-signer",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Poseidon2 hashing & bet signing for Rolly ZK-Rollup (WASM, Goldilocks field)",
5
5
  "type": "module",
6
6
  "exports": {