passkey-kit 0.10.11 → 0.10.13

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 +1 -1
  2. package/src/kit.ts +10 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passkey-kit",
3
- "version": "0.10.11",
3
+ "version": "0.10.13",
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
@@ -397,18 +397,18 @@ export class PasskeyKit extends PasskeyBase {
397
397
  }
398
398
  ) {
399
399
  if (!(txn instanceof AssembledTransaction)) {
400
- let tx = typeof txn === 'string' ? txn : txn.toXDR()
401
-
402
400
  try {
403
- txn = AssembledTransaction.fromXDR(this.wallet!.options, tx, this.wallet!.spec)
401
+ txn = AssembledTransaction.fromXDR(this.wallet!.options, typeof txn === 'string' ? txn : txn.toXDR(), this.wallet!.spec)
404
402
  } 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
- );
403
+ if (!(txn instanceof AssembledTransaction)) {
404
+ const built = TransactionBuilder.fromXDR(typeof txn === 'string' ? txn : txn.toXDR(), this.networkPassphrase);
405
+ const operation = built.operations[0] as Operation.InvokeHostFunction;
406
+
407
+ txn = await AssembledTransaction.buildWithOp<T>(
408
+ Operation.invokeHostFunction({ func: operation.func }),
409
+ this.wallet!.options as AssembledTransactionOptions<T>
410
+ );
411
+ }
412
412
  }
413
413
  }
414
414