@rolly-dev/witness-core 0.2.2 → 0.3.1
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/index.d.ts
CHANGED
|
@@ -124,6 +124,11 @@ export interface ProcessTxRequest {
|
|
|
124
124
|
gameMode?: number
|
|
125
125
|
predictionLo?: number
|
|
126
126
|
predictionHi?: number
|
|
127
|
+
/**
|
|
128
|
+
* Blackjack only: base stake (decimal string). The engine replays the round
|
|
129
|
+
* from this to derive the TOTAL staked (recorded as `amount`) and the win.
|
|
130
|
+
*/
|
|
131
|
+
baseBet?: string
|
|
127
132
|
userSecretRandom?: Buffer
|
|
128
133
|
useGameLock?: boolean
|
|
129
134
|
maxBlockTimestamp?: string
|
|
@@ -272,6 +277,34 @@ export declare class MerkleEngine {
|
|
|
272
277
|
/** Spendable balance minus all frozen buckets (withdrawal + game locks). */
|
|
273
278
|
getAvailable(userId: number): bigint
|
|
274
279
|
getSeedHash(userId: number): Buffer
|
|
280
|
+
/**
|
|
281
|
+
* Read-only reveal of the user's current committed full server seed (64 LE
|
|
282
|
+
* bytes = 8 limbs). The blackjack backend needs it at DEAL time to unfold
|
|
283
|
+
* the fair shoe and run the round off-chain before the single settle
|
|
284
|
+
* `in_house_bet`. This does NOT advance the seed chain: it returns the seed
|
|
285
|
+
* already committed by the previous slot's `next_seed_hash`, and the
|
|
286
|
+
* eventual blackjack settle IHB is the next tx to consume / rotate it (so
|
|
287
|
+
* the backend MUST keep the round the next IHB for this user). Returns an
|
|
288
|
+
* all-zero 64-byte buffer when the user has no initialized seed yet.
|
|
289
|
+
*/
|
|
290
|
+
getServerSeed(userId: number): Buffer
|
|
291
|
+
/**
|
|
292
|
+
* Pin `user_id`'s server seed for an open off-chain blackjack round. While
|
|
293
|
+
* reserved, any OTHER user-seed `in_house_bet` (dice/limbo/keno/plinko/
|
|
294
|
+
* coinflip) is rejected with `SeedReserved`; the blackjack settle IHB (and
|
|
295
|
+
* only it) is allowed through and clears the reservation. Crash is
|
|
296
|
+
* unaffected — it draws from the house account seed, not the user's.
|
|
297
|
+
* A HARD pin with no expiry: only the settle or `release_seed` lifts it.
|
|
298
|
+
* NON-consensus.
|
|
299
|
+
*/
|
|
300
|
+
reserveSeed(userId: number): void
|
|
301
|
+
/**
|
|
302
|
+
* Release a seed reservation (blackjack round settled or rolled back).
|
|
303
|
+
* No-op when the user has none.
|
|
304
|
+
*/
|
|
305
|
+
releaseSeed(userId: number): void
|
|
306
|
+
/** Whether `user_id` currently holds a live (non-expired) seed reservation. */
|
|
307
|
+
isSeedReserved(userId: number): boolean
|
|
275
308
|
getPkHash(userId: number): Buffer
|
|
276
309
|
getAddressHash(userId: number): Buffer
|
|
277
310
|
getLockedTotal(userId: number): bigint
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|