@rolly-dev/wasm-signer 1.9.0 → 1.11.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 +22 -0
- package/dist/node/rolly_wasm_signer.js +51 -0
- package/dist/node/rolly_wasm_signer_bg.wasm +0 -0
- package/dist/node/rolly_wasm_signer_bg.wasm.d.ts +2 -0
- package/dist/node-inline/rolly_wasm_signer.d.ts +22 -0
- package/dist/node-inline/rolly_wasm_signer.js +52 -1
- package/dist/node-inline/rolly_wasm_signer.mjs +51 -2
- package/dist/node-inline/rolly_wasm_signer_bg.wasm.d.ts +2 -0
- package/dist/web/rolly_wasm_signer.d.ts +24 -0
- package/dist/web/rolly_wasm_signer.js +49 -0
- package/dist/web/rolly_wasm_signer_bg.wasm +0 -0
- package/dist/web/rolly_wasm_signer_bg.wasm.d.ts +2 -0
- package/js/browser.mjs +2 -0
- package/js/index.d.ts +2 -0
- package/js/node-inline.cjs +2 -0
- package/js/node-inline.mjs +2 -0
- package/js/node.cjs +2 -0
- package/js/node.mjs +2 -0
- package/js/react.mjs +4 -0
- package/package.json +1 -1
|
@@ -49,6 +49,18 @@ export function compute_payout_coinflip(random: BigUint64Array, bet_atomic: bigi
|
|
|
49
49
|
*/
|
|
50
50
|
export function compute_payout_dice(random: BigUint64Array, bet_atomic: bigint, game_mode: number, prediction_lo: number, prediction_hi: number): BigUint64Array;
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Full limbo payout computation — pure integer arithmetic, zero floats.
|
|
54
|
+
*
|
|
55
|
+
* `random`: 4 Goldilocks field elements (Poseidon2 output).
|
|
56
|
+
* `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
|
|
57
|
+
* `prediction_x100`: target multiplier × 100 (101..999999, i.e. 1.01x–9999.99x).
|
|
58
|
+
* `rtp_numer`: RTP numerator for this bet (90–99). Stored per-bet, included in prediction_hash.
|
|
59
|
+
*
|
|
60
|
+
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier×10000]`.
|
|
61
|
+
*/
|
|
62
|
+
export function compute_payout_limbo(random: BigUint64Array, bet_atomic: bigint, prediction_x100: number, rtp_numer: number): BigUint64Array;
|
|
63
|
+
|
|
52
64
|
/**
|
|
53
65
|
* Full plinko payout computation — pure integer arithmetic, zero floats.
|
|
54
66
|
*
|
|
@@ -69,6 +81,7 @@ export function compute_payout_plinko(random: BigUint64Array, bet_atomic: bigint
|
|
|
69
81
|
* and the in-circuit `build_prediction_hash`.
|
|
70
82
|
*
|
|
71
83
|
* Semantics of p0–p2 depend on the game:
|
|
84
|
+
* Limbo: `(rtp_numer, prediction_x100, 0)`
|
|
72
85
|
* Dice: `(mode, pred_lo, pred_hi)`
|
|
73
86
|
* Plinko: `(sector, rows, is_extreme)`
|
|
74
87
|
* CoinFlip: `(prediction, 0, 0)`
|
|
@@ -89,6 +102,15 @@ export function compute_roll_coinflip(random: BigUint64Array): number;
|
|
|
89
102
|
*/
|
|
90
103
|
export function compute_roll_dice(random: BigUint64Array): number;
|
|
91
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Extract limbo result multiplier × 100 from Poseidon2 random output.
|
|
107
|
+
*
|
|
108
|
+
* `random` must be exactly 4 elements.
|
|
109
|
+
* `rtp_numer` must be in [90, 99].
|
|
110
|
+
* Returns the clamped multiplier × 100 (101..999999).
|
|
111
|
+
*/
|
|
112
|
+
export function compute_roll_limbo(random: BigUint64Array, rtp_numer: number): number;
|
|
113
|
+
|
|
92
114
|
/**
|
|
93
115
|
* Extract plinko bucket index from Poseidon2 random output.
|
|
94
116
|
*
|
|
@@ -126,6 +126,38 @@ function compute_payout_dice(random, bet_atomic, game_mode, prediction_lo, predi
|
|
|
126
126
|
}
|
|
127
127
|
exports.compute_payout_dice = compute_payout_dice;
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Full limbo payout computation — pure integer arithmetic, zero floats.
|
|
131
|
+
*
|
|
132
|
+
* `random`: 4 Goldilocks field elements (Poseidon2 output).
|
|
133
|
+
* `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
|
|
134
|
+
* `prediction_x100`: target multiplier × 100 (101..999999, i.e. 1.01x–9999.99x).
|
|
135
|
+
* `rtp_numer`: RTP numerator for this bet (90–99). Stored per-bet, included in prediction_hash.
|
|
136
|
+
*
|
|
137
|
+
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier×10000]`.
|
|
138
|
+
* @param {BigUint64Array} random
|
|
139
|
+
* @param {bigint} bet_atomic
|
|
140
|
+
* @param {number} prediction_x100
|
|
141
|
+
* @param {number} rtp_numer
|
|
142
|
+
* @returns {BigUint64Array}
|
|
143
|
+
*/
|
|
144
|
+
function compute_payout_limbo(random, bet_atomic, prediction_x100, rtp_numer) {
|
|
145
|
+
try {
|
|
146
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
147
|
+
const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
|
|
148
|
+
const len0 = WASM_VECTOR_LEN;
|
|
149
|
+
wasm.compute_payout_limbo(retptr, ptr0, len0, bet_atomic, prediction_x100, rtp_numer);
|
|
150
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
151
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
152
|
+
var v2 = getArrayU64FromWasm0(r0, r1).slice();
|
|
153
|
+
wasm.__wbindgen_export2(r0, r1 * 8, 8);
|
|
154
|
+
return v2;
|
|
155
|
+
} finally {
|
|
156
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.compute_payout_limbo = compute_payout_limbo;
|
|
160
|
+
|
|
129
161
|
/**
|
|
130
162
|
* Full plinko payout computation — pure integer arithmetic, zero floats.
|
|
131
163
|
*
|
|
@@ -167,6 +199,7 @@ exports.compute_payout_plinko = compute_payout_plinko;
|
|
|
167
199
|
* and the in-circuit `build_prediction_hash`.
|
|
168
200
|
*
|
|
169
201
|
* Semantics of p0–p2 depend on the game:
|
|
202
|
+
* Limbo: `(rtp_numer, prediction_x100, 0)`
|
|
170
203
|
* Dice: `(mode, pred_lo, pred_hi)`
|
|
171
204
|
* Plinko: `(sector, rows, is_extreme)`
|
|
172
205
|
* CoinFlip: `(prediction, 0, 0)`
|
|
@@ -221,6 +254,24 @@ function compute_roll_dice(random) {
|
|
|
221
254
|
}
|
|
222
255
|
exports.compute_roll_dice = compute_roll_dice;
|
|
223
256
|
|
|
257
|
+
/**
|
|
258
|
+
* Extract limbo result multiplier × 100 from Poseidon2 random output.
|
|
259
|
+
*
|
|
260
|
+
* `random` must be exactly 4 elements.
|
|
261
|
+
* `rtp_numer` must be in [90, 99].
|
|
262
|
+
* Returns the clamped multiplier × 100 (101..999999).
|
|
263
|
+
* @param {BigUint64Array} random
|
|
264
|
+
* @param {number} rtp_numer
|
|
265
|
+
* @returns {number}
|
|
266
|
+
*/
|
|
267
|
+
function compute_roll_limbo(random, rtp_numer) {
|
|
268
|
+
const ptr0 = passArray64ToWasm0(random, wasm.__wbindgen_export3);
|
|
269
|
+
const len0 = WASM_VECTOR_LEN;
|
|
270
|
+
const ret = wasm.compute_roll_limbo(ptr0, len0, rtp_numer);
|
|
271
|
+
return ret >>> 0;
|
|
272
|
+
}
|
|
273
|
+
exports.compute_roll_limbo = compute_roll_limbo;
|
|
274
|
+
|
|
224
275
|
/**
|
|
225
276
|
* Extract plinko bucket index from Poseidon2 random output.
|
|
226
277
|
*
|
|
Binary file
|
|
@@ -6,10 +6,12 @@ export const compute_address_hash: (a: number, b: number, c: number) => void;
|
|
|
6
6
|
export const compute_multi_dice: (a: number) => bigint;
|
|
7
7
|
export const compute_payout_coinflip: (a: number, b: number, c: number, d: bigint, e: number) => void;
|
|
8
8
|
export const compute_payout_dice: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
9
|
+
export const compute_payout_limbo: (a: number, b: number, c: number, d: bigint, e: number, f: number) => void;
|
|
9
10
|
export const compute_payout_plinko: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number) => void;
|
|
10
11
|
export const compute_prediction_hash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
11
12
|
export const compute_roll_coinflip: (a: number, b: number) => number;
|
|
12
13
|
export const compute_roll_dice: (a: number, b: number) => number;
|
|
14
|
+
export const compute_roll_limbo: (a: number, b: number, c: number) => number;
|
|
13
15
|
export const compute_roll_plinko: (a: number, b: number, c: number) => number;
|
|
14
16
|
export const compute_server_seed_hash: (a: number, b: number, c: number) => void;
|
|
15
17
|
export const compute_user_seed_binding: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
@@ -49,6 +49,18 @@ export function compute_payout_coinflip(random: BigUint64Array, bet_atomic: bigi
|
|
|
49
49
|
*/
|
|
50
50
|
export function compute_payout_dice(random: BigUint64Array, bet_atomic: bigint, game_mode: number, prediction_lo: number, prediction_hi: number): BigUint64Array;
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Full limbo payout computation — pure integer arithmetic, zero floats.
|
|
54
|
+
*
|
|
55
|
+
* `random`: 4 Goldilocks field elements (Poseidon2 output).
|
|
56
|
+
* `bet_atomic`: bet in atomic units (1 USDT = 1_000_000).
|
|
57
|
+
* `prediction_x100`: target multiplier × 100 (101..999999, i.e. 1.01x–9999.99x).
|
|
58
|
+
* `rtp_numer`: RTP numerator for this bet (90–99). Stored per-bet, included in prediction_hash.
|
|
59
|
+
*
|
|
60
|
+
* Returns `BigUint64Array[4]`: `[win_amount, multiplier_x100, is_win (0|1), payout_multiplier×10000]`.
|
|
61
|
+
*/
|
|
62
|
+
export function compute_payout_limbo(random: BigUint64Array, bet_atomic: bigint, prediction_x100: number, rtp_numer: number): BigUint64Array;
|
|
63
|
+
|
|
52
64
|
/**
|
|
53
65
|
* Full plinko payout computation — pure integer arithmetic, zero floats.
|
|
54
66
|
*
|
|
@@ -69,6 +81,7 @@ export function compute_payout_plinko(random: BigUint64Array, bet_atomic: bigint
|
|
|
69
81
|
* and the in-circuit `build_prediction_hash`.
|
|
70
82
|
*
|
|
71
83
|
* Semantics of p0–p2 depend on the game:
|
|
84
|
+
* Limbo: `(rtp_numer, prediction_x100, 0)`
|
|
72
85
|
* Dice: `(mode, pred_lo, pred_hi)`
|
|
73
86
|
* Plinko: `(sector, rows, is_extreme)`
|
|
74
87
|
* CoinFlip: `(prediction, 0, 0)`
|
|
@@ -89,6 +102,15 @@ export function compute_roll_coinflip(random: BigUint64Array): number;
|
|
|
89
102
|
*/
|
|
90
103
|
export function compute_roll_dice(random: BigUint64Array): number;
|
|
91
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Extract limbo result multiplier × 100 from Poseidon2 random output.
|
|
107
|
+
*
|
|
108
|
+
* `random` must be exactly 4 elements.
|
|
109
|
+
* `rtp_numer` must be in [90, 99].
|
|
110
|
+
* Returns the clamped multiplier × 100 (101..999999).
|
|
111
|
+
*/
|
|
112
|
+
export function compute_roll_limbo(random: BigUint64Array, rtp_numer: number): number;
|
|
113
|
+
|
|
92
114
|
/**
|
|
93
115
|
* Extract plinko bucket index from Poseidon2 random output.
|
|
94
116
|
*
|