passkey-kit 0.10.19 → 0.10.20

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/cheatsheet.txt CHANGED
@@ -13,6 +13,6 @@ stellar contract deploy --wasm target/wasm32-unknown-unknown/release/sample_poli
13
13
 
14
14
  export JWT=???
15
15
  mercury-cli --jwt $JWT --local false --mainnet false deploy
16
- mercury-cli --jwt $JWT --local false --mainnet false catchup --project-name "smart-wallets-next-dima" --contracts CDJWTBQTTGWZVJNS4UC47DIBKEYGDV2YHRAYBD3A2ZLWVXFI6LHYZQPA
16
+ mercury-cli --jwt $JWT --local false --mainnet false catchup --project-name "smart-wallets-next-dima" --contracts CBFOIYCWRC5LXYMF7VPM4MTBEIIMDJ6TBWYH2PY5U7MW73MINQNN3V7E
17
17
  curl -X GET https://api.mercurydata.app/catchups/4
18
18
  curl -X POST https://api.mercurydata.app/v2/key -H "Authorization: Bearer $JWT"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passkey-kit",
3
- "version": "0.10.19",
3
+ "version": "0.10.20",
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,15 +9,15 @@
9
9
  "types": "types/index.d.ts",
10
10
  "dependencies": {
11
11
  "@simplewebauthn/browser": "^13.1.0",
12
- "@stellar/stellar-sdk": "^13.1.0",
12
+ "@stellar/stellar-sdk": "^13.2.0",
13
13
  "base64url": "^3.0.1",
14
14
  "buffer": "^6.0.3",
15
- "passkey-kit-sdk": "0.6.6",
16
- "sac-sdk": "0.3.6"
15
+ "passkey-kit-sdk": "0.6.7",
16
+ "sac-sdk": "0.3.7"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@simplewebauthn/types": "^12.0.0",
20
- "@types/node": "^22.13.10",
20
+ "@types/node": "^22.14.0",
21
21
  "typescript": "^5.8.2"
22
22
  },
23
23
  "workspaces": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.6",
2
+ "version": "0.6.7",
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
- "buffer": "6.0.3",
13
- "@stellar/stellar-sdk": "13.1.0"
12
+ "@stellar/stellar-sdk": "^13.2.0",
13
+ "buffer": "^6.0.3"
14
14
  },
15
15
  "devDependencies": {
16
- "typescript": "5.8.2"
16
+ "typescript": "^5.8.2"
17
17
  }
18
18
  }
@@ -136,6 +136,7 @@ export class Client extends ContractClient {
136
136
  salt?: Buffer | Uint8Array;
137
137
  /** The format used to decode `wasmHash`, if it's provided as a string. */
138
138
  format?: "hex" | "base64";
139
+ address?: string;
139
140
  }
140
141
  ): Promise<AssembledTransaction<T>> {
141
142
  return ContractClient.deploy({ signer }, options)
@@ -178,6 +178,7 @@ export declare class Client extends ContractClient {
178
178
  salt?: Buffer | Uint8Array;
179
179
  /** The format used to decode `wasmHash`, if it's provided as a string. */
180
180
  format?: "hex" | "base64";
181
+ address?: string;
181
182
  }): Promise<AssembledTransaction<T>>;
182
183
  constructor(options: ContractClientOptions);
183
184
  readonly fromJSON: {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.6",
2
+ "version": "0.3.7",
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
- "buffer": "6.0.3",
13
- "@stellar/stellar-sdk": "13.1.0"
12
+ "@stellar/stellar-sdk": "^13.2.0",
13
+ "buffer": "^6.0.3"
14
14
  },
15
15
  "devDependencies": {
16
- "typescript": "5.8.2"
16
+ "typescript": "^5.8.2"
17
17
  }
18
18
  }
@@ -531,6 +531,7 @@ export class Client extends ContractClient {
531
531
  salt?: Buffer | Uint8Array;
532
532
  /** The format used to decode `wasmHash`, if it's provided as a string. */
533
533
  format?: "hex" | "base64";
534
+ address?: string;
534
535
  }
535
536
  ): Promise<AssembledTransaction<T>> {
536
537
  return ContractClient.deploy(null, options)
@@ -508,6 +508,7 @@ export declare class Client extends ContractClient {
508
508
  salt?: Buffer | Uint8Array;
509
509
  /** The format used to decode `wasmHash`, if it's provided as a string. */
510
510
  format?: "hex" | "base64";
511
+ address?: string;
511
512
  }): Promise<AssembledTransaction<T>>;
512
513
  constructor(options: ContractClientOptions);
513
514
  readonly fromJSON: {
package/src/kit.ts CHANGED
@@ -9,6 +9,8 @@ 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
+
12
14
  export class PasskeyKit extends PasskeyBase {
13
15
  declare rpc: Server
14
16
  declare rpcUrl: string
@@ -105,6 +107,12 @@ export class PasskeyKit extends PasskeyBase {
105
107
  residentKey: "preferred",
106
108
  userVerification: "preferred",
107
109
  } } = settings || {}
110
+
111
+ // TODO discover the contract id before creating the key so we can use it in the key name
112
+ // TODO it's possible for the creation to fail in which case we've created a passkey but it's not onchain.
113
+ // In this case we should save the passkey info and retry uploading it async vs asking the user to create another passkey
114
+ // This does introduce a storage dependency though so it likely needs to be a function with some logic for choosing how to store the passkey data
115
+
108
116
  const { id, response } = await this.WebAuthn.startRegistration({
109
117
  optionsJSON: {
110
118
  challenge: base64url("stellaristhebetterblockchain"),
@@ -180,6 +188,7 @@ export class PasskeyKit extends PasskeyBase {
180
188
 
181
189
  ////
182
190
  // TEMP for backwards compatibility for when we seeded wallets from a factory address
191
+ // Consider putting this in the constructor
183
192
  if (!contractId && walletPublicKey) {
184
193
  contractId = this.encodeContract(walletPublicKey, keyIdBuffer);
185
194