@depay/web3-wallets-evm 16.3.2 → 16.3.4

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.
@@ -9,7 +9,7 @@ let supported$1 = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanch
9
9
  supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base'];
10
10
  supported$1.solana = [];
11
11
 
12
- function _optionalChain$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; }
12
+ 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; }
13
13
  class Transaction {
14
14
 
15
15
  constructor({
@@ -34,7 +34,7 @@ class Transaction {
34
34
  this.to = (to && to.match('0x')) ? ethers.utils.getAddress(to) : to;
35
35
 
36
36
  // optional
37
- this.value = _optionalChain$h([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
37
+ this.value = _optionalChain$k([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]);
38
38
  this.api = api;
39
39
  this.method = method;
40
40
  this.params = params;
@@ -74,7 +74,7 @@ class Transaction {
74
74
  }
75
75
 
76
76
  getParamType(param) {
77
- if(_optionalChain$h([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) {
77
+ if(_optionalChain$k([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) {
78
78
  return `(${param.components.map((param)=>this.getParamType(param)).join(',')})`
79
79
  } else {
80
80
  return param.type
@@ -147,6 +147,8 @@ class Transaction {
147
147
  }
148
148
  }
149
149
 
150
+ 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; }
151
+
150
152
  const sendTransaction$3 = async ({ transaction, wallet })=> {
151
153
  transaction = new Transaction(transaction);
152
154
  if((await wallet.connectedTo(transaction.blockchain)) == false) {
@@ -199,7 +201,10 @@ const retrieveConfirmedTransaction$3 = (sentTransaction)=>{
199
201
  try {
200
202
 
201
203
  sentTransaction.wait(1).then(resolve).catch((error)=>{
202
- if(error && error.toString().match('undefined')) {
204
+ if(
205
+ (error && _optionalChain$j([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) ||
206
+ (error && error.toString().match('undefined'))
207
+ ) {
203
208
  setTimeout(()=>{
204
209
  retrieveConfirmedTransaction$3(sentTransaction)
205
210
  .then(resolve)
@@ -210,7 +215,10 @@ const retrieveConfirmedTransaction$3 = (sentTransaction)=>{
210
215
  }
211
216
  });
212
217
  } catch(error) {
213
- if(error && error.toString().match('undefined')) {
218
+ if(
219
+ (error && _optionalChain$j([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) ||
220
+ (error && error.toString().match('undefined'))
221
+ ) {
214
222
  setTimeout(()=>{
215
223
  retrieveConfirmedTransaction$3(sentTransaction)
216
224
  .then(resolve)
@@ -253,7 +261,7 @@ const submitSimpleTransfer$3 = ({ transaction, signer })=>{
253
261
  })
254
262
  };
255
263
 
256
- 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; }
264
+ 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; }
257
265
 
258
266
  class WindowEthereum {
259
267
 
@@ -265,31 +273,31 @@ class WindowEthereum {
265
273
 
266
274
  static __initStatic2() {this.isAvailable = async()=>{
267
275
  return (
268
- _optionalChain$g([window, 'optionalAccess', _31 => _31.ethereum]) &&
276
+ _optionalChain$i([window, 'optionalAccess', _31 => _31.ethereum]) &&
269
277
  // not MetaMask
270
- !(_optionalChain$g([window, 'optionalAccess', _32 => _32.ethereum, 'optionalAccess', _33 => _33.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) &&
278
+ !(_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) &&
271
279
  // not Coin98
272
- !_optionalChain$g([window, 'optionalAccess', _34 => _34.coin98]) &&
280
+ !_optionalChain$i([window, 'optionalAccess', _34 => _34.coin98]) &&
273
281
  // not Trust Wallet
274
- !(_optionalChain$g([window, 'optionalAccess', _35 => _35.ethereum, 'optionalAccess', _36 => _36.isTrust]) || _optionalChain$g([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isTrustWallet])) &&
282
+ !(_optionalChain$i([window, 'optionalAccess', _35 => _35.ethereum, 'optionalAccess', _36 => _36.isTrust]) || _optionalChain$i([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isTrustWallet])) &&
275
283
  // not crypto.com
276
- !_optionalChain$g([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isDeficonnectProvider]) &&
284
+ !_optionalChain$i([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isDeficonnectProvider]) &&
277
285
  // not HyperPay
278
- !_optionalChain$g([window, 'optionalAccess', _41 => _41.ethereum, 'optionalAccess', _42 => _42.isHyperPay]) &&
286
+ !_optionalChain$i([window, 'optionalAccess', _41 => _41.ethereum, 'optionalAccess', _42 => _42.isHyperPay]) &&
279
287
  // not Phantom
280
- !(window.phantom && !window.glow && !_optionalChain$g([window, 'optionalAccess', _43 => _43.solana, 'optionalAccess', _44 => _44.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) &&
288
+ !(window.phantom && !window.glow && !_optionalChain$i([window, 'optionalAccess', _43 => _43.solana, 'optionalAccess', _44 => _44.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) &&
281
289
  // not Rabby
282
- !_optionalChain$g([window, 'optionalAccess', _45 => _45.ethereum, 'optionalAccess', _46 => _46.isRabby]) &&
290
+ !_optionalChain$i([window, 'optionalAccess', _45 => _45.ethereum, 'optionalAccess', _46 => _46.isRabby]) &&
283
291
  // not Backpack
284
- !_optionalChain$g([window, 'optionalAccess', _47 => _47.backpack, 'optionalAccess', _48 => _48.isBackpack]) &&
292
+ !_optionalChain$i([window, 'optionalAccess', _47 => _47.backpack, 'optionalAccess', _48 => _48.isBackpack]) &&
285
293
  // not TokenPocket
286
- !_optionalChain$g([window, 'optionalAccess', _49 => _49.ethereum, 'optionalAccess', _50 => _50.isTokenPocket]) &&
294
+ !_optionalChain$i([window, 'optionalAccess', _49 => _49.ethereum, 'optionalAccess', _50 => _50.isTokenPocket]) &&
287
295
  // not BitKeep
288
- !_optionalChain$g([window, 'optionalAccess', _51 => _51.ethereum, 'optionalAccess', _52 => _52.isBitKeep]) &&
296
+ !_optionalChain$i([window, 'optionalAccess', _51 => _51.ethereum, 'optionalAccess', _52 => _52.isBitKeep]) &&
289
297
  // not Coinbase
290
- !(_optionalChain$g([window, 'optionalAccess', _53 => _53.ethereum, 'optionalAccess', _54 => _54.isCoinbaseWallet]) || _optionalChain$g([window, 'optionalAccess', _55 => _55.ethereum, 'optionalAccess', _56 => _56.isWalletLink])) &&
298
+ !(_optionalChain$i([window, 'optionalAccess', _53 => _53.ethereum, 'optionalAccess', _54 => _54.isCoinbaseWallet]) || _optionalChain$i([window, 'optionalAccess', _55 => _55.ethereum, 'optionalAccess', _56 => _56.isWalletLink])) &&
291
299
  // MetaMask through ProviderMap
292
- !_optionalChain$g([window, 'optionalAccess', _57 => _57.ethereum, 'optionalAccess', _58 => _58.providerMap, 'optionalAccess', _59 => _59.has, 'call', _60 => _60('MetaMask')])
300
+ !_optionalChain$i([window, 'optionalAccess', _57 => _57.ethereum, 'optionalAccess', _58 => _58.providerMap, 'optionalAccess', _59 => _59.has, 'call', _60 => _60('MetaMask')])
293
301
  )
294
302
  };}
295
303
 
@@ -415,7 +423,7 @@ class WindowEthereum {
415
423
  }
416
424
  } WindowEthereum.__initStatic(); WindowEthereum.__initStatic2();
417
425
 
418
- 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; }
426
+ 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; }
419
427
  class Binance extends WindowEthereum {
420
428
 
421
429
  static __initStatic() {this.info = {
@@ -425,7 +433,7 @@ class Binance extends WindowEthereum {
425
433
  };}
426
434
 
427
435
  static __initStatic2() {this.isAvailable = async()=>{
428
- return _optionalChain$f([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
436
+ return _optionalChain$h([window, 'optionalAccess', _2 => _2.BinanceChain]) &&
429
437
  !window.coin98 &&
430
438
  !window.trustwallet
431
439
  };}
@@ -434,7 +442,7 @@ class Binance extends WindowEthereum {
434
442
 
435
443
  } Binance.__initStatic(); Binance.__initStatic2();
436
444
 
437
- 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; }
445
+ 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; }
438
446
  class Brave extends WindowEthereum {
439
447
 
440
448
  static __initStatic() {this.info = {
@@ -443,7 +451,7 @@ class Brave extends WindowEthereum {
443
451
  blockchains: supported$1.evm
444
452
  };}
445
453
 
446
- static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$e([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
454
+ static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$g([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };}
447
455
  } Brave.__initStatic(); Brave.__initStatic2();
448
456
 
449
457
  var logos = {
@@ -454,7 +462,7 @@ var logos = {
454
462
  trust: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA5Ni41IDk2LjUiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDk2LjUgOTYuNSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3QgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9Ijk2LjUiIGhlaWdodD0iOTYuNSIvPgo8cGF0aCBzdHJva2U9IiMzMzc1QkIiIHN0cm9rZS13aWR0aD0iNi4wNjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQgPSIxMCIgZmlsbD0ibm9uZSIgZD0ibTQ4LjUgMjAuMWM5LjYgOCAyMC42IDcuNSAyMy43IDcuNS0wLjcgNDUuNS01LjkgMzYuNS0yMy43IDQ5LjMtMTcuOC0xMi44LTIzLTMuNy0yMy43LTQ5LjMgMy4yIDAgMTQuMSAwLjUgMjMuNy03LjV6Ii8+Cjwvc3ZnPgo=",
455
463
  };
456
464
 
457
- 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; }
465
+ 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; }
458
466
  class Coin98EVM extends WindowEthereum {
459
467
 
460
468
  static __initStatic() {this.info = {
@@ -464,13 +472,13 @@ class Coin98EVM extends WindowEthereum {
464
472
  platform: 'evm',
465
473
  };}
466
474
 
467
- static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$d([window, 'optionalAccess', _2 => _2.coin98]) };}
475
+ static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _2 => _2.coin98]) };}
468
476
 
469
477
  getProvider() { return window.coin98.provider }
470
478
 
471
479
  } Coin98EVM.__initStatic(); Coin98EVM.__initStatic2();
472
480
 
473
- 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; }
481
+ 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; }
474
482
  class CoinbaseEVM extends WindowEthereum {
475
483
 
476
484
  static __initStatic() {this.info = {
@@ -481,8 +489,8 @@ class CoinbaseEVM extends WindowEthereum {
481
489
  };}
482
490
 
483
491
  getProvider() {
484
- if(_optionalChain$c([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) {
485
- return _optionalChain$c([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')])
492
+ if(_optionalChain$e([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) {
493
+ return _optionalChain$e([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')])
486
494
  } else {
487
495
  return window.ethereum
488
496
  }
@@ -491,15 +499,15 @@ class CoinbaseEVM extends WindowEthereum {
491
499
  static __initStatic2() {this.isAvailable = async()=>{
492
500
  return(
493
501
  (
494
- _optionalChain$c([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$c([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink])
502
+ _optionalChain$e([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$e([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink])
495
503
  ) || (
496
- _optionalChain$c([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')])
504
+ _optionalChain$e([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')])
497
505
  )
498
506
  )
499
507
  };}
500
508
  } CoinbaseEVM.__initStatic(); CoinbaseEVM.__initStatic2();
501
509
 
502
- 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; }
510
+ 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; }
503
511
  class CryptoCom extends WindowEthereum {
504
512
 
505
513
  static __initStatic() {this.info = {
@@ -508,10 +516,10 @@ class CryptoCom extends WindowEthereum {
508
516
  blockchains: supported$1.evm
509
517
  };}
510
518
 
511
- static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$b([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
519
+ static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$d([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };}
512
520
  } CryptoCom.__initStatic(); CryptoCom.__initStatic2();
513
521
 
514
- 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; }
522
+ 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; }
515
523
  class ExodusEVM extends WindowEthereum {
516
524
 
517
525
  static __initStatic() {this.info = {
@@ -521,10 +529,10 @@ class ExodusEVM extends WindowEthereum {
521
529
  platform: 'evm',
522
530
  };}
523
531
 
524
- static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$a([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };}
532
+ static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };}
525
533
  } ExodusEVM.__initStatic(); ExodusEVM.__initStatic2();
526
534
 
527
- 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; }
535
+ 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; }
528
536
  class HyperPay extends WindowEthereum {
529
537
 
530
538
  static __initStatic() {this.info = {
@@ -533,10 +541,10 @@ class HyperPay extends WindowEthereum {
533
541
  blockchains: supported$1.evm
534
542
  };}
535
543
 
536
- static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };}
544
+ static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$b([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };}
537
545
  } HyperPay.__initStatic(); HyperPay.__initStatic2();
538
546
 
539
- 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; }
547
+ 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; }
540
548
  class MetaMask extends WindowEthereum {
541
549
 
542
550
  static __initStatic() {this.info = {
@@ -546,8 +554,8 @@ class MetaMask extends WindowEthereum {
546
554
  };}
547
555
 
548
556
  getProvider() {
549
- if(_optionalChain$8([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) {
550
- return _optionalChain$8([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')])
557
+ if(_optionalChain$a([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) {
558
+ return _optionalChain$a([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')])
551
559
  } else {
552
560
  return window.ethereum
553
561
  }
@@ -556,16 +564,16 @@ class MetaMask extends WindowEthereum {
556
564
  static __initStatic2() {this.isAvailable = async()=>{
557
565
  return(
558
566
  (
559
- _optionalChain$8([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) &&
567
+ _optionalChain$a([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) &&
560
568
  Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1
561
569
  ) || (
562
- _optionalChain$8([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')])
570
+ _optionalChain$a([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')])
563
571
  )
564
572
  )
565
573
  };}
566
574
  } MetaMask.__initStatic(); MetaMask.__initStatic2();
567
575
 
568
- 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; }
576
+ 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; }
569
577
  class Opera extends WindowEthereum {
570
578
 
571
579
  static __initStatic() {this.info = {
@@ -574,7 +582,7 @@ class Opera extends WindowEthereum {
574
582
  blockchains: supported$1.evm
575
583
  };}
576
584
 
577
- static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
585
+ static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };}
578
586
  } Opera.__initStatic(); Opera.__initStatic2();
579
587
 
580
588
  class PhantomEVM extends WindowEthereum {
@@ -582,7 +590,7 @@ class PhantomEVM extends WindowEthereum {
582
590
  static __initStatic() {this.info = {
583
591
  name: 'Phantom',
584
592
  logo: logos.phantom,
585
- blockchains: supported$1.evm,
593
+ blockchains: ['ethereum', 'polygon'],
586
594
  platform: 'evm',
587
595
  };}
588
596
 
@@ -594,7 +602,7 @@ class PhantomEVM extends WindowEthereum {
594
602
  };}
595
603
  } PhantomEVM.__initStatic(); PhantomEVM.__initStatic2();
596
604
 
597
- 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; }
605
+ 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; }
598
606
  class Rabby extends WindowEthereum {
599
607
 
600
608
  static __initStatic() {this.info = {
@@ -605,12 +613,12 @@ class Rabby extends WindowEthereum {
605
613
 
606
614
  static __initStatic2() {this.isAvailable = async()=>{
607
615
  return(
608
- _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby])
616
+ _optionalChain$8([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby])
609
617
  )
610
618
  };}
611
619
  } Rabby.__initStatic(); Rabby.__initStatic2();
612
620
 
613
- 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; }
621
+ 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; }
614
622
  class TokenPocket extends WindowEthereum {
615
623
 
616
624
  static __initStatic() {this.info = {
@@ -621,12 +629,12 @@ class TokenPocket extends WindowEthereum {
621
629
 
622
630
  static __initStatic2() {this.isAvailable = async()=>{
623
631
  return (
624
- _optionalChain$5([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket])
632
+ _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket])
625
633
  )
626
634
  };}
627
635
  } TokenPocket.__initStatic(); TokenPocket.__initStatic2();
628
636
 
629
- 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; }
637
+ 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; }
630
638
  class TrustEVM extends WindowEthereum {
631
639
 
632
640
  static __initStatic() {this.info = {
@@ -638,7 +646,7 @@ class TrustEVM extends WindowEthereum {
638
646
 
639
647
  static __initStatic2() {this.isAvailable = async()=>{
640
648
  return (
641
- (_optionalChain$4([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$4([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) &&
649
+ (_optionalChain$6([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$6([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) &&
642
650
  Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!Debug)(?!TrustWallet)(?!MetaMask)(?!PocketUniverse)(?!RevokeCash)/)).length == 1
643
651
  )
644
652
  };}
@@ -743,7 +751,7 @@ const getSmartContractWallet = async(blockchain, address)=> {
743
751
  }
744
752
  };
745
753
 
746
- 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; }
754
+ 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; }
747
755
 
748
756
  const sendTransaction$2 = async ({ transaction, wallet })=> {
749
757
  transaction = new Transaction(transaction);
@@ -796,7 +804,10 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{
796
804
  try {
797
805
 
798
806
  sentTransaction.wait(1).then(resolve).catch((error)=>{
799
- if(error && error.toString().match('undefined')) {
807
+ if(
808
+ (error && _optionalChain$5([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) ||
809
+ (error && error.toString().match('undefined'))
810
+ ) {
800
811
  setTimeout(()=>{
801
812
  retrieveConfirmedTransaction$2(sentTransaction)
802
813
  .then(resolve)
@@ -807,7 +818,10 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{
807
818
  }
808
819
  });
809
820
  } catch (error) {
810
- if(error && error.toString().match('undefined')) {
821
+ if(
822
+ (error && _optionalChain$5([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) ||
823
+ (error && error.toString().match('undefined'))
824
+ ) {
811
825
  setTimeout(()=>{
812
826
  retrieveConfirmedTransaction$2(sentTransaction)
813
827
  .then(resolve)
@@ -852,7 +866,7 @@ const submit$2 = ({ transaction, wallet }) => {
852
866
  const submitContractInteraction$2 = async ({ transaction, wallet })=>{
853
867
  const provider = await getProvider(transaction.blockchain);
854
868
  let gasPrice = await provider.getGasPrice();
855
- if(_optionalChain$3([wallet, 'access', _ => _.session, 'optionalAccess', _2 => _2.peerMeta, 'optionalAccess', _3 => _3.name]) === 'Uniswap Wallet') {
869
+ if(_optionalChain$5([wallet, 'access', _7 => _7.session, 'optionalAccess', _8 => _8.peerMeta, 'optionalAccess', _9 => _9.name]) === 'Uniswap Wallet') {
856
870
  gasPrice = undefined;
857
871
  } else {
858
872
  gasPrice = gasPrice.toHexString();
@@ -876,7 +890,7 @@ const submitContractInteraction$2 = async ({ transaction, wallet })=>{
876
890
  const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
877
891
  const provider = await getProvider(transaction.blockchain);
878
892
  let gasPrice = await provider.getGasPrice();
879
- if(_optionalChain$3([wallet, 'access', _4 => _4.session, 'optionalAccess', _5 => _5.peerMeta, 'optionalAccess', _6 => _6.name]) === 'Uniswap Wallet') {
893
+ if(_optionalChain$5([wallet, 'access', _10 => _10.session, 'optionalAccess', _11 => _11.peerMeta, 'optionalAccess', _12 => _12.name]) === 'Uniswap Wallet') {
880
894
  gasPrice = undefined;
881
895
  } else {
882
896
  gasPrice = gasPrice.toHexString();
@@ -895,7 +909,7 @@ const submitSimpleTransfer$2 = async ({ transaction, wallet })=>{
895
909
  })
896
910
  };
897
911
 
898
- 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; }
912
+ 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; }
899
913
 
900
914
  const KEY$1 = '_DePayWeb3WalletsConnectedWalletConnectV1Instance';
901
915
 
@@ -1038,8 +1052,8 @@ class WalletConnectV1 {
1038
1052
  let session = await this.connector.connect();
1039
1053
  this.session = session;
1040
1054
 
1041
- if(_optionalChain$2([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; }
1042
- if(_optionalChain$2([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; }
1055
+ if(_optionalChain$4([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; }
1056
+ if(_optionalChain$4([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; }
1043
1057
 
1044
1058
  if(session.accounts instanceof Array && session.accounts.length) {
1045
1059
  setConnectedInstance$1(this);
@@ -1183,6 +1197,8 @@ class WalletConnectV1 {
1183
1197
  WalletConnectV1.getConnectedInstance = getConnectedInstance$2;
1184
1198
  WalletConnectV1.setConnectedInstance = setConnectedInstance$1;
1185
1199
 
1200
+ 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; }
1201
+
1186
1202
  const sendTransaction$1 = async ({ transaction, wallet })=> {
1187
1203
  transaction = new Transaction(transaction);
1188
1204
  if((await wallet.connectedTo(transaction.blockchain)) == false) {
@@ -1234,7 +1250,10 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{
1234
1250
  return new Promise((resolve, reject)=>{
1235
1251
  try {
1236
1252
  sentTransaction.wait(1).then(resolve).catch((error)=>{
1237
- if(error && error.toString().match('undefined')) {
1253
+ if(
1254
+ (error && _optionalChain$3([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) ||
1255
+ (error && error.toString().match('undefined'))
1256
+ ) {
1238
1257
  setTimeout(()=>{
1239
1258
  retrieveConfirmedTransaction$1(sentTransaction)
1240
1259
  .then(resolve)
@@ -1245,7 +1264,10 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{
1245
1264
  }
1246
1265
  });
1247
1266
  } catch (error) {
1248
- if(error && error.toString().match('undefined')) {
1267
+ if(
1268
+ (error && _optionalChain$3([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) ||
1269
+ (error && error.toString().match('undefined'))
1270
+ ) {
1249
1271
  setTimeout(()=>{
1250
1272
  retrieveConfirmedTransaction$1(sentTransaction)
1251
1273
  .then(resolve)
@@ -1273,7 +1295,10 @@ const retrieveTransaction = (tx, blockchain)=>{
1273
1295
  }
1274
1296
  resolve(sentTransaction);
1275
1297
  } catch (error) {
1276
- if(error && error.toString().match('undefined')) {
1298
+ if(
1299
+ (error && _optionalChain$3([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) ||
1300
+ (error && error.toString().match('undefined'))
1301
+ ) {
1277
1302
  setTimeout(()=>{
1278
1303
  retrieveTransaction(tx, blockchain)
1279
1304
  .then(resolve)
@@ -1339,7 +1364,7 @@ const submitSimpleTransfer$1 = async ({ transaction, wallet })=>{
1339
1364
  }).catch((e)=>{console.log('ERROR', e);})
1340
1365
  };
1341
1366
 
1342
- 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; }
1367
+ 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; }
1343
1368
 
1344
1369
  const KEY = 'depay:wallets:wc2';
1345
1370
 
@@ -1458,11 +1483,11 @@ const getLastSession = async(walletName)=>{
1458
1483
  };
1459
1484
 
1460
1485
  const getWalletConnectV2Config = (walletName)=>{
1461
- const methods = _optionalChain$1([CONFIGURATIONS, 'access', _ => _[walletName], 'optionalAccess', _2 => _2.methods]) || DEFAULT_CONFIGURATION.methods;
1462
- const events = _optionalChain$1([CONFIGURATIONS, 'access', _3 => _3[walletName], 'optionalAccess', _4 => _4.events]) || DEFAULT_CONFIGURATION.events;
1486
+ const methods = _optionalChain$2([CONFIGURATIONS, 'access', _ => _[walletName], 'optionalAccess', _2 => _2.methods]) || DEFAULT_CONFIGURATION.methods;
1487
+ const events = _optionalChain$2([CONFIGURATIONS, 'access', _3 => _3[walletName], 'optionalAccess', _4 => _4.events]) || DEFAULT_CONFIGURATION.events;
1463
1488
 
1464
1489
  let requiredNamespaces = {};
1465
- if(_optionalChain$1([CONFIGURATIONS, 'access', _5 => _5[walletName], 'optionalAccess', _6 => _6.requiredNamespaces])) {
1490
+ if(_optionalChain$2([CONFIGURATIONS, 'access', _5 => _5[walletName], 'optionalAccess', _6 => _6.requiredNamespaces])) {
1466
1491
  requiredNamespaces = CONFIGURATIONS[walletName].requiredNamespaces;
1467
1492
  } else {
1468
1493
  requiredNamespaces['eip155'] = {
@@ -1475,14 +1500,14 @@ const getWalletConnectV2Config = (walletName)=>{
1475
1500
  }
1476
1501
 
1477
1502
  let optionalNamespaces = {};
1478
- if(_optionalChain$1([CONFIGURATIONS, 'access', _7 => _7[walletName], 'optionalAccess', _8 => _8.optionalNamespaces])) {
1503
+ if(_optionalChain$2([CONFIGURATIONS, 'access', _7 => _7[walletName], 'optionalAccess', _8 => _8.optionalNamespaces])) {
1479
1504
  optionalNamespaces = CONFIGURATIONS[walletName].optionalNamespaces;
1480
1505
  } else {
1481
1506
  optionalNamespaces['eip155'] = {
1482
1507
  chains: supported$1.evm.map((blockchain)=>`${Blockchains[blockchain].namespace}:${Blockchains[blockchain].networkId}`),
1483
1508
  };
1484
1509
  }
1485
- if(_optionalChain$1([optionalNamespaces, 'optionalAccess', _9 => _9.eip155]) && _optionalChain$1([optionalNamespaces, 'optionalAccess', _10 => _10.eip155, 'optionalAccess', _11 => _11.chains, 'optionalAccess', _12 => _12.length])) {
1510
+ if(_optionalChain$2([optionalNamespaces, 'optionalAccess', _9 => _9.eip155]) && _optionalChain$2([optionalNamespaces, 'optionalAccess', _10 => _10.eip155, 'optionalAccess', _11 => _11.chains, 'optionalAccess', _12 => _12.length])) {
1486
1511
  optionalNamespaces['eip155'].methods = methods;
1487
1512
  optionalNamespaces['eip155'].events = events;
1488
1513
  }
@@ -1497,9 +1522,9 @@ const getSignClient = ()=>{
1497
1522
  projectId: localStorage[KEY+":projectId"],
1498
1523
  metadata: {
1499
1524
  name: document.title || 'dApp',
1500
- 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',
1525
+ 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',
1501
1526
  url: location.href,
1502
- 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`]
1527
+ 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`]
1503
1528
  }
1504
1529
  });
1505
1530
  resolve(signClient);
@@ -1517,7 +1542,7 @@ class WalletConnectV2 {
1517
1542
  };}
1518
1543
 
1519
1544
  static __initStatic2() {this.isAvailable = async(options)=>{
1520
- return !! await getLastSession(_optionalChain$1([options, 'optionalAccess', _21 => _21.walletName]))
1545
+ return !! await getLastSession(_optionalChain$2([options, 'optionalAccess', _21 => _21.walletName]))
1521
1546
  };}
1522
1547
 
1523
1548
  constructor() {
@@ -1532,19 +1557,19 @@ class WalletConnectV2 {
1532
1557
  }
1533
1558
 
1534
1559
  async account() {
1535
- if(_optionalChain$1([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.namespaces, 'optionalAccess', _24 => _24.eip155, 'optionalAccess', _25 => _25.accounts, 'optionalAccess', _26 => _26.length])) {
1560
+ if(_optionalChain$2([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.namespaces, 'optionalAccess', _24 => _24.eip155, 'optionalAccess', _25 => _25.accounts, 'optionalAccess', _26 => _26.length])) {
1536
1561
  return this.session.namespaces.eip155.accounts[0].split(':')[2]
1537
1562
  }
1538
1563
  }
1539
1564
 
1540
1565
  async setSessionBlockchains() {
1541
- if(!this.session || !_optionalChain$1([this, 'access', _27 => _27.session, 'optionalAccess', _28 => _28.namespaces, 'optionalAccess', _29 => _29.eip155])) { return }
1542
- if(_optionalChain$1([CONFIGURATIONS, 'access', _30 => _30[this.walletName], 'optionalAccess', _31 => _31.methods, 'optionalAccess', _32 => _32.includes, 'call', _33 => _33('wallet_switchEthereumChain')])) {
1543
- this.blockchains = [this.session.namespaces.eip155.chains[this.session.namespaces.eip155.chains.length-1]].map((chainIdentifier)=>_optionalChain$1([Blockchains, 'access', _34 => _34.findByNetworkId, 'call', _35 => _35(chainIdentifier.split(':')[1]), 'optionalAccess', _36 => _36.name])).filter(Boolean);
1566
+ if(!this.session || !_optionalChain$2([this, 'access', _27 => _27.session, 'optionalAccess', _28 => _28.namespaces, 'optionalAccess', _29 => _29.eip155])) { return }
1567
+ if(_optionalChain$2([CONFIGURATIONS, 'access', _30 => _30[this.walletName], 'optionalAccess', _31 => _31.methods, 'optionalAccess', _32 => _32.includes, 'call', _33 => _33('wallet_switchEthereumChain')])) {
1568
+ this.blockchains = [this.session.namespaces.eip155.chains[this.session.namespaces.eip155.chains.length-1]].map((chainIdentifier)=>_optionalChain$2([Blockchains, 'access', _34 => _34.findByNetworkId, 'call', _35 => _35(chainIdentifier.split(':')[1]), 'optionalAccess', _36 => _36.name])).filter(Boolean);
1544
1569
  } else if(this.session.namespaces.eip155.chains) {
1545
- this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$1([Blockchains, 'access', _37 => _37.findByNetworkId, 'call', _38 => _38(chainIdentifier.split(':')[1]), 'optionalAccess', _39 => _39.name])).filter(Boolean);
1570
+ this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$2([Blockchains, 'access', _37 => _37.findByNetworkId, 'call', _38 => _38(chainIdentifier.split(':')[1]), 'optionalAccess', _39 => _39.name])).filter(Boolean);
1546
1571
  } else if(this.session.namespaces.eip155.accounts) {
1547
- this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$1([Blockchains, 'access', _40 => _40.findByNetworkId, 'call', _41 => _41(accountIdentifier.split(':')[1]), 'optionalAccess', _42 => _42.name])).filter(Boolean);
1572
+ this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$2([Blockchains, 'access', _40 => _40.findByNetworkId, 'call', _41 => _41(accountIdentifier.split(':')[1]), 'optionalAccess', _42 => _42.name])).filter(Boolean);
1548
1573
  }
1549
1574
  }
1550
1575
 
@@ -1554,13 +1579,13 @@ class WalletConnectV2 {
1554
1579
 
1555
1580
  try {
1556
1581
 
1557
- this.walletName = _optionalChain$1([options, 'optionalAccess', _43 => _43.name]);
1582
+ this.walletName = _optionalChain$2([options, 'optionalAccess', _43 => _43.name]);
1558
1583
 
1559
1584
  // delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS
1560
1585
  this.signClient = await getSignClient();
1561
1586
 
1562
1587
  this.signClient.on("session_delete", (session)=> {
1563
- if(_optionalChain$1([session, 'optionalAccess', _44 => _44.topic]) === _optionalChain$1([this, 'access', _45 => _45.session, 'optionalAccess', _46 => _46.topic])) {
1588
+ if(_optionalChain$2([session, 'optionalAccess', _44 => _44.topic]) === _optionalChain$2([this, 'access', _45 => _45.session, 'optionalAccess', _46 => _46.topic])) {
1564
1589
  localStorage[KEY+':name'] = undefined;
1565
1590
  localStorage[KEY+':logo'] = undefined;
1566
1591
  this.signClient = undefined;
@@ -1569,14 +1594,14 @@ class WalletConnectV2 {
1569
1594
  });
1570
1595
 
1571
1596
  this.signClient.on("session_update", async(session)=> {
1572
- if(_optionalChain$1([session, 'optionalAccess', _47 => _47.topic]) === _optionalChain$1([this, 'access', _48 => _48.session, 'optionalAccess', _49 => _49.topic])) {
1597
+ if(_optionalChain$2([session, 'optionalAccess', _47 => _47.topic]) === _optionalChain$2([this, 'access', _48 => _48.session, 'optionalAccess', _49 => _49.topic])) {
1573
1598
  this.session = this.signClient.session.get(session.topic);
1574
1599
  await this.setSessionBlockchains();
1575
1600
  }
1576
1601
  });
1577
1602
 
1578
1603
  this.signClient.on("session_event", (event)=> {
1579
- if(_optionalChain$1([event, 'optionalAccess', _50 => _50.topic]) === _optionalChain$1([this, 'access', _51 => _51.session, 'optionalAccess', _52 => _52.topic])) {}
1604
+ if(_optionalChain$2([event, 'optionalAccess', _50 => _50.topic]) === _optionalChain$2([this, 'access', _51 => _51.session, 'optionalAccess', _52 => _52.topic])) {}
1580
1605
  });
1581
1606
 
1582
1607
  const connectWallet = async()=>{
@@ -1587,24 +1612,24 @@ class WalletConnectV2 {
1587
1612
  await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect
1588
1613
  };
1589
1614
 
1590
- const lastSession = _optionalChain$1([this, 'optionalAccess', _53 => _53.walletName, 'optionalAccess', _54 => _54.length]) ? await getLastSession(this.walletName) : undefined;
1615
+ const lastSession = _optionalChain$2([this, 'optionalAccess', _53 => _53.walletName, 'optionalAccess', _54 => _54.length]) ? await getLastSession(this.walletName) : undefined;
1591
1616
  if(lastSession) {
1592
1617
  this.session = lastSession;
1593
1618
  } else {
1594
1619
  await connectWallet();
1595
1620
  }
1596
1621
 
1597
- let meta = _optionalChain$1([this, 'access', _55 => _55.session, 'optionalAccess', _56 => _56.peer, 'optionalAccess', _57 => _57.metadata]);
1622
+ let meta = _optionalChain$2([this, 'access', _55 => _55.session, 'optionalAccess', _56 => _56.peer, 'optionalAccess', _57 => _57.metadata]);
1598
1623
  if(meta && meta.name) {
1599
1624
  this.name = meta.name;
1600
1625
  localStorage[KEY+':name'] = meta.name;
1601
- if(_optionalChain$1([meta, 'optionalAccess', _58 => _58.icons]) && meta.icons.length) {
1626
+ if(_optionalChain$2([meta, 'optionalAccess', _58 => _58.icons]) && meta.icons.length) {
1602
1627
  this.logo = meta.icons[0];
1603
1628
  localStorage[KEY+':logo'] = this.logo;
1604
1629
  }
1605
1630
  }
1606
- if(_optionalChain$1([options, 'optionalAccess', _59 => _59.name])) { localStorage[KEY+':name'] = this.name = options.name; }
1607
- if(_optionalChain$1([options, 'optionalAccess', _60 => _60.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; }
1631
+ if(_optionalChain$2([options, 'optionalAccess', _59 => _59.name])) { localStorage[KEY+':name'] = this.name = options.name; }
1632
+ if(_optionalChain$2([options, 'optionalAccess', _60 => _60.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; }
1608
1633
 
1609
1634
  await this.setSessionBlockchains();
1610
1635
 
@@ -1661,7 +1686,7 @@ class WalletConnectV2 {
1661
1686
  switch (event) {
1662
1687
  case 'account':
1663
1688
  internalCallback = async(event)=> {
1664
- if(_optionalChain$1([event, 'optionalAccess', _61 => _61.topic]) === _optionalChain$1([this, 'access', _62 => _62.session, 'optionalAccess', _63 => _63.topic]) && event.params.event.name === 'accountsChanged') {
1689
+ if(_optionalChain$2([event, 'optionalAccess', _61 => _61.topic]) === _optionalChain$2([this, 'access', _62 => _62.session, 'optionalAccess', _63 => _63.topic]) && event.params.event.name === 'accountsChanged') {
1665
1690
  callback(await this.account());
1666
1691
  }
1667
1692
  };
@@ -1721,6 +1746,7 @@ class WalletConnectV2 {
1721
1746
 
1722
1747
  WalletConnectV2.getConnectedInstance = getConnectedInstance$1;
1723
1748
 
1749
+ 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; }
1724
1750
  const sendTransaction = async ({ transaction, wallet })=> {
1725
1751
  transaction = new Transaction(transaction);
1726
1752
  if((await wallet.connectedTo(transaction.blockchain)) == false) {
@@ -1771,7 +1797,10 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{
1771
1797
  try {
1772
1798
 
1773
1799
  sentTransaction.wait(1).then(resolve).catch((error)=>{
1774
- if(error && error.toString().match('undefined')) {
1800
+ if(
1801
+ (error && _optionalChain$1([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) ||
1802
+ (error && error.toString().match('undefined'))
1803
+ ) {
1775
1804
  setTimeout(()=>{
1776
1805
  retrieveConfirmedTransaction(sentTransaction)
1777
1806
  .then(resolve)
@@ -1782,7 +1811,10 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{
1782
1811
  }
1783
1812
  });
1784
1813
  } catch(error) {
1785
- if(error && error.toString().match('undefined')) {
1814
+ if(
1815
+ (error && _optionalChain$1([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) ||
1816
+ (error && error.toString().match('undefined'))
1817
+ ) {
1786
1818
  setTimeout(()=>{
1787
1819
  retrieveConfirmedTransaction(sentTransaction)
1788
1820
  .then(resolve)