passkey-kit 0.10.11 → 0.10.12

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 +3 -3
  2. package/src/kit.ts +11 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passkey-kit",
3
- "version": "0.10.11",
3
+ "version": "0.10.12",
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",
@@ -12,8 +12,8 @@
12
12
  "@stellar/stellar-sdk": "^13.1.0",
13
13
  "base64url": "^3.0.1",
14
14
  "buffer": "^6.0.3",
15
- "passkey-kit-sdk": "0.6.5",
16
- "sac-sdk": "0.3.5"
15
+ "sac-sdk": "0.3.5",
16
+ "passkey-kit-sdk": "0.6.5"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@simplewebauthn/types": "^12.0.0",
package/src/kit.ts CHANGED
@@ -397,18 +397,20 @@ export class PasskeyKit extends PasskeyBase {
397
397
  }
398
398
  ) {
399
399
  if (!(txn instanceof AssembledTransaction)) {
400
- let tx = typeof txn === 'string' ? txn : txn.toXDR()
400
+ txn = typeof txn === 'string' ? txn : txn.toXDR()
401
401
 
402
402
  try {
403
- txn = AssembledTransaction.fromXDR(this.wallet!.options, tx, this.wallet!.spec)
403
+ txn = AssembledTransaction.fromXDR(this.wallet!.options, txn, this.wallet!.spec)
404
404
  } catch {
405
- const built = TransactionBuilder.fromXDR(tx, this.networkPassphrase);
406
- const operation = built.operations[0] as Operation.InvokeHostFunction;
407
-
408
- txn = await AssembledTransaction.buildWithOp<T>(
409
- Operation.invokeHostFunction({ func: operation.func }),
410
- this.wallet!.options as AssembledTransactionOptions<T>
411
- );
405
+ if (!(txn instanceof AssembledTransaction)) {
406
+ const built = TransactionBuilder.fromXDR(txn, this.networkPassphrase);
407
+ const operation = built.operations[0] as Operation.InvokeHostFunction;
408
+
409
+ txn = await AssembledTransaction.buildWithOp<T>(
410
+ Operation.invokeHostFunction({ func: operation.func }),
411
+ this.wallet!.options as AssembledTransactionOptions<T>
412
+ );
413
+ }
412
414
  }
413
415
  }
414
416