@depay/web3-wallets-evm 14.3.0 → 14.5.1
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/esm/index.evm.js +40 -39
- package/dist/esm/index.js +55 -54
- package/dist/umd/index.evm.js +40 -39
- package/dist/umd/index.js +55 -54
- package/package.json +2 -2
package/dist/esm/index.evm.js
CHANGED
|
@@ -6,7 +6,7 @@ import { WalletConnectClient } from '@depay/walletconnect-v1';
|
|
|
6
6
|
import { Core, SignClient } from '@depay/walletconnect-v2';
|
|
7
7
|
import { CoinbaseWalletSDK } from '@depay/coinbase-wallet-sdk';
|
|
8
8
|
|
|
9
|
-
function _optionalChain$
|
|
9
|
+
function _optionalChain$e(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; }
|
|
10
10
|
class Transaction$1 {
|
|
11
11
|
|
|
12
12
|
constructor({ blockchain, from, to, value, api, method, params, instructions, sent, succeeded, failed }) {
|
|
@@ -17,7 +17,7 @@ class Transaction$1 {
|
|
|
17
17
|
this.to = (to && to.match('0x')) ? ethers.utils.getAddress(to) : to;
|
|
18
18
|
|
|
19
19
|
// optional
|
|
20
|
-
this.value = _optionalChain$
|
|
20
|
+
this.value = _optionalChain$e([Transaction$1, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
|
|
21
21
|
this.api = api;
|
|
22
22
|
this.method = method;
|
|
23
23
|
this.params = params;
|
|
@@ -185,7 +185,7 @@ let supported$3 = ['ethereum', 'bsc', 'polygon', 'velas'];
|
|
|
185
185
|
supported$3.evm = ['ethereum', 'bsc', 'polygon', 'velas'];
|
|
186
186
|
supported$3.solana = [];
|
|
187
187
|
|
|
188
|
-
function _optionalChain$
|
|
188
|
+
function _optionalChain$d(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; }
|
|
189
189
|
class WindowEthereum {
|
|
190
190
|
|
|
191
191
|
static __initStatic() {this.info = {
|
|
@@ -196,12 +196,12 @@ class WindowEthereum {
|
|
|
196
196
|
|
|
197
197
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
198
198
|
return (
|
|
199
|
-
_optionalChain$
|
|
199
|
+
_optionalChain$d([window, 'optionalAccess', _13 => _13.ethereum]) &&
|
|
200
200
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)/)).length != 1 && // MetaMask
|
|
201
|
-
!_optionalChain$
|
|
202
|
-
!(_optionalChain$
|
|
203
|
-
!_optionalChain$
|
|
204
|
-
!(_optionalChain$
|
|
201
|
+
!_optionalChain$d([window, 'optionalAccess', _14 => _14.coin98]) && // Coin98
|
|
202
|
+
!(_optionalChain$d([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isTrust]) || _optionalChain$d([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isTrustWallet])) && // Trust Wallet
|
|
203
|
+
!_optionalChain$d([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isDeficonnectProvider]) && // crypto.com
|
|
204
|
+
!(_optionalChain$d([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.isCoinbaseWallet]) || _optionalChain$d([window, 'optionalAccess', _23 => _23.ethereum, 'optionalAccess', _24 => _24.isWalletLink]))
|
|
205
205
|
)
|
|
206
206
|
};}
|
|
207
207
|
|
|
@@ -308,7 +308,7 @@ class WindowEthereum {
|
|
|
308
308
|
}
|
|
309
309
|
} WindowEthereum.__initStatic(); WindowEthereum.__initStatic2();
|
|
310
310
|
|
|
311
|
-
function _optionalChain$
|
|
311
|
+
function _optionalChain$c(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; }
|
|
312
312
|
class Binance extends WindowEthereum {
|
|
313
313
|
|
|
314
314
|
static __initStatic() {this.info = {
|
|
@@ -318,7 +318,7 @@ class Binance extends WindowEthereum {
|
|
|
318
318
|
};}
|
|
319
319
|
|
|
320
320
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
321
|
-
return _optionalChain$
|
|
321
|
+
return _optionalChain$c([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
|
|
322
322
|
!window.coin98
|
|
323
323
|
};}
|
|
324
324
|
|
|
@@ -326,7 +326,7 @@ class Binance extends WindowEthereum {
|
|
|
326
326
|
|
|
327
327
|
} Binance.__initStatic(); Binance.__initStatic2();
|
|
328
328
|
|
|
329
|
-
function _optionalChain$
|
|
329
|
+
function _optionalChain$b(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; }
|
|
330
330
|
class Brave extends WindowEthereum {
|
|
331
331
|
|
|
332
332
|
static __initStatic() {this.info = {
|
|
@@ -335,10 +335,10 @@ class Brave extends WindowEthereum {
|
|
|
335
335
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
336
336
|
};}
|
|
337
337
|
|
|
338
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
338
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$b([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
|
|
339
339
|
} Brave.__initStatic(); Brave.__initStatic2();
|
|
340
340
|
|
|
341
|
-
function _optionalChain$
|
|
341
|
+
function _optionalChain$a(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; }
|
|
342
342
|
class Coin98 extends WindowEthereum {
|
|
343
343
|
|
|
344
344
|
static __initStatic() {this.info = {
|
|
@@ -347,10 +347,10 @@ class Coin98 extends WindowEthereum {
|
|
|
347
347
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
348
348
|
};}
|
|
349
349
|
|
|
350
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
350
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$a([window, 'optionalAccess', _2 => _2.coin98]) };}
|
|
351
351
|
} Coin98.__initStatic(); Coin98.__initStatic2();
|
|
352
352
|
|
|
353
|
-
function _optionalChain$
|
|
353
|
+
function _optionalChain$9(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; }
|
|
354
354
|
class Coinbase extends WindowEthereum {
|
|
355
355
|
|
|
356
356
|
static __initStatic() {this.info = {
|
|
@@ -359,10 +359,10 @@ class Coinbase extends WindowEthereum {
|
|
|
359
359
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
360
360
|
};}
|
|
361
361
|
|
|
362
|
-
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$
|
|
362
|
+
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$9([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isCoinbaseWallet]) || _optionalChain$9([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isWalletLink])) };}
|
|
363
363
|
} Coinbase.__initStatic(); Coinbase.__initStatic2();
|
|
364
364
|
|
|
365
|
-
function _optionalChain$
|
|
365
|
+
function _optionalChain$8(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; }
|
|
366
366
|
class CryptoCom extends WindowEthereum {
|
|
367
367
|
|
|
368
368
|
static __initStatic() {this.info = {
|
|
@@ -371,10 +371,10 @@ class CryptoCom extends WindowEthereum {
|
|
|
371
371
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
372
372
|
};}
|
|
373
373
|
|
|
374
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
374
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$8([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
|
|
375
375
|
} CryptoCom.__initStatic(); CryptoCom.__initStatic2();
|
|
376
376
|
|
|
377
|
-
function _optionalChain$
|
|
377
|
+
function _optionalChain$7(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; }
|
|
378
378
|
class MetaMask extends WindowEthereum {
|
|
379
379
|
|
|
380
380
|
static __initStatic() {this.info = {
|
|
@@ -384,11 +384,11 @@ class MetaMask extends WindowEthereum {
|
|
|
384
384
|
};}
|
|
385
385
|
|
|
386
386
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
387
|
-
return _optionalChain$
|
|
387
|
+
return _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)/)).length == 1
|
|
388
388
|
};}
|
|
389
389
|
} MetaMask.__initStatic(); MetaMask.__initStatic2();
|
|
390
390
|
|
|
391
|
-
function _optionalChain$
|
|
391
|
+
function _optionalChain$6(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; }
|
|
392
392
|
class Opera extends WindowEthereum {
|
|
393
393
|
|
|
394
394
|
static __initStatic() {this.info = {
|
|
@@ -397,10 +397,10 @@ class Opera extends WindowEthereum {
|
|
|
397
397
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
398
398
|
};}
|
|
399
399
|
|
|
400
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
400
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
|
|
401
401
|
} Opera.__initStatic(); Opera.__initStatic2();
|
|
402
402
|
|
|
403
|
-
function _optionalChain$
|
|
403
|
+
function _optionalChain$5(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; }
|
|
404
404
|
class Trust extends WindowEthereum {
|
|
405
405
|
|
|
406
406
|
static __initStatic() {this.info = {
|
|
@@ -409,7 +409,7 @@ class Trust extends WindowEthereum {
|
|
|
409
409
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
410
410
|
};}
|
|
411
411
|
|
|
412
|
-
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$
|
|
412
|
+
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$5([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$5([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) };}
|
|
413
413
|
} Trust.__initStatic(); Trust.__initStatic2();
|
|
414
414
|
|
|
415
415
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -60017,6 +60017,7 @@ const submitSimpleTransfer$3 = async ({ transaction, wallet })=>{
|
|
|
60017
60017
|
})
|
|
60018
60018
|
};
|
|
60019
60019
|
|
|
60020
|
+
function _optionalChain$4(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; }
|
|
60020
60021
|
const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
|
|
60021
60022
|
|
|
60022
60023
|
const getConnectedInstance$2 = ()=>{
|
|
@@ -60094,6 +60095,8 @@ class WalletConnectV1 {
|
|
|
60094
60095
|
|
|
60095
60096
|
async connect(options) {
|
|
60096
60097
|
let connect = (options && options.connect) ? options.connect : ({uri})=>{};
|
|
60098
|
+
if(_optionalChain$4([options, 'optionalAccess', _ => _.name])) { this.name = options.name; }
|
|
60099
|
+
if(_optionalChain$4([options, 'optionalAccess', _2 => _2.logo])) { this.logo = options.logo; }
|
|
60097
60100
|
try {
|
|
60098
60101
|
window.localStorage.removeItem('walletconnect'); // https://github.com/WalletConnect/walletconnect-monorepo/issues/315
|
|
60099
60102
|
|
|
@@ -60113,13 +60116,14 @@ class WalletConnectV1 {
|
|
|
60113
60116
|
|
|
60114
60117
|
if(accounts instanceof Array && accounts.length) {
|
|
60115
60118
|
setConnectedInstance$2(this);
|
|
60116
|
-
|
|
60117
|
-
|
|
60118
|
-
|
|
60119
|
-
this.connectedAccounts = accounts;
|
|
60120
|
-
this.connectedChainId = chainId;
|
|
60119
|
+
accounts = accounts.map((account)=>ethers.utils.getAddress(account));
|
|
60120
|
+
this.connectedAccounts = accounts;
|
|
60121
|
+
this.connectedChainId = chainId;
|
|
60121
60122
|
|
|
60122
|
-
|
|
60123
|
+
return accounts[0]
|
|
60124
|
+
} else {
|
|
60125
|
+
return
|
|
60126
|
+
}
|
|
60123
60127
|
} catch (error) {
|
|
60124
60128
|
console.log('WALLETCONNECT ERROR', error);
|
|
60125
60129
|
return undefined
|
|
@@ -60923,22 +60927,19 @@ var wallets = {
|
|
|
60923
60927
|
WalletLink
|
|
60924
60928
|
};
|
|
60925
60929
|
|
|
60926
|
-
let instances = {};
|
|
60927
|
-
|
|
60928
60930
|
const getWallets = ()=>{
|
|
60929
60931
|
let availableWallets = [];
|
|
60930
60932
|
|
|
60931
60933
|
Object.keys(wallets).forEach((key)=>{
|
|
60932
60934
|
let wallet = wallets[key];
|
|
60933
60935
|
if(wallet.isAvailable()) {
|
|
60934
|
-
|
|
60935
|
-
|
|
60936
|
-
|
|
60937
|
-
|
|
60938
|
-
|
|
60939
|
-
}
|
|
60936
|
+
let instance;
|
|
60937
|
+
if(wallet.getConnectedInstance && wallet.getConnectedInstance()) {
|
|
60938
|
+
instance = wallet.getConnectedInstance();
|
|
60939
|
+
} else {
|
|
60940
|
+
instance = new wallet;
|
|
60940
60941
|
}
|
|
60941
|
-
availableWallets.push(
|
|
60942
|
+
availableWallets.push(instance);
|
|
60942
60943
|
}
|
|
60943
60944
|
});
|
|
60944
60945
|
|
package/dist/esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { WalletConnectClient } from '@depay/walletconnect-v1';
|
|
|
7
7
|
import { Core, SignClient } from '@depay/walletconnect-v2';
|
|
8
8
|
import { CoinbaseWalletSDK } from '@depay/coinbase-wallet-sdk';
|
|
9
9
|
|
|
10
|
-
function _optionalChain$
|
|
10
|
+
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; }
|
|
11
11
|
class Transaction {
|
|
12
12
|
|
|
13
13
|
constructor({ blockchain, from, to, value, api, method, params, instructions, sent, succeeded, failed }) {
|
|
@@ -18,7 +18,7 @@ class Transaction {
|
|
|
18
18
|
this.to = (to && to.match('0x')) ? ethers.utils.getAddress(to) : to;
|
|
19
19
|
|
|
20
20
|
// optional
|
|
21
|
-
this.value = _optionalChain$
|
|
21
|
+
this.value = _optionalChain$g([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
|
|
22
22
|
this.api = api;
|
|
23
23
|
this.method = method;
|
|
24
24
|
this.params = params;
|
|
@@ -296,7 +296,7 @@ var EVM = {
|
|
|
296
296
|
setProvider: setProvider$1,
|
|
297
297
|
};
|
|
298
298
|
|
|
299
|
-
function _optionalChain$
|
|
299
|
+
function _optionalChain$f(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; }
|
|
300
300
|
let getCacheStore = () => {
|
|
301
301
|
if (getWindow()._cacheStore == undefined) {
|
|
302
302
|
resetCache();
|
|
@@ -326,7 +326,7 @@ let set = function ({ key, value, expires }) {
|
|
|
326
326
|
|
|
327
327
|
let get = function ({ key, expires }) {
|
|
328
328
|
let cachedEntry = getCacheStore()[key];
|
|
329
|
-
if (_optionalChain$
|
|
329
|
+
if (_optionalChain$f([cachedEntry, 'optionalAccess', _ => _.expiresAt]) > Date.now()) {
|
|
330
330
|
return cachedEntry.value
|
|
331
331
|
}
|
|
332
332
|
};
|
|
@@ -567,7 +567,7 @@ let supported$2 = ['ethereum', 'bsc', 'polygon', 'velas'];
|
|
|
567
567
|
supported$2.evm = ['ethereum', 'bsc', 'polygon', 'velas'];
|
|
568
568
|
supported$2.solana = [];
|
|
569
569
|
|
|
570
|
-
function _optionalChain$
|
|
570
|
+
function _optionalChain$e(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; }
|
|
571
571
|
class WindowEthereum {
|
|
572
572
|
|
|
573
573
|
static __initStatic() {this.info = {
|
|
@@ -578,12 +578,12 @@ class WindowEthereum {
|
|
|
578
578
|
|
|
579
579
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
580
580
|
return (
|
|
581
|
-
_optionalChain$
|
|
581
|
+
_optionalChain$e([window, 'optionalAccess', _13 => _13.ethereum]) &&
|
|
582
582
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)/)).length != 1 && // MetaMask
|
|
583
|
-
!_optionalChain$
|
|
584
|
-
!(_optionalChain$
|
|
585
|
-
!_optionalChain$
|
|
586
|
-
!(_optionalChain$
|
|
583
|
+
!_optionalChain$e([window, 'optionalAccess', _14 => _14.coin98]) && // Coin98
|
|
584
|
+
!(_optionalChain$e([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isTrust]) || _optionalChain$e([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isTrustWallet])) && // Trust Wallet
|
|
585
|
+
!_optionalChain$e([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isDeficonnectProvider]) && // crypto.com
|
|
586
|
+
!(_optionalChain$e([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.isCoinbaseWallet]) || _optionalChain$e([window, 'optionalAccess', _23 => _23.ethereum, 'optionalAccess', _24 => _24.isWalletLink]))
|
|
587
587
|
)
|
|
588
588
|
};}
|
|
589
589
|
|
|
@@ -690,7 +690,7 @@ class WindowEthereum {
|
|
|
690
690
|
}
|
|
691
691
|
} WindowEthereum.__initStatic(); WindowEthereum.__initStatic2();
|
|
692
692
|
|
|
693
|
-
function _optionalChain$
|
|
693
|
+
function _optionalChain$d(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; }
|
|
694
694
|
class Binance extends WindowEthereum {
|
|
695
695
|
|
|
696
696
|
static __initStatic() {this.info = {
|
|
@@ -700,7 +700,7 @@ class Binance extends WindowEthereum {
|
|
|
700
700
|
};}
|
|
701
701
|
|
|
702
702
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
703
|
-
return _optionalChain$
|
|
703
|
+
return _optionalChain$d([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
|
|
704
704
|
!window.coin98
|
|
705
705
|
};}
|
|
706
706
|
|
|
@@ -708,7 +708,7 @@ class Binance extends WindowEthereum {
|
|
|
708
708
|
|
|
709
709
|
} Binance.__initStatic(); Binance.__initStatic2();
|
|
710
710
|
|
|
711
|
-
function _optionalChain$
|
|
711
|
+
function _optionalChain$c(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; }
|
|
712
712
|
class Brave extends WindowEthereum {
|
|
713
713
|
|
|
714
714
|
static __initStatic() {this.info = {
|
|
@@ -717,10 +717,10 @@ class Brave extends WindowEthereum {
|
|
|
717
717
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
718
718
|
};}
|
|
719
719
|
|
|
720
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
720
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
|
|
721
721
|
} Brave.__initStatic(); Brave.__initStatic2();
|
|
722
722
|
|
|
723
|
-
function _optionalChain$
|
|
723
|
+
function _optionalChain$b(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; }
|
|
724
724
|
class Coin98 extends WindowEthereum {
|
|
725
725
|
|
|
726
726
|
static __initStatic() {this.info = {
|
|
@@ -729,10 +729,10 @@ class Coin98 extends WindowEthereum {
|
|
|
729
729
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
730
730
|
};}
|
|
731
731
|
|
|
732
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
732
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$b([window, 'optionalAccess', _2 => _2.coin98]) };}
|
|
733
733
|
} Coin98.__initStatic(); Coin98.__initStatic2();
|
|
734
734
|
|
|
735
|
-
function _optionalChain$
|
|
735
|
+
function _optionalChain$a(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; }
|
|
736
736
|
class Coinbase extends WindowEthereum {
|
|
737
737
|
|
|
738
738
|
static __initStatic() {this.info = {
|
|
@@ -741,10 +741,10 @@ class Coinbase extends WindowEthereum {
|
|
|
741
741
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
742
742
|
};}
|
|
743
743
|
|
|
744
|
-
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$
|
|
744
|
+
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$a([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isCoinbaseWallet]) || _optionalChain$a([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isWalletLink])) };}
|
|
745
745
|
} Coinbase.__initStatic(); Coinbase.__initStatic2();
|
|
746
746
|
|
|
747
|
-
function _optionalChain$
|
|
747
|
+
function _optionalChain$9(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; }
|
|
748
748
|
class CryptoCom extends WindowEthereum {
|
|
749
749
|
|
|
750
750
|
static __initStatic() {this.info = {
|
|
@@ -753,10 +753,10 @@ class CryptoCom extends WindowEthereum {
|
|
|
753
753
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
754
754
|
};}
|
|
755
755
|
|
|
756
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
756
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
|
|
757
757
|
} CryptoCom.__initStatic(); CryptoCom.__initStatic2();
|
|
758
758
|
|
|
759
|
-
function _optionalChain$
|
|
759
|
+
function _optionalChain$8(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; }
|
|
760
760
|
class MetaMask extends WindowEthereum {
|
|
761
761
|
|
|
762
762
|
static __initStatic() {this.info = {
|
|
@@ -766,11 +766,11 @@ class MetaMask extends WindowEthereum {
|
|
|
766
766
|
};}
|
|
767
767
|
|
|
768
768
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
769
|
-
return _optionalChain$
|
|
769
|
+
return _optionalChain$8([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)/)).length == 1
|
|
770
770
|
};}
|
|
771
771
|
} MetaMask.__initStatic(); MetaMask.__initStatic2();
|
|
772
772
|
|
|
773
|
-
function _optionalChain$
|
|
773
|
+
function _optionalChain$7(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; }
|
|
774
774
|
class Opera extends WindowEthereum {
|
|
775
775
|
|
|
776
776
|
static __initStatic() {this.info = {
|
|
@@ -779,10 +779,10 @@ class Opera extends WindowEthereum {
|
|
|
779
779
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
780
780
|
};}
|
|
781
781
|
|
|
782
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
782
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
|
|
783
783
|
} Opera.__initStatic(); Opera.__initStatic2();
|
|
784
784
|
|
|
785
|
-
function _optionalChain$
|
|
785
|
+
function _optionalChain$6(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; }
|
|
786
786
|
const POLL_SPEED = 500; // 0.5 seconds
|
|
787
787
|
const MAX_POLLS = 240; // 120 seconds
|
|
788
788
|
|
|
@@ -802,14 +802,14 @@ const sendTransaction$3 = async ({ transaction, wallet })=> {
|
|
|
802
802
|
|
|
803
803
|
const provider = await getProvider(transaction.blockchain);
|
|
804
804
|
const { value } = await provider.getSignatureStatus(signature);
|
|
805
|
-
const confirmationStatus = _optionalChain$
|
|
805
|
+
const confirmationStatus = _optionalChain$6([value, 'optionalAccess', _ => _.confirmationStatus]);
|
|
806
806
|
if(confirmationStatus) {
|
|
807
807
|
const hasReachedSufficientCommitment = confirmationStatus === 'confirmed' || confirmationStatus === 'finalized';
|
|
808
808
|
if (hasReachedSufficientCommitment) {
|
|
809
809
|
if(value.err) {
|
|
810
810
|
transaction._failed = true;
|
|
811
811
|
const confirmedTransaction = await provider.getConfirmedTransaction(signature);
|
|
812
|
-
const failedReason = _optionalChain$
|
|
812
|
+
const failedReason = _optionalChain$6([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null;
|
|
813
813
|
if(transaction.failed) transaction.failed(transaction, failedReason);
|
|
814
814
|
} else {
|
|
815
815
|
transaction._succeeded = true;
|
|
@@ -872,7 +872,7 @@ let supported$1 = ['ethereum', 'bsc', 'polygon', 'solana', 'velas'];
|
|
|
872
872
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'velas'];
|
|
873
873
|
supported$1.solana = ['solana'];
|
|
874
874
|
|
|
875
|
-
function _optionalChain$
|
|
875
|
+
function _optionalChain$5(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; }
|
|
876
876
|
class WindowSolana {
|
|
877
877
|
|
|
878
878
|
static __initStatic() {this.info = {
|
|
@@ -883,8 +883,8 @@ class WindowSolana {
|
|
|
883
883
|
|
|
884
884
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
885
885
|
return (
|
|
886
|
-
_optionalChain$
|
|
887
|
-
!_optionalChain$
|
|
886
|
+
_optionalChain$5([window, 'optionalAccess', _4 => _4.solana]) &&
|
|
887
|
+
!_optionalChain$5([window, 'optionalAccess', _5 => _5.solana, 'optionalAccess', _6 => _6.isPhantom]) &&
|
|
888
888
|
!window.coin98
|
|
889
889
|
)
|
|
890
890
|
};}
|
|
@@ -902,9 +902,9 @@ class WindowSolana {
|
|
|
902
902
|
}
|
|
903
903
|
|
|
904
904
|
async account() {
|
|
905
|
-
if(_optionalChain$
|
|
906
|
-
if(_optionalChain$
|
|
907
|
-
if(_optionalChain$
|
|
905
|
+
if(_optionalChain$5([window, 'optionalAccess', _7 => _7.solana]) == undefined){ return }
|
|
906
|
+
if(_optionalChain$5([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.publicKey])) { return window.solana.publicKey.toString() }
|
|
907
|
+
if(_optionalChain$5([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isBraveWallet]) != true) {
|
|
908
908
|
let publicKey;
|
|
909
909
|
try { ({ publicKey } = await window.solana.connect({ onlyIfTrusted: true })); } catch (e) {}
|
|
910
910
|
if(publicKey){ return publicKey.toString() }
|
|
@@ -912,7 +912,7 @@ class WindowSolana {
|
|
|
912
912
|
}
|
|
913
913
|
|
|
914
914
|
async connect() {
|
|
915
|
-
if(!_optionalChain$
|
|
915
|
+
if(!_optionalChain$5([window, 'optionalAccess', _12 => _12.solana])) { return undefined }
|
|
916
916
|
let { publicKey } = await window.solana.connect();
|
|
917
917
|
return publicKey.toString()
|
|
918
918
|
}
|
|
@@ -921,7 +921,7 @@ class WindowSolana {
|
|
|
921
921
|
let internalCallback;
|
|
922
922
|
switch (event) {
|
|
923
923
|
case 'account':
|
|
924
|
-
internalCallback = (publicKey) => callback(_optionalChain$
|
|
924
|
+
internalCallback = (publicKey) => callback(_optionalChain$5([publicKey, 'optionalAccess', _13 => _13.toString, 'call', _14 => _14()]));
|
|
925
925
|
window.solana.on('accountChanged', internalCallback);
|
|
926
926
|
break
|
|
927
927
|
}
|
|
@@ -961,7 +961,7 @@ class WindowSolana {
|
|
|
961
961
|
}
|
|
962
962
|
} WindowSolana.__initStatic(); WindowSolana.__initStatic2();
|
|
963
963
|
|
|
964
|
-
function _optionalChain$
|
|
964
|
+
function _optionalChain$4(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; }
|
|
965
965
|
class Phantom extends WindowSolana {
|
|
966
966
|
|
|
967
967
|
static __initStatic() {this.info = {
|
|
@@ -970,10 +970,10 @@ class Phantom extends WindowSolana {
|
|
|
970
970
|
blockchains: supported$1.solana
|
|
971
971
|
};}
|
|
972
972
|
|
|
973
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
973
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$4([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isPhantom]) };}
|
|
974
974
|
} Phantom.__initStatic(); Phantom.__initStatic2();
|
|
975
975
|
|
|
976
|
-
function _optionalChain$
|
|
976
|
+
function _optionalChain$3(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; }
|
|
977
977
|
class Trust extends WindowEthereum {
|
|
978
978
|
|
|
979
979
|
static __initStatic() {this.info = {
|
|
@@ -982,7 +982,7 @@ class Trust extends WindowEthereum {
|
|
|
982
982
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
983
983
|
};}
|
|
984
984
|
|
|
985
|
-
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$
|
|
985
|
+
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$3([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$3([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) };}
|
|
986
986
|
} Trust.__initStatic(); Trust.__initStatic2();
|
|
987
987
|
|
|
988
988
|
const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
@@ -1111,6 +1111,7 @@ const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
|
|
|
1111
1111
|
})
|
|
1112
1112
|
};
|
|
1113
1113
|
|
|
1114
|
+
function _optionalChain$2(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; }
|
|
1114
1115
|
const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
|
|
1115
1116
|
|
|
1116
1117
|
const getConnectedInstance$2 = ()=>{
|
|
@@ -1188,6 +1189,8 @@ class WalletConnectV1 {
|
|
|
1188
1189
|
|
|
1189
1190
|
async connect(options) {
|
|
1190
1191
|
let connect = (options && options.connect) ? options.connect : ({uri})=>{};
|
|
1192
|
+
if(_optionalChain$2([options, 'optionalAccess', _ => _.name])) { this.name = options.name; }
|
|
1193
|
+
if(_optionalChain$2([options, 'optionalAccess', _2 => _2.logo])) { this.logo = options.logo; }
|
|
1191
1194
|
try {
|
|
1192
1195
|
window.localStorage.removeItem('walletconnect'); // https://github.com/WalletConnect/walletconnect-monorepo/issues/315
|
|
1193
1196
|
|
|
@@ -1207,13 +1210,14 @@ class WalletConnectV1 {
|
|
|
1207
1210
|
|
|
1208
1211
|
if(accounts instanceof Array && accounts.length) {
|
|
1209
1212
|
setConnectedInstance$2(this);
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
this.connectedAccounts = accounts;
|
|
1214
|
-
this.connectedChainId = chainId;
|
|
1213
|
+
accounts = accounts.map((account)=>ethers.utils.getAddress(account));
|
|
1214
|
+
this.connectedAccounts = accounts;
|
|
1215
|
+
this.connectedChainId = chainId;
|
|
1215
1216
|
|
|
1216
|
-
|
|
1217
|
+
return accounts[0]
|
|
1218
|
+
} else {
|
|
1219
|
+
return
|
|
1220
|
+
}
|
|
1217
1221
|
} catch (error) {
|
|
1218
1222
|
console.log('WALLETCONNECT ERROR', error);
|
|
1219
1223
|
return undefined
|
|
@@ -1839,22 +1843,19 @@ var wallets = {
|
|
|
1839
1843
|
WalletLink
|
|
1840
1844
|
};
|
|
1841
1845
|
|
|
1842
|
-
let instances = {};
|
|
1843
|
-
|
|
1844
1846
|
const getWallets = ()=>{
|
|
1845
1847
|
let availableWallets = [];
|
|
1846
1848
|
|
|
1847
1849
|
Object.keys(wallets).forEach((key)=>{
|
|
1848
1850
|
let wallet = wallets[key];
|
|
1849
1851
|
if(wallet.isAvailable()) {
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
}
|
|
1852
|
+
let instance;
|
|
1853
|
+
if(wallet.getConnectedInstance && wallet.getConnectedInstance()) {
|
|
1854
|
+
instance = wallet.getConnectedInstance();
|
|
1855
|
+
} else {
|
|
1856
|
+
instance = new wallet;
|
|
1856
1857
|
}
|
|
1857
|
-
availableWallets.push(
|
|
1858
|
+
availableWallets.push(instance);
|
|
1858
1859
|
}
|
|
1859
1860
|
});
|
|
1860
1861
|
|
package/dist/umd/index.evm.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Web3Wallets = {}, global.Web3Blockchains, global.ethers, global.Web3Constants, global.Web3Client, global.WalletConnect, global.WalletConnectV2, global.CoinbaseWalletSdk));
|
|
5
5
|
}(this, (function (exports, web3Blockchains, ethers, web3Constants, web3ClientEvm, walletconnectV1, walletconnectV2, coinbaseWalletSdk) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function _optionalChain$
|
|
7
|
+
function _optionalChain$e(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$1 {
|
|
9
9
|
|
|
10
10
|
constructor({ blockchain, from, to, value, api, method, params, instructions, sent, succeeded, failed }) {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
this.to = (to && to.match('0x')) ? ethers.ethers.utils.getAddress(to) : to;
|
|
16
16
|
|
|
17
17
|
// optional
|
|
18
|
-
this.value = _optionalChain$
|
|
18
|
+
this.value = _optionalChain$e([Transaction$1, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
|
|
19
19
|
this.api = api;
|
|
20
20
|
this.method = method;
|
|
21
21
|
this.params = params;
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
supported$3.evm = ['ethereum', 'bsc', 'polygon', 'velas'];
|
|
184
184
|
supported$3.solana = [];
|
|
185
185
|
|
|
186
|
-
function _optionalChain$
|
|
186
|
+
function _optionalChain$d(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; }
|
|
187
187
|
class WindowEthereum {
|
|
188
188
|
|
|
189
189
|
static __initStatic() {this.info = {
|
|
@@ -194,12 +194,12 @@
|
|
|
194
194
|
|
|
195
195
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
196
196
|
return (
|
|
197
|
-
_optionalChain$
|
|
197
|
+
_optionalChain$d([window, 'optionalAccess', _13 => _13.ethereum]) &&
|
|
198
198
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)/)).length != 1 && // MetaMask
|
|
199
|
-
!_optionalChain$
|
|
200
|
-
!(_optionalChain$
|
|
201
|
-
!_optionalChain$
|
|
202
|
-
!(_optionalChain$
|
|
199
|
+
!_optionalChain$d([window, 'optionalAccess', _14 => _14.coin98]) && // Coin98
|
|
200
|
+
!(_optionalChain$d([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isTrust]) || _optionalChain$d([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isTrustWallet])) && // Trust Wallet
|
|
201
|
+
!_optionalChain$d([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isDeficonnectProvider]) && // crypto.com
|
|
202
|
+
!(_optionalChain$d([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.isCoinbaseWallet]) || _optionalChain$d([window, 'optionalAccess', _23 => _23.ethereum, 'optionalAccess', _24 => _24.isWalletLink]))
|
|
203
203
|
)
|
|
204
204
|
};}
|
|
205
205
|
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
}
|
|
307
307
|
} WindowEthereum.__initStatic(); WindowEthereum.__initStatic2();
|
|
308
308
|
|
|
309
|
-
function _optionalChain$
|
|
309
|
+
function _optionalChain$c(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; }
|
|
310
310
|
class Binance extends WindowEthereum {
|
|
311
311
|
|
|
312
312
|
static __initStatic() {this.info = {
|
|
@@ -316,7 +316,7 @@
|
|
|
316
316
|
};}
|
|
317
317
|
|
|
318
318
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
319
|
-
return _optionalChain$
|
|
319
|
+
return _optionalChain$c([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
|
|
320
320
|
!window.coin98
|
|
321
321
|
};}
|
|
322
322
|
|
|
@@ -324,7 +324,7 @@
|
|
|
324
324
|
|
|
325
325
|
} Binance.__initStatic(); Binance.__initStatic2();
|
|
326
326
|
|
|
327
|
-
function _optionalChain$
|
|
327
|
+
function _optionalChain$b(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; }
|
|
328
328
|
class Brave extends WindowEthereum {
|
|
329
329
|
|
|
330
330
|
static __initStatic() {this.info = {
|
|
@@ -333,10 +333,10 @@
|
|
|
333
333
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
334
334
|
};}
|
|
335
335
|
|
|
336
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
336
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$b([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
|
|
337
337
|
} Brave.__initStatic(); Brave.__initStatic2();
|
|
338
338
|
|
|
339
|
-
function _optionalChain$
|
|
339
|
+
function _optionalChain$a(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; }
|
|
340
340
|
class Coin98 extends WindowEthereum {
|
|
341
341
|
|
|
342
342
|
static __initStatic() {this.info = {
|
|
@@ -345,10 +345,10 @@
|
|
|
345
345
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
346
346
|
};}
|
|
347
347
|
|
|
348
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
348
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$a([window, 'optionalAccess', _2 => _2.coin98]) };}
|
|
349
349
|
} Coin98.__initStatic(); Coin98.__initStatic2();
|
|
350
350
|
|
|
351
|
-
function _optionalChain$
|
|
351
|
+
function _optionalChain$9(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; }
|
|
352
352
|
class Coinbase extends WindowEthereum {
|
|
353
353
|
|
|
354
354
|
static __initStatic() {this.info = {
|
|
@@ -357,10 +357,10 @@
|
|
|
357
357
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
358
358
|
};}
|
|
359
359
|
|
|
360
|
-
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$
|
|
360
|
+
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$9([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isCoinbaseWallet]) || _optionalChain$9([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isWalletLink])) };}
|
|
361
361
|
} Coinbase.__initStatic(); Coinbase.__initStatic2();
|
|
362
362
|
|
|
363
|
-
function _optionalChain$
|
|
363
|
+
function _optionalChain$8(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; }
|
|
364
364
|
class CryptoCom extends WindowEthereum {
|
|
365
365
|
|
|
366
366
|
static __initStatic() {this.info = {
|
|
@@ -369,10 +369,10 @@
|
|
|
369
369
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
370
370
|
};}
|
|
371
371
|
|
|
372
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
372
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$8([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
|
|
373
373
|
} CryptoCom.__initStatic(); CryptoCom.__initStatic2();
|
|
374
374
|
|
|
375
|
-
function _optionalChain$
|
|
375
|
+
function _optionalChain$7(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; }
|
|
376
376
|
class MetaMask extends WindowEthereum {
|
|
377
377
|
|
|
378
378
|
static __initStatic() {this.info = {
|
|
@@ -382,11 +382,11 @@
|
|
|
382
382
|
};}
|
|
383
383
|
|
|
384
384
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
385
|
-
return _optionalChain$
|
|
385
|
+
return _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)/)).length == 1
|
|
386
386
|
};}
|
|
387
387
|
} MetaMask.__initStatic(); MetaMask.__initStatic2();
|
|
388
388
|
|
|
389
|
-
function _optionalChain$
|
|
389
|
+
function _optionalChain$6(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; }
|
|
390
390
|
class Opera extends WindowEthereum {
|
|
391
391
|
|
|
392
392
|
static __initStatic() {this.info = {
|
|
@@ -395,10 +395,10 @@
|
|
|
395
395
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
396
396
|
};}
|
|
397
397
|
|
|
398
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
398
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
|
|
399
399
|
} Opera.__initStatic(); Opera.__initStatic2();
|
|
400
400
|
|
|
401
|
-
function _optionalChain$
|
|
401
|
+
function _optionalChain$5(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; }
|
|
402
402
|
class Trust extends WindowEthereum {
|
|
403
403
|
|
|
404
404
|
static __initStatic() {this.info = {
|
|
@@ -407,7 +407,7 @@
|
|
|
407
407
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
408
408
|
};}
|
|
409
409
|
|
|
410
|
-
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$
|
|
410
|
+
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$5([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$5([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) };}
|
|
411
411
|
} Trust.__initStatic(); Trust.__initStatic2();
|
|
412
412
|
|
|
413
413
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -60015,6 +60015,7 @@
|
|
|
60015
60015
|
})
|
|
60016
60016
|
};
|
|
60017
60017
|
|
|
60018
|
+
function _optionalChain$4(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; }
|
|
60018
60019
|
const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
|
|
60019
60020
|
|
|
60020
60021
|
const getConnectedInstance$2 = ()=>{
|
|
@@ -60092,6 +60093,8 @@
|
|
|
60092
60093
|
|
|
60093
60094
|
async connect(options) {
|
|
60094
60095
|
let connect = (options && options.connect) ? options.connect : ({uri})=>{};
|
|
60096
|
+
if(_optionalChain$4([options, 'optionalAccess', _ => _.name])) { this.name = options.name; }
|
|
60097
|
+
if(_optionalChain$4([options, 'optionalAccess', _2 => _2.logo])) { this.logo = options.logo; }
|
|
60095
60098
|
try {
|
|
60096
60099
|
window.localStorage.removeItem('walletconnect'); // https://github.com/WalletConnect/walletconnect-monorepo/issues/315
|
|
60097
60100
|
|
|
@@ -60111,13 +60114,14 @@
|
|
|
60111
60114
|
|
|
60112
60115
|
if(accounts instanceof Array && accounts.length) {
|
|
60113
60116
|
setConnectedInstance$2(this);
|
|
60114
|
-
|
|
60115
|
-
|
|
60116
|
-
|
|
60117
|
-
this.connectedAccounts = accounts;
|
|
60118
|
-
this.connectedChainId = chainId;
|
|
60117
|
+
accounts = accounts.map((account)=>ethers.ethers.utils.getAddress(account));
|
|
60118
|
+
this.connectedAccounts = accounts;
|
|
60119
|
+
this.connectedChainId = chainId;
|
|
60119
60120
|
|
|
60120
|
-
|
|
60121
|
+
return accounts[0]
|
|
60122
|
+
} else {
|
|
60123
|
+
return
|
|
60124
|
+
}
|
|
60121
60125
|
} catch (error) {
|
|
60122
60126
|
console.log('WALLETCONNECT ERROR', error);
|
|
60123
60127
|
return undefined
|
|
@@ -60921,22 +60925,19 @@
|
|
|
60921
60925
|
WalletLink
|
|
60922
60926
|
};
|
|
60923
60927
|
|
|
60924
|
-
let instances = {};
|
|
60925
|
-
|
|
60926
60928
|
const getWallets = ()=>{
|
|
60927
60929
|
let availableWallets = [];
|
|
60928
60930
|
|
|
60929
60931
|
Object.keys(wallets).forEach((key)=>{
|
|
60930
60932
|
let wallet = wallets[key];
|
|
60931
60933
|
if(wallet.isAvailable()) {
|
|
60932
|
-
|
|
60933
|
-
|
|
60934
|
-
|
|
60935
|
-
|
|
60936
|
-
|
|
60937
|
-
}
|
|
60934
|
+
let instance;
|
|
60935
|
+
if(wallet.getConnectedInstance && wallet.getConnectedInstance()) {
|
|
60936
|
+
instance = wallet.getConnectedInstance();
|
|
60937
|
+
} else {
|
|
60938
|
+
instance = new wallet;
|
|
60938
60939
|
}
|
|
60939
|
-
availableWallets.push(
|
|
60940
|
+
availableWallets.push(instance);
|
|
60940
60941
|
}
|
|
60941
60942
|
});
|
|
60942
60943
|
|
package/dist/umd/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
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
5
|
}(this, (function (exports, web3Blockchains, ethers, web3Constants, solanaWeb3_js, web3Client, walletconnectV1, walletconnectV2, coinbaseWalletSdk) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function _optionalChain$
|
|
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 {
|
|
9
9
|
|
|
10
10
|
constructor({ blockchain, from, to, value, api, method, params, instructions, sent, succeeded, failed }) {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
this.to = (to && to.match('0x')) ? ethers.ethers.utils.getAddress(to) : to;
|
|
16
16
|
|
|
17
17
|
// optional
|
|
18
|
-
this.value = _optionalChain$
|
|
18
|
+
this.value = _optionalChain$g([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
|
|
19
19
|
this.api = api;
|
|
20
20
|
this.method = method;
|
|
21
21
|
this.params = params;
|
|
@@ -293,7 +293,7 @@
|
|
|
293
293
|
setProvider: setProvider$1,
|
|
294
294
|
};
|
|
295
295
|
|
|
296
|
-
function _optionalChain$
|
|
296
|
+
function _optionalChain$f(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; }
|
|
297
297
|
let getCacheStore = () => {
|
|
298
298
|
if (getWindow()._cacheStore == undefined) {
|
|
299
299
|
resetCache();
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
|
|
324
324
|
let get = function ({ key, expires }) {
|
|
325
325
|
let cachedEntry = getCacheStore()[key];
|
|
326
|
-
if (_optionalChain$
|
|
326
|
+
if (_optionalChain$f([cachedEntry, 'optionalAccess', _ => _.expiresAt]) > Date.now()) {
|
|
327
327
|
return cachedEntry.value
|
|
328
328
|
}
|
|
329
329
|
};
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
supported$2.evm = ['ethereum', 'bsc', 'polygon', 'velas'];
|
|
565
565
|
supported$2.solana = [];
|
|
566
566
|
|
|
567
|
-
function _optionalChain$
|
|
567
|
+
function _optionalChain$e(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; }
|
|
568
568
|
class WindowEthereum {
|
|
569
569
|
|
|
570
570
|
static __initStatic() {this.info = {
|
|
@@ -575,12 +575,12 @@
|
|
|
575
575
|
|
|
576
576
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
577
577
|
return (
|
|
578
|
-
_optionalChain$
|
|
578
|
+
_optionalChain$e([window, 'optionalAccess', _13 => _13.ethereum]) &&
|
|
579
579
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)/)).length != 1 && // MetaMask
|
|
580
|
-
!_optionalChain$
|
|
581
|
-
!(_optionalChain$
|
|
582
|
-
!_optionalChain$
|
|
583
|
-
!(_optionalChain$
|
|
580
|
+
!_optionalChain$e([window, 'optionalAccess', _14 => _14.coin98]) && // Coin98
|
|
581
|
+
!(_optionalChain$e([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isTrust]) || _optionalChain$e([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isTrustWallet])) && // Trust Wallet
|
|
582
|
+
!_optionalChain$e([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isDeficonnectProvider]) && // crypto.com
|
|
583
|
+
!(_optionalChain$e([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.isCoinbaseWallet]) || _optionalChain$e([window, 'optionalAccess', _23 => _23.ethereum, 'optionalAccess', _24 => _24.isWalletLink]))
|
|
584
584
|
)
|
|
585
585
|
};}
|
|
586
586
|
|
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
}
|
|
688
688
|
} WindowEthereum.__initStatic(); WindowEthereum.__initStatic2();
|
|
689
689
|
|
|
690
|
-
function _optionalChain$
|
|
690
|
+
function _optionalChain$d(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; }
|
|
691
691
|
class Binance extends WindowEthereum {
|
|
692
692
|
|
|
693
693
|
static __initStatic() {this.info = {
|
|
@@ -697,7 +697,7 @@
|
|
|
697
697
|
};}
|
|
698
698
|
|
|
699
699
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
700
|
-
return _optionalChain$
|
|
700
|
+
return _optionalChain$d([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
|
|
701
701
|
!window.coin98
|
|
702
702
|
};}
|
|
703
703
|
|
|
@@ -705,7 +705,7 @@
|
|
|
705
705
|
|
|
706
706
|
} Binance.__initStatic(); Binance.__initStatic2();
|
|
707
707
|
|
|
708
|
-
function _optionalChain$
|
|
708
|
+
function _optionalChain$c(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; }
|
|
709
709
|
class Brave extends WindowEthereum {
|
|
710
710
|
|
|
711
711
|
static __initStatic() {this.info = {
|
|
@@ -714,10 +714,10 @@
|
|
|
714
714
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
715
715
|
};}
|
|
716
716
|
|
|
717
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
717
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
|
|
718
718
|
} Brave.__initStatic(); Brave.__initStatic2();
|
|
719
719
|
|
|
720
|
-
function _optionalChain$
|
|
720
|
+
function _optionalChain$b(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; }
|
|
721
721
|
class Coin98 extends WindowEthereum {
|
|
722
722
|
|
|
723
723
|
static __initStatic() {this.info = {
|
|
@@ -726,10 +726,10 @@
|
|
|
726
726
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
727
727
|
};}
|
|
728
728
|
|
|
729
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
729
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$b([window, 'optionalAccess', _2 => _2.coin98]) };}
|
|
730
730
|
} Coin98.__initStatic(); Coin98.__initStatic2();
|
|
731
731
|
|
|
732
|
-
function _optionalChain$
|
|
732
|
+
function _optionalChain$a(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; }
|
|
733
733
|
class Coinbase extends WindowEthereum {
|
|
734
734
|
|
|
735
735
|
static __initStatic() {this.info = {
|
|
@@ -738,10 +738,10 @@
|
|
|
738
738
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
739
739
|
};}
|
|
740
740
|
|
|
741
|
-
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$
|
|
741
|
+
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$a([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isCoinbaseWallet]) || _optionalChain$a([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isWalletLink])) };}
|
|
742
742
|
} Coinbase.__initStatic(); Coinbase.__initStatic2();
|
|
743
743
|
|
|
744
|
-
function _optionalChain$
|
|
744
|
+
function _optionalChain$9(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; }
|
|
745
745
|
class CryptoCom extends WindowEthereum {
|
|
746
746
|
|
|
747
747
|
static __initStatic() {this.info = {
|
|
@@ -750,10 +750,10 @@
|
|
|
750
750
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
751
751
|
};}
|
|
752
752
|
|
|
753
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
753
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
|
|
754
754
|
} CryptoCom.__initStatic(); CryptoCom.__initStatic2();
|
|
755
755
|
|
|
756
|
-
function _optionalChain$
|
|
756
|
+
function _optionalChain$8(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; }
|
|
757
757
|
class MetaMask extends WindowEthereum {
|
|
758
758
|
|
|
759
759
|
static __initStatic() {this.info = {
|
|
@@ -763,11 +763,11 @@
|
|
|
763
763
|
};}
|
|
764
764
|
|
|
765
765
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
766
|
-
return _optionalChain$
|
|
766
|
+
return _optionalChain$8([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)/)).length == 1
|
|
767
767
|
};}
|
|
768
768
|
} MetaMask.__initStatic(); MetaMask.__initStatic2();
|
|
769
769
|
|
|
770
|
-
function _optionalChain$
|
|
770
|
+
function _optionalChain$7(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; }
|
|
771
771
|
class Opera extends WindowEthereum {
|
|
772
772
|
|
|
773
773
|
static __initStatic() {this.info = {
|
|
@@ -776,10 +776,10 @@
|
|
|
776
776
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
777
777
|
};}
|
|
778
778
|
|
|
779
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
779
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
|
|
780
780
|
} Opera.__initStatic(); Opera.__initStatic2();
|
|
781
781
|
|
|
782
|
-
function _optionalChain$
|
|
782
|
+
function _optionalChain$6(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; }
|
|
783
783
|
const POLL_SPEED = 500; // 0.5 seconds
|
|
784
784
|
const MAX_POLLS = 240; // 120 seconds
|
|
785
785
|
|
|
@@ -799,14 +799,14 @@
|
|
|
799
799
|
|
|
800
800
|
const provider = await web3Client.getProvider(transaction.blockchain);
|
|
801
801
|
const { value } = await provider.getSignatureStatus(signature);
|
|
802
|
-
const confirmationStatus = _optionalChain$
|
|
802
|
+
const confirmationStatus = _optionalChain$6([value, 'optionalAccess', _ => _.confirmationStatus]);
|
|
803
803
|
if(confirmationStatus) {
|
|
804
804
|
const hasReachedSufficientCommitment = confirmationStatus === 'confirmed' || confirmationStatus === 'finalized';
|
|
805
805
|
if (hasReachedSufficientCommitment) {
|
|
806
806
|
if(value.err) {
|
|
807
807
|
transaction._failed = true;
|
|
808
808
|
const confirmedTransaction = await provider.getConfirmedTransaction(signature);
|
|
809
|
-
const failedReason = _optionalChain$
|
|
809
|
+
const failedReason = _optionalChain$6([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null;
|
|
810
810
|
if(transaction.failed) transaction.failed(transaction, failedReason);
|
|
811
811
|
} else {
|
|
812
812
|
transaction._succeeded = true;
|
|
@@ -869,7 +869,7 @@
|
|
|
869
869
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'velas'];
|
|
870
870
|
supported$1.solana = ['solana'];
|
|
871
871
|
|
|
872
|
-
function _optionalChain$
|
|
872
|
+
function _optionalChain$5(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; }
|
|
873
873
|
class WindowSolana {
|
|
874
874
|
|
|
875
875
|
static __initStatic() {this.info = {
|
|
@@ -880,8 +880,8 @@
|
|
|
880
880
|
|
|
881
881
|
static __initStatic2() {this.isAvailable = ()=>{
|
|
882
882
|
return (
|
|
883
|
-
_optionalChain$
|
|
884
|
-
!_optionalChain$
|
|
883
|
+
_optionalChain$5([window, 'optionalAccess', _4 => _4.solana]) &&
|
|
884
|
+
!_optionalChain$5([window, 'optionalAccess', _5 => _5.solana, 'optionalAccess', _6 => _6.isPhantom]) &&
|
|
885
885
|
!window.coin98
|
|
886
886
|
)
|
|
887
887
|
};}
|
|
@@ -899,9 +899,9 @@
|
|
|
899
899
|
}
|
|
900
900
|
|
|
901
901
|
async account() {
|
|
902
|
-
if(_optionalChain$
|
|
903
|
-
if(_optionalChain$
|
|
904
|
-
if(_optionalChain$
|
|
902
|
+
if(_optionalChain$5([window, 'optionalAccess', _7 => _7.solana]) == undefined){ return }
|
|
903
|
+
if(_optionalChain$5([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.publicKey])) { return window.solana.publicKey.toString() }
|
|
904
|
+
if(_optionalChain$5([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isBraveWallet]) != true) {
|
|
905
905
|
let publicKey;
|
|
906
906
|
try { ({ publicKey } = await window.solana.connect({ onlyIfTrusted: true })); } catch (e) {}
|
|
907
907
|
if(publicKey){ return publicKey.toString() }
|
|
@@ -909,7 +909,7 @@
|
|
|
909
909
|
}
|
|
910
910
|
|
|
911
911
|
async connect() {
|
|
912
|
-
if(!_optionalChain$
|
|
912
|
+
if(!_optionalChain$5([window, 'optionalAccess', _12 => _12.solana])) { return undefined }
|
|
913
913
|
let { publicKey } = await window.solana.connect();
|
|
914
914
|
return publicKey.toString()
|
|
915
915
|
}
|
|
@@ -918,7 +918,7 @@
|
|
|
918
918
|
let internalCallback;
|
|
919
919
|
switch (event) {
|
|
920
920
|
case 'account':
|
|
921
|
-
internalCallback = (publicKey) => callback(_optionalChain$
|
|
921
|
+
internalCallback = (publicKey) => callback(_optionalChain$5([publicKey, 'optionalAccess', _13 => _13.toString, 'call', _14 => _14()]));
|
|
922
922
|
window.solana.on('accountChanged', internalCallback);
|
|
923
923
|
break
|
|
924
924
|
}
|
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
}
|
|
959
959
|
} WindowSolana.__initStatic(); WindowSolana.__initStatic2();
|
|
960
960
|
|
|
961
|
-
function _optionalChain$
|
|
961
|
+
function _optionalChain$4(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; }
|
|
962
962
|
class Phantom extends WindowSolana {
|
|
963
963
|
|
|
964
964
|
static __initStatic() {this.info = {
|
|
@@ -967,10 +967,10 @@
|
|
|
967
967
|
blockchains: supported$1.solana
|
|
968
968
|
};}
|
|
969
969
|
|
|
970
|
-
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$
|
|
970
|
+
static __initStatic2() {this.isAvailable = ()=>{ return _optionalChain$4([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isPhantom]) };}
|
|
971
971
|
} Phantom.__initStatic(); Phantom.__initStatic2();
|
|
972
972
|
|
|
973
|
-
function _optionalChain$
|
|
973
|
+
function _optionalChain$3(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; }
|
|
974
974
|
class Trust extends WindowEthereum {
|
|
975
975
|
|
|
976
976
|
static __initStatic() {this.info = {
|
|
@@ -979,7 +979,7 @@
|
|
|
979
979
|
blockchains: ['ethereum', 'bsc', 'polygon', 'velas']
|
|
980
980
|
};}
|
|
981
981
|
|
|
982
|
-
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$
|
|
982
|
+
static __initStatic2() {this.isAvailable = ()=>{ return (_optionalChain$3([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$3([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) };}
|
|
983
983
|
} Trust.__initStatic(); Trust.__initStatic2();
|
|
984
984
|
|
|
985
985
|
const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
@@ -1108,6 +1108,7 @@
|
|
|
1108
1108
|
})
|
|
1109
1109
|
};
|
|
1110
1110
|
|
|
1111
|
+
function _optionalChain$2(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; }
|
|
1111
1112
|
const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
|
|
1112
1113
|
|
|
1113
1114
|
const getConnectedInstance$2 = ()=>{
|
|
@@ -1185,6 +1186,8 @@
|
|
|
1185
1186
|
|
|
1186
1187
|
async connect(options) {
|
|
1187
1188
|
let connect = (options && options.connect) ? options.connect : ({uri})=>{};
|
|
1189
|
+
if(_optionalChain$2([options, 'optionalAccess', _ => _.name])) { this.name = options.name; }
|
|
1190
|
+
if(_optionalChain$2([options, 'optionalAccess', _2 => _2.logo])) { this.logo = options.logo; }
|
|
1188
1191
|
try {
|
|
1189
1192
|
window.localStorage.removeItem('walletconnect'); // https://github.com/WalletConnect/walletconnect-monorepo/issues/315
|
|
1190
1193
|
|
|
@@ -1204,13 +1207,14 @@
|
|
|
1204
1207
|
|
|
1205
1208
|
if(accounts instanceof Array && accounts.length) {
|
|
1206
1209
|
setConnectedInstance$2(this);
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
this.connectedAccounts = accounts;
|
|
1211
|
-
this.connectedChainId = chainId;
|
|
1210
|
+
accounts = accounts.map((account)=>ethers.ethers.utils.getAddress(account));
|
|
1211
|
+
this.connectedAccounts = accounts;
|
|
1212
|
+
this.connectedChainId = chainId;
|
|
1212
1213
|
|
|
1213
|
-
|
|
1214
|
+
return accounts[0]
|
|
1215
|
+
} else {
|
|
1216
|
+
return
|
|
1217
|
+
}
|
|
1214
1218
|
} catch (error) {
|
|
1215
1219
|
console.log('WALLETCONNECT ERROR', error);
|
|
1216
1220
|
return undefined
|
|
@@ -1836,22 +1840,19 @@
|
|
|
1836
1840
|
WalletLink
|
|
1837
1841
|
};
|
|
1838
1842
|
|
|
1839
|
-
let instances = {};
|
|
1840
|
-
|
|
1841
1843
|
const getWallets = ()=>{
|
|
1842
1844
|
let availableWallets = [];
|
|
1843
1845
|
|
|
1844
1846
|
Object.keys(wallets).forEach((key)=>{
|
|
1845
1847
|
let wallet = wallets[key];
|
|
1846
1848
|
if(wallet.isAvailable()) {
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
}
|
|
1849
|
+
let instance;
|
|
1850
|
+
if(wallet.getConnectedInstance && wallet.getConnectedInstance()) {
|
|
1851
|
+
instance = wallet.getConnectedInstance();
|
|
1852
|
+
} else {
|
|
1853
|
+
instance = new wallet;
|
|
1853
1854
|
}
|
|
1854
|
-
availableWallets.push(
|
|
1855
|
+
availableWallets.push(instance);
|
|
1855
1856
|
}
|
|
1856
1857
|
});
|
|
1857
1858
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/web3-wallets-evm",
|
|
3
3
|
"moduleName": "Web3Wallets",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.5.1",
|
|
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",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"private": false,
|
|
26
26
|
"dependencies": {},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@depay/coinbase-wallet-sdk": "^
|
|
28
|
+
"@depay/coinbase-wallet-sdk": "^3.6.4",
|
|
29
29
|
"@depay/walletconnect-v1": "^1.8.0",
|
|
30
30
|
"@depay/walletconnect-v2": "^2.4.2",
|
|
31
31
|
"@depay/web3-blockchains": "^6.4.0",
|