passkey-kit 0.10.12 → 0.10.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.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/src/kit.ts +8 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passkey-kit",
3
- "version": "0.10.12",
3
+ "version": "0.10.14",
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",
@@ -8,17 +8,17 @@
8
8
  "main": "src/index.ts",
9
9
  "types": "types/index.d.ts",
10
10
  "dependencies": {
11
- "@simplewebauthn/browser": "^13.0.0",
11
+ "@simplewebauthn/browser": "^13.1.0",
12
12
  "@stellar/stellar-sdk": "^13.1.0",
13
13
  "base64url": "^3.0.1",
14
14
  "buffer": "^6.0.3",
15
- "sac-sdk": "0.3.5",
16
- "passkey-kit-sdk": "0.6.5"
15
+ "passkey-kit-sdk": "0.6.5",
16
+ "sac-sdk": "0.3.5"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@simplewebauthn/types": "^12.0.0",
20
- "@types/node": "^22.10.2",
21
- "typescript": "^5.7.2"
20
+ "@types/node": "^22.13.6",
21
+ "typescript": "^5.8.2"
22
22
  },
23
23
  "workspaces": [
24
24
  "packages/*"
package/src/kit.ts CHANGED
@@ -39,7 +39,12 @@ export class PasskeyKit extends PasskeyBase {
39
39
  super(rpcUrl)
40
40
 
41
41
  this.networkPassphrase = networkPassphrase
42
- this.walletKeypair = Keypair.fromRawEd25519Seed(hash(Buffer.from(this.networkPassphrase)))
42
+ // this account exists as the seed source for deploying new wallets
43
+ // not using the genesis wallet as on mainnet the account has no usable signers
44
+ // there's a chance this isn't the best move and should instead be a constructor variable
45
+ // alternatively when we create a new wallet we shouldn't inherit the source as the auth entry signer
46
+ // Keypair.fromRawEd25519Seed(hash(Buffer.from(this.networkPassphrase)))
47
+ this.walletKeypair = Keypair.fromRawEd25519Seed(hash(Buffer.from('kalepail')));
43
48
  this.walletPublicKey = this.walletKeypair.publicKey()
44
49
  this.walletWasmHash = walletWasmHash
45
50
  this.WebAuthn = WebAuthn || { startRegistration, startAuthentication }
@@ -397,13 +402,11 @@ export class PasskeyKit extends PasskeyBase {
397
402
  }
398
403
  ) {
399
404
  if (!(txn instanceof AssembledTransaction)) {
400
- txn = typeof txn === 'string' ? txn : txn.toXDR()
401
-
402
405
  try {
403
- txn = AssembledTransaction.fromXDR(this.wallet!.options, txn, this.wallet!.spec)
406
+ txn = AssembledTransaction.fromXDR(this.wallet!.options, typeof txn === 'string' ? txn : txn.toXDR(), this.wallet!.spec)
404
407
  } catch {
405
408
  if (!(txn instanceof AssembledTransaction)) {
406
- const built = TransactionBuilder.fromXDR(txn, this.networkPassphrase);
409
+ const built = TransactionBuilder.fromXDR(typeof txn === 'string' ? txn : txn.toXDR(), this.networkPassphrase);
407
410
  const operation = built.operations[0] as Operation.InvokeHostFunction;
408
411
 
409
412
  txn = await AssembledTransaction.buildWithOp<T>(