@depay/web3-wallets-evm 14.6.5 → 14.7.0

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/dist/umd/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@depay/web3-blockchains'), require('ethers'), require('@depay/web3-constants'), require('@depay/solana-web3.js'), require('@depay/web3-client'), require('@depay/walletconnect-v1'), require('@depay/walletconnect-v2'), require('@depay/coinbase-wallet-sdk')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@depay/web3-blockchains', 'ethers', '@depay/web3-constants', '@depay/solana-web3.js', '@depay/web3-client', '@depay/walletconnect-v1', '@depay/walletconnect-v2', '@depay/coinbase-wallet-sdk'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Constants, global.SolanaWeb3js, global.Web3Client, global.WalletConnect, global.WalletConnectV2, global.CoinbaseWalletSdk));
5
- }(this, (function (exports, web3Blockchains, ethers, web3Constants, solanaWeb3_js, web3Client, walletconnectV1, walletconnectV2, coinbaseWalletSdk) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@depay/web3-blockchains'), require('ethers'), require('@depay/web3-client'), require('@depay/web3-constants'), require('@depay/solana-web3.js'), require('@depay/walletconnect-v1'), require('@depay/walletconnect-v2'), require('@depay/coinbase-wallet-sdk')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@depay/web3-blockchains', 'ethers', '@depay/web3-client', '@depay/web3-constants', '@depay/solana-web3.js', '@depay/walletconnect-v1', '@depay/walletconnect-v2', '@depay/coinbase-wallet-sdk'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Client, global.Web3Constants, global.SolanaWeb3js, global.WalletConnect, global.WalletConnectV2, global.CoinbaseWalletSdk));
5
+ }(this, (function (exports, web3Blockchains, ethers, web3Client, web3Constants, solanaWeb3_js, walletconnectV1, walletconnectV2, coinbaseWalletSdk) { 'use strict';
6
6
 
7
7
  function _optionalChain$g(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
8
8
  class Transaction {
@@ -210,7 +210,7 @@
210
210
 
211
211
  // MAKE SURE PROVIDER SUPPORT BATCH SIZE OF 99 BATCH REQUESTS!
212
212
  const ENDPOINTS = {
213
- ethereum: ['https://rpc.ankr.com/eth', 'https://eth-mainnet-public.unifra.io', 'https://ethereum.publicnode.com'],
213
+ ethereum: ['https://rpc.ankr.com/eth', 'https://eth.llamarpc.com', 'https://ethereum.publicnode.com'],
214
214
  bsc: ['https://bsc-dataseed.binance.org', 'https://bsc-dataseed1.ninicoin.io', 'https://bsc-dataseed3.defibit.io'],
215
215
  polygon: ['https://polygon-rpc.com', 'https://poly-rpc.gateway.pokt.network', 'https://matic-mainnet.chainstacklabs.com'],
216
216
  velas: ['https://mainnet.velas.com/rpc', 'https://evmexplorer.velas.com/rpc', 'https://explorer.velas.com/rpc'],
@@ -466,7 +466,7 @@
466
466
  }
467
467
  };
468
468
 
469
- let request = async function (url, options) {
469
+ let request$1 = async function (url, options) {
470
470
  let { blockchain, address, method } = parseUrl(url);
471
471
  let { api, params, cache: cache$1, block } = (typeof(url) == 'object' ? url : options) || {};
472
472
 
@@ -492,7 +492,7 @@
492
492
  throw({ code: 'WRONG_NETWORK' })
493
493
  }
494
494
  await transaction.prepare({ wallet });
495
- let transactionCount = await request({ blockchain: transaction.blockchain, method: 'transactionCount', address: transaction.from });
495
+ let transactionCount = await request$1({ blockchain: transaction.blockchain, method: 'transactionCount', address: transaction.from });
496
496
  transaction.nonce = transactionCount;
497
497
  let provider = new ethers.ethers.providers.Web3Provider(wallet.getProvider(), 'any');
498
498
  let signer = provider.getSigner(0);
@@ -678,6 +678,10 @@
678
678
  })
679
679
  }
680
680
 
681
+ transactionCount({ blockchain, address }) {
682
+ return web3Client.request({ blockchain, method: 'transactionCount', address })
683
+ }
684
+
681
685
  async sign(message) {
682
686
  await this.account();
683
687
  let provider = new ethers.ethers.providers.Web3Provider(this.getProvider(), 'any');
@@ -1104,7 +1108,7 @@
1104
1108
  }
1105
1109
  await transaction.prepare({ wallet });
1106
1110
  const smartContractWallet = await getSmartContractWallet(transaction.blockchain, transaction.from);
1107
- const transactionCount = smartContractWallet ? await smartContractWallet.transactionCount() : await web3Client.request({ blockchain: transaction.blockchain, method: 'transactionCount', address: transaction.from });
1111
+ let transactionCount = await wallet.transactionCount({ blockchain: transaction.blockchain, address: transaction.from });
1108
1112
  transaction.nonce = transactionCount;
1109
1113
  await submit$2({ transaction, wallet }).then((tx)=>{
1110
1114
  if (tx) {
@@ -1411,6 +1415,15 @@
1411
1415
  }
1412
1416
  }
1413
1417
 
1418
+ async transactionCount({ blockchain, address }) {
1419
+ const smartContractWallet = await getSmartContractWallet(blockchain, address);
1420
+ if(smartContractWallet) {
1421
+ return await smartContractWallet.transactionCount()
1422
+ } else {
1423
+ return await web3Client.request({ blockchain, method: 'transactionCount', address })
1424
+ }
1425
+ }
1426
+
1414
1427
  async sign(message) {
1415
1428
  let address = await this.account();
1416
1429
  var params = [ethers.ethers.utils.toUtf8Bytes(message), address];
@@ -1910,6 +1923,10 @@
1910
1923
  return internalCallback
1911
1924
  }
1912
1925
 
1926
+ transactionCount({ blockchain, address }) {
1927
+ return request({ blockchain, method: 'transactionCount', address })
1928
+ }
1929
+
1913
1930
  async sign(message) {
1914
1931
  await this.account();
1915
1932
  let provider = new ethers.ethers.providers.Web3Provider(this.connector, 'any');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/web3-wallets-evm",
3
3
  "moduleName": "Web3Wallets",
4
- "version": "14.6.5",
4
+ "version": "14.7.0",
5
5
  "description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.",
6
6
  "main": "dist/umd/index.evm.js",
7
7
  "module": "dist/esm/index.evm.js",
@@ -29,7 +29,7 @@
29
29
  "@depay/walletconnect-v1": "^1.8.0",
30
30
  "@depay/walletconnect-v2": "^2.4.2",
31
31
  "@depay/web3-blockchains": "^6.4.0",
32
- "@depay/web3-client-evm": "^10.3.0",
32
+ "@depay/web3-client-evm": "^10.3.2",
33
33
  "@depay/web3-constants": "^6.3.2",
34
34
  "ethers": "^5.7.1"
35
35
  },