@depay/web3-wallets-evm 15.3.0 → 15.4.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/README.md +1 -1
- package/dist/esm/index.evm.js +20 -21
- package/dist/esm/index.js +17 -18
- package/dist/esm/index.solana.js +20 -21
- package/dist/umd/index.evm.js +27 -23
- package/dist/umd/index.js +24 -20
- package/dist/umd/index.solana.js +27 -23
- package/package.json +3 -4
package/README.md
CHANGED
package/dist/esm/index.evm.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Blockchains from '@depay/web3-blockchains';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
import { request as request$3, getProvider, estimate } from '@depay/web3-client-evm';
|
|
4
|
-
import { CONSTANTS } from '@depay/web3-constants';
|
|
5
4
|
import { WalletConnectClient } from '@depay/walletconnect-v1';
|
|
6
5
|
import { CoinbaseWalletSDK } from '@depay/coinbase-wallet-sdk';
|
|
7
6
|
|
|
@@ -58933,7 +58932,7 @@ class StaticJsonRpcBatchProvider extends ethers.providers.JsonRpcProvider {
|
|
|
58933
58932
|
}
|
|
58934
58933
|
|
|
58935
58934
|
detectNetwork() {
|
|
58936
|
-
return Promise.resolve(
|
|
58935
|
+
return Promise.resolve(Blockchains.findByName(this._network).id)
|
|
58937
58936
|
}
|
|
58938
58937
|
|
|
58939
58938
|
requestChunk(chunk, endpoint) {
|
|
@@ -59210,7 +59209,7 @@ let supported$1 = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'velas'];
|
|
|
59210
59209
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'velas'];
|
|
59211
59210
|
supported$1.solana = ['solana'];
|
|
59212
59211
|
|
|
59213
|
-
function _optionalChain$
|
|
59212
|
+
function _optionalChain$1$1(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; }
|
|
59214
59213
|
let getCacheStore = () => {
|
|
59215
59214
|
if (getWindow()._cacheStore == undefined) {
|
|
59216
59215
|
resetCache();
|
|
@@ -59240,7 +59239,7 @@ let set = function ({ key, value, expires }) {
|
|
|
59240
59239
|
|
|
59241
59240
|
let get = function ({ key, expires }) {
|
|
59242
59241
|
let cachedEntry = getCacheStore()[key];
|
|
59243
|
-
if (_optionalChain$
|
|
59242
|
+
if (_optionalChain$1$1([cachedEntry, 'optionalAccess', _ => _.expiresAt]) > Date.now()) {
|
|
59244
59243
|
return cachedEntry.value
|
|
59245
59244
|
}
|
|
59246
59245
|
};
|
|
@@ -59478,7 +59477,7 @@ class Transaction {
|
|
|
59478
59477
|
|
|
59479
59478
|
static bigNumberify(value, blockchain) {
|
|
59480
59479
|
if (typeof value === 'number') {
|
|
59481
|
-
return ethers.utils.parseUnits(value.toString(),
|
|
59480
|
+
return ethers.utils.parseUnits(value.toString(), Blockchains[blockchain].currency.decimals)
|
|
59482
59481
|
} else if (value && value.toString) {
|
|
59483
59482
|
return ethers.BigNumber.from(value.toString())
|
|
59484
59483
|
} else {
|
|
@@ -59562,7 +59561,7 @@ const sendTransaction$3 = async ({ transaction, wallet })=> {
|
|
|
59562
59561
|
if (sentTransaction) {
|
|
59563
59562
|
transaction.id = sentTransaction.hash;
|
|
59564
59563
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
59565
|
-
transaction.url =
|
|
59564
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59566
59565
|
if (transaction.sent) transaction.sent(transaction);
|
|
59567
59566
|
sentTransaction.wait(1).then(() => {
|
|
59568
59567
|
transaction._succeeded = true;
|
|
@@ -59571,7 +59570,7 @@ const sendTransaction$3 = async ({ transaction, wallet })=> {
|
|
|
59571
59570
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
59572
59571
|
if(error.replacement && error.replacement.hash) {
|
|
59573
59572
|
transaction.id = error.replacement.hash;
|
|
59574
|
-
transaction.url =
|
|
59573
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59575
59574
|
}
|
|
59576
59575
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
59577
59576
|
transaction._succeeded = true;
|
|
@@ -59691,7 +59690,7 @@ class WindowEthereum {
|
|
|
59691
59690
|
}
|
|
59692
59691
|
|
|
59693
59692
|
async connectedTo(input) {
|
|
59694
|
-
const blockchain =
|
|
59693
|
+
const blockchain = Blockchains.findById(await this.getProvider().request({ method: 'eth_chainId' }));
|
|
59695
59694
|
if(input) {
|
|
59696
59695
|
return input === blockchain.name
|
|
59697
59696
|
} else {
|
|
@@ -59701,7 +59700,7 @@ class WindowEthereum {
|
|
|
59701
59700
|
|
|
59702
59701
|
addNetwork(blockchainName) {
|
|
59703
59702
|
return new Promise((resolve, reject)=>{
|
|
59704
|
-
const blockchain =
|
|
59703
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
59705
59704
|
this.getProvider().request({
|
|
59706
59705
|
method: 'wallet_addEthereumChain',
|
|
59707
59706
|
params: [{
|
|
@@ -59722,7 +59721,7 @@ class WindowEthereum {
|
|
|
59722
59721
|
|
|
59723
59722
|
switchTo(blockchainName) {
|
|
59724
59723
|
return new Promise((resolve, reject)=>{
|
|
59725
|
-
const blockchain =
|
|
59724
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
59726
59725
|
this.getProvider().request({
|
|
59727
59726
|
method: 'wallet_switchEthereumChain',
|
|
59728
59727
|
params: [{ chainId: blockchain.id }],
|
|
@@ -59869,7 +59868,7 @@ const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
|
59869
59868
|
await submit$2({ transaction, wallet }).then(({ signature })=>{
|
|
59870
59869
|
if(signature) {
|
|
59871
59870
|
transaction.id = signature;
|
|
59872
|
-
transaction.url =
|
|
59871
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59873
59872
|
if (transaction.sent) transaction.sent(transaction);
|
|
59874
59873
|
|
|
59875
59874
|
let count = 0;
|
|
@@ -60158,7 +60157,7 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
|
60158
60157
|
transaction.nonce = transactionCount;
|
|
60159
60158
|
await submit$1({ transaction, wallet }).then((tx)=>{
|
|
60160
60159
|
if (tx) {
|
|
60161
|
-
let blockchain =
|
|
60160
|
+
let blockchain = Blockchains.findByName(transaction.blockchain);
|
|
60162
60161
|
transaction.id = tx;
|
|
60163
60162
|
transaction.url = smartContractWallet && smartContractWallet.explorerUrlFor ? smartContractWallet.explorerUrlFor({ transaction }) : blockchain.explorerUrlFor({ transaction });
|
|
60164
60163
|
if (transaction.sent) transaction.sent(transaction);
|
|
@@ -60393,7 +60392,7 @@ class WalletConnectV1 {
|
|
|
60393
60392
|
|
|
60394
60393
|
async connectedTo(input) {
|
|
60395
60394
|
let chainId = await this.connector.sendCustomRequest({ method: 'eth_chainId' });
|
|
60396
|
-
const blockchain =
|
|
60395
|
+
const blockchain = Blockchains.findById(chainId);
|
|
60397
60396
|
if(input) {
|
|
60398
60397
|
return input === blockchain.name
|
|
60399
60398
|
} else {
|
|
@@ -60404,7 +60403,7 @@ class WalletConnectV1 {
|
|
|
60404
60403
|
switchTo(blockchainName) {
|
|
60405
60404
|
return new Promise((resolve, reject)=>{
|
|
60406
60405
|
let resolved, rejected;
|
|
60407
|
-
const blockchain =
|
|
60406
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
60408
60407
|
setTimeout(async()=>{
|
|
60409
60408
|
if(!(await this.connectedTo(blockchainName)) && !resolved && !rejected){
|
|
60410
60409
|
reject({ code: 'NOT_SUPPORTED' });
|
|
@@ -60439,7 +60438,7 @@ class WalletConnectV1 {
|
|
|
60439
60438
|
|
|
60440
60439
|
addNetwork(blockchainName) {
|
|
60441
60440
|
return new Promise((resolve, reject)=>{
|
|
60442
|
-
const blockchain =
|
|
60441
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
60443
60442
|
this.connector.sendCustomRequest({
|
|
60444
60443
|
method: 'wallet_addEthereumChain',
|
|
60445
60444
|
params: [{
|
|
@@ -60520,7 +60519,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
60520
60519
|
if (sentTransaction) {
|
|
60521
60520
|
transaction.id = sentTransaction.hash;
|
|
60522
60521
|
transaction.nonce = sentTransaction.nonce;
|
|
60523
|
-
transaction.url =
|
|
60522
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
60524
60523
|
if (transaction.sent) transaction.sent(transaction);
|
|
60525
60524
|
sentTransaction.wait(1).then(() => {
|
|
60526
60525
|
transaction._succeeded = true;
|
|
@@ -60529,7 +60528,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
60529
60528
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
60530
60529
|
if(error.replacement && error.replacement.hash) {
|
|
60531
60530
|
transaction.id = error.replacement.hash;
|
|
60532
|
-
transaction.url =
|
|
60531
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
60533
60532
|
}
|
|
60534
60533
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
60535
60534
|
transaction._succeeded = true;
|
|
@@ -60636,7 +60635,7 @@ class WalletLink {
|
|
|
60636
60635
|
|
|
60637
60636
|
async connectedTo(input) {
|
|
60638
60637
|
let chainId = await this.connector.getChainId();
|
|
60639
|
-
const blockchain =
|
|
60638
|
+
const blockchain = Blockchains.findByNetworkId(chainId);
|
|
60640
60639
|
if(input) {
|
|
60641
60640
|
return input === blockchain.name
|
|
60642
60641
|
} else {
|
|
@@ -60646,7 +60645,7 @@ class WalletLink {
|
|
|
60646
60645
|
|
|
60647
60646
|
switchTo(blockchainName) {
|
|
60648
60647
|
return new Promise((resolve, reject)=>{
|
|
60649
|
-
const blockchain =
|
|
60648
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
60650
60649
|
this.connector.request({
|
|
60651
60650
|
method: 'wallet_switchEthereumChain',
|
|
60652
60651
|
params: [{ chainId: blockchain.id }],
|
|
@@ -60664,7 +60663,7 @@ class WalletLink {
|
|
|
60664
60663
|
|
|
60665
60664
|
addNetwork(blockchainName) {
|
|
60666
60665
|
return new Promise((resolve, reject)=>{
|
|
60667
|
-
const blockchain =
|
|
60666
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
60668
60667
|
this.connector.request({
|
|
60669
60668
|
method: 'wallet_addEthereumChain',
|
|
60670
60669
|
params: [{
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Blockchains from '@depay/web3-blockchains';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
import { request, getProvider, estimate } from '@depay/web3-client';
|
|
4
|
-
import { CONSTANTS } from '@depay/web3-constants';
|
|
5
4
|
import { PublicKey, Transaction as Transaction$1, SystemProgram } from '@depay/solana-web3.js';
|
|
6
5
|
import { WalletConnectClient } from '@depay/walletconnect-v1';
|
|
7
6
|
import { CoinbaseWalletSDK } from '@depay/coinbase-wallet-sdk';
|
|
@@ -41,7 +40,7 @@ class Transaction {
|
|
|
41
40
|
|
|
42
41
|
static bigNumberify(value, blockchain) {
|
|
43
42
|
if (typeof value === 'number') {
|
|
44
|
-
return ethers.utils.parseUnits(value.toString(),
|
|
43
|
+
return ethers.utils.parseUnits(value.toString(), Blockchains[blockchain].currency.decimals)
|
|
45
44
|
} else if (value && value.toString) {
|
|
46
45
|
return ethers.BigNumber.from(value.toString())
|
|
47
46
|
} else {
|
|
@@ -125,7 +124,7 @@ const sendTransaction$3 = async ({ transaction, wallet })=> {
|
|
|
125
124
|
if (sentTransaction) {
|
|
126
125
|
transaction.id = sentTransaction.hash;
|
|
127
126
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
128
|
-
transaction.url =
|
|
127
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
129
128
|
if (transaction.sent) transaction.sent(transaction);
|
|
130
129
|
sentTransaction.wait(1).then(() => {
|
|
131
130
|
transaction._succeeded = true;
|
|
@@ -134,7 +133,7 @@ const sendTransaction$3 = async ({ transaction, wallet })=> {
|
|
|
134
133
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
135
134
|
if(error.replacement && error.replacement.hash) {
|
|
136
135
|
transaction.id = error.replacement.hash;
|
|
137
|
-
transaction.url =
|
|
136
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
138
137
|
}
|
|
139
138
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
140
139
|
transaction._succeeded = true;
|
|
@@ -254,7 +253,7 @@ class WindowEthereum {
|
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
async connectedTo(input) {
|
|
257
|
-
const blockchain =
|
|
256
|
+
const blockchain = Blockchains.findById(await this.getProvider().request({ method: 'eth_chainId' }));
|
|
258
257
|
if(input) {
|
|
259
258
|
return input === blockchain.name
|
|
260
259
|
} else {
|
|
@@ -264,7 +263,7 @@ class WindowEthereum {
|
|
|
264
263
|
|
|
265
264
|
addNetwork(blockchainName) {
|
|
266
265
|
return new Promise((resolve, reject)=>{
|
|
267
|
-
const blockchain =
|
|
266
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
268
267
|
this.getProvider().request({
|
|
269
268
|
method: 'wallet_addEthereumChain',
|
|
270
269
|
params: [{
|
|
@@ -285,7 +284,7 @@ class WindowEthereum {
|
|
|
285
284
|
|
|
286
285
|
switchTo(blockchainName) {
|
|
287
286
|
return new Promise((resolve, reject)=>{
|
|
288
|
-
const blockchain =
|
|
287
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
289
288
|
this.getProvider().request({
|
|
290
289
|
method: 'wallet_switchEthereumChain',
|
|
291
290
|
params: [{ chainId: blockchain.id }],
|
|
@@ -432,7 +431,7 @@ const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
|
432
431
|
await submit$2({ transaction, wallet }).then(({ signature })=>{
|
|
433
432
|
if(signature) {
|
|
434
433
|
transaction.id = signature;
|
|
435
|
-
transaction.url =
|
|
434
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
436
435
|
if (transaction.sent) transaction.sent(transaction);
|
|
437
436
|
|
|
438
437
|
let count = 0;
|
|
@@ -721,7 +720,7 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
|
721
720
|
transaction.nonce = transactionCount;
|
|
722
721
|
await submit$1({ transaction, wallet }).then((tx)=>{
|
|
723
722
|
if (tx) {
|
|
724
|
-
let blockchain =
|
|
723
|
+
let blockchain = Blockchains.findByName(transaction.blockchain);
|
|
725
724
|
transaction.id = tx;
|
|
726
725
|
transaction.url = smartContractWallet && smartContractWallet.explorerUrlFor ? smartContractWallet.explorerUrlFor({ transaction }) : blockchain.explorerUrlFor({ transaction });
|
|
727
726
|
if (transaction.sent) transaction.sent(transaction);
|
|
@@ -956,7 +955,7 @@ class WalletConnectV1 {
|
|
|
956
955
|
|
|
957
956
|
async connectedTo(input) {
|
|
958
957
|
let chainId = await this.connector.sendCustomRequest({ method: 'eth_chainId' });
|
|
959
|
-
const blockchain =
|
|
958
|
+
const blockchain = Blockchains.findById(chainId);
|
|
960
959
|
if(input) {
|
|
961
960
|
return input === blockchain.name
|
|
962
961
|
} else {
|
|
@@ -967,7 +966,7 @@ class WalletConnectV1 {
|
|
|
967
966
|
switchTo(blockchainName) {
|
|
968
967
|
return new Promise((resolve, reject)=>{
|
|
969
968
|
let resolved, rejected;
|
|
970
|
-
const blockchain =
|
|
969
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
971
970
|
setTimeout(async()=>{
|
|
972
971
|
if(!(await this.connectedTo(blockchainName)) && !resolved && !rejected){
|
|
973
972
|
reject({ code: 'NOT_SUPPORTED' });
|
|
@@ -1002,7 +1001,7 @@ class WalletConnectV1 {
|
|
|
1002
1001
|
|
|
1003
1002
|
addNetwork(blockchainName) {
|
|
1004
1003
|
return new Promise((resolve, reject)=>{
|
|
1005
|
-
const blockchain =
|
|
1004
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
1006
1005
|
this.connector.sendCustomRequest({
|
|
1007
1006
|
method: 'wallet_addEthereumChain',
|
|
1008
1007
|
params: [{
|
|
@@ -1083,7 +1082,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
1083
1082
|
if (sentTransaction) {
|
|
1084
1083
|
transaction.id = sentTransaction.hash;
|
|
1085
1084
|
transaction.nonce = sentTransaction.nonce;
|
|
1086
|
-
transaction.url =
|
|
1085
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
1087
1086
|
if (transaction.sent) transaction.sent(transaction);
|
|
1088
1087
|
sentTransaction.wait(1).then(() => {
|
|
1089
1088
|
transaction._succeeded = true;
|
|
@@ -1092,7 +1091,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
1092
1091
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
1093
1092
|
if(error.replacement && error.replacement.hash) {
|
|
1094
1093
|
transaction.id = error.replacement.hash;
|
|
1095
|
-
transaction.url =
|
|
1094
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
1096
1095
|
}
|
|
1097
1096
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
1098
1097
|
transaction._succeeded = true;
|
|
@@ -1199,7 +1198,7 @@ class WalletLink {
|
|
|
1199
1198
|
|
|
1200
1199
|
async connectedTo(input) {
|
|
1201
1200
|
let chainId = await this.connector.getChainId();
|
|
1202
|
-
const blockchain =
|
|
1201
|
+
const blockchain = Blockchains.findByNetworkId(chainId);
|
|
1203
1202
|
if(input) {
|
|
1204
1203
|
return input === blockchain.name
|
|
1205
1204
|
} else {
|
|
@@ -1209,7 +1208,7 @@ class WalletLink {
|
|
|
1209
1208
|
|
|
1210
1209
|
switchTo(blockchainName) {
|
|
1211
1210
|
return new Promise((resolve, reject)=>{
|
|
1212
|
-
const blockchain =
|
|
1211
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
1213
1212
|
this.connector.request({
|
|
1214
1213
|
method: 'wallet_switchEthereumChain',
|
|
1215
1214
|
params: [{ chainId: blockchain.id }],
|
|
@@ -1227,7 +1226,7 @@ class WalletLink {
|
|
|
1227
1226
|
|
|
1228
1227
|
addNetwork(blockchainName) {
|
|
1229
1228
|
return new Promise((resolve, reject)=>{
|
|
1230
|
-
const blockchain =
|
|
1229
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
1231
1230
|
this.connector.request({
|
|
1232
1231
|
method: 'wallet_addEthereumChain',
|
|
1233
1232
|
params: [{
|
package/dist/esm/index.solana.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Blockchains from '@depay/web3-blockchains';
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
import { request as request$3, getProvider, estimate } from '@depay/web3-client-solana';
|
|
4
|
-
import { CONSTANTS } from '@depay/web3-constants';
|
|
5
4
|
import { WalletConnectClient } from '@depay/walletconnect-v1';
|
|
6
5
|
import { CoinbaseWalletSDK } from '@depay/coinbase-wallet-sdk';
|
|
7
6
|
|
|
@@ -58933,7 +58932,7 @@ class StaticJsonRpcBatchProvider extends ethers.providers.JsonRpcProvider {
|
|
|
58933
58932
|
}
|
|
58934
58933
|
|
|
58935
58934
|
detectNetwork() {
|
|
58936
|
-
return Promise.resolve(
|
|
58935
|
+
return Promise.resolve(Blockchains.findByName(this._network).id)
|
|
58937
58936
|
}
|
|
58938
58937
|
|
|
58939
58938
|
requestChunk(chunk, endpoint) {
|
|
@@ -59210,7 +59209,7 @@ let supported$1 = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'velas'];
|
|
|
59210
59209
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'velas'];
|
|
59211
59210
|
supported$1.solana = ['solana'];
|
|
59212
59211
|
|
|
59213
|
-
function _optionalChain$
|
|
59212
|
+
function _optionalChain$1$1(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; }
|
|
59214
59213
|
let getCacheStore = () => {
|
|
59215
59214
|
if (getWindow()._cacheStore == undefined) {
|
|
59216
59215
|
resetCache();
|
|
@@ -59240,7 +59239,7 @@ let set = function ({ key, value, expires }) {
|
|
|
59240
59239
|
|
|
59241
59240
|
let get = function ({ key, expires }) {
|
|
59242
59241
|
let cachedEntry = getCacheStore()[key];
|
|
59243
|
-
if (_optionalChain$
|
|
59242
|
+
if (_optionalChain$1$1([cachedEntry, 'optionalAccess', _ => _.expiresAt]) > Date.now()) {
|
|
59244
59243
|
return cachedEntry.value
|
|
59245
59244
|
}
|
|
59246
59245
|
};
|
|
@@ -59478,7 +59477,7 @@ class Transaction {
|
|
|
59478
59477
|
|
|
59479
59478
|
static bigNumberify(value, blockchain) {
|
|
59480
59479
|
if (typeof value === 'number') {
|
|
59481
|
-
return ethers.utils.parseUnits(value.toString(),
|
|
59480
|
+
return ethers.utils.parseUnits(value.toString(), Blockchains[blockchain].currency.decimals)
|
|
59482
59481
|
} else if (value && value.toString) {
|
|
59483
59482
|
return ethers.BigNumber.from(value.toString())
|
|
59484
59483
|
} else {
|
|
@@ -59562,7 +59561,7 @@ const sendTransaction$3 = async ({ transaction, wallet })=> {
|
|
|
59562
59561
|
if (sentTransaction) {
|
|
59563
59562
|
transaction.id = sentTransaction.hash;
|
|
59564
59563
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
59565
|
-
transaction.url =
|
|
59564
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59566
59565
|
if (transaction.sent) transaction.sent(transaction);
|
|
59567
59566
|
sentTransaction.wait(1).then(() => {
|
|
59568
59567
|
transaction._succeeded = true;
|
|
@@ -59571,7 +59570,7 @@ const sendTransaction$3 = async ({ transaction, wallet })=> {
|
|
|
59571
59570
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
59572
59571
|
if(error.replacement && error.replacement.hash) {
|
|
59573
59572
|
transaction.id = error.replacement.hash;
|
|
59574
|
-
transaction.url =
|
|
59573
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59575
59574
|
}
|
|
59576
59575
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
59577
59576
|
transaction._succeeded = true;
|
|
@@ -59691,7 +59690,7 @@ class WindowEthereum {
|
|
|
59691
59690
|
}
|
|
59692
59691
|
|
|
59693
59692
|
async connectedTo(input) {
|
|
59694
|
-
const blockchain =
|
|
59693
|
+
const blockchain = Blockchains.findById(await this.getProvider().request({ method: 'eth_chainId' }));
|
|
59695
59694
|
if(input) {
|
|
59696
59695
|
return input === blockchain.name
|
|
59697
59696
|
} else {
|
|
@@ -59701,7 +59700,7 @@ class WindowEthereum {
|
|
|
59701
59700
|
|
|
59702
59701
|
addNetwork(blockchainName) {
|
|
59703
59702
|
return new Promise((resolve, reject)=>{
|
|
59704
|
-
const blockchain =
|
|
59703
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
59705
59704
|
this.getProvider().request({
|
|
59706
59705
|
method: 'wallet_addEthereumChain',
|
|
59707
59706
|
params: [{
|
|
@@ -59722,7 +59721,7 @@ class WindowEthereum {
|
|
|
59722
59721
|
|
|
59723
59722
|
switchTo(blockchainName) {
|
|
59724
59723
|
return new Promise((resolve, reject)=>{
|
|
59725
|
-
const blockchain =
|
|
59724
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
59726
59725
|
this.getProvider().request({
|
|
59727
59726
|
method: 'wallet_switchEthereumChain',
|
|
59728
59727
|
params: [{ chainId: blockchain.id }],
|
|
@@ -59869,7 +59868,7 @@ const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
|
59869
59868
|
await submit$2({ transaction, wallet }).then(({ signature })=>{
|
|
59870
59869
|
if(signature) {
|
|
59871
59870
|
transaction.id = signature;
|
|
59872
|
-
transaction.url =
|
|
59871
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59873
59872
|
if (transaction.sent) transaction.sent(transaction);
|
|
59874
59873
|
|
|
59875
59874
|
let count = 0;
|
|
@@ -60158,7 +60157,7 @@ const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
|
60158
60157
|
transaction.nonce = transactionCount;
|
|
60159
60158
|
await submit$1({ transaction, wallet }).then((tx)=>{
|
|
60160
60159
|
if (tx) {
|
|
60161
|
-
let blockchain =
|
|
60160
|
+
let blockchain = Blockchains.findByName(transaction.blockchain);
|
|
60162
60161
|
transaction.id = tx;
|
|
60163
60162
|
transaction.url = smartContractWallet && smartContractWallet.explorerUrlFor ? smartContractWallet.explorerUrlFor({ transaction }) : blockchain.explorerUrlFor({ transaction });
|
|
60164
60163
|
if (transaction.sent) transaction.sent(transaction);
|
|
@@ -60393,7 +60392,7 @@ class WalletConnectV1 {
|
|
|
60393
60392
|
|
|
60394
60393
|
async connectedTo(input) {
|
|
60395
60394
|
let chainId = await this.connector.sendCustomRequest({ method: 'eth_chainId' });
|
|
60396
|
-
const blockchain =
|
|
60395
|
+
const blockchain = Blockchains.findById(chainId);
|
|
60397
60396
|
if(input) {
|
|
60398
60397
|
return input === blockchain.name
|
|
60399
60398
|
} else {
|
|
@@ -60404,7 +60403,7 @@ class WalletConnectV1 {
|
|
|
60404
60403
|
switchTo(blockchainName) {
|
|
60405
60404
|
return new Promise((resolve, reject)=>{
|
|
60406
60405
|
let resolved, rejected;
|
|
60407
|
-
const blockchain =
|
|
60406
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
60408
60407
|
setTimeout(async()=>{
|
|
60409
60408
|
if(!(await this.connectedTo(blockchainName)) && !resolved && !rejected){
|
|
60410
60409
|
reject({ code: 'NOT_SUPPORTED' });
|
|
@@ -60439,7 +60438,7 @@ class WalletConnectV1 {
|
|
|
60439
60438
|
|
|
60440
60439
|
addNetwork(blockchainName) {
|
|
60441
60440
|
return new Promise((resolve, reject)=>{
|
|
60442
|
-
const blockchain =
|
|
60441
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
60443
60442
|
this.connector.sendCustomRequest({
|
|
60444
60443
|
method: 'wallet_addEthereumChain',
|
|
60445
60444
|
params: [{
|
|
@@ -60520,7 +60519,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
60520
60519
|
if (sentTransaction) {
|
|
60521
60520
|
transaction.id = sentTransaction.hash;
|
|
60522
60521
|
transaction.nonce = sentTransaction.nonce;
|
|
60523
|
-
transaction.url =
|
|
60522
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
60524
60523
|
if (transaction.sent) transaction.sent(transaction);
|
|
60525
60524
|
sentTransaction.wait(1).then(() => {
|
|
60526
60525
|
transaction._succeeded = true;
|
|
@@ -60529,7 +60528,7 @@ const sendTransaction = async ({ transaction, wallet })=> {
|
|
|
60529
60528
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
60530
60529
|
if(error.replacement && error.replacement.hash) {
|
|
60531
60530
|
transaction.id = error.replacement.hash;
|
|
60532
|
-
transaction.url =
|
|
60531
|
+
transaction.url = Blockchains.findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
60533
60532
|
}
|
|
60534
60533
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
60535
60534
|
transaction._succeeded = true;
|
|
@@ -60636,7 +60635,7 @@ class WalletLink {
|
|
|
60636
60635
|
|
|
60637
60636
|
async connectedTo(input) {
|
|
60638
60637
|
let chainId = await this.connector.getChainId();
|
|
60639
|
-
const blockchain =
|
|
60638
|
+
const blockchain = Blockchains.findByNetworkId(chainId);
|
|
60640
60639
|
if(input) {
|
|
60641
60640
|
return input === blockchain.name
|
|
60642
60641
|
} else {
|
|
@@ -60646,7 +60645,7 @@ class WalletLink {
|
|
|
60646
60645
|
|
|
60647
60646
|
switchTo(blockchainName) {
|
|
60648
60647
|
return new Promise((resolve, reject)=>{
|
|
60649
|
-
const blockchain =
|
|
60648
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
60650
60649
|
this.connector.request({
|
|
60651
60650
|
method: 'wallet_switchEthereumChain',
|
|
60652
60651
|
params: [{ chainId: blockchain.id }],
|
|
@@ -60664,7 +60663,7 @@ class WalletLink {
|
|
|
60664
60663
|
|
|
60665
60664
|
addNetwork(blockchainName) {
|
|
60666
60665
|
return new Promise((resolve, reject)=>{
|
|
60667
|
-
const blockchain =
|
|
60666
|
+
const blockchain = Blockchains.findByName(blockchainName);
|
|
60668
60667
|
this.connector.request({
|
|
60669
60668
|
method: 'wallet_addEthereumChain',
|
|
60670
60669
|
params: [{
|
package/dist/umd/index.evm.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@depay/web3-blockchains'), require('ethers'), require('@depay/web3-client-evm'), require('@depay/
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@depay/web3-blockchains', 'ethers', '@depay/web3-client-evm', '@depay/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Client, global.
|
|
5
|
-
}(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@depay/web3-blockchains'), require('ethers'), require('@depay/web3-client-evm'), require('@depay/walletconnect-v1'), require('@depay/coinbase-wallet-sdk')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@depay/web3-blockchains', 'ethers', '@depay/web3-client-evm', '@depay/walletconnect-v1', '@depay/coinbase-wallet-sdk'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Client, global.WalletConnect, global.CoinbaseWalletSdk));
|
|
5
|
+
}(this, (function (exports, Blockchains, ethers, web3ClientEvm, walletconnectV1, coinbaseWalletSdk) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var Blockchains__default = /*#__PURE__*/_interopDefaultLegacy(Blockchains);
|
|
6
10
|
|
|
7
11
|
let supported$2 = ['ethereum', 'bsc', 'polygon', 'fantom', 'velas'];
|
|
8
12
|
supported$2.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'velas'];
|
|
@@ -58932,7 +58936,7 @@
|
|
|
58932
58936
|
}
|
|
58933
58937
|
|
|
58934
58938
|
detectNetwork() {
|
|
58935
|
-
return Promise.resolve(
|
|
58939
|
+
return Promise.resolve(Blockchains__default['default'].findByName(this._network).id)
|
|
58936
58940
|
}
|
|
58937
58941
|
|
|
58938
58942
|
requestChunk(chunk, endpoint) {
|
|
@@ -59209,7 +59213,7 @@
|
|
|
59209
59213
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'velas'];
|
|
59210
59214
|
supported$1.solana = ['solana'];
|
|
59211
59215
|
|
|
59212
|
-
function _optionalChain$
|
|
59216
|
+
function _optionalChain$1$1(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; }
|
|
59213
59217
|
let getCacheStore = () => {
|
|
59214
59218
|
if (getWindow()._cacheStore == undefined) {
|
|
59215
59219
|
resetCache();
|
|
@@ -59239,7 +59243,7 @@
|
|
|
59239
59243
|
|
|
59240
59244
|
let get = function ({ key, expires }) {
|
|
59241
59245
|
let cachedEntry = getCacheStore()[key];
|
|
59242
|
-
if (_optionalChain$
|
|
59246
|
+
if (_optionalChain$1$1([cachedEntry, 'optionalAccess', _ => _.expiresAt]) > Date.now()) {
|
|
59243
59247
|
return cachedEntry.value
|
|
59244
59248
|
}
|
|
59245
59249
|
};
|
|
@@ -59477,7 +59481,7 @@
|
|
|
59477
59481
|
|
|
59478
59482
|
static bigNumberify(value, blockchain) {
|
|
59479
59483
|
if (typeof value === 'number') {
|
|
59480
|
-
return ethers.ethers.utils.parseUnits(value.toString(),
|
|
59484
|
+
return ethers.ethers.utils.parseUnits(value.toString(), Blockchains__default['default'][blockchain].currency.decimals)
|
|
59481
59485
|
} else if (value && value.toString) {
|
|
59482
59486
|
return ethers.ethers.BigNumber.from(value.toString())
|
|
59483
59487
|
} else {
|
|
@@ -59561,7 +59565,7 @@
|
|
|
59561
59565
|
if (sentTransaction) {
|
|
59562
59566
|
transaction.id = sentTransaction.hash;
|
|
59563
59567
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
59564
|
-
transaction.url =
|
|
59568
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59565
59569
|
if (transaction.sent) transaction.sent(transaction);
|
|
59566
59570
|
sentTransaction.wait(1).then(() => {
|
|
59567
59571
|
transaction._succeeded = true;
|
|
@@ -59570,7 +59574,7 @@
|
|
|
59570
59574
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
59571
59575
|
if(error.replacement && error.replacement.hash) {
|
|
59572
59576
|
transaction.id = error.replacement.hash;
|
|
59573
|
-
transaction.url =
|
|
59577
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59574
59578
|
}
|
|
59575
59579
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
59576
59580
|
transaction._succeeded = true;
|
|
@@ -59690,7 +59694,7 @@
|
|
|
59690
59694
|
}
|
|
59691
59695
|
|
|
59692
59696
|
async connectedTo(input) {
|
|
59693
|
-
const blockchain =
|
|
59697
|
+
const blockchain = Blockchains__default['default'].findById(await this.getProvider().request({ method: 'eth_chainId' }));
|
|
59694
59698
|
if(input) {
|
|
59695
59699
|
return input === blockchain.name
|
|
59696
59700
|
} else {
|
|
@@ -59700,7 +59704,7 @@
|
|
|
59700
59704
|
|
|
59701
59705
|
addNetwork(blockchainName) {
|
|
59702
59706
|
return new Promise((resolve, reject)=>{
|
|
59703
|
-
const blockchain =
|
|
59707
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
59704
59708
|
this.getProvider().request({
|
|
59705
59709
|
method: 'wallet_addEthereumChain',
|
|
59706
59710
|
params: [{
|
|
@@ -59721,7 +59725,7 @@
|
|
|
59721
59725
|
|
|
59722
59726
|
switchTo(blockchainName) {
|
|
59723
59727
|
return new Promise((resolve, reject)=>{
|
|
59724
|
-
const blockchain =
|
|
59728
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
59725
59729
|
this.getProvider().request({
|
|
59726
59730
|
method: 'wallet_switchEthereumChain',
|
|
59727
59731
|
params: [{ chainId: blockchain.id }],
|
|
@@ -59868,7 +59872,7 @@
|
|
|
59868
59872
|
await submit$2({ transaction, wallet }).then(({ signature })=>{
|
|
59869
59873
|
if(signature) {
|
|
59870
59874
|
transaction.id = signature;
|
|
59871
|
-
transaction.url =
|
|
59875
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59872
59876
|
if (transaction.sent) transaction.sent(transaction);
|
|
59873
59877
|
|
|
59874
59878
|
let count = 0;
|
|
@@ -60157,7 +60161,7 @@
|
|
|
60157
60161
|
transaction.nonce = transactionCount;
|
|
60158
60162
|
await submit$1({ transaction, wallet }).then((tx)=>{
|
|
60159
60163
|
if (tx) {
|
|
60160
|
-
let blockchain =
|
|
60164
|
+
let blockchain = Blockchains__default['default'].findByName(transaction.blockchain);
|
|
60161
60165
|
transaction.id = tx;
|
|
60162
60166
|
transaction.url = smartContractWallet && smartContractWallet.explorerUrlFor ? smartContractWallet.explorerUrlFor({ transaction }) : blockchain.explorerUrlFor({ transaction });
|
|
60163
60167
|
if (transaction.sent) transaction.sent(transaction);
|
|
@@ -60392,7 +60396,7 @@
|
|
|
60392
60396
|
|
|
60393
60397
|
async connectedTo(input) {
|
|
60394
60398
|
let chainId = await this.connector.sendCustomRequest({ method: 'eth_chainId' });
|
|
60395
|
-
const blockchain =
|
|
60399
|
+
const blockchain = Blockchains__default['default'].findById(chainId);
|
|
60396
60400
|
if(input) {
|
|
60397
60401
|
return input === blockchain.name
|
|
60398
60402
|
} else {
|
|
@@ -60403,7 +60407,7 @@
|
|
|
60403
60407
|
switchTo(blockchainName) {
|
|
60404
60408
|
return new Promise((resolve, reject)=>{
|
|
60405
60409
|
let resolved, rejected;
|
|
60406
|
-
const blockchain =
|
|
60410
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
60407
60411
|
setTimeout(async()=>{
|
|
60408
60412
|
if(!(await this.connectedTo(blockchainName)) && !resolved && !rejected){
|
|
60409
60413
|
reject({ code: 'NOT_SUPPORTED' });
|
|
@@ -60438,7 +60442,7 @@
|
|
|
60438
60442
|
|
|
60439
60443
|
addNetwork(blockchainName) {
|
|
60440
60444
|
return new Promise((resolve, reject)=>{
|
|
60441
|
-
const blockchain =
|
|
60445
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
60442
60446
|
this.connector.sendCustomRequest({
|
|
60443
60447
|
method: 'wallet_addEthereumChain',
|
|
60444
60448
|
params: [{
|
|
@@ -60519,7 +60523,7 @@
|
|
|
60519
60523
|
if (sentTransaction) {
|
|
60520
60524
|
transaction.id = sentTransaction.hash;
|
|
60521
60525
|
transaction.nonce = sentTransaction.nonce;
|
|
60522
|
-
transaction.url =
|
|
60526
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
60523
60527
|
if (transaction.sent) transaction.sent(transaction);
|
|
60524
60528
|
sentTransaction.wait(1).then(() => {
|
|
60525
60529
|
transaction._succeeded = true;
|
|
@@ -60528,7 +60532,7 @@
|
|
|
60528
60532
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
60529
60533
|
if(error.replacement && error.replacement.hash) {
|
|
60530
60534
|
transaction.id = error.replacement.hash;
|
|
60531
|
-
transaction.url =
|
|
60535
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
60532
60536
|
}
|
|
60533
60537
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
60534
60538
|
transaction._succeeded = true;
|
|
@@ -60635,7 +60639,7 @@
|
|
|
60635
60639
|
|
|
60636
60640
|
async connectedTo(input) {
|
|
60637
60641
|
let chainId = await this.connector.getChainId();
|
|
60638
|
-
const blockchain =
|
|
60642
|
+
const blockchain = Blockchains__default['default'].findByNetworkId(chainId);
|
|
60639
60643
|
if(input) {
|
|
60640
60644
|
return input === blockchain.name
|
|
60641
60645
|
} else {
|
|
@@ -60645,7 +60649,7 @@
|
|
|
60645
60649
|
|
|
60646
60650
|
switchTo(blockchainName) {
|
|
60647
60651
|
return new Promise((resolve, reject)=>{
|
|
60648
|
-
const blockchain =
|
|
60652
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
60649
60653
|
this.connector.request({
|
|
60650
60654
|
method: 'wallet_switchEthereumChain',
|
|
60651
60655
|
params: [{ chainId: blockchain.id }],
|
|
@@ -60663,7 +60667,7 @@
|
|
|
60663
60667
|
|
|
60664
60668
|
addNetwork(blockchainName) {
|
|
60665
60669
|
return new Promise((resolve, reject)=>{
|
|
60666
|
-
const blockchain =
|
|
60670
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
60667
60671
|
this.connector.request({
|
|
60668
60672
|
method: 'wallet_addEthereumChain',
|
|
60669
60673
|
params: [{
|
package/dist/umd/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@depay/web3-blockchains'), require('ethers'), require('@depay/web3-client'), require('@depay/
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@depay/web3-blockchains', 'ethers', '@depay/web3-client', '@depay/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Client, global.
|
|
5
|
-
}(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@depay/web3-blockchains'), require('ethers'), require('@depay/web3-client'), require('@depay/solana-web3.js'), require('@depay/walletconnect-v1'), require('@depay/coinbase-wallet-sdk')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@depay/web3-blockchains', 'ethers', '@depay/web3-client', '@depay/solana-web3.js', '@depay/walletconnect-v1', '@depay/coinbase-wallet-sdk'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Client, global.SolanaWeb3js, global.WalletConnect, global.CoinbaseWalletSdk));
|
|
5
|
+
}(this, (function (exports, Blockchains, ethers, web3Client, solanaWeb3_js, walletconnectV1, coinbaseWalletSdk) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var Blockchains__default = /*#__PURE__*/_interopDefaultLegacy(Blockchains);
|
|
6
10
|
|
|
7
11
|
let supported$1 = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'velas'];
|
|
8
12
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'velas'];
|
|
@@ -39,7 +43,7 @@
|
|
|
39
43
|
|
|
40
44
|
static bigNumberify(value, blockchain) {
|
|
41
45
|
if (typeof value === 'number') {
|
|
42
|
-
return ethers.ethers.utils.parseUnits(value.toString(),
|
|
46
|
+
return ethers.ethers.utils.parseUnits(value.toString(), Blockchains__default['default'][blockchain].currency.decimals)
|
|
43
47
|
} else if (value && value.toString) {
|
|
44
48
|
return ethers.ethers.BigNumber.from(value.toString())
|
|
45
49
|
} else {
|
|
@@ -123,7 +127,7 @@
|
|
|
123
127
|
if (sentTransaction) {
|
|
124
128
|
transaction.id = sentTransaction.hash;
|
|
125
129
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
126
|
-
transaction.url =
|
|
130
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
127
131
|
if (transaction.sent) transaction.sent(transaction);
|
|
128
132
|
sentTransaction.wait(1).then(() => {
|
|
129
133
|
transaction._succeeded = true;
|
|
@@ -132,7 +136,7 @@
|
|
|
132
136
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
133
137
|
if(error.replacement && error.replacement.hash) {
|
|
134
138
|
transaction.id = error.replacement.hash;
|
|
135
|
-
transaction.url =
|
|
139
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
136
140
|
}
|
|
137
141
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
138
142
|
transaction._succeeded = true;
|
|
@@ -252,7 +256,7 @@
|
|
|
252
256
|
}
|
|
253
257
|
|
|
254
258
|
async connectedTo(input) {
|
|
255
|
-
const blockchain =
|
|
259
|
+
const blockchain = Blockchains__default['default'].findById(await this.getProvider().request({ method: 'eth_chainId' }));
|
|
256
260
|
if(input) {
|
|
257
261
|
return input === blockchain.name
|
|
258
262
|
} else {
|
|
@@ -262,7 +266,7 @@
|
|
|
262
266
|
|
|
263
267
|
addNetwork(blockchainName) {
|
|
264
268
|
return new Promise((resolve, reject)=>{
|
|
265
|
-
const blockchain =
|
|
269
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
266
270
|
this.getProvider().request({
|
|
267
271
|
method: 'wallet_addEthereumChain',
|
|
268
272
|
params: [{
|
|
@@ -283,7 +287,7 @@
|
|
|
283
287
|
|
|
284
288
|
switchTo(blockchainName) {
|
|
285
289
|
return new Promise((resolve, reject)=>{
|
|
286
|
-
const blockchain =
|
|
290
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
287
291
|
this.getProvider().request({
|
|
288
292
|
method: 'wallet_switchEthereumChain',
|
|
289
293
|
params: [{ chainId: blockchain.id }],
|
|
@@ -430,7 +434,7 @@
|
|
|
430
434
|
await submit$2({ transaction, wallet }).then(({ signature })=>{
|
|
431
435
|
if(signature) {
|
|
432
436
|
transaction.id = signature;
|
|
433
|
-
transaction.url =
|
|
437
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
434
438
|
if (transaction.sent) transaction.sent(transaction);
|
|
435
439
|
|
|
436
440
|
let count = 0;
|
|
@@ -719,7 +723,7 @@
|
|
|
719
723
|
transaction.nonce = transactionCount;
|
|
720
724
|
await submit$1({ transaction, wallet }).then((tx)=>{
|
|
721
725
|
if (tx) {
|
|
722
|
-
let blockchain =
|
|
726
|
+
let blockchain = Blockchains__default['default'].findByName(transaction.blockchain);
|
|
723
727
|
transaction.id = tx;
|
|
724
728
|
transaction.url = smartContractWallet && smartContractWallet.explorerUrlFor ? smartContractWallet.explorerUrlFor({ transaction }) : blockchain.explorerUrlFor({ transaction });
|
|
725
729
|
if (transaction.sent) transaction.sent(transaction);
|
|
@@ -954,7 +958,7 @@
|
|
|
954
958
|
|
|
955
959
|
async connectedTo(input) {
|
|
956
960
|
let chainId = await this.connector.sendCustomRequest({ method: 'eth_chainId' });
|
|
957
|
-
const blockchain =
|
|
961
|
+
const blockchain = Blockchains__default['default'].findById(chainId);
|
|
958
962
|
if(input) {
|
|
959
963
|
return input === blockchain.name
|
|
960
964
|
} else {
|
|
@@ -965,7 +969,7 @@
|
|
|
965
969
|
switchTo(blockchainName) {
|
|
966
970
|
return new Promise((resolve, reject)=>{
|
|
967
971
|
let resolved, rejected;
|
|
968
|
-
const blockchain =
|
|
972
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
969
973
|
setTimeout(async()=>{
|
|
970
974
|
if(!(await this.connectedTo(blockchainName)) && !resolved && !rejected){
|
|
971
975
|
reject({ code: 'NOT_SUPPORTED' });
|
|
@@ -1000,7 +1004,7 @@
|
|
|
1000
1004
|
|
|
1001
1005
|
addNetwork(blockchainName) {
|
|
1002
1006
|
return new Promise((resolve, reject)=>{
|
|
1003
|
-
const blockchain =
|
|
1007
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
1004
1008
|
this.connector.sendCustomRequest({
|
|
1005
1009
|
method: 'wallet_addEthereumChain',
|
|
1006
1010
|
params: [{
|
|
@@ -1081,7 +1085,7 @@
|
|
|
1081
1085
|
if (sentTransaction) {
|
|
1082
1086
|
transaction.id = sentTransaction.hash;
|
|
1083
1087
|
transaction.nonce = sentTransaction.nonce;
|
|
1084
|
-
transaction.url =
|
|
1088
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
1085
1089
|
if (transaction.sent) transaction.sent(transaction);
|
|
1086
1090
|
sentTransaction.wait(1).then(() => {
|
|
1087
1091
|
transaction._succeeded = true;
|
|
@@ -1090,7 +1094,7 @@
|
|
|
1090
1094
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
1091
1095
|
if(error.replacement && error.replacement.hash) {
|
|
1092
1096
|
transaction.id = error.replacement.hash;
|
|
1093
|
-
transaction.url =
|
|
1097
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
1094
1098
|
}
|
|
1095
1099
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
1096
1100
|
transaction._succeeded = true;
|
|
@@ -1197,7 +1201,7 @@
|
|
|
1197
1201
|
|
|
1198
1202
|
async connectedTo(input) {
|
|
1199
1203
|
let chainId = await this.connector.getChainId();
|
|
1200
|
-
const blockchain =
|
|
1204
|
+
const blockchain = Blockchains__default['default'].findByNetworkId(chainId);
|
|
1201
1205
|
if(input) {
|
|
1202
1206
|
return input === blockchain.name
|
|
1203
1207
|
} else {
|
|
@@ -1207,7 +1211,7 @@
|
|
|
1207
1211
|
|
|
1208
1212
|
switchTo(blockchainName) {
|
|
1209
1213
|
return new Promise((resolve, reject)=>{
|
|
1210
|
-
const blockchain =
|
|
1214
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
1211
1215
|
this.connector.request({
|
|
1212
1216
|
method: 'wallet_switchEthereumChain',
|
|
1213
1217
|
params: [{ chainId: blockchain.id }],
|
|
@@ -1225,7 +1229,7 @@
|
|
|
1225
1229
|
|
|
1226
1230
|
addNetwork(blockchainName) {
|
|
1227
1231
|
return new Promise((resolve, reject)=>{
|
|
1228
|
-
const blockchain =
|
|
1232
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
1229
1233
|
this.connector.request({
|
|
1230
1234
|
method: 'wallet_addEthereumChain',
|
|
1231
1235
|
params: [{
|
package/dist/umd/index.solana.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@depay/web3-blockchains'), require('ethers'), require('@depay/web3-client-solana'), require('@depay/
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@depay/web3-blockchains', 'ethers', '@depay/web3-client-solana', '@depay/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Client, global.
|
|
5
|
-
}(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@depay/web3-blockchains'), require('ethers'), require('@depay/web3-client-solana'), require('@depay/walletconnect-v1'), require('@depay/coinbase-wallet-sdk')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@depay/web3-blockchains', 'ethers', '@depay/web3-client-solana', '@depay/walletconnect-v1', '@depay/coinbase-wallet-sdk'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Client, global.WalletConnect, global.CoinbaseWalletSdk));
|
|
5
|
+
}(this, (function (exports, Blockchains, ethers, web3ClientSolana, walletconnectV1, coinbaseWalletSdk) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var Blockchains__default = /*#__PURE__*/_interopDefaultLegacy(Blockchains);
|
|
6
10
|
|
|
7
11
|
let supported$2 = ['solana'];
|
|
8
12
|
supported$2.evm = [];
|
|
@@ -58932,7 +58936,7 @@
|
|
|
58932
58936
|
}
|
|
58933
58937
|
|
|
58934
58938
|
detectNetwork() {
|
|
58935
|
-
return Promise.resolve(
|
|
58939
|
+
return Promise.resolve(Blockchains__default['default'].findByName(this._network).id)
|
|
58936
58940
|
}
|
|
58937
58941
|
|
|
58938
58942
|
requestChunk(chunk, endpoint) {
|
|
@@ -59209,7 +59213,7 @@
|
|
|
59209
59213
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'velas'];
|
|
59210
59214
|
supported$1.solana = ['solana'];
|
|
59211
59215
|
|
|
59212
|
-
function _optionalChain$
|
|
59216
|
+
function _optionalChain$1$1(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; }
|
|
59213
59217
|
let getCacheStore = () => {
|
|
59214
59218
|
if (getWindow()._cacheStore == undefined) {
|
|
59215
59219
|
resetCache();
|
|
@@ -59239,7 +59243,7 @@
|
|
|
59239
59243
|
|
|
59240
59244
|
let get = function ({ key, expires }) {
|
|
59241
59245
|
let cachedEntry = getCacheStore()[key];
|
|
59242
|
-
if (_optionalChain$
|
|
59246
|
+
if (_optionalChain$1$1([cachedEntry, 'optionalAccess', _ => _.expiresAt]) > Date.now()) {
|
|
59243
59247
|
return cachedEntry.value
|
|
59244
59248
|
}
|
|
59245
59249
|
};
|
|
@@ -59477,7 +59481,7 @@
|
|
|
59477
59481
|
|
|
59478
59482
|
static bigNumberify(value, blockchain) {
|
|
59479
59483
|
if (typeof value === 'number') {
|
|
59480
|
-
return ethers.ethers.utils.parseUnits(value.toString(),
|
|
59484
|
+
return ethers.ethers.utils.parseUnits(value.toString(), Blockchains__default['default'][blockchain].currency.decimals)
|
|
59481
59485
|
} else if (value && value.toString) {
|
|
59482
59486
|
return ethers.ethers.BigNumber.from(value.toString())
|
|
59483
59487
|
} else {
|
|
@@ -59561,7 +59565,7 @@
|
|
|
59561
59565
|
if (sentTransaction) {
|
|
59562
59566
|
transaction.id = sentTransaction.hash;
|
|
59563
59567
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
59564
|
-
transaction.url =
|
|
59568
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59565
59569
|
if (transaction.sent) transaction.sent(transaction);
|
|
59566
59570
|
sentTransaction.wait(1).then(() => {
|
|
59567
59571
|
transaction._succeeded = true;
|
|
@@ -59570,7 +59574,7 @@
|
|
|
59570
59574
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
59571
59575
|
if(error.replacement && error.replacement.hash) {
|
|
59572
59576
|
transaction.id = error.replacement.hash;
|
|
59573
|
-
transaction.url =
|
|
59577
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59574
59578
|
}
|
|
59575
59579
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
59576
59580
|
transaction._succeeded = true;
|
|
@@ -59690,7 +59694,7 @@
|
|
|
59690
59694
|
}
|
|
59691
59695
|
|
|
59692
59696
|
async connectedTo(input) {
|
|
59693
|
-
const blockchain =
|
|
59697
|
+
const blockchain = Blockchains__default['default'].findById(await this.getProvider().request({ method: 'eth_chainId' }));
|
|
59694
59698
|
if(input) {
|
|
59695
59699
|
return input === blockchain.name
|
|
59696
59700
|
} else {
|
|
@@ -59700,7 +59704,7 @@
|
|
|
59700
59704
|
|
|
59701
59705
|
addNetwork(blockchainName) {
|
|
59702
59706
|
return new Promise((resolve, reject)=>{
|
|
59703
|
-
const blockchain =
|
|
59707
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
59704
59708
|
this.getProvider().request({
|
|
59705
59709
|
method: 'wallet_addEthereumChain',
|
|
59706
59710
|
params: [{
|
|
@@ -59721,7 +59725,7 @@
|
|
|
59721
59725
|
|
|
59722
59726
|
switchTo(blockchainName) {
|
|
59723
59727
|
return new Promise((resolve, reject)=>{
|
|
59724
|
-
const blockchain =
|
|
59728
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
59725
59729
|
this.getProvider().request({
|
|
59726
59730
|
method: 'wallet_switchEthereumChain',
|
|
59727
59731
|
params: [{ chainId: blockchain.id }],
|
|
@@ -59868,7 +59872,7 @@
|
|
|
59868
59872
|
await submit$2({ transaction, wallet }).then(({ signature })=>{
|
|
59869
59873
|
if(signature) {
|
|
59870
59874
|
transaction.id = signature;
|
|
59871
|
-
transaction.url =
|
|
59875
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
59872
59876
|
if (transaction.sent) transaction.sent(transaction);
|
|
59873
59877
|
|
|
59874
59878
|
let count = 0;
|
|
@@ -60157,7 +60161,7 @@
|
|
|
60157
60161
|
transaction.nonce = transactionCount;
|
|
60158
60162
|
await submit$1({ transaction, wallet }).then((tx)=>{
|
|
60159
60163
|
if (tx) {
|
|
60160
|
-
let blockchain =
|
|
60164
|
+
let blockchain = Blockchains__default['default'].findByName(transaction.blockchain);
|
|
60161
60165
|
transaction.id = tx;
|
|
60162
60166
|
transaction.url = smartContractWallet && smartContractWallet.explorerUrlFor ? smartContractWallet.explorerUrlFor({ transaction }) : blockchain.explorerUrlFor({ transaction });
|
|
60163
60167
|
if (transaction.sent) transaction.sent(transaction);
|
|
@@ -60392,7 +60396,7 @@
|
|
|
60392
60396
|
|
|
60393
60397
|
async connectedTo(input) {
|
|
60394
60398
|
let chainId = await this.connector.sendCustomRequest({ method: 'eth_chainId' });
|
|
60395
|
-
const blockchain =
|
|
60399
|
+
const blockchain = Blockchains__default['default'].findById(chainId);
|
|
60396
60400
|
if(input) {
|
|
60397
60401
|
return input === blockchain.name
|
|
60398
60402
|
} else {
|
|
@@ -60403,7 +60407,7 @@
|
|
|
60403
60407
|
switchTo(blockchainName) {
|
|
60404
60408
|
return new Promise((resolve, reject)=>{
|
|
60405
60409
|
let resolved, rejected;
|
|
60406
|
-
const blockchain =
|
|
60410
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
60407
60411
|
setTimeout(async()=>{
|
|
60408
60412
|
if(!(await this.connectedTo(blockchainName)) && !resolved && !rejected){
|
|
60409
60413
|
reject({ code: 'NOT_SUPPORTED' });
|
|
@@ -60438,7 +60442,7 @@
|
|
|
60438
60442
|
|
|
60439
60443
|
addNetwork(blockchainName) {
|
|
60440
60444
|
return new Promise((resolve, reject)=>{
|
|
60441
|
-
const blockchain =
|
|
60445
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
60442
60446
|
this.connector.sendCustomRequest({
|
|
60443
60447
|
method: 'wallet_addEthereumChain',
|
|
60444
60448
|
params: [{
|
|
@@ -60519,7 +60523,7 @@
|
|
|
60519
60523
|
if (sentTransaction) {
|
|
60520
60524
|
transaction.id = sentTransaction.hash;
|
|
60521
60525
|
transaction.nonce = sentTransaction.nonce;
|
|
60522
|
-
transaction.url =
|
|
60526
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
60523
60527
|
if (transaction.sent) transaction.sent(transaction);
|
|
60524
60528
|
sentTransaction.wait(1).then(() => {
|
|
60525
60529
|
transaction._succeeded = true;
|
|
@@ -60528,7 +60532,7 @@
|
|
|
60528
60532
|
if(error && error.code && error.code == 'TRANSACTION_REPLACED') {
|
|
60529
60533
|
if(error.replacement && error.replacement.hash) {
|
|
60530
60534
|
transaction.id = error.replacement.hash;
|
|
60531
|
-
transaction.url =
|
|
60535
|
+
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
60532
60536
|
}
|
|
60533
60537
|
if(error.replacement && error.replacement.hash && error.receipt && error.receipt.status == 1) {
|
|
60534
60538
|
transaction._succeeded = true;
|
|
@@ -60635,7 +60639,7 @@
|
|
|
60635
60639
|
|
|
60636
60640
|
async connectedTo(input) {
|
|
60637
60641
|
let chainId = await this.connector.getChainId();
|
|
60638
|
-
const blockchain =
|
|
60642
|
+
const blockchain = Blockchains__default['default'].findByNetworkId(chainId);
|
|
60639
60643
|
if(input) {
|
|
60640
60644
|
return input === blockchain.name
|
|
60641
60645
|
} else {
|
|
@@ -60645,7 +60649,7 @@
|
|
|
60645
60649
|
|
|
60646
60650
|
switchTo(blockchainName) {
|
|
60647
60651
|
return new Promise((resolve, reject)=>{
|
|
60648
|
-
const blockchain =
|
|
60652
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
60649
60653
|
this.connector.request({
|
|
60650
60654
|
method: 'wallet_switchEthereumChain',
|
|
60651
60655
|
params: [{ chainId: blockchain.id }],
|
|
@@ -60663,7 +60667,7 @@
|
|
|
60663
60667
|
|
|
60664
60668
|
addNetwork(blockchainName) {
|
|
60665
60669
|
return new Promise((resolve, reject)=>{
|
|
60666
|
-
const blockchain =
|
|
60670
|
+
const blockchain = Blockchains__default['default'].findByName(blockchainName);
|
|
60667
60671
|
this.connector.request({
|
|
60668
60672
|
method: 'wallet_addEthereumChain',
|
|
60669
60673
|
params: [{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/web3-wallets-evm",
|
|
3
3
|
"moduleName": "Web3Wallets",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.4.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",
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
"@depay/coinbase-wallet-sdk": "^3.6.4",
|
|
28
28
|
"@depay/walletconnect-v1": "^1.8.0",
|
|
29
29
|
"@depay/walletconnect-v2": "^2.4.2",
|
|
30
|
-
"@depay/web3-blockchains": "^
|
|
31
|
-
"@depay/web3-client-evm": "^10.
|
|
32
|
-
"@depay/web3-constants": "^6.4.2",
|
|
30
|
+
"@depay/web3-blockchains": "^7.1.0",
|
|
31
|
+
"@depay/web3-client-evm": "^10.7.0",
|
|
33
32
|
"ethers": "^5.7.1"
|
|
34
33
|
},
|
|
35
34
|
"engines": {
|