@depay/web3-wallets-evm 16.2.12 → 16.2.13
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 +85 -90
- package/dist/esm/index.js +101 -106
- package/dist/umd/index.evm.js +85 -90
- package/dist/umd/index.js +101 -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
|
};}
|
|
@@ -690,7 +688,7 @@ const getSmartContractWallet = async(blockchain, address)=> {
|
|
|
690
688
|
}
|
|
691
689
|
};
|
|
692
690
|
|
|
693
|
-
function _optionalChain$
|
|
691
|
+
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
692
|
|
|
695
693
|
const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
696
694
|
transaction = new Transaction(transaction);
|
|
@@ -743,7 +741,7 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{
|
|
|
743
741
|
try {
|
|
744
742
|
|
|
745
743
|
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
746
|
-
if(
|
|
744
|
+
if(error && error.toString().match('undefined')) {
|
|
747
745
|
setTimeout(()=>{
|
|
748
746
|
retrieveConfirmedTransaction$2(sentTransaction)
|
|
749
747
|
.then(resolve)
|
|
@@ -754,7 +752,7 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{
|
|
|
754
752
|
}
|
|
755
753
|
});
|
|
756
754
|
} catch (error) {
|
|
757
|
-
if(
|
|
755
|
+
if(error && error.toString().match('undefined')) {
|
|
758
756
|
setTimeout(()=>{
|
|
759
757
|
retrieveConfirmedTransaction$2(sentTransaction)
|
|
760
758
|
.then(resolve)
|
|
@@ -799,7 +797,7 @@ const submit$2 = ({ transaction, wallet }) => {
|
|
|
799
797
|
const submitContractInteraction$2 = async ({ transaction, wallet })=>{
|
|
800
798
|
const provider = await getProvider(transaction.blockchain);
|
|
801
799
|
let gasPrice = await provider.getGasPrice();
|
|
802
|
-
if(_optionalChain$
|
|
800
|
+
if(_optionalChain$3([wallet, 'access', _ => _.session, 'optionalAccess', _2 => _2.peerMeta, 'optionalAccess', _3 => _3.name]) === 'Uniswap Wallet') {
|
|
803
801
|
gasPrice = undefined;
|
|
804
802
|
} else {
|
|
805
803
|
gasPrice = gasPrice.toHexString();
|
|
@@ -823,7 +821,7 @@ const submitContractInteraction$2 = async ({ transaction, wallet })=>{
|
|
|
823
821
|
const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
|
|
824
822
|
const provider = await getProvider(transaction.blockchain);
|
|
825
823
|
let gasPrice = await provider.getGasPrice();
|
|
826
|
-
if(_optionalChain$
|
|
824
|
+
if(_optionalChain$3([wallet, 'access', _4 => _4.session, 'optionalAccess', _5 => _5.peerMeta, 'optionalAccess', _6 => _6.name]) === 'Uniswap Wallet') {
|
|
827
825
|
gasPrice = undefined;
|
|
828
826
|
} else {
|
|
829
827
|
gasPrice = gasPrice.toHexString();
|
|
@@ -842,7 +840,7 @@ const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
|
|
|
842
840
|
})
|
|
843
841
|
};
|
|
844
842
|
|
|
845
|
-
function _optionalChain$
|
|
843
|
+
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
844
|
|
|
847
845
|
const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
|
|
848
846
|
|
|
@@ -985,8 +983,8 @@ class WalletConnectV1 {
|
|
|
985
983
|
let session = await this.connector.connect();
|
|
986
984
|
this.session = session;
|
|
987
985
|
|
|
988
|
-
if(_optionalChain$
|
|
989
|
-
if(_optionalChain$
|
|
986
|
+
if(_optionalChain$2([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; }
|
|
987
|
+
if(_optionalChain$2([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; }
|
|
990
988
|
|
|
991
989
|
if(session.accounts instanceof Array && session.accounts.length) {
|
|
992
990
|
setConnectedInstance$1(this);
|
|
@@ -1130,8 +1128,6 @@ class WalletConnectV1 {
|
|
|
1130
1128
|
WalletConnectV1.getConnectedInstance = getConnectedInstance$2;
|
|
1131
1129
|
WalletConnectV1.setConnectedInstance = setConnectedInstance$1;
|
|
1132
1130
|
|
|
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
1131
|
const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
1136
1132
|
transaction = new Transaction(transaction);
|
|
1137
1133
|
if((await wallet.connectedTo(transaction.blockchain)) == false) {
|
|
@@ -1183,7 +1179,7 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{
|
|
|
1183
1179
|
return new Promise((resolve, reject)=>{
|
|
1184
1180
|
try {
|
|
1185
1181
|
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
1186
|
-
if(
|
|
1182
|
+
if(error && error.toString().match('undefined')) {
|
|
1187
1183
|
setTimeout(()=>{
|
|
1188
1184
|
retrieveConfirmedTransaction$1(sentTransaction)
|
|
1189
1185
|
.then(resolve)
|
|
@@ -1194,7 +1190,7 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{
|
|
|
1194
1190
|
}
|
|
1195
1191
|
});
|
|
1196
1192
|
} catch (error) {
|
|
1197
|
-
if(
|
|
1193
|
+
if(error && error.toString().match('undefined')) {
|
|
1198
1194
|
setTimeout(()=>{
|
|
1199
1195
|
retrieveConfirmedTransaction$1(sentTransaction)
|
|
1200
1196
|
.then(resolve)
|
|
@@ -1222,7 +1218,7 @@ const retrieveTransaction = (tx, blockchain)=>{
|
|
|
1222
1218
|
}
|
|
1223
1219
|
resolve(sentTransaction);
|
|
1224
1220
|
} catch (error) {
|
|
1225
|
-
if(
|
|
1221
|
+
if(error && error.toString().match('undefined')) {
|
|
1226
1222
|
setTimeout(()=>{
|
|
1227
1223
|
retrieveTransaction(tx, blockchain)
|
|
1228
1224
|
.then(resolve)
|
|
@@ -1288,7 +1284,7 @@ const submitSimpleTransfer$1 = async ({ transaction, wallet })=>{
|
|
|
1288
1284
|
}).catch((e)=>{console.log('ERROR', e);})
|
|
1289
1285
|
};
|
|
1290
1286
|
|
|
1291
|
-
function _optionalChain$
|
|
1287
|
+
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
1288
|
|
|
1293
1289
|
const KEY = 'depay:wallets:wc2';
|
|
1294
1290
|
|
|
@@ -1407,11 +1403,11 @@ const getLastSession = async(walletName)=>{
|
|
|
1407
1403
|
};
|
|
1408
1404
|
|
|
1409
1405
|
const getWalletConnectV2Config = (walletName)=>{
|
|
1410
|
-
const methods = _optionalChain$
|
|
1411
|
-
const events = _optionalChain$
|
|
1406
|
+
const methods = _optionalChain$1([CONFIGURATIONS, 'access', _ => _[walletName], 'optionalAccess', _2 => _2.methods]) || DEFAULT_CONFIGURATION.methods;
|
|
1407
|
+
const events = _optionalChain$1([CONFIGURATIONS, 'access', _3 => _3[walletName], 'optionalAccess', _4 => _4.events]) || DEFAULT_CONFIGURATION.events;
|
|
1412
1408
|
|
|
1413
1409
|
let requiredNamespaces = {};
|
|
1414
|
-
if(_optionalChain$
|
|
1410
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _5 => _5[walletName], 'optionalAccess', _6 => _6.requiredNamespaces])) {
|
|
1415
1411
|
requiredNamespaces = CONFIGURATIONS[walletName].requiredNamespaces;
|
|
1416
1412
|
} else {
|
|
1417
1413
|
requiredNamespaces['eip155'] = {
|
|
@@ -1424,14 +1420,14 @@ const getWalletConnectV2Config = (walletName)=>{
|
|
|
1424
1420
|
}
|
|
1425
1421
|
|
|
1426
1422
|
let optionalNamespaces = {};
|
|
1427
|
-
if(_optionalChain$
|
|
1423
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _7 => _7[walletName], 'optionalAccess', _8 => _8.optionalNamespaces])) {
|
|
1428
1424
|
optionalNamespaces = CONFIGURATIONS[walletName].optionalNamespaces;
|
|
1429
1425
|
} else {
|
|
1430
1426
|
optionalNamespaces['eip155'] = {
|
|
1431
1427
|
chains: supported$1.evm.map((blockchain)=>`${Blockchains[blockchain].namespace}:${Blockchains[blockchain].networkId}`),
|
|
1432
1428
|
};
|
|
1433
1429
|
}
|
|
1434
|
-
if(_optionalChain$
|
|
1430
|
+
if(_optionalChain$1([optionalNamespaces, 'optionalAccess', _9 => _9.eip155]) && _optionalChain$1([optionalNamespaces, 'optionalAccess', _10 => _10.eip155, 'optionalAccess', _11 => _11.chains, 'optionalAccess', _12 => _12.length])) {
|
|
1435
1431
|
optionalNamespaces['eip155'].methods = methods;
|
|
1436
1432
|
optionalNamespaces['eip155'].events = events;
|
|
1437
1433
|
}
|
|
@@ -1446,9 +1442,9 @@ const getSignClient = ()=>{
|
|
|
1446
1442
|
projectId: localStorage[KEY+":projectId"],
|
|
1447
1443
|
metadata: {
|
|
1448
1444
|
name: document.title || 'dApp',
|
|
1449
|
-
description: _optionalChain$
|
|
1445
|
+
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
1446
|
url: location.href,
|
|
1451
|
-
icons: [_optionalChain$
|
|
1447
|
+
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
1448
|
}
|
|
1453
1449
|
});
|
|
1454
1450
|
resolve(signClient);
|
|
@@ -1466,7 +1462,7 @@ class WalletConnectV2 {
|
|
|
1466
1462
|
};}
|
|
1467
1463
|
|
|
1468
1464
|
static __initStatic2() {this.isAvailable = async(options)=>{
|
|
1469
|
-
return !! await getLastSession(_optionalChain$
|
|
1465
|
+
return !! await getLastSession(_optionalChain$1([options, 'optionalAccess', _21 => _21.walletName]))
|
|
1470
1466
|
};}
|
|
1471
1467
|
|
|
1472
1468
|
constructor() {
|
|
@@ -1481,19 +1477,19 @@ class WalletConnectV2 {
|
|
|
1481
1477
|
}
|
|
1482
1478
|
|
|
1483
1479
|
async account() {
|
|
1484
|
-
if(_optionalChain$
|
|
1480
|
+
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
1481
|
return this.session.namespaces.eip155.accounts[0].split(':')[2]
|
|
1486
1482
|
}
|
|
1487
1483
|
}
|
|
1488
1484
|
|
|
1489
1485
|
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$
|
|
1486
|
+
if(!this.session || !_optionalChain$1([this, 'access', _27 => _27.session, 'optionalAccess', _28 => _28.namespaces, 'optionalAccess', _29 => _29.eip155])) { return }
|
|
1487
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _30 => _30[this.walletName], 'optionalAccess', _31 => _31.methods, 'optionalAccess', _32 => _32.includes, 'call', _33 => _33('wallet_switchEthereumChain')])) {
|
|
1488
|
+
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
1489
|
} else if(this.session.namespaces.eip155.chains) {
|
|
1494
|
-
this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$
|
|
1490
|
+
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
1491
|
} else if(this.session.namespaces.eip155.accounts) {
|
|
1496
|
-
this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$
|
|
1492
|
+
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
1493
|
}
|
|
1498
1494
|
}
|
|
1499
1495
|
|
|
@@ -1503,13 +1499,13 @@ class WalletConnectV2 {
|
|
|
1503
1499
|
|
|
1504
1500
|
try {
|
|
1505
1501
|
|
|
1506
|
-
this.walletName = _optionalChain$
|
|
1502
|
+
this.walletName = _optionalChain$1([options, 'optionalAccess', _43 => _43.name]);
|
|
1507
1503
|
|
|
1508
1504
|
// delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS
|
|
1509
1505
|
this.signClient = await getSignClient();
|
|
1510
1506
|
|
|
1511
1507
|
this.signClient.on("session_delete", (session)=> {
|
|
1512
|
-
if(_optionalChain$
|
|
1508
|
+
if(_optionalChain$1([session, 'optionalAccess', _44 => _44.topic]) === _optionalChain$1([this, 'access', _45 => _45.session, 'optionalAccess', _46 => _46.topic])) {
|
|
1513
1509
|
localStorage[KEY+':name'] = undefined;
|
|
1514
1510
|
localStorage[KEY+':logo'] = undefined;
|
|
1515
1511
|
this.signClient = undefined;
|
|
@@ -1518,14 +1514,14 @@ class WalletConnectV2 {
|
|
|
1518
1514
|
});
|
|
1519
1515
|
|
|
1520
1516
|
this.signClient.on("session_update", async(session)=> {
|
|
1521
|
-
if(_optionalChain$
|
|
1517
|
+
if(_optionalChain$1([session, 'optionalAccess', _47 => _47.topic]) === _optionalChain$1([this, 'access', _48 => _48.session, 'optionalAccess', _49 => _49.topic])) {
|
|
1522
1518
|
this.session = this.signClient.session.get(session.topic);
|
|
1523
1519
|
await this.setSessionBlockchains();
|
|
1524
1520
|
}
|
|
1525
1521
|
});
|
|
1526
1522
|
|
|
1527
1523
|
this.signClient.on("session_event", (event)=> {
|
|
1528
|
-
if(_optionalChain$
|
|
1524
|
+
if(_optionalChain$1([event, 'optionalAccess', _50 => _50.topic]) === _optionalChain$1([this, 'access', _51 => _51.session, 'optionalAccess', _52 => _52.topic])) {}
|
|
1529
1525
|
});
|
|
1530
1526
|
|
|
1531
1527
|
const connectWallet = async()=>{
|
|
@@ -1536,24 +1532,24 @@ class WalletConnectV2 {
|
|
|
1536
1532
|
await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect
|
|
1537
1533
|
};
|
|
1538
1534
|
|
|
1539
|
-
const lastSession = _optionalChain$
|
|
1535
|
+
const lastSession = _optionalChain$1([this, 'optionalAccess', _53 => _53.walletName, 'optionalAccess', _54 => _54.length]) ? await getLastSession(this.walletName) : undefined;
|
|
1540
1536
|
if(lastSession) {
|
|
1541
1537
|
this.session = lastSession;
|
|
1542
1538
|
} else {
|
|
1543
1539
|
await connectWallet();
|
|
1544
1540
|
}
|
|
1545
1541
|
|
|
1546
|
-
let meta = _optionalChain$
|
|
1542
|
+
let meta = _optionalChain$1([this, 'access', _55 => _55.session, 'optionalAccess', _56 => _56.peer, 'optionalAccess', _57 => _57.metadata]);
|
|
1547
1543
|
if(meta && meta.name) {
|
|
1548
1544
|
this.name = meta.name;
|
|
1549
1545
|
localStorage[KEY+':name'] = meta.name;
|
|
1550
|
-
if(_optionalChain$
|
|
1546
|
+
if(_optionalChain$1([meta, 'optionalAccess', _58 => _58.icons]) && meta.icons.length) {
|
|
1551
1547
|
this.logo = meta.icons[0];
|
|
1552
1548
|
localStorage[KEY+':logo'] = this.logo;
|
|
1553
1549
|
}
|
|
1554
1550
|
}
|
|
1555
|
-
if(_optionalChain$
|
|
1556
|
-
if(_optionalChain$
|
|
1551
|
+
if(_optionalChain$1([options, 'optionalAccess', _59 => _59.name])) { localStorage[KEY+':name'] = this.name = options.name; }
|
|
1552
|
+
if(_optionalChain$1([options, 'optionalAccess', _60 => _60.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; }
|
|
1557
1553
|
|
|
1558
1554
|
await this.setSessionBlockchains();
|
|
1559
1555
|
|
|
@@ -1610,7 +1606,7 @@ class WalletConnectV2 {
|
|
|
1610
1606
|
switch (event) {
|
|
1611
1607
|
case 'account':
|
|
1612
1608
|
internalCallback = async(event)=> {
|
|
1613
|
-
if(_optionalChain$
|
|
1609
|
+
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
1610
|
callback(await this.account());
|
|
1615
1611
|
}
|
|
1616
1612
|
};
|
|
@@ -1670,7 +1666,6 @@ class WalletConnectV2 {
|
|
|
1670
1666
|
|
|
1671
1667
|
WalletConnectV2.getConnectedInstance = getConnectedInstance$1;
|
|
1672
1668
|
|
|
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
1669
|
const sendTransaction = async ({ transaction, wallet })=> {
|
|
1675
1670
|
transaction = new Transaction(transaction);
|
|
1676
1671
|
if((await wallet.connectedTo(transaction.blockchain)) == false) {
|
|
@@ -1721,7 +1716,7 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{
|
|
|
1721
1716
|
try {
|
|
1722
1717
|
|
|
1723
1718
|
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
1724
|
-
if(
|
|
1719
|
+
if(error && error.toString().match('undefined')) {
|
|
1725
1720
|
setTimeout(()=>{
|
|
1726
1721
|
retrieveConfirmedTransaction(sentTransaction)
|
|
1727
1722
|
.then(resolve)
|
|
@@ -1732,7 +1727,7 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{
|
|
|
1732
1727
|
}
|
|
1733
1728
|
});
|
|
1734
1729
|
} catch(error) {
|
|
1735
|
-
if(
|
|
1730
|
+
if(error && error.toString().match('undefined')) {
|
|
1736
1731
|
setTimeout(()=>{
|
|
1737
1732
|
retrieveConfirmedTransaction(sentTransaction)
|
|
1738
1733
|
.then(resolve)
|