bulk-keychain-wasm 0.1.12 → 0.1.14
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/bulk_keychain_wasm.d.ts +155 -0
- package/bulk_keychain_wasm.js +490 -75
- package/bulk_keychain_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/bulk_keychain_wasm.d.ts
CHANGED
|
@@ -141,6 +141,14 @@ export class WasmSigner {
|
|
|
141
141
|
* Sign multiple orders - each becomes its own transaction (parallel)
|
|
142
142
|
*/
|
|
143
143
|
signAll(orders: any, base_nonce?: number | null): any;
|
|
144
|
+
/**
|
|
145
|
+
* Sign a multisig creation
|
|
146
|
+
*/
|
|
147
|
+
signCreateMultisig(signers: any, threshold: number, time_lock_secs?: number | null, proposal_lifetime_secs?: number | null, nonce?: number | null): any;
|
|
148
|
+
/**
|
|
149
|
+
* Sign a sub-account creation (optional initial margin transfer)
|
|
150
|
+
*/
|
|
151
|
+
signCreateSubAccount(name: string, margin_symbol?: string | null, margin_amount?: number | null, nonce?: number | null): any;
|
|
144
152
|
/**
|
|
145
153
|
* Sign a faucet request (testnet only)
|
|
146
154
|
*/
|
|
@@ -149,6 +157,26 @@ export class WasmSigner {
|
|
|
149
157
|
* Sign multiple orders atomically in ONE transaction
|
|
150
158
|
*/
|
|
151
159
|
signGroup(orders: any, nonce?: number | null): any;
|
|
160
|
+
/**
|
|
161
|
+
* Sign a multisig approval
|
|
162
|
+
*/
|
|
163
|
+
signMultisigApprove(multisig: string, proposal_id: number, nonce?: number | null): any;
|
|
164
|
+
/**
|
|
165
|
+
* Sign a multisig cancellation
|
|
166
|
+
*/
|
|
167
|
+
signMultisigCancel(multisig: string, proposal_id: number, nonce?: number | null): any;
|
|
168
|
+
/**
|
|
169
|
+
* Sign a multisig execution
|
|
170
|
+
*/
|
|
171
|
+
signMultisigExecute(multisig: string, proposal_id: number, nonce?: number | null): any;
|
|
172
|
+
/**
|
|
173
|
+
* Sign a multisig proposal
|
|
174
|
+
*/
|
|
175
|
+
signMultisigPropose(multisig: string, actions: any, nonce?: number | null): any;
|
|
176
|
+
/**
|
|
177
|
+
* Sign a multisig rejection
|
|
178
|
+
*/
|
|
179
|
+
signMultisigReject(multisig: string, proposal_id: number, nonce?: number | null): any;
|
|
152
180
|
/**
|
|
153
181
|
* Sign one or more oracle price updates (`px`)
|
|
154
182
|
*/
|
|
@@ -165,6 +193,36 @@ export class WasmSigner {
|
|
|
165
193
|
* Sign a batch Pyth oracle update (`o`)
|
|
166
194
|
*/
|
|
167
195
|
signPythOracle(oracles: any, nonce?: number | null): any;
|
|
196
|
+
/**
|
|
197
|
+
* Sign a sub-account removal
|
|
198
|
+
*
|
|
199
|
+
* @param toRemove - sub-account pubkey to remove (base58)
|
|
200
|
+
* @param nonce - optional nonce
|
|
201
|
+
*/
|
|
202
|
+
signRemoveSubAccount(to_remove: string, nonce?: number | null): any;
|
|
203
|
+
/**
|
|
204
|
+
* Sign a sub-account rename
|
|
205
|
+
*
|
|
206
|
+
* @param subaccount - sub-account pubkey to rename (base58)
|
|
207
|
+
* @param name - new display name
|
|
208
|
+
* @param nonce - optional nonce
|
|
209
|
+
*/
|
|
210
|
+
signRenameSubAccount(subaccount: string, name: string, nonce?: number | null): any;
|
|
211
|
+
/**
|
|
212
|
+
* Sign a margin transfer between accounts
|
|
213
|
+
*
|
|
214
|
+
* @param kind - "internal" or "external" (defaults to "internal")
|
|
215
|
+
* @param fromPubkey - source account pubkey (base58)
|
|
216
|
+
* @param toPubkey - destination account pubkey (base58)
|
|
217
|
+
* @param marginSymbol - margin asset symbol (e.g. "USDC")
|
|
218
|
+
* @param marginAmount - amount to transfer
|
|
219
|
+
* @param nonce - optional nonce
|
|
220
|
+
*/
|
|
221
|
+
signTransfer(kind: string | null | undefined, from_pubkey: string, to_pubkey: string, margin_symbol: string, margin_amount: number, nonce?: number | null): any;
|
|
222
|
+
/**
|
|
223
|
+
* Sign a multisig policy update
|
|
224
|
+
*/
|
|
225
|
+
signUpdateMultisigPolicy(multisig: string, signers: any, threshold: number, time_lock_secs?: number | null, proposal_lifetime_secs?: number | null, nonce?: number | null): any;
|
|
168
226
|
/**
|
|
169
227
|
* Sign user settings update
|
|
170
228
|
*/
|
|
@@ -226,6 +284,23 @@ export function prepareAgentWallet(agent_pubkey: string, _delete: boolean, optio
|
|
|
226
284
|
*/
|
|
227
285
|
export function prepareAll(orders: any, options: any): WasmPreparedMessage[];
|
|
228
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Prepare a multisig creation for external signing
|
|
289
|
+
*
|
|
290
|
+
* @param signers - signer pubkeys (base58)
|
|
291
|
+
* @param threshold - approvals required
|
|
292
|
+
* @param options - { account: string, signer?: string, nonce?: number, timeLockSecs?: number, proposalLifetimeSecs?: number }
|
|
293
|
+
*/
|
|
294
|
+
export function prepareCreateMultisig(signers: any, threshold: number, options: any): WasmPreparedMessage;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Prepare a sub-account creation for external signing
|
|
298
|
+
*
|
|
299
|
+
* @param name - Sub-account display name
|
|
300
|
+
* @param options - { account: string, signer?: string, nonce?: number, marginSymbol?: string, marginAmount?: number }
|
|
301
|
+
*/
|
|
302
|
+
export function prepareCreateSubAccount(name: string, options: any): WasmPreparedMessage;
|
|
303
|
+
|
|
229
304
|
/**
|
|
230
305
|
* Prepare faucet request for external signing
|
|
231
306
|
*
|
|
@@ -244,6 +319,31 @@ export function prepareFaucet(options: any): WasmPreparedMessage;
|
|
|
244
319
|
*/
|
|
245
320
|
export function prepareGroup(orders: any, options: any): WasmPreparedMessage;
|
|
246
321
|
|
|
322
|
+
/**
|
|
323
|
+
* Prepare a multisig approval for external signing
|
|
324
|
+
*/
|
|
325
|
+
export function prepareMultisigApprove(multisig: string, proposal_id: number, options: any): WasmPreparedMessage;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Prepare a multisig cancellation for external signing
|
|
329
|
+
*/
|
|
330
|
+
export function prepareMultisigCancel(multisig: string, proposal_id: number, options: any): WasmPreparedMessage;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Prepare a multisig execution for external signing
|
|
334
|
+
*/
|
|
335
|
+
export function prepareMultisigExecute(multisig: string, proposal_id: number, options: any): WasmPreparedMessage;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Prepare a multisig proposal for external signing
|
|
339
|
+
*/
|
|
340
|
+
export function prepareMultisigPropose(multisig: string, actions: any, options: any): WasmPreparedMessage;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Prepare a multisig rejection for external signing
|
|
344
|
+
*/
|
|
345
|
+
export function prepareMultisigReject(multisig: string, proposal_id: number, options: any): WasmPreparedMessage;
|
|
346
|
+
|
|
247
347
|
/**
|
|
248
348
|
* Prepare a single order for external wallet signing
|
|
249
349
|
*
|
|
@@ -263,6 +363,39 @@ export function prepareGroup(orders: any, options: any): WasmPreparedMessage;
|
|
|
263
363
|
*/
|
|
264
364
|
export function prepareOrder(order: any, options: any): WasmPreparedMessage;
|
|
265
365
|
|
|
366
|
+
/**
|
|
367
|
+
* Prepare a sub-account removal for external signing
|
|
368
|
+
*
|
|
369
|
+
* @param toRemove - sub-account pubkey to remove (base58)
|
|
370
|
+
* @param options - { account: string, signer?: string, nonce?: number }
|
|
371
|
+
*/
|
|
372
|
+
export function prepareRemoveSubAccount(to_remove: string, options: any): WasmPreparedMessage;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Prepare a sub-account rename for external signing
|
|
376
|
+
*
|
|
377
|
+
* @param subaccount - sub-account pubkey to rename (base58)
|
|
378
|
+
* @param name - new display name
|
|
379
|
+
* @param options - { account: string, signer?: string, nonce?: number }
|
|
380
|
+
*/
|
|
381
|
+
export function prepareRenameSubAccount(subaccount: string, name: string, options: any): WasmPreparedMessage;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Prepare a margin transfer for external signing
|
|
385
|
+
*
|
|
386
|
+
* @param fromPubkey - source account pubkey (base58)
|
|
387
|
+
* @param toPubkey - destination account pubkey (base58)
|
|
388
|
+
* @param marginSymbol - margin asset symbol
|
|
389
|
+
* @param marginAmount - amount to transfer
|
|
390
|
+
* @param options - { account: string, signer?: string, nonce?: number, kind?: "internal" | "external" }
|
|
391
|
+
*/
|
|
392
|
+
export function prepareTransfer(from_pubkey: string, to_pubkey: string, margin_symbol: string, margin_amount: number, options: any): WasmPreparedMessage;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Prepare a multisig policy update for external signing
|
|
396
|
+
*/
|
|
397
|
+
export function prepareUpdateMultisigPolicy(multisig: string, signers: any, threshold: number, options: any): WasmPreparedMessage;
|
|
398
|
+
|
|
266
399
|
/**
|
|
267
400
|
* Prepare user settings update for external signing
|
|
268
401
|
*
|
|
@@ -298,9 +431,20 @@ export interface InitOutput {
|
|
|
298
431
|
readonly finalizeTransaction: (a: any, b: number, c: number) => [number, number, number];
|
|
299
432
|
readonly prepareAgentWallet: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
300
433
|
readonly prepareAll: (a: any, b: any) => [number, number, number, number];
|
|
434
|
+
readonly prepareCreateMultisig: (a: any, b: number, c: any) => [number, number, number];
|
|
435
|
+
readonly prepareCreateSubAccount: (a: number, b: number, c: any) => [number, number, number];
|
|
301
436
|
readonly prepareFaucet: (a: any) => [number, number, number];
|
|
302
437
|
readonly prepareGroup: (a: any, b: any) => [number, number, number];
|
|
438
|
+
readonly prepareMultisigApprove: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
439
|
+
readonly prepareMultisigCancel: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
440
|
+
readonly prepareMultisigExecute: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
441
|
+
readonly prepareMultisigPropose: (a: number, b: number, c: any, d: any) => [number, number, number];
|
|
442
|
+
readonly prepareMultisigReject: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
303
443
|
readonly prepareOrder: (a: any, b: any) => [number, number, number];
|
|
444
|
+
readonly prepareRemoveSubAccount: (a: number, b: number, c: any) => [number, number, number];
|
|
445
|
+
readonly prepareRenameSubAccount: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
446
|
+
readonly prepareTransfer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any) => [number, number, number];
|
|
447
|
+
readonly prepareUpdateMultisigPolicy: (a: number, b: number, c: any, d: number, e: any) => [number, number, number];
|
|
304
448
|
readonly prepareUpdateUserSettings: (a: any, b: any) => [number, number, number];
|
|
305
449
|
readonly randomHash: () => [number, number];
|
|
306
450
|
readonly validateHash: (a: number, b: number) => number;
|
|
@@ -334,11 +478,22 @@ export interface InitOutput {
|
|
|
334
478
|
readonly wasmsigner_sign: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
335
479
|
readonly wasmsigner_signAgentWallet: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
336
480
|
readonly wasmsigner_signAll: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
481
|
+
readonly wasmsigner_signCreateMultisig: (a: number, b: any, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
482
|
+
readonly wasmsigner_signCreateSubAccount: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
|
|
337
483
|
readonly wasmsigner_signFaucet: (a: number, b: number, c: number) => [number, number, number];
|
|
338
484
|
readonly wasmsigner_signGroup: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
485
|
+
readonly wasmsigner_signMultisigApprove: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
486
|
+
readonly wasmsigner_signMultisigCancel: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
487
|
+
readonly wasmsigner_signMultisigExecute: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
488
|
+
readonly wasmsigner_signMultisigPropose: (a: number, b: number, c: number, d: any, e: number, f: number) => [number, number, number];
|
|
489
|
+
readonly wasmsigner_signMultisigReject: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
339
490
|
readonly wasmsigner_signOraclePrices: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
340
491
|
readonly wasmsigner_signOrdersBatch: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
341
492
|
readonly wasmsigner_signPythOracle: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
493
|
+
readonly wasmsigner_signRemoveSubAccount: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
494
|
+
readonly wasmsigner_signRenameSubAccount: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
495
|
+
readonly wasmsigner_signTransfer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => [number, number, number];
|
|
496
|
+
readonly wasmsigner_signUpdateMultisigPolicy: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
|
|
342
497
|
readonly wasmsigner_signUserSettings: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
343
498
|
readonly wasmsigner_signWhitelistFaucet: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
344
499
|
readonly wasmsigner_withNonceManager: (a: number, b: number, c: number) => [number, number, number];
|
package/bulk_keychain_wasm.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export class WasmKeypair {
|
|
7
7
|
static __wrap(ptr) {
|
|
8
|
-
ptr = ptr >>> 0;
|
|
9
8
|
const obj = Object.create(WasmKeypair.prototype);
|
|
10
9
|
obj.__wbg_ptr = ptr;
|
|
11
10
|
WasmKeypairFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -54,7 +53,7 @@ export class WasmKeypair {
|
|
|
54
53
|
*/
|
|
55
54
|
constructor() {
|
|
56
55
|
const ret = wasm.wasmkeypair_new();
|
|
57
|
-
this.__wbg_ptr = ret
|
|
56
|
+
this.__wbg_ptr = ret;
|
|
58
57
|
WasmKeypairFinalization.register(this, this.__wbg_ptr, this);
|
|
59
58
|
return this;
|
|
60
59
|
}
|
|
@@ -121,7 +120,6 @@ if (Symbol.dispose) WasmKeypair.prototype[Symbol.dispose] = WasmKeypair.prototyp
|
|
|
121
120
|
*/
|
|
122
121
|
export class WasmPreparedMessage {
|
|
123
122
|
static __wrap(ptr) {
|
|
124
|
-
ptr = ptr >>> 0;
|
|
125
123
|
const obj = Object.create(WasmPreparedMessage.prototype);
|
|
126
124
|
obj.__wbg_ptr = ptr;
|
|
127
125
|
WasmPreparedMessageFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -301,7 +299,6 @@ if (Symbol.dispose) WasmPreparedMessage.prototype[Symbol.dispose] = WasmPrepared
|
|
|
301
299
|
*/
|
|
302
300
|
export class WasmSigner {
|
|
303
301
|
static __wrap(ptr) {
|
|
304
|
-
ptr = ptr >>> 0;
|
|
305
302
|
const obj = Object.create(WasmSigner.prototype);
|
|
306
303
|
obj.__wbg_ptr = ptr;
|
|
307
304
|
WasmSignerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -354,7 +351,7 @@ export class WasmSigner {
|
|
|
354
351
|
constructor(keypair) {
|
|
355
352
|
_assertClass(keypair, WasmKeypair);
|
|
356
353
|
const ret = wasm.wasmsigner_new(keypair.__wbg_ptr);
|
|
357
|
-
this.__wbg_ptr = ret
|
|
354
|
+
this.__wbg_ptr = ret;
|
|
358
355
|
WasmSignerFinalization.register(this, this.__wbg_ptr, this);
|
|
359
356
|
return this;
|
|
360
357
|
}
|
|
@@ -430,6 +427,41 @@ export class WasmSigner {
|
|
|
430
427
|
}
|
|
431
428
|
return takeFromExternrefTable0(ret[0]);
|
|
432
429
|
}
|
|
430
|
+
/**
|
|
431
|
+
* Sign a multisig creation
|
|
432
|
+
* @param {any} signers
|
|
433
|
+
* @param {number} threshold
|
|
434
|
+
* @param {number | null} [time_lock_secs]
|
|
435
|
+
* @param {number | null} [proposal_lifetime_secs]
|
|
436
|
+
* @param {number | null} [nonce]
|
|
437
|
+
* @returns {any}
|
|
438
|
+
*/
|
|
439
|
+
signCreateMultisig(signers, threshold, time_lock_secs, proposal_lifetime_secs, nonce) {
|
|
440
|
+
const ret = wasm.wasmsigner_signCreateMultisig(this.__wbg_ptr, signers, threshold, isLikeNone(time_lock_secs) ? Number.MAX_SAFE_INTEGER : (time_lock_secs) >>> 0, isLikeNone(proposal_lifetime_secs) ? Number.MAX_SAFE_INTEGER : (proposal_lifetime_secs) >>> 0, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
441
|
+
if (ret[2]) {
|
|
442
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
443
|
+
}
|
|
444
|
+
return takeFromExternrefTable0(ret[0]);
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Sign a sub-account creation (optional initial margin transfer)
|
|
448
|
+
* @param {string} name
|
|
449
|
+
* @param {string | null} [margin_symbol]
|
|
450
|
+
* @param {number | null} [margin_amount]
|
|
451
|
+
* @param {number | null} [nonce]
|
|
452
|
+
* @returns {any}
|
|
453
|
+
*/
|
|
454
|
+
signCreateSubAccount(name, margin_symbol, margin_amount, nonce) {
|
|
455
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
456
|
+
const len0 = WASM_VECTOR_LEN;
|
|
457
|
+
var ptr1 = isLikeNone(margin_symbol) ? 0 : passStringToWasm0(margin_symbol, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
458
|
+
var len1 = WASM_VECTOR_LEN;
|
|
459
|
+
const ret = wasm.wasmsigner_signCreateSubAccount(this.__wbg_ptr, ptr0, len0, ptr1, len1, !isLikeNone(margin_amount), isLikeNone(margin_amount) ? 0 : margin_amount, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
460
|
+
if (ret[2]) {
|
|
461
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
462
|
+
}
|
|
463
|
+
return takeFromExternrefTable0(ret[0]);
|
|
464
|
+
}
|
|
433
465
|
/**
|
|
434
466
|
* Sign a faucet request (testnet only)
|
|
435
467
|
* @param {number | null} [nonce]
|
|
@@ -455,6 +487,86 @@ export class WasmSigner {
|
|
|
455
487
|
}
|
|
456
488
|
return takeFromExternrefTable0(ret[0]);
|
|
457
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* Sign a multisig approval
|
|
492
|
+
* @param {string} multisig
|
|
493
|
+
* @param {number} proposal_id
|
|
494
|
+
* @param {number | null} [nonce]
|
|
495
|
+
* @returns {any}
|
|
496
|
+
*/
|
|
497
|
+
signMultisigApprove(multisig, proposal_id, nonce) {
|
|
498
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
|
+
const len0 = WASM_VECTOR_LEN;
|
|
500
|
+
const ret = wasm.wasmsigner_signMultisigApprove(this.__wbg_ptr, ptr0, len0, proposal_id, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
501
|
+
if (ret[2]) {
|
|
502
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
503
|
+
}
|
|
504
|
+
return takeFromExternrefTable0(ret[0]);
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Sign a multisig cancellation
|
|
508
|
+
* @param {string} multisig
|
|
509
|
+
* @param {number} proposal_id
|
|
510
|
+
* @param {number | null} [nonce]
|
|
511
|
+
* @returns {any}
|
|
512
|
+
*/
|
|
513
|
+
signMultisigCancel(multisig, proposal_id, nonce) {
|
|
514
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
515
|
+
const len0 = WASM_VECTOR_LEN;
|
|
516
|
+
const ret = wasm.wasmsigner_signMultisigCancel(this.__wbg_ptr, ptr0, len0, proposal_id, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
517
|
+
if (ret[2]) {
|
|
518
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
519
|
+
}
|
|
520
|
+
return takeFromExternrefTable0(ret[0]);
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Sign a multisig execution
|
|
524
|
+
* @param {string} multisig
|
|
525
|
+
* @param {number} proposal_id
|
|
526
|
+
* @param {number | null} [nonce]
|
|
527
|
+
* @returns {any}
|
|
528
|
+
*/
|
|
529
|
+
signMultisigExecute(multisig, proposal_id, nonce) {
|
|
530
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
531
|
+
const len0 = WASM_VECTOR_LEN;
|
|
532
|
+
const ret = wasm.wasmsigner_signMultisigExecute(this.__wbg_ptr, ptr0, len0, proposal_id, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
533
|
+
if (ret[2]) {
|
|
534
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
535
|
+
}
|
|
536
|
+
return takeFromExternrefTable0(ret[0]);
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Sign a multisig proposal
|
|
540
|
+
* @param {string} multisig
|
|
541
|
+
* @param {any} actions
|
|
542
|
+
* @param {number | null} [nonce]
|
|
543
|
+
* @returns {any}
|
|
544
|
+
*/
|
|
545
|
+
signMultisigPropose(multisig, actions, nonce) {
|
|
546
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
547
|
+
const len0 = WASM_VECTOR_LEN;
|
|
548
|
+
const ret = wasm.wasmsigner_signMultisigPropose(this.__wbg_ptr, ptr0, len0, actions, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
549
|
+
if (ret[2]) {
|
|
550
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
551
|
+
}
|
|
552
|
+
return takeFromExternrefTable0(ret[0]);
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Sign a multisig rejection
|
|
556
|
+
* @param {string} multisig
|
|
557
|
+
* @param {number} proposal_id
|
|
558
|
+
* @param {number | null} [nonce]
|
|
559
|
+
* @returns {any}
|
|
560
|
+
*/
|
|
561
|
+
signMultisigReject(multisig, proposal_id, nonce) {
|
|
562
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
563
|
+
const len0 = WASM_VECTOR_LEN;
|
|
564
|
+
const ret = wasm.wasmsigner_signMultisigReject(this.__wbg_ptr, ptr0, len0, proposal_id, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
565
|
+
if (ret[2]) {
|
|
566
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
567
|
+
}
|
|
568
|
+
return takeFromExternrefTable0(ret[0]);
|
|
569
|
+
}
|
|
458
570
|
/**
|
|
459
571
|
* Sign one or more oracle price updates (`px`)
|
|
460
572
|
* @param {any} oracles
|
|
@@ -507,6 +619,97 @@ export class WasmSigner {
|
|
|
507
619
|
}
|
|
508
620
|
return takeFromExternrefTable0(ret[0]);
|
|
509
621
|
}
|
|
622
|
+
/**
|
|
623
|
+
* Sign a sub-account removal
|
|
624
|
+
*
|
|
625
|
+
* @param toRemove - sub-account pubkey to remove (base58)
|
|
626
|
+
* @param nonce - optional nonce
|
|
627
|
+
* @param {string} to_remove
|
|
628
|
+
* @param {number | null} [nonce]
|
|
629
|
+
* @returns {any}
|
|
630
|
+
*/
|
|
631
|
+
signRemoveSubAccount(to_remove, nonce) {
|
|
632
|
+
const ptr0 = passStringToWasm0(to_remove, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
633
|
+
const len0 = WASM_VECTOR_LEN;
|
|
634
|
+
const ret = wasm.wasmsigner_signRemoveSubAccount(this.__wbg_ptr, ptr0, len0, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
635
|
+
if (ret[2]) {
|
|
636
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
637
|
+
}
|
|
638
|
+
return takeFromExternrefTable0(ret[0]);
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Sign a sub-account rename
|
|
642
|
+
*
|
|
643
|
+
* @param subaccount - sub-account pubkey to rename (base58)
|
|
644
|
+
* @param name - new display name
|
|
645
|
+
* @param nonce - optional nonce
|
|
646
|
+
* @param {string} subaccount
|
|
647
|
+
* @param {string} name
|
|
648
|
+
* @param {number | null} [nonce]
|
|
649
|
+
* @returns {any}
|
|
650
|
+
*/
|
|
651
|
+
signRenameSubAccount(subaccount, name, nonce) {
|
|
652
|
+
const ptr0 = passStringToWasm0(subaccount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
653
|
+
const len0 = WASM_VECTOR_LEN;
|
|
654
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
655
|
+
const len1 = WASM_VECTOR_LEN;
|
|
656
|
+
const ret = wasm.wasmsigner_signRenameSubAccount(this.__wbg_ptr, ptr0, len0, ptr1, len1, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
657
|
+
if (ret[2]) {
|
|
658
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
659
|
+
}
|
|
660
|
+
return takeFromExternrefTable0(ret[0]);
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Sign a margin transfer between accounts
|
|
664
|
+
*
|
|
665
|
+
* @param kind - "internal" or "external" (defaults to "internal")
|
|
666
|
+
* @param fromPubkey - source account pubkey (base58)
|
|
667
|
+
* @param toPubkey - destination account pubkey (base58)
|
|
668
|
+
* @param marginSymbol - margin asset symbol (e.g. "USDC")
|
|
669
|
+
* @param marginAmount - amount to transfer
|
|
670
|
+
* @param nonce - optional nonce
|
|
671
|
+
* @param {string | null | undefined} kind
|
|
672
|
+
* @param {string} from_pubkey
|
|
673
|
+
* @param {string} to_pubkey
|
|
674
|
+
* @param {string} margin_symbol
|
|
675
|
+
* @param {number} margin_amount
|
|
676
|
+
* @param {number | null} [nonce]
|
|
677
|
+
* @returns {any}
|
|
678
|
+
*/
|
|
679
|
+
signTransfer(kind, from_pubkey, to_pubkey, margin_symbol, margin_amount, nonce) {
|
|
680
|
+
var ptr0 = isLikeNone(kind) ? 0 : passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
681
|
+
var len0 = WASM_VECTOR_LEN;
|
|
682
|
+
const ptr1 = passStringToWasm0(from_pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
683
|
+
const len1 = WASM_VECTOR_LEN;
|
|
684
|
+
const ptr2 = passStringToWasm0(to_pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
685
|
+
const len2 = WASM_VECTOR_LEN;
|
|
686
|
+
const ptr3 = passStringToWasm0(margin_symbol, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
687
|
+
const len3 = WASM_VECTOR_LEN;
|
|
688
|
+
const ret = wasm.wasmsigner_signTransfer(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, margin_amount, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
689
|
+
if (ret[2]) {
|
|
690
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
691
|
+
}
|
|
692
|
+
return takeFromExternrefTable0(ret[0]);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Sign a multisig policy update
|
|
696
|
+
* @param {string} multisig
|
|
697
|
+
* @param {any} signers
|
|
698
|
+
* @param {number} threshold
|
|
699
|
+
* @param {number | null} [time_lock_secs]
|
|
700
|
+
* @param {number | null} [proposal_lifetime_secs]
|
|
701
|
+
* @param {number | null} [nonce]
|
|
702
|
+
* @returns {any}
|
|
703
|
+
*/
|
|
704
|
+
signUpdateMultisigPolicy(multisig, signers, threshold, time_lock_secs, proposal_lifetime_secs, nonce) {
|
|
705
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
706
|
+
const len0 = WASM_VECTOR_LEN;
|
|
707
|
+
const ret = wasm.wasmsigner_signUpdateMultisigPolicy(this.__wbg_ptr, ptr0, len0, signers, threshold, isLikeNone(time_lock_secs) ? Number.MAX_SAFE_INTEGER : (time_lock_secs) >>> 0, isLikeNone(proposal_lifetime_secs) ? Number.MAX_SAFE_INTEGER : (proposal_lifetime_secs) >>> 0, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce);
|
|
708
|
+
if (ret[2]) {
|
|
709
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
710
|
+
}
|
|
711
|
+
return takeFromExternrefTable0(ret[0]);
|
|
712
|
+
}
|
|
510
713
|
/**
|
|
511
714
|
* Sign user settings update
|
|
512
715
|
* @param {any} settings
|
|
@@ -653,6 +856,44 @@ export function prepareAll(orders, options) {
|
|
|
653
856
|
return v1;
|
|
654
857
|
}
|
|
655
858
|
|
|
859
|
+
/**
|
|
860
|
+
* Prepare a multisig creation for external signing
|
|
861
|
+
*
|
|
862
|
+
* @param signers - signer pubkeys (base58)
|
|
863
|
+
* @param threshold - approvals required
|
|
864
|
+
* @param options - { account: string, signer?: string, nonce?: number, timeLockSecs?: number, proposalLifetimeSecs?: number }
|
|
865
|
+
* @param {any} signers
|
|
866
|
+
* @param {number} threshold
|
|
867
|
+
* @param {any} options
|
|
868
|
+
* @returns {WasmPreparedMessage}
|
|
869
|
+
*/
|
|
870
|
+
export function prepareCreateMultisig(signers, threshold, options) {
|
|
871
|
+
const ret = wasm.prepareCreateMultisig(signers, threshold, options);
|
|
872
|
+
if (ret[2]) {
|
|
873
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
874
|
+
}
|
|
875
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* Prepare a sub-account creation for external signing
|
|
880
|
+
*
|
|
881
|
+
* @param name - Sub-account display name
|
|
882
|
+
* @param options - { account: string, signer?: string, nonce?: number, marginSymbol?: string, marginAmount?: number }
|
|
883
|
+
* @param {string} name
|
|
884
|
+
* @param {any} options
|
|
885
|
+
* @returns {WasmPreparedMessage}
|
|
886
|
+
*/
|
|
887
|
+
export function prepareCreateSubAccount(name, options) {
|
|
888
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
889
|
+
const len0 = WASM_VECTOR_LEN;
|
|
890
|
+
const ret = wasm.prepareCreateSubAccount(ptr0, len0, options);
|
|
891
|
+
if (ret[2]) {
|
|
892
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
893
|
+
}
|
|
894
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
895
|
+
}
|
|
896
|
+
|
|
656
897
|
/**
|
|
657
898
|
* Prepare faucet request for external signing
|
|
658
899
|
*
|
|
@@ -688,6 +929,91 @@ export function prepareGroup(orders, options) {
|
|
|
688
929
|
return WasmPreparedMessage.__wrap(ret[0]);
|
|
689
930
|
}
|
|
690
931
|
|
|
932
|
+
/**
|
|
933
|
+
* Prepare a multisig approval for external signing
|
|
934
|
+
* @param {string} multisig
|
|
935
|
+
* @param {number} proposal_id
|
|
936
|
+
* @param {any} options
|
|
937
|
+
* @returns {WasmPreparedMessage}
|
|
938
|
+
*/
|
|
939
|
+
export function prepareMultisigApprove(multisig, proposal_id, options) {
|
|
940
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
941
|
+
const len0 = WASM_VECTOR_LEN;
|
|
942
|
+
const ret = wasm.prepareMultisigApprove(ptr0, len0, proposal_id, options);
|
|
943
|
+
if (ret[2]) {
|
|
944
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
945
|
+
}
|
|
946
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Prepare a multisig cancellation for external signing
|
|
951
|
+
* @param {string} multisig
|
|
952
|
+
* @param {number} proposal_id
|
|
953
|
+
* @param {any} options
|
|
954
|
+
* @returns {WasmPreparedMessage}
|
|
955
|
+
*/
|
|
956
|
+
export function prepareMultisigCancel(multisig, proposal_id, options) {
|
|
957
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
958
|
+
const len0 = WASM_VECTOR_LEN;
|
|
959
|
+
const ret = wasm.prepareMultisigCancel(ptr0, len0, proposal_id, options);
|
|
960
|
+
if (ret[2]) {
|
|
961
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
962
|
+
}
|
|
963
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Prepare a multisig execution for external signing
|
|
968
|
+
* @param {string} multisig
|
|
969
|
+
* @param {number} proposal_id
|
|
970
|
+
* @param {any} options
|
|
971
|
+
* @returns {WasmPreparedMessage}
|
|
972
|
+
*/
|
|
973
|
+
export function prepareMultisigExecute(multisig, proposal_id, options) {
|
|
974
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
975
|
+
const len0 = WASM_VECTOR_LEN;
|
|
976
|
+
const ret = wasm.prepareMultisigExecute(ptr0, len0, proposal_id, options);
|
|
977
|
+
if (ret[2]) {
|
|
978
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
979
|
+
}
|
|
980
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
/**
|
|
984
|
+
* Prepare a multisig proposal for external signing
|
|
985
|
+
* @param {string} multisig
|
|
986
|
+
* @param {any} actions
|
|
987
|
+
* @param {any} options
|
|
988
|
+
* @returns {WasmPreparedMessage}
|
|
989
|
+
*/
|
|
990
|
+
export function prepareMultisigPropose(multisig, actions, options) {
|
|
991
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
992
|
+
const len0 = WASM_VECTOR_LEN;
|
|
993
|
+
const ret = wasm.prepareMultisigPropose(ptr0, len0, actions, options);
|
|
994
|
+
if (ret[2]) {
|
|
995
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
996
|
+
}
|
|
997
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Prepare a multisig rejection for external signing
|
|
1002
|
+
* @param {string} multisig
|
|
1003
|
+
* @param {number} proposal_id
|
|
1004
|
+
* @param {any} options
|
|
1005
|
+
* @returns {WasmPreparedMessage}
|
|
1006
|
+
*/
|
|
1007
|
+
export function prepareMultisigReject(multisig, proposal_id, options) {
|
|
1008
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1009
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1010
|
+
const ret = wasm.prepareMultisigReject(ptr0, len0, proposal_id, options);
|
|
1011
|
+
if (ret[2]) {
|
|
1012
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1013
|
+
}
|
|
1014
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
691
1017
|
/**
|
|
692
1018
|
* Prepare a single order for external wallet signing
|
|
693
1019
|
*
|
|
@@ -716,6 +1042,95 @@ export function prepareOrder(order, options) {
|
|
|
716
1042
|
return WasmPreparedMessage.__wrap(ret[0]);
|
|
717
1043
|
}
|
|
718
1044
|
|
|
1045
|
+
/**
|
|
1046
|
+
* Prepare a sub-account removal for external signing
|
|
1047
|
+
*
|
|
1048
|
+
* @param toRemove - sub-account pubkey to remove (base58)
|
|
1049
|
+
* @param options - { account: string, signer?: string, nonce?: number }
|
|
1050
|
+
* @param {string} to_remove
|
|
1051
|
+
* @param {any} options
|
|
1052
|
+
* @returns {WasmPreparedMessage}
|
|
1053
|
+
*/
|
|
1054
|
+
export function prepareRemoveSubAccount(to_remove, options) {
|
|
1055
|
+
const ptr0 = passStringToWasm0(to_remove, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1056
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1057
|
+
const ret = wasm.prepareRemoveSubAccount(ptr0, len0, options);
|
|
1058
|
+
if (ret[2]) {
|
|
1059
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1060
|
+
}
|
|
1061
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* Prepare a sub-account rename for external signing
|
|
1066
|
+
*
|
|
1067
|
+
* @param subaccount - sub-account pubkey to rename (base58)
|
|
1068
|
+
* @param name - new display name
|
|
1069
|
+
* @param options - { account: string, signer?: string, nonce?: number }
|
|
1070
|
+
* @param {string} subaccount
|
|
1071
|
+
* @param {string} name
|
|
1072
|
+
* @param {any} options
|
|
1073
|
+
* @returns {WasmPreparedMessage}
|
|
1074
|
+
*/
|
|
1075
|
+
export function prepareRenameSubAccount(subaccount, name, options) {
|
|
1076
|
+
const ptr0 = passStringToWasm0(subaccount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1077
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1078
|
+
const ptr1 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1079
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1080
|
+
const ret = wasm.prepareRenameSubAccount(ptr0, len0, ptr1, len1, options);
|
|
1081
|
+
if (ret[2]) {
|
|
1082
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1083
|
+
}
|
|
1084
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* Prepare a margin transfer for external signing
|
|
1089
|
+
*
|
|
1090
|
+
* @param fromPubkey - source account pubkey (base58)
|
|
1091
|
+
* @param toPubkey - destination account pubkey (base58)
|
|
1092
|
+
* @param marginSymbol - margin asset symbol
|
|
1093
|
+
* @param marginAmount - amount to transfer
|
|
1094
|
+
* @param options - { account: string, signer?: string, nonce?: number, kind?: "internal" | "external" }
|
|
1095
|
+
* @param {string} from_pubkey
|
|
1096
|
+
* @param {string} to_pubkey
|
|
1097
|
+
* @param {string} margin_symbol
|
|
1098
|
+
* @param {number} margin_amount
|
|
1099
|
+
* @param {any} options
|
|
1100
|
+
* @returns {WasmPreparedMessage}
|
|
1101
|
+
*/
|
|
1102
|
+
export function prepareTransfer(from_pubkey, to_pubkey, margin_symbol, margin_amount, options) {
|
|
1103
|
+
const ptr0 = passStringToWasm0(from_pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1104
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1105
|
+
const ptr1 = passStringToWasm0(to_pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1106
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1107
|
+
const ptr2 = passStringToWasm0(margin_symbol, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1108
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1109
|
+
const ret = wasm.prepareTransfer(ptr0, len0, ptr1, len1, ptr2, len2, margin_amount, options);
|
|
1110
|
+
if (ret[2]) {
|
|
1111
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1112
|
+
}
|
|
1113
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Prepare a multisig policy update for external signing
|
|
1118
|
+
* @param {string} multisig
|
|
1119
|
+
* @param {any} signers
|
|
1120
|
+
* @param {number} threshold
|
|
1121
|
+
* @param {any} options
|
|
1122
|
+
* @returns {WasmPreparedMessage}
|
|
1123
|
+
*/
|
|
1124
|
+
export function prepareUpdateMultisigPolicy(multisig, signers, threshold, options) {
|
|
1125
|
+
const ptr0 = passStringToWasm0(multisig, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1126
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1127
|
+
const ret = wasm.prepareUpdateMultisigPolicy(ptr0, len0, signers, threshold, options);
|
|
1128
|
+
if (ret[2]) {
|
|
1129
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1130
|
+
}
|
|
1131
|
+
return WasmPreparedMessage.__wrap(ret[0]);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
719
1134
|
/**
|
|
720
1135
|
* Prepare user settings update for external signing
|
|
721
1136
|
*
|
|
@@ -776,11 +1191,11 @@ export function validatePubkey(s) {
|
|
|
776
1191
|
function __wbg_get_imports() {
|
|
777
1192
|
const import0 = {
|
|
778
1193
|
__proto__: null,
|
|
779
|
-
|
|
1194
|
+
__wbg_Error_3639a60ed15f87e7: function(arg0, arg1) {
|
|
780
1195
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
781
1196
|
return ret;
|
|
782
1197
|
},
|
|
783
|
-
|
|
1198
|
+
__wbg_Number_a3d737fd183f7dca: function(arg0) {
|
|
784
1199
|
const ret = Number(arg0);
|
|
785
1200
|
return ret;
|
|
786
1201
|
},
|
|
@@ -791,64 +1206,64 @@ function __wbg_get_imports() {
|
|
|
791
1206
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
792
1207
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
793
1208
|
},
|
|
794
|
-
|
|
1209
|
+
__wbg___wbindgen_bigint_get_as_i64_3af6d4ca77193a4b: function(arg0, arg1) {
|
|
795
1210
|
const v = arg1;
|
|
796
1211
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
797
1212
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
798
1213
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
799
1214
|
},
|
|
800
|
-
|
|
1215
|
+
__wbg___wbindgen_boolean_get_c3dd5c39f1b5a12b: function(arg0) {
|
|
801
1216
|
const v = arg0;
|
|
802
1217
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
803
1218
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
804
1219
|
},
|
|
805
|
-
|
|
1220
|
+
__wbg___wbindgen_debug_string_07cb72cfcc952e2b: function(arg0, arg1) {
|
|
806
1221
|
const ret = debugString(arg1);
|
|
807
1222
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
808
1223
|
const len1 = WASM_VECTOR_LEN;
|
|
809
1224
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
810
1225
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
811
1226
|
},
|
|
812
|
-
|
|
1227
|
+
__wbg___wbindgen_in_2617fa76397620d3: function(arg0, arg1) {
|
|
813
1228
|
const ret = arg0 in arg1;
|
|
814
1229
|
return ret;
|
|
815
1230
|
},
|
|
816
|
-
|
|
1231
|
+
__wbg___wbindgen_is_bigint_d6a8167cac401b95: function(arg0) {
|
|
817
1232
|
const ret = typeof(arg0) === 'bigint';
|
|
818
1233
|
return ret;
|
|
819
1234
|
},
|
|
820
|
-
|
|
1235
|
+
__wbg___wbindgen_is_function_2f0fd7ceb86e64c5: function(arg0) {
|
|
821
1236
|
const ret = typeof(arg0) === 'function';
|
|
822
1237
|
return ret;
|
|
823
1238
|
},
|
|
824
|
-
|
|
1239
|
+
__wbg___wbindgen_is_object_5b22ff2418063a9c: function(arg0) {
|
|
825
1240
|
const val = arg0;
|
|
826
1241
|
const ret = typeof(val) === 'object' && val !== null;
|
|
827
1242
|
return ret;
|
|
828
1243
|
},
|
|
829
|
-
|
|
1244
|
+
__wbg___wbindgen_is_string_eddc07a3efad52e6: function(arg0) {
|
|
830
1245
|
const ret = typeof(arg0) === 'string';
|
|
831
1246
|
return ret;
|
|
832
1247
|
},
|
|
833
|
-
|
|
1248
|
+
__wbg___wbindgen_is_undefined_244a92c34d3b6ec0: function(arg0) {
|
|
834
1249
|
const ret = arg0 === undefined;
|
|
835
1250
|
return ret;
|
|
836
1251
|
},
|
|
837
|
-
|
|
1252
|
+
__wbg___wbindgen_jsval_eq_403eaa3610500a25: function(arg0, arg1) {
|
|
838
1253
|
const ret = arg0 === arg1;
|
|
839
1254
|
return ret;
|
|
840
1255
|
},
|
|
841
|
-
|
|
1256
|
+
__wbg___wbindgen_jsval_loose_eq_1978f1e77b4bce62: function(arg0, arg1) {
|
|
842
1257
|
const ret = arg0 == arg1;
|
|
843
1258
|
return ret;
|
|
844
1259
|
},
|
|
845
|
-
|
|
1260
|
+
__wbg___wbindgen_number_get_dd6d69a6079f26f1: function(arg0, arg1) {
|
|
846
1261
|
const obj = arg1;
|
|
847
1262
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
848
1263
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
849
1264
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
850
1265
|
},
|
|
851
|
-
|
|
1266
|
+
__wbg___wbindgen_string_get_965592073e5d848c: function(arg0, arg1) {
|
|
852
1267
|
const obj = arg1;
|
|
853
1268
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
854
1269
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -856,26 +1271,26 @@ function __wbg_get_imports() {
|
|
|
856
1271
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
857
1272
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
858
1273
|
},
|
|
859
|
-
|
|
1274
|
+
__wbg___wbindgen_throw_9c75d47bf9e7731e: function(arg0, arg1) {
|
|
860
1275
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
861
1276
|
},
|
|
862
|
-
|
|
863
|
-
const ret = arg0.call(arg1);
|
|
1277
|
+
__wbg_call_a41d6421b30a32c5: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1278
|
+
const ret = arg0.call(arg1, arg2);
|
|
864
1279
|
return ret;
|
|
865
1280
|
}, arguments); },
|
|
866
|
-
|
|
867
|
-
const ret = arg0.call(arg1
|
|
1281
|
+
__wbg_call_add9e5a76382e668: function() { return handleError(function (arg0, arg1) {
|
|
1282
|
+
const ret = arg0.call(arg1);
|
|
868
1283
|
return ret;
|
|
869
1284
|
}, arguments); },
|
|
870
1285
|
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
871
1286
|
const ret = arg0.crypto;
|
|
872
1287
|
return ret;
|
|
873
1288
|
},
|
|
874
|
-
|
|
1289
|
+
__wbg_done_b1afd6201ac045e0: function(arg0) {
|
|
875
1290
|
const ret = arg0.done;
|
|
876
1291
|
return ret;
|
|
877
1292
|
},
|
|
878
|
-
|
|
1293
|
+
__wbg_entries_bb9843ba73dc70d6: function(arg0) {
|
|
879
1294
|
const ret = Object.entries(arg0);
|
|
880
1295
|
return ret;
|
|
881
1296
|
},
|
|
@@ -893,15 +1308,15 @@ function __wbg_get_imports() {
|
|
|
893
1308
|
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
894
1309
|
arg0.getRandomValues(arg1);
|
|
895
1310
|
}, arguments); },
|
|
896
|
-
|
|
897
|
-
const ret = Reflect.get(arg0, arg1);
|
|
898
|
-
return ret;
|
|
899
|
-
}, arguments); },
|
|
900
|
-
__wbg_get_8360291721e2339f: function(arg0, arg1) {
|
|
1311
|
+
__wbg_get_652f640b3b0b6e3e: function(arg0, arg1) {
|
|
901
1312
|
const ret = arg0[arg1 >>> 0];
|
|
902
1313
|
return ret;
|
|
903
1314
|
},
|
|
904
|
-
|
|
1315
|
+
__wbg_get_9cfea9b7bbf12a15: function() { return handleError(function (arg0, arg1) {
|
|
1316
|
+
const ret = Reflect.get(arg0, arg1);
|
|
1317
|
+
return ret;
|
|
1318
|
+
}, arguments); },
|
|
1319
|
+
__wbg_get_unchecked_be562b1421656321: function(arg0, arg1) {
|
|
905
1320
|
const ret = arg0[arg1 >>> 0];
|
|
906
1321
|
return ret;
|
|
907
1322
|
},
|
|
@@ -909,7 +1324,7 @@ function __wbg_get_imports() {
|
|
|
909
1324
|
const ret = arg0[arg1];
|
|
910
1325
|
return ret;
|
|
911
1326
|
},
|
|
912
|
-
|
|
1327
|
+
__wbg_instanceof_ArrayBuffer_eab9f28fbec23477: function(arg0) {
|
|
913
1328
|
let result;
|
|
914
1329
|
try {
|
|
915
1330
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -919,7 +1334,7 @@ function __wbg_get_imports() {
|
|
|
919
1334
|
const ret = result;
|
|
920
1335
|
return ret;
|
|
921
1336
|
},
|
|
922
|
-
|
|
1337
|
+
__wbg_instanceof_Map_10d4edf60fcf9327: function(arg0) {
|
|
923
1338
|
let result;
|
|
924
1339
|
try {
|
|
925
1340
|
result = arg0 instanceof Map;
|
|
@@ -929,7 +1344,7 @@ function __wbg_get_imports() {
|
|
|
929
1344
|
const ret = result;
|
|
930
1345
|
return ret;
|
|
931
1346
|
},
|
|
932
|
-
|
|
1347
|
+
__wbg_instanceof_Uint8Array_57d77acd50e4c44d: function(arg0) {
|
|
933
1348
|
let result;
|
|
934
1349
|
try {
|
|
935
1350
|
result = arg0 instanceof Uint8Array;
|
|
@@ -939,23 +1354,23 @@ function __wbg_get_imports() {
|
|
|
939
1354
|
const ret = result;
|
|
940
1355
|
return ret;
|
|
941
1356
|
},
|
|
942
|
-
|
|
1357
|
+
__wbg_isArray_c6c6ef8308995bcf: function(arg0) {
|
|
943
1358
|
const ret = Array.isArray(arg0);
|
|
944
1359
|
return ret;
|
|
945
1360
|
},
|
|
946
|
-
|
|
1361
|
+
__wbg_isSafeInteger_3c56c421a5b4cce4: function(arg0) {
|
|
947
1362
|
const ret = Number.isSafeInteger(arg0);
|
|
948
1363
|
return ret;
|
|
949
1364
|
},
|
|
950
|
-
|
|
1365
|
+
__wbg_iterator_9d68985a1d096fc2: function() {
|
|
951
1366
|
const ret = Symbol.iterator;
|
|
952
1367
|
return ret;
|
|
953
1368
|
},
|
|
954
|
-
|
|
1369
|
+
__wbg_length_0a6ce016dc1460b0: function(arg0) {
|
|
955
1370
|
const ret = arg0.length;
|
|
956
1371
|
return ret;
|
|
957
1372
|
},
|
|
958
|
-
|
|
1373
|
+
__wbg_length_ba3c032602efe310: function(arg0) {
|
|
959
1374
|
const ret = arg0.length;
|
|
960
1375
|
return ret;
|
|
961
1376
|
},
|
|
@@ -963,38 +1378,38 @@ function __wbg_get_imports() {
|
|
|
963
1378
|
const ret = arg0.msCrypto;
|
|
964
1379
|
return ret;
|
|
965
1380
|
},
|
|
966
|
-
__wbg_new_0c7403db6e782f19: function(arg0) {
|
|
967
|
-
const ret = new Uint8Array(arg0);
|
|
968
|
-
return ret;
|
|
969
|
-
},
|
|
970
1381
|
__wbg_new_227d7c05414eb861: function() {
|
|
971
1382
|
const ret = new Error();
|
|
972
1383
|
return ret;
|
|
973
1384
|
},
|
|
974
|
-
|
|
975
|
-
const ret = new
|
|
1385
|
+
__wbg_new_2fad8ca02fd00684: function() {
|
|
1386
|
+
const ret = new Object();
|
|
976
1387
|
return ret;
|
|
977
1388
|
},
|
|
978
|
-
|
|
1389
|
+
__wbg_new_3baa8d9866155c79: function() {
|
|
979
1390
|
const ret = new Array();
|
|
980
1391
|
return ret;
|
|
981
1392
|
},
|
|
982
|
-
|
|
983
|
-
const ret = new
|
|
1393
|
+
__wbg_new_46ae4e4ff2a07a64: function() {
|
|
1394
|
+
const ret = new Map();
|
|
984
1395
|
return ret;
|
|
985
1396
|
},
|
|
986
|
-
|
|
987
|
-
const ret = new Uint8Array(arg0
|
|
1397
|
+
__wbg_new_8454eee672b2ba6e: function(arg0) {
|
|
1398
|
+
const ret = new Uint8Array(arg0);
|
|
988
1399
|
return ret;
|
|
989
1400
|
},
|
|
990
|
-
|
|
991
|
-
const ret = arg0
|
|
1401
|
+
__wbg_new_with_length_9011f5da794bf5d9: function(arg0) {
|
|
1402
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
992
1403
|
return ret;
|
|
993
|
-
},
|
|
994
|
-
|
|
1404
|
+
},
|
|
1405
|
+
__wbg_next_261c3c48c6e309a5: function(arg0) {
|
|
995
1406
|
const ret = arg0.next;
|
|
996
1407
|
return ret;
|
|
997
1408
|
},
|
|
1409
|
+
__wbg_next_aacee310bcfe6461: function() { return handleError(function (arg0) {
|
|
1410
|
+
const ret = arg0.next();
|
|
1411
|
+
return ret;
|
|
1412
|
+
}, arguments); },
|
|
998
1413
|
__wbg_node_84ea875411254db1: function(arg0) {
|
|
999
1414
|
const ret = arg0.node;
|
|
1000
1415
|
return ret;
|
|
@@ -1003,7 +1418,7 @@ function __wbg_get_imports() {
|
|
|
1003
1418
|
const ret = arg0.process;
|
|
1004
1419
|
return ret;
|
|
1005
1420
|
},
|
|
1006
|
-
|
|
1421
|
+
__wbg_prototypesetcall_fd4050e806e1d519: function(arg0, arg1, arg2) {
|
|
1007
1422
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1008
1423
|
},
|
|
1009
1424
|
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
@@ -1013,16 +1428,16 @@ function __wbg_get_imports() {
|
|
|
1013
1428
|
const ret = module.require;
|
|
1014
1429
|
return ret;
|
|
1015
1430
|
}, arguments); },
|
|
1016
|
-
__wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
|
|
1017
|
-
arg0[arg1 >>> 0] = arg2;
|
|
1018
|
-
},
|
|
1019
1431
|
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
1020
1432
|
arg0[arg1] = arg2;
|
|
1021
1433
|
},
|
|
1022
|
-
|
|
1434
|
+
__wbg_set_82f7a370f604db70: function(arg0, arg1, arg2) {
|
|
1023
1435
|
const ret = arg0.set(arg1, arg2);
|
|
1024
1436
|
return ret;
|
|
1025
1437
|
},
|
|
1438
|
+
__wbg_set_f614f6a0608d1d1d: function(arg0, arg1, arg2) {
|
|
1439
|
+
arg0[arg1 >>> 0] = arg2;
|
|
1440
|
+
},
|
|
1026
1441
|
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
1027
1442
|
const ret = arg1.stack;
|
|
1028
1443
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -1030,27 +1445,27 @@ function __wbg_get_imports() {
|
|
|
1030
1445
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1031
1446
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1032
1447
|
},
|
|
1033
|
-
|
|
1034
|
-
const ret = typeof
|
|
1448
|
+
__wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb: function() {
|
|
1449
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1035
1450
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1036
1451
|
},
|
|
1037
|
-
|
|
1038
|
-
const ret = typeof
|
|
1452
|
+
__wbg_static_accessor_GLOBAL_e039bc914f83e74e: function() {
|
|
1453
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1039
1454
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1040
1455
|
},
|
|
1041
|
-
|
|
1456
|
+
__wbg_static_accessor_SELF_8bf8c48c28420ad5: function() {
|
|
1042
1457
|
const ret = typeof self === 'undefined' ? null : self;
|
|
1043
1458
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1044
1459
|
},
|
|
1045
|
-
|
|
1460
|
+
__wbg_static_accessor_WINDOW_6aeee9b51652ee0f: function() {
|
|
1046
1461
|
const ret = typeof window === 'undefined' ? null : window;
|
|
1047
1462
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1048
1463
|
},
|
|
1049
|
-
|
|
1464
|
+
__wbg_subarray_fbe3cef290e1fa43: function(arg0, arg1, arg2) {
|
|
1050
1465
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1051
1466
|
return ret;
|
|
1052
1467
|
},
|
|
1053
|
-
|
|
1468
|
+
__wbg_value_f852716acdeb3e82: function(arg0) {
|
|
1054
1469
|
const ret = arg0.value;
|
|
1055
1470
|
return ret;
|
|
1056
1471
|
},
|
|
@@ -1105,13 +1520,13 @@ function __wbg_get_imports() {
|
|
|
1105
1520
|
|
|
1106
1521
|
const WasmKeypairFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1107
1522
|
? { register: () => {}, unregister: () => {} }
|
|
1108
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmkeypair_free(ptr
|
|
1523
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmkeypair_free(ptr, 1));
|
|
1109
1524
|
const WasmPreparedMessageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1110
1525
|
? { register: () => {}, unregister: () => {} }
|
|
1111
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpreparedmessage_free(ptr
|
|
1526
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpreparedmessage_free(ptr, 1));
|
|
1112
1527
|
const WasmSignerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1113
1528
|
? { register: () => {}, unregister: () => {} }
|
|
1114
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsigner_free(ptr
|
|
1529
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsigner_free(ptr, 1));
|
|
1115
1530
|
|
|
1116
1531
|
function addToExternrefTable0(obj) {
|
|
1117
1532
|
const idx = wasm.__externref_table_alloc();
|
|
@@ -1215,8 +1630,7 @@ function getDataViewMemory0() {
|
|
|
1215
1630
|
}
|
|
1216
1631
|
|
|
1217
1632
|
function getStringFromWasm0(ptr, len) {
|
|
1218
|
-
|
|
1219
|
-
return decodeText(ptr, len);
|
|
1633
|
+
return decodeText(ptr >>> 0, len);
|
|
1220
1634
|
}
|
|
1221
1635
|
|
|
1222
1636
|
let cachedUint8ArrayMemory0 = null;
|
|
@@ -1319,8 +1733,9 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
1319
1733
|
|
|
1320
1734
|
let WASM_VECTOR_LEN = 0;
|
|
1321
1735
|
|
|
1322
|
-
let wasmModule, wasm;
|
|
1736
|
+
let wasmModule, wasmInstance, wasm;
|
|
1323
1737
|
function __wbg_finalize_init(instance, module) {
|
|
1738
|
+
wasmInstance = instance;
|
|
1324
1739
|
wasm = instance.exports;
|
|
1325
1740
|
wasmModule = module;
|
|
1326
1741
|
cachedDataViewMemory0 = null;
|
|
Binary file
|
package/package.json
CHANGED