passkey-kit 0.10.20 → 0.10.22
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 +6 -6
- package/packages/passkey-kit-sdk/package.json +3 -3
- package/packages/sac-sdk/package.json +3 -3
- package/src/kit.ts +13 -3
- package/src/sac.ts +1 -1
- package/types/kit.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passkey-kit",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.22",
|
|
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",
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"types": "types/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@simplewebauthn/browser": "^13.1.0",
|
|
12
|
-
"@stellar/stellar-sdk": "^13.
|
|
12
|
+
"@stellar/stellar-sdk": "^13.3.0",
|
|
13
13
|
"base64url": "^3.0.1",
|
|
14
14
|
"buffer": "^6.0.3",
|
|
15
|
-
"passkey-kit-sdk": "0.6.
|
|
16
|
-
"sac-sdk": "0.3.
|
|
15
|
+
"passkey-kit-sdk": "0.6.8",
|
|
16
|
+
"sac-sdk": "0.3.8"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@simplewebauthn/types": "^12.0.0",
|
|
20
|
-
"@types/node": "^22.
|
|
21
|
-
"typescript": "^5.8.
|
|
20
|
+
"@types/node": "^22.15.2",
|
|
21
|
+
"typescript": "^5.8.3"
|
|
22
22
|
},
|
|
23
23
|
"workspaces": [
|
|
24
24
|
"packages/*"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.6.
|
|
2
|
+
"version": "0.6.8",
|
|
3
3
|
"name": "passkey-kit-sdk",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"build": "tsc"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@stellar/stellar-sdk": "^13.
|
|
12
|
+
"@stellar/stellar-sdk": "^13.3.0",
|
|
13
13
|
"buffer": "^6.0.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"typescript": "^5.8.
|
|
16
|
+
"typescript": "^5.8.3"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.3.
|
|
2
|
+
"version": "0.3.8",
|
|
3
3
|
"name": "sac-sdk",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"build": "tsc"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@stellar/stellar-sdk": "^13.
|
|
12
|
+
"@stellar/stellar-sdk": "^13.3.0",
|
|
13
13
|
"buffer": "^6.0.3"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"typescript": "^5.8.
|
|
16
|
+
"typescript": "^5.8.3"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/src/kit.ts
CHANGED
|
@@ -9,8 +9,6 @@ import { PasskeyBase } from './base'
|
|
|
9
9
|
import { AssembledTransaction, basicNodeSigner, DEFAULT_TIMEOUT, type AssembledTransactionOptions, type Tx } from '@stellar/stellar-sdk/minimal/contract'
|
|
10
10
|
import type { Server } from '@stellar/stellar-sdk/minimal/rpc'
|
|
11
11
|
|
|
12
|
-
// TODO default to 30 second timeouts
|
|
13
|
-
|
|
14
12
|
export class PasskeyKit extends PasskeyBase {
|
|
15
13
|
declare rpc: Server
|
|
16
14
|
declare rpcUrl: string
|
|
@@ -18,6 +16,7 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
18
16
|
private walletKeypair: Keypair
|
|
19
17
|
private walletPublicKey: string
|
|
20
18
|
private walletWasmHash: string
|
|
19
|
+
private timeoutInSeconds: number
|
|
21
20
|
private WebAuthn: {
|
|
22
21
|
startRegistration: typeof startRegistration,
|
|
23
22
|
startAuthentication: typeof startAuthentication
|
|
@@ -31,6 +30,7 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
31
30
|
rpcUrl: string,
|
|
32
31
|
networkPassphrase: string,
|
|
33
32
|
walletWasmHash: string,
|
|
33
|
+
timeoutInSeconds?: number,
|
|
34
34
|
WebAuthn?: {
|
|
35
35
|
startRegistration: typeof startRegistration,
|
|
36
36
|
startAuthentication: typeof startAuthentication
|
|
@@ -49,6 +49,7 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
49
49
|
this.walletKeypair = Keypair.fromRawEd25519Seed(hash(Buffer.from('kalepail')));
|
|
50
50
|
this.walletPublicKey = this.walletKeypair.publicKey()
|
|
51
51
|
this.walletWasmHash = walletWasmHash
|
|
52
|
+
this.timeoutInSeconds = options.timeoutInSeconds || 30 // Launchtube requires <= 30 second timeout so let's default to that
|
|
52
53
|
this.WebAuthn = WebAuthn || { startRegistration, startAuthentication }
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -74,6 +75,7 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
74
75
|
networkPassphrase: this.networkPassphrase,
|
|
75
76
|
publicKey: this.walletPublicKey,
|
|
76
77
|
salt: hash(keyId),
|
|
78
|
+
timeoutInSeconds: this.timeoutInSeconds,
|
|
77
79
|
}
|
|
78
80
|
)
|
|
79
81
|
|
|
@@ -238,7 +240,7 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
238
240
|
|
|
239
241
|
if (!expiration) {
|
|
240
242
|
const { sequence } = await this.rpc.getLatestLedger()
|
|
241
|
-
expiration = sequence +
|
|
243
|
+
expiration = sequence + this.timeoutInSeconds / 5; // assumes 5 second ledger time
|
|
242
244
|
}
|
|
243
245
|
}
|
|
244
246
|
|
|
@@ -466,6 +468,8 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
466
468
|
public remove(signer: SignerKey) {
|
|
467
469
|
return this.wallet!.remove_signer({
|
|
468
470
|
signer_key: this.getSignerKey(signer)
|
|
471
|
+
}, {
|
|
472
|
+
timeoutInSeconds: this.timeoutInSeconds,
|
|
469
473
|
});
|
|
470
474
|
}
|
|
471
475
|
|
|
@@ -484,6 +488,8 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
484
488
|
{ tag: store, values: undefined },
|
|
485
489
|
],
|
|
486
490
|
},
|
|
491
|
+
}, {
|
|
492
|
+
timeoutInSeconds: this.timeoutInSeconds,
|
|
487
493
|
});
|
|
488
494
|
}
|
|
489
495
|
private ed25519(publicKey: string, limits: SignerLimits, store: SignerStore, fn: 'add_signer' | 'update_signer', expiration?: number) {
|
|
@@ -497,6 +503,8 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
497
503
|
{ tag: store, values: undefined },
|
|
498
504
|
],
|
|
499
505
|
},
|
|
506
|
+
}, {
|
|
507
|
+
timeoutInSeconds: this.timeoutInSeconds,
|
|
500
508
|
});
|
|
501
509
|
}
|
|
502
510
|
private policy(policy: string, limits: SignerLimits, store: SignerStore, fn: 'add_signer' | 'update_signer', expiration?: number) {
|
|
@@ -510,6 +518,8 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
510
518
|
{ tag: store, values: undefined },
|
|
511
519
|
],
|
|
512
520
|
},
|
|
521
|
+
}, {
|
|
522
|
+
timeoutInSeconds: this.timeoutInSeconds,
|
|
513
523
|
});
|
|
514
524
|
}
|
|
515
525
|
|
package/src/sac.ts
CHANGED
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;
|