passkey-kit 0.10.20 → 0.10.21

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passkey-kit",
3
- "version": "0.10.20",
3
+ "version": "0.10.21",
4
4
  "description": "A helper library for creating and using smart wallet accounts on the Stellar blockchain.",
5
5
  "author": "Tyler van der Hoeven",
6
6
  "license": "MIT",
package/src/kit.ts CHANGED
@@ -18,6 +18,7 @@ export class PasskeyKit extends PasskeyBase {
18
18
  private walletKeypair: Keypair
19
19
  private walletPublicKey: string
20
20
  private walletWasmHash: string
21
+ private timeoutInSeconds: number
21
22
  private WebAuthn: {
22
23
  startRegistration: typeof startRegistration,
23
24
  startAuthentication: typeof startAuthentication
@@ -31,6 +32,7 @@ export class PasskeyKit extends PasskeyBase {
31
32
  rpcUrl: string,
32
33
  networkPassphrase: string,
33
34
  walletWasmHash: string,
35
+ timeoutInSeconds?: number,
34
36
  WebAuthn?: {
35
37
  startRegistration: typeof startRegistration,
36
38
  startAuthentication: typeof startAuthentication
@@ -49,6 +51,7 @@ export class PasskeyKit extends PasskeyBase {
49
51
  this.walletKeypair = Keypair.fromRawEd25519Seed(hash(Buffer.from('kalepail')));
50
52
  this.walletPublicKey = this.walletKeypair.publicKey()
51
53
  this.walletWasmHash = walletWasmHash
54
+ this.timeoutInSeconds = options.timeoutInSeconds || DEFAULT_TIMEOUT
52
55
  this.WebAuthn = WebAuthn || { startRegistration, startAuthentication }
53
56
  }
54
57
 
@@ -74,6 +77,7 @@ export class PasskeyKit extends PasskeyBase {
74
77
  networkPassphrase: this.networkPassphrase,
75
78
  publicKey: this.walletPublicKey,
76
79
  salt: hash(keyId),
80
+ timeoutInSeconds: this.timeoutInSeconds,
77
81
  }
78
82
  )
79
83
 
@@ -466,6 +470,8 @@ export class PasskeyKit extends PasskeyBase {
466
470
  public remove(signer: SignerKey) {
467
471
  return this.wallet!.remove_signer({
468
472
  signer_key: this.getSignerKey(signer)
473
+ }, {
474
+ timeoutInSeconds: this.timeoutInSeconds,
469
475
  });
470
476
  }
471
477
 
@@ -484,6 +490,8 @@ export class PasskeyKit extends PasskeyBase {
484
490
  { tag: store, values: undefined },
485
491
  ],
486
492
  },
493
+ }, {
494
+ timeoutInSeconds: this.timeoutInSeconds,
487
495
  });
488
496
  }
489
497
  private ed25519(publicKey: string, limits: SignerLimits, store: SignerStore, fn: 'add_signer' | 'update_signer', expiration?: number) {
@@ -497,6 +505,8 @@ export class PasskeyKit extends PasskeyBase {
497
505
  { tag: store, values: undefined },
498
506
  ],
499
507
  },
508
+ }, {
509
+ timeoutInSeconds: this.timeoutInSeconds,
500
510
  });
501
511
  }
502
512
  private policy(policy: string, limits: SignerLimits, store: SignerStore, fn: 'add_signer' | 'update_signer', expiration?: number) {
@@ -510,6 +520,8 @@ export class PasskeyKit extends PasskeyBase {
510
520
  { tag: store, values: undefined },
511
521
  ],
512
522
  },
523
+ }, {
524
+ timeoutInSeconds: this.timeoutInSeconds,
513
525
  });
514
526
  }
515
527
 
package/types/kit.d.ts CHANGED
@@ -13,6 +13,7 @@ export declare class PasskeyKit extends PasskeyBase {
13
13
  private walletKeypair;
14
14
  private walletPublicKey;
15
15
  private walletWasmHash;
16
+ private timeoutInSeconds;
16
17
  private WebAuthn;
17
18
  keyId: string | undefined;
18
19
  networkPassphrase: string;
@@ -21,6 +22,7 @@ export declare class PasskeyKit extends PasskeyBase {
21
22
  rpcUrl: string;
22
23
  networkPassphrase: string;
23
24
  walletWasmHash: string;
25
+ timeoutInSeconds?: number;
24
26
  WebAuthn?: {
25
27
  startRegistration: typeof startRegistration;
26
28
  startAuthentication: typeof startAuthentication;