From 896ca51c73e7295f66f4ddde45b898ca24ba84c7 Mon Sep 17 00:00:00 2001 From: Sebastian Pape <0xneo11@gmail.com> Date: Thu, 1 Aug 2024 16:18:35 +0200 Subject: [PATCH] v17.2.0: adds 6963 support for MetaMask, Uniswap and Rainbow --- dist/esm/index.evm.js | 284 ++++++++++++++++----------- dist/esm/index.js | 348 ++++++++++++++++++++-------------- dist/esm/index.solana.js | 82 ++++---- dist/umd/index.evm.js | 284 ++++++++++++++++----------- dist/umd/index.js | 348 ++++++++++++++++++++-------------- dist/umd/index.solana.js | 82 ++++---- package.evm.json | 2 +- package.json | 2 +- package.solana.json | 2 +- src/getWallets.js | 11 ++ src/index.js | 2 + src/wallets.js | 4 + src/wallets/MetaMask.js | 29 +-- src/wallets/Rainbow.js | 29 +++ src/wallets/Uniswap.js | 13 +- src/wallets/WindowEthereum.js | 2 + 16 files changed, 926 insertions(+), 598 deletions(-) create mode 100644 src/wallets/Rainbow.js diff --git a/dist/esm/index.evm.js b/dist/esm/index.evm.js index e826b305..80ece32c 100644 --- a/dist/esm/index.evm.js +++ b/dist/esm/index.evm.js @@ -8,7 +8,7 @@ let supported$1 = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanch supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base']; supported$1.solana = []; -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; } +function _optionalChain$o(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; } class Transaction { constructor({ @@ -33,7 +33,7 @@ class Transaction { this.to = (to && to.match('0x')) ? ethers.utils.getAddress(to) : to; // optional - this.value = _optionalChain$m([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); + this.value = _optionalChain$o([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); this.api = api; this.method = method; this.params = params; @@ -73,7 +73,7 @@ class Transaction { } getParamType(param) { - if(_optionalChain$m([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { + if(_optionalChain$o([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { return `(${param.components.map((param)=>this.getParamType(param)).join(',')})` } else { return param.type @@ -146,7 +146,7 @@ class Transaction { } } -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; } +function _optionalChain$n(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; } const sendTransaction$2 = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); @@ -201,7 +201,7 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{ sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$l([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$n([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -215,7 +215,7 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{ }); } catch(error) { if( - (error && _optionalChain$l([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$n([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -250,12 +250,12 @@ const submitContractInteraction$2 = async ({ transaction, signer, provider })=>{ if(contractArguments) { return await method(...contractArguments, { value: Transaction.bigNumberify(transaction.value, transaction.blockchain), - gasLimit: _optionalChain$l([gas, 'optionalAccess', _7 => _7.toHexString, 'call', _8 => _8()]) + gasLimit: _optionalChain$n([gas, 'optionalAccess', _7 => _7.toHexString, 'call', _8 => _8()]) }) } else { return await method({ value: Transaction.bigNumberify(transaction.value, transaction.blockchain), - gasLimit: _optionalChain$l([gas, 'optionalAccess', _9 => _9.toHexString, 'call', _10 => _10()]) + gasLimit: _optionalChain$n([gas, 'optionalAccess', _9 => _9.toHexString, 'call', _10 => _10()]) }) } }; @@ -267,7 +267,7 @@ const submitSimpleTransfer$2 = ({ transaction, signer })=>{ }) }; -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; } +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; } class WindowEthereum { @@ -279,37 +279,39 @@ class WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$k([window, 'optionalAccess', _36 => _36.ethereum]) && + _optionalChain$m([window, 'optionalAccess', _38 => _38.ethereum]) && // not MetaMask - !(_optionalChain$k([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) && + !(_optionalChain$m([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) && // not Coin98 - !_optionalChain$k([window, 'optionalAccess', _39 => _39.coin98]) && + !_optionalChain$m([window, 'optionalAccess', _41 => _41.coin98]) && // not Trust Wallet - !(_optionalChain$k([window, 'optionalAccess', _40 => _40.ethereum, 'optionalAccess', _41 => _41.isTrust]) || _optionalChain$k([window, 'optionalAccess', _42 => _42.ethereum, 'optionalAccess', _43 => _43.isTrustWallet])) && + !(_optionalChain$m([window, 'optionalAccess', _42 => _42.ethereum, 'optionalAccess', _43 => _43.isTrust]) || _optionalChain$m([window, 'optionalAccess', _44 => _44.ethereum, 'optionalAccess', _45 => _45.isTrustWallet])) && // not crypto.com - !_optionalChain$k([window, 'optionalAccess', _44 => _44.ethereum, 'optionalAccess', _45 => _45.isDeficonnectProvider]) && + !_optionalChain$m([window, 'optionalAccess', _46 => _46.ethereum, 'optionalAccess', _47 => _47.isDeficonnectProvider]) && // not HyperPay - !_optionalChain$k([window, 'optionalAccess', _46 => _46.ethereum, 'optionalAccess', _47 => _47.isHyperPay]) && + !_optionalChain$m([window, 'optionalAccess', _48 => _48.ethereum, 'optionalAccess', _49 => _49.isHyperPay]) && // not Phantom - !(window.phantom && !window.glow && !_optionalChain$k([window, 'optionalAccess', _48 => _48.solana, 'optionalAccess', _49 => _49.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && + !(window.phantom && !window.glow && !_optionalChain$m([window, 'optionalAccess', _50 => _50.solana, 'optionalAccess', _51 => _51.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && // not Rabby - !_optionalChain$k([window, 'optionalAccess', _50 => _50.ethereum, 'optionalAccess', _51 => _51.isRabby]) && + !_optionalChain$m([window, 'optionalAccess', _52 => _52.ethereum, 'optionalAccess', _53 => _53.isRabby]) && // not Backpack - !_optionalChain$k([window, 'optionalAccess', _52 => _52.backpack, 'optionalAccess', _53 => _53.isBackpack]) && + !_optionalChain$m([window, 'optionalAccess', _54 => _54.backpack, 'optionalAccess', _55 => _55.isBackpack]) && // not TokenPocket - !_optionalChain$k([window, 'optionalAccess', _54 => _54.ethereum, 'optionalAccess', _55 => _55.isTokenPocket]) && + !_optionalChain$m([window, 'optionalAccess', _56 => _56.ethereum, 'optionalAccess', _57 => _57.isTokenPocket]) && // not BitKeep - !_optionalChain$k([window, 'optionalAccess', _56 => _56.ethereum, 'optionalAccess', _57 => _57.isBitKeep]) && + !_optionalChain$m([window, 'optionalAccess', _58 => _58.ethereum, 'optionalAccess', _59 => _59.isBitKeep]) && // not Coinbase - !(_optionalChain$k([window, 'optionalAccess', _58 => _58.ethereum, 'optionalAccess', _59 => _59.isCoinbaseWallet]) || _optionalChain$k([window, 'optionalAccess', _60 => _60.ethereum, 'optionalAccess', _61 => _61.isWalletLink])) && + !(_optionalChain$m([window, 'optionalAccess', _60 => _60.ethereum, 'optionalAccess', _61 => _61.isCoinbaseWallet]) || _optionalChain$m([window, 'optionalAccess', _62 => _62.ethereum, 'optionalAccess', _63 => _63.isWalletLink])) && // MetaMask through ProviderMap - !_optionalChain$k([window, 'optionalAccess', _62 => _62.ethereum, 'optionalAccess', _63 => _63.providerMap, 'optionalAccess', _64 => _64.has, 'call', _65 => _65('MetaMask')]) && + !_optionalChain$m([window, 'optionalAccess', _64 => _64.ethereum, 'optionalAccess', _65 => _65.providerMap, 'optionalAccess', _66 => _66.has, 'call', _67 => _67('MetaMask')]) && // Brave Wallet - !_optionalChain$k([window, 'optionalAccess', _66 => _66.ethereum, 'optionalAccess', _67 => _67.isBraveWallet]) && + !_optionalChain$m([window, 'optionalAccess', _68 => _68.ethereum, 'optionalAccess', _69 => _69.isBraveWallet]) && // Uniswap Wallet - !_optionalChain$k([window, 'optionalAccess', _68 => _68.ethereum, 'optionalAccess', _69 => _69.isUniswapWallet]) && + !_optionalChain$m([window, 'optionalAccess', _70 => _70.ethereum, 'optionalAccess', _71 => _71.isUniswapWallet]) && + // Rainbow + !_optionalChain$m([window, 'optionalAccess', _72 => _72.ethereum, 'optionalAccess', _73 => _73.isRainbow]) && // OKX Wallet - !_optionalChain$k([window, 'optionalAccess', _70 => _70.okxwallet]) + !_optionalChain$m([window, 'optionalAccess', _74 => _74.okxwallet]) ) };} @@ -435,7 +437,7 @@ class WindowEthereum { } } WindowEthereum.__initStatic(); WindowEthereum.__initStatic2(); -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; } +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; } class Binance extends WindowEthereum { static __initStatic() {this.info = { @@ -445,7 +447,7 @@ class Binance extends WindowEthereum { };} static __initStatic2() {this.isAvailable = async()=>{ - return _optionalChain$j([window, 'optionalAccess', _2 => _2.BinanceChain]) && + return _optionalChain$l([window, 'optionalAccess', _2 => _2.BinanceChain]) && !window.coin98 && !window.trustwallet };} @@ -465,7 +467,7 @@ var logos = { okx: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMzYuMSAzMzYuMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzM2LjEgMzM2LjE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleH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NXY2NC43YzAsMi43LDIuMiw1LDUsNWg2NC43YzIuNywwLDUtMi4yLDUtNXYtNjQuNwoJQzI4NC4xLDIwNy42LDI4MS45LDIwNS40LDI3OS4xLDIwNS40eiIvPgo8L3N2Zz4K", }; -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; } +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; } class BraveEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -475,14 +477,14 @@ class BraveEVM extends WindowEthereum { platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$i([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$k([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };} getProvider() { return window.ethereum } } BraveEVM.__initStatic(); BraveEVM.__initStatic2(); -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; } +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; } class Coin98EVM extends WindowEthereum { static __initStatic() {this.info = { @@ -492,13 +494,13 @@ class Coin98EVM extends WindowEthereum { platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$h([window, 'optionalAccess', _2 => _2.coin98]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$j([window, 'optionalAccess', _2 => _2.coin98]) };} getProvider() { return window.coin98.provider } } Coin98EVM.__initStatic(); Coin98EVM.__initStatic2(); -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; } +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; } class CoinbaseEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -509,8 +511,8 @@ class CoinbaseEVM extends WindowEthereum { };} getProvider() { - if(_optionalChain$g([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) { - return _optionalChain$g([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')]) + if(_optionalChain$i([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) { + return _optionalChain$i([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')]) } else { return window.ethereum } @@ -519,15 +521,15 @@ class CoinbaseEVM extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return( ( - _optionalChain$g([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$g([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink]) + _optionalChain$i([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$i([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink]) ) || ( - _optionalChain$g([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')]) + _optionalChain$i([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')]) ) ) };} } CoinbaseEVM.__initStatic(); CoinbaseEVM.__initStatic2(); -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; } +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; } class CryptoCom extends WindowEthereum { static __initStatic() {this.info = { @@ -536,10 +538,10 @@ class CryptoCom extends WindowEthereum { blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$h([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };} } CryptoCom.__initStatic(); CryptoCom.__initStatic2(); -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; } +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; } class ExodusEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -549,10 +551,10 @@ class ExodusEVM extends WindowEthereum { platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$e([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$g([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };} } ExodusEVM.__initStatic(); ExodusEVM.__initStatic2(); -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; } +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; } class HyperPay extends WindowEthereum { static __initStatic() {this.info = { @@ -561,10 +563,10 @@ class HyperPay extends WindowEthereum { blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$d([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };} } HyperPay.__initStatic(); HyperPay.__initStatic2(); -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; } +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; } class MagicEdenEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -576,12 +578,12 @@ class MagicEdenEVM extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMagicEden]) + _optionalChain$e([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMagicEden]) ) };} } MagicEdenEVM.__initStatic(); MagicEdenEVM.__initStatic2(); -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; } +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; } class OKXEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -593,12 +595,12 @@ class OKXEVM extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$b([window, 'optionalAccess', _2 => _2.okxwallet]) + _optionalChain$d([window, 'optionalAccess', _2 => _2.okxwallet]) ) };} } OKXEVM.__initStatic(); OKXEVM.__initStatic2(); -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; } +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; } class MetaMask extends WindowEthereum { static __initStatic() {this.info = { @@ -607,27 +609,32 @@ class MetaMask extends WindowEthereum { blockchains: supported$1.evm };} - getProvider() { - if(_optionalChain$a([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) { - return _optionalChain$a([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')]) - } else { - return window.ethereum - } - } + static __initStatic2() {this.isMetaMask = (provider)=> { + return( + _optionalChain$c([provider, 'optionalAccess', _3 => _3.isMetaMask]) && + Object.keys(provider).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 + ) + };} - static __initStatic2() {this.isAvailable = async()=>{ + static __initStatic3() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return MetaMask.isMetaMask(provider) + }) : undefined + };} + + static __initStatic4() {this.isAvailable = async()=>{ return( - ( - _optionalChain$a([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) && - Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 - ) || ( - _optionalChain$a([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')]) - ) + MetaMask.getEip6963Provider() || + MetaMask.isMetaMask(_optionalChain$c([window, 'optionalAccess', _4 => _4.ethereum])) ) };} -} MetaMask.__initStatic(); MetaMask.__initStatic2(); -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; } + getProvider() { + return MetaMask.getEip6963Provider() || (MetaMask.isMetaMask(_optionalChain$c([window, 'optionalAccess', _5 => _5.ethereum])) && _optionalChain$c([window, 'optionalAccess', _6 => _6.ethereum])) + } +} MetaMask.__initStatic(); MetaMask.__initStatic2(); MetaMask.__initStatic3(); MetaMask.__initStatic4(); + +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; } class Opera extends WindowEthereum { static __initStatic() {this.info = { @@ -636,10 +643,10 @@ class Opera extends WindowEthereum { blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$b([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };} } Opera.__initStatic(); Opera.__initStatic2(); -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; } +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; } class PhantomEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -653,13 +660,13 @@ class PhantomEVM extends WindowEthereum { return ( window.phantom && window.phantom.ethereum && - ! _optionalChain$8([window, 'optionalAccess', _4 => _4.ethereum, 'optionalAccess', _5 => _5.isMagicEden]) && - ! _optionalChain$8([window, 'optionalAccess', _6 => _6.okxwallet]) + ! _optionalChain$a([window, 'optionalAccess', _4 => _4.ethereum, 'optionalAccess', _5 => _5.isMagicEden]) && + ! _optionalChain$a([window, 'optionalAccess', _6 => _6.okxwallet]) ) };} } PhantomEVM.__initStatic(); PhantomEVM.__initStatic2(); -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; } +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; } class Rabby extends WindowEthereum { static __initStatic() {this.info = { @@ -670,12 +677,12 @@ class Rabby extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return( - _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby]) + _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby]) ) };} } Rabby.__initStatic(); Rabby.__initStatic2(); -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; } +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; } class Uniswap extends WindowEthereum { static __initStatic() {this.info = { @@ -684,14 +691,53 @@ class Uniswap extends WindowEthereum { blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ + static __initStatic2() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return _optionalChain$8([provider, 'optionalAccess', _4 => _4.isUniswapWallet]) + }) : undefined + };} + + static __initStatic3() {this.isAvailable = async()=>{ return( - _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isUniswapWallet]) + Uniswap.getEip6963Provider() || + _optionalChain$8([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isUniswapWallet]) ) };} -} Uniswap.__initStatic(); Uniswap.__initStatic2(); -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; } + getProvider() { + return Uniswap.getEip6963Provider() || (_optionalChain$8([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isUniswapWallet]) && _optionalChain$8([window, 'optionalAccess', _9 => _9.ethereum])) + } +} Uniswap.__initStatic(); Uniswap.__initStatic2(); Uniswap.__initStatic3(); + +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; } +class Rainbow extends WindowEthereum { + + static __initStatic() {this.info = { + name: 'Rainbow', + logo: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzhIMjZDNTYuOTI3OSAzOCA4MiA2My4wNzIxIDgyIDk0VjEwMEg5NEM5Ny4zMTM3IDEwMCAxMDAgOTcuMzEzNyAxMDAgOTRDMTAwIDUzLjEzMDkgNjYuODY5MSAyMCAyNiAyMEMyMi42ODYzIDIwIDIwIDIyLjY4NjMgMjAgMjZWMzhaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNODQgOTRIMTAwQzEwMCA5Ny4zMTM3IDk3LjMxMzcgMTAwIDk0IDEwMEg4NFY5NFoiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl82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bGF0ZSgyNiA5NCkgcm90YXRlKC05MCkgc2NhbGUoNDIpIj4KPHN0b3Agb2Zmc2V0PSIwLjU5NTEzIiBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50OF9yYWRpYWxfNjJfMzI5IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUxIDk3KSBzY2FsZSgxNyA0NS4zMzMzKSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjMgNjkpIHJvdGF0ZSgtOTApIHNjYWxlKDE3IDMyMi4zNykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=", + blockchains: supported$1.evm + };} + + static __initStatic2() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return _optionalChain$7([provider, 'optionalAccess', _4 => _4.isRainbow]) + }) : undefined + };} + + static __initStatic3() {this.isAvailable = async()=>{ + return( + Rainbow.getEip6963Provider() || + _optionalChain$7([window, 'optionalAccess', _5 => _5.rainbow, 'optionalAccess', _6 => _6.isRainbow]) + ) + };} + + getProvider() { + return Rainbow.getEip6963Provider() || _optionalChain$7([window, 'optionalAccess', _7 => _7.rainbow]) + } + +} Rainbow.__initStatic(); Rainbow.__initStatic2(); Rainbow.__initStatic3(); + +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; } class TokenPocket extends WindowEthereum { static __initStatic() {this.info = { @@ -702,12 +748,12 @@ class TokenPocket extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$5([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket]) + _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket]) ) };} } TokenPocket.__initStatic(); TokenPocket.__initStatic2(); -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; } +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; } class TrustEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -719,7 +765,7 @@ class TrustEVM extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - (_optionalChain$4([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$4([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) && + (_optionalChain$5([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$5([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!Debug)(?!TrustWallet)(?!MetaMask)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 ) };} @@ -824,7 +870,7 @@ const getSmartContractWallet = async(blockchain, address)=> { } }; -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; } +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; } const sendTransaction$1 = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); @@ -875,7 +921,7 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{ try { sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$3([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -889,7 +935,7 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{ }); } catch (error) { if( - (error && _optionalChain$3([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -920,7 +966,7 @@ const retrieveTransaction = (tx, blockchain)=>{ resolve(sentTransaction); } catch (error) { if( - (error && _optionalChain$3([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -962,8 +1008,8 @@ const submitContractInteraction$1 = async ({ transaction, wallet })=>{ to: transaction.to, value: transaction.value ? ethers.BigNumber.from(transaction.value.toString()).toHexString() : undefined, data: await transaction.getData(), - gas: _optionalChain$3([gas, 'optionalAccess', _10 => _10.toHexString, 'call', _11 => _11()]), - gasLimit: _optionalChain$3([gas, 'optionalAccess', _12 => _12.toHexString, 'call', _13 => _13()]), + gas: _optionalChain$4([gas, 'optionalAccess', _10 => _10.toHexString, 'call', _11 => _11()]), + gasLimit: _optionalChain$4([gas, 'optionalAccess', _12 => _12.toHexString, 'call', _13 => _13()]), gasPrice: gasPrice.toHexString(), nonce: ethers.utils.hexlify(transaction.nonce), }] @@ -990,16 +1036,16 @@ const submitSimpleTransfer$1 = async ({ transaction, wallet })=>{ to: transaction.to, value: transaction.value ? ethers.BigNumber.from(transaction.value.toString()).toHexString() : undefined, data: '0x0', - gas: _optionalChain$3([gas, 'optionalAccess', _14 => _14.toHexString, 'call', _15 => _15()]), - gasLimit: _optionalChain$3([gas, 'optionalAccess', _16 => _16.toHexString, 'call', _17 => _17()]), - gasPrice: _optionalChain$3([gasPrice, 'optionalAccess', _18 => _18.toHexString, 'call', _19 => _19()]), + gas: _optionalChain$4([gas, 'optionalAccess', _14 => _14.toHexString, 'call', _15 => _15()]), + gasLimit: _optionalChain$4([gas, 'optionalAccess', _16 => _16.toHexString, 'call', _17 => _17()]), + gasPrice: _optionalChain$4([gasPrice, 'optionalAccess', _18 => _18.toHexString, 'call', _19 => _19()]), nonce: ethers.utils.hexlify(transaction.nonce) }] } }).catch((e)=>{console.log('ERROR', e);}) }; -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; } +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; } const KEY = 'depay:wallets:wc2'; @@ -1052,7 +1098,7 @@ const getWalletConnectV2Config = (walletName)=>{ optionalNamespaces['eip155'] = { chains: supported$1.evm.map((blockchain)=>`${Blockchains[blockchain].namespace}:${Blockchains[blockchain].networkId}`), }; - if(_optionalChain$2([optionalNamespaces, 'optionalAccess', _ => _.eip155]) && _optionalChain$2([optionalNamespaces, 'optionalAccess', _2 => _2.eip155, 'optionalAccess', _3 => _3.chains, 'optionalAccess', _4 => _4.length])) { + if(_optionalChain$3([optionalNamespaces, 'optionalAccess', _ => _.eip155]) && _optionalChain$3([optionalNamespaces, 'optionalAccess', _2 => _2.eip155, 'optionalAccess', _3 => _3.chains, 'optionalAccess', _4 => _4.length])) { optionalNamespaces['eip155'].methods = methods; optionalNamespaces['eip155'].events = events; } @@ -1067,9 +1113,9 @@ const getSignClient = ()=>{ projectId: localStorage[KEY+":projectId"], metadata: { name: document.title || 'dApp', - description: _optionalChain$2([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('meta[name="description"]'), 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8('content')]) || document.title || 'dApp', + description: _optionalChain$3([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('meta[name="description"]'), 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8('content')]) || document.title || 'dApp', url: location.href, - icons: [_optionalChain$2([document, 'access', _9 => _9.querySelector, 'call', _10 => _10("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _11 => _11.href]) || `${location.origin}/favicon.ico`] + icons: [_optionalChain$3([document, 'access', _9 => _9.querySelector, 'call', _10 => _10("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _11 => _11.href]) || `${location.origin}/favicon.ico`] } }); resolve(signClient); @@ -1087,7 +1133,7 @@ class WalletConnectV2 { };} static __initStatic2() {this.isAvailable = async(options)=>{ - return !! await getLastSession(_optionalChain$2([options, 'optionalAccess', _13 => _13.walletName])) + return !! await getLastSession(_optionalChain$3([options, 'optionalAccess', _13 => _13.walletName])) };} constructor() { @@ -1102,17 +1148,17 @@ class WalletConnectV2 { } async account() { - if(_optionalChain$2([this, 'access', _14 => _14.session, 'optionalAccess', _15 => _15.namespaces, 'optionalAccess', _16 => _16.eip155, 'optionalAccess', _17 => _17.accounts, 'optionalAccess', _18 => _18.length])) { + if(_optionalChain$3([this, 'access', _14 => _14.session, 'optionalAccess', _15 => _15.namespaces, 'optionalAccess', _16 => _16.eip155, 'optionalAccess', _17 => _17.accounts, 'optionalAccess', _18 => _18.length])) { return this.session.namespaces.eip155.accounts[0].split(':')[2] } } async setSessionBlockchains() { - if(!this.session || (!_optionalChain$2([this, 'access', _19 => _19.session, 'optionalAccess', _20 => _20.namespaces, 'optionalAccess', _21 => _21.eip155]) && !_optionalChain$2([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.optionalNamespaces, 'optionalAccess', _24 => _24.eip155]))) { return } + if(!this.session || (!_optionalChain$3([this, 'access', _19 => _19.session, 'optionalAccess', _20 => _20.namespaces, 'optionalAccess', _21 => _21.eip155]) && !_optionalChain$3([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.optionalNamespaces, 'optionalAccess', _24 => _24.eip155]))) { return } if(this.session.namespaces.eip155.chains) { - this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$2([Blockchains, 'access', _25 => _25.findByNetworkId, 'call', _26 => _26(chainIdentifier.split(':')[1]), 'optionalAccess', _27 => _27.name])).filter(Boolean); + this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$3([Blockchains, 'access', _25 => _25.findByNetworkId, 'call', _26 => _26(chainIdentifier.split(':')[1]), 'optionalAccess', _27 => _27.name])).filter(Boolean); } else if(this.session.namespaces.eip155.accounts) { - this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$2([Blockchains, 'access', _28 => _28.findByNetworkId, 'call', _29 => _29(accountIdentifier.split(':')[1]), 'optionalAccess', _30 => _30.name])).filter(Boolean); + this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$3([Blockchains, 'access', _28 => _28.findByNetworkId, 'call', _29 => _29(accountIdentifier.split(':')[1]), 'optionalAccess', _30 => _30.name])).filter(Boolean); } } @@ -1122,13 +1168,13 @@ class WalletConnectV2 { try { - this.walletName = _optionalChain$2([options, 'optionalAccess', _31 => _31.name]); + this.walletName = _optionalChain$3([options, 'optionalAccess', _31 => _31.name]); // delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS this.signClient = await getSignClient(); this.signClient.on("session_delete", (session)=> { - if(_optionalChain$2([session, 'optionalAccess', _32 => _32.topic]) === _optionalChain$2([this, 'access', _33 => _33.session, 'optionalAccess', _34 => _34.topic])) { + if(_optionalChain$3([session, 'optionalAccess', _32 => _32.topic]) === _optionalChain$3([this, 'access', _33 => _33.session, 'optionalAccess', _34 => _34.topic])) { localStorage[KEY+':name'] = undefined; localStorage[KEY+':logo'] = undefined; this.signClient = undefined; @@ -1137,14 +1183,14 @@ class WalletConnectV2 { }); this.signClient.on("session_update", async(session)=> { - if(_optionalChain$2([session, 'optionalAccess', _35 => _35.topic]) === _optionalChain$2([this, 'access', _36 => _36.session, 'optionalAccess', _37 => _37.topic])) { + if(_optionalChain$3([session, 'optionalAccess', _35 => _35.topic]) === _optionalChain$3([this, 'access', _36 => _36.session, 'optionalAccess', _37 => _37.topic])) { this.session = this.signClient.session.get(session.topic); await this.setSessionBlockchains(); } }); this.signClient.on("session_event", (event)=> { - if(_optionalChain$2([event, 'optionalAccess', _38 => _38.topic]) === _optionalChain$2([this, 'access', _39 => _39.session, 'optionalAccess', _40 => _40.topic])) {} + if(_optionalChain$3([event, 'optionalAccess', _38 => _38.topic]) === _optionalChain$3([this, 'access', _39 => _39.session, 'optionalAccess', _40 => _40.topic])) {} }); const connectWallet = async()=>{ @@ -1155,24 +1201,24 @@ class WalletConnectV2 { await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect }; - const lastSession = _optionalChain$2([this, 'optionalAccess', _41 => _41.walletName, 'optionalAccess', _42 => _42.length]) ? await getLastSession(this.walletName) : undefined; + const lastSession = _optionalChain$3([this, 'optionalAccess', _41 => _41.walletName, 'optionalAccess', _42 => _42.length]) ? await getLastSession(this.walletName) : undefined; if(lastSession) { this.session = lastSession; } else { await connectWallet(); } - let meta = _optionalChain$2([this, 'access', _43 => _43.session, 'optionalAccess', _44 => _44.peer, 'optionalAccess', _45 => _45.metadata]); + let meta = _optionalChain$3([this, 'access', _43 => _43.session, 'optionalAccess', _44 => _44.peer, 'optionalAccess', _45 => _45.metadata]); if(meta && meta.name) { this.name = meta.name; localStorage[KEY+':name'] = meta.name; - if(_optionalChain$2([meta, 'optionalAccess', _46 => _46.icons]) && meta.icons.length) { + if(_optionalChain$3([meta, 'optionalAccess', _46 => _46.icons]) && meta.icons.length) { this.logo = meta.icons[0]; localStorage[KEY+':logo'] = this.logo; } } - if(_optionalChain$2([options, 'optionalAccess', _47 => _47.name])) { localStorage[KEY+':name'] = this.name = options.name; } - if(_optionalChain$2([options, 'optionalAccess', _48 => _48.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; } + if(_optionalChain$3([options, 'optionalAccess', _47 => _47.name])) { localStorage[KEY+':name'] = this.name = options.name; } + if(_optionalChain$3([options, 'optionalAccess', _48 => _48.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; } await this.setSessionBlockchains(); @@ -1212,7 +1258,7 @@ class WalletConnectV2 { switch (event) { case 'account': internalCallback = async(event)=> { - if(_optionalChain$2([event, 'optionalAccess', _49 => _49.topic]) === _optionalChain$2([this, 'access', _50 => _50.session, 'optionalAccess', _51 => _51.topic]) && event.params.event.name === 'accountsChanged') { + if(_optionalChain$3([event, 'optionalAccess', _49 => _49.topic]) === _optionalChain$3([this, 'access', _50 => _50.session, 'optionalAccess', _51 => _51.topic]) && event.params.event.name === 'accountsChanged') { callback(await this.account()); } }; @@ -1272,7 +1318,7 @@ class WalletConnectV2 { WalletConnectV2.getConnectedInstance = getConnectedInstance$1; -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; } +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; } const sendTransaction = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); if((await wallet.connectedTo(transaction.blockchain)) == false) { @@ -1324,7 +1370,7 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{ sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$1([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$2([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1338,7 +1384,7 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{ }); } catch(error) { if( - (error && _optionalChain$1([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$2([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1383,7 +1429,7 @@ const submitSimpleTransfer = ({ transaction, signer })=>{ }) }; -function _optionalChain(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; } +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; } const getConnectedInstance = ()=>{ return window._connectedWalletLinkInstance @@ -1437,10 +1483,10 @@ class WalletLink { let connect = (options && options.connect) ? options.connect : ({uri})=>{}; await connect({ uri: this.connector.qrUrl }); - _optionalChain([document, 'access', _ => _.querySelector, 'call', _2 => _2('.-cbwsdk-css-reset'), 'optionalAccess', _3 => _3.setAttribute, 'call', _4 => _4('style', 'display: none;')]); - _optionalChain([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('.-cbwsdk-extension-dialog-container'), 'optionalAccess', _7 => _7.setAttribute, 'call', _8 => _8('style', 'display: none;')]); + _optionalChain$1([document, 'access', _ => _.querySelector, 'call', _2 => _2('.-cbwsdk-css-reset'), 'optionalAccess', _3 => _3.setAttribute, 'call', _4 => _4('style', 'display: none;')]); + _optionalChain$1([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('.-cbwsdk-extension-dialog-container'), 'optionalAccess', _7 => _7.setAttribute, 'call', _8 => _8('style', 'display: none;')]); setTimeout(()=>{ - if(_optionalChain([this, 'optionalAccess', _9 => _9.connector, 'optionalAccess', _10 => _10._relay, 'optionalAccess', _11 => _11.ui, 'optionalAccess', _12 => _12.linkFlow, 'optionalAccess', _13 => _13.isOpen])){ + if(_optionalChain$1([this, 'optionalAccess', _9 => _9.connector, 'optionalAccess', _10 => _10._relay, 'optionalAccess', _11 => _11.ui, 'optionalAccess', _12 => _12.linkFlow, 'optionalAccess', _13 => _13.isOpen])){ this.connector._relay.ui.linkFlow.isOpen = false; } }, 10); @@ -1565,6 +1611,7 @@ var wallets = { TrustEVM, Rabby, Uniswap, + Rainbow, BraveEVM, Opera, MagicEdenEVM, @@ -1582,10 +1629,22 @@ var wallets = { WalletLink }; +function _optionalChain(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; } const getWallets = async(args)=>{ let drip = (args && typeof args.drip === 'function') ? args.drip : undefined; + // eip6963 + window['_eip6963Providers'] = {}; + const announceProvider = (event)=>{ + if(_optionalChain([event, 'optionalAccess', _ => _.detail, 'optionalAccess', _2 => _2.info, 'optionalAccess', _3 => _3.uuid])) { + window['_eip6963Providers'][_optionalChain([event, 'optionalAccess', _4 => _4.detail, 'optionalAccess', _5 => _5.info, 'optionalAccess', _6 => _6.uuid])] = event.detail.provider; + } + }; + window.addEventListener("eip6963:announceProvider", announceProvider); + window.dispatchEvent(new Event("eip6963:requestProvider")); + window.removeEventListener("eip6963:announceProvider", announceProvider); + let availableWallets = await Promise.all( Object.keys(wallets).map( @@ -1620,6 +1679,7 @@ const supported = [ wallets.TrustEVM, wallets.Rabby, wallets.Uniswap, + wallets.Rainbow, wallets.PhantomEVM, wallets.BraveEVM, wallets.OKXEvm, diff --git a/dist/esm/index.js b/dist/esm/index.js index c71a4747..ef01ca1b 100644 --- a/dist/esm/index.js +++ b/dist/esm/index.js @@ -5,7 +5,7 @@ import { ethers } from 'ethers'; import { SignClient } from '@depay/walletconnect-v2'; import { CoinbaseWalletSDK } from '@depay/coinbase-wallet-sdk'; -function _optionalChain$y(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; } +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; } class Transaction { constructor({ @@ -30,7 +30,7 @@ class Transaction { this.to = (to && to.match('0x')) ? ethers.utils.getAddress(to) : to; // optional - this.value = _optionalChain$y([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); + this.value = _optionalChain$A([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); this.api = api; this.method = method; this.params = params; @@ -70,7 +70,7 @@ class Transaction { } getParamType(param) { - if(_optionalChain$y([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { + if(_optionalChain$A([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { return `(${param.components.map((param)=>this.getParamType(param)).join(',')})` } else { return param.type @@ -143,7 +143,7 @@ class Transaction { } } -function _optionalChain$x(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; } +function _optionalChain$z(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; } const POLL_SPEED = 500; // 0.5 seconds const MAX_POLLS = 240; // 120 seconds @@ -164,14 +164,14 @@ const sendTransaction$3 = async ({ transaction, wallet })=> { const provider = await getProvider(transaction.blockchain); const { value } = await provider.getSignatureStatus(signature); - const confirmationStatus = _optionalChain$x([value, 'optionalAccess', _ => _.confirmationStatus]); + const confirmationStatus = _optionalChain$z([value, 'optionalAccess', _ => _.confirmationStatus]); if(confirmationStatus) { const hasReachedSufficientCommitment = confirmationStatus === 'confirmed' || confirmationStatus === 'finalized'; if (hasReachedSufficientCommitment) { if(value.err) { transaction._failed = true; const confirmedTransaction = await provider.getConfirmedTransaction(signature); - const failedReason = _optionalChain$x([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null; + const failedReason = _optionalChain$z([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null; if(transaction.failed) transaction.failed(transaction, failedReason); } else { transaction._succeeded = true; @@ -262,7 +262,7 @@ let supported$1 = ['ethereum', 'bsc', 'polygon', 'solana', 'fantom', 'arbitrum', supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base']; supported$1.solana = ['solana']; -function _optionalChain$w(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; } +function _optionalChain$y(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; } class WindowSolana { static __initStatic() {this.info = { @@ -273,13 +273,13 @@ class WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$w([window, 'optionalAccess', _6 => _6.solana]) && + _optionalChain$y([window, 'optionalAccess', _6 => _6.solana]) && // not Phantom !(window.phantom && !window.glow && !window.solana.isGlow && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && // not Coin98 !window.coin98 && // not BitKeep - !(_optionalChain$w([window, 'optionalAccess', _7 => _7.solana]) && _optionalChain$w([window, 'optionalAccess', _8 => _8.solana, 'access', _9 => _9.isBitKeep])) && + !(_optionalChain$y([window, 'optionalAccess', _7 => _7.solana]) && _optionalChain$y([window, 'optionalAccess', _8 => _8.solana, 'access', _9 => _9.isBitKeep])) && // not Glow !window.solana.isGlow && // not trust @@ -287,7 +287,7 @@ class WindowSolana { // Brave Wallet !window.solana.isBraveWallet && // OKX Wallet - !_optionalChain$w([window, 'optionalAccess', _10 => _10.okxwallet]) + !_optionalChain$y([window, 'optionalAccess', _10 => _10.okxwallet]) ) };} @@ -334,7 +334,7 @@ class WindowSolana { let internalCallback; switch (event) { case 'account': - internalCallback = (publicKey) => callback(_optionalChain$w([publicKey, 'optionalAccess', _11 => _11.toString, 'call', _12 => _12()])); + internalCallback = (publicKey) => callback(_optionalChain$y([publicKey, 'optionalAccess', _11 => _11.toString, 'call', _12 => _12()])); this.getProvider().on('accountChanged', internalCallback); break } @@ -387,7 +387,7 @@ class WindowSolana { } } WindowSolana.__initStatic(); WindowSolana.__initStatic2(); -function _optionalChain$v(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; } +function _optionalChain$x(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; } class Backpack extends WindowSolana { @@ -399,7 +399,7 @@ class Backpack extends WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$v([window, 'optionalAccess', _2 => _2.backpack]) && + _optionalChain$x([window, 'optionalAccess', _2 => _2.backpack]) && window.backpack.isBackpack ) };} @@ -417,7 +417,7 @@ class Backpack extends WindowSolana { } } Backpack.__initStatic(); Backpack.__initStatic2(); -function _optionalChain$u(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; } +function _optionalChain$w(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; } const sendTransaction$2 = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); @@ -472,7 +472,7 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{ sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$u([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$w([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -486,7 +486,7 @@ const retrieveConfirmedTransaction$2 = (sentTransaction)=>{ }); } catch(error) { if( - (error && _optionalChain$u([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$w([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -521,12 +521,12 @@ const submitContractInteraction$2 = async ({ transaction, signer, provider })=>{ if(contractArguments) { return await method(...contractArguments, { value: Transaction.bigNumberify(transaction.value, transaction.blockchain), - gasLimit: _optionalChain$u([gas, 'optionalAccess', _7 => _7.toHexString, 'call', _8 => _8()]) + gasLimit: _optionalChain$w([gas, 'optionalAccess', _7 => _7.toHexString, 'call', _8 => _8()]) }) } else { return await method({ value: Transaction.bigNumberify(transaction.value, transaction.blockchain), - gasLimit: _optionalChain$u([gas, 'optionalAccess', _9 => _9.toHexString, 'call', _10 => _10()]) + gasLimit: _optionalChain$w([gas, 'optionalAccess', _9 => _9.toHexString, 'call', _10 => _10()]) }) } }; @@ -538,7 +538,7 @@ const submitSimpleTransfer$2 = ({ transaction, signer })=>{ }) }; -function _optionalChain$t(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; } +function _optionalChain$v(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; } class WindowEthereum { @@ -550,37 +550,39 @@ class WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$t([window, 'optionalAccess', _36 => _36.ethereum]) && + _optionalChain$v([window, 'optionalAccess', _38 => _38.ethereum]) && // not MetaMask - !(_optionalChain$t([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) && + !(_optionalChain$v([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) && // not Coin98 - !_optionalChain$t([window, 'optionalAccess', _39 => _39.coin98]) && + !_optionalChain$v([window, 'optionalAccess', _41 => _41.coin98]) && // not Trust Wallet - !(_optionalChain$t([window, 'optionalAccess', _40 => _40.ethereum, 'optionalAccess', _41 => _41.isTrust]) || _optionalChain$t([window, 'optionalAccess', _42 => _42.ethereum, 'optionalAccess', _43 => _43.isTrustWallet])) && + !(_optionalChain$v([window, 'optionalAccess', _42 => _42.ethereum, 'optionalAccess', _43 => _43.isTrust]) || _optionalChain$v([window, 'optionalAccess', _44 => _44.ethereum, 'optionalAccess', _45 => _45.isTrustWallet])) && // not crypto.com - !_optionalChain$t([window, 'optionalAccess', _44 => _44.ethereum, 'optionalAccess', _45 => _45.isDeficonnectProvider]) && + !_optionalChain$v([window, 'optionalAccess', _46 => _46.ethereum, 'optionalAccess', _47 => _47.isDeficonnectProvider]) && // not HyperPay - !_optionalChain$t([window, 'optionalAccess', _46 => _46.ethereum, 'optionalAccess', _47 => _47.isHyperPay]) && + !_optionalChain$v([window, 'optionalAccess', _48 => _48.ethereum, 'optionalAccess', _49 => _49.isHyperPay]) && // not Phantom - !(window.phantom && !window.glow && !_optionalChain$t([window, 'optionalAccess', _48 => _48.solana, 'optionalAccess', _49 => _49.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && + !(window.phantom && !window.glow && !_optionalChain$v([window, 'optionalAccess', _50 => _50.solana, 'optionalAccess', _51 => _51.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && // not Rabby - !_optionalChain$t([window, 'optionalAccess', _50 => _50.ethereum, 'optionalAccess', _51 => _51.isRabby]) && + !_optionalChain$v([window, 'optionalAccess', _52 => _52.ethereum, 'optionalAccess', _53 => _53.isRabby]) && // not Backpack - !_optionalChain$t([window, 'optionalAccess', _52 => _52.backpack, 'optionalAccess', _53 => _53.isBackpack]) && + !_optionalChain$v([window, 'optionalAccess', _54 => _54.backpack, 'optionalAccess', _55 => _55.isBackpack]) && // not TokenPocket - !_optionalChain$t([window, 'optionalAccess', _54 => _54.ethereum, 'optionalAccess', _55 => _55.isTokenPocket]) && + !_optionalChain$v([window, 'optionalAccess', _56 => _56.ethereum, 'optionalAccess', _57 => _57.isTokenPocket]) && // not BitKeep - !_optionalChain$t([window, 'optionalAccess', _56 => _56.ethereum, 'optionalAccess', _57 => _57.isBitKeep]) && + !_optionalChain$v([window, 'optionalAccess', _58 => _58.ethereum, 'optionalAccess', _59 => _59.isBitKeep]) && // not Coinbase - !(_optionalChain$t([window, 'optionalAccess', _58 => _58.ethereum, 'optionalAccess', _59 => _59.isCoinbaseWallet]) || _optionalChain$t([window, 'optionalAccess', _60 => _60.ethereum, 'optionalAccess', _61 => _61.isWalletLink])) && + !(_optionalChain$v([window, 'optionalAccess', _60 => _60.ethereum, 'optionalAccess', _61 => _61.isCoinbaseWallet]) || _optionalChain$v([window, 'optionalAccess', _62 => _62.ethereum, 'optionalAccess', _63 => _63.isWalletLink])) && // MetaMask through ProviderMap - !_optionalChain$t([window, 'optionalAccess', _62 => _62.ethereum, 'optionalAccess', _63 => _63.providerMap, 'optionalAccess', _64 => _64.has, 'call', _65 => _65('MetaMask')]) && + !_optionalChain$v([window, 'optionalAccess', _64 => _64.ethereum, 'optionalAccess', _65 => _65.providerMap, 'optionalAccess', _66 => _66.has, 'call', _67 => _67('MetaMask')]) && // Brave Wallet - !_optionalChain$t([window, 'optionalAccess', _66 => _66.ethereum, 'optionalAccess', _67 => _67.isBraveWallet]) && + !_optionalChain$v([window, 'optionalAccess', _68 => _68.ethereum, 'optionalAccess', _69 => _69.isBraveWallet]) && // Uniswap Wallet - !_optionalChain$t([window, 'optionalAccess', _68 => _68.ethereum, 'optionalAccess', _69 => _69.isUniswapWallet]) && + !_optionalChain$v([window, 'optionalAccess', _70 => _70.ethereum, 'optionalAccess', _71 => _71.isUniswapWallet]) && + // Rainbow + !_optionalChain$v([window, 'optionalAccess', _72 => _72.ethereum, 'optionalAccess', _73 => _73.isRainbow]) && // OKX Wallet - !_optionalChain$t([window, 'optionalAccess', _70 => _70.okxwallet]) + !_optionalChain$v([window, 'optionalAccess', _74 => _74.okxwallet]) ) };} @@ -706,7 +708,7 @@ class WindowEthereum { } } WindowEthereum.__initStatic(); WindowEthereum.__initStatic2(); -function _optionalChain$s(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; } +function _optionalChain$u(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; } class Binance extends WindowEthereum { static __initStatic() {this.info = { @@ -716,7 +718,7 @@ class Binance extends WindowEthereum { };} static __initStatic2() {this.isAvailable = async()=>{ - return _optionalChain$s([window, 'optionalAccess', _2 => _2.BinanceChain]) && + return _optionalChain$u([window, 'optionalAccess', _2 => _2.BinanceChain]) && !window.coin98 && !window.trustwallet };} @@ -736,7 +738,7 @@ var logos = { okx: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6I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GQ9Ik0yNzkuMSw1Ni4xaC02NC43Yy0yLjcsMC01LDIuMi01LDV2NjQuN2MwLDIuNywyLjIsNSw1LDVoNjQuN2MyLjcsMCw1LTIuMiw1LTVWNjEKCUMyODQuMSw1OC4zLDI4MS45LDU2LjEsMjc5LjEsNTYuMXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTEyOS44LDIwNS40SDY1LjFjLTIuNywwLTUsMi4yLTUsNXY2NC43YzAsMi43LDIuMiw1LDUsNWg2NC43YzIuOCwwLDUtMi4yLDUtNXYtNjQuNwoJQzEzNC44LDIwNy42LDEzMi41LDIwNS40LDEyOS44LDIwNS40eiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjc5LjEsMjA1LjRoLTY0LjdjLTIuNywwLTUsMi4yLTUsNXY2NC43YzAsMi43LDIuMiw1LDUsNWg2NC43YzIuNywwLDUtMi4yLDUtNXYtNjQuNwoJQzI4NC4xLDIwNy42LDI4MS45LDIwNS40LDI3OS4xLDIwNS40eiIvPgo8L3N2Zz4K", }; -function _optionalChain$r(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; } +function _optionalChain$t(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; } class BraveEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -746,14 +748,14 @@ class BraveEVM extends WindowEthereum { platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$r([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$t([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };} getProvider() { return window.ethereum } } BraveEVM.__initStatic(); BraveEVM.__initStatic2(); -function _optionalChain$q(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; } +function _optionalChain$s(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; } class BraveSVM extends WindowSolana { static __initStatic() {this.info = { @@ -763,14 +765,14 @@ class BraveSVM extends WindowSolana { platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$q([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isBraveWallet]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$s([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isBraveWallet]) };} getProvider() { return window.braveSolana } } BraveSVM.__initStatic(); BraveSVM.__initStatic2(); -function _optionalChain$p(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; } +function _optionalChain$r(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; } class Coin98EVM extends WindowEthereum { static __initStatic() {this.info = { @@ -780,13 +782,13 @@ class Coin98EVM extends WindowEthereum { platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$p([window, 'optionalAccess', _2 => _2.coin98]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$r([window, 'optionalAccess', _2 => _2.coin98]) };} getProvider() { return window.coin98.provider } } Coin98EVM.__initStatic(); Coin98EVM.__initStatic2(); -function _optionalChain$o(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; } +function _optionalChain$q(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; } class Coin98SVM extends WindowSolana { static __initStatic() {this.info = { @@ -796,13 +798,13 @@ class Coin98SVM extends WindowSolana { platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$o([window, 'optionalAccess', _3 => _3.coin98, 'optionalAccess', _4 => _4.sol]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$q([window, 'optionalAccess', _3 => _3.coin98, 'optionalAccess', _4 => _4.sol]) };} getProvider() { return window.coin98.sol } } Coin98SVM.__initStatic(); Coin98SVM.__initStatic2(); -function _optionalChain$n(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; } +function _optionalChain$p(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; } class CoinbaseEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -813,8 +815,8 @@ class CoinbaseEVM extends WindowEthereum { };} getProvider() { - if(_optionalChain$n([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) { - return _optionalChain$n([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')]) + if(_optionalChain$p([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) { + return _optionalChain$p([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')]) } else { return window.ethereum } @@ -823,9 +825,9 @@ class CoinbaseEVM extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return( ( - _optionalChain$n([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$n([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink]) + _optionalChain$p([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$p([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink]) ) || ( - _optionalChain$n([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')]) + _optionalChain$p([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')]) ) ) };} @@ -849,7 +851,7 @@ class CoinbaseSVM extends WindowSolana { };} } CoinbaseSVM.__initStatic(); CoinbaseSVM.__initStatic2(); -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; } +function _optionalChain$o(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; } class CryptoCom extends WindowEthereum { static __initStatic() {this.info = { @@ -858,10 +860,10 @@ class CryptoCom extends WindowEthereum { blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$m([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$o([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };} } CryptoCom.__initStatic(); CryptoCom.__initStatic2(); -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; } +function _optionalChain$n(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; } class ExodusEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -871,10 +873,10 @@ class ExodusEVM extends WindowEthereum { platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$l([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$n([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };} } ExodusEVM.__initStatic(); ExodusEVM.__initStatic2(); -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; } +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; } class ExodusSVM extends WindowSolana { static __initStatic() {this.info = { @@ -884,7 +886,7 @@ class ExodusSVM extends WindowSolana { platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$k([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isExodus]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$m([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isExodus]) };} } ExodusSVM.__initStatic(); ExodusSVM.__initStatic2(); class Glow extends WindowSolana { @@ -903,7 +905,7 @@ class Glow extends WindowSolana { };} } Glow.__initStatic(); Glow.__initStatic2(); -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; } +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; } class HyperPay extends WindowEthereum { static __initStatic() {this.info = { @@ -912,10 +914,10 @@ class HyperPay extends WindowEthereum { blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$j([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$l([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };} } HyperPay.__initStatic(); HyperPay.__initStatic2(); -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; } +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; } class MagicEdenEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -927,12 +929,12 @@ class MagicEdenEVM extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$i([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMagicEden]) + _optionalChain$k([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMagicEden]) ) };} } MagicEdenEVM.__initStatic(); MagicEdenEVM.__initStatic2(); -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; } +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; } class MagicEdenSVM extends WindowSolana { static __initStatic() {this.info = { @@ -944,12 +946,12 @@ class MagicEdenSVM extends WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$h([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isMagicEden]) + _optionalChain$j([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isMagicEden]) ) };} } MagicEdenSVM.__initStatic(); MagicEdenSVM.__initStatic2(); -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; } +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; } class OKXEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -961,12 +963,12 @@ class OKXEVM extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$g([window, 'optionalAccess', _2 => _2.okxwallet]) + _optionalChain$i([window, 'optionalAccess', _2 => _2.okxwallet]) ) };} } OKXEVM.__initStatic(); OKXEVM.__initStatic2(); -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; } +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; } class OKXSVM extends WindowSolana { static __initStatic() {this.info = { @@ -978,12 +980,12 @@ class OKXSVM extends WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$f([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isOkxWallet]) + _optionalChain$h([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isOkxWallet]) ) };} } OKXSVM.__initStatic(); OKXSVM.__initStatic2(); -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; } +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; } class MetaMask extends WindowEthereum { static __initStatic() {this.info = { @@ -992,27 +994,32 @@ class MetaMask extends WindowEthereum { blockchains: supported$1.evm };} - getProvider() { - if(_optionalChain$e([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) { - return _optionalChain$e([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')]) - } else { - return window.ethereum - } - } + static __initStatic2() {this.isMetaMask = (provider)=> { + return( + _optionalChain$g([provider, 'optionalAccess', _3 => _3.isMetaMask]) && + Object.keys(provider).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 + ) + };} - static __initStatic2() {this.isAvailable = async()=>{ + static __initStatic3() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return MetaMask.isMetaMask(provider) + }) : undefined + };} + + static __initStatic4() {this.isAvailable = async()=>{ return( - ( - _optionalChain$e([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) && - Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 - ) || ( - _optionalChain$e([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')]) - ) + MetaMask.getEip6963Provider() || + MetaMask.isMetaMask(_optionalChain$g([window, 'optionalAccess', _4 => _4.ethereum])) ) };} -} MetaMask.__initStatic(); MetaMask.__initStatic2(); -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; } + getProvider() { + return MetaMask.getEip6963Provider() || (MetaMask.isMetaMask(_optionalChain$g([window, 'optionalAccess', _5 => _5.ethereum])) && _optionalChain$g([window, 'optionalAccess', _6 => _6.ethereum])) + } +} MetaMask.__initStatic(); MetaMask.__initStatic2(); MetaMask.__initStatic3(); MetaMask.__initStatic4(); + +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; } class Opera extends WindowEthereum { static __initStatic() {this.info = { @@ -1021,10 +1028,10 @@ class Opera extends WindowEthereum { blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$d([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };} } Opera.__initStatic(); Opera.__initStatic2(); -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; } +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; } class PhantomEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -1038,13 +1045,13 @@ class PhantomEVM extends WindowEthereum { return ( window.phantom && window.phantom.ethereum && - ! _optionalChain$c([window, 'optionalAccess', _4 => _4.ethereum, 'optionalAccess', _5 => _5.isMagicEden]) && - ! _optionalChain$c([window, 'optionalAccess', _6 => _6.okxwallet]) + ! _optionalChain$e([window, 'optionalAccess', _4 => _4.ethereum, 'optionalAccess', _5 => _5.isMagicEden]) && + ! _optionalChain$e([window, 'optionalAccess', _6 => _6.okxwallet]) ) };} } PhantomEVM.__initStatic(); PhantomEVM.__initStatic2(); -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; } +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; } class PhantomSVM extends WindowSolana { static __initStatic() {this.info = { @@ -1058,16 +1065,16 @@ class PhantomSVM extends WindowSolana { return ( window.phantom && !window.glow && - !_optionalChain$b([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.isGlow]) && - !_optionalChain$b([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isExodus]) && - ! _optionalChain$b([window, 'optionalAccess', _12 => _12.ethereum, 'optionalAccess', _13 => _13.isMagicEden]) && - ! _optionalChain$b([window, 'optionalAccess', _14 => _14.okxwallet]) && + !_optionalChain$d([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.isGlow]) && + !_optionalChain$d([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isExodus]) && + ! _optionalChain$d([window, 'optionalAccess', _12 => _12.ethereum, 'optionalAccess', _13 => _13.isMagicEden]) && + ! _optionalChain$d([window, 'optionalAccess', _14 => _14.okxwallet]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier]) ) };} } PhantomSVM.__initStatic(); PhantomSVM.__initStatic2(); -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; } +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; } class Rabby extends WindowEthereum { static __initStatic() {this.info = { @@ -1078,12 +1085,12 @@ class Rabby extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return( - _optionalChain$a([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby]) + _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby]) ) };} } Rabby.__initStatic(); Rabby.__initStatic2(); -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; } +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; } class Uniswap extends WindowEthereum { static __initStatic() {this.info = { @@ -1092,14 +1099,53 @@ class Uniswap extends WindowEthereum { blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ + static __initStatic2() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return _optionalChain$b([provider, 'optionalAccess', _4 => _4.isUniswapWallet]) + }) : undefined + };} + + static __initStatic3() {this.isAvailable = async()=>{ return( - _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isUniswapWallet]) + Uniswap.getEip6963Provider() || + _optionalChain$b([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isUniswapWallet]) ) };} -} Uniswap.__initStatic(); Uniswap.__initStatic2(); -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; } + getProvider() { + return Uniswap.getEip6963Provider() || (_optionalChain$b([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isUniswapWallet]) && _optionalChain$b([window, 'optionalAccess', _9 => _9.ethereum])) + } +} Uniswap.__initStatic(); Uniswap.__initStatic2(); Uniswap.__initStatic3(); + +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; } +class Rainbow extends WindowEthereum { + + static __initStatic() {this.info = { + name: 'Rainbow', + logo: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzhIMjZDNTYuOTI3OSAzOCA4MiA2My4wNzIxIDgyIDk0VjEwMEg5NEM5Ny4zMTM3IDEwMCAxMDAgOTcuMzEzNyAxMDAgOTRDMTAwIDUzLjEzMDkgNjYuODY5MSAyMCAyNiAyMEMyMi42ODYzIDIwIDIwIDIyLjY4NjMgMjAgMjZWMzhaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNODQgOTRIMTAwQzEwMCA5Ny4zMTM3IDk3LjMxMzcgMTAwIDk0IDEwMEg4NFY5NFoiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik0yNiAy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NhbGUoNDIpIj4KPHN0b3Agb2Zmc2V0PSIwLjU5NTEzIiBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50OF9yYWRpYWxfNjJfMzI5IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUxIDk3KSBzY2FsZSgxNyA0NS4zMzMzKSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjMgNjkpIHJvdGF0ZSgtOTApIHNjYWxlKDE3IDMyMi4zNykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=", + blockchains: supported$1.evm + };} + + static __initStatic2() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return _optionalChain$a([provider, 'optionalAccess', _4 => _4.isRainbow]) + }) : undefined + };} + + static __initStatic3() {this.isAvailable = async()=>{ + return( + Rainbow.getEip6963Provider() || + _optionalChain$a([window, 'optionalAccess', _5 => _5.rainbow, 'optionalAccess', _6 => _6.isRainbow]) + ) + };} + + getProvider() { + return Rainbow.getEip6963Provider() || _optionalChain$a([window, 'optionalAccess', _7 => _7.rainbow]) + } + +} Rainbow.__initStatic(); Rainbow.__initStatic2(); Rainbow.__initStatic3(); + +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; } const KEY$1 = '_DePayWeb3WalletsConnectedSolanaMobileWalletInstance'; @@ -1190,8 +1236,8 @@ class SolanaMobileWalletAdapter { await transact( async (wallet) => { await this.authorize(wallet); - if(_optionalChain$8([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; } - if(_optionalChain$8([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; } + if(_optionalChain$9([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; } + if(_optionalChain$9([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; } } ); return this._account @@ -1250,7 +1296,7 @@ class SolanaMobileWalletAdapter { } } SolanaMobileWalletAdapter.__initStatic(); SolanaMobileWalletAdapter.__initStatic2(); -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; } +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; } class Solflare extends WindowSolana { static __initStatic() {this.info = { @@ -1261,7 +1307,7 @@ class Solflare extends WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$7([window, 'optionalAccess', _2 => _2.solflare]) && + _optionalChain$8([window, 'optionalAccess', _2 => _2.solflare]) && window.solflare.isSolflare ) };} @@ -1271,7 +1317,7 @@ class Solflare extends WindowSolana { _sendTransaction(transaction) { return this.getProvider().signTransaction(transaction) } } Solflare.__initStatic(); Solflare.__initStatic2(); -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; } +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; } class TokenPocket extends WindowEthereum { static __initStatic() {this.info = { @@ -1282,12 +1328,12 @@ class TokenPocket extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket]) + _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket]) ) };} } TokenPocket.__initStatic(); TokenPocket.__initStatic2(); -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; } +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; } class TrustEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -1299,13 +1345,13 @@ class TrustEVM extends WindowEthereum { static __initStatic2() {this.isAvailable = async()=>{ return ( - (_optionalChain$5([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$5([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) && + (_optionalChain$6([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$6([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!Debug)(?!TrustWallet)(?!MetaMask)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 ) };} } TrustEVM.__initStatic(); TrustEVM.__initStatic2(); -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; } +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; } class TrustSVM extends WindowSolana { static __initStatic() {this.info = { @@ -1316,7 +1362,7 @@ class TrustSVM extends WindowSolana { };} static __initStatic2() {this.isAvailable = async()=>{ - return _optionalChain$4([window, 'access', _3 => _3.solana, 'optionalAccess', _4 => _4.isTrustWallet]) + return _optionalChain$5([window, 'access', _3 => _3.solana, 'optionalAccess', _4 => _4.isTrustWallet]) };} } TrustSVM.__initStatic(); TrustSVM.__initStatic2(); @@ -1419,7 +1465,7 @@ const getSmartContractWallet = async(blockchain, address)=> { } }; -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; } +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; } const sendTransaction$1 = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); @@ -1470,7 +1516,7 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{ try { sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$3([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1484,7 +1530,7 @@ const retrieveConfirmedTransaction$1 = (sentTransaction)=>{ }); } catch (error) { if( - (error && _optionalChain$3([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1515,7 +1561,7 @@ const retrieveTransaction = (tx, blockchain)=>{ resolve(sentTransaction); } catch (error) { if( - (error && _optionalChain$3([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1557,8 +1603,8 @@ const submitContractInteraction$1 = async ({ transaction, wallet })=>{ to: transaction.to, value: transaction.value ? ethers.BigNumber.from(transaction.value.toString()).toHexString() : undefined, data: await transaction.getData(), - gas: _optionalChain$3([gas, 'optionalAccess', _10 => _10.toHexString, 'call', _11 => _11()]), - gasLimit: _optionalChain$3([gas, 'optionalAccess', _12 => _12.toHexString, 'call', _13 => _13()]), + gas: _optionalChain$4([gas, 'optionalAccess', _10 => _10.toHexString, 'call', _11 => _11()]), + gasLimit: _optionalChain$4([gas, 'optionalAccess', _12 => _12.toHexString, 'call', _13 => _13()]), gasPrice: gasPrice.toHexString(), nonce: ethers.utils.hexlify(transaction.nonce), }] @@ -1585,16 +1631,16 @@ const submitSimpleTransfer$1 = async ({ transaction, wallet })=>{ to: transaction.to, value: transaction.value ? ethers.BigNumber.from(transaction.value.toString()).toHexString() : undefined, data: '0x0', - gas: _optionalChain$3([gas, 'optionalAccess', _14 => _14.toHexString, 'call', _15 => _15()]), - gasLimit: _optionalChain$3([gas, 'optionalAccess', _16 => _16.toHexString, 'call', _17 => _17()]), - gasPrice: _optionalChain$3([gasPrice, 'optionalAccess', _18 => _18.toHexString, 'call', _19 => _19()]), + gas: _optionalChain$4([gas, 'optionalAccess', _14 => _14.toHexString, 'call', _15 => _15()]), + gasLimit: _optionalChain$4([gas, 'optionalAccess', _16 => _16.toHexString, 'call', _17 => _17()]), + gasPrice: _optionalChain$4([gasPrice, 'optionalAccess', _18 => _18.toHexString, 'call', _19 => _19()]), nonce: ethers.utils.hexlify(transaction.nonce) }] } }).catch((e)=>{console.log('ERROR', e);}) }; -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; } +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; } const KEY = 'depay:wallets:wc2'; @@ -1647,7 +1693,7 @@ const getWalletConnectV2Config = (walletName)=>{ optionalNamespaces['eip155'] = { chains: supported$1.evm.map((blockchain)=>`${Blockchains[blockchain].namespace}:${Blockchains[blockchain].networkId}`), }; - if(_optionalChain$2([optionalNamespaces, 'optionalAccess', _ => _.eip155]) && _optionalChain$2([optionalNamespaces, 'optionalAccess', _2 => _2.eip155, 'optionalAccess', _3 => _3.chains, 'optionalAccess', _4 => _4.length])) { + if(_optionalChain$3([optionalNamespaces, 'optionalAccess', _ => _.eip155]) && _optionalChain$3([optionalNamespaces, 'optionalAccess', _2 => _2.eip155, 'optionalAccess', _3 => _3.chains, 'optionalAccess', _4 => _4.length])) { optionalNamespaces['eip155'].methods = methods; optionalNamespaces['eip155'].events = events; } @@ -1662,9 +1708,9 @@ const getSignClient = ()=>{ projectId: localStorage[KEY+":projectId"], metadata: { name: document.title || 'dApp', - description: _optionalChain$2([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('meta[name="description"]'), 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8('content')]) || document.title || 'dApp', + description: _optionalChain$3([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('meta[name="description"]'), 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8('content')]) || document.title || 'dApp', url: location.href, - icons: [_optionalChain$2([document, 'access', _9 => _9.querySelector, 'call', _10 => _10("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _11 => _11.href]) || `${location.origin}/favicon.ico`] + icons: [_optionalChain$3([document, 'access', _9 => _9.querySelector, 'call', _10 => _10("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _11 => _11.href]) || `${location.origin}/favicon.ico`] } }); resolve(signClient); @@ -1682,7 +1728,7 @@ class WalletConnectV2 { };} static __initStatic2() {this.isAvailable = async(options)=>{ - return !! await getLastSession(_optionalChain$2([options, 'optionalAccess', _13 => _13.walletName])) + return !! await getLastSession(_optionalChain$3([options, 'optionalAccess', _13 => _13.walletName])) };} constructor() { @@ -1697,17 +1743,17 @@ class WalletConnectV2 { } async account() { - if(_optionalChain$2([this, 'access', _14 => _14.session, 'optionalAccess', _15 => _15.namespaces, 'optionalAccess', _16 => _16.eip155, 'optionalAccess', _17 => _17.accounts, 'optionalAccess', _18 => _18.length])) { + if(_optionalChain$3([this, 'access', _14 => _14.session, 'optionalAccess', _15 => _15.namespaces, 'optionalAccess', _16 => _16.eip155, 'optionalAccess', _17 => _17.accounts, 'optionalAccess', _18 => _18.length])) { return this.session.namespaces.eip155.accounts[0].split(':')[2] } } async setSessionBlockchains() { - if(!this.session || (!_optionalChain$2([this, 'access', _19 => _19.session, 'optionalAccess', _20 => _20.namespaces, 'optionalAccess', _21 => _21.eip155]) && !_optionalChain$2([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.optionalNamespaces, 'optionalAccess', _24 => _24.eip155]))) { return } + if(!this.session || (!_optionalChain$3([this, 'access', _19 => _19.session, 'optionalAccess', _20 => _20.namespaces, 'optionalAccess', _21 => _21.eip155]) && !_optionalChain$3([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.optionalNamespaces, 'optionalAccess', _24 => _24.eip155]))) { return } if(this.session.namespaces.eip155.chains) { - this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$2([Blockchains, 'access', _25 => _25.findByNetworkId, 'call', _26 => _26(chainIdentifier.split(':')[1]), 'optionalAccess', _27 => _27.name])).filter(Boolean); + this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$3([Blockchains, 'access', _25 => _25.findByNetworkId, 'call', _26 => _26(chainIdentifier.split(':')[1]), 'optionalAccess', _27 => _27.name])).filter(Boolean); } else if(this.session.namespaces.eip155.accounts) { - this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$2([Blockchains, 'access', _28 => _28.findByNetworkId, 'call', _29 => _29(accountIdentifier.split(':')[1]), 'optionalAccess', _30 => _30.name])).filter(Boolean); + this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$3([Blockchains, 'access', _28 => _28.findByNetworkId, 'call', _29 => _29(accountIdentifier.split(':')[1]), 'optionalAccess', _30 => _30.name])).filter(Boolean); } } @@ -1717,13 +1763,13 @@ class WalletConnectV2 { try { - this.walletName = _optionalChain$2([options, 'optionalAccess', _31 => _31.name]); + this.walletName = _optionalChain$3([options, 'optionalAccess', _31 => _31.name]); // delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS this.signClient = await getSignClient(); this.signClient.on("session_delete", (session)=> { - if(_optionalChain$2([session, 'optionalAccess', _32 => _32.topic]) === _optionalChain$2([this, 'access', _33 => _33.session, 'optionalAccess', _34 => _34.topic])) { + if(_optionalChain$3([session, 'optionalAccess', _32 => _32.topic]) === _optionalChain$3([this, 'access', _33 => _33.session, 'optionalAccess', _34 => _34.topic])) { localStorage[KEY+':name'] = undefined; localStorage[KEY+':logo'] = undefined; this.signClient = undefined; @@ -1732,14 +1778,14 @@ class WalletConnectV2 { }); this.signClient.on("session_update", async(session)=> { - if(_optionalChain$2([session, 'optionalAccess', _35 => _35.topic]) === _optionalChain$2([this, 'access', _36 => _36.session, 'optionalAccess', _37 => _37.topic])) { + if(_optionalChain$3([session, 'optionalAccess', _35 => _35.topic]) === _optionalChain$3([this, 'access', _36 => _36.session, 'optionalAccess', _37 => _37.topic])) { this.session = this.signClient.session.get(session.topic); await this.setSessionBlockchains(); } }); this.signClient.on("session_event", (event)=> { - if(_optionalChain$2([event, 'optionalAccess', _38 => _38.topic]) === _optionalChain$2([this, 'access', _39 => _39.session, 'optionalAccess', _40 => _40.topic])) {} + if(_optionalChain$3([event, 'optionalAccess', _38 => _38.topic]) === _optionalChain$3([this, 'access', _39 => _39.session, 'optionalAccess', _40 => _40.topic])) {} }); const connectWallet = async()=>{ @@ -1750,24 +1796,24 @@ class WalletConnectV2 { await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect }; - const lastSession = _optionalChain$2([this, 'optionalAccess', _41 => _41.walletName, 'optionalAccess', _42 => _42.length]) ? await getLastSession(this.walletName) : undefined; + const lastSession = _optionalChain$3([this, 'optionalAccess', _41 => _41.walletName, 'optionalAccess', _42 => _42.length]) ? await getLastSession(this.walletName) : undefined; if(lastSession) { this.session = lastSession; } else { await connectWallet(); } - let meta = _optionalChain$2([this, 'access', _43 => _43.session, 'optionalAccess', _44 => _44.peer, 'optionalAccess', _45 => _45.metadata]); + let meta = _optionalChain$3([this, 'access', _43 => _43.session, 'optionalAccess', _44 => _44.peer, 'optionalAccess', _45 => _45.metadata]); if(meta && meta.name) { this.name = meta.name; localStorage[KEY+':name'] = meta.name; - if(_optionalChain$2([meta, 'optionalAccess', _46 => _46.icons]) && meta.icons.length) { + if(_optionalChain$3([meta, 'optionalAccess', _46 => _46.icons]) && meta.icons.length) { this.logo = meta.icons[0]; localStorage[KEY+':logo'] = this.logo; } } - if(_optionalChain$2([options, 'optionalAccess', _47 => _47.name])) { localStorage[KEY+':name'] = this.name = options.name; } - if(_optionalChain$2([options, 'optionalAccess', _48 => _48.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; } + if(_optionalChain$3([options, 'optionalAccess', _47 => _47.name])) { localStorage[KEY+':name'] = this.name = options.name; } + if(_optionalChain$3([options, 'optionalAccess', _48 => _48.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; } await this.setSessionBlockchains(); @@ -1807,7 +1853,7 @@ class WalletConnectV2 { switch (event) { case 'account': internalCallback = async(event)=> { - if(_optionalChain$2([event, 'optionalAccess', _49 => _49.topic]) === _optionalChain$2([this, 'access', _50 => _50.session, 'optionalAccess', _51 => _51.topic]) && event.params.event.name === 'accountsChanged') { + if(_optionalChain$3([event, 'optionalAccess', _49 => _49.topic]) === _optionalChain$3([this, 'access', _50 => _50.session, 'optionalAccess', _51 => _51.topic]) && event.params.event.name === 'accountsChanged') { callback(await this.account()); } }; @@ -1867,7 +1913,7 @@ class WalletConnectV2 { WalletConnectV2.getConnectedInstance = getConnectedInstance$1; -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; } +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; } const sendTransaction = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); if((await wallet.connectedTo(transaction.blockchain)) == false) { @@ -1919,7 +1965,7 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{ sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$1([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$2([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1933,7 +1979,7 @@ const retrieveConfirmedTransaction = (sentTransaction)=>{ }); } catch(error) { if( - (error && _optionalChain$1([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$2([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1978,7 +2024,7 @@ const submitSimpleTransfer = ({ transaction, signer })=>{ }) }; -function _optionalChain(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; } +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; } const getConnectedInstance = ()=>{ return window._connectedWalletLinkInstance @@ -2032,10 +2078,10 @@ class WalletLink { let connect = (options && options.connect) ? options.connect : ({uri})=>{}; await connect({ uri: this.connector.qrUrl }); - _optionalChain([document, 'access', _ => _.querySelector, 'call', _2 => _2('.-cbwsdk-css-reset'), 'optionalAccess', _3 => _3.setAttribute, 'call', _4 => _4('style', 'display: none;')]); - _optionalChain([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('.-cbwsdk-extension-dialog-container'), 'optionalAccess', _7 => _7.setAttribute, 'call', _8 => _8('style', 'display: none;')]); + _optionalChain$1([document, 'access', _ => _.querySelector, 'call', _2 => _2('.-cbwsdk-css-reset'), 'optionalAccess', _3 => _3.setAttribute, 'call', _4 => _4('style', 'display: none;')]); + _optionalChain$1([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('.-cbwsdk-extension-dialog-container'), 'optionalAccess', _7 => _7.setAttribute, 'call', _8 => _8('style', 'display: none;')]); setTimeout(()=>{ - if(_optionalChain([this, 'optionalAccess', _9 => _9.connector, 'optionalAccess', _10 => _10._relay, 'optionalAccess', _11 => _11.ui, 'optionalAccess', _12 => _12.linkFlow, 'optionalAccess', _13 => _13.isOpen])){ + if(_optionalChain$1([this, 'optionalAccess', _9 => _9.connector, 'optionalAccess', _10 => _10._relay, 'optionalAccess', _11 => _11.ui, 'optionalAccess', _12 => _12.linkFlow, 'optionalAccess', _13 => _13.isOpen])){ this.connector._relay.ui.linkFlow.isOpen = false; } }, 10); @@ -2167,6 +2213,7 @@ var wallets = { Solflare, Rabby, Uniswap, + Rainbow, BraveEVM, BraveSVM, MagicEdenEVM, @@ -2190,10 +2237,22 @@ var wallets = { WalletLink }; +function _optionalChain(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; } const getWallets = async(args)=>{ let drip = (args && typeof args.drip === 'function') ? args.drip : undefined; + // eip6963 + window['_eip6963Providers'] = {}; + const announceProvider = (event)=>{ + if(_optionalChain([event, 'optionalAccess', _ => _.detail, 'optionalAccess', _2 => _2.info, 'optionalAccess', _3 => _3.uuid])) { + window['_eip6963Providers'][_optionalChain([event, 'optionalAccess', _4 => _4.detail, 'optionalAccess', _5 => _5.info, 'optionalAccess', _6 => _6.uuid])] = event.detail.provider; + } + }; + window.addEventListener("eip6963:announceProvider", announceProvider); + window.dispatchEvent(new Event("eip6963:requestProvider")); + window.removeEventListener("eip6963:announceProvider", announceProvider); + let availableWallets = await Promise.all( Object.keys(wallets).map( @@ -2235,6 +2294,7 @@ const supported = [ wallets.Solflare, wallets.Rabby, wallets.Uniswap, + wallets.Rainbow, wallets.BraveEVM, wallets.BraveSVM, wallets.Opera, diff --git a/dist/esm/index.solana.js b/dist/esm/index.solana.js index 8e8ec638..c372d476 100644 --- a/dist/esm/index.solana.js +++ b/dist/esm/index.solana.js @@ -3,7 +3,7 @@ import Blockchains from '@depay/web3-blockchains'; import { PublicKey, SystemProgram, TransactionMessage, VersionedTransaction, transact } from '@depay/solana-web3.js'; import { ethers } from 'ethers'; -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; } +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; } class Transaction { constructor({ @@ -28,7 +28,7 @@ class Transaction { this.to = (to && to.match('0x')) ? ethers.utils.getAddress(to) : to; // optional - this.value = _optionalChain$c([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); + this.value = _optionalChain$d([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); this.api = api; this.method = method; this.params = params; @@ -68,7 +68,7 @@ class Transaction { } getParamType(param) { - if(_optionalChain$c([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { + if(_optionalChain$d([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { return `(${param.components.map((param)=>this.getParamType(param)).join(',')})` } else { return param.type @@ -141,7 +141,7 @@ class Transaction { } } -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; } +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; } const POLL_SPEED = 500; // 0.5 seconds const MAX_POLLS = 240; // 120 seconds @@ -162,14 +162,14 @@ const sendTransaction = async ({ transaction, wallet })=> { const provider = await getProvider(transaction.blockchain); const { value } = await provider.getSignatureStatus(signature); - const confirmationStatus = _optionalChain$b([value, 'optionalAccess', _ => _.confirmationStatus]); + const confirmationStatus = _optionalChain$c([value, 'optionalAccess', _ => _.confirmationStatus]); if(confirmationStatus) { const hasReachedSufficientCommitment = confirmationStatus === 'confirmed' || confirmationStatus === 'finalized'; if (hasReachedSufficientCommitment) { if(value.err) { transaction._failed = true; const confirmedTransaction = await provider.getConfirmedTransaction(signature); - const failedReason = _optionalChain$b([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null; + const failedReason = _optionalChain$c([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null; if(transaction.failed) transaction.failed(transaction, failedReason); } else { transaction._succeeded = true; @@ -260,7 +260,7 @@ let supported$1 = ['solana']; supported$1.evm = []; supported$1.solana = ['solana']; -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; } +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; } class WindowSolana { static __initStatic() {this.info = { @@ -271,13 +271,13 @@ class WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$a([window, 'optionalAccess', _6 => _6.solana]) && + _optionalChain$b([window, 'optionalAccess', _6 => _6.solana]) && // not Phantom !(window.phantom && !window.glow && !window.solana.isGlow && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && // not Coin98 !window.coin98 && // not BitKeep - !(_optionalChain$a([window, 'optionalAccess', _7 => _7.solana]) && _optionalChain$a([window, 'optionalAccess', _8 => _8.solana, 'access', _9 => _9.isBitKeep])) && + !(_optionalChain$b([window, 'optionalAccess', _7 => _7.solana]) && _optionalChain$b([window, 'optionalAccess', _8 => _8.solana, 'access', _9 => _9.isBitKeep])) && // not Glow !window.solana.isGlow && // not trust @@ -285,7 +285,7 @@ class WindowSolana { // Brave Wallet !window.solana.isBraveWallet && // OKX Wallet - !_optionalChain$a([window, 'optionalAccess', _10 => _10.okxwallet]) + !_optionalChain$b([window, 'optionalAccess', _10 => _10.okxwallet]) ) };} @@ -332,7 +332,7 @@ class WindowSolana { let internalCallback; switch (event) { case 'account': - internalCallback = (publicKey) => callback(_optionalChain$a([publicKey, 'optionalAccess', _11 => _11.toString, 'call', _12 => _12()])); + internalCallback = (publicKey) => callback(_optionalChain$b([publicKey, 'optionalAccess', _11 => _11.toString, 'call', _12 => _12()])); this.getProvider().on('accountChanged', internalCallback); break } @@ -385,7 +385,7 @@ class WindowSolana { } } WindowSolana.__initStatic(); WindowSolana.__initStatic2(); -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; } +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; } class Backpack extends WindowSolana { @@ -397,7 +397,7 @@ class Backpack extends WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$9([window, 'optionalAccess', _2 => _2.backpack]) && + _optionalChain$a([window, 'optionalAccess', _2 => _2.backpack]) && window.backpack.isBackpack ) };} @@ -426,7 +426,7 @@ var logos = { okx: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMzYuMSAzMzYuMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzM2LjEgMzM2LjE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojRkZGRkZGO30KPC9zdHlsZT4KPHBhdGggZD0iTTMxMy43LDBIMjIuNEMxMCwwLDAsMTAsMCwyMi40djI5MS4zYzAsMTIuNCwxMCwyMi40LDIyLjQsMjIuNGgyOTEuM2MxMi40LDAsMjIuNC0xMCwyMi40LTIyLjRWMjIuNAoJQzMzNi4xLDEwLDMyNi4xLDAsMzEzLjcsMHoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIwNC41LDEzMC43aC02NC43Yy0yLjcsMC01LDIuMi01LDV2NjQuN2MwLDIuNywyLjIsNSw1LDVoNjQuN2MyLjcsMCw1LTIuMiw1LTV2LTY0LjcKCUMyMDkuNSwxMzIuOSwyMDcuMiwxMzAuNywyMDQuNSwxMzAuN3oiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTEyOS44LDU2LjFINjUuMWMtMi43LDAtNSwyLjItNSw1djY0LjdjMCwyLjcsMi4yLDUsNSw1aDY0LjdjMi44LDAsNS0yLjIsNS01VjYxCglDMTM0LjgsNTguMywxMzIuNSw1Ni4xLDEyOS44LDU2LjF6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yNzkuMSw1Ni4xaC02NC43Yy0yLjcsMC01LDIuMi01LDV2NjQuN2MwLDIuNywyLjIsNSw1LDVoNjQuN2MyLjcsMCw1LTIuMiw1LTVWNjEKCUMyODQuMSw1OC4zLDI4MS45LDU2LjEsMjc5LjEsNTYuMXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTEyOS44LDIwNS40SDY1LjFjLTIuNywwLTUsMi4yLTUsNXY2NC43YzAsMi43LDIuMiw1LDUsNWg2NC43YzIuOCwwLDUtMi4yLDUtNXYtNjQuNwoJQzEzNC44LDIwNy42LDEzMi41LDIwNS40LDEyOS44LDIwNS40eiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjc5LjEsMjA1LjRoLTY0LjdjLTIuNywwLTUsMi4yLTUsNXY2NC43YzAsMi43LDIuMiw1LDUsNWg2NC43YzIuNywwLDUtMi4yLDUtNXYtNjQuNwoJQzI4NC4xLDIwNy42LDI4MS45LDIwNS40LDI3OS4xLDIwNS40eiIvPgo8L3N2Zz4K", }; -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; } +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; } class BraveSVM extends WindowSolana { static __initStatic() {this.info = { @@ -436,14 +436,14 @@ class BraveSVM extends WindowSolana { platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$8([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isBraveWallet]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isBraveWallet]) };} getProvider() { return window.braveSolana } } BraveSVM.__initStatic(); BraveSVM.__initStatic2(); -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; } +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; } class Coin98SVM extends WindowSolana { static __initStatic() {this.info = { @@ -453,7 +453,7 @@ class Coin98SVM extends WindowSolana { platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$7([window, 'optionalAccess', _3 => _3.coin98, 'optionalAccess', _4 => _4.sol]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$8([window, 'optionalAccess', _3 => _3.coin98, 'optionalAccess', _4 => _4.sol]) };} getProvider() { return window.coin98.sol } @@ -477,7 +477,7 @@ class CoinbaseSVM extends WindowSolana { };} } CoinbaseSVM.__initStatic(); CoinbaseSVM.__initStatic2(); -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; } +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; } class ExodusSVM extends WindowSolana { static __initStatic() {this.info = { @@ -487,7 +487,7 @@ class ExodusSVM extends WindowSolana { platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$6([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isExodus]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$7([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isExodus]) };} } ExodusSVM.__initStatic(); ExodusSVM.__initStatic2(); class Glow extends WindowSolana { @@ -506,7 +506,7 @@ class Glow extends WindowSolana { };} } Glow.__initStatic(); Glow.__initStatic2(); -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; } +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; } class MagicEdenSVM extends WindowSolana { static __initStatic() {this.info = { @@ -518,12 +518,12 @@ class MagicEdenSVM extends WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$5([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isMagicEden]) + _optionalChain$6([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isMagicEden]) ) };} } MagicEdenSVM.__initStatic(); MagicEdenSVM.__initStatic2(); -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; } +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; } class OKXSVM extends WindowSolana { static __initStatic() {this.info = { @@ -535,12 +535,12 @@ class OKXSVM extends WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$4([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isOkxWallet]) + _optionalChain$5([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isOkxWallet]) ) };} } OKXSVM.__initStatic(); OKXSVM.__initStatic2(); -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; } +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; } class PhantomSVM extends WindowSolana { static __initStatic() {this.info = { @@ -554,16 +554,16 @@ class PhantomSVM extends WindowSolana { return ( window.phantom && !window.glow && - !_optionalChain$3([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.isGlow]) && - !_optionalChain$3([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isExodus]) && - ! _optionalChain$3([window, 'optionalAccess', _12 => _12.ethereum, 'optionalAccess', _13 => _13.isMagicEden]) && - ! _optionalChain$3([window, 'optionalAccess', _14 => _14.okxwallet]) && + !_optionalChain$4([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.isGlow]) && + !_optionalChain$4([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isExodus]) && + ! _optionalChain$4([window, 'optionalAccess', _12 => _12.ethereum, 'optionalAccess', _13 => _13.isMagicEden]) && + ! _optionalChain$4([window, 'optionalAccess', _14 => _14.okxwallet]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier]) ) };} } PhantomSVM.__initStatic(); PhantomSVM.__initStatic2(); -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; } +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; } const KEY = '_DePayWeb3WalletsConnectedSolanaMobileWalletInstance'; @@ -654,8 +654,8 @@ class SolanaMobileWalletAdapter { await transact( async (wallet) => { await this.authorize(wallet); - if(_optionalChain$2([options, 'optionalAccess', _ => _.name])) { localStorage[KEY+'_name'] = this.name = options.name; } - if(_optionalChain$2([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY+'_logo'] = this.logo = options.logo; } + if(_optionalChain$3([options, 'optionalAccess', _ => _.name])) { localStorage[KEY+'_name'] = this.name = options.name; } + if(_optionalChain$3([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY+'_logo'] = this.logo = options.logo; } } ); return this._account @@ -714,7 +714,7 @@ class SolanaMobileWalletAdapter { } } SolanaMobileWalletAdapter.__initStatic(); SolanaMobileWalletAdapter.__initStatic2(); -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; } +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; } class Solflare extends WindowSolana { static __initStatic() {this.info = { @@ -725,7 +725,7 @@ class Solflare extends WindowSolana { static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$1([window, 'optionalAccess', _2 => _2.solflare]) && + _optionalChain$2([window, 'optionalAccess', _2 => _2.solflare]) && window.solflare.isSolflare ) };} @@ -735,7 +735,7 @@ class Solflare extends WindowSolana { _sendTransaction(transaction) { return this.getProvider().signTransaction(transaction) } } Solflare.__initStatic(); Solflare.__initStatic2(); -function _optionalChain(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; } +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; } class TrustSVM extends WindowSolana { static __initStatic() {this.info = { @@ -746,7 +746,7 @@ class TrustSVM extends WindowSolana { };} static __initStatic2() {this.isAvailable = async()=>{ - return _optionalChain([window, 'access', _3 => _3.solana, 'optionalAccess', _4 => _4.isTrustWallet]) + return _optionalChain$1([window, 'access', _3 => _3.solana, 'optionalAccess', _4 => _4.isTrustWallet]) };} } TrustSVM.__initStatic(); TrustSVM.__initStatic2(); @@ -768,10 +768,22 @@ var wallets = { SolanaMobileWalletAdapter, }; +function _optionalChain(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; } const getWallets = async(args)=>{ let drip = (args && typeof args.drip === 'function') ? args.drip : undefined; + // eip6963 + window['_eip6963Providers'] = {}; + const announceProvider = (event)=>{ + if(_optionalChain([event, 'optionalAccess', _ => _.detail, 'optionalAccess', _2 => _2.info, 'optionalAccess', _3 => _3.uuid])) { + window['_eip6963Providers'][_optionalChain([event, 'optionalAccess', _4 => _4.detail, 'optionalAccess', _5 => _5.info, 'optionalAccess', _6 => _6.uuid])] = event.detail.provider; + } + }; + window.addEventListener("eip6963:announceProvider", announceProvider); + window.dispatchEvent(new Event("eip6963:requestProvider")); + window.removeEventListener("eip6963:announceProvider", announceProvider); + let availableWallets = await Promise.all( Object.keys(wallets).map( diff --git a/dist/umd/index.evm.js b/dist/umd/index.evm.js index 184cf67b..b9193db8 100644 --- a/dist/umd/index.evm.js +++ b/dist/umd/index.evm.js @@ -12,7 +12,7 @@ supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base']; supported$1.solana = []; - 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; } + function _optionalChain$o(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; } class Transaction { constructor({ @@ -37,7 +37,7 @@ this.to = (to && to.match('0x')) ? ethers.ethers.utils.getAddress(to) : to; // optional - this.value = _optionalChain$m([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); + this.value = _optionalChain$o([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); this.api = api; this.method = method; this.params = params; @@ -77,7 +77,7 @@ } getParamType(param) { - if(_optionalChain$m([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { + if(_optionalChain$o([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { return `(${param.components.map((param)=>this.getParamType(param)).join(',')})` } else { return param.type @@ -150,7 +150,7 @@ } } - 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; } + function _optionalChain$n(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; } const sendTransaction$2 = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); @@ -205,7 +205,7 @@ sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$l([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$n([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -219,7 +219,7 @@ }); } catch(error) { if( - (error && _optionalChain$l([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$n([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -254,12 +254,12 @@ if(contractArguments) { return await method(...contractArguments, { value: Transaction.bigNumberify(transaction.value, transaction.blockchain), - gasLimit: _optionalChain$l([gas, 'optionalAccess', _7 => _7.toHexString, 'call', _8 => _8()]) + gasLimit: _optionalChain$n([gas, 'optionalAccess', _7 => _7.toHexString, 'call', _8 => _8()]) }) } else { return await method({ value: Transaction.bigNumberify(transaction.value, transaction.blockchain), - gasLimit: _optionalChain$l([gas, 'optionalAccess', _9 => _9.toHexString, 'call', _10 => _10()]) + gasLimit: _optionalChain$n([gas, 'optionalAccess', _9 => _9.toHexString, 'call', _10 => _10()]) }) } }; @@ -271,7 +271,7 @@ }) }; - 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; } + 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; } class WindowEthereum { @@ -283,37 +283,39 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$k([window, 'optionalAccess', _36 => _36.ethereum]) && + _optionalChain$m([window, 'optionalAccess', _38 => _38.ethereum]) && // not MetaMask - !(_optionalChain$k([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) && + !(_optionalChain$m([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) && // not Coin98 - !_optionalChain$k([window, 'optionalAccess', _39 => _39.coin98]) && + !_optionalChain$m([window, 'optionalAccess', _41 => _41.coin98]) && // not Trust Wallet - !(_optionalChain$k([window, 'optionalAccess', _40 => _40.ethereum, 'optionalAccess', _41 => _41.isTrust]) || _optionalChain$k([window, 'optionalAccess', _42 => _42.ethereum, 'optionalAccess', _43 => _43.isTrustWallet])) && + !(_optionalChain$m([window, 'optionalAccess', _42 => _42.ethereum, 'optionalAccess', _43 => _43.isTrust]) || _optionalChain$m([window, 'optionalAccess', _44 => _44.ethereum, 'optionalAccess', _45 => _45.isTrustWallet])) && // not crypto.com - !_optionalChain$k([window, 'optionalAccess', _44 => _44.ethereum, 'optionalAccess', _45 => _45.isDeficonnectProvider]) && + !_optionalChain$m([window, 'optionalAccess', _46 => _46.ethereum, 'optionalAccess', _47 => _47.isDeficonnectProvider]) && // not HyperPay - !_optionalChain$k([window, 'optionalAccess', _46 => _46.ethereum, 'optionalAccess', _47 => _47.isHyperPay]) && + !_optionalChain$m([window, 'optionalAccess', _48 => _48.ethereum, 'optionalAccess', _49 => _49.isHyperPay]) && // not Phantom - !(window.phantom && !window.glow && !_optionalChain$k([window, 'optionalAccess', _48 => _48.solana, 'optionalAccess', _49 => _49.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && + !(window.phantom && !window.glow && !_optionalChain$m([window, 'optionalAccess', _50 => _50.solana, 'optionalAccess', _51 => _51.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && // not Rabby - !_optionalChain$k([window, 'optionalAccess', _50 => _50.ethereum, 'optionalAccess', _51 => _51.isRabby]) && + !_optionalChain$m([window, 'optionalAccess', _52 => _52.ethereum, 'optionalAccess', _53 => _53.isRabby]) && // not Backpack - !_optionalChain$k([window, 'optionalAccess', _52 => _52.backpack, 'optionalAccess', _53 => _53.isBackpack]) && + !_optionalChain$m([window, 'optionalAccess', _54 => _54.backpack, 'optionalAccess', _55 => _55.isBackpack]) && // not TokenPocket - !_optionalChain$k([window, 'optionalAccess', _54 => _54.ethereum, 'optionalAccess', _55 => _55.isTokenPocket]) && + !_optionalChain$m([window, 'optionalAccess', _56 => _56.ethereum, 'optionalAccess', _57 => _57.isTokenPocket]) && // not BitKeep - !_optionalChain$k([window, 'optionalAccess', _56 => _56.ethereum, 'optionalAccess', _57 => _57.isBitKeep]) && + !_optionalChain$m([window, 'optionalAccess', _58 => _58.ethereum, 'optionalAccess', _59 => _59.isBitKeep]) && // not Coinbase - !(_optionalChain$k([window, 'optionalAccess', _58 => _58.ethereum, 'optionalAccess', _59 => _59.isCoinbaseWallet]) || _optionalChain$k([window, 'optionalAccess', _60 => _60.ethereum, 'optionalAccess', _61 => _61.isWalletLink])) && + !(_optionalChain$m([window, 'optionalAccess', _60 => _60.ethereum, 'optionalAccess', _61 => _61.isCoinbaseWallet]) || _optionalChain$m([window, 'optionalAccess', _62 => _62.ethereum, 'optionalAccess', _63 => _63.isWalletLink])) && // MetaMask through ProviderMap - !_optionalChain$k([window, 'optionalAccess', _62 => _62.ethereum, 'optionalAccess', _63 => _63.providerMap, 'optionalAccess', _64 => _64.has, 'call', _65 => _65('MetaMask')]) && + !_optionalChain$m([window, 'optionalAccess', _64 => _64.ethereum, 'optionalAccess', _65 => _65.providerMap, 'optionalAccess', _66 => _66.has, 'call', _67 => _67('MetaMask')]) && // Brave Wallet - !_optionalChain$k([window, 'optionalAccess', _66 => _66.ethereum, 'optionalAccess', _67 => _67.isBraveWallet]) && + !_optionalChain$m([window, 'optionalAccess', _68 => _68.ethereum, 'optionalAccess', _69 => _69.isBraveWallet]) && // Uniswap Wallet - !_optionalChain$k([window, 'optionalAccess', _68 => _68.ethereum, 'optionalAccess', _69 => _69.isUniswapWallet]) && + !_optionalChain$m([window, 'optionalAccess', _70 => _70.ethereum, 'optionalAccess', _71 => _71.isUniswapWallet]) && + // Rainbow + !_optionalChain$m([window, 'optionalAccess', _72 => _72.ethereum, 'optionalAccess', _73 => _73.isRainbow]) && // OKX Wallet - !_optionalChain$k([window, 'optionalAccess', _70 => _70.okxwallet]) + !_optionalChain$m([window, 'optionalAccess', _74 => _74.okxwallet]) ) };} @@ -439,7 +441,7 @@ } } WindowEthereum.__initStatic(); WindowEthereum.__initStatic2(); - 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; } + 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; } class Binance extends WindowEthereum { static __initStatic() {this.info = { @@ -449,7 +451,7 @@ };} static __initStatic2() {this.isAvailable = async()=>{ - return _optionalChain$j([window, 'optionalAccess', _2 => _2.BinanceChain]) && + return _optionalChain$l([window, 'optionalAccess', _2 => _2.BinanceChain]) && !window.coin98 && !window.trustwallet };} @@ -469,7 +471,7 @@ okx: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjIuMCwgU1ZHIEV4cG9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01LDV2NjQuN2MwLDIuNywyLjIsNSw1LDVoNjQuN2MyLjcsMCw1LTIuMiw1LTVWNjEKCUMyODQuMSw1OC4zLDI4MS45LDU2LjEsMjc5LjEsNTYuMXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTEyOS44LDIwNS40SDY1LjFjLTIuNywwLTUsMi4yLTUsNXY2NC43YzAsMi43LDIuMiw1LDUsNWg2NC43YzIuOCwwLDUtMi4yLDUtNXYtNjQuNwoJQzEzNC44LDIwNy42LDEzMi41LDIwNS40LDEyOS44LDIwNS40eiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjc5LjEsMjA1LjRoLTY0LjdjLTIuNywwLTUsMi4yLTUsNXY2NC43YzAsMi43LDIuMiw1LDUsNWg2NC43YzIuNywwLDUtMi4yLDUtNXYtNjQuNwoJQzI4NC4xLDIwNy42LDI4MS45LDIwNS40LDI3OS4xLDIwNS40eiIvPgo8L3N2Zz4K", }; - 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; } + 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; } class BraveEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -479,14 +481,14 @@ platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$i([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$k([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };} getProvider() { return window.ethereum } } BraveEVM.__initStatic(); BraveEVM.__initStatic2(); - 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; } + 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; } class Coin98EVM extends WindowEthereum { static __initStatic() {this.info = { @@ -496,13 +498,13 @@ platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$h([window, 'optionalAccess', _2 => _2.coin98]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$j([window, 'optionalAccess', _2 => _2.coin98]) };} getProvider() { return window.coin98.provider } } Coin98EVM.__initStatic(); Coin98EVM.__initStatic2(); - 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; } + 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; } class CoinbaseEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -513,8 +515,8 @@ };} getProvider() { - if(_optionalChain$g([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) { - return _optionalChain$g([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')]) + if(_optionalChain$i([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) { + return _optionalChain$i([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')]) } else { return window.ethereum } @@ -523,15 +525,15 @@ static __initStatic2() {this.isAvailable = async()=>{ return( ( - _optionalChain$g([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$g([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink]) + _optionalChain$i([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$i([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink]) ) || ( - _optionalChain$g([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')]) + _optionalChain$i([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')]) ) ) };} } CoinbaseEVM.__initStatic(); CoinbaseEVM.__initStatic2(); - 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; } + 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; } class CryptoCom extends WindowEthereum { static __initStatic() {this.info = { @@ -540,10 +542,10 @@ blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$h([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };} } CryptoCom.__initStatic(); CryptoCom.__initStatic2(); - 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; } + 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; } class ExodusEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -553,10 +555,10 @@ platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$e([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$g([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };} } ExodusEVM.__initStatic(); ExodusEVM.__initStatic2(); - 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; } + 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; } class HyperPay extends WindowEthereum { static __initStatic() {this.info = { @@ -565,10 +567,10 @@ blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$d([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };} } HyperPay.__initStatic(); HyperPay.__initStatic2(); - 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; } + 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; } class MagicEdenEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -580,12 +582,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMagicEden]) + _optionalChain$e([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMagicEden]) ) };} } MagicEdenEVM.__initStatic(); MagicEdenEVM.__initStatic2(); - 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; } + 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; } class OKXEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -597,12 +599,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$b([window, 'optionalAccess', _2 => _2.okxwallet]) + _optionalChain$d([window, 'optionalAccess', _2 => _2.okxwallet]) ) };} } OKXEVM.__initStatic(); OKXEVM.__initStatic2(); - 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; } + 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; } class MetaMask extends WindowEthereum { static __initStatic() {this.info = { @@ -611,27 +613,32 @@ blockchains: supported$1.evm };} - getProvider() { - if(_optionalChain$a([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) { - return _optionalChain$a([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')]) - } else { - return window.ethereum - } - } + static __initStatic2() {this.isMetaMask = (provider)=> { + return( + _optionalChain$c([provider, 'optionalAccess', _3 => _3.isMetaMask]) && + Object.keys(provider).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 + ) + };} - static __initStatic2() {this.isAvailable = async()=>{ + static __initStatic3() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return MetaMask.isMetaMask(provider) + }) : undefined + };} + + static __initStatic4() {this.isAvailable = async()=>{ return( - ( - _optionalChain$a([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) && - Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 - ) || ( - _optionalChain$a([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')]) - ) + MetaMask.getEip6963Provider() || + MetaMask.isMetaMask(_optionalChain$c([window, 'optionalAccess', _4 => _4.ethereum])) ) };} - } MetaMask.__initStatic(); MetaMask.__initStatic2(); - 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; } + getProvider() { + return MetaMask.getEip6963Provider() || (MetaMask.isMetaMask(_optionalChain$c([window, 'optionalAccess', _5 => _5.ethereum])) && _optionalChain$c([window, 'optionalAccess', _6 => _6.ethereum])) + } + } MetaMask.__initStatic(); MetaMask.__initStatic2(); MetaMask.__initStatic3(); MetaMask.__initStatic4(); + + 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; } class Opera extends WindowEthereum { static __initStatic() {this.info = { @@ -640,10 +647,10 @@ blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$b([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };} } Opera.__initStatic(); Opera.__initStatic2(); - 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; } + 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; } class PhantomEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -657,13 +664,13 @@ return ( window.phantom && window.phantom.ethereum && - ! _optionalChain$8([window, 'optionalAccess', _4 => _4.ethereum, 'optionalAccess', _5 => _5.isMagicEden]) && - ! _optionalChain$8([window, 'optionalAccess', _6 => _6.okxwallet]) + ! _optionalChain$a([window, 'optionalAccess', _4 => _4.ethereum, 'optionalAccess', _5 => _5.isMagicEden]) && + ! _optionalChain$a([window, 'optionalAccess', _6 => _6.okxwallet]) ) };} } PhantomEVM.__initStatic(); PhantomEVM.__initStatic2(); - 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; } + 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; } class Rabby extends WindowEthereum { static __initStatic() {this.info = { @@ -674,12 +681,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return( - _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby]) + _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby]) ) };} } Rabby.__initStatic(); Rabby.__initStatic2(); - 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; } + 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; } class Uniswap extends WindowEthereum { static __initStatic() {this.info = { @@ -688,14 +695,53 @@ blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ + static __initStatic2() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return _optionalChain$8([provider, 'optionalAccess', _4 => _4.isUniswapWallet]) + }) : undefined + };} + + static __initStatic3() {this.isAvailable = async()=>{ return( - _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isUniswapWallet]) + Uniswap.getEip6963Provider() || + _optionalChain$8([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isUniswapWallet]) ) };} - } Uniswap.__initStatic(); Uniswap.__initStatic2(); - 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; } + getProvider() { + return Uniswap.getEip6963Provider() || (_optionalChain$8([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isUniswapWallet]) && _optionalChain$8([window, 'optionalAccess', _9 => _9.ethereum])) + } + } Uniswap.__initStatic(); Uniswap.__initStatic2(); Uniswap.__initStatic3(); + + 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; } + class Rainbow extends WindowEthereum { + + static __initStatic() {this.info = { + name: 'Rainbow', + logo: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzhIMjZDNTYuOTI3OSAzOCA4MiA2My4wNzIxIDgyIDk0VjEwMEg5NEM5Ny4zMTM3IDEwMCAxMDAgOTcuMzEzNyAxMDAgOTRDMTAwIDUzLjEzMDkgNjYuODY5MSAyMCAyNiAyMEMyMi42ODYzIDIwIDIwIDIyLjY4NjMgMjAgMjZWMzhaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfNj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Object.values(window['_eip6963Providers']).find((provider)=>{ + return _optionalChain$7([provider, 'optionalAccess', _4 => _4.isRainbow]) + }) : undefined + };} + + static __initStatic3() {this.isAvailable = async()=>{ + return( + Rainbow.getEip6963Provider() || + _optionalChain$7([window, 'optionalAccess', _5 => _5.rainbow, 'optionalAccess', _6 => _6.isRainbow]) + ) + };} + + getProvider() { + return Rainbow.getEip6963Provider() || _optionalChain$7([window, 'optionalAccess', _7 => _7.rainbow]) + } + + } Rainbow.__initStatic(); Rainbow.__initStatic2(); Rainbow.__initStatic3(); + + 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; } class TokenPocket extends WindowEthereum { static __initStatic() {this.info = { @@ -706,12 +752,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$5([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket]) + _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket]) ) };} } TokenPocket.__initStatic(); TokenPocket.__initStatic2(); - 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; } + 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; } class TrustEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -723,7 +769,7 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - (_optionalChain$4([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$4([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) && + (_optionalChain$5([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$5([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!Debug)(?!TrustWallet)(?!MetaMask)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 ) };} @@ -828,7 +874,7 @@ } }; - 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; } + 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; } const sendTransaction$1 = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); @@ -879,7 +925,7 @@ try { sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$3([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -893,7 +939,7 @@ }); } catch (error) { if( - (error && _optionalChain$3([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -924,7 +970,7 @@ resolve(sentTransaction); } catch (error) { if( - (error && _optionalChain$3([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -966,8 +1012,8 @@ to: transaction.to, value: transaction.value ? ethers.ethers.BigNumber.from(transaction.value.toString()).toHexString() : undefined, data: await transaction.getData(), - gas: _optionalChain$3([gas, 'optionalAccess', _10 => _10.toHexString, 'call', _11 => _11()]), - gasLimit: _optionalChain$3([gas, 'optionalAccess', _12 => _12.toHexString, 'call', _13 => _13()]), + gas: _optionalChain$4([gas, 'optionalAccess', _10 => _10.toHexString, 'call', _11 => _11()]), + gasLimit: _optionalChain$4([gas, 'optionalAccess', _12 => _12.toHexString, 'call', _13 => _13()]), gasPrice: gasPrice.toHexString(), nonce: ethers.ethers.utils.hexlify(transaction.nonce), }] @@ -994,16 +1040,16 @@ to: transaction.to, value: transaction.value ? ethers.ethers.BigNumber.from(transaction.value.toString()).toHexString() : undefined, data: '0x0', - gas: _optionalChain$3([gas, 'optionalAccess', _14 => _14.toHexString, 'call', _15 => _15()]), - gasLimit: _optionalChain$3([gas, 'optionalAccess', _16 => _16.toHexString, 'call', _17 => _17()]), - gasPrice: _optionalChain$3([gasPrice, 'optionalAccess', _18 => _18.toHexString, 'call', _19 => _19()]), + gas: _optionalChain$4([gas, 'optionalAccess', _14 => _14.toHexString, 'call', _15 => _15()]), + gasLimit: _optionalChain$4([gas, 'optionalAccess', _16 => _16.toHexString, 'call', _17 => _17()]), + gasPrice: _optionalChain$4([gasPrice, 'optionalAccess', _18 => _18.toHexString, 'call', _19 => _19()]), nonce: ethers.ethers.utils.hexlify(transaction.nonce) }] } }).catch((e)=>{console.log('ERROR', e);}) }; - 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; } + 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; } const KEY = 'depay:wallets:wc2'; @@ -1056,7 +1102,7 @@ optionalNamespaces['eip155'] = { chains: supported$1.evm.map((blockchain)=>`${Blockchains__default['default'][blockchain].namespace}:${Blockchains__default['default'][blockchain].networkId}`), }; - if(_optionalChain$2([optionalNamespaces, 'optionalAccess', _ => _.eip155]) && _optionalChain$2([optionalNamespaces, 'optionalAccess', _2 => _2.eip155, 'optionalAccess', _3 => _3.chains, 'optionalAccess', _4 => _4.length])) { + if(_optionalChain$3([optionalNamespaces, 'optionalAccess', _ => _.eip155]) && _optionalChain$3([optionalNamespaces, 'optionalAccess', _2 => _2.eip155, 'optionalAccess', _3 => _3.chains, 'optionalAccess', _4 => _4.length])) { optionalNamespaces['eip155'].methods = methods; optionalNamespaces['eip155'].events = events; } @@ -1071,9 +1117,9 @@ projectId: localStorage[KEY+":projectId"], metadata: { name: document.title || 'dApp', - description: _optionalChain$2([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('meta[name="description"]'), 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8('content')]) || document.title || 'dApp', + description: _optionalChain$3([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('meta[name="description"]'), 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8('content')]) || document.title || 'dApp', url: location.href, - icons: [_optionalChain$2([document, 'access', _9 => _9.querySelector, 'call', _10 => _10("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _11 => _11.href]) || `${location.origin}/favicon.ico`] + icons: [_optionalChain$3([document, 'access', _9 => _9.querySelector, 'call', _10 => _10("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _11 => _11.href]) || `${location.origin}/favicon.ico`] } }); resolve(signClient); @@ -1091,7 +1137,7 @@ };} static __initStatic2() {this.isAvailable = async(options)=>{ - return !! await getLastSession(_optionalChain$2([options, 'optionalAccess', _13 => _13.walletName])) + return !! await getLastSession(_optionalChain$3([options, 'optionalAccess', _13 => _13.walletName])) };} constructor() { @@ -1106,17 +1152,17 @@ } async account() { - if(_optionalChain$2([this, 'access', _14 => _14.session, 'optionalAccess', _15 => _15.namespaces, 'optionalAccess', _16 => _16.eip155, 'optionalAccess', _17 => _17.accounts, 'optionalAccess', _18 => _18.length])) { + if(_optionalChain$3([this, 'access', _14 => _14.session, 'optionalAccess', _15 => _15.namespaces, 'optionalAccess', _16 => _16.eip155, 'optionalAccess', _17 => _17.accounts, 'optionalAccess', _18 => _18.length])) { return this.session.namespaces.eip155.accounts[0].split(':')[2] } } async setSessionBlockchains() { - if(!this.session || (!_optionalChain$2([this, 'access', _19 => _19.session, 'optionalAccess', _20 => _20.namespaces, 'optionalAccess', _21 => _21.eip155]) && !_optionalChain$2([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.optionalNamespaces, 'optionalAccess', _24 => _24.eip155]))) { return } + if(!this.session || (!_optionalChain$3([this, 'access', _19 => _19.session, 'optionalAccess', _20 => _20.namespaces, 'optionalAccess', _21 => _21.eip155]) && !_optionalChain$3([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.optionalNamespaces, 'optionalAccess', _24 => _24.eip155]))) { return } if(this.session.namespaces.eip155.chains) { - this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$2([Blockchains__default['default'], 'access', _25 => _25.findByNetworkId, 'call', _26 => _26(chainIdentifier.split(':')[1]), 'optionalAccess', _27 => _27.name])).filter(Boolean); + this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$3([Blockchains__default['default'], 'access', _25 => _25.findByNetworkId, 'call', _26 => _26(chainIdentifier.split(':')[1]), 'optionalAccess', _27 => _27.name])).filter(Boolean); } else if(this.session.namespaces.eip155.accounts) { - this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$2([Blockchains__default['default'], 'access', _28 => _28.findByNetworkId, 'call', _29 => _29(accountIdentifier.split(':')[1]), 'optionalAccess', _30 => _30.name])).filter(Boolean); + this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$3([Blockchains__default['default'], 'access', _28 => _28.findByNetworkId, 'call', _29 => _29(accountIdentifier.split(':')[1]), 'optionalAccess', _30 => _30.name])).filter(Boolean); } } @@ -1126,13 +1172,13 @@ try { - this.walletName = _optionalChain$2([options, 'optionalAccess', _31 => _31.name]); + this.walletName = _optionalChain$3([options, 'optionalAccess', _31 => _31.name]); // delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS this.signClient = await getSignClient(); this.signClient.on("session_delete", (session)=> { - if(_optionalChain$2([session, 'optionalAccess', _32 => _32.topic]) === _optionalChain$2([this, 'access', _33 => _33.session, 'optionalAccess', _34 => _34.topic])) { + if(_optionalChain$3([session, 'optionalAccess', _32 => _32.topic]) === _optionalChain$3([this, 'access', _33 => _33.session, 'optionalAccess', _34 => _34.topic])) { localStorage[KEY+':name'] = undefined; localStorage[KEY+':logo'] = undefined; this.signClient = undefined; @@ -1141,14 +1187,14 @@ }); this.signClient.on("session_update", async(session)=> { - if(_optionalChain$2([session, 'optionalAccess', _35 => _35.topic]) === _optionalChain$2([this, 'access', _36 => _36.session, 'optionalAccess', _37 => _37.topic])) { + if(_optionalChain$3([session, 'optionalAccess', _35 => _35.topic]) === _optionalChain$3([this, 'access', _36 => _36.session, 'optionalAccess', _37 => _37.topic])) { this.session = this.signClient.session.get(session.topic); await this.setSessionBlockchains(); } }); this.signClient.on("session_event", (event)=> { - if(_optionalChain$2([event, 'optionalAccess', _38 => _38.topic]) === _optionalChain$2([this, 'access', _39 => _39.session, 'optionalAccess', _40 => _40.topic])) {} + if(_optionalChain$3([event, 'optionalAccess', _38 => _38.topic]) === _optionalChain$3([this, 'access', _39 => _39.session, 'optionalAccess', _40 => _40.topic])) {} }); const connectWallet = async()=>{ @@ -1159,24 +1205,24 @@ await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect }; - const lastSession = _optionalChain$2([this, 'optionalAccess', _41 => _41.walletName, 'optionalAccess', _42 => _42.length]) ? await getLastSession(this.walletName) : undefined; + const lastSession = _optionalChain$3([this, 'optionalAccess', _41 => _41.walletName, 'optionalAccess', _42 => _42.length]) ? await getLastSession(this.walletName) : undefined; if(lastSession) { this.session = lastSession; } else { await connectWallet(); } - let meta = _optionalChain$2([this, 'access', _43 => _43.session, 'optionalAccess', _44 => _44.peer, 'optionalAccess', _45 => _45.metadata]); + let meta = _optionalChain$3([this, 'access', _43 => _43.session, 'optionalAccess', _44 => _44.peer, 'optionalAccess', _45 => _45.metadata]); if(meta && meta.name) { this.name = meta.name; localStorage[KEY+':name'] = meta.name; - if(_optionalChain$2([meta, 'optionalAccess', _46 => _46.icons]) && meta.icons.length) { + if(_optionalChain$3([meta, 'optionalAccess', _46 => _46.icons]) && meta.icons.length) { this.logo = meta.icons[0]; localStorage[KEY+':logo'] = this.logo; } } - if(_optionalChain$2([options, 'optionalAccess', _47 => _47.name])) { localStorage[KEY+':name'] = this.name = options.name; } - if(_optionalChain$2([options, 'optionalAccess', _48 => _48.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; } + if(_optionalChain$3([options, 'optionalAccess', _47 => _47.name])) { localStorage[KEY+':name'] = this.name = options.name; } + if(_optionalChain$3([options, 'optionalAccess', _48 => _48.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; } await this.setSessionBlockchains(); @@ -1216,7 +1262,7 @@ switch (event) { case 'account': internalCallback = async(event)=> { - if(_optionalChain$2([event, 'optionalAccess', _49 => _49.topic]) === _optionalChain$2([this, 'access', _50 => _50.session, 'optionalAccess', _51 => _51.topic]) && event.params.event.name === 'accountsChanged') { + if(_optionalChain$3([event, 'optionalAccess', _49 => _49.topic]) === _optionalChain$3([this, 'access', _50 => _50.session, 'optionalAccess', _51 => _51.topic]) && event.params.event.name === 'accountsChanged') { callback(await this.account()); } }; @@ -1276,7 +1322,7 @@ WalletConnectV2.getConnectedInstance = getConnectedInstance$1; - 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; } + 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; } const sendTransaction = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); if((await wallet.connectedTo(transaction.blockchain)) == false) { @@ -1328,7 +1374,7 @@ sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$1([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$2([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1342,7 +1388,7 @@ }); } catch(error) { if( - (error && _optionalChain$1([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$2([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1387,7 +1433,7 @@ }) }; - function _optionalChain(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; } + 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; } const getConnectedInstance = ()=>{ return window._connectedWalletLinkInstance @@ -1441,10 +1487,10 @@ let connect = (options && options.connect) ? options.connect : ({uri})=>{}; await connect({ uri: this.connector.qrUrl }); - _optionalChain([document, 'access', _ => _.querySelector, 'call', _2 => _2('.-cbwsdk-css-reset'), 'optionalAccess', _3 => _3.setAttribute, 'call', _4 => _4('style', 'display: none;')]); - _optionalChain([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('.-cbwsdk-extension-dialog-container'), 'optionalAccess', _7 => _7.setAttribute, 'call', _8 => _8('style', 'display: none;')]); + _optionalChain$1([document, 'access', _ => _.querySelector, 'call', _2 => _2('.-cbwsdk-css-reset'), 'optionalAccess', _3 => _3.setAttribute, 'call', _4 => _4('style', 'display: none;')]); + _optionalChain$1([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('.-cbwsdk-extension-dialog-container'), 'optionalAccess', _7 => _7.setAttribute, 'call', _8 => _8('style', 'display: none;')]); setTimeout(()=>{ - if(_optionalChain([this, 'optionalAccess', _9 => _9.connector, 'optionalAccess', _10 => _10._relay, 'optionalAccess', _11 => _11.ui, 'optionalAccess', _12 => _12.linkFlow, 'optionalAccess', _13 => _13.isOpen])){ + if(_optionalChain$1([this, 'optionalAccess', _9 => _9.connector, 'optionalAccess', _10 => _10._relay, 'optionalAccess', _11 => _11.ui, 'optionalAccess', _12 => _12.linkFlow, 'optionalAccess', _13 => _13.isOpen])){ this.connector._relay.ui.linkFlow.isOpen = false; } }, 10); @@ -1569,6 +1615,7 @@ TrustEVM, Rabby, Uniswap, + Rainbow, BraveEVM, Opera, MagicEdenEVM, @@ -1586,10 +1633,22 @@ WalletLink }; + function _optionalChain(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; } const getWallets = async(args)=>{ let drip = (args && typeof args.drip === 'function') ? args.drip : undefined; + // eip6963 + window['_eip6963Providers'] = {}; + const announceProvider = (event)=>{ + if(_optionalChain([event, 'optionalAccess', _ => _.detail, 'optionalAccess', _2 => _2.info, 'optionalAccess', _3 => _3.uuid])) { + window['_eip6963Providers'][_optionalChain([event, 'optionalAccess', _4 => _4.detail, 'optionalAccess', _5 => _5.info, 'optionalAccess', _6 => _6.uuid])] = event.detail.provider; + } + }; + window.addEventListener("eip6963:announceProvider", announceProvider); + window.dispatchEvent(new Event("eip6963:requestProvider")); + window.removeEventListener("eip6963:announceProvider", announceProvider); + let availableWallets = await Promise.all( Object.keys(wallets).map( @@ -1624,6 +1683,7 @@ wallets.TrustEVM, wallets.Rabby, wallets.Uniswap, + wallets.Rainbow, wallets.PhantomEVM, wallets.BraveEVM, wallets.OKXEvm, diff --git a/dist/umd/index.js b/dist/umd/index.js index 0e79cbf8..e7bafae4 100644 --- a/dist/umd/index.js +++ b/dist/umd/index.js @@ -8,7 +8,7 @@ var Blockchains__default = /*#__PURE__*/_interopDefaultLegacy(Blockchains); - function _optionalChain$y(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; } + 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; } class Transaction { constructor({ @@ -33,7 +33,7 @@ this.to = (to && to.match('0x')) ? ethers.ethers.utils.getAddress(to) : to; // optional - this.value = _optionalChain$y([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); + this.value = _optionalChain$A([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); this.api = api; this.method = method; this.params = params; @@ -73,7 +73,7 @@ } getParamType(param) { - if(_optionalChain$y([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { + if(_optionalChain$A([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { return `(${param.components.map((param)=>this.getParamType(param)).join(',')})` } else { return param.type @@ -146,7 +146,7 @@ } } - function _optionalChain$x(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; } + function _optionalChain$z(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; } const POLL_SPEED = 500; // 0.5 seconds const MAX_POLLS = 240; // 120 seconds @@ -167,14 +167,14 @@ const provider = await web3Client.getProvider(transaction.blockchain); const { value } = await provider.getSignatureStatus(signature); - const confirmationStatus = _optionalChain$x([value, 'optionalAccess', _ => _.confirmationStatus]); + const confirmationStatus = _optionalChain$z([value, 'optionalAccess', _ => _.confirmationStatus]); if(confirmationStatus) { const hasReachedSufficientCommitment = confirmationStatus === 'confirmed' || confirmationStatus === 'finalized'; if (hasReachedSufficientCommitment) { if(value.err) { transaction._failed = true; const confirmedTransaction = await provider.getConfirmedTransaction(signature); - const failedReason = _optionalChain$x([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null; + const failedReason = _optionalChain$z([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null; if(transaction.failed) transaction.failed(transaction, failedReason); } else { transaction._succeeded = true; @@ -265,7 +265,7 @@ supported$1.evm = ['ethereum', 'bsc', 'polygon', 'fantom', 'arbitrum', 'avalanche', 'gnosis', 'optimism', 'base']; supported$1.solana = ['solana']; - function _optionalChain$w(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; } + function _optionalChain$y(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; } class WindowSolana { static __initStatic() {this.info = { @@ -276,13 +276,13 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$w([window, 'optionalAccess', _6 => _6.solana]) && + _optionalChain$y([window, 'optionalAccess', _6 => _6.solana]) && // not Phantom !(window.phantom && !window.glow && !window.solana.isGlow && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && // not Coin98 !window.coin98 && // not BitKeep - !(_optionalChain$w([window, 'optionalAccess', _7 => _7.solana]) && _optionalChain$w([window, 'optionalAccess', _8 => _8.solana, 'access', _9 => _9.isBitKeep])) && + !(_optionalChain$y([window, 'optionalAccess', _7 => _7.solana]) && _optionalChain$y([window, 'optionalAccess', _8 => _8.solana, 'access', _9 => _9.isBitKeep])) && // not Glow !window.solana.isGlow && // not trust @@ -290,7 +290,7 @@ // Brave Wallet !window.solana.isBraveWallet && // OKX Wallet - !_optionalChain$w([window, 'optionalAccess', _10 => _10.okxwallet]) + !_optionalChain$y([window, 'optionalAccess', _10 => _10.okxwallet]) ) };} @@ -337,7 +337,7 @@ let internalCallback; switch (event) { case 'account': - internalCallback = (publicKey) => callback(_optionalChain$w([publicKey, 'optionalAccess', _11 => _11.toString, 'call', _12 => _12()])); + internalCallback = (publicKey) => callback(_optionalChain$y([publicKey, 'optionalAccess', _11 => _11.toString, 'call', _12 => _12()])); this.getProvider().on('accountChanged', internalCallback); break } @@ -390,7 +390,7 @@ } } WindowSolana.__initStatic(); WindowSolana.__initStatic2(); - function _optionalChain$v(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; } + function _optionalChain$x(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; } class Backpack extends WindowSolana { @@ -402,7 +402,7 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$v([window, 'optionalAccess', _2 => _2.backpack]) && + _optionalChain$x([window, 'optionalAccess', _2 => _2.backpack]) && window.backpack.isBackpack ) };} @@ -420,7 +420,7 @@ } } Backpack.__initStatic(); Backpack.__initStatic2(); - function _optionalChain$u(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; } + function _optionalChain$w(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; } const sendTransaction$2 = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); @@ -475,7 +475,7 @@ sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$u([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$w([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -489,7 +489,7 @@ }); } catch(error) { if( - (error && _optionalChain$u([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$w([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -524,12 +524,12 @@ if(contractArguments) { return await method(...contractArguments, { value: Transaction.bigNumberify(transaction.value, transaction.blockchain), - gasLimit: _optionalChain$u([gas, 'optionalAccess', _7 => _7.toHexString, 'call', _8 => _8()]) + gasLimit: _optionalChain$w([gas, 'optionalAccess', _7 => _7.toHexString, 'call', _8 => _8()]) }) } else { return await method({ value: Transaction.bigNumberify(transaction.value, transaction.blockchain), - gasLimit: _optionalChain$u([gas, 'optionalAccess', _9 => _9.toHexString, 'call', _10 => _10()]) + gasLimit: _optionalChain$w([gas, 'optionalAccess', _9 => _9.toHexString, 'call', _10 => _10()]) }) } }; @@ -541,7 +541,7 @@ }) }; - function _optionalChain$t(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; } + function _optionalChain$v(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; } class WindowEthereum { @@ -553,37 +553,39 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$t([window, 'optionalAccess', _36 => _36.ethereum]) && + _optionalChain$v([window, 'optionalAccess', _38 => _38.ethereum]) && // not MetaMask - !(_optionalChain$t([window, 'optionalAccess', _37 => _37.ethereum, 'optionalAccess', _38 => _38.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) && + !(_optionalChain$v([window, 'optionalAccess', _39 => _39.ethereum, 'optionalAccess', _40 => _40.isMetaMask]) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1) && // not Coin98 - !_optionalChain$t([window, 'optionalAccess', _39 => _39.coin98]) && + !_optionalChain$v([window, 'optionalAccess', _41 => _41.coin98]) && // not Trust Wallet - !(_optionalChain$t([window, 'optionalAccess', _40 => _40.ethereum, 'optionalAccess', _41 => _41.isTrust]) || _optionalChain$t([window, 'optionalAccess', _42 => _42.ethereum, 'optionalAccess', _43 => _43.isTrustWallet])) && + !(_optionalChain$v([window, 'optionalAccess', _42 => _42.ethereum, 'optionalAccess', _43 => _43.isTrust]) || _optionalChain$v([window, 'optionalAccess', _44 => _44.ethereum, 'optionalAccess', _45 => _45.isTrustWallet])) && // not crypto.com - !_optionalChain$t([window, 'optionalAccess', _44 => _44.ethereum, 'optionalAccess', _45 => _45.isDeficonnectProvider]) && + !_optionalChain$v([window, 'optionalAccess', _46 => _46.ethereum, 'optionalAccess', _47 => _47.isDeficonnectProvider]) && // not HyperPay - !_optionalChain$t([window, 'optionalAccess', _46 => _46.ethereum, 'optionalAccess', _47 => _47.isHyperPay]) && + !_optionalChain$v([window, 'optionalAccess', _48 => _48.ethereum, 'optionalAccess', _49 => _49.isHyperPay]) && // not Phantom - !(window.phantom && !window.glow && !_optionalChain$t([window, 'optionalAccess', _48 => _48.solana, 'optionalAccess', _49 => _49.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && + !(window.phantom && !window.glow && !_optionalChain$v([window, 'optionalAccess', _50 => _50.solana, 'optionalAccess', _51 => _51.isGlow]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && // not Rabby - !_optionalChain$t([window, 'optionalAccess', _50 => _50.ethereum, 'optionalAccess', _51 => _51.isRabby]) && + !_optionalChain$v([window, 'optionalAccess', _52 => _52.ethereum, 'optionalAccess', _53 => _53.isRabby]) && // not Backpack - !_optionalChain$t([window, 'optionalAccess', _52 => _52.backpack, 'optionalAccess', _53 => _53.isBackpack]) && + !_optionalChain$v([window, 'optionalAccess', _54 => _54.backpack, 'optionalAccess', _55 => _55.isBackpack]) && // not TokenPocket - !_optionalChain$t([window, 'optionalAccess', _54 => _54.ethereum, 'optionalAccess', _55 => _55.isTokenPocket]) && + !_optionalChain$v([window, 'optionalAccess', _56 => _56.ethereum, 'optionalAccess', _57 => _57.isTokenPocket]) && // not BitKeep - !_optionalChain$t([window, 'optionalAccess', _56 => _56.ethereum, 'optionalAccess', _57 => _57.isBitKeep]) && + !_optionalChain$v([window, 'optionalAccess', _58 => _58.ethereum, 'optionalAccess', _59 => _59.isBitKeep]) && // not Coinbase - !(_optionalChain$t([window, 'optionalAccess', _58 => _58.ethereum, 'optionalAccess', _59 => _59.isCoinbaseWallet]) || _optionalChain$t([window, 'optionalAccess', _60 => _60.ethereum, 'optionalAccess', _61 => _61.isWalletLink])) && + !(_optionalChain$v([window, 'optionalAccess', _60 => _60.ethereum, 'optionalAccess', _61 => _61.isCoinbaseWallet]) || _optionalChain$v([window, 'optionalAccess', _62 => _62.ethereum, 'optionalAccess', _63 => _63.isWalletLink])) && // MetaMask through ProviderMap - !_optionalChain$t([window, 'optionalAccess', _62 => _62.ethereum, 'optionalAccess', _63 => _63.providerMap, 'optionalAccess', _64 => _64.has, 'call', _65 => _65('MetaMask')]) && + !_optionalChain$v([window, 'optionalAccess', _64 => _64.ethereum, 'optionalAccess', _65 => _65.providerMap, 'optionalAccess', _66 => _66.has, 'call', _67 => _67('MetaMask')]) && // Brave Wallet - !_optionalChain$t([window, 'optionalAccess', _66 => _66.ethereum, 'optionalAccess', _67 => _67.isBraveWallet]) && + !_optionalChain$v([window, 'optionalAccess', _68 => _68.ethereum, 'optionalAccess', _69 => _69.isBraveWallet]) && // Uniswap Wallet - !_optionalChain$t([window, 'optionalAccess', _68 => _68.ethereum, 'optionalAccess', _69 => _69.isUniswapWallet]) && + !_optionalChain$v([window, 'optionalAccess', _70 => _70.ethereum, 'optionalAccess', _71 => _71.isUniswapWallet]) && + // Rainbow + !_optionalChain$v([window, 'optionalAccess', _72 => _72.ethereum, 'optionalAccess', _73 => _73.isRainbow]) && // OKX Wallet - !_optionalChain$t([window, 'optionalAccess', _70 => _70.okxwallet]) + !_optionalChain$v([window, 'optionalAccess', _74 => _74.okxwallet]) ) };} @@ -709,7 +711,7 @@ } } WindowEthereum.__initStatic(); WindowEthereum.__initStatic2(); - function _optionalChain$s(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; } + function _optionalChain$u(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; } class Binance extends WindowEthereum { static __initStatic() {this.info = { @@ -719,7 +721,7 @@ };} static __initStatic2() {this.isAvailable = async()=>{ - return _optionalChain$s([window, 'optionalAccess', _2 => _2.BinanceChain]) && + return _optionalChain$u([window, 'optionalAccess', _2 => _2.BinanceChain]) && !window.coin98 && !window.trustwallet };} @@ -739,7 +741,7 @@ okx: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMzYuMSAzMzYuMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzM2LjEgMzM2LjE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojRkZGRkZGO30KPC9zdHlsZT4KPHBhdGggZD0iTTMxMy43LDBIMjIuNEMxMCwwLDAsMTAsMCwyMi40djI5MS4zYzAsMTIuNCwxMCwyMi40LDIyLjQsMjIuNGgyOTEuM2MxMi40LDAsMjIuNC0x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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; } + function _optionalChain$t(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; } class BraveEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -749,14 +751,14 @@ platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$r([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$t([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isBraveWallet]) };} getProvider() { return window.ethereum } } BraveEVM.__initStatic(); BraveEVM.__initStatic2(); - function _optionalChain$q(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; } + function _optionalChain$s(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; } class BraveSVM extends WindowSolana { static __initStatic() {this.info = { @@ -766,14 +768,14 @@ platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$q([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isBraveWallet]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$s([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isBraveWallet]) };} getProvider() { return window.braveSolana } } BraveSVM.__initStatic(); BraveSVM.__initStatic2(); - function _optionalChain$p(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; } + function _optionalChain$r(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; } class Coin98EVM extends WindowEthereum { static __initStatic() {this.info = { @@ -783,13 +785,13 @@ platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$p([window, 'optionalAccess', _2 => _2.coin98]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$r([window, 'optionalAccess', _2 => _2.coin98]) };} getProvider() { return window.coin98.provider } } Coin98EVM.__initStatic(); Coin98EVM.__initStatic2(); - function _optionalChain$o(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; } + function _optionalChain$q(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; } class Coin98SVM extends WindowSolana { static __initStatic() {this.info = { @@ -799,13 +801,13 @@ platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$o([window, 'optionalAccess', _3 => _3.coin98, 'optionalAccess', _4 => _4.sol]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$q([window, 'optionalAccess', _3 => _3.coin98, 'optionalAccess', _4 => _4.sol]) };} getProvider() { return window.coin98.sol } } Coin98SVM.__initStatic(); Coin98SVM.__initStatic2(); - function _optionalChain$n(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; } + function _optionalChain$p(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; } class CoinbaseEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -816,8 +818,8 @@ };} getProvider() { - if(_optionalChain$n([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) { - return _optionalChain$n([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')]) + if(_optionalChain$p([window, 'optionalAccess', _9 => _9.ethereum, 'optionalAccess', _10 => _10.providerMap, 'optionalAccess', _11 => _11.has, 'call', _12 => _12('CoinbaseWallet')])) { + return _optionalChain$p([window, 'optionalAccess', _13 => _13.ethereum, 'optionalAccess', _14 => _14.providerMap, 'optionalAccess', _15 => _15.get, 'call', _16 => _16('CoinbaseWallet')]) } else { return window.ethereum } @@ -826,9 +828,9 @@ static __initStatic2() {this.isAvailable = async()=>{ return( ( - _optionalChain$n([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$n([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink]) + _optionalChain$p([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.isCoinbaseWallet]) || _optionalChain$p([window, 'optionalAccess', _19 => _19.ethereum, 'optionalAccess', _20 => _20.isWalletLink]) ) || ( - _optionalChain$n([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')]) + _optionalChain$p([window, 'optionalAccess', _21 => _21.ethereum, 'optionalAccess', _22 => _22.providerMap, 'optionalAccess', _23 => _23.has, 'call', _24 => _24('CoinbaseWallet')]) ) ) };} @@ -852,7 +854,7 @@ };} } CoinbaseSVM.__initStatic(); CoinbaseSVM.__initStatic2(); - 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; } + function _optionalChain$o(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; } class CryptoCom extends WindowEthereum { static __initStatic() {this.info = { @@ -861,10 +863,10 @@ blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$m([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$o([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isDeficonnectProvider]) };} } CryptoCom.__initStatic(); CryptoCom.__initStatic2(); - 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; } + function _optionalChain$n(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; } class ExodusEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -874,10 +876,10 @@ platform: 'evm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$l([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$n([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isExodus]) };} } ExodusEVM.__initStatic(); ExodusEVM.__initStatic2(); - 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; } + 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; } class ExodusSVM extends WindowSolana { static __initStatic() {this.info = { @@ -887,7 +889,7 @@ platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$k([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isExodus]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$m([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isExodus]) };} } ExodusSVM.__initStatic(); ExodusSVM.__initStatic2(); class Glow extends WindowSolana { @@ -906,7 +908,7 @@ };} } Glow.__initStatic(); Glow.__initStatic2(); - 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; } + 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; } class HyperPay extends WindowEthereum { static __initStatic() {this.info = { @@ -915,10 +917,10 @@ blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$j([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$l([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isHyperPay]) };} } HyperPay.__initStatic(); HyperPay.__initStatic2(); - 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; } + 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; } class MagicEdenEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -930,12 +932,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$i([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMagicEden]) + _optionalChain$k([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isMagicEden]) ) };} } MagicEdenEVM.__initStatic(); MagicEdenEVM.__initStatic2(); - 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; } + 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; } class MagicEdenSVM extends WindowSolana { static __initStatic() {this.info = { @@ -947,12 +949,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$h([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isMagicEden]) + _optionalChain$j([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isMagicEden]) ) };} } MagicEdenSVM.__initStatic(); MagicEdenSVM.__initStatic2(); - 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; } + 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; } class OKXEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -964,12 +966,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$g([window, 'optionalAccess', _2 => _2.okxwallet]) + _optionalChain$i([window, 'optionalAccess', _2 => _2.okxwallet]) ) };} } OKXEVM.__initStatic(); OKXEVM.__initStatic2(); - 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; } + 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; } class OKXSVM extends WindowSolana { static __initStatic() {this.info = { @@ -981,12 +983,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$f([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isOkxWallet]) + _optionalChain$h([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isOkxWallet]) ) };} } OKXSVM.__initStatic(); OKXSVM.__initStatic2(); - 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; } + 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; } class MetaMask extends WindowEthereum { static __initStatic() {this.info = { @@ -995,27 +997,32 @@ blockchains: supported$1.evm };} - getProvider() { - if(_optionalChain$e([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.providerMap, 'optionalAccess', _9 => _9.has, 'call', _10 => _10('MetaMask')])) { - return _optionalChain$e([window, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.providerMap, 'optionalAccess', _13 => _13.get, 'call', _14 => _14('MetaMask')]) - } else { - return window.ethereum - } - } + static __initStatic2() {this.isMetaMask = (provider)=> { + return( + _optionalChain$g([provider, 'optionalAccess', _3 => _3.isMetaMask]) && + Object.keys(provider).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 + ) + };} - static __initStatic2() {this.isAvailable = async()=>{ + static __initStatic3() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return MetaMask.isMetaMask(provider) + }) : undefined + };} + + static __initStatic4() {this.isAvailable = async()=>{ return( - ( - _optionalChain$e([window, 'optionalAccess', _15 => _15.ethereum, 'optionalAccess', _16 => _16.isMetaMask]) && - Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 - ) || ( - _optionalChain$e([window, 'optionalAccess', _17 => _17.ethereum, 'optionalAccess', _18 => _18.providerMap, 'optionalAccess', _19 => _19.has, 'call', _20 => _20('MetaMask')]) - ) + MetaMask.getEip6963Provider() || + MetaMask.isMetaMask(_optionalChain$g([window, 'optionalAccess', _4 => _4.ethereum])) ) };} - } MetaMask.__initStatic(); MetaMask.__initStatic2(); - 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; } + getProvider() { + return MetaMask.getEip6963Provider() || (MetaMask.isMetaMask(_optionalChain$g([window, 'optionalAccess', _5 => _5.ethereum])) && _optionalChain$g([window, 'optionalAccess', _6 => _6.ethereum])) + } + } MetaMask.__initStatic(); MetaMask.__initStatic2(); MetaMask.__initStatic3(); MetaMask.__initStatic4(); + + 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; } class Opera extends WindowEthereum { static __initStatic() {this.info = { @@ -1024,10 +1031,10 @@ blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$d([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$f([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isOpera]) };} } Opera.__initStatic(); Opera.__initStatic2(); - 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; } + 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; } class PhantomEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -1041,13 +1048,13 @@ return ( window.phantom && window.phantom.ethereum && - ! _optionalChain$c([window, 'optionalAccess', _4 => _4.ethereum, 'optionalAccess', _5 => _5.isMagicEden]) && - ! _optionalChain$c([window, 'optionalAccess', _6 => _6.okxwallet]) + ! _optionalChain$e([window, 'optionalAccess', _4 => _4.ethereum, 'optionalAccess', _5 => _5.isMagicEden]) && + ! _optionalChain$e([window, 'optionalAccess', _6 => _6.okxwallet]) ) };} } PhantomEVM.__initStatic(); PhantomEVM.__initStatic2(); - 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; } + 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; } class PhantomSVM extends WindowSolana { static __initStatic() {this.info = { @@ -1061,16 +1068,16 @@ return ( window.phantom && !window.glow && - !_optionalChain$b([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.isGlow]) && - !_optionalChain$b([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isExodus]) && - ! _optionalChain$b([window, 'optionalAccess', _12 => _12.ethereum, 'optionalAccess', _13 => _13.isMagicEden]) && - ! _optionalChain$b([window, 'optionalAccess', _14 => _14.okxwallet]) && + !_optionalChain$d([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.isGlow]) && + !_optionalChain$d([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isExodus]) && + ! _optionalChain$d([window, 'optionalAccess', _12 => _12.ethereum, 'optionalAccess', _13 => _13.isMagicEden]) && + ! _optionalChain$d([window, 'optionalAccess', _14 => _14.okxwallet]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier]) ) };} } PhantomSVM.__initStatic(); PhantomSVM.__initStatic2(); - 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; } + 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; } class Rabby extends WindowEthereum { static __initStatic() {this.info = { @@ -1081,12 +1088,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return( - _optionalChain$a([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby]) + _optionalChain$c([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isRabby]) ) };} } Rabby.__initStatic(); Rabby.__initStatic2(); - 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; } + 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; } class Uniswap extends WindowEthereum { static __initStatic() {this.info = { @@ -1095,14 +1102,53 @@ blockchains: supported$1.evm };} - static __initStatic2() {this.isAvailable = async()=>{ + static __initStatic2() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return _optionalChain$b([provider, 'optionalAccess', _4 => _4.isUniswapWallet]) + }) : undefined + };} + + static __initStatic3() {this.isAvailable = async()=>{ return( - _optionalChain$9([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isUniswapWallet]) + Uniswap.getEip6963Provider() || + _optionalChain$b([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isUniswapWallet]) ) };} - } Uniswap.__initStatic(); Uniswap.__initStatic2(); - 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; } + getProvider() { + return Uniswap.getEip6963Provider() || (_optionalChain$b([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isUniswapWallet]) && _optionalChain$b([window, 'optionalAccess', _9 => _9.ethereum])) + } + } Uniswap.__initStatic(); Uniswap.__initStatic2(); Uniswap.__initStatic3(); + + 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; } + class Rainbow extends WindowEthereum { + + static __initStatic() {this.info = { + name: 'Rainbow', + logo: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzhIMjZDNTYuOTI3OSAzOCA4MiA2My4wNzIxIDgyIDk0VjEwMEg5NEM5Ny4zMTM3IDEwMCAxMDAgOTcuMzEzNyAxMDAgOTRDMTAwIDUzLjEzMDkgNjYuODY5MSAyMCAyNiAyMEMyMi42ODYzIDIwIDIwIDIyLjY4NjMgMjAgMjZWMzhaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNODQgOTRIMTAwQzEwMCA5Ny4zMTM3IDk3LjMxMzcgMTAwIDk0IDEwMEg4NFY5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PblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyNiA5NCkgcm90YXRlKC05MCkgc2NhbGUoNDIpIj4KPHN0b3Agb2Zmc2V0PSIwLjU5NTEzIiBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50OF9yYWRpYWxfNjJfMzI5IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUxIDk3KSBzY2FsZSgxNyA0NS4zMzMzKSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjMgNjkpIHJvdGF0ZSgtOTApIHNjYWxlKDE3IDMyMi4zNykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=", + blockchains: supported$1.evm + };} + + static __initStatic2() {this.getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return _optionalChain$a([provider, 'optionalAccess', _4 => _4.isRainbow]) + }) : undefined + };} + + static __initStatic3() {this.isAvailable = async()=>{ + return( + Rainbow.getEip6963Provider() || + _optionalChain$a([window, 'optionalAccess', _5 => _5.rainbow, 'optionalAccess', _6 => _6.isRainbow]) + ) + };} + + getProvider() { + return Rainbow.getEip6963Provider() || _optionalChain$a([window, 'optionalAccess', _7 => _7.rainbow]) + } + + } Rainbow.__initStatic(); Rainbow.__initStatic2(); Rainbow.__initStatic3(); + + 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; } const KEY$1 = '_DePayWeb3WalletsConnectedSolanaMobileWalletInstance'; @@ -1193,8 +1239,8 @@ await solanaWeb3_js.transact( async (wallet) => { await this.authorize(wallet); - if(_optionalChain$8([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; } - if(_optionalChain$8([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; } + if(_optionalChain$9([options, 'optionalAccess', _ => _.name])) { localStorage[KEY$1+'_name'] = this.name = options.name; } + if(_optionalChain$9([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY$1+'_logo'] = this.logo = options.logo; } } ); return this._account @@ -1253,7 +1299,7 @@ } } SolanaMobileWalletAdapter.__initStatic(); SolanaMobileWalletAdapter.__initStatic2(); - 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; } + 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; } class Solflare extends WindowSolana { static __initStatic() {this.info = { @@ -1264,7 +1310,7 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$7([window, 'optionalAccess', _2 => _2.solflare]) && + _optionalChain$8([window, 'optionalAccess', _2 => _2.solflare]) && window.solflare.isSolflare ) };} @@ -1274,7 +1320,7 @@ _sendTransaction(transaction) { return this.getProvider().signTransaction(transaction) } } Solflare.__initStatic(); Solflare.__initStatic2(); - 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; } + 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; } class TokenPocket extends WindowEthereum { static __initStatic() {this.info = { @@ -1285,12 +1331,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$6([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket]) + _optionalChain$7([window, 'optionalAccess', _3 => _3.ethereum, 'optionalAccess', _4 => _4.isTokenPocket]) ) };} } TokenPocket.__initStatic(); TokenPocket.__initStatic2(); - 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; } + 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; } class TrustEVM extends WindowEthereum { static __initStatic() {this.info = { @@ -1302,13 +1348,13 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - (_optionalChain$5([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$5([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) && + (_optionalChain$6([window, 'optionalAccess', _5 => _5.ethereum, 'optionalAccess', _6 => _6.isTrust]) || _optionalChain$6([window, 'optionalAccess', _7 => _7.ethereum, 'optionalAccess', _8 => _8.isTrustWallet])) && Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!Debug)(?!TrustWallet)(?!MetaMask)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 ) };} } TrustEVM.__initStatic(); TrustEVM.__initStatic2(); - 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; } + 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; } class TrustSVM extends WindowSolana { static __initStatic() {this.info = { @@ -1319,7 +1365,7 @@ };} static __initStatic2() {this.isAvailable = async()=>{ - return _optionalChain$4([window, 'access', _3 => _3.solana, 'optionalAccess', _4 => _4.isTrustWallet]) + return _optionalChain$5([window, 'access', _3 => _3.solana, 'optionalAccess', _4 => _4.isTrustWallet]) };} } TrustSVM.__initStatic(); TrustSVM.__initStatic2(); @@ -1422,7 +1468,7 @@ } }; - 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; } + 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; } const sendTransaction$1 = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); @@ -1473,7 +1519,7 @@ try { sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$3([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1487,7 +1533,7 @@ }); } catch (error) { if( - (error && _optionalChain$3([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1518,7 +1564,7 @@ resolve(sentTransaction); } catch (error) { if( - (error && _optionalChain$3([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) || + (error && _optionalChain$4([error, 'optionalAccess', _7 => _7.stack, 'optionalAccess', _8 => _8.match, 'call', _9 => _9('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1560,8 +1606,8 @@ to: transaction.to, value: transaction.value ? ethers.ethers.BigNumber.from(transaction.value.toString()).toHexString() : undefined, data: await transaction.getData(), - gas: _optionalChain$3([gas, 'optionalAccess', _10 => _10.toHexString, 'call', _11 => _11()]), - gasLimit: _optionalChain$3([gas, 'optionalAccess', _12 => _12.toHexString, 'call', _13 => _13()]), + gas: _optionalChain$4([gas, 'optionalAccess', _10 => _10.toHexString, 'call', _11 => _11()]), + gasLimit: _optionalChain$4([gas, 'optionalAccess', _12 => _12.toHexString, 'call', _13 => _13()]), gasPrice: gasPrice.toHexString(), nonce: ethers.ethers.utils.hexlify(transaction.nonce), }] @@ -1588,16 +1634,16 @@ to: transaction.to, value: transaction.value ? ethers.ethers.BigNumber.from(transaction.value.toString()).toHexString() : undefined, data: '0x0', - gas: _optionalChain$3([gas, 'optionalAccess', _14 => _14.toHexString, 'call', _15 => _15()]), - gasLimit: _optionalChain$3([gas, 'optionalAccess', _16 => _16.toHexString, 'call', _17 => _17()]), - gasPrice: _optionalChain$3([gasPrice, 'optionalAccess', _18 => _18.toHexString, 'call', _19 => _19()]), + gas: _optionalChain$4([gas, 'optionalAccess', _14 => _14.toHexString, 'call', _15 => _15()]), + gasLimit: _optionalChain$4([gas, 'optionalAccess', _16 => _16.toHexString, 'call', _17 => _17()]), + gasPrice: _optionalChain$4([gasPrice, 'optionalAccess', _18 => _18.toHexString, 'call', _19 => _19()]), nonce: ethers.ethers.utils.hexlify(transaction.nonce) }] } }).catch((e)=>{console.log('ERROR', e);}) }; - 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; } + 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; } const KEY = 'depay:wallets:wc2'; @@ -1650,7 +1696,7 @@ optionalNamespaces['eip155'] = { chains: supported$1.evm.map((blockchain)=>`${Blockchains__default['default'][blockchain].namespace}:${Blockchains__default['default'][blockchain].networkId}`), }; - if(_optionalChain$2([optionalNamespaces, 'optionalAccess', _ => _.eip155]) && _optionalChain$2([optionalNamespaces, 'optionalAccess', _2 => _2.eip155, 'optionalAccess', _3 => _3.chains, 'optionalAccess', _4 => _4.length])) { + if(_optionalChain$3([optionalNamespaces, 'optionalAccess', _ => _.eip155]) && _optionalChain$3([optionalNamespaces, 'optionalAccess', _2 => _2.eip155, 'optionalAccess', _3 => _3.chains, 'optionalAccess', _4 => _4.length])) { optionalNamespaces['eip155'].methods = methods; optionalNamespaces['eip155'].events = events; } @@ -1665,9 +1711,9 @@ projectId: localStorage[KEY+":projectId"], metadata: { name: document.title || 'dApp', - description: _optionalChain$2([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('meta[name="description"]'), 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8('content')]) || document.title || 'dApp', + description: _optionalChain$3([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('meta[name="description"]'), 'optionalAccess', _7 => _7.getAttribute, 'call', _8 => _8('content')]) || document.title || 'dApp', url: location.href, - icons: [_optionalChain$2([document, 'access', _9 => _9.querySelector, 'call', _10 => _10("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _11 => _11.href]) || `${location.origin}/favicon.ico`] + icons: [_optionalChain$3([document, 'access', _9 => _9.querySelector, 'call', _10 => _10("link[rel~='icon'], link[rel~='shortcut icon']"), 'optionalAccess', _11 => _11.href]) || `${location.origin}/favicon.ico`] } }); resolve(signClient); @@ -1685,7 +1731,7 @@ };} static __initStatic2() {this.isAvailable = async(options)=>{ - return !! await getLastSession(_optionalChain$2([options, 'optionalAccess', _13 => _13.walletName])) + return !! await getLastSession(_optionalChain$3([options, 'optionalAccess', _13 => _13.walletName])) };} constructor() { @@ -1700,17 +1746,17 @@ } async account() { - if(_optionalChain$2([this, 'access', _14 => _14.session, 'optionalAccess', _15 => _15.namespaces, 'optionalAccess', _16 => _16.eip155, 'optionalAccess', _17 => _17.accounts, 'optionalAccess', _18 => _18.length])) { + if(_optionalChain$3([this, 'access', _14 => _14.session, 'optionalAccess', _15 => _15.namespaces, 'optionalAccess', _16 => _16.eip155, 'optionalAccess', _17 => _17.accounts, 'optionalAccess', _18 => _18.length])) { return this.session.namespaces.eip155.accounts[0].split(':')[2] } } async setSessionBlockchains() { - if(!this.session || (!_optionalChain$2([this, 'access', _19 => _19.session, 'optionalAccess', _20 => _20.namespaces, 'optionalAccess', _21 => _21.eip155]) && !_optionalChain$2([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.optionalNamespaces, 'optionalAccess', _24 => _24.eip155]))) { return } + if(!this.session || (!_optionalChain$3([this, 'access', _19 => _19.session, 'optionalAccess', _20 => _20.namespaces, 'optionalAccess', _21 => _21.eip155]) && !_optionalChain$3([this, 'access', _22 => _22.session, 'optionalAccess', _23 => _23.optionalNamespaces, 'optionalAccess', _24 => _24.eip155]))) { return } if(this.session.namespaces.eip155.chains) { - this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$2([Blockchains__default['default'], 'access', _25 => _25.findByNetworkId, 'call', _26 => _26(chainIdentifier.split(':')[1]), 'optionalAccess', _27 => _27.name])).filter(Boolean); + this.blockchains = this.session.namespaces.eip155.chains.map((chainIdentifier)=>_optionalChain$3([Blockchains__default['default'], 'access', _25 => _25.findByNetworkId, 'call', _26 => _26(chainIdentifier.split(':')[1]), 'optionalAccess', _27 => _27.name])).filter(Boolean); } else if(this.session.namespaces.eip155.accounts) { - this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$2([Blockchains__default['default'], 'access', _28 => _28.findByNetworkId, 'call', _29 => _29(accountIdentifier.split(':')[1]), 'optionalAccess', _30 => _30.name])).filter(Boolean); + this.blockchains = this.session.namespaces.eip155.accounts.map((accountIdentifier)=>_optionalChain$3([Blockchains__default['default'], 'access', _28 => _28.findByNetworkId, 'call', _29 => _29(accountIdentifier.split(':')[1]), 'optionalAccess', _30 => _30.name])).filter(Boolean); } } @@ -1720,13 +1766,13 @@ try { - this.walletName = _optionalChain$2([options, 'optionalAccess', _31 => _31.name]); + this.walletName = _optionalChain$3([options, 'optionalAccess', _31 => _31.name]); // delete localStorage[`wc@2:client:0.3//session`] // DELETE WC SESSIONS this.signClient = await getSignClient(); this.signClient.on("session_delete", (session)=> { - if(_optionalChain$2([session, 'optionalAccess', _32 => _32.topic]) === _optionalChain$2([this, 'access', _33 => _33.session, 'optionalAccess', _34 => _34.topic])) { + if(_optionalChain$3([session, 'optionalAccess', _32 => _32.topic]) === _optionalChain$3([this, 'access', _33 => _33.session, 'optionalAccess', _34 => _34.topic])) { localStorage[KEY+':name'] = undefined; localStorage[KEY+':logo'] = undefined; this.signClient = undefined; @@ -1735,14 +1781,14 @@ }); this.signClient.on("session_update", async(session)=> { - if(_optionalChain$2([session, 'optionalAccess', _35 => _35.topic]) === _optionalChain$2([this, 'access', _36 => _36.session, 'optionalAccess', _37 => _37.topic])) { + if(_optionalChain$3([session, 'optionalAccess', _35 => _35.topic]) === _optionalChain$3([this, 'access', _36 => _36.session, 'optionalAccess', _37 => _37.topic])) { this.session = this.signClient.session.get(session.topic); await this.setSessionBlockchains(); } }); this.signClient.on("session_event", (event)=> { - if(_optionalChain$2([event, 'optionalAccess', _38 => _38.topic]) === _optionalChain$2([this, 'access', _39 => _39.session, 'optionalAccess', _40 => _40.topic])) {} + if(_optionalChain$3([event, 'optionalAccess', _38 => _38.topic]) === _optionalChain$3([this, 'access', _39 => _39.session, 'optionalAccess', _40 => _40.topic])) {} }); const connectWallet = async()=>{ @@ -1753,24 +1799,24 @@ await new Promise(resolve=>setTimeout(resolve, 500)); // to prevent race condition within WalletConnect }; - const lastSession = _optionalChain$2([this, 'optionalAccess', _41 => _41.walletName, 'optionalAccess', _42 => _42.length]) ? await getLastSession(this.walletName) : undefined; + const lastSession = _optionalChain$3([this, 'optionalAccess', _41 => _41.walletName, 'optionalAccess', _42 => _42.length]) ? await getLastSession(this.walletName) : undefined; if(lastSession) { this.session = lastSession; } else { await connectWallet(); } - let meta = _optionalChain$2([this, 'access', _43 => _43.session, 'optionalAccess', _44 => _44.peer, 'optionalAccess', _45 => _45.metadata]); + let meta = _optionalChain$3([this, 'access', _43 => _43.session, 'optionalAccess', _44 => _44.peer, 'optionalAccess', _45 => _45.metadata]); if(meta && meta.name) { this.name = meta.name; localStorage[KEY+':name'] = meta.name; - if(_optionalChain$2([meta, 'optionalAccess', _46 => _46.icons]) && meta.icons.length) { + if(_optionalChain$3([meta, 'optionalAccess', _46 => _46.icons]) && meta.icons.length) { this.logo = meta.icons[0]; localStorage[KEY+':logo'] = this.logo; } } - if(_optionalChain$2([options, 'optionalAccess', _47 => _47.name])) { localStorage[KEY+':name'] = this.name = options.name; } - if(_optionalChain$2([options, 'optionalAccess', _48 => _48.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; } + if(_optionalChain$3([options, 'optionalAccess', _47 => _47.name])) { localStorage[KEY+':name'] = this.name = options.name; } + if(_optionalChain$3([options, 'optionalAccess', _48 => _48.logo])) { localStorage[KEY+':logo'] = this.logo = options.logo; } await this.setSessionBlockchains(); @@ -1810,7 +1856,7 @@ switch (event) { case 'account': internalCallback = async(event)=> { - if(_optionalChain$2([event, 'optionalAccess', _49 => _49.topic]) === _optionalChain$2([this, 'access', _50 => _50.session, 'optionalAccess', _51 => _51.topic]) && event.params.event.name === 'accountsChanged') { + if(_optionalChain$3([event, 'optionalAccess', _49 => _49.topic]) === _optionalChain$3([this, 'access', _50 => _50.session, 'optionalAccess', _51 => _51.topic]) && event.params.event.name === 'accountsChanged') { callback(await this.account()); } }; @@ -1870,7 +1916,7 @@ WalletConnectV2.getConnectedInstance = getConnectedInstance$1; - 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; } + 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; } const sendTransaction = async ({ transaction, wallet })=> { transaction = new Transaction(transaction); if((await wallet.connectedTo(transaction.blockchain)) == false) { @@ -1922,7 +1968,7 @@ sentTransaction.wait(1).then(resolve).catch((error)=>{ if( - (error && _optionalChain$1([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || + (error && _optionalChain$2([error, 'optionalAccess', _ => _.stack, 'optionalAccess', _2 => _2.match, 'call', _3 => _3('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1936,7 +1982,7 @@ }); } catch(error) { if( - (error && _optionalChain$1([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || + (error && _optionalChain$2([error, 'optionalAccess', _4 => _4.stack, 'optionalAccess', _5 => _5.match, 'call', _6 => _6('JSON-RPC error')])) || (error && error.toString().match('undefined')) ) { setTimeout(()=>{ @@ -1981,7 +2027,7 @@ }) }; - function _optionalChain(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; } + 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; } const getConnectedInstance = ()=>{ return window._connectedWalletLinkInstance @@ -2035,10 +2081,10 @@ let connect = (options && options.connect) ? options.connect : ({uri})=>{}; await connect({ uri: this.connector.qrUrl }); - _optionalChain([document, 'access', _ => _.querySelector, 'call', _2 => _2('.-cbwsdk-css-reset'), 'optionalAccess', _3 => _3.setAttribute, 'call', _4 => _4('style', 'display: none;')]); - _optionalChain([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('.-cbwsdk-extension-dialog-container'), 'optionalAccess', _7 => _7.setAttribute, 'call', _8 => _8('style', 'display: none;')]); + _optionalChain$1([document, 'access', _ => _.querySelector, 'call', _2 => _2('.-cbwsdk-css-reset'), 'optionalAccess', _3 => _3.setAttribute, 'call', _4 => _4('style', 'display: none;')]); + _optionalChain$1([document, 'access', _5 => _5.querySelector, 'call', _6 => _6('.-cbwsdk-extension-dialog-container'), 'optionalAccess', _7 => _7.setAttribute, 'call', _8 => _8('style', 'display: none;')]); setTimeout(()=>{ - if(_optionalChain([this, 'optionalAccess', _9 => _9.connector, 'optionalAccess', _10 => _10._relay, 'optionalAccess', _11 => _11.ui, 'optionalAccess', _12 => _12.linkFlow, 'optionalAccess', _13 => _13.isOpen])){ + if(_optionalChain$1([this, 'optionalAccess', _9 => _9.connector, 'optionalAccess', _10 => _10._relay, 'optionalAccess', _11 => _11.ui, 'optionalAccess', _12 => _12.linkFlow, 'optionalAccess', _13 => _13.isOpen])){ this.connector._relay.ui.linkFlow.isOpen = false; } }, 10); @@ -2170,6 +2216,7 @@ Solflare, Rabby, Uniswap, + Rainbow, BraveEVM, BraveSVM, MagicEdenEVM, @@ -2193,10 +2240,22 @@ WalletLink }; + function _optionalChain(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; } const getWallets = async(args)=>{ let drip = (args && typeof args.drip === 'function') ? args.drip : undefined; + // eip6963 + window['_eip6963Providers'] = {}; + const announceProvider = (event)=>{ + if(_optionalChain([event, 'optionalAccess', _ => _.detail, 'optionalAccess', _2 => _2.info, 'optionalAccess', _3 => _3.uuid])) { + window['_eip6963Providers'][_optionalChain([event, 'optionalAccess', _4 => _4.detail, 'optionalAccess', _5 => _5.info, 'optionalAccess', _6 => _6.uuid])] = event.detail.provider; + } + }; + window.addEventListener("eip6963:announceProvider", announceProvider); + window.dispatchEvent(new Event("eip6963:requestProvider")); + window.removeEventListener("eip6963:announceProvider", announceProvider); + let availableWallets = await Promise.all( Object.keys(wallets).map( @@ -2238,6 +2297,7 @@ wallets.Solflare, wallets.Rabby, wallets.Uniswap, + wallets.Rainbow, wallets.BraveEVM, wallets.BraveSVM, wallets.Opera, diff --git a/dist/umd/index.solana.js b/dist/umd/index.solana.js index fa39de17..81263eee 100644 --- a/dist/umd/index.solana.js +++ b/dist/umd/index.solana.js @@ -8,7 +8,7 @@ var Blockchains__default = /*#__PURE__*/_interopDefaultLegacy(Blockchains); - 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; } + 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; } class Transaction { constructor({ @@ -33,7 +33,7 @@ this.to = (to && to.match('0x')) ? ethers.ethers.utils.getAddress(to) : to; // optional - this.value = _optionalChain$c([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); + this.value = _optionalChain$d([Transaction, 'access', _ => _.bigNumberify, 'call', _2 => _2(value, blockchain), 'optionalAccess', _3 => _3.toString, 'call', _4 => _4()]); this.api = api; this.method = method; this.params = params; @@ -73,7 +73,7 @@ } getParamType(param) { - if(_optionalChain$c([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { + if(_optionalChain$d([param, 'optionalAccess', _5 => _5.components, 'optionalAccess', _6 => _6.length])) { return `(${param.components.map((param)=>this.getParamType(param)).join(',')})` } else { return param.type @@ -146,7 +146,7 @@ } } - 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; } + 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; } const POLL_SPEED = 500; // 0.5 seconds const MAX_POLLS = 240; // 120 seconds @@ -167,14 +167,14 @@ const provider = await web3ClientSolana.getProvider(transaction.blockchain); const { value } = await provider.getSignatureStatus(signature); - const confirmationStatus = _optionalChain$b([value, 'optionalAccess', _ => _.confirmationStatus]); + const confirmationStatus = _optionalChain$c([value, 'optionalAccess', _ => _.confirmationStatus]); if(confirmationStatus) { const hasReachedSufficientCommitment = confirmationStatus === 'confirmed' || confirmationStatus === 'finalized'; if (hasReachedSufficientCommitment) { if(value.err) { transaction._failed = true; const confirmedTransaction = await provider.getConfirmedTransaction(signature); - const failedReason = _optionalChain$b([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null; + const failedReason = _optionalChain$c([confirmedTransaction, 'optionalAccess', _2 => _2.meta, 'optionalAccess', _3 => _3.logMessages]) ? confirmedTransaction.meta.logMessages[confirmedTransaction.meta.logMessages.length - 1] : null; if(transaction.failed) transaction.failed(transaction, failedReason); } else { transaction._succeeded = true; @@ -265,7 +265,7 @@ supported$1.evm = []; supported$1.solana = ['solana']; - 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; } + 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; } class WindowSolana { static __initStatic() {this.info = { @@ -276,13 +276,13 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$a([window, 'optionalAccess', _6 => _6.solana]) && + _optionalChain$b([window, 'optionalAccess', _6 => _6.solana]) && // not Phantom !(window.phantom && !window.glow && !window.solana.isGlow && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier])) && // not Coin98 !window.coin98 && // not BitKeep - !(_optionalChain$a([window, 'optionalAccess', _7 => _7.solana]) && _optionalChain$a([window, 'optionalAccess', _8 => _8.solana, 'access', _9 => _9.isBitKeep])) && + !(_optionalChain$b([window, 'optionalAccess', _7 => _7.solana]) && _optionalChain$b([window, 'optionalAccess', _8 => _8.solana, 'access', _9 => _9.isBitKeep])) && // not Glow !window.solana.isGlow && // not trust @@ -290,7 +290,7 @@ // Brave Wallet !window.solana.isBraveWallet && // OKX Wallet - !_optionalChain$a([window, 'optionalAccess', _10 => _10.okxwallet]) + !_optionalChain$b([window, 'optionalAccess', _10 => _10.okxwallet]) ) };} @@ -337,7 +337,7 @@ let internalCallback; switch (event) { case 'account': - internalCallback = (publicKey) => callback(_optionalChain$a([publicKey, 'optionalAccess', _11 => _11.toString, 'call', _12 => _12()])); + internalCallback = (publicKey) => callback(_optionalChain$b([publicKey, 'optionalAccess', _11 => _11.toString, 'call', _12 => _12()])); this.getProvider().on('accountChanged', internalCallback); break } @@ -390,7 +390,7 @@ } } WindowSolana.__initStatic(); WindowSolana.__initStatic2(); - 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; } + 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; } class Backpack extends WindowSolana { @@ -402,7 +402,7 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$9([window, 'optionalAccess', _2 => _2.backpack]) && + _optionalChain$a([window, 'optionalAccess', _2 => _2.backpack]) && window.backpack.isBackpack ) };} @@ -431,7 +431,7 @@ okx: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMzYuMSAzMzYuMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ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LDIwNS40eiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjc5LjEsMjA1LjRoLTY0LjdjLTIuNywwLTUsMi4yLTUsNXY2NC43YzAsMi43LDIuMiw1LDUsNWg2NC43YzIuNywwLDUtMi4yLDUtNXYtNjQuNwoJQzI4NC4xLDIwNy42LDI4MS45LDIwNS40LDI3OS4xLDIwNS40eiIvPgo8L3N2Zz4K", }; - 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; } + 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; } class BraveSVM extends WindowSolana { static __initStatic() {this.info = { @@ -441,14 +441,14 @@ platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$8([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isBraveWallet]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$9([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isBraveWallet]) };} getProvider() { return window.braveSolana } } BraveSVM.__initStatic(); BraveSVM.__initStatic2(); - 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; } + 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; } class Coin98SVM extends WindowSolana { static __initStatic() {this.info = { @@ -458,7 +458,7 @@ platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$7([window, 'optionalAccess', _3 => _3.coin98, 'optionalAccess', _4 => _4.sol]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$8([window, 'optionalAccess', _3 => _3.coin98, 'optionalAccess', _4 => _4.sol]) };} getProvider() { return window.coin98.sol } @@ -482,7 +482,7 @@ };} } CoinbaseSVM.__initStatic(); CoinbaseSVM.__initStatic2(); - 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; } + 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; } class ExodusSVM extends WindowSolana { static __initStatic() {this.info = { @@ -492,7 +492,7 @@ platform: 'svm', };} - static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$6([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isExodus]) };} + static __initStatic2() {this.isAvailable = async()=>{ return _optionalChain$7([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isExodus]) };} } ExodusSVM.__initStatic(); ExodusSVM.__initStatic2(); class Glow extends WindowSolana { @@ -511,7 +511,7 @@ };} } Glow.__initStatic(); Glow.__initStatic2(); - 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; } + 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; } class MagicEdenSVM extends WindowSolana { static __initStatic() {this.info = { @@ -523,12 +523,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$5([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isMagicEden]) + _optionalChain$6([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isMagicEden]) ) };} } MagicEdenSVM.__initStatic(); MagicEdenSVM.__initStatic2(); - 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; } + 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; } class OKXSVM extends WindowSolana { static __initStatic() {this.info = { @@ -540,12 +540,12 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$4([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isOkxWallet]) + _optionalChain$5([window, 'optionalAccess', _3 => _3.solana, 'optionalAccess', _4 => _4.isOkxWallet]) ) };} } OKXSVM.__initStatic(); OKXSVM.__initStatic2(); - 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; } + 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; } class PhantomSVM extends WindowSolana { static __initStatic() {this.info = { @@ -559,16 +559,16 @@ return ( window.phantom && !window.glow && - !_optionalChain$3([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.isGlow]) && - !_optionalChain$3([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isExodus]) && - ! _optionalChain$3([window, 'optionalAccess', _12 => _12.ethereum, 'optionalAccess', _13 => _13.isMagicEden]) && - ! _optionalChain$3([window, 'optionalAccess', _14 => _14.okxwallet]) && + !_optionalChain$4([window, 'optionalAccess', _8 => _8.solana, 'optionalAccess', _9 => _9.isGlow]) && + !_optionalChain$4([window, 'optionalAccess', _10 => _10.solana, 'optionalAccess', _11 => _11.isExodus]) && + ! _optionalChain$4([window, 'optionalAccess', _12 => _12.ethereum, 'optionalAccess', _13 => _13.isMagicEden]) && + ! _optionalChain$4([window, 'optionalAccess', _14 => _14.okxwallet]) && !['isBitKeep'].some((identifier)=>window.solana && window.solana[identifier]) ) };} } PhantomSVM.__initStatic(); PhantomSVM.__initStatic2(); - 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; } + 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; } const KEY = '_DePayWeb3WalletsConnectedSolanaMobileWalletInstance'; @@ -659,8 +659,8 @@ await solanaWeb3_js.transact( async (wallet) => { await this.authorize(wallet); - if(_optionalChain$2([options, 'optionalAccess', _ => _.name])) { localStorage[KEY+'_name'] = this.name = options.name; } - if(_optionalChain$2([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY+'_logo'] = this.logo = options.logo; } + if(_optionalChain$3([options, 'optionalAccess', _ => _.name])) { localStorage[KEY+'_name'] = this.name = options.name; } + if(_optionalChain$3([options, 'optionalAccess', _2 => _2.logo])) { localStorage[KEY+'_logo'] = this.logo = options.logo; } } ); return this._account @@ -719,7 +719,7 @@ } } SolanaMobileWalletAdapter.__initStatic(); SolanaMobileWalletAdapter.__initStatic2(); - 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; } + 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; } class Solflare extends WindowSolana { static __initStatic() {this.info = { @@ -730,7 +730,7 @@ static __initStatic2() {this.isAvailable = async()=>{ return ( - _optionalChain$1([window, 'optionalAccess', _2 => _2.solflare]) && + _optionalChain$2([window, 'optionalAccess', _2 => _2.solflare]) && window.solflare.isSolflare ) };} @@ -740,7 +740,7 @@ _sendTransaction(transaction) { return this.getProvider().signTransaction(transaction) } } Solflare.__initStatic(); Solflare.__initStatic2(); - function _optionalChain(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; } + 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; } class TrustSVM extends WindowSolana { static __initStatic() {this.info = { @@ -751,7 +751,7 @@ };} static __initStatic2() {this.isAvailable = async()=>{ - return _optionalChain([window, 'access', _3 => _3.solana, 'optionalAccess', _4 => _4.isTrustWallet]) + return _optionalChain$1([window, 'access', _3 => _3.solana, 'optionalAccess', _4 => _4.isTrustWallet]) };} } TrustSVM.__initStatic(); TrustSVM.__initStatic2(); @@ -773,10 +773,22 @@ SolanaMobileWalletAdapter, }; + function _optionalChain(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; } const getWallets = async(args)=>{ let drip = (args && typeof args.drip === 'function') ? args.drip : undefined; + // eip6963 + window['_eip6963Providers'] = {}; + const announceProvider = (event)=>{ + if(_optionalChain([event, 'optionalAccess', _ => _.detail, 'optionalAccess', _2 => _2.info, 'optionalAccess', _3 => _3.uuid])) { + window['_eip6963Providers'][_optionalChain([event, 'optionalAccess', _4 => _4.detail, 'optionalAccess', _5 => _5.info, 'optionalAccess', _6 => _6.uuid])] = event.detail.provider; + } + }; + window.addEventListener("eip6963:announceProvider", announceProvider); + window.dispatchEvent(new Event("eip6963:requestProvider")); + window.removeEventListener("eip6963:announceProvider", announceProvider); + let availableWallets = await Promise.all( Object.keys(wallets).map( diff --git a/package.evm.json b/package.evm.json index 0c130caf..6b9a2da5 100644 --- a/package.evm.json +++ b/package.evm.json @@ -1,7 +1,7 @@ { "name": "@depay/web3-wallets-evm", "moduleName": "Web3Wallets", - "version": "17.1.0", + "version": "17.2.0", "description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.", "main": "dist/umd/index.evm.js", "module": "dist/esm/index.evm.js", diff --git a/package.json b/package.json index 334e98b2..3595bb9e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@depay/web3-wallets", "moduleName": "Web3Wallets", - "version": "17.1.0", + "version": "17.2.0", "description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.", "main": "dist/umd/index.js", "module": "dist/esm/index.js", diff --git a/package.solana.json b/package.solana.json index 410577f3..f9b13a82 100644 --- a/package.solana.json +++ b/package.solana.json @@ -1,7 +1,7 @@ { "name": "@depay/web3-wallets-solana", "moduleName": "Web3Wallets", - "version": "17.1.0", + "version": "17.2.0", "description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.", "main": "dist/umd/index.solana.js", "module": "dist/esm/index.solana.js", diff --git a/src/getWallets.js b/src/getWallets.js index a30f37ce..93cd758e 100644 --- a/src/getWallets.js +++ b/src/getWallets.js @@ -4,6 +4,17 @@ const getWallets = async(args)=>{ let drip = (args && typeof args.drip === 'function') ? args.drip : undefined + // eip6963 + window['_eip6963Providers'] = {} + const announceProvider = (event)=>{ + if(event?.detail?.info?.uuid) { + window['_eip6963Providers'][event?.detail?.info?.uuid] = event.detail.provider + } + } + window.addEventListener("eip6963:announceProvider", announceProvider) + window.dispatchEvent(new Event("eip6963:requestProvider")) + window.removeEventListener("eip6963:announceProvider", announceProvider) + let availableWallets = await Promise.all( Object.keys(wallets).map( diff --git a/src/index.js b/src/index.js index e827e8b3..4b4b57ef 100644 --- a/src/index.js +++ b/src/index.js @@ -10,6 +10,7 @@ const supported = [ wallets.TrustEVM, wallets.Rabby, wallets.Uniswap, + wallets.Rainbow, wallets.PhantomEVM, wallets.BraveEVM, wallets.OKXEvm, @@ -65,6 +66,7 @@ const supported = [ wallets.Solflare, wallets.Rabby, wallets.Uniswap, + wallets.Rainbow, wallets.BraveEVM, wallets.BraveSVM, wallets.Opera, diff --git a/src/wallets.js b/src/wallets.js index 7c8f2c37..af94eb50 100644 --- a/src/wallets.js +++ b/src/wallets.js @@ -14,6 +14,7 @@ import Opera from './wallets/Opera' import PhantomEVM from './wallets/Phantom.evm' import Rabby from './wallets/Rabby' import Uniswap from './wallets/Uniswap' +import Rainbow from './wallets/Rainbow' import TokenPocket from './wallets/TokenPocket' import TrustEVM from './wallets/Trust.evm' import WalletConnectV2 from './wallets/WalletConnectV2' @@ -27,6 +28,7 @@ export default { TrustEVM, Rabby, Uniswap, + Rainbow, BraveEVM, Opera, MagicEdenEVM, @@ -103,6 +105,7 @@ import PhantomEVM from './wallets/Phantom.evm' import PhantomSVM from './wallets/Phantom.svm' import Rabby from './wallets/Rabby' import Uniswap from './wallets/Uniswap' +import Rainbow from './wallets/Rainbow' import SolanaMobileWalletAdapter from './wallets/SolanaMobileWalletAdapter' import Solflare from './wallets/Solflare' import TokenPocket from './wallets/TokenPocket' @@ -127,6 +130,7 @@ export default { Solflare, Rabby, Uniswap, + Rainbow, BraveEVM, BraveSVM, MagicEdenEVM, diff --git a/src/wallets/MetaMask.js b/src/wallets/MetaMask.js index 949fa919..46a2bac8 100644 --- a/src/wallets/MetaMask.js +++ b/src/wallets/MetaMask.js @@ -9,22 +9,27 @@ export default class MetaMask extends WindowEthereum { blockchains: supported.evm } - getProvider() { - if(window?.ethereum?.providerMap?.has('MetaMask')) { - return window?.ethereum?.providerMap?.get('MetaMask') - } else { - return window.ethereum - } + static isMetaMask = (provider)=> { + return( + provider?.isMetaMask && + Object.keys(provider).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 + ) + } + + static getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return MetaMask.isMetaMask(provider) + }) : undefined } static isAvailable = async()=>{ return( - ( - window?.ethereum?.isMetaMask && - Object.keys(window.ethereum).filter((key)=>key.match(/^is(?!Connected)(?!PocketUniverse)(?!RevokeCash)/)).length == 1 - ) || ( - window?.ethereum?.providerMap?.has('MetaMask') - ) + MetaMask.getEip6963Provider() || + MetaMask.isMetaMask(window?.ethereum) ) } + + getProvider() { + return MetaMask.getEip6963Provider() || (MetaMask.isMetaMask(window?.ethereum) && window?.ethereum) + } } diff --git a/src/wallets/Rainbow.js b/src/wallets/Rainbow.js new file mode 100644 index 00000000..a8acbb54 --- /dev/null +++ b/src/wallets/Rainbow.js @@ -0,0 +1,29 @@ +import { supported } from '../blockchains' +import WindowEthereum from './WindowEthereum' + +export default class Rainbow extends WindowEthereum { + + static info = { + name: 'Rainbow', + logo: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdod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dyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjMgNjkpIHJvdGF0ZSgtOTApIHNjYWxlKDE3IDMyMi4zNykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo=", + blockchains: supported.evm + } + + static getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return provider?.isRainbow + }) : undefined + } + + static isAvailable = async()=>{ + return( + Rainbow.getEip6963Provider() || + window?.rainbow?.isRainbow + ) + } + + getProvider() { + return Rainbow.getEip6963Provider() || window?.rainbow + } + +} diff --git a/src/wallets/Uniswap.js b/src/wallets/Uniswap.js index 0f1a7933..85e8fea9 100644 --- a/src/wallets/Uniswap.js +++ b/src/wallets/Uniswap.js @@ -9,9 +9,20 @@ export default class Uniswap extends WindowEthereum { blockchains: supported.evm } - static isAvailable = async()=>{ + static getEip6963Provider = ()=>{ + return window['_eip6963Providers'] ? Object.values(window['_eip6963Providers']).find((provider)=>{ + return provider?.isUniswapWallet + }) : undefined + } + + static isAvailable = async()=>{ return( + Uniswap.getEip6963Provider() || window?.ethereum?.isUniswapWallet ) } + + getProvider() { + return Uniswap.getEip6963Provider() || (window?.ethereum?.isUniswapWallet && window?.ethereum) + } } diff --git a/src/wallets/WindowEthereum.js b/src/wallets/WindowEthereum.js index eddf1a31..523742eb 100644 --- a/src/wallets/WindowEthereum.js +++ b/src/wallets/WindowEthereum.js @@ -56,6 +56,8 @@ export default class WindowEthereum { !window?.ethereum?.isBraveWallet && // Uniswap Wallet !window?.ethereum?.isUniswapWallet && + // Rainbow + !window?.ethereum?.isRainbow && // OKX Wallet !window?.okxwallet )