@cartridge/controller-wasm 0.3.18 → 0.3.19
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/package.json
CHANGED
|
@@ -232,31 +232,29 @@ export class CartridgeAccount {
|
|
|
232
232
|
* Creates a new `CartridgeAccount` instance.
|
|
233
233
|
*
|
|
234
234
|
* # Parameters
|
|
235
|
-
* - `app_id`: Application identifier.
|
|
236
235
|
* - `rpc_url`: The URL of the JSON-RPC endpoint.
|
|
237
236
|
* - `address`: The blockchain address associated with the account.
|
|
238
237
|
* - `username`: Username associated with the account.
|
|
239
238
|
* - `owner`: A Owner struct containing the owner signer and associated data.
|
|
240
239
|
*/
|
|
241
|
-
static new(
|
|
240
|
+
static new(class_hash: JsFelt, rpc_url: string, address: JsFelt, username: string, owner: Owner, cartridge_api_url: string): Promise<CartridgeAccountWithMeta>;
|
|
242
241
|
/**
|
|
243
242
|
* Creates a new `CartridgeAccount` instance with a randomly generated Starknet signer.
|
|
244
243
|
* The controller address is computed internally based on the generated signer.
|
|
245
244
|
*
|
|
246
245
|
* # Parameters
|
|
247
|
-
* - `app_id`: Application identifier.
|
|
248
246
|
* - `rpc_url`: The URL of the JSON-RPC endpoint.
|
|
249
247
|
* - `username`: Username associated with the account.
|
|
250
248
|
*/
|
|
251
|
-
static newHeadless(
|
|
252
|
-
static fromStorage(
|
|
249
|
+
static newHeadless(class_hash: JsFelt, rpc_url: string, username: string, cartridge_api_url: string): Promise<CartridgeAccountWithMeta>;
|
|
250
|
+
static fromStorage(cartridge_api_url: string): Promise<CartridgeAccountWithMeta | undefined>;
|
|
253
251
|
disconnect(): Promise<void>;
|
|
254
|
-
registerSession(policies: Policy[], expires_at: bigint, public_key: JsFelt, max_fee?: JsFeeEstimate | null): Promise<any>;
|
|
252
|
+
registerSession(app_id: string, policies: Policy[], expires_at: bigint, public_key: JsFelt, max_fee?: JsFeeEstimate | null): Promise<any>;
|
|
255
253
|
registerSessionCalldata(policies: Policy[], expires_at: bigint, public_key: JsFelt): Promise<any>;
|
|
256
254
|
upgrade(new_class_hash: JsFelt): Promise<JsCall>;
|
|
257
255
|
register(register: JsRegister): Promise<JsRegisterResponse>;
|
|
258
|
-
createSession(policies: Policy[], expires_at: bigint, authorize_user_execution?: boolean | null): Promise<AuthorizedSession | undefined>;
|
|
259
|
-
skipSession(policies: Policy[]): Promise<void>;
|
|
256
|
+
createSession(app_id: string, policies: Policy[], expires_at: bigint, authorize_user_execution?: boolean | null): Promise<AuthorizedSession | undefined>;
|
|
257
|
+
skipSession(app_id: string, policies: Policy[]): Promise<void>;
|
|
260
258
|
addOwner(owner?: Signer | null, signer_input?: JsAddSignerInput | null, rp_id?: string | null): Promise<void>;
|
|
261
259
|
removeOwner(signer: JsRemoveSignerInput): Promise<void>;
|
|
262
260
|
createPasskeySigner(rp_id: string): Promise<JsAddSignerInput>;
|
|
@@ -264,17 +262,17 @@ export class CartridgeAccount {
|
|
|
264
262
|
execute(calls: JsCall[], max_fee?: JsFeeEstimate | null, fee_source?: JsFeeSource | null): Promise<any>;
|
|
265
263
|
executeFromOutsideV2(calls: JsCall[], fee_source?: JsFeeSource | null): Promise<any>;
|
|
266
264
|
executeFromOutsideV3(calls: JsCall[], fee_source?: JsFeeSource | null): Promise<any>;
|
|
267
|
-
trySessionExecute(calls: JsCall[], fee_source?: JsFeeSource | null): Promise<any>;
|
|
265
|
+
trySessionExecute(app_id: string, calls: JsCall[], fee_source?: JsFeeSource | null): Promise<any>;
|
|
268
266
|
isRegisteredSessionAuthorized(policies: Policy[], public_key?: JsFelt | null): Promise<AuthorizedSession | undefined>;
|
|
269
|
-
hasRequestedSession(policies: Policy[]): Promise<boolean>;
|
|
267
|
+
hasRequestedSession(app_id: string, policies: Policy[]): Promise<boolean>;
|
|
270
268
|
revokeSession(session: JsRevokableSession): Promise<void>;
|
|
271
269
|
revokeSessions(sessions: JsRevokableSession[]): Promise<void>;
|
|
272
270
|
signMessage(typed_data: string): Promise<Felts>;
|
|
273
271
|
getNonce(): Promise<any>;
|
|
274
272
|
deploySelf(max_fee?: JsFeeEstimate | null): Promise<any>;
|
|
275
273
|
delegateAccount(): Promise<JsFelt>;
|
|
276
|
-
hasAuthorizedPoliciesForCalls(calls: JsCall[]): Promise<boolean>;
|
|
277
|
-
hasAuthorizedPoliciesForMessage(typed_data: string): Promise<boolean>;
|
|
274
|
+
hasAuthorizedPoliciesForCalls(app_id: string, calls: JsCall[]): Promise<boolean>;
|
|
275
|
+
hasAuthorizedPoliciesForMessage(app_id: string, typed_data: string): Promise<boolean>;
|
|
278
276
|
/**
|
|
279
277
|
* Signs an OutsideExecution V3 transaction and returns both the OutsideExecution object and its signature.
|
|
280
278
|
*
|
|
@@ -303,7 +301,6 @@ export class CartridgeAccountMeta {
|
|
|
303
301
|
private constructor();
|
|
304
302
|
free(): void;
|
|
305
303
|
[Symbol.dispose](): void;
|
|
306
|
-
appId(): string;
|
|
307
304
|
username(): string;
|
|
308
305
|
address(): string;
|
|
309
306
|
classHash(): string;
|
|
@@ -330,7 +327,7 @@ export class ControllerFactory {
|
|
|
330
327
|
private constructor();
|
|
331
328
|
free(): void;
|
|
332
329
|
[Symbol.dispose](): void;
|
|
333
|
-
static fromStorage(
|
|
330
|
+
static fromStorage(cartridge_api_url: string): Promise<CartridgeAccountWithMeta | undefined>;
|
|
334
331
|
/**
|
|
335
332
|
* Login to an existing controller account.
|
|
336
333
|
*
|
|
@@ -359,11 +356,11 @@ export class ControllerFactory {
|
|
|
359
356
|
* 3. Handles WebAuthn signer updates when multiple signers are present
|
|
360
357
|
* 4. Registers the session with Cartridge API if requested
|
|
361
358
|
*/
|
|
362
|
-
static login(
|
|
359
|
+
static login(username: string, class_hash: JsFelt, rpc_url: string, address: JsFelt, owner: Owner, cartridge_api_url: string, session_expires_at_s: bigint, is_controller_registered?: boolean | null, create_wildcard_session?: boolean | null, app_id?: string | null): Promise<LoginResult>;
|
|
363
360
|
/**
|
|
364
361
|
* This should only be used with webauthn signers
|
|
365
362
|
*/
|
|
366
|
-
static apiLogin(
|
|
363
|
+
static apiLogin(username: string, class_hash: JsFelt, rpc_url: string, address: JsFelt, owner: Owner, cartridge_api_url: string): Promise<CartridgeAccountWithMeta>;
|
|
367
364
|
}
|
|
368
365
|
/**
|
|
369
366
|
* JavaScript-friendly chain configuration
|
|
@@ -402,11 +399,11 @@ export class MultiChainAccount {
|
|
|
402
399
|
/**
|
|
403
400
|
* Creates a new MultiChainAccount with multiple chain configurations
|
|
404
401
|
*/
|
|
405
|
-
static create(
|
|
402
|
+
static create(username: string, chain_configs: JsChainConfig[], cartridge_api_url: string): Promise<MultiChainAccount>;
|
|
406
403
|
/**
|
|
407
404
|
* Loads a MultiChainAccount from storage
|
|
408
405
|
*/
|
|
409
|
-
static fromStorage(
|
|
406
|
+
static fromStorage(cartridge_api_url: string): Promise<MultiChainAccount | undefined>;
|
|
410
407
|
/**
|
|
411
408
|
* Adds a new chain configuration
|
|
412
409
|
*/
|
|
@@ -427,7 +424,6 @@ export class MultiChainAccountMeta {
|
|
|
427
424
|
private constructor();
|
|
428
425
|
free(): void;
|
|
429
426
|
[Symbol.dispose](): void;
|
|
430
|
-
readonly app_id: string;
|
|
431
427
|
readonly username: string;
|
|
432
428
|
readonly chains: JsFelt[];
|
|
433
429
|
}
|
|
@@ -359,20 +359,20 @@ export function signerToGuid(signer) {
|
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
function
|
|
363
|
-
wasm.
|
|
362
|
+
function __wasm_bindgen_func_elem_8823(arg0, arg1, arg2) {
|
|
363
|
+
wasm.__wasm_bindgen_func_elem_8823(arg0, arg1, addHeapObject(arg2));
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
function
|
|
367
|
-
wasm.
|
|
366
|
+
function __wasm_bindgen_func_elem_8679(arg0, arg1) {
|
|
367
|
+
wasm.__wasm_bindgen_func_elem_8679(arg0, arg1);
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
function
|
|
371
|
-
wasm.
|
|
370
|
+
function __wasm_bindgen_func_elem_3186(arg0, arg1, arg2) {
|
|
371
|
+
wasm.__wasm_bindgen_func_elem_3186(arg0, arg1, addHeapObject(arg2));
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
function
|
|
375
|
-
wasm.
|
|
374
|
+
function __wasm_bindgen_func_elem_10951(arg0, arg1, arg2, arg3) {
|
|
375
|
+
wasm.__wasm_bindgen_func_elem_10951(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
/**
|
|
@@ -489,12 +489,10 @@ export class CartridgeAccount {
|
|
|
489
489
|
* Creates a new `CartridgeAccount` instance.
|
|
490
490
|
*
|
|
491
491
|
* # Parameters
|
|
492
|
-
* - `app_id`: Application identifier.
|
|
493
492
|
* - `rpc_url`: The URL of the JSON-RPC endpoint.
|
|
494
493
|
* - `address`: The blockchain address associated with the account.
|
|
495
494
|
* - `username`: Username associated with the account.
|
|
496
495
|
* - `owner`: A Owner struct containing the owner signer and associated data.
|
|
497
|
-
* @param {string} app_id
|
|
498
496
|
* @param {JsFelt} class_hash
|
|
499
497
|
* @param {string} rpc_url
|
|
500
498
|
* @param {JsFelt} address
|
|
@@ -503,16 +501,14 @@ export class CartridgeAccount {
|
|
|
503
501
|
* @param {string} cartridge_api_url
|
|
504
502
|
* @returns {Promise<CartridgeAccountWithMeta>}
|
|
505
503
|
*/
|
|
506
|
-
static new(
|
|
507
|
-
const ptr0 = passStringToWasm0(
|
|
504
|
+
static new(class_hash, rpc_url, address, username, owner, cartridge_api_url) {
|
|
505
|
+
const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
508
506
|
const len0 = WASM_VECTOR_LEN;
|
|
509
|
-
const ptr1 = passStringToWasm0(
|
|
507
|
+
const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
510
508
|
const len1 = WASM_VECTOR_LEN;
|
|
511
|
-
const ptr2 = passStringToWasm0(
|
|
509
|
+
const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
512
510
|
const len2 = WASM_VECTOR_LEN;
|
|
513
|
-
const
|
|
514
|
-
const len3 = WASM_VECTOR_LEN;
|
|
515
|
-
const ret = wasm.cartridgeaccount_new(ptr0, len0, addHeapObject(class_hash), ptr1, len1, addHeapObject(address), ptr2, len2, addHeapObject(owner), ptr3, len3);
|
|
511
|
+
const ret = wasm.cartridgeaccount_new(addHeapObject(class_hash), ptr0, len0, addHeapObject(address), ptr1, len1, addHeapObject(owner), ptr2, len2);
|
|
516
512
|
return takeObject(ret);
|
|
517
513
|
}
|
|
518
514
|
/**
|
|
@@ -520,39 +516,32 @@ export class CartridgeAccount {
|
|
|
520
516
|
* The controller address is computed internally based on the generated signer.
|
|
521
517
|
*
|
|
522
518
|
* # Parameters
|
|
523
|
-
* - `app_id`: Application identifier.
|
|
524
519
|
* - `rpc_url`: The URL of the JSON-RPC endpoint.
|
|
525
520
|
* - `username`: Username associated with the account.
|
|
526
|
-
* @param {string} app_id
|
|
527
521
|
* @param {JsFelt} class_hash
|
|
528
522
|
* @param {string} rpc_url
|
|
529
523
|
* @param {string} username
|
|
530
524
|
* @param {string} cartridge_api_url
|
|
531
525
|
* @returns {Promise<CartridgeAccountWithMeta>}
|
|
532
526
|
*/
|
|
533
|
-
static newHeadless(
|
|
534
|
-
const ptr0 = passStringToWasm0(
|
|
527
|
+
static newHeadless(class_hash, rpc_url, username, cartridge_api_url) {
|
|
528
|
+
const ptr0 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
535
529
|
const len0 = WASM_VECTOR_LEN;
|
|
536
|
-
const ptr1 = passStringToWasm0(
|
|
530
|
+
const ptr1 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
537
531
|
const len1 = WASM_VECTOR_LEN;
|
|
538
|
-
const ptr2 = passStringToWasm0(
|
|
532
|
+
const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
539
533
|
const len2 = WASM_VECTOR_LEN;
|
|
540
|
-
const
|
|
541
|
-
const len3 = WASM_VECTOR_LEN;
|
|
542
|
-
const ret = wasm.cartridgeaccount_newHeadless(ptr0, len0, addHeapObject(class_hash), ptr1, len1, ptr2, len2, ptr3, len3);
|
|
534
|
+
const ret = wasm.cartridgeaccount_newHeadless(addHeapObject(class_hash), ptr0, len0, ptr1, len1, ptr2, len2);
|
|
543
535
|
return takeObject(ret);
|
|
544
536
|
}
|
|
545
537
|
/**
|
|
546
|
-
* @param {string} app_id
|
|
547
538
|
* @param {string} cartridge_api_url
|
|
548
539
|
* @returns {Promise<CartridgeAccountWithMeta | undefined>}
|
|
549
540
|
*/
|
|
550
|
-
static fromStorage(
|
|
551
|
-
const ptr0 = passStringToWasm0(
|
|
541
|
+
static fromStorage(cartridge_api_url) {
|
|
542
|
+
const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
552
543
|
const len0 = WASM_VECTOR_LEN;
|
|
553
|
-
const
|
|
554
|
-
const len1 = WASM_VECTOR_LEN;
|
|
555
|
-
const ret = wasm.cartridgeaccount_fromStorage(ptr0, len0, ptr1, len1);
|
|
544
|
+
const ret = wasm.cartridgeaccount_fromStorage(ptr0, len0);
|
|
556
545
|
return takeObject(ret);
|
|
557
546
|
}
|
|
558
547
|
/**
|
|
@@ -563,16 +552,19 @@ export class CartridgeAccount {
|
|
|
563
552
|
return takeObject(ret);
|
|
564
553
|
}
|
|
565
554
|
/**
|
|
555
|
+
* @param {string} app_id
|
|
566
556
|
* @param {Policy[]} policies
|
|
567
557
|
* @param {bigint} expires_at
|
|
568
558
|
* @param {JsFelt} public_key
|
|
569
559
|
* @param {JsFeeEstimate | null} [max_fee]
|
|
570
560
|
* @returns {Promise<any>}
|
|
571
561
|
*/
|
|
572
|
-
registerSession(policies, expires_at, public_key, max_fee) {
|
|
573
|
-
const ptr0 =
|
|
562
|
+
registerSession(app_id, policies, expires_at, public_key, max_fee) {
|
|
563
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
574
564
|
const len0 = WASM_VECTOR_LEN;
|
|
575
|
-
const
|
|
565
|
+
const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
|
|
566
|
+
const len1 = WASM_VECTOR_LEN;
|
|
567
|
+
const ret = wasm.cartridgeaccount_registerSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, addHeapObject(public_key), isLikeNone(max_fee) ? 0 : addHeapObject(max_fee));
|
|
576
568
|
return takeObject(ret);
|
|
577
569
|
}
|
|
578
570
|
/**
|
|
@@ -604,25 +596,31 @@ export class CartridgeAccount {
|
|
|
604
596
|
return takeObject(ret);
|
|
605
597
|
}
|
|
606
598
|
/**
|
|
599
|
+
* @param {string} app_id
|
|
607
600
|
* @param {Policy[]} policies
|
|
608
601
|
* @param {bigint} expires_at
|
|
609
602
|
* @param {boolean | null} [authorize_user_execution]
|
|
610
603
|
* @returns {Promise<AuthorizedSession | undefined>}
|
|
611
604
|
*/
|
|
612
|
-
createSession(policies, expires_at, authorize_user_execution) {
|
|
613
|
-
const ptr0 =
|
|
605
|
+
createSession(app_id, policies, expires_at, authorize_user_execution) {
|
|
606
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
614
607
|
const len0 = WASM_VECTOR_LEN;
|
|
615
|
-
const
|
|
608
|
+
const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
|
|
609
|
+
const len1 = WASM_VECTOR_LEN;
|
|
610
|
+
const ret = wasm.cartridgeaccount_createSession(this.__wbg_ptr, ptr0, len0, ptr1, len1, expires_at, isLikeNone(authorize_user_execution) ? 0xFFFFFF : authorize_user_execution ? 1 : 0);
|
|
616
611
|
return takeObject(ret);
|
|
617
612
|
}
|
|
618
613
|
/**
|
|
614
|
+
* @param {string} app_id
|
|
619
615
|
* @param {Policy[]} policies
|
|
620
616
|
* @returns {Promise<void>}
|
|
621
617
|
*/
|
|
622
|
-
skipSession(policies) {
|
|
623
|
-
const ptr0 =
|
|
618
|
+
skipSession(app_id, policies) {
|
|
619
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
624
620
|
const len0 = WASM_VECTOR_LEN;
|
|
625
|
-
const
|
|
621
|
+
const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
|
|
622
|
+
const len1 = WASM_VECTOR_LEN;
|
|
623
|
+
const ret = wasm.cartridgeaccount_skipSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
626
624
|
return takeObject(ret);
|
|
627
625
|
}
|
|
628
626
|
/**
|
|
@@ -700,14 +698,17 @@ export class CartridgeAccount {
|
|
|
700
698
|
return takeObject(ret);
|
|
701
699
|
}
|
|
702
700
|
/**
|
|
701
|
+
* @param {string} app_id
|
|
703
702
|
* @param {JsCall[]} calls
|
|
704
703
|
* @param {JsFeeSource | null} [fee_source]
|
|
705
704
|
* @returns {Promise<any>}
|
|
706
705
|
*/
|
|
707
|
-
trySessionExecute(calls, fee_source) {
|
|
708
|
-
const ptr0 =
|
|
706
|
+
trySessionExecute(app_id, calls, fee_source) {
|
|
707
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
709
708
|
const len0 = WASM_VECTOR_LEN;
|
|
710
|
-
const
|
|
709
|
+
const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
|
|
710
|
+
const len1 = WASM_VECTOR_LEN;
|
|
711
|
+
const ret = wasm.cartridgeaccount_trySessionExecute(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(fee_source) ? 0 : addHeapObject(fee_source));
|
|
711
712
|
return takeObject(ret);
|
|
712
713
|
}
|
|
713
714
|
/**
|
|
@@ -722,13 +723,16 @@ export class CartridgeAccount {
|
|
|
722
723
|
return takeObject(ret);
|
|
723
724
|
}
|
|
724
725
|
/**
|
|
726
|
+
* @param {string} app_id
|
|
725
727
|
* @param {Policy[]} policies
|
|
726
728
|
* @returns {Promise<boolean>}
|
|
727
729
|
*/
|
|
728
|
-
hasRequestedSession(policies) {
|
|
729
|
-
const ptr0 =
|
|
730
|
+
hasRequestedSession(app_id, policies) {
|
|
731
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
730
732
|
const len0 = WASM_VECTOR_LEN;
|
|
731
|
-
const
|
|
733
|
+
const ptr1 = passArrayJsValueToWasm0(policies, wasm.__wbindgen_export);
|
|
734
|
+
const len1 = WASM_VECTOR_LEN;
|
|
735
|
+
const ret = wasm.cartridgeaccount_hasRequestedSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
732
736
|
return takeObject(ret);
|
|
733
737
|
}
|
|
734
738
|
/**
|
|
@@ -782,23 +786,29 @@ export class CartridgeAccount {
|
|
|
782
786
|
return takeObject(ret);
|
|
783
787
|
}
|
|
784
788
|
/**
|
|
789
|
+
* @param {string} app_id
|
|
785
790
|
* @param {JsCall[]} calls
|
|
786
791
|
* @returns {Promise<boolean>}
|
|
787
792
|
*/
|
|
788
|
-
hasAuthorizedPoliciesForCalls(calls) {
|
|
789
|
-
const ptr0 =
|
|
793
|
+
hasAuthorizedPoliciesForCalls(app_id, calls) {
|
|
794
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
790
795
|
const len0 = WASM_VECTOR_LEN;
|
|
791
|
-
const
|
|
796
|
+
const ptr1 = passArrayJsValueToWasm0(calls, wasm.__wbindgen_export);
|
|
797
|
+
const len1 = WASM_VECTOR_LEN;
|
|
798
|
+
const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForCalls(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
792
799
|
return takeObject(ret);
|
|
793
800
|
}
|
|
794
801
|
/**
|
|
802
|
+
* @param {string} app_id
|
|
795
803
|
* @param {string} typed_data
|
|
796
804
|
* @returns {Promise<boolean>}
|
|
797
805
|
*/
|
|
798
|
-
hasAuthorizedPoliciesForMessage(typed_data) {
|
|
799
|
-
const ptr0 = passStringToWasm0(
|
|
806
|
+
hasAuthorizedPoliciesForMessage(app_id, typed_data) {
|
|
807
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
800
808
|
const len0 = WASM_VECTOR_LEN;
|
|
801
|
-
const
|
|
809
|
+
const ptr1 = passStringToWasm0(typed_data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
810
|
+
const len1 = WASM_VECTOR_LEN;
|
|
811
|
+
const ret = wasm.cartridgeaccount_hasAuthorizedPoliciesForMessage(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
802
812
|
return takeObject(ret);
|
|
803
813
|
}
|
|
804
814
|
/**
|
|
@@ -858,25 +868,6 @@ export class CartridgeAccountMeta {
|
|
|
858
868
|
const ptr = this.__destroy_into_raw();
|
|
859
869
|
wasm.__wbg_cartridgeaccountmeta_free(ptr, 0);
|
|
860
870
|
}
|
|
861
|
-
/**
|
|
862
|
-
* @returns {string}
|
|
863
|
-
*/
|
|
864
|
-
appId() {
|
|
865
|
-
let deferred1_0;
|
|
866
|
-
let deferred1_1;
|
|
867
|
-
try {
|
|
868
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
869
|
-
wasm.cartridgeaccountmeta_appId(retptr, this.__wbg_ptr);
|
|
870
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
871
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
872
|
-
deferred1_0 = r0;
|
|
873
|
-
deferred1_1 = r1;
|
|
874
|
-
return getStringFromWasm0(r0, r1);
|
|
875
|
-
} finally {
|
|
876
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
877
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
871
|
/**
|
|
881
872
|
* @returns {string}
|
|
882
873
|
*/
|
|
@@ -1056,16 +1047,13 @@ export class ControllerFactory {
|
|
|
1056
1047
|
wasm.__wbg_controllerfactory_free(ptr, 0);
|
|
1057
1048
|
}
|
|
1058
1049
|
/**
|
|
1059
|
-
* @param {string} app_id
|
|
1060
1050
|
* @param {string} cartridge_api_url
|
|
1061
1051
|
* @returns {Promise<CartridgeAccountWithMeta | undefined>}
|
|
1062
1052
|
*/
|
|
1063
|
-
static fromStorage(
|
|
1064
|
-
const ptr0 = passStringToWasm0(
|
|
1053
|
+
static fromStorage(cartridge_api_url) {
|
|
1054
|
+
const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1065
1055
|
const len0 = WASM_VECTOR_LEN;
|
|
1066
|
-
const
|
|
1067
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1068
|
-
const ret = wasm.controllerfactory_fromStorage(ptr0, len0, ptr1, len1);
|
|
1056
|
+
const ret = wasm.controllerfactory_fromStorage(ptr0, len0);
|
|
1069
1057
|
return takeObject(ret);
|
|
1070
1058
|
}
|
|
1071
1059
|
/**
|
|
@@ -1095,7 +1083,6 @@ export class ControllerFactory {
|
|
|
1095
1083
|
* 2. Calls `Controller::new` and optionally `create_wildcard_session`
|
|
1096
1084
|
* 3. Handles WebAuthn signer updates when multiple signers are present
|
|
1097
1085
|
* 4. Registers the session with Cartridge API if requested
|
|
1098
|
-
* @param {string} app_id
|
|
1099
1086
|
* @param {string} username
|
|
1100
1087
|
* @param {JsFelt} class_hash
|
|
1101
1088
|
* @param {string} rpc_url
|
|
@@ -1105,23 +1092,23 @@ export class ControllerFactory {
|
|
|
1105
1092
|
* @param {bigint} session_expires_at_s
|
|
1106
1093
|
* @param {boolean | null} [is_controller_registered]
|
|
1107
1094
|
* @param {boolean | null} [create_wildcard_session]
|
|
1095
|
+
* @param {string | null} [app_id]
|
|
1108
1096
|
* @returns {Promise<LoginResult>}
|
|
1109
1097
|
*/
|
|
1110
|
-
static login(
|
|
1111
|
-
const ptr0 = passStringToWasm0(
|
|
1098
|
+
static login(username, class_hash, rpc_url, address, owner, cartridge_api_url, session_expires_at_s, is_controller_registered, create_wildcard_session, app_id) {
|
|
1099
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1112
1100
|
const len0 = WASM_VECTOR_LEN;
|
|
1113
|
-
const ptr1 = passStringToWasm0(
|
|
1101
|
+
const ptr1 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1114
1102
|
const len1 = WASM_VECTOR_LEN;
|
|
1115
|
-
const ptr2 = passStringToWasm0(
|
|
1103
|
+
const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1116
1104
|
const len2 = WASM_VECTOR_LEN;
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
const ret = wasm.controllerfactory_login(ptr0, len0,
|
|
1105
|
+
var ptr3 = isLikeNone(app_id) ? 0 : passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1106
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1107
|
+
const ret = wasm.controllerfactory_login(ptr0, len0, addHeapObject(class_hash), ptr1, len1, addHeapObject(address), addHeapObject(owner), ptr2, len2, session_expires_at_s, isLikeNone(is_controller_registered) ? 0xFFFFFF : is_controller_registered ? 1 : 0, isLikeNone(create_wildcard_session) ? 0xFFFFFF : create_wildcard_session ? 1 : 0, ptr3, len3);
|
|
1120
1108
|
return takeObject(ret);
|
|
1121
1109
|
}
|
|
1122
1110
|
/**
|
|
1123
1111
|
* This should only be used with webauthn signers
|
|
1124
|
-
* @param {string} app_id
|
|
1125
1112
|
* @param {string} username
|
|
1126
1113
|
* @param {JsFelt} class_hash
|
|
1127
1114
|
* @param {string} rpc_url
|
|
@@ -1130,16 +1117,14 @@ export class ControllerFactory {
|
|
|
1130
1117
|
* @param {string} cartridge_api_url
|
|
1131
1118
|
* @returns {Promise<CartridgeAccountWithMeta>}
|
|
1132
1119
|
*/
|
|
1133
|
-
static apiLogin(
|
|
1134
|
-
const ptr0 = passStringToWasm0(
|
|
1120
|
+
static apiLogin(username, class_hash, rpc_url, address, owner, cartridge_api_url) {
|
|
1121
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1135
1122
|
const len0 = WASM_VECTOR_LEN;
|
|
1136
|
-
const ptr1 = passStringToWasm0(
|
|
1123
|
+
const ptr1 = passStringToWasm0(rpc_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1137
1124
|
const len1 = WASM_VECTOR_LEN;
|
|
1138
|
-
const ptr2 = passStringToWasm0(
|
|
1125
|
+
const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1139
1126
|
const len2 = WASM_VECTOR_LEN;
|
|
1140
|
-
const
|
|
1141
|
-
const len3 = WASM_VECTOR_LEN;
|
|
1142
|
-
const ret = wasm.controllerfactory_apiLogin(ptr0, len0, ptr1, len1, addHeapObject(class_hash), ptr2, len2, addHeapObject(address), addHeapObject(owner), ptr3, len3);
|
|
1127
|
+
const ret = wasm.controllerfactory_apiLogin(ptr0, len0, addHeapObject(class_hash), ptr1, len1, addHeapObject(address), addHeapObject(owner), ptr2, len2);
|
|
1143
1128
|
return takeObject(ret);
|
|
1144
1129
|
}
|
|
1145
1130
|
}
|
|
@@ -1388,36 +1373,30 @@ export class MultiChainAccount {
|
|
|
1388
1373
|
}
|
|
1389
1374
|
/**
|
|
1390
1375
|
* Creates a new MultiChainAccount with multiple chain configurations
|
|
1391
|
-
* @param {string} app_id
|
|
1392
1376
|
* @param {string} username
|
|
1393
1377
|
* @param {JsChainConfig[]} chain_configs
|
|
1394
1378
|
* @param {string} cartridge_api_url
|
|
1395
1379
|
* @returns {Promise<MultiChainAccount>}
|
|
1396
1380
|
*/
|
|
1397
|
-
static create(
|
|
1398
|
-
const ptr0 = passStringToWasm0(
|
|
1381
|
+
static create(username, chain_configs, cartridge_api_url) {
|
|
1382
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1399
1383
|
const len0 = WASM_VECTOR_LEN;
|
|
1400
|
-
const ptr1 =
|
|
1384
|
+
const ptr1 = passArrayJsValueToWasm0(chain_configs, wasm.__wbindgen_export);
|
|
1401
1385
|
const len1 = WASM_VECTOR_LEN;
|
|
1402
|
-
const ptr2 =
|
|
1386
|
+
const ptr2 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1403
1387
|
const len2 = WASM_VECTOR_LEN;
|
|
1404
|
-
const
|
|
1405
|
-
const len3 = WASM_VECTOR_LEN;
|
|
1406
|
-
const ret = wasm.multichainaccount_create(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1388
|
+
const ret = wasm.multichainaccount_create(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1407
1389
|
return takeObject(ret);
|
|
1408
1390
|
}
|
|
1409
1391
|
/**
|
|
1410
1392
|
* Loads a MultiChainAccount from storage
|
|
1411
|
-
* @param {string} app_id
|
|
1412
1393
|
* @param {string} cartridge_api_url
|
|
1413
1394
|
* @returns {Promise<MultiChainAccount | undefined>}
|
|
1414
1395
|
*/
|
|
1415
|
-
static fromStorage(
|
|
1416
|
-
const ptr0 = passStringToWasm0(
|
|
1396
|
+
static fromStorage(cartridge_api_url) {
|
|
1397
|
+
const ptr0 = passStringToWasm0(cartridge_api_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1417
1398
|
const len0 = WASM_VECTOR_LEN;
|
|
1418
|
-
const
|
|
1419
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1420
|
-
const ret = wasm.multichainaccount_fromStorage(ptr0, len0, ptr1, len1);
|
|
1399
|
+
const ret = wasm.multichainaccount_fromStorage(ptr0, len0);
|
|
1421
1400
|
return takeObject(ret);
|
|
1422
1401
|
}
|
|
1423
1402
|
/**
|
|
@@ -1471,25 +1450,6 @@ export class MultiChainAccountMeta {
|
|
|
1471
1450
|
const ptr = this.__destroy_into_raw();
|
|
1472
1451
|
wasm.__wbg_multichainaccountmeta_free(ptr, 0);
|
|
1473
1452
|
}
|
|
1474
|
-
/**
|
|
1475
|
-
* @returns {string}
|
|
1476
|
-
*/
|
|
1477
|
-
get app_id() {
|
|
1478
|
-
let deferred1_0;
|
|
1479
|
-
let deferred1_1;
|
|
1480
|
-
try {
|
|
1481
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1482
|
-
wasm.multichainaccountmeta_app_id(retptr, this.__wbg_ptr);
|
|
1483
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1484
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1485
|
-
deferred1_0 = r0;
|
|
1486
|
-
deferred1_1 = r1;
|
|
1487
|
-
return getStringFromWasm0(r0, r1);
|
|
1488
|
-
} finally {
|
|
1489
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1490
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
1453
|
/**
|
|
1494
1454
|
* @returns {string}
|
|
1495
1455
|
*/
|
|
@@ -1898,7 +1858,7 @@ export function __wbg_new_3c3d849046688a66(arg0, arg1) {
|
|
|
1898
1858
|
const a = state0.a;
|
|
1899
1859
|
state0.a = 0;
|
|
1900
1860
|
try {
|
|
1901
|
-
return
|
|
1861
|
+
return __wasm_bindgen_func_elem_10951(a, state0.b, arg0, arg1);
|
|
1902
1862
|
} finally {
|
|
1903
1863
|
state0.a = a;
|
|
1904
1864
|
}
|
|
@@ -2238,13 +2198,13 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
|
2238
2198
|
|
|
2239
2199
|
export function __wbindgen_cast_4082834687a71a5d(arg0, arg1) {
|
|
2240
2200
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
2241
|
-
const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_225,
|
|
2201
|
+
const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_225, __wasm_bindgen_func_elem_3186);
|
|
2242
2202
|
return addHeapObject(ret);
|
|
2243
2203
|
};
|
|
2244
2204
|
|
|
2245
|
-
export function
|
|
2246
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2247
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2205
|
+
export function __wbindgen_cast_4892f1fb8f346ce7(arg0, arg1) {
|
|
2206
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1000, function: Function { arguments: [Externref], shim_idx: 1001, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2207
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8808, __wasm_bindgen_func_elem_8823);
|
|
2248
2208
|
return addHeapObject(ret);
|
|
2249
2209
|
};
|
|
2250
2210
|
|
|
@@ -2266,9 +2226,9 @@ export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
|
2266
2226
|
return addHeapObject(ret);
|
|
2267
2227
|
};
|
|
2268
2228
|
|
|
2269
|
-
export function
|
|
2270
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2271
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2229
|
+
export function __wbindgen_cast_d92f130ade9da151(arg0, arg1) {
|
|
2230
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 967, function: Function { arguments: [], shim_idx: 968, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2231
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_8670, __wasm_bindgen_func_elem_8679);
|
|
2272
2232
|
return addHeapObject(ret);
|
|
2273
2233
|
};
|
|
2274
2234
|
|
|
Binary file
|
|
@@ -286,16 +286,16 @@ export function signerToGuid(signer) {
|
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
function
|
|
290
|
-
wasm.
|
|
289
|
+
function __wasm_bindgen_func_elem_3921(arg0, arg1) {
|
|
290
|
+
wasm.__wasm_bindgen_func_elem_3921(arg0, arg1);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
function
|
|
294
|
-
wasm.
|
|
293
|
+
function __wasm_bindgen_func_elem_4060(arg0, arg1, arg2) {
|
|
294
|
+
wasm.__wasm_bindgen_func_elem_4060(arg0, arg1, addHeapObject(arg2));
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
function
|
|
298
|
-
wasm.
|
|
297
|
+
function __wasm_bindgen_func_elem_5872(arg0, arg1, arg2, arg3) {
|
|
298
|
+
wasm.__wasm_bindgen_func_elem_5872(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/**
|
|
@@ -890,7 +890,7 @@ export function __wbg_new_3c3d849046688a66(arg0, arg1) {
|
|
|
890
890
|
const a = state0.a;
|
|
891
891
|
state0.a = 0;
|
|
892
892
|
try {
|
|
893
|
-
return
|
|
893
|
+
return __wasm_bindgen_func_elem_5872(a, state0.b, arg0, arg1);
|
|
894
894
|
} finally {
|
|
895
895
|
state0.a = a;
|
|
896
896
|
}
|
|
@@ -1172,7 +1172,7 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
|
1172
1172
|
|
|
1173
1173
|
export function __wbindgen_cast_84b1c647b29b7771(arg0, arg1) {
|
|
1174
1174
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 491, function: Function { arguments: [Externref], shim_idx: 492, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1175
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1175
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4045, __wasm_bindgen_func_elem_4060);
|
|
1176
1176
|
return addHeapObject(ret);
|
|
1177
1177
|
};
|
|
1178
1178
|
|
|
@@ -1184,7 +1184,7 @@ export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
|
|
|
1184
1184
|
|
|
1185
1185
|
export function __wbindgen_cast_cbae8fdbdf7d2814(arg0, arg1) {
|
|
1186
1186
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 458, function: Function { arguments: [], shim_idx: 459, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1187
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1187
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_3912, __wasm_bindgen_func_elem_3921);
|
|
1188
1188
|
return addHeapObject(ret);
|
|
1189
1189
|
};
|
|
1190
1190
|
|
|
Binary file
|