@depay/web3-wallets-evm 16.2.2 → 16.2.3
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 +159 -76
- package/dist/esm/index.js +175 -92
- package/dist/umd/index.evm.js +159 -76
- package/dist/umd/index.js +175 -92
- package/package.json +1 -1
package/dist/umd/index.evm.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
|
|
13
13
|
supported$1.solana = [];
|
|
14
14
|
|
|
15
|
-
function _optionalChain$
|
|
15
|
+
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; }
|
|
16
16
|
class Transaction {
|
|
17
17
|
|
|
18
18
|
constructor({
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
this.to = (to && to.match('0x')) ? ethers.ethers.utils.getAddress(to) : to;
|
|
38
38
|
|
|
39
39
|
// optional
|
|
40
|
-
this.value = _optionalChain$
|
|
40
|
+
this.value = _optionalChain$i([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
|
|
41
41
|
this.api = api;
|
|
42
42
|
this.method = method;
|
|
43
43
|
this.params = params;
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
getParamType(param) {
|
|
80
|
-
if(_optionalChain$
|
|
80
|
+
if(_optionalChain$i([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) {
|
|
81
81
|
return `(${param.components.map((param)=>this.getParamType(param)).join(',')})`
|
|
82
82
|
} else {
|
|
83
83
|
return param.type
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
})
|
|
228
228
|
};
|
|
229
229
|
|
|
230
|
-
function _optionalChain$
|
|
230
|
+
function _optionalChain$h(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; }
|
|
231
231
|
|
|
232
232
|
class WindowEthereum {
|
|
233
233
|
|
|
@@ -239,29 +239,31 @@
|
|
|
239
239
|
|
|
240
240
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
241
241
|
return (
|
|
242
|
-
_optionalChain$
|
|
242
|
+
_optionalChain$h([window, 'optionalAccess', _31 => _31.ethereum]) &&
|
|
243
243
|
// not MetaMask
|
|
244
|
-
!(_optionalChain$
|
|
244
|
+
!(_optionalChain$h([window, 'optionalAccess', _32 => _32.ethereum, 'optionalAccess', _33 => _33.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) &&
|
|
245
245
|
// not Coin98
|
|
246
|
-
!_optionalChain$
|
|
246
|
+
!_optionalChain$h([window, 'optionalAccess', _34 => _34.coin98]) &&
|
|
247
247
|
// not Trust Wallet
|
|
248
|
-
!(_optionalChain$
|
|
248
|
+
!(_optionalChain$h([window, 'optionalAccess', _35 => _35.ethereum, 'optionalAccess', _36 => _36.isTrust]) || _optionalChain$h([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isTrustWallet])) &&
|
|
249
249
|
// not crypto.com
|
|
250
|
-
!_optionalChain$
|
|
250
|
+
!_optionalChain$h([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isDeficonnectProvider]) &&
|
|
251
251
|
// not HyperPay
|
|
252
|
-
!_optionalChain$
|
|
252
|
+
!_optionalChain$h([window, 'optionalAccess', _41 => _41.ethereum, 'optionalAccess', _42 => _42.isHyperPay]) &&
|
|
253
253
|
// not Phantom
|
|
254
|
-
!(window.phantom && !window.glow && !_optionalChain$
|
|
254
|
+
!(window.phantom && !window.glow && !_optionalChain$h([window, 'optionalAccess', _43 => _43.solana, 'optionalAccess', _44 => _44.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) &&
|
|
255
255
|
// not Rabby
|
|
256
|
-
!_optionalChain$
|
|
256
|
+
!_optionalChain$h([window, 'optionalAccess', _45 => _45.ethereum, 'optionalAccess', _46 => _46.isRabby]) &&
|
|
257
257
|
// not Backpack
|
|
258
|
-
!_optionalChain$
|
|
258
|
+
!_optionalChain$h([window, 'optionalAccess', _47 => _47.backpack, 'optionalAccess', _48 => _48.isBackpack]) &&
|
|
259
259
|
// not TokenPocket
|
|
260
|
-
!_optionalChain$
|
|
260
|
+
!_optionalChain$h([window, 'optionalAccess', _49 => _49.ethereum, 'optionalAccess', _50 => _50.isTokenPocket]) &&
|
|
261
261
|
// not BitKeep
|
|
262
|
-
!_optionalChain$
|
|
262
|
+
!_optionalChain$h([window, 'optionalAccess', _51 => _51.ethereum, 'optionalAccess', _52 => _52.isBitKeep]) &&
|
|
263
263
|
// not Coinbase
|
|
264
|
-
!(_optionalChain$
|
|
264
|
+
!(_optionalChain$h([window, 'optionalAccess', _53 => _53.ethereum, 'optionalAccess', _54 => _54.isCoinbaseWallet]) || _optionalChain$h([window, 'optionalAccess', _55 => _55.ethereum, 'optionalAccess', _56 => _56.isWalletLink])) &&
|
|
265
|
+
// MetaMask through ProviderMap
|
|
266
|
+
!_optionalChain$h([window, 'optionalAccess', _57 => _57.ethereum, 'optionalAccess', _58 => _58.providerMap, 'optionalAccess', _59 => _59.has, 'call', _60 => _60('MetaMask')])
|
|
265
267
|
)
|
|
266
268
|
};}
|
|
267
269
|
|
|
@@ -387,7 +389,7 @@
|
|
|
387
389
|
}
|
|
388
390
|
} WindowEthereum.__initStatic(); WindowEthereum.__initStatic2();
|
|
389
391
|
|
|
390
|
-
function _optionalChain$
|
|
392
|
+
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; }
|
|
391
393
|
class Binance extends WindowEthereum {
|
|
392
394
|
|
|
393
395
|
static __initStatic() {this.info = {
|
|
@@ -397,7 +399,7 @@
|
|
|
397
399
|
};}
|
|
398
400
|
|
|
399
401
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
400
|
-
return _optionalChain$
|
|
402
|
+
return _optionalChain$g([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
|
|
401
403
|
!window.coin98
|
|
402
404
|
};}
|
|
403
405
|
|
|
@@ -405,7 +407,7 @@
|
|
|
405
407
|
|
|
406
408
|
} Binance.__initStatic(); Binance.__initStatic2();
|
|
407
409
|
|
|
408
|
-
function _optionalChain$
|
|
410
|
+
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; }
|
|
409
411
|
class Brave extends WindowEthereum {
|
|
410
412
|
|
|
411
413
|
static __initStatic() {this.info = {
|
|
@@ -414,10 +416,10 @@
|
|
|
414
416
|
blockchains: supported$1.evm
|
|
415
417
|
};}
|
|
416
418
|
|
|
417
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
419
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
|
|
418
420
|
} Brave.__initStatic(); Brave.__initStatic2();
|
|
419
421
|
|
|
420
|
-
function _optionalChain$
|
|
422
|
+
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
423
|
class Coin98 extends WindowEthereum {
|
|
422
424
|
|
|
423
425
|
static __initStatic() {this.info = {
|
|
@@ -426,10 +428,10 @@
|
|
|
426
428
|
blockchains: supported$1.evm
|
|
427
429
|
};}
|
|
428
430
|
|
|
429
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
431
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$e([window, 'optionalAccess', _2 => _2.coin98]) };}
|
|
430
432
|
} Coin98.__initStatic(); Coin98.__initStatic2();
|
|
431
433
|
|
|
432
|
-
function _optionalChain$
|
|
434
|
+
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; }
|
|
433
435
|
class Coinbase extends WindowEthereum {
|
|
434
436
|
|
|
435
437
|
static __initStatic() {this.info = {
|
|
@@ -438,10 +440,26 @@
|
|
|
438
440
|
blockchains: supported$1.evm
|
|
439
441
|
};}
|
|
440
442
|
|
|
441
|
-
|
|
443
|
+
getProvider() {
|
|
444
|
+
if(_optionalChain$d([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) {
|
|
445
|
+
return _optionalChain$d([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')])
|
|
446
|
+
} else {
|
|
447
|
+
return window.ethereum
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
static __initStatic2() {this.isAvailable = async()=>{
|
|
452
|
+
return(
|
|
453
|
+
(
|
|
454
|
+
_optionalChain$d([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$d([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink])
|
|
455
|
+
) || (
|
|
456
|
+
_optionalChain$d([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')])
|
|
457
|
+
)
|
|
458
|
+
)
|
|
459
|
+
};}
|
|
442
460
|
} Coinbase.__initStatic(); Coinbase.__initStatic2();
|
|
443
461
|
|
|
444
|
-
function _optionalChain$
|
|
462
|
+
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; }
|
|
445
463
|
class CryptoCom extends WindowEthereum {
|
|
446
464
|
|
|
447
465
|
static __initStatic() {this.info = {
|
|
@@ -450,10 +468,10 @@
|
|
|
450
468
|
blockchains: supported$1.evm
|
|
451
469
|
};}
|
|
452
470
|
|
|
453
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
471
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
|
|
454
472
|
} CryptoCom.__initStatic(); CryptoCom.__initStatic2();
|
|
455
473
|
|
|
456
|
-
function _optionalChain$
|
|
474
|
+
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; }
|
|
457
475
|
class HyperPay extends WindowEthereum {
|
|
458
476
|
|
|
459
477
|
static __initStatic() {this.info = {
|
|
@@ -462,10 +480,10 @@
|
|
|
462
480
|
blockchains: supported$1.evm
|
|
463
481
|
};}
|
|
464
482
|
|
|
465
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
483
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$b([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };}
|
|
466
484
|
} HyperPay.__initStatic(); HyperPay.__initStatic2();
|
|
467
485
|
|
|
468
|
-
function _optionalChain$
|
|
486
|
+
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; }
|
|
469
487
|
class MetaMask extends WindowEthereum {
|
|
470
488
|
|
|
471
489
|
static __initStatic() {this.info = {
|
|
@@ -474,15 +492,27 @@
|
|
|
474
492
|
blockchains: supported$1.evm
|
|
475
493
|
};}
|
|
476
494
|
|
|
477
|
-
|
|
495
|
+
getProvider() {
|
|
496
|
+
if(_optionalChain$a([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) {
|
|
497
|
+
return _optionalChain$a([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')])
|
|
498
|
+
} else {
|
|
499
|
+
return window.ethereum
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
static __initStatic2() {this.isAvailable = async()=>{
|
|
478
504
|
return(
|
|
479
|
-
|
|
480
|
-
|
|
505
|
+
(
|
|
506
|
+
_optionalChain$a([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) &&
|
|
507
|
+
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1
|
|
508
|
+
) || (
|
|
509
|
+
_optionalChain$a([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')])
|
|
510
|
+
)
|
|
481
511
|
)
|
|
482
512
|
};}
|
|
483
513
|
} MetaMask.__initStatic(); MetaMask.__initStatic2();
|
|
484
514
|
|
|
485
|
-
function _optionalChain$
|
|
515
|
+
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; }
|
|
486
516
|
class Opera extends WindowEthereum {
|
|
487
517
|
|
|
488
518
|
static __initStatic() {this.info = {
|
|
@@ -491,10 +521,10 @@
|
|
|
491
521
|
blockchains: supported$1.evm
|
|
492
522
|
};}
|
|
493
523
|
|
|
494
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
524
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
|
|
495
525
|
} Opera.__initStatic(); Opera.__initStatic2();
|
|
496
526
|
|
|
497
|
-
function _optionalChain$
|
|
527
|
+
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; }
|
|
498
528
|
class Rabby extends WindowEthereum {
|
|
499
529
|
|
|
500
530
|
static __initStatic() {this.info = {
|
|
@@ -505,12 +535,12 @@
|
|
|
505
535
|
|
|
506
536
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
507
537
|
return(
|
|
508
|
-
_optionalChain$
|
|
538
|
+
_optionalChain$8([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby])
|
|
509
539
|
)
|
|
510
540
|
};}
|
|
511
541
|
} Rabby.__initStatic(); Rabby.__initStatic2();
|
|
512
542
|
|
|
513
|
-
function _optionalChain$
|
|
543
|
+
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; }
|
|
514
544
|
class TokenPocket extends WindowEthereum {
|
|
515
545
|
|
|
516
546
|
static __initStatic() {this.info = {
|
|
@@ -521,12 +551,12 @@
|
|
|
521
551
|
|
|
522
552
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
523
553
|
return (
|
|
524
|
-
_optionalChain$
|
|
554
|
+
_optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket])
|
|
525
555
|
)
|
|
526
556
|
};}
|
|
527
557
|
} TokenPocket.__initStatic(); TokenPocket.__initStatic2();
|
|
528
558
|
|
|
529
|
-
function _optionalChain$
|
|
559
|
+
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; }
|
|
530
560
|
class Trust extends WindowEthereum {
|
|
531
561
|
|
|
532
562
|
static __initStatic() {this.info = {
|
|
@@ -537,7 +567,7 @@
|
|
|
537
567
|
|
|
538
568
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
539
569
|
return (
|
|
540
|
-
(_optionalChain$
|
|
570
|
+
(_optionalChain$6([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$6([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) &&
|
|
541
571
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!Debug)(?!TrustWallet)(?!MetaMask)(?!PocketUniverse)(?!RevokeCash)/)).length == 1
|
|
542
572
|
)
|
|
543
573
|
};}
|
|
@@ -632,7 +662,7 @@
|
|
|
632
662
|
}
|
|
633
663
|
};
|
|
634
664
|
|
|
635
|
-
function _optionalChain$
|
|
665
|
+
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; }
|
|
636
666
|
|
|
637
667
|
const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
638
668
|
transaction = new Transaction(transaction);
|
|
@@ -644,6 +674,7 @@
|
|
|
644
674
|
let transactionCount = await wallet.transactionCount({ blockchain: transaction.blockchain, address: transaction.from });
|
|
645
675
|
transaction.nonce = transactionCount;
|
|
646
676
|
await submit$2({ transaction, wallet }).then((tx)=>{
|
|
677
|
+
console.log('tx', tx);
|
|
647
678
|
if (tx) {
|
|
648
679
|
let blockchain = Blockchains__default['default'].findByName(transaction.blockchain);
|
|
649
680
|
transaction.id = tx;
|
|
@@ -653,7 +684,7 @@
|
|
|
653
684
|
transaction.id = sentTransaction.hash || transaction.id;
|
|
654
685
|
transaction.url = blockchain.explorerUrlFor({ transaction });
|
|
655
686
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
656
|
-
sentTransaction
|
|
687
|
+
retrieveConfirmedTransaction$2(sentTransaction).then(()=>{
|
|
657
688
|
transaction._succeeded = true;
|
|
658
689
|
if (transaction.succeeded) transaction.succeeded(transaction);
|
|
659
690
|
}).catch((error)=>{
|
|
@@ -680,6 +711,23 @@
|
|
|
680
711
|
return transaction
|
|
681
712
|
};
|
|
682
713
|
|
|
714
|
+
const retrieveConfirmedTransaction$2 = (sentTransaction)=>{
|
|
715
|
+
return new Promise((resolve, reject)=>{
|
|
716
|
+
|
|
717
|
+
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
718
|
+
if(_optionalChain$5([error, 'optionalAccess', _ => _.toString, 'call', _2 => _2()]) === "TypeError: Cannot read properties of undefined (reading 'message')") {
|
|
719
|
+
setTimeout(()=>{
|
|
720
|
+
retrieveConfirmedTransaction$2(sentTransaction)
|
|
721
|
+
.then(resolve)
|
|
722
|
+
.catch(reject);
|
|
723
|
+
}, 500);
|
|
724
|
+
} else {
|
|
725
|
+
reject(error);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
})
|
|
729
|
+
};
|
|
730
|
+
|
|
683
731
|
const retrieveTransaction$1 = async ({ blockchain, tx, smartContractWallet })=>{
|
|
684
732
|
const provider = await web3ClientEvm.getProvider(blockchain);
|
|
685
733
|
let retrieve = async()=>{
|
|
@@ -712,7 +760,7 @@
|
|
|
712
760
|
const submitContractInteraction$2 = async ({ transaction, wallet })=>{
|
|
713
761
|
const provider = await web3ClientEvm.getProvider(transaction.blockchain);
|
|
714
762
|
let gasPrice = await provider.getGasPrice();
|
|
715
|
-
if(_optionalChain$
|
|
763
|
+
if(_optionalChain$5([wallet, 'access', _3 => _3.session, 'optionalAccess', _4 => _4.peerMeta, 'optionalAccess', _5 => _5.name]) === 'Uniswap Wallet') {
|
|
716
764
|
gasPrice = undefined;
|
|
717
765
|
} else {
|
|
718
766
|
gasPrice = gasPrice.toHexString();
|
|
@@ -736,7 +784,7 @@
|
|
|
736
784
|
const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
|
|
737
785
|
const provider = await web3ClientEvm.getProvider(transaction.blockchain);
|
|
738
786
|
let gasPrice = await provider.getGasPrice();
|
|
739
|
-
if(_optionalChain$
|
|
787
|
+
if(_optionalChain$5([wallet, 'access', _6 => _6.session, 'optionalAccess', _7 => _7.peerMeta, 'optionalAccess', _8 => _8.name]) === 'Uniswap Wallet') {
|
|
740
788
|
gasPrice = undefined;
|
|
741
789
|
} else {
|
|
742
790
|
gasPrice = gasPrice.toHexString();
|
|
@@ -755,7 +803,7 @@
|
|
|
755
803
|
})
|
|
756
804
|
};
|
|
757
805
|
|
|
758
|
-
function _optionalChain$
|
|
806
|
+
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; }
|
|
759
807
|
|
|
760
808
|
const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
|
|
761
809
|
|
|
@@ -898,8 +946,8 @@
|
|
|
898
946
|
let session = await this.connector.connect();
|
|
899
947
|
this.session = session;
|
|
900
948
|
|
|
901
|
-
if(_optionalChain$
|
|
902
|
-
if(_optionalChain$
|
|
949
|
+
if(_optionalChain$4([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; }
|
|
950
|
+
if(_optionalChain$4([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; }
|
|
903
951
|
|
|
904
952
|
if(session.accounts instanceof Array && session.accounts.length) {
|
|
905
953
|
setConnectedInstance$1(this);
|
|
@@ -1043,7 +1091,7 @@
|
|
|
1043
1091
|
WalletConnectV1.getConnectedInstance = getConnectedInstance$2;
|
|
1044
1092
|
WalletConnectV1.setConnectedInstance = setConnectedInstance$1;
|
|
1045
1093
|
|
|
1046
|
-
function _optionalChain$
|
|
1094
|
+
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; }
|
|
1047
1095
|
|
|
1048
1096
|
const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
1049
1097
|
transaction = new Transaction(transaction);
|
|
@@ -1066,7 +1114,7 @@
|
|
|
1066
1114
|
console.log('Error retrieving transaction');
|
|
1067
1115
|
if(transaction.failed) transaction.failed(transaction, 'Error retrieving transaction');
|
|
1068
1116
|
} else {
|
|
1069
|
-
sentTransaction
|
|
1117
|
+
retrieveConfirmedTransaction$1(sentTransaction).then(() => {
|
|
1070
1118
|
transaction._succeeded = true;
|
|
1071
1119
|
if (transaction.succeeded) transaction.succeeded(transaction);
|
|
1072
1120
|
}).catch((error)=>{
|
|
@@ -1093,6 +1141,23 @@
|
|
|
1093
1141
|
return transaction
|
|
1094
1142
|
};
|
|
1095
1143
|
|
|
1144
|
+
const retrieveConfirmedTransaction$1 = (sentTransaction)=>{
|
|
1145
|
+
return new Promise((resolve, reject)=>{
|
|
1146
|
+
|
|
1147
|
+
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
1148
|
+
if(_optionalChain$3([error, 'optionalAccess', _ => _.toString, 'call', _2 => _2()]) === "TypeError: Cannot read properties of undefined (reading 'message')") {
|
|
1149
|
+
setTimeout(()=>{
|
|
1150
|
+
retrieveConfirmedTransaction$1(sentTransaction)
|
|
1151
|
+
.then(resolve)
|
|
1152
|
+
.catch(reject);
|
|
1153
|
+
}, 500);
|
|
1154
|
+
} else {
|
|
1155
|
+
reject(error);
|
|
1156
|
+
}
|
|
1157
|
+
});
|
|
1158
|
+
})
|
|
1159
|
+
};
|
|
1160
|
+
|
|
1096
1161
|
const retrieveTransaction = async (tx, blockchain)=>{
|
|
1097
1162
|
let sentTransaction;
|
|
1098
1163
|
const provider = await web3ClientEvm.getProvider(blockchain);
|
|
@@ -1128,7 +1193,7 @@
|
|
|
1128
1193
|
params: [{
|
|
1129
1194
|
from: transaction.from,
|
|
1130
1195
|
to: transaction.to,
|
|
1131
|
-
value: _optionalChain$
|
|
1196
|
+
value: _optionalChain$3([transaction, 'access', _3 => _3.value, 'optionalAccess', _4 => _4.toString, 'call', _5 => _5()]),
|
|
1132
1197
|
data: await transaction.getData(),
|
|
1133
1198
|
gas: gas.toHexString(),
|
|
1134
1199
|
gasPrice: gasPrice.toHexString(),
|
|
@@ -1151,7 +1216,7 @@
|
|
|
1151
1216
|
params: [{
|
|
1152
1217
|
from: transaction.from,
|
|
1153
1218
|
to: transaction.to,
|
|
1154
|
-
value: _optionalChain$
|
|
1219
|
+
value: _optionalChain$3([transaction, 'access', _6 => _6.value, 'optionalAccess', _7 => _7.toString, 'call', _8 => _8()]),
|
|
1155
1220
|
gas: gas.toHexString(),
|
|
1156
1221
|
gasPrice: gasPrice.toHexString(),
|
|
1157
1222
|
nonce: transaction.nonce
|
|
@@ -1160,7 +1225,7 @@
|
|
|
1160
1225
|
}).catch((e)=>{console.log('ERROR', e);})
|
|
1161
1226
|
};
|
|
1162
1227
|
|
|
1163
|
-
function _optionalChain$
|
|
1228
|
+
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; }
|
|
1164
1229
|
|
|
1165
1230
|
const KEY = 'depay:wallets:wc2';
|
|
1166
1231
|
|
|
@@ -1263,11 +1328,11 @@
|
|
|
1263
1328
|
};
|
|
1264
1329
|
|
|
1265
1330
|
const getWalletConnectV2Config = (walletName)=>{
|
|
1266
|
-
const methods = _optionalChain$
|
|
1267
|
-
const events = _optionalChain$
|
|
1331
|
+
const methods = _optionalChain$2([CONFIGURATIONS, 'access', _ => _[walletName], 'optionalAccess', _2 => _2.methods]) || DEFAULT_CONFIGURATION.methods;
|
|
1332
|
+
const events = _optionalChain$2([CONFIGURATIONS, 'access', _3 => _3[walletName], 'optionalAccess', _4 => _4.events]) || DEFAULT_CONFIGURATION.events;
|
|
1268
1333
|
|
|
1269
1334
|
let requiredNamespaces = {};
|
|
1270
|
-
if(_optionalChain$
|
|
1335
|
+
if(_optionalChain$2([CONFIGURATIONS, 'access', _5 => _5[walletName], 'optionalAccess', _6 => _6.requiredNamespaces])) {
|
|
1271
1336
|
requiredNamespaces = CONFIGURATIONS[walletName].requiredNamespaces;
|
|
1272
1337
|
} else {
|
|
1273
1338
|
requiredNamespaces['eip155'] = {
|
|
@@ -1278,14 +1343,14 @@
|
|
|
1278
1343
|
requiredNamespaces['eip155'].events = events;
|
|
1279
1344
|
|
|
1280
1345
|
let optionalNamespaces = {};
|
|
1281
|
-
if(_optionalChain$
|
|
1346
|
+
if(_optionalChain$2([CONFIGURATIONS, 'access', _7 => _7[walletName], 'optionalAccess', _8 => _8.optionalNamespaces])) {
|
|
1282
1347
|
optionalNamespaces = CONFIGURATIONS[walletName].optionalNamespaces;
|
|
1283
1348
|
} else {
|
|
1284
1349
|
optionalNamespaces['eip155'] = {
|
|
1285
1350
|
chains: supported$1.evm.map((blockchain)=>`${Blockchains__default['default'][blockchain].namespace}:${Blockchains__default['default'][blockchain].networkId}`),
|
|
1286
1351
|
};
|
|
1287
1352
|
}
|
|
1288
|
-
if(_optionalChain$
|
|
1353
|
+
if(_optionalChain$2([optionalNamespaces, 'optionalAccess', _9 => _9.eip155]) && _optionalChain$2([optionalNamespaces, 'optionalAccess', _10 => _10.eip155, 'optionalAccess', _11 => _11.chains, 'optionalAccess', _12 => _12.length])) {
|
|
1289
1354
|
optionalNamespaces['eip155'].methods = methods;
|
|
1290
1355
|
optionalNamespaces['eip155'].events = events;
|
|
1291
1356
|
}
|
|
@@ -1300,9 +1365,9 @@
|
|
|
1300
1365
|
projectId: localStorage[KEY+":projectId"],
|
|
1301
1366
|
metadata: {
|
|
1302
1367
|
name: document.title || 'dApp',
|
|
1303
|
-
description: _optionalChain$
|
|
1368
|
+
description: _optionalChain$2([document, 'access', _13 => _13.querySelector, 'call', _14 => _14('meta[name="description"]'), 'optionalAccess', _15 => _15.getAttribute, 'call', _16 => _16('content')]) || document.title || 'dApp',
|
|
1304
1369
|
url: location.href,
|
|
1305
|
-
icons: [_optionalChain$
|
|
1370
|
+
icons: [_optionalChain$2([document, 'access', _17 => _17.querySelector, 'call', _18 => _18("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _19 => _19.href]) || `${location.origin}/favicon.ico`]
|
|
1306
1371
|
}
|
|
1307
1372
|
});
|
|
1308
1373
|
resolve(signClient);
|
|
@@ -1320,7 +1385,7 @@
|
|
|
1320
1385
|
};}
|
|
1321
1386
|
|
|
1322
1387
|
static __initStatic2() {this.isAvailable = async(options)=>{
|
|
1323
|
-
return !! await getLastSession(_optionalChain$
|
|
1388
|
+
return !! await getLastSession(_optionalChain$2([options, 'optionalAccess', _21 => _21.walletName]))
|
|
1324
1389
|
};}
|
|
1325
1390
|
|
|
1326
1391
|
constructor() {
|
|
@@ -1335,19 +1400,19 @@
|
|
|
1335
1400
|
}
|
|
1336
1401
|
|
|
1337
1402
|
async account() {
|
|
1338
|
-
if(_optionalChain$
|
|
1403
|
+
if(_optionalChain$2([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.namespaces, 'optionalAccess', _24 => _24.eip155, 'optionalAccess', _25 => _25.accounts, 'optionalAccess', _26 => _26.length])) {
|
|
1339
1404
|
return this.session.namespaces.eip155.accounts[0].split(':')[2]
|
|
1340
1405
|
}
|
|
1341
1406
|
}
|
|
1342
1407
|
|
|
1343
1408
|
async setSessionBlockchains() {
|
|
1344
1409
|
if(!this.session) { return }
|
|
1345
|
-
if(_optionalChain$
|
|
1346
|
-
this.blockchains = [this.session.namespaces.eip155.chains[this.session.namespaces.eip155.chains.length-1]].map((chainIdentifier)=>_optionalChain$
|
|
1410
|
+
if(_optionalChain$2([CONFIGURATIONS, 'access', _27 => _27[this.walletName], 'optionalAccess', _28 => _28.methods, 'optionalAccess', _29 => _29.includes, 'call', _30 => _30('wallet_switchEthereumChain')])) {
|
|
1411
|
+
this.blockchains = [this.session.namespaces.eip155.chains[this.session.namespaces.eip155.chains.length-1]].map((chainIdentifier)=>_optionalChain$2([Blockchains__default['default'], 'access', _31 => _31.findByNetworkId, 'call', _32 => _32(chainIdentifier.split(':')[1]), 'optionalAccess', _33 => _33.name])).filter(Boolean);
|
|
1347
1412
|
} else if(this.session.namespaces.eip155.chains) {
|
|
1348
|
-
this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$
|
|
1413
|
+
this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$2([Blockchains__default['default'], 'access', _34 => _34.findByNetworkId, 'call', _35 => _35(chainIdentifier.split(':')[1]), 'optionalAccess', _36 => _36.name])).filter(Boolean);
|
|
1349
1414
|
} else if(this.session.namespaces.eip155.accounts) {
|
|
1350
|
-
this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$
|
|
1415
|
+
this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$2([Blockchains__default['default'], 'access', _37 => _37.findByNetworkId, 'call', _38 => _38(accountIdentifier.split(':')[1]), 'optionalAccess', _39 => _39.name])).filter(Boolean);
|
|
1351
1416
|
}
|
|
1352
1417
|
}
|
|
1353
1418
|
|
|
@@ -1357,13 +1422,13 @@
|
|
|
1357
1422
|
|
|
1358
1423
|
try {
|
|
1359
1424
|
|
|
1360
|
-
this.walletName = _optionalChain$
|
|
1425
|
+
this.walletName = _optionalChain$2([options, 'optionalAccess', _40 => _40.name]);
|
|
1361
1426
|
|
|
1362
1427
|
// delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS
|
|
1363
1428
|
this.signClient = await getSignClient();
|
|
1364
1429
|
|
|
1365
1430
|
this.signClient.on("session_delete", (session)=> {
|
|
1366
|
-
if(_optionalChain$
|
|
1431
|
+
if(_optionalChain$2([session, 'optionalAccess', _41 => _41.topic]) === _optionalChain$2([this, 'access', _42 => _42.session, 'optionalAccess', _43 => _43.topic])) {
|
|
1367
1432
|
localStorage[KEY+':name'] = undefined;
|
|
1368
1433
|
localStorage[KEY+':logo'] = undefined;
|
|
1369
1434
|
this.signClient = undefined;
|
|
@@ -1372,14 +1437,14 @@
|
|
|
1372
1437
|
});
|
|
1373
1438
|
|
|
1374
1439
|
this.signClient.on("session_update", async(session)=> {
|
|
1375
|
-
if(_optionalChain$
|
|
1440
|
+
if(_optionalChain$2([session, 'optionalAccess', _44 => _44.topic]) === _optionalChain$2([this, 'access', _45 => _45.session, 'optionalAccess', _46 => _46.topic])) {
|
|
1376
1441
|
this.session = this.signClient.session.get(session.topic);
|
|
1377
1442
|
await this.setSessionBlockchains();
|
|
1378
1443
|
}
|
|
1379
1444
|
});
|
|
1380
1445
|
|
|
1381
1446
|
this.signClient.on("session_event", (event)=> {
|
|
1382
|
-
if(_optionalChain$
|
|
1447
|
+
if(_optionalChain$2([event, 'optionalAccess', _47 => _47.topic]) === _optionalChain$2([this, 'access', _48 => _48.session, 'optionalAccess', _49 => _49.topic])) {}
|
|
1383
1448
|
});
|
|
1384
1449
|
|
|
1385
1450
|
const connectWallet = async()=>{
|
|
@@ -1390,24 +1455,24 @@
|
|
|
1390
1455
|
await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect
|
|
1391
1456
|
};
|
|
1392
1457
|
|
|
1393
|
-
const lastSession = _optionalChain$
|
|
1458
|
+
const lastSession = _optionalChain$2([this, 'optionalAccess', _50 => _50.walletName, 'optionalAccess', _51 => _51.length]) ? await getLastSession(this.walletName) : undefined;
|
|
1394
1459
|
if(lastSession) {
|
|
1395
1460
|
this.session = lastSession;
|
|
1396
1461
|
} else {
|
|
1397
1462
|
await connectWallet();
|
|
1398
1463
|
}
|
|
1399
1464
|
|
|
1400
|
-
let meta = _optionalChain$
|
|
1465
|
+
let meta = _optionalChain$2([this, 'access', _52 => _52.session, 'optionalAccess', _53 => _53.peer, 'optionalAccess', _54 => _54.metadata]);
|
|
1401
1466
|
if(meta && meta.name) {
|
|
1402
1467
|
this.name = meta.name;
|
|
1403
1468
|
localStorage[KEY+':name'] = meta.name;
|
|
1404
|
-
if(_optionalChain$
|
|
1469
|
+
if(_optionalChain$2([meta, 'optionalAccess', _55 => _55.icons]) && meta.icons.length) {
|
|
1405
1470
|
this.logo = meta.icons[0];
|
|
1406
1471
|
localStorage[KEY+':logo'] = this.logo;
|
|
1407
1472
|
}
|
|
1408
1473
|
}
|
|
1409
|
-
if(_optionalChain$
|
|
1410
|
-
if(_optionalChain$
|
|
1474
|
+
if(_optionalChain$2([options, 'optionalAccess', _56 => _56.name])) { localStorage[KEY+':name'] = this.name = options.name; }
|
|
1475
|
+
if(_optionalChain$2([options, 'optionalAccess', _57 => _57.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; }
|
|
1411
1476
|
|
|
1412
1477
|
await this.setSessionBlockchains();
|
|
1413
1478
|
|
|
@@ -1464,7 +1529,7 @@
|
|
|
1464
1529
|
switch (event) {
|
|
1465
1530
|
case 'account':
|
|
1466
1531
|
internalCallback = async(event)=> {
|
|
1467
|
-
if(_optionalChain$
|
|
1532
|
+
if(_optionalChain$2([event, 'optionalAccess', _58 => _58.topic]) === _optionalChain$2([this, 'access', _59 => _59.session, 'optionalAccess', _60 => _60.topic]) && event.params.event.name === 'accountsChanged') {
|
|
1468
1533
|
callback(await this.account());
|
|
1469
1534
|
}
|
|
1470
1535
|
};
|
|
@@ -1524,6 +1589,7 @@
|
|
|
1524
1589
|
|
|
1525
1590
|
WalletConnectV2.getConnectedInstance = getConnectedInstance$1;
|
|
1526
1591
|
|
|
1592
|
+
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; }
|
|
1527
1593
|
const sendTransaction = async ({ transaction, wallet })=> {
|
|
1528
1594
|
transaction = new Transaction(transaction);
|
|
1529
1595
|
if((await wallet.connectedTo(transaction.blockchain)) == false) {
|
|
@@ -1541,7 +1607,7 @@
|
|
|
1541
1607
|
transaction.nonce = sentTransaction.nonce;
|
|
1542
1608
|
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
1543
1609
|
if (transaction.sent) transaction.sent(transaction);
|
|
1544
|
-
sentTransaction
|
|
1610
|
+
retrieveConfirmedTransaction(sentTransaction).then(() => {
|
|
1545
1611
|
transaction._succeeded = true;
|
|
1546
1612
|
if (transaction.succeeded) transaction.succeeded(transaction);
|
|
1547
1613
|
}).catch((error)=>{
|
|
@@ -1569,6 +1635,23 @@
|
|
|
1569
1635
|
return transaction
|
|
1570
1636
|
};
|
|
1571
1637
|
|
|
1638
|
+
const retrieveConfirmedTransaction = (sentTransaction)=>{
|
|
1639
|
+
return new Promise((resolve, reject)=>{
|
|
1640
|
+
|
|
1641
|
+
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
1642
|
+
if(_optionalChain$1([error, 'optionalAccess', _ => _.toString, 'call', _2 => _2()]) === "TypeError: Cannot read properties of undefined (reading 'message')") {
|
|
1643
|
+
setTimeout(()=>{
|
|
1644
|
+
retrieveConfirmedTransaction(sentTransaction)
|
|
1645
|
+
.then(resolve)
|
|
1646
|
+
.catch(reject);
|
|
1647
|
+
}, 500);
|
|
1648
|
+
} else {
|
|
1649
|
+
reject(error);
|
|
1650
|
+
}
|
|
1651
|
+
});
|
|
1652
|
+
})
|
|
1653
|
+
};
|
|
1654
|
+
|
|
1572
1655
|
const submit = ({ transaction, provider, signer }) => {
|
|
1573
1656
|
if(transaction.method) {
|
|
1574
1657
|
return submitContractInteraction({ transaction, signer, provider })
|