@depay/web3-wallets-evm 16.2.10 → 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 +179 -106
- package/dist/esm/index.js +195 -122
- package/dist/umd/index.evm.js +179 -106
- package/dist/umd/index.js +195 -122
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
var Blockchains__default = /*#__PURE__*/_interopDefaultLegacy(Blockchains);
|
|
10
10
|
|
|
11
|
-
function _optionalChain$
|
|
11
|
+
function _optionalChain$m(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; }
|
|
12
12
|
class Transaction {
|
|
13
13
|
|
|
14
14
|
constructor({
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
this.to = (to && to.match('0x')) ? ethers.ethers.utils.getAddress(to) : to;
|
|
34
34
|
|
|
35
35
|
// optional
|
|
36
|
-
this.value = _optionalChain$
|
|
36
|
+
this.value = _optionalChain$m([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
|
|
37
37
|
this.api = api;
|
|
38
38
|
this.method = method;
|
|
39
39
|
this.params = params;
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
getParamType(param) {
|
|
76
|
-
if(_optionalChain$
|
|
76
|
+
if(_optionalChain$m([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) {
|
|
77
77
|
return `(${param.components.map((param)=>this.getParamType(param)).join(',')})`
|
|
78
78
|
} else {
|
|
79
79
|
return param.type
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
function _optionalChain$
|
|
149
|
+
function _optionalChain$l(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; }
|
|
150
150
|
|
|
151
151
|
const POLL_SPEED = 500; // 0.5 seconds
|
|
152
152
|
const MAX_POLLS = 240; // 120 seconds
|
|
@@ -167,14 +167,14 @@
|
|
|
167
167
|
|
|
168
168
|
const provider = await web3Client.getProvider(transaction.blockchain);
|
|
169
169
|
const { value } = await provider.getSignatureStatus(signature);
|
|
170
|
-
const confirmationStatus = _optionalChain$
|
|
170
|
+
const confirmationStatus = _optionalChain$l([value, 'optionalAccess', _ => _.confirmationStatus]);
|
|
171
171
|
if(confirmationStatus) {
|
|
172
172
|
const hasReachedSufficientCommitment = confirmationStatus === 'confirmed' || confirmationStatus === 'finalized';
|
|
173
173
|
if (hasReachedSufficientCommitment) {
|
|
174
174
|
if(value.err) {
|
|
175
175
|
transaction._failed = true;
|
|
176
176
|
const confirmedTransaction = await provider.getConfirmedTransaction(signature);
|
|
177
|
-
const failedReason = _optionalChain$
|
|
177
|
+
const failedReason = _optionalChain$l([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null;
|
|
178
178
|
if(transaction.failed) transaction.failed(transaction, failedReason);
|
|
179
179
|
} else {
|
|
180
180
|
transaction._succeeded = true;
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
|
|
266
266
|
supported$1.solana = ['solana'];
|
|
267
267
|
|
|
268
|
-
function _optionalChain$
|
|
268
|
+
function _optionalChain$k(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; }
|
|
269
269
|
class WindowSolana {
|
|
270
270
|
|
|
271
271
|
static __initStatic() {this.info = {
|
|
@@ -276,13 +276,13 @@
|
|
|
276
276
|
|
|
277
277
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
278
278
|
return (
|
|
279
|
-
_optionalChain$
|
|
279
|
+
_optionalChain$k([window, 'optionalAccess', _5 => _5.solana]) &&
|
|
280
280
|
// not Phantom
|
|
281
281
|
!(window.phantom && !window.glow && !window.solana.isGlow && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) &&
|
|
282
282
|
// not Coin98
|
|
283
283
|
!window.coin98 &&
|
|
284
284
|
// not BitKeep
|
|
285
|
-
!(_optionalChain$
|
|
285
|
+
!(_optionalChain$k([window, 'optionalAccess', _6 => _6.solana]) && _optionalChain$k([window, 'optionalAccess', _7 => _7.solana, 'access', _8 => _8.isBitKeep])) &&
|
|
286
286
|
// not Glow
|
|
287
287
|
!window.solana.isGlow
|
|
288
288
|
)
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
let internalCallback;
|
|
332
332
|
switch (event) {
|
|
333
333
|
case 'account':
|
|
334
|
-
internalCallback = (publicKey) => callback(_optionalChain$
|
|
334
|
+
internalCallback = (publicKey) => callback(_optionalChain$k([publicKey, 'optionalAccess', _9 => _9.toString, 'call', _10 => _10()]));
|
|
335
335
|
this.getProvider().on('accountChanged', internalCallback);
|
|
336
336
|
break
|
|
337
337
|
}
|
|
@@ -384,7 +384,7 @@
|
|
|
384
384
|
}
|
|
385
385
|
} WindowSolana.__initStatic(); WindowSolana.__initStatic2();
|
|
386
386
|
|
|
387
|
-
function _optionalChain$
|
|
387
|
+
function _optionalChain$j(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; }
|
|
388
388
|
|
|
389
389
|
class Backpack extends WindowSolana {
|
|
390
390
|
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
|
|
397
397
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
398
398
|
return (
|
|
399
|
-
_optionalChain$
|
|
399
|
+
_optionalChain$j([window, 'optionalAccess', _2 => _2.backpack]) &&
|
|
400
400
|
window.backpack.isBackpack
|
|
401
401
|
)
|
|
402
402
|
};}
|
|
@@ -433,7 +433,7 @@
|
|
|
433
433
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
434
434
|
transaction.url = Blockchains__default['default'].findByName(transaction.blockchain).explorerUrlFor({ transaction });
|
|
435
435
|
if (transaction.sent) transaction.sent(transaction);
|
|
436
|
-
sentTransaction
|
|
436
|
+
retrieveConfirmedTransaction$3(sentTransaction).then(() => {
|
|
437
437
|
transaction._succeeded = true;
|
|
438
438
|
if (transaction.succeeded) transaction.succeeded(transaction);
|
|
439
439
|
}).catch((error)=>{
|
|
@@ -461,6 +461,35 @@
|
|
|
461
461
|
return transaction
|
|
462
462
|
};
|
|
463
463
|
|
|
464
|
+
const retrieveConfirmedTransaction$3 = (sentTransaction)=>{
|
|
465
|
+
return new Promise((resolve, reject)=>{
|
|
466
|
+
try {
|
|
467
|
+
|
|
468
|
+
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
469
|
+
if(error && error.toString().match('undefined')) {
|
|
470
|
+
setTimeout(()=>{
|
|
471
|
+
retrieveConfirmedTransaction$3(sentTransaction)
|
|
472
|
+
.then(resolve)
|
|
473
|
+
.catch(reject);
|
|
474
|
+
}, 500);
|
|
475
|
+
} else {
|
|
476
|
+
reject(error);
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
} catch(error) {
|
|
480
|
+
if(error && error.toString().match('undefined')) {
|
|
481
|
+
setTimeout(()=>{
|
|
482
|
+
retrieveConfirmedTransaction$3(sentTransaction)
|
|
483
|
+
.then(resolve)
|
|
484
|
+
.catch(reject);
|
|
485
|
+
}, 500);
|
|
486
|
+
} else {
|
|
487
|
+
reject(error);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
})
|
|
491
|
+
};
|
|
492
|
+
|
|
464
493
|
const submit$3 = ({ transaction, provider, signer }) => {
|
|
465
494
|
if(transaction.method) {
|
|
466
495
|
return submitContractInteraction$3({ transaction, signer, provider })
|
|
@@ -491,7 +520,7 @@
|
|
|
491
520
|
})
|
|
492
521
|
};
|
|
493
522
|
|
|
494
|
-
function _optionalChain$
|
|
523
|
+
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; }
|
|
495
524
|
|
|
496
525
|
class WindowEthereum {
|
|
497
526
|
|
|
@@ -503,31 +532,31 @@
|
|
|
503
532
|
|
|
504
533
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
505
534
|
return (
|
|
506
|
-
_optionalChain$
|
|
535
|
+
_optionalChain$i([window, 'optionalAccess', _31 => _31.ethereum]) &&
|
|
507
536
|
// not MetaMask
|
|
508
|
-
!(_optionalChain$
|
|
537
|
+
!(_optionalChain$i([window, 'optionalAccess', _32 => _32.ethereum, 'optionalAccess', _33 => _33.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) &&
|
|
509
538
|
// not Coin98
|
|
510
|
-
!_optionalChain$
|
|
539
|
+
!_optionalChain$i([window, 'optionalAccess', _34 => _34.coin98]) &&
|
|
511
540
|
// not Trust Wallet
|
|
512
|
-
!(_optionalChain$
|
|
541
|
+
!(_optionalChain$i([window, 'optionalAccess', _35 => _35.ethereum, 'optionalAccess', _36 => _36.isTrust]) || _optionalChain$i([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isTrustWallet])) &&
|
|
513
542
|
// not crypto.com
|
|
514
|
-
!_optionalChain$
|
|
543
|
+
!_optionalChain$i([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isDeficonnectProvider]) &&
|
|
515
544
|
// not HyperPay
|
|
516
|
-
!_optionalChain$
|
|
545
|
+
!_optionalChain$i([window, 'optionalAccess', _41 => _41.ethereum, 'optionalAccess', _42 => _42.isHyperPay]) &&
|
|
517
546
|
// not Phantom
|
|
518
|
-
!(window.phantom && !window.glow && !_optionalChain$
|
|
547
|
+
!(window.phantom && !window.glow && !_optionalChain$i([window, 'optionalAccess', _43 => _43.solana, 'optionalAccess', _44 => _44.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) &&
|
|
519
548
|
// not Rabby
|
|
520
|
-
!_optionalChain$
|
|
549
|
+
!_optionalChain$i([window, 'optionalAccess', _45 => _45.ethereum, 'optionalAccess', _46 => _46.isRabby]) &&
|
|
521
550
|
// not Backpack
|
|
522
|
-
!_optionalChain$
|
|
551
|
+
!_optionalChain$i([window, 'optionalAccess', _47 => _47.backpack, 'optionalAccess', _48 => _48.isBackpack]) &&
|
|
523
552
|
// not TokenPocket
|
|
524
|
-
!_optionalChain$
|
|
553
|
+
!_optionalChain$i([window, 'optionalAccess', _49 => _49.ethereum, 'optionalAccess', _50 => _50.isTokenPocket]) &&
|
|
525
554
|
// not BitKeep
|
|
526
|
-
!_optionalChain$
|
|
555
|
+
!_optionalChain$i([window, 'optionalAccess', _51 => _51.ethereum, 'optionalAccess', _52 => _52.isBitKeep]) &&
|
|
527
556
|
// not Coinbase
|
|
528
|
-
!(_optionalChain$
|
|
557
|
+
!(_optionalChain$i([window, 'optionalAccess', _53 => _53.ethereum, 'optionalAccess', _54 => _54.isCoinbaseWallet]) || _optionalChain$i([window, 'optionalAccess', _55 => _55.ethereum, 'optionalAccess', _56 => _56.isWalletLink])) &&
|
|
529
558
|
// MetaMask through ProviderMap
|
|
530
|
-
!_optionalChain$
|
|
559
|
+
!_optionalChain$i([window, 'optionalAccess', _57 => _57.ethereum, 'optionalAccess', _58 => _58.providerMap, 'optionalAccess', _59 => _59.has, 'call', _60 => _60('MetaMask')])
|
|
531
560
|
)
|
|
532
561
|
};}
|
|
533
562
|
|
|
@@ -653,7 +682,7 @@
|
|
|
653
682
|
}
|
|
654
683
|
} WindowEthereum.__initStatic(); WindowEthereum.__initStatic2();
|
|
655
684
|
|
|
656
|
-
function _optionalChain$
|
|
685
|
+
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; }
|
|
657
686
|
class Binance extends WindowEthereum {
|
|
658
687
|
|
|
659
688
|
static __initStatic() {this.info = {
|
|
@@ -663,7 +692,7 @@
|
|
|
663
692
|
};}
|
|
664
693
|
|
|
665
694
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
666
|
-
return _optionalChain$
|
|
695
|
+
return _optionalChain$h([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
|
|
667
696
|
!window.coin98
|
|
668
697
|
};}
|
|
669
698
|
|
|
@@ -671,7 +700,7 @@
|
|
|
671
700
|
|
|
672
701
|
} Binance.__initStatic(); Binance.__initStatic2();
|
|
673
702
|
|
|
674
|
-
function _optionalChain$
|
|
703
|
+
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; }
|
|
675
704
|
class Brave extends WindowEthereum {
|
|
676
705
|
|
|
677
706
|
static __initStatic() {this.info = {
|
|
@@ -680,10 +709,10 @@
|
|
|
680
709
|
blockchains: supported$1.evm
|
|
681
710
|
};}
|
|
682
711
|
|
|
683
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
712
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$g([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
|
|
684
713
|
} Brave.__initStatic(); Brave.__initStatic2();
|
|
685
714
|
|
|
686
|
-
function _optionalChain$
|
|
715
|
+
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; }
|
|
687
716
|
class Coin98 extends WindowEthereum {
|
|
688
717
|
|
|
689
718
|
static __initStatic() {this.info = {
|
|
@@ -692,10 +721,10 @@
|
|
|
692
721
|
blockchains: supported$1.evm
|
|
693
722
|
};}
|
|
694
723
|
|
|
695
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
724
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _2 => _2.coin98]) };}
|
|
696
725
|
} Coin98.__initStatic(); Coin98.__initStatic2();
|
|
697
726
|
|
|
698
|
-
function _optionalChain$
|
|
727
|
+
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; }
|
|
699
728
|
class Coinbase extends WindowEthereum {
|
|
700
729
|
|
|
701
730
|
static __initStatic() {this.info = {
|
|
@@ -705,8 +734,8 @@
|
|
|
705
734
|
};}
|
|
706
735
|
|
|
707
736
|
getProvider() {
|
|
708
|
-
if(_optionalChain$
|
|
709
|
-
return _optionalChain$
|
|
737
|
+
if(_optionalChain$e([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) {
|
|
738
|
+
return _optionalChain$e([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')])
|
|
710
739
|
} else {
|
|
711
740
|
return window.ethereum
|
|
712
741
|
}
|
|
@@ -715,15 +744,15 @@
|
|
|
715
744
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
716
745
|
return(
|
|
717
746
|
(
|
|
718
|
-
_optionalChain$
|
|
747
|
+
_optionalChain$e([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$e([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink])
|
|
719
748
|
) || (
|
|
720
|
-
_optionalChain$
|
|
749
|
+
_optionalChain$e([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')])
|
|
721
750
|
)
|
|
722
751
|
)
|
|
723
752
|
};}
|
|
724
753
|
} Coinbase.__initStatic(); Coinbase.__initStatic2();
|
|
725
754
|
|
|
726
|
-
function _optionalChain$
|
|
755
|
+
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; }
|
|
727
756
|
class CryptoCom extends WindowEthereum {
|
|
728
757
|
|
|
729
758
|
static __initStatic() {this.info = {
|
|
@@ -732,7 +761,7 @@
|
|
|
732
761
|
blockchains: supported$1.evm
|
|
733
762
|
};}
|
|
734
763
|
|
|
735
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
764
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$d([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
|
|
736
765
|
} CryptoCom.__initStatic(); CryptoCom.__initStatic2();
|
|
737
766
|
|
|
738
767
|
class Glow extends WindowSolana {
|
|
@@ -751,7 +780,7 @@
|
|
|
751
780
|
};}
|
|
752
781
|
} Glow.__initStatic(); Glow.__initStatic2();
|
|
753
782
|
|
|
754
|
-
function _optionalChain$
|
|
783
|
+
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; }
|
|
755
784
|
class HyperPay extends WindowEthereum {
|
|
756
785
|
|
|
757
786
|
static __initStatic() {this.info = {
|
|
@@ -760,10 +789,10 @@
|
|
|
760
789
|
blockchains: supported$1.evm
|
|
761
790
|
};}
|
|
762
791
|
|
|
763
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
792
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };}
|
|
764
793
|
} HyperPay.__initStatic(); HyperPay.__initStatic2();
|
|
765
794
|
|
|
766
|
-
function _optionalChain$
|
|
795
|
+
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; }
|
|
767
796
|
class MetaMask extends WindowEthereum {
|
|
768
797
|
|
|
769
798
|
static __initStatic() {this.info = {
|
|
@@ -773,8 +802,8 @@
|
|
|
773
802
|
};}
|
|
774
803
|
|
|
775
804
|
getProvider() {
|
|
776
|
-
if(_optionalChain$
|
|
777
|
-
return _optionalChain$
|
|
805
|
+
if(_optionalChain$b([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) {
|
|
806
|
+
return _optionalChain$b([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')])
|
|
778
807
|
} else {
|
|
779
808
|
return window.ethereum
|
|
780
809
|
}
|
|
@@ -783,16 +812,16 @@
|
|
|
783
812
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
784
813
|
return(
|
|
785
814
|
(
|
|
786
|
-
_optionalChain$
|
|
815
|
+
_optionalChain$b([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) &&
|
|
787
816
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1
|
|
788
817
|
) || (
|
|
789
|
-
_optionalChain$
|
|
818
|
+
_optionalChain$b([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')])
|
|
790
819
|
)
|
|
791
820
|
)
|
|
792
821
|
};}
|
|
793
822
|
} MetaMask.__initStatic(); MetaMask.__initStatic2();
|
|
794
823
|
|
|
795
|
-
function _optionalChain$
|
|
824
|
+
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; }
|
|
796
825
|
class Opera extends WindowEthereum {
|
|
797
826
|
|
|
798
827
|
static __initStatic() {this.info = {
|
|
@@ -801,10 +830,10 @@
|
|
|
801
830
|
blockchains: supported$1.evm
|
|
802
831
|
};}
|
|
803
832
|
|
|
804
|
-
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$
|
|
833
|
+
static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$a([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
|
|
805
834
|
} Opera.__initStatic(); Opera.__initStatic2();
|
|
806
835
|
|
|
807
|
-
function _optionalChain$
|
|
836
|
+
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; }
|
|
808
837
|
class Phantom extends WindowSolana {
|
|
809
838
|
|
|
810
839
|
static __initStatic() {this.info = {
|
|
@@ -817,13 +846,13 @@
|
|
|
817
846
|
return (
|
|
818
847
|
window.phantom &&
|
|
819
848
|
!window.glow &&
|
|
820
|
-
!_optionalChain$
|
|
849
|
+
!_optionalChain$9([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isGlow]) &&
|
|
821
850
|
!['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])
|
|
822
851
|
)
|
|
823
852
|
};}
|
|
824
853
|
} Phantom.__initStatic(); Phantom.__initStatic2();
|
|
825
854
|
|
|
826
|
-
function _optionalChain$
|
|
855
|
+
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; }
|
|
827
856
|
class Rabby extends WindowEthereum {
|
|
828
857
|
|
|
829
858
|
static __initStatic() {this.info = {
|
|
@@ -834,12 +863,12 @@
|
|
|
834
863
|
|
|
835
864
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
836
865
|
return(
|
|
837
|
-
_optionalChain$
|
|
866
|
+
_optionalChain$8([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby])
|
|
838
867
|
)
|
|
839
868
|
};}
|
|
840
869
|
} Rabby.__initStatic(); Rabby.__initStatic2();
|
|
841
870
|
|
|
842
|
-
function _optionalChain$
|
|
871
|
+
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; }
|
|
843
872
|
|
|
844
873
|
|
|
845
874
|
const KEY$2 = '_DePayWeb3WalletsConnectedSolanaMobileWalletInstance';
|
|
@@ -930,8 +959,8 @@
|
|
|
930
959
|
await solanaWeb3_js.transact(
|
|
931
960
|
async (wallet) => {
|
|
932
961
|
await this.authorize(wallet);
|
|
933
|
-
if(_optionalChain$
|
|
934
|
-
if(_optionalChain$
|
|
962
|
+
if(_optionalChain$7([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$2+'_name'] = this.name = options.name; }
|
|
963
|
+
if(_optionalChain$7([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$2+'_logo'] = this.logo = options.logo; }
|
|
935
964
|
}
|
|
936
965
|
);
|
|
937
966
|
return this._account
|
|
@@ -990,7 +1019,7 @@
|
|
|
990
1019
|
}
|
|
991
1020
|
} SolanaMobileWalletAdapter.__initStatic(); SolanaMobileWalletAdapter.__initStatic2();
|
|
992
1021
|
|
|
993
|
-
function _optionalChain$
|
|
1022
|
+
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; }
|
|
994
1023
|
class Solflare extends WindowSolana {
|
|
995
1024
|
|
|
996
1025
|
static __initStatic() {this.info = {
|
|
@@ -1001,7 +1030,7 @@
|
|
|
1001
1030
|
|
|
1002
1031
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
1003
1032
|
return (
|
|
1004
|
-
_optionalChain$
|
|
1033
|
+
_optionalChain$6([window, 'optionalAccess', _2 => _2.solflare]) &&
|
|
1005
1034
|
window.solflare.isSolflare
|
|
1006
1035
|
)
|
|
1007
1036
|
};}
|
|
@@ -1011,7 +1040,7 @@
|
|
|
1011
1040
|
_sendTransaction(transaction) { return this.getProvider().signTransaction(transaction) }
|
|
1012
1041
|
} Solflare.__initStatic(); Solflare.__initStatic2();
|
|
1013
1042
|
|
|
1014
|
-
function _optionalChain$
|
|
1043
|
+
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; }
|
|
1015
1044
|
class TokenPocket extends WindowEthereum {
|
|
1016
1045
|
|
|
1017
1046
|
static __initStatic() {this.info = {
|
|
@@ -1022,12 +1051,12 @@
|
|
|
1022
1051
|
|
|
1023
1052
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
1024
1053
|
return (
|
|
1025
|
-
_optionalChain$
|
|
1054
|
+
_optionalChain$5([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket])
|
|
1026
1055
|
)
|
|
1027
1056
|
};}
|
|
1028
1057
|
} TokenPocket.__initStatic(); TokenPocket.__initStatic2();
|
|
1029
1058
|
|
|
1030
|
-
function _optionalChain$
|
|
1059
|
+
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; }
|
|
1031
1060
|
class Trust extends WindowEthereum {
|
|
1032
1061
|
|
|
1033
1062
|
static __initStatic() {this.info = {
|
|
@@ -1038,7 +1067,7 @@
|
|
|
1038
1067
|
|
|
1039
1068
|
static __initStatic2() {this.isAvailable = async()=>{
|
|
1040
1069
|
return (
|
|
1041
|
-
(_optionalChain$
|
|
1070
|
+
(_optionalChain$4([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$4([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) &&
|
|
1042
1071
|
Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!Debug)(?!TrustWallet)(?!MetaMask)(?!PocketUniverse)(?!RevokeCash)/)).length == 1
|
|
1043
1072
|
)
|
|
1044
1073
|
};}
|
|
@@ -1133,7 +1162,7 @@
|
|
|
1133
1162
|
}
|
|
1134
1163
|
};
|
|
1135
1164
|
|
|
1136
|
-
function _optionalChain$
|
|
1165
|
+
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; }
|
|
1137
1166
|
|
|
1138
1167
|
const sendTransaction$2 = async ({ transaction, wallet })=> {
|
|
1139
1168
|
transaction = new Transaction(transaction);
|
|
@@ -1145,7 +1174,6 @@
|
|
|
1145
1174
|
let transactionCount = await wallet.transactionCount({ blockchain: transaction.blockchain, address: transaction.from });
|
|
1146
1175
|
transaction.nonce = transactionCount;
|
|
1147
1176
|
await submit$2({ transaction, wallet }).then((tx)=>{
|
|
1148
|
-
console.log('tx', tx);
|
|
1149
1177
|
if (tx) {
|
|
1150
1178
|
let blockchain = Blockchains__default['default'].findByName(transaction.blockchain);
|
|
1151
1179
|
transaction.id = tx;
|
|
@@ -1184,9 +1212,21 @@
|
|
|
1184
1212
|
|
|
1185
1213
|
const retrieveConfirmedTransaction$2 = (sentTransaction)=>{
|
|
1186
1214
|
return new Promise((resolve, reject)=>{
|
|
1215
|
+
try {
|
|
1187
1216
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1217
|
+
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
1218
|
+
if(error && error.toString().match('undefined')) {
|
|
1219
|
+
setTimeout(()=>{
|
|
1220
|
+
retrieveConfirmedTransaction$2(sentTransaction)
|
|
1221
|
+
.then(resolve)
|
|
1222
|
+
.catch(reject);
|
|
1223
|
+
}, 500);
|
|
1224
|
+
} else {
|
|
1225
|
+
reject(error);
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1228
|
+
} catch (error) {
|
|
1229
|
+
if(error && error.toString().match('undefined')) {
|
|
1190
1230
|
setTimeout(()=>{
|
|
1191
1231
|
retrieveConfirmedTransaction$2(sentTransaction)
|
|
1192
1232
|
.then(resolve)
|
|
@@ -1195,7 +1235,7 @@
|
|
|
1195
1235
|
} else {
|
|
1196
1236
|
reject(error);
|
|
1197
1237
|
}
|
|
1198
|
-
}
|
|
1238
|
+
}
|
|
1199
1239
|
})
|
|
1200
1240
|
};
|
|
1201
1241
|
|
|
@@ -1231,7 +1271,7 @@
|
|
|
1231
1271
|
const submitContractInteraction$2 = async ({ transaction, wallet })=>{
|
|
1232
1272
|
const provider = await web3Client.getProvider(transaction.blockchain);
|
|
1233
1273
|
let gasPrice = await provider.getGasPrice();
|
|
1234
|
-
if(_optionalChain$
|
|
1274
|
+
if(_optionalChain$3([wallet, 'access', _ => _.session, 'optionalAccess', _2 => _2.peerMeta, 'optionalAccess', _3 => _3.name]) === 'Uniswap Wallet') {
|
|
1235
1275
|
gasPrice = undefined;
|
|
1236
1276
|
} else {
|
|
1237
1277
|
gasPrice = gasPrice.toHexString();
|
|
@@ -1255,7 +1295,7 @@
|
|
|
1255
1295
|
const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
|
|
1256
1296
|
const provider = await web3Client.getProvider(transaction.blockchain);
|
|
1257
1297
|
let gasPrice = await provider.getGasPrice();
|
|
1258
|
-
if(_optionalChain$
|
|
1298
|
+
if(_optionalChain$3([wallet, 'access', _4 => _4.session, 'optionalAccess', _5 => _5.peerMeta, 'optionalAccess', _6 => _6.name]) === 'Uniswap Wallet') {
|
|
1259
1299
|
gasPrice = undefined;
|
|
1260
1300
|
} else {
|
|
1261
1301
|
gasPrice = gasPrice.toHexString();
|
|
@@ -1274,7 +1314,7 @@
|
|
|
1274
1314
|
})
|
|
1275
1315
|
};
|
|
1276
1316
|
|
|
1277
|
-
function _optionalChain$
|
|
1317
|
+
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; }
|
|
1278
1318
|
|
|
1279
1319
|
const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
|
|
1280
1320
|
|
|
@@ -1417,8 +1457,8 @@
|
|
|
1417
1457
|
let session = await this.connector.connect();
|
|
1418
1458
|
this.session = session;
|
|
1419
1459
|
|
|
1420
|
-
if(_optionalChain$
|
|
1421
|
-
if(_optionalChain$
|
|
1460
|
+
if(_optionalChain$2([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; }
|
|
1461
|
+
if(_optionalChain$2([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; }
|
|
1422
1462
|
|
|
1423
1463
|
if(session.accounts instanceof Array && session.accounts.length) {
|
|
1424
1464
|
setConnectedInstance$1(this);
|
|
@@ -1562,8 +1602,6 @@
|
|
|
1562
1602
|
WalletConnectV1.getConnectedInstance = getConnectedInstance$2;
|
|
1563
1603
|
WalletConnectV1.setConnectedInstance = setConnectedInstance$1;
|
|
1564
1604
|
|
|
1565
|
-
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; }
|
|
1566
|
-
|
|
1567
1605
|
const sendTransaction$1 = async ({ transaction, wallet })=> {
|
|
1568
1606
|
transaction = new Transaction(transaction);
|
|
1569
1607
|
if((await wallet.connectedTo(transaction.blockchain)) == false) {
|
|
@@ -1582,7 +1620,6 @@
|
|
|
1582
1620
|
transaction.nonce = sentTransaction.nonce || transactionCount;
|
|
1583
1621
|
if(!sentTransaction) {
|
|
1584
1622
|
transaction._failed = true;
|
|
1585
|
-
console.log('Error retrieving transaction');
|
|
1586
1623
|
if(transaction.failed) transaction.failed(transaction, 'Error retrieving transaction');
|
|
1587
1624
|
} else {
|
|
1588
1625
|
retrieveConfirmedTransaction$1(sentTransaction).then(() => {
|
|
@@ -1614,35 +1651,60 @@
|
|
|
1614
1651
|
|
|
1615
1652
|
const retrieveConfirmedTransaction$1 = (sentTransaction)=>{
|
|
1616
1653
|
return new Promise((resolve, reject)=>{
|
|
1654
|
+
try {
|
|
1655
|
+
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
1656
|
+
if(error && error.toString().match('undefined')) {
|
|
1657
|
+
setTimeout(()=>{
|
|
1658
|
+
retrieveConfirmedTransaction$1(sentTransaction)
|
|
1659
|
+
.then(resolve)
|
|
1660
|
+
.catch(reject);
|
|
1661
|
+
}, 500);
|
|
1662
|
+
} else {
|
|
1663
|
+
reject(error);
|
|
1664
|
+
}
|
|
1665
|
+
});
|
|
1666
|
+
} catch (error) {
|
|
1667
|
+
if(error && error.toString().match('undefined')) {
|
|
1668
|
+
setTimeout(()=>{
|
|
1669
|
+
retrieveConfirmedTransaction$1(sentTransaction)
|
|
1670
|
+
.then(resolve)
|
|
1671
|
+
.catch(reject);
|
|
1672
|
+
}, 500);
|
|
1673
|
+
} else {
|
|
1674
|
+
reject(error);
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
})
|
|
1678
|
+
};
|
|
1617
1679
|
|
|
1618
|
-
|
|
1619
|
-
|
|
1680
|
+
const retrieveTransaction = (tx, blockchain)=>{
|
|
1681
|
+
return new Promise(async(resolve, reject)=>{
|
|
1682
|
+
try {
|
|
1683
|
+
let sentTransaction;
|
|
1684
|
+
const provider = await web3Client.getProvider(blockchain);
|
|
1685
|
+
sentTransaction = await provider.getTransaction(tx);
|
|
1686
|
+
const maxRetries = 120;
|
|
1687
|
+
let attempt = 1;
|
|
1688
|
+
while (attempt <= maxRetries && !sentTransaction) {
|
|
1689
|
+
sentTransaction = await provider.getTransaction(tx);
|
|
1690
|
+
await (new Promise((resolve)=>setTimeout(resolve, 5000)));
|
|
1691
|
+
attempt++;
|
|
1692
|
+
}
|
|
1693
|
+
resolve(sentTransaction);
|
|
1694
|
+
} catch (error) {
|
|
1695
|
+
if(error && error.toString().match('undefined')) {
|
|
1620
1696
|
setTimeout(()=>{
|
|
1621
|
-
|
|
1697
|
+
retrieveTransaction(tx, blockchain)
|
|
1622
1698
|
.then(resolve)
|
|
1623
1699
|
.catch(reject);
|
|
1624
1700
|
}, 500);
|
|
1625
1701
|
} else {
|
|
1626
1702
|
reject(error);
|
|
1627
1703
|
}
|
|
1628
|
-
}
|
|
1704
|
+
}
|
|
1629
1705
|
})
|
|
1630
1706
|
};
|
|
1631
1707
|
|
|
1632
|
-
const retrieveTransaction = async (tx, blockchain)=>{
|
|
1633
|
-
let sentTransaction;
|
|
1634
|
-
const provider = await web3Client.getProvider(blockchain);
|
|
1635
|
-
sentTransaction = await provider.getTransaction(tx);
|
|
1636
|
-
const maxRetries = 120;
|
|
1637
|
-
let attempt = 1;
|
|
1638
|
-
while (attempt <= maxRetries && !sentTransaction) {
|
|
1639
|
-
sentTransaction = await provider.getTransaction(tx);
|
|
1640
|
-
await (new Promise((resolve)=>setTimeout(resolve, 5000)));
|
|
1641
|
-
attempt++;
|
|
1642
|
-
}
|
|
1643
|
-
return sentTransaction
|
|
1644
|
-
};
|
|
1645
|
-
|
|
1646
1708
|
const submit$1 = ({ transaction, wallet }) => {
|
|
1647
1709
|
if(transaction.method) {
|
|
1648
1710
|
return submitContractInteraction$1({ transaction, wallet })
|
|
@@ -1696,7 +1758,7 @@
|
|
|
1696
1758
|
}).catch((e)=>{console.log('ERROR', e);})
|
|
1697
1759
|
};
|
|
1698
1760
|
|
|
1699
|
-
function _optionalChain$
|
|
1761
|
+
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; }
|
|
1700
1762
|
|
|
1701
1763
|
const KEY = 'depay:wallets:wc2';
|
|
1702
1764
|
|
|
@@ -1815,11 +1877,11 @@
|
|
|
1815
1877
|
};
|
|
1816
1878
|
|
|
1817
1879
|
const getWalletConnectV2Config = (walletName)=>{
|
|
1818
|
-
const methods = _optionalChain$
|
|
1819
|
-
const events = _optionalChain$
|
|
1880
|
+
const methods = _optionalChain$1([CONFIGURATIONS, 'access', _ => _[walletName], 'optionalAccess', _2 => _2.methods]) || DEFAULT_CONFIGURATION.methods;
|
|
1881
|
+
const events = _optionalChain$1([CONFIGURATIONS, 'access', _3 => _3[walletName], 'optionalAccess', _4 => _4.events]) || DEFAULT_CONFIGURATION.events;
|
|
1820
1882
|
|
|
1821
1883
|
let requiredNamespaces = {};
|
|
1822
|
-
if(_optionalChain$
|
|
1884
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _5 => _5[walletName], 'optionalAccess', _6 => _6.requiredNamespaces])) {
|
|
1823
1885
|
requiredNamespaces = CONFIGURATIONS[walletName].requiredNamespaces;
|
|
1824
1886
|
} else {
|
|
1825
1887
|
requiredNamespaces['eip155'] = {
|
|
@@ -1832,14 +1894,14 @@
|
|
|
1832
1894
|
}
|
|
1833
1895
|
|
|
1834
1896
|
let optionalNamespaces = {};
|
|
1835
|
-
if(_optionalChain$
|
|
1897
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _7 => _7[walletName], 'optionalAccess', _8 => _8.optionalNamespaces])) {
|
|
1836
1898
|
optionalNamespaces = CONFIGURATIONS[walletName].optionalNamespaces;
|
|
1837
1899
|
} else {
|
|
1838
1900
|
optionalNamespaces['eip155'] = {
|
|
1839
1901
|
chains: supported$1.evm.map((blockchain)=>`${Blockchains__default['default'][blockchain].namespace}:${Blockchains__default['default'][blockchain].networkId}`),
|
|
1840
1902
|
};
|
|
1841
1903
|
}
|
|
1842
|
-
if(_optionalChain$
|
|
1904
|
+
if(_optionalChain$1([optionalNamespaces, 'optionalAccess', _9 => _9.eip155]) && _optionalChain$1([optionalNamespaces, 'optionalAccess', _10 => _10.eip155, 'optionalAccess', _11 => _11.chains, 'optionalAccess', _12 => _12.length])) {
|
|
1843
1905
|
optionalNamespaces['eip155'].methods = methods;
|
|
1844
1906
|
optionalNamespaces['eip155'].events = events;
|
|
1845
1907
|
}
|
|
@@ -1854,9 +1916,9 @@
|
|
|
1854
1916
|
projectId: localStorage[KEY+":projectId"],
|
|
1855
1917
|
metadata: {
|
|
1856
1918
|
name: document.title || 'dApp',
|
|
1857
|
-
description: _optionalChain$
|
|
1919
|
+
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',
|
|
1858
1920
|
url: location.href,
|
|
1859
|
-
icons: [_optionalChain$
|
|
1921
|
+
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`]
|
|
1860
1922
|
}
|
|
1861
1923
|
});
|
|
1862
1924
|
resolve(signClient);
|
|
@@ -1874,7 +1936,7 @@
|
|
|
1874
1936
|
};}
|
|
1875
1937
|
|
|
1876
1938
|
static __initStatic2() {this.isAvailable = async(options)=>{
|
|
1877
|
-
return !! await getLastSession(_optionalChain$
|
|
1939
|
+
return !! await getLastSession(_optionalChain$1([options, 'optionalAccess', _21 => _21.walletName]))
|
|
1878
1940
|
};}
|
|
1879
1941
|
|
|
1880
1942
|
constructor() {
|
|
@@ -1889,19 +1951,19 @@
|
|
|
1889
1951
|
}
|
|
1890
1952
|
|
|
1891
1953
|
async account() {
|
|
1892
|
-
if(_optionalChain$
|
|
1954
|
+
if(_optionalChain$1([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.namespaces, 'optionalAccess', _24 => _24.eip155, 'optionalAccess', _25 => _25.accounts, 'optionalAccess', _26 => _26.length])) {
|
|
1893
1955
|
return this.session.namespaces.eip155.accounts[0].split(':')[2]
|
|
1894
1956
|
}
|
|
1895
1957
|
}
|
|
1896
1958
|
|
|
1897
1959
|
async setSessionBlockchains() {
|
|
1898
|
-
if(!this.session || !_optionalChain$
|
|
1899
|
-
if(_optionalChain$
|
|
1900
|
-
this.blockchains = [this.session.namespaces.eip155.chains[this.session.namespaces.eip155.chains.length-1]].map((chainIdentifier)=>_optionalChain$
|
|
1960
|
+
if(!this.session || !_optionalChain$1([this, 'access', _27 => _27.session, 'optionalAccess', _28 => _28.namespaces, 'optionalAccess', _29 => _29.eip155])) { return }
|
|
1961
|
+
if(_optionalChain$1([CONFIGURATIONS, 'access', _30 => _30[this.walletName], 'optionalAccess', _31 => _31.methods, 'optionalAccess', _32 => _32.includes, 'call', _33 => _33('wallet_switchEthereumChain')])) {
|
|
1962
|
+
this.blockchains = [this.session.namespaces.eip155.chains[this.session.namespaces.eip155.chains.length-1]].map((chainIdentifier)=>_optionalChain$1([Blockchains__default['default'], 'access', _34 => _34.findByNetworkId, 'call', _35 => _35(chainIdentifier.split(':')[1]), 'optionalAccess', _36 => _36.name])).filter(Boolean);
|
|
1901
1963
|
} else if(this.session.namespaces.eip155.chains) {
|
|
1902
|
-
this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$
|
|
1964
|
+
this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$1([Blockchains__default['default'], 'access', _37 => _37.findByNetworkId, 'call', _38 => _38(chainIdentifier.split(':')[1]), 'optionalAccess', _39 => _39.name])).filter(Boolean);
|
|
1903
1965
|
} else if(this.session.namespaces.eip155.accounts) {
|
|
1904
|
-
this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$
|
|
1966
|
+
this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$1([Blockchains__default['default'], 'access', _40 => _40.findByNetworkId, 'call', _41 => _41(accountIdentifier.split(':')[1]), 'optionalAccess', _42 => _42.name])).filter(Boolean);
|
|
1905
1967
|
}
|
|
1906
1968
|
}
|
|
1907
1969
|
|
|
@@ -1911,13 +1973,13 @@
|
|
|
1911
1973
|
|
|
1912
1974
|
try {
|
|
1913
1975
|
|
|
1914
|
-
this.walletName = _optionalChain$
|
|
1976
|
+
this.walletName = _optionalChain$1([options, 'optionalAccess', _43 => _43.name]);
|
|
1915
1977
|
|
|
1916
1978
|
// delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS
|
|
1917
1979
|
this.signClient = await getSignClient();
|
|
1918
1980
|
|
|
1919
1981
|
this.signClient.on("session_delete", (session)=> {
|
|
1920
|
-
if(_optionalChain$
|
|
1982
|
+
if(_optionalChain$1([session, 'optionalAccess', _44 => _44.topic]) === _optionalChain$1([this, 'access', _45 => _45.session, 'optionalAccess', _46 => _46.topic])) {
|
|
1921
1983
|
localStorage[KEY+':name'] = undefined;
|
|
1922
1984
|
localStorage[KEY+':logo'] = undefined;
|
|
1923
1985
|
this.signClient = undefined;
|
|
@@ -1926,14 +1988,14 @@
|
|
|
1926
1988
|
});
|
|
1927
1989
|
|
|
1928
1990
|
this.signClient.on("session_update", async(session)=> {
|
|
1929
|
-
if(_optionalChain$
|
|
1991
|
+
if(_optionalChain$1([session, 'optionalAccess', _47 => _47.topic]) === _optionalChain$1([this, 'access', _48 => _48.session, 'optionalAccess', _49 => _49.topic])) {
|
|
1930
1992
|
this.session = this.signClient.session.get(session.topic);
|
|
1931
1993
|
await this.setSessionBlockchains();
|
|
1932
1994
|
}
|
|
1933
1995
|
});
|
|
1934
1996
|
|
|
1935
1997
|
this.signClient.on("session_event", (event)=> {
|
|
1936
|
-
if(_optionalChain$
|
|
1998
|
+
if(_optionalChain$1([event, 'optionalAccess', _50 => _50.topic]) === _optionalChain$1([this, 'access', _51 => _51.session, 'optionalAccess', _52 => _52.topic])) {}
|
|
1937
1999
|
});
|
|
1938
2000
|
|
|
1939
2001
|
const connectWallet = async()=>{
|
|
@@ -1944,24 +2006,24 @@
|
|
|
1944
2006
|
await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect
|
|
1945
2007
|
};
|
|
1946
2008
|
|
|
1947
|
-
const lastSession = _optionalChain$
|
|
2009
|
+
const lastSession = _optionalChain$1([this, 'optionalAccess', _53 => _53.walletName, 'optionalAccess', _54 => _54.length]) ? await getLastSession(this.walletName) : undefined;
|
|
1948
2010
|
if(lastSession) {
|
|
1949
2011
|
this.session = lastSession;
|
|
1950
2012
|
} else {
|
|
1951
2013
|
await connectWallet();
|
|
1952
2014
|
}
|
|
1953
2015
|
|
|
1954
|
-
let meta = _optionalChain$
|
|
2016
|
+
let meta = _optionalChain$1([this, 'access', _55 => _55.session, 'optionalAccess', _56 => _56.peer, 'optionalAccess', _57 => _57.metadata]);
|
|
1955
2017
|
if(meta && meta.name) {
|
|
1956
2018
|
this.name = meta.name;
|
|
1957
2019
|
localStorage[KEY+':name'] = meta.name;
|
|
1958
|
-
if(_optionalChain$
|
|
2020
|
+
if(_optionalChain$1([meta, 'optionalAccess', _58 => _58.icons]) && meta.icons.length) {
|
|
1959
2021
|
this.logo = meta.icons[0];
|
|
1960
2022
|
localStorage[KEY+':logo'] = this.logo;
|
|
1961
2023
|
}
|
|
1962
2024
|
}
|
|
1963
|
-
if(_optionalChain$
|
|
1964
|
-
if(_optionalChain$
|
|
2025
|
+
if(_optionalChain$1([options, 'optionalAccess', _59 => _59.name])) { localStorage[KEY+':name'] = this.name = options.name; }
|
|
2026
|
+
if(_optionalChain$1([options, 'optionalAccess', _60 => _60.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; }
|
|
1965
2027
|
|
|
1966
2028
|
await this.setSessionBlockchains();
|
|
1967
2029
|
|
|
@@ -2018,7 +2080,7 @@
|
|
|
2018
2080
|
switch (event) {
|
|
2019
2081
|
case 'account':
|
|
2020
2082
|
internalCallback = async(event)=> {
|
|
2021
|
-
if(_optionalChain$
|
|
2083
|
+
if(_optionalChain$1([event, 'optionalAccess', _61 => _61.topic]) === _optionalChain$1([this, 'access', _62 => _62.session, 'optionalAccess', _63 => _63.topic]) && event.params.event.name === 'accountsChanged') {
|
|
2022
2084
|
callback(await this.account());
|
|
2023
2085
|
}
|
|
2024
2086
|
};
|
|
@@ -2078,7 +2140,6 @@
|
|
|
2078
2140
|
|
|
2079
2141
|
WalletConnectV2.getConnectedInstance = getConnectedInstance$1;
|
|
2080
2142
|
|
|
2081
|
-
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; }
|
|
2082
2143
|
const sendTransaction = async ({ transaction, wallet })=> {
|
|
2083
2144
|
transaction = new Transaction(transaction);
|
|
2084
2145
|
if((await wallet.connectedTo(transaction.blockchain)) == false) {
|
|
@@ -2126,9 +2187,21 @@
|
|
|
2126
2187
|
|
|
2127
2188
|
const retrieveConfirmedTransaction = (sentTransaction)=>{
|
|
2128
2189
|
return new Promise((resolve, reject)=>{
|
|
2190
|
+
try {
|
|
2129
2191
|
|
|
2130
|
-
|
|
2131
|
-
|
|
2192
|
+
sentTransaction.wait(1).then(resolve).catch((error)=>{
|
|
2193
|
+
if(error && error.toString().match('undefined')) {
|
|
2194
|
+
setTimeout(()=>{
|
|
2195
|
+
retrieveConfirmedTransaction(sentTransaction)
|
|
2196
|
+
.then(resolve)
|
|
2197
|
+
.catch(reject);
|
|
2198
|
+
}, 500);
|
|
2199
|
+
} else {
|
|
2200
|
+
reject(error);
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2203
|
+
} catch(error) {
|
|
2204
|
+
if(error && error.toString().match('undefined')) {
|
|
2132
2205
|
setTimeout(()=>{
|
|
2133
2206
|
retrieveConfirmedTransaction(sentTransaction)
|
|
2134
2207
|
.then(resolve)
|
|
@@ -2137,7 +2210,7 @@
|
|
|
2137
2210
|
} else {
|
|
2138
2211
|
reject(error);
|
|
2139
2212
|
}
|
|
2140
|
-
}
|
|
2213
|
+
}
|
|
2141
2214
|
})
|
|
2142
2215
|
};
|
|
2143
2216
|
|