@rolly-dev/wasm-signer 1.21.0 → 1.22.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.
@@ -12,6 +12,11 @@
12
12
  */
13
13
  export function amount_split(amount: bigint): Uint32Array;
14
14
 
15
+ /**
16
+ * Aviato RTP percent (99). Canonical source for backend/frontend.
17
+ */
18
+ export function aviato_rtp_percent(): number;
19
+
15
20
  /**
16
21
  * CoinFlip multiplier × 10000 (19800 = 1.98×). Canonical source for backend/frontend.
17
22
  */
@@ -29,12 +34,12 @@ export function coinflip_rtp_percent(): number;
29
34
  export function compute_address_hash(address_hex: string): BigUint64Array;
30
35
 
31
36
  /**
32
- * Extract crash point (×100) from Poseidon2 random output.
37
+ * Extract aviato point (×100) from Poseidon2 random output.
33
38
  *
34
39
  * `random` must be exactly 4 elements.
35
- * Returns the clamped crash multiplier ×100 (100..=1_000_000, i.e. 1.00x..10000.00x).
40
+ * Returns the clamped aviato multiplier ×100 (100..=1_000_000, i.e. 1.00x..10000.00x).
36
41
  */
37
- export function compute_crash_point(random: BigUint64Array): number;
42
+ export function compute_aviato_point(random: BigUint64Array): number;
38
43
 
39
44
  /**
40
45
  * Extract the 10 drawn numbers from Poseidon2 random output using
@@ -54,28 +59,28 @@ export function compute_drawn_keno(random: BigUint64Array): Uint8Array;
54
59
  export function compute_multi_dice(win_numbers: number): bigint;
55
60
 
56
61
  /**
57
- * Full coinflip payout computation — pure integer arithmetic, zero floats.
62
+ * Full aviato payout computation — pure integer arithmetic, zero floats.
58
63
  *
59
- * `random`: 4 Goldilocks field elements (Poseidon2 output).
64
+ * `random`: 4 Goldilocks field elements (Poseidon2 output of server_seed).
60
65
  * `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
61
- * `prediction`: 0 or 1.
66
+ * `cashout_x100`: multiplier at which the user cashed out (×100).
67
+ * - 0 = user did NOT cash out (loss).
68
+ * - 100..=1_000_000 = user stopped at this multiplier.
62
69
  *
63
- * Returns `BigUint64Array[4]`: `[win_amount, roll (0|1), is_win (0|1), multiplier×10000]`.
70
+ * Returns `BigUint64Array[4]`: `[win_amount, aviato_x100, is_win (0|1), multiplier×10000]`.
64
71
  */
65
- export function compute_payout_coinflip(random: BigUint64Array, bet_atomic: bigint, prediction: number): BigUint64Array;
72
+ export function compute_payout_aviato(random: BigUint64Array, bet_atomic: bigint, cashout_x100: number): BigUint64Array;
66
73
 
67
74
  /**
68
- * Full crash payout computation — pure integer arithmetic, zero floats.
75
+ * Full coinflip payout computation — pure integer arithmetic, zero floats.
69
76
  *
70
- * `random`: 4 Goldilocks field elements (Poseidon2 output of server_seed).
77
+ * `random`: 4 Goldilocks field elements (Poseidon2 output).
71
78
  * `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
72
- * `cashout_x100`: multiplier at which the user cashed out (×100).
73
- * - 0 = user did NOT cash out (loss).
74
- * - 100..=1_000_000 = user stopped at this multiplier.
79
+ * `prediction`: 0 or 1.
75
80
  *
76
- * Returns `BigUint64Array[4]`: `[win_amount, crash_x100, is_win (0|1), multiplier×10000]`.
81
+ * Returns `BigUint64Array[4]`: `[win_amount, roll (0|1), is_win (0|1), multiplier×10000]`.
77
82
  */
78
- export function compute_payout_crash(random: BigUint64Array, bet_atomic: bigint, cashout_x100: number): BigUint64Array;
83
+ export function compute_payout_coinflip(random: BigUint64Array, bet_atomic: bigint, prediction: number): BigUint64Array;
79
84
 
80
85
  /**
81
86
  * Full dice payout computation — pure integer arithmetic, zero floats.
@@ -206,11 +211,6 @@ export function compute_server_seed_hash(server_seed: BigUint64Array): BigUint64
206
211
  */
207
212
  export function compute_user_seed_binding(game_id: number, bet: bigint, pred_hash: BigUint64Array, secret: BigUint64Array): BigUint64Array;
208
213
 
209
- /**
210
- * Crash RTP percent (99). Canonical source for backend/frontend.
211
- */
212
- export function crash_rtp_percent(): number;
213
-
214
214
  /**
215
215
  * Derive a session key from 32 bytes of entropy (e.g. MetaMask signature).
216
216
  *
@@ -26,6 +26,16 @@ function amount_split(amount) {
26
26
  }
27
27
  exports.amount_split = amount_split;
28
28
 
29
+ /**
30
+ * Aviato RTP percent (99). Canonical source for backend/frontend.
31
+ * @returns {number}
32
+ */
33
+ function aviato_rtp_percent() {
34
+ const ret = wasm.aviato_rtp_percent();
35
+ return ret >>> 0;
36
+ }
37
+ exports.aviato_rtp_percent = aviato_rtp_percent;
38
+
29
39
  /**
30
40
  * CoinFlip multiplier × 10000 (19800 = 1.98×). Canonical source for backend/frontend.
31
41
  * @returns {number}
@@ -41,7 +51,7 @@ exports.coinflip_multiplier_x10000 = coinflip_multiplier_x10000;
41
51
  * @returns {number}
42
52
  */
43
53
  function coinflip_rtp_percent() {
44
- const ret = wasm.coinflip_rtp_percent();
54
+ const ret = wasm.aviato_rtp_percent();
45
55
  return ret >>> 0;
46
56
  }
47
57
  exports.coinflip_rtp_percent = coinflip_rtp_percent;
@@ -70,20 +80,20 @@ function compute_address_hash(address_hex) {
70
80
  exports.compute_address_hash = compute_address_hash;
71
81
 
72
82
  /**
73
- * Extract crash point (×100) from Poseidon2 random output.
83
+ * Extract aviato point (×100) from Poseidon2 random output.
74
84
  *
75
85
  * `random` must be exactly 4 elements.
76
- * Returns the clamped crash multiplier ×100 (100..=1_000_000, i.e. 1.00x..10000.00x).
86
+ * Returns the clamped aviato multiplier ×100 (100..=1_000_000, i.e. 1.00x..10000.00x).
77
87
  * @param {BigUint64Array} random
78
88
  * @returns {number}
79
89
  */
80
- function compute_crash_point(random) {
90
+ function compute_aviato_point(random) {
81
91
  const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
82
92
  const len0 = WASM_VECTOR_LEN;
83
- const ret = wasm.compute_crash_point(ptr0, len0);
93
+ const ret = wasm.compute_aviato_point(ptr0, len0);
84
94
  return ret >>> 0;
85
95
  }
86
- exports.compute_crash_point = compute_crash_point;
96
+ exports.compute_aviato_point = compute_aviato_point;
87
97
 
88
98
  /**
89
99
  * Extract the 10 drawn numbers from Poseidon2 random output using
@@ -126,24 +136,26 @@ function compute_multi_dice(win_numbers) {
126
136
  exports.compute_multi_dice = compute_multi_dice;
127
137
 
128
138
  /**
129
- * Full coinflip payout computation — pure integer arithmetic, zero floats.
139
+ * Full aviato payout computation — pure integer arithmetic, zero floats.
130
140
  *
131
- * `random`: 4 Goldilocks field elements (Poseidon2 output).
141
+ * `random`: 4 Goldilocks field elements (Poseidon2 output of server_seed).
132
142
  * `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
133
- * `prediction`: 0 or 1.
143
+ * `cashout_x100`: multiplier at which the user cashed out (×100).
144
+ * - 0 = user did NOT cash out (loss).
145
+ * - 100..=1_000_000 = user stopped at this multiplier.
134
146
  *
135
- * Returns `BigUint64Array[4]`: `[win_amount, roll (0|1), is_win (0|1), multiplier×10000]`.
147
+ * Returns `BigUint64Array[4]`: `[win_amount, aviato_x100, is_win (0|1), multiplier×10000]`.
136
148
  * @param {BigUint64Array} random
137
149
  * @param {bigint} bet_atomic
138
- * @param {number} prediction
150
+ * @param {number} cashout_x100
139
151
  * @returns {BigUint64Array}
140
152
  */
141
- function compute_payout_coinflip(random, bet_atomic, prediction) {
153
+ function compute_payout_aviato(random, bet_atomic, cashout_x100) {
142
154
  try {
143
155
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
144
156
  const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
145
157
  const len0 = WASM_VECTOR_LEN;
146
- wasm.compute_payout_coinflip(retptr, ptr0, len0, bet_atomic, prediction);
158
+ wasm.compute_payout_aviato(retptr, ptr0, len0, bet_atomic, cashout_x100);
147
159
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
148
160
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
149
161
  var v2 = getArrayU64FromWasm0(r0, r1).slice();
@@ -153,29 +165,27 @@ function compute_payout_coinflip(random, bet_atomic, prediction) {
153
165
  wasm.__wbindgen_add_to_stack_pointer(16);
154
166
  }
155
167
  }
156
- exports.compute_payout_coinflip = compute_payout_coinflip;
168
+ exports.compute_payout_aviato = compute_payout_aviato;
157
169
 
158
170
  /**
159
- * Full crash payout computation — pure integer arithmetic, zero floats.
171
+ * Full coinflip payout computation — pure integer arithmetic, zero floats.
160
172
  *
161
- * `random`: 4 Goldilocks field elements (Poseidon2 output of server_seed).
173
+ * `random`: 4 Goldilocks field elements (Poseidon2 output).
162
174
  * `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
163
- * `cashout_x100`: multiplier at which the user cashed out (×100).
164
- * - 0 = user did NOT cash out (loss).
165
- * - 100..=1_000_000 = user stopped at this multiplier.
175
+ * `prediction`: 0 or 1.
166
176
  *
167
- * Returns `BigUint64Array[4]`: `[win_amount, crash_x100, is_win (0|1), multiplier×10000]`.
177
+ * Returns `BigUint64Array[4]`: `[win_amount, roll (0|1), is_win (0|1), multiplier×10000]`.
168
178
  * @param {BigUint64Array} random
169
179
  * @param {bigint} bet_atomic
170
- * @param {number} cashout_x100
180
+ * @param {number} prediction
171
181
  * @returns {BigUint64Array}
172
182
  */
173
- function compute_payout_crash(random, bet_atomic, cashout_x100) {
183
+ function compute_payout_coinflip(random, bet_atomic, prediction) {
174
184
  try {
175
185
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
176
186
  const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
177
187
  const len0 = WASM_VECTOR_LEN;
178
- wasm.compute_payout_crash(retptr, ptr0, len0, bet_atomic, cashout_x100);
188
+ wasm.compute_payout_coinflip(retptr, ptr0, len0, bet_atomic, prediction);
179
189
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
180
190
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
181
191
  var v2 = getArrayU64FromWasm0(r0, r1).slice();
@@ -185,7 +195,7 @@ function compute_payout_crash(random, bet_atomic, cashout_x100) {
185
195
  wasm.__wbindgen_add_to_stack_pointer(16);
186
196
  }
187
197
  }
188
- exports.compute_payout_crash = compute_payout_crash;
198
+ exports.compute_payout_coinflip = compute_payout_coinflip;
189
199
 
190
200
  /**
191
201
  * Full dice payout computation — pure integer arithmetic, zero floats.
@@ -509,16 +519,6 @@ function compute_user_seed_binding(game_id, bet, pred_hash, secret) {
509
519
  }
510
520
  exports.compute_user_seed_binding = compute_user_seed_binding;
511
521
 
512
- /**
513
- * Crash RTP percent (99). Canonical source for backend/frontend.
514
- * @returns {number}
515
- */
516
- function crash_rtp_percent() {
517
- const ret = wasm.coinflip_rtp_percent();
518
- return ret >>> 0;
519
- }
520
- exports.crash_rtp_percent = crash_rtp_percent;
521
-
522
522
  /**
523
523
  * Derive a session key from 32 bytes of entropy (e.g. MetaMask signature).
524
524
  *
@@ -559,7 +559,7 @@ exports.derive_session_key = derive_session_key;
559
559
  * @returns {number}
560
560
  */
561
561
  function dice_rtp_percent() {
562
- const ret = wasm.coinflip_rtp_percent();
562
+ const ret = wasm.aviato_rtp_percent();
563
563
  return ret >>> 0;
564
564
  }
565
565
  exports.dice_rtp_percent = dice_rtp_percent;
@@ -828,7 +828,7 @@ exports.keno_rtp_x100 = keno_rtp_x100;
828
828
  * @returns {number}
829
829
  */
830
830
  function limbo_rtp_percent() {
831
- const ret = wasm.coinflip_rtp_percent();
831
+ const ret = wasm.limbo_rtp_percent();
832
832
  return ret >>> 0;
833
833
  }
834
834
  exports.limbo_rtp_percent = limbo_rtp_percent;
Binary file
@@ -2,14 +2,14 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const amount_split: (a: number, b: bigint) => void;
5
+ export const aviato_rtp_percent: () => number;
5
6
  export const coinflip_multiplier_x10000: () => number;
6
- export const coinflip_rtp_percent: () => number;
7
7
  export const compute_address_hash: (a: number, b: number, c: number) => void;
8
- export const compute_crash_point: (a: number, b: number) => number;
8
+ export const compute_aviato_point: (a: number, b: number) => number;
9
9
  export const compute_drawn_keno: (a: number, b: number, c: number) => void;
10
10
  export const compute_multi_dice: (a: number) => bigint;
11
+ export const compute_payout_aviato: (a: number, b: number, c: number, d: bigint, e: number) => void;
11
12
  export const compute_payout_coinflip: (a: number, b: number, c: number, d: bigint, e: number) => void;
12
- export const compute_payout_crash: (a: number, b: number, c: number, d: bigint, e: number) => void;
13
13
  export const compute_payout_dice: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
14
14
  export const compute_payout_keno: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
15
15
  export const compute_payout_limbo: (a: number, b: number, c: number, d: bigint, e: number) => void;
@@ -35,6 +35,7 @@ export const keno_is_valid_config: (a: number, b: number) => number;
35
35
  export const keno_multiplier_table: (a: number, b: number, c: number) => void;
36
36
  export const keno_numbers_range: () => number;
37
37
  export const keno_rtp_x100: (a: number, b: number) => bigint;
38
+ export const limbo_rtp_percent: () => number;
38
39
  export const make_main_leaf: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
39
40
  export const plinko_all_rtp_x100: () => number;
40
41
  export const plinko_is_valid_config: (a: number, b: number, c: number) => number;
@@ -50,10 +51,9 @@ export const seed_hash_truncated: (a: number, b: number, c: number) => void;
50
51
  export const session_public_key: (a: number, b: number, c: number, d: bigint) => void;
51
52
  export const string_to_user_seed: (a: number, b: number, c: number) => void;
52
53
  export const string_to_user_seed_hex: (a: number, b: number, c: number) => void;
53
- export const crash_rtp_percent: () => number;
54
+ export const coinflip_rtp_percent: () => number;
54
55
  export const dice_rtp_percent: () => number;
55
56
  export const keno_max_picks: () => number;
56
- export const limbo_rtp_percent: () => number;
57
57
  export const goldilocks_modulus: () => bigint;
58
58
  export const __wbindgen_export: (a: number) => void;
59
59
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
@@ -12,6 +12,11 @@
12
12
  */
13
13
  export function amount_split(amount: bigint): Uint32Array;
14
14
 
15
+ /**
16
+ * Aviato RTP percent (99). Canonical source for backend/frontend.
17
+ */
18
+ export function aviato_rtp_percent(): number;
19
+
15
20
  /**
16
21
  * CoinFlip multiplier × 10000 (19800 = 1.98×). Canonical source for backend/frontend.
17
22
  */
@@ -29,12 +34,12 @@ export function coinflip_rtp_percent(): number;
29
34
  export function compute_address_hash(address_hex: string): BigUint64Array;
30
35
 
31
36
  /**
32
- * Extract crash point (×100) from Poseidon2 random output.
37
+ * Extract aviato point (×100) from Poseidon2 random output.
33
38
  *
34
39
  * `random` must be exactly 4 elements.
35
- * Returns the clamped crash multiplier ×100 (100..=1_000_000, i.e. 1.00x..10000.00x).
40
+ * Returns the clamped aviato multiplier ×100 (100..=1_000_000, i.e. 1.00x..10000.00x).
36
41
  */
37
- export function compute_crash_point(random: BigUint64Array): number;
42
+ export function compute_aviato_point(random: BigUint64Array): number;
38
43
 
39
44
  /**
40
45
  * Extract the 10 drawn numbers from Poseidon2 random output using
@@ -54,28 +59,28 @@ export function compute_drawn_keno(random: BigUint64Array): Uint8Array;
54
59
  export function compute_multi_dice(win_numbers: number): bigint;
55
60
 
56
61
  /**
57
- * Full coinflip payout computation — pure integer arithmetic, zero floats.
62
+ * Full aviato payout computation — pure integer arithmetic, zero floats.
58
63
  *
59
- * `random`: 4 Goldilocks field elements (Poseidon2 output).
64
+ * `random`: 4 Goldilocks field elements (Poseidon2 output of server_seed).
60
65
  * `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
61
- * `prediction`: 0 or 1.
66
+ * `cashout_x100`: multiplier at which the user cashed out (×100).
67
+ * - 0 = user did NOT cash out (loss).
68
+ * - 100..=1_000_000 = user stopped at this multiplier.
62
69
  *
63
- * Returns `BigUint64Array[4]`: `[win_amount, roll (0|1), is_win (0|1), multiplier×10000]`.
70
+ * Returns `BigUint64Array[4]`: `[win_amount, aviato_x100, is_win (0|1), multiplier×10000]`.
64
71
  */
65
- export function compute_payout_coinflip(random: BigUint64Array, bet_atomic: bigint, prediction: number): BigUint64Array;
72
+ export function compute_payout_aviato(random: BigUint64Array, bet_atomic: bigint, cashout_x100: number): BigUint64Array;
66
73
 
67
74
  /**
68
- * Full crash payout computation — pure integer arithmetic, zero floats.
75
+ * Full coinflip payout computation — pure integer arithmetic, zero floats.
69
76
  *
70
- * `random`: 4 Goldilocks field elements (Poseidon2 output of server_seed).
77
+ * `random`: 4 Goldilocks field elements (Poseidon2 output).
71
78
  * `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
72
- * `cashout_x100`: multiplier at which the user cashed out (×100).
73
- * - 0 = user did NOT cash out (loss).
74
- * - 100..=1_000_000 = user stopped at this multiplier.
79
+ * `prediction`: 0 or 1.
75
80
  *
76
- * Returns `BigUint64Array[4]`: `[win_amount, crash_x100, is_win (0|1), multiplier×10000]`.
81
+ * Returns `BigUint64Array[4]`: `[win_amount, roll (0|1), is_win (0|1), multiplier×10000]`.
77
82
  */
78
- export function compute_payout_crash(random: BigUint64Array, bet_atomic: bigint, cashout_x100: number): BigUint64Array;
83
+ export function compute_payout_coinflip(random: BigUint64Array, bet_atomic: bigint, prediction: number): BigUint64Array;
79
84
 
80
85
  /**
81
86
  * Full dice payout computation — pure integer arithmetic, zero floats.
@@ -206,11 +211,6 @@ export function compute_server_seed_hash(server_seed: BigUint64Array): BigUint64
206
211
  */
207
212
  export function compute_user_seed_binding(game_id: number, bet: bigint, pred_hash: BigUint64Array, secret: BigUint64Array): BigUint64Array;
208
213
 
209
- /**
210
- * Crash RTP percent (99). Canonical source for backend/frontend.
211
- */
212
- export function crash_rtp_percent(): number;
213
-
214
214
  /**
215
215
  * Derive a session key from 32 bytes of entropy (e.g. MetaMask signature).
216
216
  *