@verified-network/verified-sdk 2.0.1 → 2.0.2

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.
@@ -411,14 +411,12 @@ class VerifiedContract {
411
411
  calls: [tx],
412
412
  },
413
413
  });
414
- // Execute the transaction using USDC on the smart account for gas
414
+ // Execute the transaction using passed paymentToken
415
415
  const { hash } = await meeClient.execute({
416
- // Specify USDC as the token to use for gas payment
417
416
  feeToken: {
418
417
  chainId,
419
418
  address: paymentToken,
420
419
  },
421
- // The transaction to execute
422
420
  instructions: [transactionInstruction],
423
421
  });
424
422
  txHash = hash;
@@ -492,14 +490,6 @@ class VerifiedContract {
492
490
  const smartAccount = await this.createSmartAccount(chainId);
493
491
  const account = await smartAccount.getAccountAddress();
494
492
  // console.log("smart account address: ", account);
495
- const _signer = this.signer;
496
- const nexusAccount = await (0, abstractjs_1.toMultichainNexusAccount)({
497
- chains: [chains_1.base, chains_1.mainnet, chains_1.sepolia, chains_1.gnosis, chains_1.baseSepolia, chains_1.polygon],
498
- transports: [(0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)()],
499
- signer: _signer,
500
- });
501
- const meeAddress = nexusAccount.addressOn(chainId);
502
- // console.log("nexus account address: ", meeAddress);
503
493
  // const signerAddress = await this.signer.getAddress();
504
494
  //construct calldata for function
505
495
  let fn = this.contract.populateTransaction[functionName];
@@ -510,6 +500,14 @@ class VerifiedContract {
510
500
  };
511
501
  if ((_a = optionsRaw[0]) === null || _a === void 0 ? void 0 : _a.paymentToken) {
512
502
  console.log("Using Mee client with paymentToken of: ", (_b = optionsRaw[0]) === null || _b === void 0 ? void 0 : _b.paymentToken);
503
+ const _signer = this.signer;
504
+ const nexusAccount = await (0, abstractjs_1.toMultichainNexusAccount)({
505
+ chains: [chains_1.base, chains_1.mainnet, chains_1.sepolia, chains_1.gnosis, chains_1.baseSepolia, chains_1.polygon],
506
+ transports: [(0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)(), (0, viem_1.http)()],
507
+ signer: _signer,
508
+ });
509
+ const meeAddress = nexusAccount.addressOn(chainId);
510
+ // console.log("nexus account address: ", meeAddress);
513
511
  return await this.callFunctionWithMEEClient(nexusAccount, chainId, tx1, (_c = optionsRaw[0]) === null || _c === void 0 ? void 0 : _c.paymentToken);
514
512
  }
515
513
  else {
@@ -576,14 +574,7 @@ class VerifiedContract {
576
574
  else if ((_b = err === null || err === void 0 ? void 0 : err.message) === null || _b === void 0 ? void 0 : _b.includes("code=INVALID_ARGUMENT")) {
577
575
  throw new TypeError(`Invalid arguments type`);
578
576
  }
579
- return {
580
- tokenAddress: "",
581
- amount: "0",
582
- amountInWei: "0",
583
- amouuntValue: "0",
584
- chainId,
585
- functionName,
586
- };
577
+ throw new Error((err === null || err === void 0 ? void 0 : err.message) || "getQuote failed.");
587
578
  }
588
579
  }
589
580
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verified-network/verified-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "An SDK to develop applications on the Verified Network",
5
5
  "repository": {
6
6
  "type": "git",