@depay/web3-wallets-evm 16.2.12 → 16.2.14
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 +95 -90
- package/dist/esm/index.js +111 -106
- package/dist/umd/index.evm.js +95 -90
- package/dist/umd/index.js +111 -106
- package/package.json +1 -1
package/dist/esm/index.evm.js
CHANGED
|
@@ -9,7 +9,7 @@ let supported$1 = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanch
|
|
|
9
9
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
|
|
10
10
|
supported$1.solana = [];
|
|
11
11
|
|
|
12
|
-
function _optionalChain$
|
|
12
|
+
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; }
|
|
13
13
|
class Transaction {
|
|
14
14
|
|
|
15
15
|
constructor({
|
|
@@ -34,7 +34,7 @@ class Transaction {
|
|
|
34
34
|
this.to = (to && to.match('0x')) ? ethers.utils.getAddress(to) : to;
|
|
35
35
|
|
|
36
36
|
// optional
|
|
37
|
-
this.value = _optionalChain$
|
|
37
|
+
this.value = _optionalChain$g([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
|
|
38
38
|
this.api = api;
|
|
39
39
|
this.method = method;
|
|
40
40
|
this.params = params;
|
|
@@ -74,7 +74,7 @@ class Transaction {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
getParamType(param) {
|
|
77
|
-
if(_optionalChain$
|
|
77
|
+
if(_optionalChain$g([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) {
|
|
78
78
|
return `(${param.components.map((param)=>this.getParamType(param)).join(',')})`
|
|
79
79
|
} else {
|
|
80
80
|
return param.type
|
|
@@ -147,8 +147,6 @@ class Transaction {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
function _optionalChain$i(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; }
|
|
151
|
-
|
|
152
150
|
const sendTransaction$3 = async ({ transaction, wallet })=> {
|
|
153
151
|
transaction = new Transaction(transaction);
|
|
154
152
|
if((await wallet.connectedTo(transaction.blockchain)) == false) {
|
|
@@ -201,7 +199,7 @@ const retrieveConfirmedTransaction$3 = (sentTransaction)=>{
|
|
|
201
199
|
try {
|
|
202
200
|
|
|
203
201
|
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
204
|
-
if(
|
|
202
|
+
if(error && error.toString().match('undefined')) {
|
|
205
203
|
setTimeout(()=>{
|
|
206
204
|
retrieveConfirmedTransaction$3(sentTransaction)
|
|
207
205
|
.then(resolve)
|
|
@@ -212,7 +210,7 @@ const retrieveConfirmedTransaction$3 = (sentTransaction)=>{
|
|
|
212
210
|
}
|
|
213
211
|
});
|
|
214
212
|
} catch(error) {
|
|
215
|
-
if(
|
|
213
|
+
if(error && error.toString().match('undefined')) {
|
|
216
214
|
setTimeout(()=>{
|
|
217
215
|
retrieveConfirmedTransaction$3(sentTransaction)
|
|
218
216
|
.then(resolve)
|
|
@@ -255,7 +253,7 @@ const submitSimpleTransfer$3 = ({ transaction, signer })=>{
|
|
|
255
253
|
})
|
|
256
254
|
};
|
|
257
255
|
|
|
258
|
-
function _optionalChain$
|
|
256
|
+
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; }
|
|
259
257
|
|
|
260
258
|
class WindowEthereum {
|
|
261
259
|
|
|
@@ -267,31 +265,31 @@ class WindowEthereum {
|
|
|
267
265
|
|
|
268
266
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
269
267
|
return (
|
|
270
|
-
_optionalChain$
|
|
268
|
+
_optionalChain$f([window, 'optionalAccess', _31 => _31.ethereum]) &&
|
|
271
269
|
// not MetaMask
|
|
272
|
-
!(_optionalChain$
|
|
270
|
+
!(_optionalChain$f([window, 'optionalAccess', _32 => _32.ethereum, 'optionalAccess', _33 => _33.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) &&
|
|
273
271
|
// not Coin98
|
|
274
|
-
!_optionalChain$
|
|
272
|
+
!_optionalChain$f([window, 'optionalAccess', _34 => _34.coin98]) &&
|
|
275
273
|
// not Trust Wallet
|
|
276
|
-
!(_optionalChain$
|
|
274
|
+
!(_optionalChain$f([window, 'optionalAccess', _35 => _35.ethereum, 'optionalAccess', _36 => _36.isTrust]) || _optionalChain$f([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isTrustWallet])) &&
|
|
277
275
|
// not crypto.com
|
|
278
|
-
!_optionalChain$
|
|
276
|
+
!_optionalChain$f([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isDeficonnectProvider]) &&
|
|
279
277
|
// not HyperPay
|
|
280
|
-
!_optionalChain$
|
|
278
|
+
!_optionalChain$f([window, 'optionalAccess', _41 => _41.ethereum, 'optionalAccess', _42 => _42.isHyperPay]) &&
|
|
281
279
|
// not Phantom
|
|
282
|
-
!(window.phantom && !window.glow && !_optionalChain$
|
|
280
|
+
!(window.phantom && !window.glow && !_optionalChain$f([window, 'optionalAccess', _43 => _43.solana, 'optionalAccess', _44 => _44.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) &&
|
|
283
281
|
// not Rabby
|
|
284
|
-
!_optionalChain$
|
|
282
|
+
!_optionalChain$f([window, 'optionalAccess', _45 => _45.ethereum, 'optionalAccess', _46 => _46.isRabby]) &&
|
|
285
283
|
// not Backpack
|
|
286
|
-
!_optionalChain$
|
|
284
|
+
!_optionalChain$f([window, 'optionalAccess', _47 => _47.backpack, 'optionalAccess', _48 => _48.isBackpack]) &&
|
|
287
285
|
// not TokenPocket
|
|
288
|
-
!_optionalChain$
|
|
286
|
+
!_optionalChain$f([window, 'optionalAccess', _49 => _49.ethereum, 'optionalAccess', _50 => _50.isTokenPocket]) &&
|
|
289
287
|
// not BitKeep
|
|
290
|
-
!_optionalChain$
|
|
288
|
+
!_optionalChain$f([window, 'optionalAccess', _51 => _51.ethereum, 'optionalAccess', _52 => _52.isBitKeep]) &&
|
|
291
289
|
// not Coinbase
|
|
292
|
-
!(_optionalChain$
|
|
290
|
+
!(_optionalChain$f([window, 'optionalAccess', _53 => _53.ethereum, 'optionalAccess', _54 => _54.isCoinbaseWallet]) || _optionalChain$f([window, 'optionalAccess', _55 => _55.ethereum, 'optionalAccess', _56 => _56.isWalletLink])) &&
|
|
293
291
|
// MetaMask through ProviderMap
|
|
294
|
-
!_optionalChain$
|
|
292
|
+
!_optionalChain$f([window, 'optionalAccess', _57 => _57.ethereum, 'optionalAccess', _58 => _58.providerMap, 'optionalAccess', _59 => _59.has, 'call', _60 => _60('MetaMask')])
|
|
295
293
|
)
|
|
296
294
|
};}
|
|
297
295
|
|
|
@@ -417,7 +415,7 @@ class WindowEthereum {
|
|
|
417
415
|
}
|
|
418
416
|
} WindowEthereum.__initStatic(); WindowEthereum.__initStatic2();
|
|
419
417
|
|
|
420
|
-
function _optionalChain$
|
|
418
|
+
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; }
|
|
421
419
|
class Binance extends WindowEthereum {
|
|
422
420
|
|
|
423
421
|
static __initStatic() {this.info = {
|
|
@@ -427,7 +425,7 @@ class Binance extends WindowEthereum {
|
|
|
427
425
|
};}
|
|
428
426
|
|
|
429
427
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
430
|
-
return _optionalChain$
|
|
428
|
+
return _optionalChain$e([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
|
|
431
429
|
!window.coin98
|
|
432
430
|
};}
|
|
433
431
|
|
|
@@ -435,7 +433,7 @@ class Binance extends WindowEthereum {
|
|
|
435
433
|
|
|
436
434
|
} Binance.__initStatic(); Binance.__initStatic2();
|
|
437
435
|
|
|
438
|
-
function _optionalChain$
|
|
436
|
+
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; }
|
|
439
437
|
class Brave extends WindowEthereum {
|
|
440
438
|
|
|
441
439
|
static __initStatic() {this.info = {
|
|
@@ -444,10 +442,10 @@ class Brave extends WindowEthereum {
|
|
|
444
442
|
blockchains: supported$1.evm
|
|
445
443
|
};}
|
|
446
444
|
|
|
447
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
445
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$d([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
|
|
448
446
|
} Brave.__initStatic(); Brave.__initStatic2();
|
|
449
447
|
|
|
450
|
-
function _optionalChain$
|
|
448
|
+
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; }
|
|
451
449
|
class Coin98 extends WindowEthereum {
|
|
452
450
|
|
|
453
451
|
static __initStatic() {this.info = {
|
|
@@ -456,10 +454,10 @@ class Coin98 extends WindowEthereum {
|
|
|
456
454
|
blockchains: supported$1.evm
|
|
457
455
|
};}
|
|
458
456
|
|
|
459
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
457
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$c([window, 'optionalAccess', _2 => _2.coin98]) };}
|
|
460
458
|
} Coin98.__initStatic(); Coin98.__initStatic2();
|
|
461
459
|
|
|
462
|
-
function _optionalChain$
|
|
460
|
+
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; }
|
|
463
461
|
class Coinbase extends WindowEthereum {
|
|
464
462
|
|
|
465
463
|
static __initStatic() {this.info = {
|
|
@@ -469,8 +467,8 @@ class Coinbase extends WindowEthereum {
|
|
|
469
467
|
};}
|
|
470
468
|
|
|
471
469
|
getProvider() {
|
|
472
|
-
if(_optionalChain$
|
|
473
|
-
return _optionalChain$
|
|
470
|
+
if(_optionalChain$b([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) {
|
|
471
|
+
return _optionalChain$b([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')])
|
|
474
472
|
} else {
|
|
475
473
|
return window.ethereum
|
|
476
474
|
}
|
|
@@ -479,15 +477,15 @@ class Coinbase extends WindowEthereum {
|
|
|
479
477
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
480
478
|
return(
|
|
481
479
|
(
|
|
482
|
-
_optionalChain$
|
|
480
|
+
_optionalChain$b([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$b([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink])
|
|
483
481
|
) || (
|
|
484
|
-
_optionalChain$
|
|
482
|
+
_optionalChain$b([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')])
|
|
485
483
|
)
|
|
486
484
|
)
|
|
487
485
|
};}
|
|
488
486
|
} Coinbase.__initStatic(); Coinbase.__initStatic2();
|
|
489
487
|
|
|
490
|
-
function _optionalChain$
|
|
488
|
+
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; }
|
|
491
489
|
class CryptoCom extends WindowEthereum {
|
|
492
490
|
|
|
493
491
|
static __initStatic() {this.info = {
|
|
@@ -496,10 +494,10 @@ class CryptoCom extends WindowEthereum {
|
|
|
496
494
|
blockchains: supported$1.evm
|
|
497
495
|
};}
|
|
498
496
|
|
|
499
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
497
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$a([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
|
|
500
498
|
} CryptoCom.__initStatic(); CryptoCom.__initStatic2();
|
|
501
499
|
|
|
502
|
-
function _optionalChain$
|
|
500
|
+
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; }
|
|
503
501
|
class HyperPay extends WindowEthereum {
|
|
504
502
|
|
|
505
503
|
static __initStatic() {this.info = {
|
|
@@ -508,10 +506,10 @@ class HyperPay extends WindowEthereum {
|
|
|
508
506
|
blockchains: supported$1.evm
|
|
509
507
|
};}
|
|
510
508
|
|
|
511
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
509
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };}
|
|
512
510
|
} HyperPay.__initStatic(); HyperPay.__initStatic2();
|
|
513
511
|
|
|
514
|
-
function _optionalChain$
|
|
512
|
+
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; }
|
|
515
513
|
class MetaMask extends WindowEthereum {
|
|
516
514
|
|
|
517
515
|
static __initStatic() {this.info = {
|
|
@@ -521,8 +519,8 @@ class MetaMask extends WindowEthereum {
|
|
|
521
519
|
};}
|
|
522
520
|
|
|
523
521
|
getProvider() {
|
|
524
|
-
if(_optionalChain$
|
|
525
|
-
return _optionalChain$
|
|
522
|
+
if(_optionalChain$8([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) {
|
|
523
|
+
return _optionalChain$8([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')])
|
|
526
524
|
} else {
|
|
527
525
|
return window.ethereum
|
|
528
526
|
}
|
|
@@ -531,16 +529,16 @@ class MetaMask extends WindowEthereum {
|
|
|
531
529
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
532
530
|
return(
|
|
533
531
|
(
|
|
534
|
-
_optionalChain$
|
|
532
|
+
_optionalChain$8([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) &&
|
|
535
533
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1
|
|
536
534
|
) || (
|
|
537
|
-
_optionalChain$
|
|
535
|
+
_optionalChain$8([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')])
|
|
538
536
|
)
|
|
539
537
|
)
|
|
540
538
|
};}
|
|
541
539
|
} MetaMask.__initStatic(); MetaMask.__initStatic2();
|
|
542
540
|
|
|
543
|
-
function _optionalChain$
|
|
541
|
+
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; }
|
|
544
542
|
class Opera extends WindowEthereum {
|
|
545
543
|
|
|
546
544
|
static __initStatic() {this.info = {
|
|
@@ -549,10 +547,10 @@ class Opera extends WindowEthereum {
|
|
|
549
547
|
blockchains: supported$1.evm
|
|
550
548
|
};}
|
|
551
549
|
|
|
552
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
550
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
|
|
553
551
|
} Opera.__initStatic(); Opera.__initStatic2();
|
|
554
552
|
|
|
555
|
-
function _optionalChain$
|
|
553
|
+
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; }
|
|
556
554
|
class Rabby extends WindowEthereum {
|
|
557
555
|
|
|
558
556
|
static __initStatic() {this.info = {
|
|
@@ -563,12 +561,12 @@ class Rabby extends WindowEthereum {
|
|
|
563
561
|
|
|
564
562
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
565
563
|
return(
|
|
566
|
-
_optionalChain$
|
|
564
|
+
_optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby])
|
|
567
565
|
)
|
|
568
566
|
};}
|
|
569
567
|
} Rabby.__initStatic(); Rabby.__initStatic2();
|
|
570
568
|
|
|
571
|
-
function _optionalChain$
|
|
569
|
+
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; }
|
|
572
570
|
class TokenPocket extends WindowEthereum {
|
|
573
571
|
|
|
574
572
|
static __initStatic() {this.info = {
|
|
@@ -579,12 +577,12 @@ class TokenPocket extends WindowEthereum {
|
|
|
579
577
|
|
|
580
578
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
581
579
|
return (
|
|
582
|
-
_optionalChain$
|
|
580
|
+
_optionalChain$5([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket])
|
|
583
581
|
)
|
|
584
582
|
};}
|
|
585
583
|
} TokenPocket.__initStatic(); TokenPocket.__initStatic2();
|
|
586
584
|
|
|
587
|
-
function _optionalChain$
|
|
585
|
+
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; }
|
|
588
586
|
class Trust extends WindowEthereum {
|
|
589
587
|
|
|
590
588
|
static __initStatic() {this.info = {
|
|
@@ -595,7 +593,7 @@ class Trust extends WindowEthereum {
|
|
|
595
593
|
|
|
596
594
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
597
595
|
return (
|
|
598
|
-
(_optionalChain$
|
|
596
|
+
(_optionalChain$4([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$4([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) &&
|
|
599
597
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!Debug)(?!TrustWallet)(?!MetaMask)(?!PocketUniverse)(?!RevokeCash)/)).length == 1
|
|
600
598
|
)
|
|
601
599
|
};}
|
|
@@ -605,12 +603,22 @@ const transactionApiBlockchainNames = {
|
|
|
605
603
|
'ethereum': 'mainnet',
|
|
606
604
|
'bsc': 'bsc',
|
|
607
605
|
'polygon': 'polygon',
|
|
606
|
+
'arbitrum': 'arbitrum',
|
|
607
|
+
'base': 'base',
|
|
608
|
+
'avalanche': 'avalanche',
|
|
609
|
+
'gnosis': 'gnosis-chain',
|
|
610
|
+
'optimism': 'optimism',
|
|
608
611
|
};
|
|
609
612
|
|
|
610
613
|
const explorerBlockchainNames = {
|
|
611
614
|
'ethereum': 'eth',
|
|
612
615
|
'bsc': 'bnb',
|
|
613
616
|
'polygon': 'matic',
|
|
617
|
+
'arbitrum': 'arb1',
|
|
618
|
+
'base': 'base',
|
|
619
|
+
'avalanche': 'avax',
|
|
620
|
+
'gnosis': 'gno',
|
|
621
|
+
'optimism': 'oeth',
|
|
614
622
|
};
|
|
615
623
|
|
|
616
624
|
class Safe {
|
|
@@ -690,7 +698,7 @@ const getSmartContractWallet = async(blockchain, address)=> {
|
|
|
690
698
|
}
|
|
691
699
|
};
|
|
692
700
|
|
|
693
|
-
function _optionalChain$
|
|
701
|
+
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; }
|
|
694
702
|
|
|
695
703
|
const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
696
704
|
transaction = new Transaction(transaction);
|
|
@@ -743,7 +751,7 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{
|
|
|
743
751
|
try {
|
|
744
752
|
|
|
745
753
|
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
746
|
-
if(
|
|
754
|
+
if(error && error.toString().match('undefined')) {
|
|
747
755
|
setTimeout(()=>{
|
|
748
756
|
retrieveConfirmedTransaction$2(sentTransaction)
|
|
749
757
|
.then(resolve)
|
|
@@ -754,7 +762,7 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{
|
|
|
754
762
|
}
|
|
755
763
|
});
|
|
756
764
|
} catch (error) {
|
|
757
|
-
if(
|
|
765
|
+
if(error && error.toString().match('undefined')) {
|
|
758
766
|
setTimeout(()=>{
|
|
759
767
|
retrieveConfirmedTransaction$2(sentTransaction)
|
|
760
768
|
.then(resolve)
|
|
@@ -799,7 +807,7 @@ const submit$2 = ({ transaction, wallet }) => {
|
|
|
799
807
|
const submitContractInteraction$2 = async ({ transaction, wallet })=>{
|
|
800
808
|
const provider = await getProvider(transaction.blockchain);
|
|
801
809
|
let gasPrice = await provider.getGasPrice();
|
|
802
|
-
if(_optionalChain$
|
|
810
|
+
if(_optionalChain$3([wallet, 'access', _ => _.session, 'optionalAccess', _2 => _2.peerMeta, 'optionalAccess', _3 => _3.name]) === 'Uniswap Wallet') {
|
|
803
811
|
gasPrice = undefined;
|
|
804
812
|
} else {
|
|
805
813
|
gasPrice = gasPrice.toHexString();
|
|
@@ -823,7 +831,7 @@ const submitContractInteraction$2 = async ({ transaction, wallet })=>{
|
|
|
823
831
|
const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
|
|
824
832
|
const provider = await getProvider(transaction.blockchain);
|
|
825
833
|
let gasPrice = await provider.getGasPrice();
|
|
826
|
-
if(_optionalChain$
|
|
834
|
+
if(_optionalChain$3([wallet, 'access', _4 => _4.session, 'optionalAccess', _5 => _5.peerMeta, 'optionalAccess', _6 => _6.name]) === 'Uniswap Wallet') {
|
|
827
835
|
gasPrice = undefined;
|
|
828
836
|
} else {
|
|
829
837
|
gasPrice = gasPrice.toHexString();
|
|
@@ -842,7 +850,7 @@ const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
|
|
|
842
850
|
})
|
|
843
851
|
};
|
|
844
852
|
|
|
845
|
-
function _optionalChain$
|
|
853
|
+
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; }
|
|
846
854
|
|
|
847
855
|
const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
|
|
848
856
|
|
|
@@ -985,8 +993,8 @@ class WalletConnectV1 {
|
|
|
985
993
|
let session = await this.connector.connect();
|
|
986
994
|
this.session = session;
|
|
987
995
|
|
|
988
|
-
if(_optionalChain$
|
|
989
|
-
if(_optionalChain$
|
|
996
|
+
if(_optionalChain$2([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; }
|
|
997
|
+
if(_optionalChain$2([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; }
|
|
990
998
|
|
|
991
999
|
if(session.accounts instanceof Array && session.accounts.length) {
|
|
992
1000
|
setConnectedInstance$1(this);
|
|
@@ -1130,8 +1138,6 @@ class WalletConnectV1 {
|
|
|
1130
1138
|
WalletConnectV1.getConnectedInstance = getConnectedInstance$2;
|
|
1131
1139
|
WalletConnectV1.setConnectedInstance = setConnectedInstance$1;
|
|
1132
1140
|
|
|
1133
|
-
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; }
|
|
1134
|
-
|
|
1135
1141
|
const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
1136
1142
|
transaction = new Transaction(transaction);
|
|
1137
1143
|
if((await wallet.connectedTo(transaction.blockchain)) == false) {
|
|
@@ -1183,7 +1189,7 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{
|
|
|
1183
1189
|
return new Promise((resolve, reject)=>{
|
|
1184
1190
|
try {
|
|
1185
1191
|
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
1186
|
-
if(
|
|
1192
|
+
if(error && error.toString().match('undefined')) {
|
|
1187
1193
|
setTimeout(()=>{
|
|
1188
1194
|
retrieveConfirmedTransaction$1(sentTransaction)
|
|
1189
1195
|
.then(resolve)
|
|
@@ -1194,7 +1200,7 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{
|
|
|
1194
1200
|
}
|
|
1195
1201
|
});
|
|
1196
1202
|
} catch (error) {
|
|
1197
|
-
if(
|
|
1203
|
+
if(error && error.toString().match('undefined')) {
|
|
1198
1204
|
setTimeout(()=>{
|
|
1199
1205
|
retrieveConfirmedTransaction$1(sentTransaction)
|
|
1200
1206
|
.then(resolve)
|
|
@@ -1222,7 +1228,7 @@ const retrieveTransaction = (tx, blockchain)=>{
|
|
|
1222
1228
|
}
|
|
1223
1229
|
resolve(sentTransaction);
|
|
1224
1230
|
} catch (error) {
|
|
1225
|
-
if(
|
|
1231
|
+
if(error && error.toString().match('undefined')) {
|
|
1226
1232
|
setTimeout(()=>{
|
|
1227
1233
|
retrieveTransaction(tx, blockchain)
|
|
1228
1234
|
.then(resolve)
|
|
@@ -1288,7 +1294,7 @@ const submitSimpleTransfer$1 = async ({ transaction, wallet })=>{
|
|
|
1288
1294
|
}).catch((e)=>{console.log('ERROR', e);})
|
|
1289
1295
|
};
|
|
1290
1296
|
|
|
1291
|
-
function _optionalChain$
|
|
1297
|
+
function _optionalChain$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; }
|
|
1292
1298
|
|
|
1293
1299
|
const KEY = 'depay:wallets:wc2';
|
|
1294
1300
|
|
|
@@ -1407,11 +1413,11 @@ const getLastSession = async(walletName)=>{
|
|
|
1407
1413
|
};
|
|
1408
1414
|
|
|
1409
1415
|
const getWalletConnectV2Config = (walletName)=>{
|
|
1410
|
-
const methods = _optionalChain$
|
|
1411
|
-
const events = _optionalChain$
|
|
1416
|
+
const methods = _optionalChain$1([CONFIGURATIONS, 'access', _ => _[walletName], 'optionalAccess', _2 => _2.methods]) || DEFAULT_CONFIGURATION.methods;
|
|
1417
|
+
const events = _optionalChain$1([CONFIGURATIONS, 'access', _3 => _3[walletName], 'optionalAccess', _4 => _4.events]) || DEFAULT_CONFIGURATION.events;
|
|
1412
1418
|
|
|
1413
1419
|
let requiredNamespaces = {};
|
|
1414
|
-
if(_optionalChain$
|
|
1420
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _5 => _5[walletName], 'optionalAccess', _6 => _6.requiredNamespaces])) {
|
|
1415
1421
|
requiredNamespaces = CONFIGURATIONS[walletName].requiredNamespaces;
|
|
1416
1422
|
} else {
|
|
1417
1423
|
requiredNamespaces['eip155'] = {
|
|
@@ -1424,14 +1430,14 @@ const getWalletConnectV2Config = (walletName)=>{
|
|
|
1424
1430
|
}
|
|
1425
1431
|
|
|
1426
1432
|
let optionalNamespaces = {};
|
|
1427
|
-
if(_optionalChain$
|
|
1433
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _7 => _7[walletName], 'optionalAccess', _8 => _8.optionalNamespaces])) {
|
|
1428
1434
|
optionalNamespaces = CONFIGURATIONS[walletName].optionalNamespaces;
|
|
1429
1435
|
} else {
|
|
1430
1436
|
optionalNamespaces['eip155'] = {
|
|
1431
1437
|
chains: supported$1.evm.map((blockchain)=>`${Blockchains[blockchain].namespace}:${Blockchains[blockchain].networkId}`),
|
|
1432
1438
|
};
|
|
1433
1439
|
}
|
|
1434
|
-
if(_optionalChain$
|
|
1440
|
+
if(_optionalChain$1([optionalNamespaces, 'optionalAccess', _9 => _9.eip155]) && _optionalChain$1([optionalNamespaces, 'optionalAccess', _10 => _10.eip155, 'optionalAccess', _11 => _11.chains, 'optionalAccess', _12 => _12.length])) {
|
|
1435
1441
|
optionalNamespaces['eip155'].methods = methods;
|
|
1436
1442
|
optionalNamespaces['eip155'].events = events;
|
|
1437
1443
|
}
|
|
@@ -1446,9 +1452,9 @@ const getSignClient = ()=>{
|
|
|
1446
1452
|
projectId: localStorage[KEY+":projectId"],
|
|
1447
1453
|
metadata: {
|
|
1448
1454
|
name: document.title || 'dApp',
|
|
1449
|
-
description: _optionalChain$
|
|
1455
|
+
description: _optionalChain$1([document, 'access', _13 => _13.querySelector, 'call', _14 => _14('meta[name="description"]'), 'optionalAccess', _15 => _15.getAttribute, 'call', _16 => _16('content')]) || document.title || 'dApp',
|
|
1450
1456
|
url: location.href,
|
|
1451
|
-
icons: [_optionalChain$
|
|
1457
|
+
icons: [_optionalChain$1([document, 'access', _17 => _17.querySelector, 'call', _18 => _18("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _19 => _19.href]) || `${location.origin}/favicon.ico`]
|
|
1452
1458
|
}
|
|
1453
1459
|
});
|
|
1454
1460
|
resolve(signClient);
|
|
@@ -1466,7 +1472,7 @@ class WalletConnectV2 {
|
|
|
1466
1472
|
};}
|
|
1467
1473
|
|
|
1468
1474
|
static __initStatic2() {this.isAvailable = async(options)=>{
|
|
1469
|
-
return !! await getLastSession(_optionalChain$
|
|
1475
|
+
return !! await getLastSession(_optionalChain$1([options, 'optionalAccess', _21 => _21.walletName]))
|
|
1470
1476
|
};}
|
|
1471
1477
|
|
|
1472
1478
|
constructor() {
|
|
@@ -1481,19 +1487,19 @@ class WalletConnectV2 {
|
|
|
1481
1487
|
}
|
|
1482
1488
|
|
|
1483
1489
|
async account() {
|
|
1484
|
-
if(_optionalChain$
|
|
1490
|
+
if(_optionalChain$1([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.namespaces, 'optionalAccess', _24 => _24.eip155, 'optionalAccess', _25 => _25.accounts, 'optionalAccess', _26 => _26.length])) {
|
|
1485
1491
|
return this.session.namespaces.eip155.accounts[0].split(':')[2]
|
|
1486
1492
|
}
|
|
1487
1493
|
}
|
|
1488
1494
|
|
|
1489
1495
|
async setSessionBlockchains() {
|
|
1490
|
-
if(!this.session || !_optionalChain$
|
|
1491
|
-
if(_optionalChain$
|
|
1492
|
-
this.blockchains = [this.session.namespaces.eip155.chains[this.session.namespaces.eip155.chains.length-1]].map((chainIdentifier)=>_optionalChain$
|
|
1496
|
+
if(!this.session || !_optionalChain$1([this, 'access', _27 => _27.session, 'optionalAccess', _28 => _28.namespaces, 'optionalAccess', _29 => _29.eip155])) { return }
|
|
1497
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _30 => _30[this.walletName], 'optionalAccess', _31 => _31.methods, 'optionalAccess', _32 => _32.includes, 'call', _33 => _33('wallet_switchEthereumChain')])) {
|
|
1498
|
+
this.blockchains = [this.session.namespaces.eip155.chains[this.session.namespaces.eip155.chains.length-1]].map((chainIdentifier)=>_optionalChain$1([Blockchains, 'access', _34 => _34.findByNetworkId, 'call', _35 => _35(chainIdentifier.split(':')[1]), 'optionalAccess', _36 => _36.name])).filter(Boolean);
|
|
1493
1499
|
} else if(this.session.namespaces.eip155.chains) {
|
|
1494
|
-
this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$
|
|
1500
|
+
this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$1([Blockchains, 'access', _37 => _37.findByNetworkId, 'call', _38 => _38(chainIdentifier.split(':')[1]), 'optionalAccess', _39 => _39.name])).filter(Boolean);
|
|
1495
1501
|
} else if(this.session.namespaces.eip155.accounts) {
|
|
1496
|
-
this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$
|
|
1502
|
+
this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$1([Blockchains, 'access', _40 => _40.findByNetworkId, 'call', _41 => _41(accountIdentifier.split(':')[1]), 'optionalAccess', _42 => _42.name])).filter(Boolean);
|
|
1497
1503
|
}
|
|
1498
1504
|
}
|
|
1499
1505
|
|
|
@@ -1503,13 +1509,13 @@ class WalletConnectV2 {
|
|
|
1503
1509
|
|
|
1504
1510
|
try {
|
|
1505
1511
|
|
|
1506
|
-
this.walletName = _optionalChain$
|
|
1512
|
+
this.walletName = _optionalChain$1([options, 'optionalAccess', _43 => _43.name]);
|
|
1507
1513
|
|
|
1508
1514
|
// delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS
|
|
1509
1515
|
this.signClient = await getSignClient();
|
|
1510
1516
|
|
|
1511
1517
|
this.signClient.on("session_delete", (session)=> {
|
|
1512
|
-
if(_optionalChain$
|
|
1518
|
+
if(_optionalChain$1([session, 'optionalAccess', _44 => _44.topic]) === _optionalChain$1([this, 'access', _45 => _45.session, 'optionalAccess', _46 => _46.topic])) {
|
|
1513
1519
|
localStorage[KEY+':name'] = undefined;
|
|
1514
1520
|
localStorage[KEY+':logo'] = undefined;
|
|
1515
1521
|
this.signClient = undefined;
|
|
@@ -1518,14 +1524,14 @@ class WalletConnectV2 {
|
|
|
1518
1524
|
});
|
|
1519
1525
|
|
|
1520
1526
|
this.signClient.on("session_update", async(session)=> {
|
|
1521
|
-
if(_optionalChain$
|
|
1527
|
+
if(_optionalChain$1([session, 'optionalAccess', _47 => _47.topic]) === _optionalChain$1([this, 'access', _48 => _48.session, 'optionalAccess', _49 => _49.topic])) {
|
|
1522
1528
|
this.session = this.signClient.session.get(session.topic);
|
|
1523
1529
|
await this.setSessionBlockchains();
|
|
1524
1530
|
}
|
|
1525
1531
|
});
|
|
1526
1532
|
|
|
1527
1533
|
this.signClient.on("session_event", (event)=> {
|
|
1528
|
-
if(_optionalChain$
|
|
1534
|
+
if(_optionalChain$1([event, 'optionalAccess', _50 => _50.topic]) === _optionalChain$1([this, 'access', _51 => _51.session, 'optionalAccess', _52 => _52.topic])) {}
|
|
1529
1535
|
});
|
|
1530
1536
|
|
|
1531
1537
|
const connectWallet = async()=>{
|
|
@@ -1536,24 +1542,24 @@ class WalletConnectV2 {
|
|
|
1536
1542
|
await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect
|
|
1537
1543
|
};
|
|
1538
1544
|
|
|
1539
|
-
const lastSession = _optionalChain$
|
|
1545
|
+
const lastSession = _optionalChain$1([this, 'optionalAccess', _53 => _53.walletName, 'optionalAccess', _54 => _54.length]) ? await getLastSession(this.walletName) : undefined;
|
|
1540
1546
|
if(lastSession) {
|
|
1541
1547
|
this.session = lastSession;
|
|
1542
1548
|
} else {
|
|
1543
1549
|
await connectWallet();
|
|
1544
1550
|
}
|
|
1545
1551
|
|
|
1546
|
-
let meta = _optionalChain$
|
|
1552
|
+
let meta = _optionalChain$1([this, 'access', _55 => _55.session, 'optionalAccess', _56 => _56.peer, 'optionalAccess', _57 => _57.metadata]);
|
|
1547
1553
|
if(meta && meta.name) {
|
|
1548
1554
|
this.name = meta.name;
|
|
1549
1555
|
localStorage[KEY+':name'] = meta.name;
|
|
1550
|
-
if(_optionalChain$
|
|
1556
|
+
if(_optionalChain$1([meta, 'optionalAccess', _58 => _58.icons]) && meta.icons.length) {
|
|
1551
1557
|
this.logo = meta.icons[0];
|
|
1552
1558
|
localStorage[KEY+':logo'] = this.logo;
|
|
1553
1559
|
}
|
|
1554
1560
|
}
|
|
1555
|
-
if(_optionalChain$
|
|
1556
|
-
if(_optionalChain$
|
|
1561
|
+
if(_optionalChain$1([options, 'optionalAccess', _59 => _59.name])) { localStorage[KEY+':name'] = this.name = options.name; }
|
|
1562
|
+
if(_optionalChain$1([options, 'optionalAccess', _60 => _60.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; }
|
|
1557
1563
|
|
|
1558
1564
|
await this.setSessionBlockchains();
|
|
1559
1565
|
|
|
@@ -1610,7 +1616,7 @@ class WalletConnectV2 {
|
|
|
1610
1616
|
switch (event) {
|
|
1611
1617
|
case 'account':
|
|
1612
1618
|
internalCallback = async(event)=> {
|
|
1613
|
-
if(_optionalChain$
|
|
1619
|
+
if(_optionalChain$1([event, 'optionalAccess', _61 => _61.topic]) === _optionalChain$1([this, 'access', _62 => _62.session, 'optionalAccess', _63 => _63.topic]) && event.params.event.name === 'accountsChanged') {
|
|
1614
1620
|
callback(await this.account());
|
|
1615
1621
|
}
|
|
1616
1622
|
};
|
|
@@ -1670,7 +1676,6 @@ class WalletConnectV2 {
|
|
|
1670
1676
|
|
|
1671
1677
|
WalletConnectV2.getConnectedInstance = getConnectedInstance$1;
|
|
1672
1678
|
|
|
1673
|
-
function _optionalChain$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; }
|
|
1674
1679
|
const sendTransaction = async ({ transaction, wallet })=> {
|
|
1675
1680
|
transaction = new Transaction(transaction);
|
|
1676
1681
|
if((await wallet.connectedTo(transaction.blockchain)) == false) {
|
|
@@ -1721,7 +1726,7 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{
|
|
|
1721
1726
|
try {
|
|
1722
1727
|
|
|
1723
1728
|
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
1724
|
-
if(
|
|
1729
|
+
if(error && error.toString().match('undefined')) {
|
|
1725
1730
|
setTimeout(()=>{
|
|
1726
1731
|
retrieveConfirmedTransaction(sentTransaction)
|
|
1727
1732
|
.then(resolve)
|
|
@@ -1732,7 +1737,7 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{
|
|
|
1732
1737
|
}
|
|
1733
1738
|
});
|
|
1734
1739
|
} catch(error) {
|
|
1735
|
-
if(
|
|
1740
|
+
if(error && error.toString().match('undefined')) {
|
|
1736
1741
|
setTimeout(()=>{
|
|
1737
1742
|
retrieveConfirmedTransaction(sentTransaction)
|
|
1738
1743
|
.then(resolve)
|