1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5644],{89744:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS=t.GENERIC_GAS_LIMIT_ORDER_EXECUTION=t.NATIVE_WRAPPED_TOKEN_ADDRESS=t.NATIVE_TOKEN_NAME=t.NATIVE_WRAPPED_TOKEN_TICKER=t.NATIVE_TOKEN_TICKER=t.GELATO_LIMIT_ORDERS_ERC20_ORDER_ROUTER=t.GELATO_LIMIT_ORDERS_MODULE_FLASHBOTS_ADDRESS=t.GELATO_LIMIT_ORDERS_MODULE_ADDRESS=t.GELATO_LIMIT_ORDERS_ADDRESS=t.SUBGRAPH_URL=t.OLD_SUBGRAPH_URL=t.NETWORK_STOP_LIMIT_HANDLERS=t.NETWORK_HANDLERS=t.NETWORK_NAME=t.HANDLERS_ADDRESSES=t.LIMIT_ORDER_SLIPPAGE=t.STOP_LIMIT_SLIPPAGE_BPS=t.BPS_GELATO_FEE=t.CHAIN_ID=t.MAX_LIFETIME_IN_SECONDS=t.SLIPPAGE_BPS=t.ETH_ADDRESS=void 0,t.ETH_ADDRESS="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",t.SLIPPAGE_BPS=40,t.MAX_LIFETIME_IN_SECONDS=7889238,t.CHAIN_ID={MAINNET:1,ROPSTEN:3,GOERLI:5,BSC:56,MATIC:137,FANTOM:250,AVAX:43114},t.BPS_GELATO_FEE={[t.CHAIN_ID.MAINNET]:10,[t.CHAIN_ID.MATIC]:10,[t.CHAIN_ID.FANTOM]:10,[t.CHAIN_ID.BSC]:10,[t.CHAIN_ID.AVAX]:10},t.STOP_LIMIT_SLIPPAGE_BPS={[t.CHAIN_ID.MAINNET]:500,[t.CHAIN_ID.ROPSTEN]:500,[t.CHAIN_ID.MATIC]:500,[t.CHAIN_ID.FANTOM]:500,[t.CHAIN_ID.BSC]:500,[t.CHAIN_ID.AVAX]:500},t.LIMIT_ORDER_SLIPPAGE={[t.CHAIN_ID.MAINNET]:40,[t.CHAIN_ID.ROPSTEN]:40,[t.CHAIN_ID.MATIC]:40,[t.CHAIN_ID.FANTOM]:40,[t.CHAIN_ID.BSC]:40,[t.CHAIN_ID.AVAX]:40},t.HANDLERS_ADDRESSES={[t.CHAIN_ID.MAINNET]:{uniswap:"0x837c03414fb86861f28ca7e91e5fd770fda0f52d",uniswap_stoplimit:"0xf437a1a98566872f734bd18addf4bb610d1f887b"},[t.CHAIN_ID.ROPSTEN]:{uniswap:"0x1f397f95d31eb20183b69d685a5060cfdefd508b",quickswap_stoplimit:"0x87bE4Eb9dFb2DefcEA035D3010f33584Fc8ddDB5"},[t.CHAIN_ID.MATIC]:{quickswap:"0xaccbd2c6ad75ad3394dc5f4b1f606bf111e4eae3",polydex:"0x00fc86d360162e4672ec6B427E12ed36F39f1f53",cafeswap:"0xd167afcee4e9a89e69646fd3c27e58b61d1b7f97",quickswap_stoplimit:"0x51cc226648f8de65513de7cdfd3e7b116156234e"},[t.CHAIN_ID.FANTOM]:{spiritswap:"0x5fb00386558ccc219e51b69d8e963ef20b0c267a",spookyswap:"0x228ffd7122d202c0cd24330892881c47b0817c7a",bombswap:"0x87C4Fbd67f6DD8a1B5EFD9879956c728C97afeFe",defyswap:"0x3d401587320522a5e0bb973d10a852430a8edbbd",spiritswap_stoplimit:"0x6ea82c72732389c5149326e048a46be9f8bec8e8",spookyswap_stoplimit:"0xe912cd26c4a4cfffc175a297f1328ab23313a1a7"},[t.CHAIN_ID.BSC]:{pancakeswap:"0x88f8CCC064bA2D39cF08D57B6e7504a7B6bE8E4e",pancakeswap_stoplimit:"0x84b826bcd26f1bc0cd5fbbdef7f5b8965d6bbb38"},[t.CHAIN_ID.AVAX]:{traderjoe:"0x88f8CCC064bA2D39cF08D57B6e7504a7B6bE8E4e",pangolin:"0x8b206547cfe6f35a77ddab2d6d97260765a349ef",pangolin_stoplimit:"0xb4c53e2e32caf977d61a8a776bdc44837a5d0d91",traderjoe_stoplimit:"0xcf497830e43836738bdd0c3d7e09b599ddf081b2"}},t.NETWORK_NAME={[t.CHAIN_ID.MAINNET]:"Ethereum",[t.CHAIN_ID.ROPSTEN]:"Ropsten",[t.CHAIN_ID.GOERLI]:"Goerli",[t.CHAIN_ID.MATIC]:"Polygon (Matic)",[t.CHAIN_ID.FANTOM]:"FANTOM",[t.CHAIN_ID.BSC]:"BSC",[t.CHAIN_ID.AVAX]:"AVAX"},t.NETWORK_HANDLERS={[t.CHAIN_ID.MAINNET]:["uniswap","uniswap_stoplimit"],[t.CHAIN_ID.ROPSTEN]:["uniswap","quickswap_stoplimit"],[t.CHAIN_ID.MATIC]:["quickswap","polydex","cafeswap","quickswap_stoplimit"],[t.CHAIN_ID.FANTOM]:["spiritswap","spookyswap","bombswap","defyswap","spiritswap_stoplimit","spookyswap_stoplimit"],[t.CHAIN_ID.BSC]:["pancakeswap","pancakeswap_stoplimit"],[t.CHAIN_ID.AVAX]:["traderjoe","pangolin","pangolin_stoplimit","traderjoe_stoplimit"]},t.NETWORK_STOP_LIMIT_HANDLERS={[t.CHAIN_ID.MAINNET]:["uniswap_stoplimit"],[t.CHAIN_ID.ROPSTEN]:["quickswap_stoplimit"],[t.CHAIN_ID.MATIC]:["quickswap_stoplimit"],[t.CHAIN_ID.BSC]:["pancakeswap_stoplimit"],[t.CHAIN_ID.FANTOM]:["spookyswap_stoplimit","spiritswap_stoplimit"],[t.CHAIN_ID.AVAX]:["traderjoe_stoplimit","pangolin_stoplimit"]},t.OLD_SUBGRAPH_URL={[t.CHAIN_ID.MAINNET]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders",[t.CHAIN_ID.ROPSTEN]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-ropsten",[t.CHAIN_ID.MATIC]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-polygon",[t.CHAIN_ID.FANTOM]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-fantom"},t.SUBGRAPH_URL={[t.CHAIN_ID.MAINNET]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-ii",[t.CHAIN_ID.MATIC]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-polygon-ii",[t.CHAIN_ID.FANTOM]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-fantom-ii",[t.CHAIN_ID.BSC]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-bsc",[t.CHAIN_ID.AVAX]:"https://api.thegraph.com/subgraphs/name/gelatodigital/limit-orders-avax"},t.GELATO_LIMIT_ORDERS_ADDRESS={[t.CHAIN_ID.MAINNET]:"0x36049D479A97CdE1fC6E2a5D2caE30B666Ebf92B",[t.CHAIN_ID.ROPSTEN]:"0x0e5096D201Fe2985f5C26432A76f145D6e5D1453",[t.CHAIN_ID.GOERLI]:"0xa0453c6ab71fe3da89640ee2503326bd0899a589",[t.CHAIN_ID.MATIC]:"0x38c4092b28dAB7F3d98eE6524549571c283cdfA5",[t.CHAIN_ID.FANTOM]:"0x05Ad1094Eb6Cde564d732196F6754Ee464896031",[t.CHAIN_ID.BSC]:"0x0c30D3d66bc7C73A83fdA929888c34dcb24FD599",[t.CHAIN_ID.AVAX]:"0x0c30D3d66bc7C73A83fdA929888c34dcb24FD599"},t.GELATO_LIMIT_ORDERS_MODULE_ADDRESS={[t.CHAIN_ID.MAINNET]:"0x037fc8e71445910e1E0bBb2a0896d5e9A7485318",[t.CHAIN_ID.ROPSTEN]:"0x3f3C13b09B601fb6074124fF8D779d2964caBf8B",[t.CHAIN_ID.GOERLI]:"0xCf8EDB3333Fae73b23f689229F4De6Ac95d1f707",[t.CHAIN_ID.MATIC]:"0x5A36178E38864F5E724A2DaF5f9cD9bA473f7903",[t.CHAIN_ID.FANTOM]:"0xf2253BF9a0BD002300cFe6f4E630d755669f6DCa",[t.CHAIN_ID.BSC]:"0xb7499a92fc36e9053a4324aFfae59d333635D9c3",[t.CHAIN_ID.AVAX]:"0xb7499a92fc36e9053a4324aFfae59d333635D9c3"},t.GELATO_LIMIT_ORDERS_MODULE_FLASHBOTS_ADDRESS={[t.CHAIN_ID.MAINNET]:"0xbeC333EDE1A0687D2b9624F8C073a54c93ba9777",[t.CHAIN_ID.GOERLI]:"0xCf8EDB3333Fae73b23f689229F4De6Ac95d1f707"},t.GELATO_LIMIT_ORDERS_ERC20_ORDER_ROUTER={[t.CHAIN_ID.MAINNET]:"0x5fb00386558ccc219e51b69d8e963ef20b0c267a",[t.CHAIN_ID.ROPSTEN]:"0x9c06ff386779cc2269d482bcecf2378a4ff5cb90",[t.CHAIN_ID.GOERLI]:"0x247A1306b6122ba28862b19a95004899db91f1b5",[t.CHAIN_ID.MATIC]:"0x0c2c2963a4353ffd839590f7cb1e783688378814",[t.CHAIN_ID.FANTOM]:"0x59e61b95f20e940ac777e88fa2dfa0a6a4c40fa0",[t.CHAIN_ID.BSC]:"0x64c7f3c2C19B41a6aD6
17bb5f4edc8EdbB3284F34",[t.CHAIN_ID.AVAX]:"0x64c7f3c2C19B41a6aD67bb5f4edc8EdbB3284F34"},t.NATIVE_TOKEN_TICKER={[t.CHAIN_ID.MAINNET]:"ETH",[t.CHAIN_ID.ROPSTEN]:"ETH",[t.CHAIN_ID.GOERLI]:"ETH",[t.CHAIN_ID.MATIC]:"MATIC",[t.CHAIN_ID.FANTOM]:"FTM",[t.CHAIN_ID.BSC]:"BNB",[t.CHAIN_ID.AVAX]:"AVAX"},t.NATIVE_WRAPPED_TOKEN_TICKER={[t.CHAIN_ID.MAINNET]:"WETH",[t.CHAIN_ID.ROPSTEN]:"WETH",[t.CHAIN_ID.GOERLI]:"WETH",[t.CHAIN_ID.MATIC]:"WMATIC",[t.CHAIN_ID.FANTOM]:"WFTM",[t.CHAIN_ID.BSC]:"WBNB",[t.CHAIN_ID.AVAX]:"WAVAX"},t.NATIVE_TOKEN_NAME={[t.CHAIN_ID.MAINNET]:"Ether",[t.CHAIN_ID.ROPSTEN]:"Ether",[t.CHAIN_ID.GOERLI]:"Ether",[t.CHAIN_ID.MATIC]:"Matic",[t.CHAIN_ID.FANTOM]:"Fantom",[t.CHAIN_ID.BSC]:"Bnb",[t.CHAIN_ID.AVAX]:"Avax"},t.NATIVE_WRAPPED_TOKEN_ADDRESS={[t.CHAIN_ID.MAINNET]:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",[t.CHAIN_ID.ROPSTEN]:"0xc778417e063141139fce010982780140aa0cd5ab",[t.CHAIN_ID.GOERLI]:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",[t.CHAIN_ID.MATIC]:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",[t.CHAIN_ID.FANTOM]:"0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83",[t.CHAIN_ID.BSC]:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",[t.CHAIN_ID.AVAX]:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"},t.GENERIC_GAS_LIMIT_ORDER_EXECUTION="400000",t.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS={[t.CHAIN_ID.MAINNET]:"0x260aB0aCb931D7Da784fC35c7E96c3B13213Abf1",[t.CHAIN_ID.ROPSTEN]:"0xDC41072F4aFE7e4a7ea0f21d13a92662Fe733C55",[t.CHAIN_ID.MATIC]:"0x81967ac4ce8e2d94f7e4b4cf3d2e760605079604",[t.CHAIN_ID.BSC]:"0xe912cd26c4a4cfffc175a297f1328ab23313a1a7",[t.CHAIN_ID.FANTOM]:"0xf437a1a98566872f734bd18addf4bb610d1f887b",[t.CHAIN_ID.AVAX]:"0xf437a1a98566872f734bd18addf4bb610d1f887b"}},98081:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERC20OrderRouter__factory=void 0;const n=r(97420),i=[{inputs:[{internalType:"contract IGelatoPineCore",name:"_gelatoPineCore",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"key",type:"bytes32"},{indexed:!0,internalType:"address",name:"caller",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"address",name:"module",type:"address"},{indexed:!1,internalType:"address",name:"inputToken",type:"address"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"address",name:"witness",type:"address"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"},{indexed:!1,internalType:"bytes32",name:"secret",type:"bytes32"}],name:"DepositToken",type:"event"},{inputs:[{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_module",type:"address"},{internalType:"address",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"bytes32",name:"_secret",type:"bytes32"}],name:"depositToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"gelatoPineCore",outputs:[{internalType:"contract IGelatoPineCore",name:"",type:"address"}],stateMutability:"view",type:"function"}];class o{static createInterface(){return new n.utils.Interface(i)}static connect(e,t){return new n.Contract(e,i,t)}}t.ERC20OrderRouter__factory=o,o.abi=i},99272:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERC20__factory=void 0;const n=r(97420),i=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}];class o{static createInterface(){return new n.utils.Interface(i)}static connect(e,t){return new n.Contract(e,i,t)}}t.ERC20__factory=o,o.abi=i},23744:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.GelatoLimitOrders__factory=void 0;const n=r(97420),i=[{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"_key",type:"bytes32"},{indexed:!0,internalType:"address",name:"_caller",type:"address"},{indexed:!1,internalType:"uint256",name:"_amount",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_data",type:"bytes"}],name:"DepositETH",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"_key",type:"bytes32"},{indexed:!1,internalType:"address",name:"_inputToken",type:"address"},{indexed:!1,internalType:"address",name:"_owner",type:"address"},{indexed:!1,internalType:"address",name:"_witness",type:"address"},{indexed:!1,internalType:"bytes",name:"_data",type:"bytes"},{indexed:!1,internalType:"uint256",name:"_amount",type:"uint256"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"_key",type:"bytes32"},{indexed:!1,internalType:"address",name:"_inputToken",type:"address"},{indexed:!1,internalType:"address",name:"_owner",type:"address"},{indexed:!1,internalType:"address",name:"_witness",type:"address"},{indexed:!1,internalType:"bytes",name:"_data",type:"bytes"},{indexed:!1,internalType:"bytes",name:"_auxData",type:"bytes"},{indexed:!1,internalType:"uint256",name:"_amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"_bought",type:"uint256"}],name:"OrderExecuted",type:"event"},{inputs:[],name:"ETH_ADDRESS",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IModule",name:"_module",type:"address"},{internalType:"contract IERC20",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"bytes",name:"_auxData",type:"bytes"}],name:"canExecuteOrder",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IModule",name:"_module",type:"address"},{internalType:"contract IERC20",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"cancelOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"decodeOrder",outputs:[{internalType:"address",name:"module",type:"address"},{internalType:"address",name:"inputToken",type:"address"},{internalType:"address payable",name:"owner",type:"address"},{internalType:"address",name:"witness",type:"address"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"bytes32",name:"secret",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"}],name:"depositEth",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_module",type:"address"},{internalType:"address",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"bytes32",name:"_secret",type:"bytes32"}],name:"encodeEthOrder",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"contract IModule",name:"_module",type:"address"},{internalType:"contract IERC20",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"bytes32",name:"_secret",type:"bytes32"},{internalType:"uint256",name:"_amount",type:"uint256"}],name:"encodeTokenOrder",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"ethDeposits",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IModule",name:"_module",type:"address"},{internalType:"contract IERC20",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bytes",name:"_auxData",type:"bytes"}],name:"executeOrder",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IModule",name:"_module",type:"address"},{internalType:"contract IERC20",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"existOrder",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IModule",name:"_module",type:"address"},{internalType:"contract IERC20",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"keyOf",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"contract IModule",name:"_module",type:"address"},{internalType:"contract IERC20",name:"_inputToken",type:"address"},{internalType:"address payable",name:"_owner",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"vaultOfOrder",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}];class o{static createInterface(){return new n.utils.Interface(i)}static connect(e,t){return new n.Contract(e,i,t)}}t.GelatoLimitOrders__factory=o,o.abi=i},82354:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Multicall__factory=void 0;const n=r(97420),i=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];class o{static createInterface(){return new n.utils.Interface(i)}static connect(e,t){return new n.Contract(e,i,t)}}t.Multicall__factory=o,o.abi=i},16060:function(e,t,r){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Multicall__factory=t.GelatoLimitOrders__factory=t.ERC20OrderRouter__factory=t.ERC20__factory=void 0;var n=r(99272);Object.defineProperty(t,"ERC20__factory",{enumerable:!0,get:function(){return n.ERC20__factory}});var i=r(98081);Object.defineProperty(t,"ERC20OrderRouter__factory",{enumerable:!0,get:function(){return i.ERC20OrderRouter__factory}});var o=r(23744);Object.defineProperty(t,"GelatoLimitOrders__factory",{enumerable:!0,get:function(){return o.GelatoLimitOrders__factory}});var a=r(82354);Object.defineProperty(t,"Multicall__factory",{enumerable:!0,get:function(){return a.Multicall__factory}})},74782:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.constants=t.utils=t.isEthereumChain=t.GelatoStopLimitOrders=t.isValidChainIdAndHandler=t.GelatoLimitOrders=void 0;const n=r(70655);var i=r(78905);Object.defineProperty(t,"GelatoLimitOrders",{enumerable:!0,get:function(){return i.GelatoLimitOrders}}),Object.defineProperty(t,"isValidChainIdAndHandler",{enumerable:!0,get:function(){return i.isValidChainIdAndHandler}});var o=r(45741);Object.defineProperty(t,"GelatoStopLimitOrders",{enumerable:!0,get:function(){return o.GelatoStopLimitOrders}});var a=r(41153);Object.defineProperty(t,"isEthereumChain",{enumerable:!0,get:function(){return a.isEthereumChain}}),(0,n.__exportStar)(r(82938),t),t.utils=(0,n.__importStar)(r(41153)),t.constants=(0,n.__importStar)(r(89744))},78905:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GelatoLimitOrders=t.isFlashbotsCompatibleChainId=t.isValidChainIdAndHandler=void 0;const n=r(70655),i=r(97420),o=r(81556),a=r(48088),s=r(89744),u=r(16060),c=r(40615),l=r(41153);t.isValidChainIdAndHandler=(e,t)=>s.NETWORK_HANDLERS[e].includes(t);t.isFlashbotsCompatibleChainId=e=>e==s.CHAIN_ID.MAINNET||e==s.CHAIN_ID.GOERLI;t.GelatoLimitOrders=class{constructor(e,r,n,c=!1){var l;if(n&&!(0,t.isValidChainIdAndHandler)(e,n))throw new Error("Invalid chainId and handler");if(c&&(n||!(0,t.isFlashbotsCompatibleChainId)(e)))throw new Error("Invalid chainId or handler for Flashbots bundle submission. handler must be undefined, and chainId either 1 (mainnet) or 5 (goerli)");this._chainId=e,this._gelatoFeeBPS=s.BPS_GELATO_FEE[e],this._slippageBPS=s.LIMIT_ORDER_SLIPPAGE[e],this._subgraphUrl=s.SUBGRAPH_URL[e],this._signer=a.Signer.isSigner(r)?r:void 0,this._provider=o.Provider.isProvider(r)?r:a.Signer.isSigner(r)?r.provider:void 0,this._gelatoLimitOrders=this._signer?u.GelatoLimitOrders__factory.connect(s.GELATO_LIMIT_ORDERS_ADDRESS[this._chainId],this._signer):this._provider?u.GelatoLimitOrders__factory.connect(s.GELATO_LIMIT_ORDERS_ADDRESS[this._chainId],this._provider):new i.Contract(s.GELATO_LIMIT_ORDERS_ADDRESS[this._chainId],u.GelatoLimitOrders__factory.createInterface()),this._moduleAddress=c?s.GELATO_LIMIT_ORDERS_MODULE_FLASHBOTS_ADDRESS[this._chainId]:s.GELATO_LIMIT_ORDERS_MODULE_ADDRESS[this._chainId],this._handler=n,this._handlerAddress=n?null===(l=s.HANDLERS_ADDRESSES[this._chainId][n])||void 0===l?void 0:l.toLowerCase():void 0,this._isFlashbotsProtected=c,this._abiEncoder=new i.utils.AbiCoder,this._erc20OrderRouter=this._signer?u.ERC20OrderRouter__factory.connect(s.GELATO_LIMIT_ORDERS_ERC20_ORDER_ROUTER[this._chainId],this._signer):this._provider?u.ERC20OrderRouter__factory.connect(s.GELATO_LIMIT_ORDERS_ERC20_ORDER_ROUTER[this._chainId],this._provider):new i.Contract(s.GELATO_LIMIT_ORDERS_ERC20_ORDER_ROUTER[this._chainId],u.ERC20OrderRouter__factory.createInterface())}get gelatoFeeBPS(){return this._gelatoFeeBPS}get slippageBPS(){return this._slippageBPS}get chainId(){return this._chainId}get signer(){return this._signer}get provider(){return this._provider}get subgraphUrl(){return this._subgraphUrl}get handler(){return this._handler}get handlerAddress(){return this._handlerAddress}get moduleAddress(){return this._moduleAddress}get contract(){return this._gelatoLimitOrders}get erc20OrderRouter(){return this._erc20OrderRouter}get isFlashbotsProtected(){return this._isFlashbotsProtected}encodeLimitOrderSubmission(e,t,r,i,o,a=!0){return(0,n.__awaiter)(this,void 0,void 0,(function*(){const{payload:n}=yield this.encodeLimitOrderSubmissionWithSecret(e,t,r,i,o,a);return n}))}encodeLimitOrderSubmissionWithSecret(e,t,r,o,a,s=!0){var u;return(0,n.__awaiter)(this,void 0,void 0,(function*(){const n=`0x67656c61746f6e6574776f726b${i.utils.hexlify(i.utils.randomBytes(19)).replace("0x","")}`,{privateKey:c,address:l}=new i.Wallet(n),{minReturn:d}=this.getFeeAndSlippageAdjustedMinReturn(o),p=yield this._encodeSubmitData(e,t,a,l,r,d,c,s),f=this._handlerAddress?this._abiEncoder.encode(["address","uint256","address"],[t,d,this._handlerAddress]):this._abiEncoder.encode(["address","uint256"],[t,d]);return{payload:p,secret:c,witness:l,order:{id:this._getKey({module:this._moduleAddress,inputToken:e,owner:a,witness:l,data:f}),module:this._moduleAddress.toLowerCase(),data:f,inputToken:e.toLowerCase(),outputToken:t.toLowerCase(),owner:a.toLowerCase(),witness:l.toLowerCase(),inputAmount:r.toString(),minReturn:d.toString(),adjustedMinReturn:o.toString(),inputData:p.data.toString(),secret:c.toLowerCase(),handler:null!==(u=this._handlerAddress)&&void 0!==u?u:null}}}))}submitLimitOrder(e,t,r,o,a=!0,s){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._signer)throw new Error("No signer");const n=yield this._signer.getAddress(),u=yield this.encodeLimitOrderSubmission(e,t,r,o,n,a);return this._signer.sendTransaction(Object.assign(Object.assign({},s),{to:u.to,data:u.data,value:i.BigNumber.from(u.value)}))}))}encodeLimitOrderCancellation(e,t){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._gelatoLimitOrders)throw new Error("No gelato limit orders contract");if(!e.inputToken)throw new Error("No input token in order");if(!e.witness)throw new Error("No witness in order");if(!e.outputToken)throw new Error("No output token in order");if(!e.minReturn)throw new Error("No minReturn in order");if(!e.owner)throw new Error("No owner");if(!e.module)throw new Error("No module in order");if(t){if(!(yield this.isActiveOrder(e)))throw new Error("Order not found. Please review your order data.")}return{data:this._gelatoLimitOrders.interface.encodeFunctionData("cancelOrder",[e.module,e.inputToken,e.owner,e.witness,e.data]),to:this._gelatoLimitOrders.address,value:i.constants.Zero}}))}cancelLimitOrder(e,t,r){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._signer)throw new Error("No signer");if(!this._gelatoLimitOrders)throw new Error("No gelato limit orders contract");let n=e;if(e.id)try{const t=yield Promise.race([this.getOrder(e.id),new Promise((e=>setTimeout(e,5e3))).then((()=>{throw new Error("Timeout")}))]);if(t){if("cancelled"===t.status)throw new Error(`Order status is not open. Current order status: ${t.status}. Cancellation transaction hash: ${t.cancelledTxHash}`);if("executed"===t.status)throw new Error(`Order status is not open. Current order status: ${t.status}. Execution transaction hash: ${t.executedTxHash}`);n=Object.assign(Object.assign({},e),t)}}catch(i){}if(!n.inputToken)throw new Error("No input token in order");if(!n.witness)throw new Error("No witness in order");if(!n.outputToken)throw new Error("No output token in order");if(!n.minReturn)throw new Error("No minReturn in order");if(!n.data)throw new Error("No data in order");if(!n.module)throw new Error("No module in order");if(t){if(!(yield this.isActiveOrder(n)))throw new Error("Order not found. Please review your order data.")}if((yield this._signer.getAddress()).toLowerCase()!==e.owner.toLowerCase())throw new Error("Owner and signer mismatch");return this._gelatoLimitOrders.cancelOrder(n.module,n.inputToken,n.owner,n.witness,n.data,null!==r&&void 0!==r?r:{gasLimit:(0,l.isEthereumChain)(this._chainId)?6e5:2e6})}))}approveTokenAmount(e,t,r){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._signer)throw new Error("No signer");return r?u.ERC20__factory.connect(e,this._signer).approve(this._erc20OrderRouter.address,t,r):u.ERC20__factory.connect(e,this._signer).approve(this._erc20OrderRouter.address,t)}))}isActiveOrder(e){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._provider)throw new Error("No provider");if(!this._gelatoLimitOrders)throw new Error("No gelato limit orders contract");if(!e.module)throw new Error("No module in order");if(!e.inputToken)throw new Error("No input token in order");if(!e.owner)throw new Error("No owner in order");if(!e.witness)throw new Error("No witness in order");if(!e.data)throw new Error("No data in order");return this._gelatoLimitOrders.existOrder(e.module,e.inputToken,e.owner,e.witness,e.data)}))}getExchangeRate(e,t,r,n,o=!1){const a=i.BigNumber.from(10).pow(i.BigNumber.from(18));return o?i.BigNumber.from(e).mul(a).div(r).mul(i.BigNumber.from(10).pow(i.BigNumber.from(n))).div(i.BigNumber.from(10).pow(i.BigNumber.from(t))).toString():i.BigNumber.from(r).mul(a).div(e).mul(i.BigNumber.from(10).pow(i.BigNumber.from(t))).div(i.BigNumber.from(10).pow(i.BigNumber.from(n))).toString()}getFeeAndSlippageAdjustedMinReturn(e,t){if(t&&!Number.isInteger(t))throw new Error("Extra Slippage BPS must an unsigned integer");const r=i.BigNumber.from(e).mul(this._gelatoFeeBPS).div(1e4).gte(1)?i.BigNumber.from(e).mul(this._gelatoFeeBPS).div(1e4):i.BigNumber.from(1),n=t?this._slippageBPS+t:this._slippageBPS,o=i.BigNumber.from(e).mul(n).div(1e4);return{minReturn:i.BigNumber.from(e).sub(r).sub(o).toString(),slippage:o.toString(),gelatoFee:r.toString()}}getAdjustedMinReturn(e,t){const r=i.BigNumber.from(this._gelatoFeeBPS),n=t?i.BigNumber.from(this._slippageBPS+t):i.BigNumber.from(this._slippageBPS),o=r.add(n);return i.BigNumber.from(e).mul(1e4).div(i.BigNumber.from(1e4).sub(o)).toString()}getExecutionPrice(e,t,r,n,o=!1){const a=i.BigNumber.from(10).pow(i.BigNumber.from(o?n:t));return o?i.BigNumber.from(e).mul(a).div(r).toString():i.BigNumber.from(r).mul(a).div(e).toString()}getOrder(e){return(0,n.__awaiter)(this,void 0,void 0,(function*(){const t=yield(0,c.queryOrder)(e,this._chainId);return t?Object.assign(Object.assign({},t),{adjustedMinReturn:this.getAdjustedMinReturn(t.minReturn)}):null}))}getOrders(e,t=!1){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return(yield(0,c.queryOrders)(e,this._chainId)).map((e=>Object.assign(Object.assign({},e),{adjustedMinReturn:this.getAdjustedMinReturn(e.minReturn)}))).filter((e=>this._handler&&!e.handler?!!t:!this._handler||e.handler===this._handlerAddress))}))}getOpenOrders(e,t=!1){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return(yield(0,c.queryOpenOrders)(e,this._chainId)).map((e=>Object.assign(Object.assign({},e),{adjustedMinReturn:this.getAdjustedMinReturn(e.minReturn)}))).filter((e=>this._handler&&!e.handler?!!t:!this._handler||e.handler===this._handlerAddress))}))}getPastOrders(e,t=!1){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return(yield(0,c.queryPastOrders)(e,this._chainId)).map((e=>Object.assign(Object.assign({},e),{adjustedMinReturn:this.getAdjustedMinReturn(e.minReturn)}))).filter((e=>this._handler&&!e.handler?!!t:!this._handler||e.handler===this._handlerAddress))}))}getExecutedOrders(e,t=!1){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return(yield(0,c.queryExecutedOrders)(e,this._chainId)).map((e=>Object.assign(Object.assign({},e),{adjustedMinReturn:this.getAdjustedMinReturn(e.minReturn)}))).filter((e=>this._handler&&!e.handler?!!t:!this._handler||e.handler===this._handlerAddress))}))}getCancelledOrders(e,t=!1){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return(yield(0,c.queryCancelledOrders)(e,this._chainId)).map((e=>Object.assign(Object.assign({},e),{adjustedMinReturn:this.getAdjustedMinReturn(e.minReturn)}))).filter((e=>this._handler&&!e.handler?!!t:!this._handler||e.handler===this._handlerAddress))}))}_getKey(e){return i.utils.keccak256(this._abiEncoder.encode(["address","address","address","address","bytes"],[e.module,e.inputToken,e.owner,e.witness,e.data]))}_encodeSubmitData(e,t,r,o,a,c,d,p){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._provider)throw new Error("No provider");if(e.toLowerCase()===t.toLowerCase())throw new Error("Input token and output token can not be equal");const n=this._handlerAddress?this._abiEncoder.encode(["address","uint256","address"],[t,c,this._handlerAddress]):this._abiEncoder.encode(["address","uint256"],[t,c]);let f,h,y;if((0,l.isNetworkGasToken)(e)){const e=yield this._gelatoLimitOrders.encodeEthOrder(this._moduleAddress,s.ETH_ADDRESS,r,o,n,d);f=this._gelatoLimitOrders.interface.encodeFunctionData("depositEth",[e]),h=a,y=this._gelatoLimitOrders.address}
1else{if(p){if((yield u.ERC20__factory.connect(e,this._provider).allowance(r,this._erc20OrderRouter.address)).lt(a))throw new Error("Insufficient token allowance for placing order")}f=this._erc20OrderRouter.interface.encodeFunctionData("depositToken",[a,this._moduleAddress,e,r,o,n,d]),h=i.constants.Zero,y=this._erc20OrderRouter.address}return{data:f,value:h,to:y}}))}}},50105:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GelatoBase=t.isETHOrWETH=t.isFlashbotsCompatibleChainId=t.isValidChainIdAndHandler=void 0;const n=r(70655),i=r(97420),o=r(81556),a=r(48088),s=r(89744),u=r(16060),c=r(41153);t.isValidChainIdAndHandler=(e,t)=>s.NETWORK_HANDLERS[e].includes(t);t.isFlashbotsCompatibleChainId=e=>e==s.CHAIN_ID.MAINNET||e==s.CHAIN_ID.GOERLI;t.isETHOrWETH=(e,t)=>{const r=s.NATIVE_WRAPPED_TOKEN_ADDRESS[t];return e.toLowerCase()===s.ETH_ADDRESS.toLowerCase()||e.toLowerCase()===r.toLowerCase()};t.GelatoBase=class{constructor(e,r,n,l,d){if(l&&!(0,t.isValidChainIdAndHandler)(e,l))throw new Error("Invalid chainId and handler");this._chainId=e,this._gelatoFeeBPS=(0,c.isEthereumChain)(e)?0:s.BPS_GELATO_FEE[e],this._slippageBPS=s.STOP_LIMIT_SLIPPAGE_BPS[e],this._subgraphUrl=s.SUBGRAPH_URL[e],this._signer=a.Signer.isSigner(n)?n:void 0,this._provider=o.Provider.isProvider(n)?n:a.Signer.isSigner(n)?n.provider:void 0,this._gelatoCore=this._signer?u.GelatoLimitOrders__factory.connect(s.GELATO_LIMIT_ORDERS_ADDRESS[this._chainId],this._signer):this._provider?u.GelatoLimitOrders__factory.connect(s.GELATO_LIMIT_ORDERS_ADDRESS[this._chainId],this._provider):new i.Contract(s.GELATO_LIMIT_ORDERS_ADDRESS[this._chainId],u.GelatoLimitOrders__factory.createInterface()),this._abiEncoder=new i.utils.AbiCoder,this._erc20OrderRouter=this._signer?u.ERC20OrderRouter__factory.connect(s.GELATO_LIMIT_ORDERS_ERC20_ORDER_ROUTER[this._chainId],this._signer):this._provider?u.ERC20OrderRouter__factory.connect(s.GELATO_LIMIT_ORDERS_ERC20_ORDER_ROUTER[this._chainId],this._provider):new i.Contract(s.GELATO_LIMIT_ORDERS_ERC20_ORDER_ROUTER[this._chainId],u.ERC20OrderRouter__factory.createInterface()),this._handler=l,this._handlerAddress=d,this._moduleAddress=r}get gelatoFeeBPS(){return this._gelatoFeeBPS}get slippageBPS(){return this._slippageBPS}get chainId(){return this._chainId}get signer(){return this._signer}get provider(){return this._provider}get subgraphUrl(){return this._subgraphUrl}get handler(){return this._handler}get handlerAddress(){return this._handlerAddress}get moduleAddress(){return this._moduleAddress}get contract(){return this._gelatoCore}get erc20OrderRouter(){return this._erc20OrderRouter}get abiEncoder(){return this._abiEncoder}encodeLimitOrderCancellation(e,t){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._gelatoCore)throw new Error("No gelato limit orders contract");if(!e.inputToken)throw new Error("No input token in order");if(!e.witness)throw new Error("No witness in order");if(!e.outputToken)throw new Error("No output token in order");if(!e.minReturn)throw new Error("No minReturn in order");if(!e.owner)throw new Error("No owner");if(t){if(!(yield this.isActiveOrder(e)))throw new Error("Order not found. Please review your order data.")}return{data:this._gelatoCore.interface.encodeFunctionData("cancelOrder",[this._moduleAddress,e.inputToken,e.owner,e.witness,e.data]),to:this._gelatoCore.address,value:i.constants.Zero}}))}cancelStopLimitOrder(e,t,r){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._signer)throw new Error("No signer");if(!this._gelatoCore)throw new Error("No gelato limit orders contract");if(!e.inputToken)throw new Error("No input token in order");if(!e.witness)throw new Error("No witness in order");if(!e.outputToken)throw new Error("No output token in order");if(!e.minReturn)throw new Error("No minReturn in order");if(!e.data)throw new Error("No data in order");if(t){if(!(yield this.isActiveOrder(e)))throw new Error("Order not found. Please review your order data.")}if((yield this._signer.getAddress()).toLowerCase()!==e.owner.toLowerCase())throw new Error("Owner and signer mismatch");return this._gelatoCore.cancelOrder(this._moduleAddress,e.inputToken,e.owner,e.witness,e.data,null!==r&&void 0!==r?r:{gasLimit:(0,
1c.isEthereumChain)(this._chainId)?5e5:15e5})}))}approveTokenAmount(e,t,r){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._signer)throw new Error("No signer");return r?u.ERC20__factory.connect(e,this._signer).approve(this._erc20OrderRouter.address,t,r):u.ERC20__factory.connect(e,this._signer).approve(this._erc20OrderRouter.address,t)}))}isActiveOrder(e){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this._provider)throw new Error("No provider");if(!this._gelatoCore)throw new Error("No gelato limit orders contract");if(!e.module)throw new Error("No module in order");if(!e.inputToken)throw new Error("No input token in order");if(!e.owner)throw new Error("No owner in order");if(!e.witness)throw new Error("No witness in order");if(!e.data)throw new Error("No data in order");return this._gelatoCore.existOrder(e.module,e.inputToken,e.owner,e.witness,e.data)}))}getExchangeRate(e,t,r,n,o=!1){const a=i.BigNumber.from(10).pow(i.BigNumber.from(18));return o?i.BigNumber.from(e).mul(a).div(r).mul(i.BigNumber.from(10).pow(i.BigNumber.from(n))).div(i.BigNumber.from(10).pow(i.BigNumber.from(t))).toString():i.BigNumber.from(r).mul(a).div(e).mul(i.BigNumber.from(10).pow(i.BigNumber.from(t))).div(i.BigNumber.from(10).pow(i.BigNumber.from(n))).toString()}getFeeAndSlippageAdjustedMinReturn(e,t){if(t&&!Number.isInteger(t))throw new Error("Extra Slippage BPS must an unsigned integer");const r=(0,c.isEthereumChain)(this._chainId)?0:i.BigNumber.from(e).mul(this._gelatoFeeBPS).div(1e4).gte(1)?i.BigNumber.from(e).mul(this._gelatoFeeBPS).div(1e4):i.BigNumber.from(1),n=t||this._slippageBPS,o=i.BigNumber.from(e).mul(n).div(1e4);return{minReturn:i.BigNumber.from(e).sub(r).sub(o).toString(),slippage:o.toString(),gelatoFee:r.toString()}}getAdjustedMinReturn(e,t){if((0,c.isEthereumChain)(this._chainId))throw new Error("Method not available for current chain.");const r=i.BigNumber.from(this._gelatoFeeBPS),n=t?i.BigNumber.from(t):i.BigNumber.from(this._slippageBPS),o=r.add(n);return i.BigNumber.from(e).mul(1e4).div(i.BigNumber.from(1e4).sub(o)).toString()}getExecutionPrice(e,t,r,n,o=!1){const a=i.BigNumber.from(10).pow(i.BigNumber.from(o?n:t));return o?i.BigNumber.from(e).mul(a).div(r).toString():i.BigNumber.from(r).mul(a).div(e).toString()}_getKey(e){return i.utils.keccak256(this._abiEncoder.encode(["address","address","address","address","bytes"],[e.module,e.inputToken,e.owner,e.witness,e.data]))}_encodeSubmitData(e,t,r,o,a,l,d,p,f){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this.provider)throw new Error("No provider");if(!this.handlerAddress)throw new Error("No handlerAddress");if(e.toLowerCase()===t.toLowerCase())throw new Error("Input token and output token can not be equal");const n=this.abiEncoder.encode(["address","uint256","address","uint256"],[t,d,this.handlerAddress,l]);let h,y,m;if((0,c.isNetworkGasToken)(e)){const e=yield this.contract.encodeEthOrder(this.moduleAddress,s.ETH_ADDRESS,r,o,n,p);h=this.contract.interface.encodeFunctionData("depositEth",[e]),y=a,m=this.contract.address}else{if(f){if((yield u.ERC20__factory.connect(e,this.provider).allowance(r,this.erc20OrderRouter.address)).lt(a))throw new Error("Insufficient token allowance for placing order")}h=this.erc20OrderRouter.interface.encodeFunctionData("depositToken",[a,this.moduleAddress,e,r,o,n,p]),y=i.constants.Zero,m=this.erc20OrderRouter.address}return{data:h,value:y,to:m}}))}}},45741:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GelatoStopLimitOrders=void 0;const n=r(70655),i=r(97420),o=r(89744),a=r(50105),s=r(73813);class u extends a.GelatoBase{constructor(e,t,r){var n;if(r&&!(0,a.isValidChainIdAndHandler)(e,r))throw new Error("Invalid chainId and handler");const i=o.NETWORK_STOP_LIMIT_HANDLERS[e];if(!r)throw new Error("No Handler defined");if(r&&!i.includes(r))throw new Error("Handler not supported");const s=o.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS[e];if(!s)throw new Error("Invalid chainId and handler");super(e,s,t,r,null===(n=o.HANDLERS_ADDRESSES[e][r])||void 0===n?void 0:n.toLowerCase())}submitStopLimitOrder(e,t,r,o,a=!0,s){return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!this.signer)throw new Error("No signer");if(!o)throw new Error("No StopLimit defined");const n=yield this.signer.getAddress(),u=yield this.encodeStopLimitOrderSubmission(e,t,r,o,n,a);return this.signer.sendTransaction(Object.assign(Object.assign({},s),{to:u.to,data:u.data,value:i.BigNumber.from(u.value)}))}))}encodeStopLimitOrderSubmission(e,t,r,i,o,a=!0){return(0,n.__awaiter)(this,void 0,void 0,(function*(){const{payload:n}=yield this.encodeStopLimitOrderSubmissionWithSecret(e,t,r,i,o,a);return n}))}encodeStopLimitOrderSubmissionWithSecret(e,t,r,o,a,s=!0){var u;return(0,n.__awaiter)(this,void 0,void 0,(function*(){if(!o)throw new Error("No StopLimit defined");if(!this.handlerAddress)throw new Error("No handlerAddress");const n=`0x67656c61746f6e6574776f726b${i.utils.hexlify(i.utils.randomBytes(19)).replace("0x","")}`,{privateKey:c,address:l}=new i.Wallet(n),{minReturn:d}=this.getFeeAndSlippageAdjustedMinReturn(o),p=yield this._encodeSubmitData(e,t,a,l,r,o,d,c,s),f=this.abiEncoder.encode(["address","uint256","address","uint256"],[t,d,this.handlerAddress,o]);return{payload:p,secret:c,witness:l,order:{id:this._getKey({module:this.moduleAddress,inputToken:e,owner:a,witness:l,data:f}),module:this.moduleAddress.toLowerCase(),data:f,inputToken:e.toLowerCase(),outputToken:t.toLowerCase(),owner:a.toLowerCase(),witness:l.toLowerCase(),inputAmount:r.toString(),minReturn:d.toString(),maxReturn:o.toString(),adjustedMinReturn:o.toString(),inputData:p.data.toString(),secret:c.toLowerCase(),handler:null!==(u=this.handlerAddress)&&void 0!==u?u:null}}}))}getOpenStopLimitOrders(e){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return yield(0,s.queryStopLimitOrders)(e,this.chainId)}))}getStopLimitOrders(e){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return yield(0,s.queryStopLimitOrders)(e,this.chainId)}))}getExecutedStopLimitOrders(e){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return yield(0,s.queryStopLimitExecutedOrders)(e,this.chainId)}))}getCancelledStopLimitOrders(e){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return yield(0,s.queryStopLimitCancelledOrders)(e,this.chainId)}))}getPastStopLimitOrders(e){return(0,n.__awaiter)(this,void 0,void 0,(function*(){return yield(0,s.queryPastOrders)(e,this.chainId)}))}}t.GelatoStopLimitOrders=u},82938:function(e,t){"use strict";
1Object.defineProperty(t,"__esModule",{value:!0})},41153:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEthereumChain=t.isTransactionCostDependentChain=t.isNetworkGasToken=t.queries=void 0;const n=r(70655),i=r(89744);t.queries=(0,n.__importStar)(r(39258));t.isNetworkGasToken=e=>e.toLowerCase()===i.ETH_ADDRESS.toLowerCase();t.isTransactionCostDependentChain=e=>{switch(e){case 1:case 3:case 5:case 56:case 250:case 43114:return!0;default:return!1}};t.isEthereumChain=e=>{switch(e){case 1:case 3:case 5:return!0;default:return!1}}},39258:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GET_ALL_STOP_LIMIT_ORDERS_BY_OWNER=t.GET_ALL_CANCELLED_ORDERS_BY_OWNER=t.GET_ALL_EXECUTED_ORDERS_BY_OWNER=t.GET_ALL_PAST_ORDERS_BY_OWNER=t.GET_ALL_OPEN_ORDERS_BY_OWNER=t.GET_ALL_ORDERS_BY_OWNER=t.GET_ORDER_BY_ID=void 0;const n=r(66729);t.GET_ORDER_BY_ID=n.gql` 2 query getOrdersByOwner($id: String) { 3 orders(where: { id: $id }) { 4 id 5 owner 6 inputToken 7 outputToken 8 minReturn 9 module 10 witness 11 secret 12 inputAmount 13 vault 14 bought 15 auxData 16 status 17 createdTxHash 18 executedTxHash 19 cancelledTxHash 20 blockNumber 21 createdAt 22 updatedAt 23 updatedAtBlock 24 updatedAtBlockHash 25 data 26 inputData 27 handler 28 } 29 } 30`,t.GET_ALL_ORDERS_BY_OWNER=n.gql` 31 query getOrdersByOwner($owner: String) { 32 orders( 33 first: 1000 34 orderBy: updatedAtBlock 35 orderDirection: desc 36 where: { owner: $owner } 37 ) { 38 id 39 owner 40 inputToken 41 outputToken 42 minReturn 43 module 44 witness 45 secret 46 inputAmount 47 vault 48 bought 49 auxData 50 status 51 createdTxHash 52 executedTxHash 53 cancelledTxHash 54 blockNumber 55 createdAt 56 updatedAt 57 updatedAtBlock 58 updatedAtBlockHash 59 data 60 inputData 61 handler 62 } 63 } 64`,t.GET_ALL_OPEN_ORDERS_BY_OWNER=n.gql` 65 query getOpenOrdersByOwner($owner: String) { 66 orders( 67 first: 1000 68 orderBy: updatedAtBlock 69 orderDirection: desc 70 where: { owner: $owner, status: open } 71 ) { 72 id 73 owner 74 inputToken 75 outputToken 76 minReturn 77 module 78 witness 79 secret 80 inputAmount 81 vault 82 bought 83 auxData 84 status 85 createdTxHash 86 executedTxHash 87 cancelledTxHash 88 blockNumber 89 createdAt 90 updatedAt 91 updatedAtBlock 92 updatedAtBlockHash 93 data 94 inputData 95 handler 96 } 97 } 98`,t.GET_ALL_PAST_ORDERS_BY_OWNER=n.gql` 99 query getPastOrdersByOwner($owner: String) { 100 orders( 101 first: 1000 102 orderBy: updatedAtBlock 103 orderDirection: desc 104 where: { owner: $owner, status_not: open } 105 ) { 106 id 107 owner 108 inputToken 109 outputToken 110 minReturn 111 module 112 witness 113 secret 114 inputAmount 115 vault 116 bought 117 auxData 118 status 119 createdTxHash 120 executedTxHash 121 cancelledTxHash 122 blockNumber 123 createdAt 124 updatedAt 125 updatedAtBlock 126 updatedAtBlockHash 127 data 128 inputData 129 handler 130 } 131 } 132`,t.GET_ALL_EXECUTED_ORDERS_BY_OWNER=n.gql` 133 query getExecutedOrdersByOwner($owner: String) { 134 orders( 135 first: 1000 136 orderBy: updatedAtBlock 137 orderDirection: desc 138 where: { owner: $owner, status: executed } 139 ) { 140 id 141 owner 142 inputToken 143 outputToken 144 minReturn 145 module 146 witness 147 secret 148 inputAmount 149 vault 150 bought 151 auxData 152 status 153 createdTxHash 154 executedTxHash 155 cancelledTxHash 156 blockNumber 157 createdAt 158 updatedAt 159 updatedAtBlock 160 updatedAtBlockHash 161 data 162 inputData 163 handler 164 } 165 } 166`,t.GET_ALL_CANCELLED_ORDERS_BY_OWNER=n.gql` 167 query getCancelledOrdersByOwner($owner: String) { 168 orders( 169 first: 1000 170 orderBy: updatedAtBlock 171 orderDirection: desc 172 where: { owner: $owner, status: cancelled } 173 ) { 174 id 175 owner 176 inputToken 177 outputToken 178 minReturn 179 module 180 witness 181 secret 182 inputAmount 183 vault 184 bought 185 auxData 186 status 187 createdTxHash 188 executedTxHash 189 cancelledTxHash 190 blockNumber 191 createdAt 192 updatedAt 193 updatedAtBlock
194 updatedAtBlockHash 195 data 196 inputData 197 handler 198 } 199 } 200`,t.GET_ALL_STOP_LIMIT_ORDERS_BY_OWNER=n.gql` 201 query getOrdersByOwner($owner: String, $module: String) { 202 orders( 203 first: 1000 204 orderBy: updatedAtBlock 205 orderDirection: desc 206 where: { owner: $owner, module: $module } 207 ) { 208 id 209 owner 210 inputToken 211 outputToken 212 minReturn 213 maxReturn 214 module 215 witness 216 secret 217 inputAmount 218 vault 219 bought 220 auxData 221 status 222 createdTxHash 223 executedTxHash 224 cancelledTxHash 225 blockNumber 226 createdAt 227 updatedAt 228 updatedAtBlock 229 updatedAtBlockHash 230 data 231 inputData 232 handler 233 } 234 } 235`},40615:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queryCancelledOrders=t.queryExecutedOrders=t.queryPastOrders=t.queryOpenOrders=t.queryOrders=t.queryOrder=void 0;const n=r(70655),i=r(66729),o=r(89744),a=r(39258);t.queryOrder=(e,t)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){var r;try{const n=o.OLD_SUBGRAPH_URL[t]?yield(0,i.request)(o.OLD_SUBGRAPH_URL[t],a.GET_ORDER_BY_ID,{id:e.toLowerCase()}):{orders:[]},u=o.SUBGRAPH_URL[t]?yield(0,i.request)(o.SUBGRAPH_URL[t],a.GET_ORDER_BY_ID,{id:e.toLowerCase()}):{orders:[]},c=[...n.orders,...u.orders];return null!==(r=s(c,t).pop())&&void 0!==r?r:null}catch(n){throw new Error("Could not query subgraph for all orders")}}));t.queryOrders=(e,t)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const r=o.OLD_SUBGRAPH_URL[t]?yield(0,i.request)(o.OLD_SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},n=o.SUBGRAPH_URL[t]?yield(0,i.request)(o.SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},u=[...r.orders,...n.orders];return s(u,t)}catch(r){throw new Error("Could not query subgraph for all orders")}}));t.queryOpenOrders=(e,t)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const r=o.OLD_SUBGRAPH_URL[t]?yield(0,i.request)(o.OLD_SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},n=o.SUBGRAPH_URL[t]?yield(0,i.request)(o.SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},u=[...r.orders,...n.orders];return s(u,t).filter((e=>"open"===e.status))}catch(r){throw new Error("Could not query subgraph for open orders")}}));t.queryPastOrders=(e,t)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const r=o.OLD_SUBGRAPH_URL[t]?yield(0,i.request)(o.OLD_SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},n=o.SUBGRAPH_URL[t]?yield(0,i.request)(o.SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},u=[...r.orders,...n.orders];return s(u,t).filter((e=>"open"!==e.status))}catch(r){throw new Error("Could not query subgraph for past orders")}}));t.queryExecutedOrders=(e,t)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const r=o.OLD_SUBGRAPH_URL[t]?yield(0,i.request)(o.OLD_SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},n=o.SUBGRAPH_URL[t]?yield(0,i.request)(o.SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},u=[...r.orders,...n.orders];return s(u,t).filter((e=>"executed"===e.status))}catch(r){throw new Error("Could not query subgraph for executed orders")}}));t.queryCancelledOrders=(e,t)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const r=o.OLD_SUBGRAPH_URL[t]?yield(0,i.request)(o.OLD_SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},n=o.SUBGRAPH_URL[t]?yield(0,i.request)(o.SUBGRAPH_URL[t],a.GET_ALL_ORDERS_BY_OWNER,{owner:e.toLowerCase()}):{orders:[]},u=[...r.orders,...n.orders];return s(u,t).filter((e=>"cancelled"===e.status))}catch(r){throw new Error("Could not query subgraph for cancelled orders")}}));const s=(e,t)=>[...new Map(e.map((e=>[e.id,e]))).values()].sort(((e,t)=>parseFloat(e.updatedAt)-parseFloat(t.updatedAt))).filter((e=>e.module!==(e=>o.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS[e].toLowerCase())(t))).map((e=>{const t=Date.now()>1e3*(parseInt(e.createdAt)+o.MAX_LIFETIME_IN_SECONDS);return Object.assign(Object.assign({},e),{isExpired:t})}))},73813:function(e,t,r){"use strict";
235Object.defineProperty(t,"__esModule",{value:!0}),t._getUniqueOrdersWithExpiry=t.queryPastOrders=t.queryStopLimitCancelledOrders=t.queryStopLimitExecutedOrders=t.queryOpenStopLimitOrders=t.queryStopLimitOrders=void 0;const n=r(70655),i=r(66729),o=r(89744),a=r(39258);t.queryStopLimitOrders=(e,r)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const n=(o.SUBGRAPH_URL[r]?yield(0,i.request)(o.SUBGRAPH_URL[r],a.GET_ALL_STOP_LIMIT_ORDERS_BY_OWNER,{owner:e.toLowerCase(),module:o.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS[r].toLowerCase()}):{orders:[]}).orders;return(0,t._getUniqueOrdersWithExpiry)(n)}catch(n){throw console.error(n),new Error("Could not query subgraph for all orders")}}));t.queryOpenStopLimitOrders=(e,r)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const n=(o.SUBGRAPH_URL[r]?yield(0,i.request)(o.SUBGRAPH_URL[r],a.GET_ALL_STOP_LIMIT_ORDERS_BY_OWNER,{owner:e.toLowerCase(),module:o.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS[r].toLowerCase()}):{orders:[]}).orders;return(0,t._getUniqueOrdersWithExpiry)(n).filter((e=>"open"===e.status))}catch(n){throw new Error("Could not query subgraph for open orders")}}));t.queryStopLimitExecutedOrders=(e,r)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const n=(o.SUBGRAPH_URL[r]?yield(0,i.request)(o.SUBGRAPH_URL[r],a.GET_ALL_STOP_LIMIT_ORDERS_BY_OWNER,{owner:e.toLowerCase(),module:o.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS[r].toLowerCase()}):{orders:[]}).orders;return(0,t._getUniqueOrdersWithExpiry)(n).filter((e=>"executed"===e.status))}catch(n){throw new Error("Could not query subgraph for executed orders")}}));t.queryStopLimitCancelledOrders=(e,r)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const n=(o.SUBGRAPH_URL[r]?yield(0,i.request)(o.SUBGRAPH_URL[r],a.GET_ALL_STOP_LIMIT_ORDERS_BY_OWNER,{owner:e.toLowerCase(),module:o.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS[r].toLowerCase()}):{orders:[]}).orders;return(0,t._getUniqueOrdersWithExpiry)(n).filter((e=>"cancelled"===e.status))}catch(n){throw new Error("Could not query subgraph for cancelled orders")}}));t.queryPastOrders=(e,r)=>(0,n.__awaiter)(void 0,void 0,void 0,(function*(){try{const n=(o.SUBGRAPH_URL[r]?yield(0,i.request)(o.SUBGRAPH_URL[r],a.GET_ALL_STOP_LIMIT_ORDERS_BY_OWNER,{owner:e.toLowerCase(),module:o.GELATO_STOP_LIMIT_ORDERS_MODULE_ADDRESS[r].toLowerCase()}):{orders:[]}).orders;return(0,t._getUniqueOrdersWithExpiry)(n).filter((e=>"open"!==e.status))}catch(n){throw new Error("Could not query subgraph for past orders")}}));t._getUniqueOrdersWithExpiry=e=>[...new Map(e.map((e=>[e.id,e]))).values()].sort(((e,t)=>parseFloat(e.updatedAt)-parseFloat(t.updatedAt))).map((e=>{const t=Date.now()>1e3*(parseInt(e.createdAt)+o.MAX_LIFETIME_IN_SECONDS);return Object.assign(Object.assign({},e),{isExpired:t})}))},29152:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(34823),o=n(r(6230)),a=function(e){return i.isExtractableFile(e)||null!==e&&"object"===typeof e&&"function"===typeof e.pipe};t.default=function(e,t,r){var n=i.extractFiles({query:e,variables:t,operationName:r},"",a),s=n.clone,u=n.files;if(0===u.size){if(!Array.isArray(e))return JSON.stringify(s);if("undefined"!==typeof t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var c=e.reduce((function(e,r,n){return e.push({query:r,variables:t?t[n]:void 0}),e}),[]);return JSON.stringify(c)}var l=new("undefined"===typeof FormData?o.default:FormData);l.append("operations",JSON.stringify(s));var d={},p=0;return u.forEach((function(e){d[++p]=e})),l.append("map",JSON.stringify(d)),p=0,u.forEach((function(e,t){l.append(""+ ++p,t)})),l}},66729:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}
235),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},c=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.gql=t.batchRequests=t.request=t.rawRequest=t.GraphQLClient=t.ClientError=void 0;var d=a(r(54098)),p=d,f=r(91625),h=l(r(29152)),y=r(66321);Object.defineProperty(t,"ClientError",{enumerable:!0,get:function(){return y.ClientError}});var m=function(e){var t={};return e&&("undefined"!==typeof Headers&&e instanceof Headers||e instanceof p.Headers?t=function(e){var t={};return e.forEach((function(e,r){t[r]=e})),t}(e):Array.isArray(e)?e.forEach((function(e){var r=e[0],n=e[1];t[r]=n})):t=e),t},g=function(e){return e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},_=function(e){var t=e.url,r=e.query,i=e.variables,o=e.operationName,a=e.headers,c=e.fetch,l=e.fetchOptions;return s(void 0,void 0,void 0,(function(){var e;return u(this,(function(s){switch(s.label){case 0:return e=h.default(r,i,o),[4,c(t,n({method:"POST",headers:n(n({},"string"===typeof e?{"Content-Type":"application/json"}:{}),a),body:e},l))];case 1:return[2,s.sent()]}}))}))},b=function(e){var t=e.url,r=e.query,i=e.variables,o=e.operationName,a=e.headers,c=e.fetch,l=e.fetchOptions;return s(void 0,void 0,void 0,(function(){var e;return u(this,(function(s){switch(s.label){case 0:return e=function(e){var t=e.query,r=e.variables,n=e.operationName;if(!Array.isArray(t)){var i=["query="+encodeURIComponent(g(t))];return r&&i.push("variables="+encodeURIComponent(JSON.stringify(r))),n&&i.push("operationName="+encodeURIComponent(n)),i.join("&")}if("undefined"!==typeof r&&!Array.isArray(r))throw new Error("Cannot create query with given variable type, array expected");var o=t.reduce((function(e,t,n){return e.push({query:g(t),variables:r?JSON.stringify(r[n]):void 0}),e}),[]);return"query="+encodeURIComponent(JSON.stringify(o))}({query:r,variables:i,operationName:o}),[4,c(t+"?"+e,n({method:"GET",headers:a},l))];case 1:return[2,s.sent()]}}))}))},v=function(){function e(e,t){this.url=e,this.options=t||{}}return e.prototype.rawRequest=function(e,t,r){var i=this.options,o=i.headers,a=i.fetch,s=void 0===a?d.default:a,u=i.method,l=void 0===u?"POST":u,p=c(i,["headers","fetch","method"]);return w({url:this.url,query:e,variables:t,headers:n(n({},m(o)),m(r)),operationName:void 0,fetch:s,method:l,fetchOptions:p})},e.prototype.request=function(e,t,r){return s(this,void 0,void 0,(function(){var i,o,a,s,l,p,f,h,y,g,_;return u(this,(function(u){switch(u.label){case 0:return i=this.options,o=i.headers,a=i.fetch,s=void 0===a?d.default:a,l=i.method,p=void 0===l?"POST":l,f=c(i,["headers","fetch","method"]),h=this.url,y=A(e),g=y.query,_=y.operationName,[4,w({url:h,query:g,variables:t,headers:n(n({},m(o)),m(r)),operationName:_,fetch:s,method:p,fetchOptions:f})];case 1:return[2,u.sent().data]}}))}))},e.prototype.batchRequests=function(e,t){return s(this,void 0,void 0,(function(){var r,i,o,a,s,l,p,f,h,y;return u(this,(function(u){switch(u.label){case 0:return r=this.options,i=r.headers,o=r.fetch,a=void 0===o?d.default:o,s=r.method,l=void 0===s?"POST":s,p=c(r,["headers","fetch","method"]),f=this.url,h=e.map((function(e){return A(e.document).query})),y=e.map((function(e){return e.variables})),[4,w({url:f,query:h,variables:y,headers:n(n({},m(i)),m(t)),operationName:void 0,fetch:a,method:l,fetchOptions:p})];case 1:return[2,u.sent().data]}}))}))},e.prototype.setHeaders=function(e){return this.options.headers=e,this},e.prototype.setHeader=function(e,t){var r,n=this.options.headers;return n?n[e]=t:this.options.headers=((r={})[e]=t,r),this},e.prototype.setEndpoint=function(e){return this.url=e,this},e}();function w(e){var t=e.url,r=e.query,i=e.variables,o=e.headers,a=e.operationName,c=e.fetch,l=e.method,d=void 0===l?"POST":l,p=e.fetchOptions;return s(this,void 0,void 0,(function(){var e,s,l,f,h,m,g,v;return u(this,(function(u){switch(u.label){case 0:return e="POST"===d.toUpperCase()?_:b,s=Array.isArray(r),[4,e({url:t,query:r,variables:i,operationName:a,headers:o,fetch:c,fetchOptions:p})];case 1:return[4,S(l=u.sent())];case 2:if(f=u.sent(),h=s&&Array.isArray(f)?!f.some((function(e){return!e.data})):!!f.data,l.ok&&!f.errors&&h)return m=l.headers,g=l.status,[2,n(n({},s?{data:f}:f),{headers:m,status:g})];throw v="string"===typeof f?{error:f}:f,new y.ClientError(n(n({},v),{status:l.status,headers:l.headers}),{query:r,variables:i})}}))}))}function E(e,t,r,n){return s(this,void 0,void 0,(function(){return u(this,(function(i){return[2,new v(e).request(t,r,n)]}))}))}function S(e){var t=e.headers.get("Content-Type");return t&&t.startsWith("application/json")?e.json():e.text()}function A(e){var t;if("string"===typeof e)return{query:e};var r=void 0,n=e.definitions.filter((function(e){return"OperationDefinition"===e.kind}));return 1===n.length&&(r=null===(t=n[0].name)||void 0===t?void 0:t.value),{query:f.print(e),operationName:r}}t.GraphQLClient=v,t.rawRequest=function(e,t,r,n){return s(this,void 0,void 0,(function(){return u(this,(function(i){return[2,new v(e).rawRequest(t,r,n)]}))}))},t.request=E,t.batchRequests=function(e,t,r){return s(this,void 0,void 0,(function(){return u(this,(function(n){return[2,new v(e).batchRequests(t,r)]}))}))},t.default=E,t.gql=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return e.reduce((function(e,r,n){return""+e+r+(n in t?t[n]:"")}),"")}},66321:function(e,t){"use strict";var r=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();
235Object.defineProperty(t,"__esModule",{value:!0}),t.ClientError=void 0;var n=function(e){function t(r,n){var i=this,o=t.extractMessage(r)+": "+JSON.stringify({response:r,request:n});return i=e.call(this,o)||this,Object.setPrototypeOf(i,t.prototype),i.response=r,i.request=n,"function"===typeof Error.captureStackTrace&&Error.captureStackTrace(i,t),i}return r(t,e),t.extractMessage=function(e){try{return e.errors[0].message}catch(t){return"GraphQL Error (Code: "+e.status+")"}},t}(Error);t.ClientError=n},52945:function(e,t,r){e.exports={default:r(88077),__esModule:!0}},85861:function(e,t,r){e.exports={default:r(98339),__esModule:!0}},32242:function(e,t,r){e.exports={default:r(44003),__esModule:!0}},85105:function(e,t,r){e.exports={default:r(15175),__esModule:!0}},85345:function(e,t,r){e.exports={default:r(92912),__esModule:!0}},93516:function(e,t,r){e.exports={default:r(99583),__esModule:!0}},64275:function(e,t,r){e.exports={default:r(3276),__esModule:!0}},99663:function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},22600:function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(32242),o=(n=i)&&n.__esModule?n:{default:n};t.default=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,o.default)(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}()},88239:function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(52945),o=(n=i)&&n.__esModule?n:{default:n};t.default=o.default||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}},93196:function(e,t,r){"use strict";t.__esModule=!0;var n=a(r(85345)),i=a(r(85861)),o=a(r(72444));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"===typeof t?"undefined":(0,o.default)(t)));e.prototype=(0,i.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(n.default?(0,n.default)(e,t):e.__proto__=t)}},49135:function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(72444),o=(n=i)&&n.__esModule?n:{default:n};t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"===typeof t?"undefined":(0,o.default)(t))&&"function"!==typeof t?e:t}},72444:function(e,t,r){"use strict";t.__esModule=!0;var n=a(r(64275)),i=a(r(93516)),o="function"===typeof i.default&&"symbol"===typeof n.default?function(e){return typeof e}:function(e){return e&&"function"===typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"===typeof i.default&&"symbol"===o(n.default)?function(e){return"undefined"===typeof e?"undefined":o(e)}:function(e){return e&&"function"===typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":"undefined"===typeof e?"undefined":o(e)}},88077:function(e,t,r){r(80529),e.exports=r(94731).Object.assign},98339:function(e,t,r){r(96924);var n=r(94731).Object;e.exports=function(e,t){return n.create(e,t)}},44003:function(e,t,r){r(1001);var n=r(94731).Object;e.exports=function(e,t,r){return n.defineProperty(e,t,r)}},15175:function(e,t,r){r(71500),e.exports=r(94731).Object.getPrototypeOf},92912:function(e,t,r){r(70845),e.exports=r(94731).Object.setPrototypeOf},99583:function(e,t,r){r(83835),r(6519),r(54427),r(19089),e.exports=r(94731).Symbol},3276:function(e,t,r){r(83036),r(46740),e.exports=r(27613).f("iterator")},71449:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},65345:function(e){e.exports=function(){}},26504:function(e,t,r){var n=r(89151);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},44389:function(e,t,r){var n=r(64874),i=r(68317),o=r(9838);e.exports=function(e){return function(t,r,a){var s,u=n(t),c=i(u.length),l=o(a,c);if(e&&r!=r){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===r)return e||l||0;return!e&&-1}}},84499:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},94731:function(e){var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},11821:function(e,t,r){var n=r(71449);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},11605:function(e){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},95810:function(e,t,r){e.exports=!r(93777)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},72571:function(e,t,r){var n=r(89151),i=r(99362).document,o=n(i)&&n(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},35568:function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleStr
235ing,toString,valueOf".split(",")},52052:function(e,t,r){var n=r(99656),i=r(32614),o=r(43416);e.exports=function(e){var t=n(e),r=i.f;if(r)for(var a,s=r(e),u=o.f,c=0;s.length>c;)u.call(e,a=s[c++])&&t.push(a);return t}},49901:function(e,t,r){var n=r(99362),i=r(94731),o=r(11821),a=r(96519),s=r(3571),u=function(e,t,r){var c,l,d,p=e&u.F,f=e&u.G,h=e&u.S,y=e&u.P,m=e&u.B,g=e&u.W,_=f?i:i[t]||(i[t]={}),b=_.prototype,v=f?n:h?n[t]:(n[t]||{}).prototype;for(c in f&&(r=t),r)(l=!p&&v&&void 0!==v[c])&&s(_,c)||(d=l?v[c]:r[c],_[c]=f&&"function"!=typeof v[c]?r[c]:m&&l?o(d,n):g&&v[c]==d?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):y&&"function"==typeof d?o(Function.call,d):d,y&&((_.virtual||(_.virtual={}))[c]=d,e&u.R&&b&&!b[c]&&a(b,c,d)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},93777:function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},99362:function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},3571:function(e){var t={}.hasOwnProperty;e.exports=function(e,r){return t.call(e,r)}},96519:function(e,t,r){var n=r(21738),i=r(38051);e.exports=r(95810)?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},10203:function(e,t,r){var n=r(99362).document;e.exports=n&&n.documentElement},93254:function(e,t,r){e.exports=!r(95810)&&!r(93777)((function(){return 7!=Object.defineProperty(r(72571)("div"),"a",{get:function(){return 7}}).a}))},72312:function(e,t,r){var n=r(84499);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},2397:function(e,t,r){var n=r(84499);e.exports=Array.isArray||function(e){return"Array"==n(e)}},89151:function(e){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},69163:function(e,t,r){"use strict";var n=r(34055),i=r(38051),o=r(10420),a={};r(96519)(a,r(25346)("iterator"),(function(){return this})),e.exports=function(e,t,r){e.prototype=n(a,{next:i(1,r)}),o(e,t+" Iterator")}},54346:function(e,t,r){"use strict";var n=r(57346),i=r(49901),o=r(11865),a=r(96519),s=r(33135),u=r(69163),c=r(10420),l=r(91146),d=r(25346)("iterator"),p=!([].keys&&"next"in[].keys()),f="keys",h="values",y=function(){return this};e.exports=function(e,t,r,m,g,_,b){u(r,t,m);var v,w,E,S=function(e){if(!p&&e in R)return R[e];switch(e){case f:case h:return function(){return new r(this,e)}}return function(){return new r(this,e)}},A=t+" Iterator",T=g==h,O=!1,R=e.prototype,C=R[d]||R["@@iterator"]||g&&R[g],I=C||S(g),D=g?T?S("entries"):I:void 0,N="Array"==t&&R.entries||C;if(N&&(E=l(N.call(new e)))!==Object.prototype&&E.next&&(c(E,A,!0),n||"function"==typeof E[d]||a(E,d,y)),T&&C&&C.name!==h&&(O=!0,I=function(){return C.call(this)}),n&&!b||!p&&!O&&R[d]||a(R,d,I),s[t]=I,s[A]=y,g)if(v={values:T?I:S(h),keys:_?I:S(f),entries:D},b)for(w in v)w in R||o(R,w,v[w]);else i(i.P+i.F*(p||O),t,v);return v}},13166:function(e){e.exports=function(e,t){return{value:t,done:!!e}}},33135:function(e){e.exports={}},57346:function(e){e.exports=!0},55965:function(e,t,r){var n=r(3535)("meta"),i=r(89151),o=r(3571),a=r(21738).f,s=0,u=Object.isExtensible||function(){return!0},c=!r(93777)((function(){return u(Object.preventExtensions({}))})),l=function(e){a(e,n,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:n,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,n)){if(!u(e))return"F";if(!t)return"E";l(e)}return e[n].i},getWeak:function(e,t){if(!o(e,n)){if(!u(e))return!0;if(!t)return!1;l(e)}return e[n].w},onFreeze:function(e){return c&&d.NEED&&u(e)&&!o(e,n)&&l(e),e}}},50266:function(e,t,r){"use strict";var n=r(95810),i=r(99656),o=r(32614),a=r(43416),s=r(19411),u=r(72312),c=Object.assign;e.exports=!c||r(93777)((function(){var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!=c({},e)[r]||Object.keys(c({},t)).join("")!=n}))?function(e,t){for(var r=s(e),c=arguments.length,l=1,d=o.f,p=a.f;c>l;)for(var f,h=u(arguments[l++]),y=d?i(h).concat(d(h)):i(h),m=y.length,g=0;m>g;)f=y[g++],n&&!p.call(h,f)||(r[f]=h[f]);return r}:c},34055:function(e,t,r){var n=r(26504),i=r(20121),o=r(35568),a=r(46210)("IE_PROTO"),s=function(){},u=function(){var e,t=r(72571)("iframe"),n=o.length;for(t.style.display="none",r(10203).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),u=e.F;n--;)delete u.prototype[o[n]];return u()};e.exports=Object.create||function(e,t){var r;return null!==e?(s.prototype=n(e),r=new s,s.prototype=null,r[a]=e):r=u(),void 0===t?r:i(r,t)}},21738:function(e,t,r){var n=r(26504),i=r(93254),o=r(25408),a=Object.defineProperty;t.f=r(95810)?Object.defineProperty:function(e,t,r){if(n(e),t=o(t,!0),n(r),i)try{return a(e,t,r)}catch(s){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},20121:function(e,t,r){var n=r(21738),i=r(26504),o=r(99656);e.exports=r(95810)?Object.defineProperties:function(e,t){i(e);for(var r,a=o(t),s=a.length,u=0;s>u;)n.f(e,r=a[u++],t[r]);return e}}
vendor: 4,409 bytes, line 235
235,18437:function(e,t,r){var n=r(43416),i=r(38051),o=r(64874),a=r(25408),s=r(3571),u=r(93254),c=Object.getOwnPropertyDescriptor;t.f=r(95810)?c:function(e,t){if(e=o(e),t=a(t,!0),u)try{return c(e,t)}catch(r){}if(s(e,t))return i(!n.f.call(e,t),e[t])}},42029:function(e,t,r){var n=r(64874),i=r(51471).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(t){return a.slice()}}(e):i(n(e))}},51471:function(e,t,r){var n=r(36152),i=r(35568).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},32614:function(e,t){t.f=Object.getOwnPropertySymbols},91146:function(e,t,r){var n=r(3571),i=r(19411),o=r(46210)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},36152:function(e,t,r){var n=r(3571),i=r(64874),o=r(44389)(!1),a=r(46210)("IE_PROTO");e.exports=function(e,t){var r,s=i(e),u=0,c=[];for(r in s)r!=a&&n(s,r)&&c.push(r);for(;t.length>u;)n(s,r=t[u++])&&(~o(c,r)||c.push(r));return c}},99656:function(e,t,r){var n=r(36152),i=r(35568);e.exports=Object.keys||function(e){return n(e,i)}},43416:function(e,t){t.f={}.propertyIsEnumerable},44903:function(e,t,r){var n=r(49901),i=r(94731),o=r(93777);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],a={};a[e]=t(r),n(n.S+n.F*o((function(){r(1)})),"Object",a)}},38051:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},11865:function(e,t,r){e.exports=r(96519)},29300:function(e,t,r){var n=r(89151),i=r(26504),o=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=r(11821)(Function.call,r(18437).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(i){t=!0}return function(e,r){return o(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:o}},10420:function(e,t,r){var n=r(21738).f,i=r(3571),o=r(25346)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},46210:function(e,t,r){var n=r(77571)("keys"),i=r(3535);e.exports=function(e){return n[e]||(n[e]=i(e))}},77571:function(e,t,r){var n=r(94731),i=r(99362),o="__core-js_shared__",a=i[o]||(i[o]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(57346)?"pure":"global",copyright:"\xa9 2020 Denis Pushkarev (zloirock.ru)"})},2222:function(e,t,r){var n=r(41485),i=r(11605);e.exports=function(e){return function(t,r){var o,a,s=String(i(t)),u=n(r),c=s.length;return u<0||u>=c?e?"":void 0:(o=s.charCodeAt(u))<55296||o>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):o:e?s.slice(u,u+2):a-56320+(o-55296<<10)+65536}}},9838:function(e,t,r){var n=r(41485),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=n(e))<0?i(e+t,0):o(e,t)}},41485:function(e){var t=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:t)(e)}},64874:function(e,t,r){var n=r(72312),i=r(11605);e.exports=function(e){return n(i(e))}},68317:function(e,t,r){var n=r(41485),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},19411:function(e,t,r){var n=r(11605);e.exports=function(e){return Object(n(e))}},25408:function(e,t,r){var n=r(89151);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},3535:function(e){var t=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+r).toString(36))}},21875:function(e,t,r){var n=r(99362),i=r(94731),o=r(57346),a=r(27613),s=r(21738).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},27613:function(e,t,r){t.f=r(25346)},25346:function(e,t,r){var n=r(77571)("wks"),i=r(3535),o=r(99362).Symbol,a="function"==typeof o;(e.exports=function(e){return n[e]||(n[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=n},61092:function(e,t,r){"use strict";
vendor: 6,303 bytes, line 235
235var n=r(65345),i=r(13166),o=r(33135),a=r(64874);e.exports=r(54346)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?r:"values"==t?e[r]:[r,e[r]])}),"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},80529:function(e,t,r){var n=r(49901);n(n.S+n.F,"Object",{assign:r(50266)})},96924:function(e,t,r){var n=r(49901);n(n.S,"Object",{create:r(34055)})},1001:function(e,t,r){var n=r(49901);n(n.S+n.F*!r(95810),"Object",{defineProperty:r(21738).f})},71500:function(e,t,r){var n=r(19411),i=r(91146);r(44903)("getPrototypeOf",(function(){return function(e){return i(n(e))}}))},70845:function(e,t,r){var n=r(49901);n(n.S,"Object",{setPrototypeOf:r(29300).set})},6519:function(){},83036:function(e,t,r){"use strict";var n=r(2222)(!0);r(54346)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})}))},83835:function(e,t,r){"use strict";var n=r(99362),i=r(3571),o=r(95810),a=r(49901),s=r(11865),u=r(55965).KEY,c=r(93777),l=r(77571),d=r(10420),p=r(3535),f=r(25346),h=r(27613),y=r(21875),m=r(52052),g=r(2397),_=r(26504),b=r(89151),v=r(19411),w=r(64874),E=r(25408),S=r(38051),A=r(34055),T=r(42029),O=r(18437),R=r(32614),C=r(21738),I=r(99656),D=O.f,N=C.f,k=T.f,P=n.Symbol,L=n.JSON,x=L&&L.stringify,B=f("_hidden"),M=f("toPrimitive"),G={}.propertyIsEnumerable,H=l("symbol-registry"),F=l("symbols"),j=l("op-symbols"),U=Object.prototype,q="function"==typeof P&&!!R.f,W=n.QObject,K=!W||!W.prototype||!W.prototype.findChild,V=o&&c((function(){return 7!=A(N({},"a",{get:function(){return N(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=D(U,t);n&&delete U[t],N(e,t,r),n&&e!==U&&N(U,t,n)}:N,Y=function(e){var t=F[e]=A(P.prototype);return t._k=e,t},z=q&&"symbol"==typeof P.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof P},J=function(e,t,r){return e===U&&J(j,t,r),_(e),t=E(t,!0),_(r),i(F,t)?(r.enumerable?(i(e,B)&&e[B][t]&&(e[B][t]=!1),r=A(r,{enumerable:S(0,!1)})):(i(e,B)||N(e,B,S(1,{})),e[B][t]=!0),V(e,t,r)):N(e,t,r)},$=function(e,t){_(e);for(var r,n=m(t=w(t)),i=0,o=n.length;o>i;)J(e,r=n[i++],t[r]);return e},X=function(e){var t=G.call(this,e=E(e,!0));return!(this===U&&i(F,e)&&!i(j,e))&&(!(t||!i(this,e)||!i(F,e)||i(this,B)&&this[B][e])||t)},Z=function(e,t){if(e=w(e),t=E(t,!0),e!==U||!i(F,t)||i(j,t)){var r=D(e,t);return!r||!i(F,t)||i(e,B)&&e[B][t]||(r.enumerable=!0),r}},Q=function(e){for(var t,r=k(w(e)),n=[],o=0;r.length>o;)i(F,t=r[o++])||t==B||t==u||n.push(t);return n},ee=function(e){for(var t,r=e===U,n=k(r?j:w(e)),o=[],a=0;n.length>a;)!i(F,t=n[a++])||r&&!i(U,t)||o.push(F[t]);return o};q||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var e=p(arguments.length>0?arguments[0]:void 0),t=function(r){this===U&&t.call(j,r),i(this,B)&&i(this[B],e)&&(this[B][e]=!1),V(this,e,S(1,r))};return o&&K&&V(U,e,{configurable:!0,set:t}),Y(e)},s(P.prototype,"toString",(function(){return this._k})),O.f=Z,C.f=J,r(51471).f=T.f=Q,r(43416).f=X,R.f=ee,o&&!r(57346)&&s(U,"propertyIsEnumerable",X,!0),h.f=function(e){return Y(f(e))}),a(a.G+a.W+a.F*!q,{Symbol:P});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;te.length>re;)f(te[re++]);for(var ne=I(f.store),ie=0;ne.length>ie;)y(ne[ie++]);a(a.S+a.F*!q,"Symbol",{for:function(e){return i(H,e+="")?H[e]:H[e]=P(e)},keyFor:function(e){if(!z(e))throw TypeError(e+" is not a symbol!");for(var t in H)if(H[t]===e)return t},useSetter:function(){K=!0},useSimple:function(){K=!1}}),a(a.S+a.F*!q,"Object",{create:function(e,t){return void 0===t?A(e):$(A(e),t)},defineProperty:J,defineProperties:$,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:ee});var oe=c((function(){R.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return R.f(v(e))}}),L&&a(a.S+a.F*(!q||c((function(){var e=P();return"[null]"!=x([e])||"{}"!=x({a:e})||"{}"!=x(Object(e))}))),"JSON",{stringify:function(e){for(var t,r,n=[e],i=1;arguments.length>i;)n.push(arguments[i++]);if(r=t=n[1],(b(t)||void 0!==e)&&!z(e))return g(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!z(t))return t}),n[1]=t,x.apply(L,n)}}),P.prototype[M]||r(96519)(P.prototype,M,P.prototype.valueOf),d(P,"Symbol"),d(Math,"Math",!0),d(n.JSON,"JSON",!0)},54427:function(e,t,r){r(21875)("asyncIterator")},19089:function(e,t,r){r(21875)("observable")},46740:function(e,t,r){r(61092);for(var n=r(99362),i=r(96519),o=r(33135),a=r(25346)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u<s.length;u++){var c=s[u],l=n[c],d=l&&l.prototype;d&&!d[a]&&i(d,a,c),o[c]=o.Array}},97420:function(e,t,r){"use strict";r.r(t),r.d(t,{BaseContract:function(){return u.BaseContract},BigNumber:function(){return c.O$},Contract:function(){return u.Contract},ContractFactory:function(){return u.ContractFactory},FixedNumber:function(){return l.xs},Signer:function(){return d.Signer},VoidSigner:function(){return d.VoidSigner},Wallet:function(){return Ce},Wordlist:function(){return I},constants:function(){return n},errors:function(){return R.jK},ethers:function(){return s},getDefaultProvider:function(){return Wt},logger:function(){return ir},providers:function(){return i},utils:function(){return a},version:function(){return nr},wordlists:function(){return P}});var n={};r.r(n),r.d(n,{AddressZero:function(){return Ne.d},EtherSymbol:function(){return Le},HashZero:function(){return Pe.R},MaxInt256:function(){return ke.PS},MaxUint256:function(){return ke.Bz},MinInt256:function(){return ke.$B},NegativeOne:function(){return ke.tL},One:function(){return ke.fh},Two:function(){return ke.Py},WeiPerEther:function(){return ke.Ce},Zero:function(){return ke._Y}});var i={};
235r.r(i),r.d(i,{AlchemyProvider:function(){return Ze},AlchemyWebSocketProvider:function(){return Xe},BaseProvider:function(){return Be.Zk},CloudflareProvider:function(){return tt},EtherscanProvider:function(){return dt},FallbackProvider:function(){return Rt},Formatter:function(){return Me.Mb},InfuraProvider:function(){return kt},InfuraWebSocketProvider:function(){return Nt},IpcProvider:function(){return Ct},JsonRpcBatchProvider:function(){return Pt},JsonRpcProvider:function(){return Ge.r},JsonRpcSigner:function(){return Ge.C},NodesmithProvider:function(){return xt},PocketProvider:function(){return Gt},Provider:function(){return f.Provider},Resolver:function(){return Be.H2},StaticJsonRpcProvider:function(){return Ye},UrlJsonRpcProvider:function(){return ze},Web3Provider:function(){return Ut},WebSocketProvider:function(){return We},getDefaultProvider:function(){return Wt},getNetwork:function(){return xe.getNetwork},isCommunityResourcable:function(){return Me.Ed},isCommunityResource:function(){return Me.Gp},showThrottleMessage:function(){return Me.vh}});var o={};r.r(o),r.d(o,{decode:function(){return Jt},encode:function(){return $t}});var a={};r.r(a),r.d(a,{AbiCoder:function(){return Kt.R},ConstructorFragment:function(){return Vt.Xg},ErrorFragment:function(){return Vt.IC},EventFragment:function(){return Vt.QV},FormatTypes:function(){return Vt.pc},Fragment:function(){return Vt.HY},FunctionFragment:function(){return Vt.YW},HDNode:function(){return W},Indexed:function(){return zt.Hk},Interface:function(){return zt.vU},LogDescription:function(){return zt.CC},Logger:function(){return R.Yd},ParamType:function(){return Vt._R},RLP:function(){return Qt},SigningKey:function(){return S.Et},SupportedAlgorithm:function(){return A.p},TransactionDescription:function(){return zt.vk},TransactionTypes:function(){return T.em},UnicodeNormalizationForm:function(){return m.Uj},Utf8ErrorFuncs:function(){return m.te},Utf8ErrorReason:function(){return m.Uw},_TypedDataEncoder:function(){return _.E},_fetchData:function(){return rt.MY},_toEscapedUtf8String:function(){return m.U$},accessListify:function(){return T.z7},arrayify:function(){return h.lE},base58:function(){return b.eU},base64:function(){return o},checkProperties:function(){return E.uj},checkResultErrors:function(){return Yt.BR},commify:function(){return rr.Fn},computeAddress:function(){return T.db},computeHmac:function(){return v.Gy},computePublicKey:function(){return S.VW},concat:function(){return h.zo},deepCopy:function(){return E.p$},defaultAbiCoder:function(){return Kt.$},defaultPath:function(){return q},defineReadOnly:function(){return E.zG},entropyToMnemonic:function(){return Y},fetchJson:function(){return rt.rd},formatBytes32String:function(){return tr.s},formatEther:function(){return rr.dF},formatUnits:function(){return rr.bM},getAccountPath:function(){return J},getAddress:function(){return p.getAddress},getContractAddress:function(){return p.getContractAddress},getCreate2Address:function(){return p.getCreate2Address},getIcapAddress:function(){return p.getIcapAddress},getJsonWalletAddress:function(){return fe},getStatic:function(){return E.tu},hashMessage:function(){return g},hexConcat:function(){return h.xs},hexDataLength:function(){return h.E1},hexDataSlice:function(){return h.p3},hexStripZeros:function(){return h.Ou},hexValue:function(){return h.$P},hexZeroPad:function(){return h.$m},hexlify:function(){return h.Dv},id:function(){return O.id},isAddress:function(){return p.isAddress},isBytes:function(){return h._t},isBytesLike:function(){return h.Zq},isHexString:function(){return h.A7},isValidMnemonic:function(){return z},isValidName:function(){return Xt.r},joinSignature:function(){return h.gV},keccak256:function(){return y.w},mnemonicToEntropy:function(){return V},mnemonicToSeed:function(){return K},namehash:function(){return Xt.V},nameprep:function(){return er.Ll},parseBytes32String:function(){return tr.F},parseEther:function(){return rr.fi},parseTransaction:function(){return T.Qc},parseUnits:function(){return rr.vz},poll:function(){return rt.$l},randomBytes:function(){return Q},recoverAddress:function(){return T.RJ},recoverPublicKey:function(){return S.LO},resolveProperties:function(){return E.mE},ripemd160:function(){return v.bP},serializeTransaction:function(){return T.qC},sha256:function(){return v.JQ},sha512:function(){return v.o},shallowCopy:function(){return E.DC},shuffled:function(){return pt.y},solidityKeccak256:function(){return Zt.keccak256},solidityPack:function(){return Zt.pack},soliditySha256:function(){return Zt.sha256},splitSignature:function(){return h.N}
235,stripZeros:function(){return h.G1},toUtf8Bytes:function(){return m.Y0},toUtf8CodePoints:function(){return m.XL},toUtf8String:function(){return m.ZN},verifyMessage:function(){return Ie},verifyTypedData:function(){return De},zeroPad:function(){return h.Bu}});var s={};r.r(s),r.d(s,{BaseContract:function(){return u.BaseContract},BigNumber:function(){return c.O$},Contract:function(){return u.Contract},ContractFactory:function(){return u.ContractFactory},FixedNumber:function(){return l.xs},Signer:function(){return d.Signer},VoidSigner:function(){return d.VoidSigner},Wallet:function(){return Ce},Wordlist:function(){return I},constants:function(){return n},errors:function(){return R.jK},getDefaultProvider:function(){return Wt},logger:function(){return ir},providers:function(){return i},utils:function(){return a},version:function(){return nr},wordlists:function(){return P}});var u=r(64146),c=r(2593),l=r(20335),d=r(48088),p=r(19485),f=r(81556),h=r(16441),y=r(38197),m=r(29251);function g(e){return"string"===typeof e&&(e=(0,m.Y0)(e)),(0,y.w)((0,h.zo)([(0,m.Y0)("\x19Ethereum Signed Message:\n"),(0,m.Y0)(String(e.length)),e]))}var _=r(67827),b=r(57727),v=r(2006);function w(e,t,r,n,i){let o;e=(0,h.lE)(e),t=(0,h.lE)(t);let a=1;const s=new Uint8Array(n),u=new Uint8Array(t.length+4);let c,l;u.set(t);for(let d=1;d<=a;d++){u[t.length]=d>>24&255,u[t.length+1]=d>>16&255,u[t.length+2]=d>>8&255,u[t.length+3]=255&d;let p=(0,h.lE)((0,v.Gy)(i,e,u));o||(o=p.length,l=new Uint8Array(o),a=Math.ceil(n/o),c=n-(a-1)*o),l.set(p);for(let t=1;t<r;t++){p=(0,h.lE)((0,v.Gy)(i,e,p));for(let e=0;e<o;e++)l[e]^=p[e]}const f=(d-1)*o,y=d===a?c:o;s.set((0,h.lE)(l).slice(0,y),f)}return(0,h.Dv)(s)}var E=r(6881),S=r(67669),A=r(21261),T=r(83875),O=r(32046),R=r(1581);const C=new R.Yd("wordlists/5.5.0");class I{constructor(e){C.checkAbstract(new.target,I),(0,E.zG)(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return(0,O.id)(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let D=null;function N(e){if(null==D&&(D="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductC
235onfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMu
235seumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThe
235nTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==I.check(e)))throw D=null,new Error("BIP39 Wordlist for en (English) FAILED")}const k=new class extends I{constructor(){super("en")}getWord(e){return N(this),D[e]}getWordIndex(e){return N(this),D.indexOf(e)}};I.register(k);const P={en:k},L=new R.Yd("hdnode/5.5.0"),x=c.O$.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),B=(0,m.Y0)("Bitcoin seed"),M=2147483648;function G(e){return(1<<e)-1<<8-e}function H(e){return(0,h.$m)((0,h.Dv)(e),32)}function F(e){return b.eU.encode((0,h.zo)([e,(0,h.p3)((0,v.JQ)((0,v.JQ)(e)),0,4)]))}function j(e){if(null==e)return P.en;if("string"===typeof e){const t=P[e];return null==t&&L.throwArgumentError("unknown locale","wordlist",e),t}return e}const U={},q="m/44'/60'/0'/0/0";class W{constructor(e,t,r,n,i,o,a,s){if(L.checkNew(new.target,W),e!==U)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new S.Et(t);(0,E.zG)(this,"privateKey",e.privateKey),(0,E.zG)(this,"publicKey",e.compressedPublicKey)}else(0,E.zG)(this,"privateKey",null),(0,E.zG)(this,"publicKey",(0,h.Dv)(r));(0,E.zG)(this,"parentFingerprint",n),(0,E.zG)(this,"fingerprint",(0,h.p3)((0,v.bP)((0,v.JQ)(this.publicKey)),0,4)),(0,E.zG)(this,"address",(0,T.db)(this.publicKey)),(0,E.zG)(this,"chainCode",i),(0,E.zG)(this,"index",o),(0,E.zG)(this,"depth",a),null==s?((0,E.zG)(this,"mnemonic",null),(0,E.zG)(this,"path",null)):"string"===typeof s?((0,E.zG)(this,"mnemonic",null),(0,E.zG)(this,"path",s)):((0,E.zG)(this,"mnemonic",s),(0,E.zG)(this,"path",s.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return F((0,h.zo)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,h.Dv)(this.depth),this.parentFingerprint,(0,h.$m)((0,h.Dv)(this.index),4),this.chainCode,null!=this.privateKey?(0,h.zo)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new W(U,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&M){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,h.lE)(this.privateKey),1),t&&(t+="'")}else r.set((0,h.lE)(this.publicKey));for(let c=24;c>=0;c-=8)r[33+(c>>3)]=e>>24-c&255;const n=(0,h.lE)((0,v.Gy)(A.p.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=H(c.O$.from(i).add(this.privateKey).mod(x));else{s=new S.Et((0,h.Dv)(i))._addPoint(this.publicKey)}let u=t;const l=this.mnemonic;return l&&(u=Object.freeze({phrase:l.phrase,path:t,locale:l.locale||"en"})),new W(U,a,s,this.fingerprint,H(o),e,this.depth+1,u)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let n=0;n<t.length;n++){const e=t[n];if(e.match(/^[0-9]+'$/)){const t=parseInt(e.substring(0,e.length-1));if(t>=M)throw new Error("invalid path index - "+e);r=r._derive(M+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=M)throw new Error("invalid path index - "+e);r=r._derive(t)}}}return r}static _fromSeed(e,t){const r=(0,h.lE)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,h.lE)((0,v.Gy)(A.p.sha512,B,r));return new W(U,H(n.slice(0,32)),null,"0x00000000",H(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Y(V(e,r=j(r)),r),W._fromSeed(K(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return W._fromSeed(e,null)}static fromExtendedKey(e){const t=b.eU.decode(e);82===t.length&&F(t.slice(0,78))===e||L.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=(0,h.Dv)(t.slice(5,9)),i=parseInt((0,h.Dv)(t.slice(9,13)).substring(2),16),o=(0,h.Dv)(t.slice(13,45)),a=t.slice(45,78);switch((0,h.Dv)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new W(U,null,(0,h.Dv)(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new W(U,(0,h.Dv)(a.slice(1)),null,n,o,i,r,null)}return L.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function K(e,t){t||(t="");const r=(0,m.Y0)("mnemonic"+t,m.Uj.NFKD);return w((0,m.Y0)(e,m.Uj.NFKD),r,2048,64,"sha512")}
235function V(e,t){t=j(t),L.checkNormalize();const r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=(0,h.lE)(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let s=0;s<r.length;s++){let e=t.getWordIndex(r[s].normalize("NFKD"));if(-1===e)throw new Error("invalid mnemonic");for(let t=0;t<11;t++)e&1<<10-t&&(n[i>>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=G(r.length/3);if(((0,h.lE)((0,v.JQ)(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return(0,h.Dv)(n.slice(0,o/8))}function Y(e,t){if(t=j(t),(e=(0,h.lE)(e)).length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let a=0;a<e.length;a++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[a],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[a]>>8-n,r.push(e[a]&(1<<8-n)-1),n+=3);const i=e.length/4,o=(0,h.lE)((0,v.JQ)(e))[0]&G(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}function z(e,t){try{return V(e,t),!0}catch(r){}return!1}function J(e){return("number"!==typeof e||e<0||e>=M||e%1)&&L.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}const $=new R.Yd("random/5.5.1");const X=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw new Error("unable to locate global object")}();let Z=X.crypto||X.msCrypto;function Q(e){(e<=0||e>1024||e%1||e!=e)&&$.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Z.getRandomValues(t),(0,h.lE)(t)}Z&&Z.getRandomValues||($.warn("WARNING: Missing strong random number source"),Z={getRandomValues:function(e){return $.throwError("no secure random source avaialble",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var ee=r(78826),te=r.n(ee);const re="json-wallets/5.5.0";function ne(e){return"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,h.lE)(e)}function ie(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function oe(e){return"string"===typeof e?(0,m.Y0)(e,m.Uj.NFKC):(0,h.lE)(e)}function ae(e,t){let r=e;const n=t.toLowerCase().split("/");for(let i=0;i<n.length;i++){let e=null;for(const t in r)if(t.toLowerCase()===n[i]){e=r[t];break}if(null===e)return null;r=e}return r}function se(e){const t=(0,h.lE)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=(0,h.Dv)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const ue=new R.Yd(re);class ce extends E.dk{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function le(e,t){const r=JSON.parse(e);t=oe(t);const n=(0,p.getAddress)(ae(r,"ethaddr")),i=ne(ae(r,"encseed"));i&&i.length%16===0||ue.throwArgumentError("invalid encseed","json",e);const o=(0,h.lE)(w(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),u=new(te().ModeOfOperation.cbc)(o,a),c=te().padding.pkcs7.strip((0,h.lE)(u.decrypt(s)));let l="";for(let p=0;p<c.length;p++)l+=String.fromCharCode(c[p]);const d=(0,m.Y0)(l),f=(0,y.w)(d);return new ce({_isCrowdsaleAccount:!0,address:n,privateKey:f})}function de(e){let t=null;try{t=JSON.parse(e)}catch(r){return!1}return t.encseed&&t.ethaddr}function pe(e){let t=null;try{t=JSON.parse(e)}catch(r){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function fe(e){if(de(e))try{return(0,p.getAddress)(JSON.parse(e).ethaddr)}catch(t){return null}if(pe(e))try{return(0,p.getAddress)(JSON.parse(e).address)}catch(t){return null}return null}var he=r(17635),ye=r.n(he),me=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ge=new R.Yd(re);function _e(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class be extends E.dk{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function ve(e,t){const r=ne(ae(e,"crypto/ciphertext"));if((0,h.Dv)((0,y.w)((0,h.zo)([t.slice(16,32),r]))).substring(2)!==ae(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===ae(e,"crypto/cipher")){const n=ne(ae(e,"crypto/cipherparams/iv")),i=new(te().Counter)(n),o=new(te().ModeOfOperation.ctr)(t,i);return(0,h.lE)(o.decrypt(r))}return null}(e,t.slice(0,16),r);n||ge.throwError("unsupported cipher",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=(0,T.db)(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),(0,p.getAddress)(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:(0,h.Dv)(n)};if("0.1"===ae(e,"x-ethers/version")){const t=ne(ae(e,"x-ethers/mnemonicCiphertext")),r=ne(ae(e,"x-ethers/mnemonicCounter")),n=new(te().Counter)(r),o=new(te().ModeOfOperation.ctr)(i,n),u=ae(e,"x-ethers/path")||q,c=ae(e,"x-ethers/locale")||"en",l=(0,h.lE)(o.decrypt(t));try{const e=Y(l,c),t=W.fromMnemonic(e,null,c).derivePath(u);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(s){if(s.code!==R.Yd.errors.INVALID_ARGUMENT||"wordlist"!==s.argument)throw s}}return new be(a)}
235function we(e,t,r,n,i){return(0,h.lE)(w(e,t,r,n,i))}function Ee(e,t,r,n,i){return Promise.resolve(we(e,t,r,n,i))}function Se(e,t,r,n,i){const o=oe(t),a=ae(e,"crypto/kdf");if(a&&"string"===typeof a){const t=function(e,t){return ge.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=ne(ae(e,"crypto/kdfparams/salt")),s=parseInt(ae(e,"crypto/kdfparams/n")),u=parseInt(ae(e,"crypto/kdfparams/r")),c=parseInt(ae(e,"crypto/kdfparams/p"));s&&u&&c||t("kdf",a),0!==(s&s-1)&&t("N",s);const l=parseInt(ae(e,"crypto/kdfparams/dklen"));return 32!==l&&t("dklen",l),n(o,r,s,u,c,64,i)}if("pbkdf2"===a.toLowerCase()){const n=ne(ae(e,"crypto/kdfparams/salt"));let i=null;const a=ae(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(ae(e,"crypto/kdfparams/c")),u=parseInt(ae(e,"crypto/kdfparams/dklen"));return 32!==u&&t("dklen",u),r(o,n,s,u,i)}}return ge.throwArgumentError("unsupported key-derivation function","kdf",a)}function Ae(e,t,r){if(de(e)){r&&r(0);const n=le(e,t);return r&&r(1),Promise.resolve(n)}return pe(e)?function(e,t,r){return me(this,void 0,void 0,(function*(){const n=JSON.parse(e);return ve(n,yield Se(n,t,Ee,ye().scrypt,r))}))}(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function Te(e,t){if(de(e))return le(e,t);if(pe(e))return function(e,t){const r=JSON.parse(e);return ve(r,Se(r,t,we,ye().syncScrypt))}(e,t);throw new Error("invalid JSON wallet")}var Oe=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Re=new R.Yd("wallet/5.5.0");class Ce extends d.Signer{constructor(e,t){if(Re.checkNew(new.target,Ce),super(),null!=(r=e)&&(0,h.A7)(r.privateKey,32)&&null!=r.address){const t=new S.Et(e.privateKey);if((0,E.zG)(this,"_signingKey",(()=>t)),(0,E.zG)(this,"address",(0,T.db)(this.publicKey)),this.address!==(0,p.getAddress)(e.address)&&Re.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,E.zG)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||q,locale:t.locale||"en"})));const r=this.mnemonic,n=W.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);(0,T.db)(n.privateKey)!==this.address&&Re.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,E.zG)(this,"_mnemonic",(()=>null))}else{if(S.Et.isSigningKey(e))"secp256k1"!==e.curve&&Re.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,E.zG)(this,"_signingKey",(()=>e));else{"string"===typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new S.Et(e);(0,E.zG)(this,"_signingKey",(()=>t))}(0,E.zG)(this,"_mnemonic",(()=>null)),(0,E.zG)(this,"address",(0,T.db)(this.publicKey))}var r;t&&!f.Provider.isProvider(t)&&Re.throwArgumentError("invalid provider","provider",t),(0,E.zG)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Ce(this,e)}signTransaction(e){return(0,E.mE)(e).then((t=>{null!=t.from&&((0,p.getAddress)(t.from)!==this.address&&Re.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest((0,y.w)((0,T.qC)(t)));return(0,T.qC)(t,r)}))}signMessage(e){return Oe(this,void 0,void 0,(function*(){return(0,h.gV)(this._signingKey().signDigest(g(e)))}))}_signTypedData(e,t,r){return Oe(this,void 0,void 0,(function*(){const n=yield _.E.resolveNames(e,t,r,(e=>(null==this.provider&&Re.throwError("cannot resolve ENS names without a provider",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,h.gV)(this._signingKey().signDigest(_.E.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!==typeof t||r||(r=t,t={}),r&&"function"!==typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if((0,p.getAddress)(e.address)!==(0,T.db)(e.privateKey))throw new Error("address/privateKey mismatch");if(_e(e)){const t=e.mnemonic;if(W.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||q).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(b){return Promise.reject(b)}"function"!==typeof r||n||(n=r,r={}),r||(r={});const i=(0,h.lE)(e.privateKey),o=oe(t);let a=null,s=null,u=null;if(_e(e)){const t=e.mnemonic;a=(0,h.lE)(V(t.phrase,t.locale||"en")),s=t.path||q,u=t.locale||"en"}let c=r.client;c||(c="ethers.js");let l=null;l=r.salt?(0,h.lE)(r.salt):Q(32);let d=null;if(r.iv){if(d=(0,h.lE)(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Q(16);let f=null;if(r.uuid){if(f=(0,h.lE)(r.uuid),16!==f.length)throw new Error("invalid uuid")}else f=Q(16);let m=1<<17,g=8,_=1;return r.scrypt&&(r.scrypt.N&&(m=r.scrypt.N),r.scrypt.r&&(g=r.scrypt.r),r.scrypt.p&&(_=r.scrypt.p)),ye().scrypt
235(o,l,m,g,_,64,n).then((t=>{const r=(t=(0,h.lE)(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),p=new(te().Counter)(d),b=new(te().ModeOfOperation.ctr)(r,p),v=(0,h.lE)(b.encrypt(i)),w=(0,y.w)((0,h.zo)([n,v])),E={address:e.address.substring(2).toLowerCase(),id:se(f),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,h.Dv)(d).substring(2)},ciphertext:(0,h.Dv)(v).substring(2),kdf:"scrypt",kdfparams:{salt:(0,h.Dv)(l).substring(2),n:m,dklen:32,p:_,r:g},mac:w.substring(2)}};if(a){const e=Q(16),t=new(te().Counter)(e),r=new(te().ModeOfOperation.ctr)(o,t),n=(0,h.lE)(r.encrypt(a)),i=new Date,l=i.getUTCFullYear()+"-"+ie(i.getUTCMonth()+1,2)+"-"+ie(i.getUTCDate(),2)+"T"+ie(i.getUTCHours(),2)+"-"+ie(i.getUTCMinutes(),2)+"-"+ie(i.getUTCSeconds(),2)+".0Z";E["x-ethers"]={client:c,gethFilename:"UTC--"+l+"--"+E.address,mnemonicCounter:(0,h.Dv)(e).substring(2),mnemonicCiphertext:(0,h.Dv)(n).substring(2),path:s,locale:u,version:"0.1"}}return JSON.stringify(E)}))}(this,e,t,r)}static createRandom(e){let t=Q(16);e||(e={}),e.extraEntropy&&(t=(0,h.lE)((0,h.p3)((0,y.w)((0,h.zo)([t,e.extraEntropy])),0,16)));const r=Y(t,e.locale);return Ce.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return Ae(e,t,r).then((e=>new Ce(e)))}static fromEncryptedJsonSync(e,t){return new Ce(Te(e,t))}static fromMnemonic(e,t,r){return t||(t=q),new Ce(W.fromMnemonic(e,null,r).derivePath(t))}}function Ie(e,t){return(0,T.RJ)(g(e),t)}function De(e,t,r,n){return(0,T.RJ)(_.E.hash(e,t,r),n)}var Ne=r(9279),ke=r(21046),Pe=r(57218);const Le="\u039e";var xe=r(45710),Be=r(45703),Me=r(81093),Ge=r(9163),He=r(41109);let Fe=null;try{if(Fe=WebSocket,null==Fe)throw new Error("inject please")}catch(or){const e=new R.Yd(He.i);Fe=function(){e.throwError("WebSockets not supported in this environment",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var je=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Ue=new R.Yd(He.i);let qe=1;class We extends Ge.r{constructor(e,t){"any"===t&&Ue.throwError("WebSocketProvider does not support 'any' network yet",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super(e,t),this._pollingInterval=-1,this._wsReady=!1,(0,E.zG)(this,"_websocket",new Fe(this.connection.url)),(0,E.zG)(this,"_requests",{}),(0,E.zG)(this,"_subs",{}),(0,E.zG)(this,"_subIds",{}),(0,E.zG)(this,"_detectNetwork",super.detectNetwork()),this._websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this._websocket.send(this._requests[e].payload)}))},this._websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),(0,E.zG)(e,"code",r.error.code||null),(0,E.zG)(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){Ue.throwError("cannot reset events block on WebSocketProvider",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){Ue.throwError("cannot set polling interval on WebSocketProvider",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return je(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&Ue.throwError("cannot set polling on WebSocketProvider",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=qe++;return new Promise(((n,i)=>{const o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});
235this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:o},this._wsReady&&this._websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return je(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const i=yield n;this._subs[i]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=c.O$.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return je(this,void 0,void 0,(function*(){this._websocket.readyState===Fe.CONNECTING&&(yield new Promise((e=>{this._websocket.onopen=function(){e(!0)},this._websocket.onerror=function(){e(!1)}}))),this._websocket.close(1e3)}))}}var Ke=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const Ve=new R.Yd(He.i);class Ye extends Ge.r{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Ke(this,void 0,void 0,(function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||Ve.throwError("no network detected",R.Yd.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,E.zG)(this,"_network",t),this.emit("network",t,null))),t}))}}class ze extends Ye{constructor(e,t){Ve.checkAbstract(new.target,ze),e=(0,E.tu)(new.target,"getNetwork")(e),t=(0,E.tu)(new.target,"getApiKey")(t);super((0,E.tu)(new.target,"getUrl")(e,t),e),"string"===typeof t?(0,E.zG)(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{(0,E.zG)(this,e,t[e])}))}_startPending(){Ve.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return Ve.throwError("API provider does not support signing",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return Ve.throwError("not implemented; sub-classes must override getUrl",R.Yd.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const Je=new R.Yd(He.i),$e="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class Xe extends We{constructor(e,t){const r=new Ze(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),(0,E.zG)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===$e}}class Ze extends ze{static getWebSocketProvider(e,t){return new Xe(e,t)}static getApiKey(e){return null==e?$e:(e&&"string"!==typeof e&&Je.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;
235case"arbitrum-rinkeby":r="arb-rinkeby.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-kovan":r="opt-kovan.g.alchemy.com/v2/";break;default:Je.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===$e&&(0,Me.vh)(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===$e}}var Qe=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const et=new R.Yd(He.i);class tt extends ze{static getApiKey(e){return null!=e&&et.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;if("homestead"===e.name)r="https://cloudflare-eth.com/";else et.throwArgumentError("unsupported network","network",arguments[0]);return r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return Qe(this,void 0,void 0,(function*(){if("getBlockNumber"===e){return(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number}return r.perform.call(this,e,t)}))}}var rt=r(29685),nt=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const it=new R.Yd(He.i);function ot(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?(0,h.$P)((0,h.Dv)(n)):"accessList"===r?"["+(0,T.z7)(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":(0,h.Dv)(n),t[r]=n)}return t}function at(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"OK"!=e.message){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function st(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function ut(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}const ct="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function lt(e,t,r){if("call"===e&&t.code===R.Yd.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),(0,h.A7)(r))return r;it.throwError("missing revert data in call exception",R.Yd.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===R.Yd.errors.SERVER_ERROR&&(t.error&&"string"===typeof t.error.message?n=t.error.message:"string"===typeof t.body?n=t.body:"string"===typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&it.throwError("insufficient funds for intrinsic transaction cost",R.Yd.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&it.throwError("nonce has already been used",R.Yd.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&it.throwError("replacement fee too low",R.Yd.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&it.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",R.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class dt extends Be.Zk{constructor(e,t){it.checkNew(new.target,dt),super(e),(0,E.zG)(this,"baseUrl",this.getBaseUrl()),(0,E.zG)(this,"apiKey",t||ct)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return it.throwArgumentError("unsupported network","network",name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return nt(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,o="proxy"===e?st:at;
235this.emit("debug",{action:"request",request:n,provider:this});const a={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&(0,Me.vh)(),Promise.resolve(!0))};let s=null;i&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const u=yield(0,rt.rd)(a,s,o||st);return this.emit("debug",{action:"response",request:n,response:(0,E.p$)(u),provider:this}),u}))}detectNetwork(){return nt(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return nt(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>lt("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=ot(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(or){return lt("call",or,t.transaction)}}case"estimateGas":{const e=ot(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(or){return lt("estimateGas",or,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=ut(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=ut(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&it.throwError("unsupported topic count",R.Yd.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"===typeof r&&66===r.length||it.throwError("unsupported topic format",R.Yd.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let t=0;t<r.length;t++){const e=r[t];if(null==e.blockHash){if(null==n[e.blockNumber]){const t=yield this.getBlock(e.blockNumber);t&&(n[e.blockNumber]=t.hash)}e.blockHash=n[e.blockNumber]}}return r}case"getEtherPrice":return"homestead"!==this.network.name?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return r.perform.call(this,e,t)}))}getHistory(e,t,r){return nt(this,void 0,void 0,(function*(){const n={action:"txlist",address:yield this.resolveName(e),startblock:null==t?0:t,endblock:null==r?99999999:r,sort:"asc"};return(yield this.fetch("account",n)).map((e=>{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return this.apiKey===ct}}var pt=r(52472),ft=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const ht=new R.Yd(He.i);function yt(){return(new Date).getTime()}function mt(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||ht.throwArgumentError("provider mismatch","networks",e):t=n}return t}function gt(e,t){e=e.slice().sort();const r=Math.floor(e.length/2);if(e.length%2)return e[r];const n=e[r-1],i=e[r];return null!=t&&Math.abs(n-i)>t?null:(n+i)/2}function _t(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(c.O$.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>_t(e))));if("object"===typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"===typeof r?"[function]":_t(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let bt=1;function vt(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const wt=[R.Yd.errors.CALL_EXCEPTION,R.Yd.errors.INSUFFICIENT_FUNDS,R.Yd.errors.NONCE_EXPIRED,R.Yd.errors.REPLACEMENT_UNDERPRICED,R.Yd.errors.UNPREDICTABLE_GAS_LIMIT],Et=["address","args","errorArgs","errorSignature","method","transaction"];function St(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function At(e,t,r){let n=_t;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=gt(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return gt(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=(0,E.DC)(e)).confirmations=-1,_t(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=(0,E.DC)(e)).transactions=e.transactions.map((e=>((e=(0,E.DC)(e)).confirmations=-1,e))),_t(e))}:function(e){return null==e?null:_t(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const i=Object.keys(n);for(let e=0;e<i.length;e++){const r=n[i[e]];if(r.count>=t)return r.result}}}(n,e.quorum)}function Tt(e,t){return ft(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:(0,rt.$l)((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Ot(e,t,r,n){return ft(this,void 0,void 0,(function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&(0,h.A7)(n.blockTag)&&(i=yield Tt(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&(0,h.A7)(n.blockTag)&&(i=yield Tt(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&(0,h.A7)(n.blockTag)&&(i=yield Tt(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&(0,h.A7)(n.blockTag)&&(i=yield Tt(e,t)),i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&(0,h.A7)(r.fromBlock)||r.toBlock&&(0,h.A7)(r.toBlock))&&(i=yield Tt(e,t)),i.getLogs(r)}}return ht.throwError("unknown method error",R.Yd.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Rt extends Be.Zk{constructor(e,t){ht.checkNew(new.target,Rt),0===e.length&&ht.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(f.Provider.isProvider(e)){const t=(0,Me.Gp)(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=(0,E.DC)(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=(0,Me.Gp)(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&ht.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&ht.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=mt(r.map((e=>e.provider.network)));null==i&&(i=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(i),(0,E.zG)(this,"providerConfigs",Object.freeze(r)),(0,E.zG)(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return ft(this,void 0,void 0,(function*(){return mt(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}
235))}perform(e,t){return ft(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;t<e.length;t++){const r=e[t];if("string"===typeof r)return r}throw e[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==e&&(yield this.getBlockNumber());const r=At(this,e,t),n=(0,pt.y)(this.providerConfigs.map(E.DC));n.sort(((e,t)=>e.priority-t.priority));const i=this._highestBlockNumber;let o=0,a=!0;for(;;){const s=yt();let u=n.filter((e=>e.runner&&s-e.start<e.stallTimeout)).reduce(((e,t)=>e+t.weight),0);for(;u<this.quorum&&o<n.length;){const r=n[o++],a=bt++;r.start=yt(),r.staller=vt(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=Ot(r,i,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:St(r,yt()),request:{method:e,params:(0,E.p$)(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:St(r,yt()),request:{method:e,params:(0,E.p$)(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:a,backend:St(r,null),request:{method:e,params:(0,E.p$)(t)},provider:this}),u+=r.weight}const c=[];n.forEach((e=>{!e.done&&e.runner&&(c.push(e.runner),e.staller&&c.push(e.staller.getPromise()))})),c.length&&(yield Promise.race(c));const l=n.filter((e=>e.done&&null==e.error));if(l.length>=this.quorum){const e=r(l);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;a||(yield vt(100).getPromise()),a=!1}const d=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return wt.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(d).forEach((e=>{const t=d[e];if(t.weight<this.quorum)return;n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,i={};Et.forEach((e=>{null!=r[e]&&(i[e]=r[e])})),ht.throwError(r.reason||r.message,e,i)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),ht.throwError("failed to meet quorum",R.Yd.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>St(e))),provider:this})}))}}const Ct=null,It=new R.Yd(He.i),Dt="84842078b09946638c03157f83405213";class Nt extends We{constructor(e,t){const r=new kt(e,t),n=r.connection;n.password&&It.throwError("INFURA WebSocket project secrets unsupported",R.Yd.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),(0,E.zG)(this,"apiKey",r.projectId),(0,E.zG)(this,"projectId",r.projectId),(0,E.zG)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===Dt}}class kt extends ze{static getWebSocketProvider(e,t){return new Nt(e,t)}static getApiKey(e){const t={apiKey:Dt,projectId:Dt,projectSecret:null};return null==e||("string"===typeof e?t.projectId=e:null!=e.projectSecret?(It.assertArgument("string"===typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),It.assertArgument("string"===typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-kovan":r="optimism-kovan.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-rinkeby":r="arbitrum-rinkeby.infura.io";break;default:It.throwError("unsupported network",R.Yd.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===Dt&&(0,Me.vh)(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===Dt}}class Pt extends Ge.r{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};
235null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:(0,E.p$)(t),provider:this}),(0,rt.rd)(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),i}}const Lt=new R.Yd(He.i);class xt extends ze{static getApiKey(e){return e&&"string"!==typeof e&&Lt.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){Lt.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Lt.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const Bt=new R.Yd(He.i),Mt={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};class Gt extends ze{constructor(e,t){if(null==t){const r=(0,E.tu)(new.target,"getNetwork")(e);if(r){const e=Mt[r.name];e&&(t={applicationId:e,loadBalancer:!0})}null==t&&Bt.throwError("unsupported network",R.Yd.errors.INVALID_ARGUMENT,{argument:"network",value:e})}super(e,t)}static getApiKey(e){null==e&&Bt.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",e);const t={applicationId:null,loadBalancer:!1,applicationSecretKey:null};return"string"===typeof e?t.applicationId=e:null!=e.applicationSecretKey?(Bt.assertArgument("string"===typeof e.applicationId,"applicationSecretKey requires an applicationId","applicationId",e.applicationId),Bt.assertArgument("string"===typeof e.applicationSecretKey,"invalid applicationSecretKey","applicationSecretKey","[REDACTED]"),t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey,t.loadBalancer=!!e.loadBalancer):e.applicationId?(Bt.assertArgument("string"===typeof e.applicationId,"apiKey.applicationId must be a string","apiKey.applicationId",e.applicationId),t.applicationId=e.applicationId,t.loadBalancer=!!e.loadBalancer):Bt.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"goerli":r="eth-goerli.gateway.pokt.network";break;default:Bt.throwError("unsupported network",R.Yd.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n=null;n=t.loadBalancer?`https://${r}/v1/lb/${t.applicationId}`:`https://${r}/v1/${t.applicationId}`;const i={url:n,headers:{}};return null!=t.applicationSecretKey&&(i.user="",i.password=t.applicationSecretKey),i}isCommunityResource(){return this.applicationId===Mt[this.network.name]}}const Ht=new R.Yd(He.i);let Ft=1;function jt(e,t){const r="Web3LegacyFetcher";return function(e,n){const i={method:e,params:n,id:Ft++,jsonrpc:"2.0"};return new Promise(((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,E.p$)(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:i,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,n(e)}e(o.result)}))}))}}class Ut extends Ge.r{constructor(e,t){Ht.checkNew(new.target,Ut),null==e&&Ht.throwArgumentError("missing provider","provider",e);let r=null,n=null,i=null;"function"===typeof e?(r="unknown:",n=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),i=e,e.request?(""===r&&(r="eip-1193:"),n=function(e){return function(t,r){null==r&&(r=[]);const n={method:t,params:r};
235return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,E.p$)(n),provider:this}),e.request(n).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e}))}}(e)):e.sendAsync?n=jt(0,e.sendAsync.bind(e)):e.send?n=jt(0,e.send.bind(e)):Ht.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,E.zG)(this,"jsonRpcFetchFunc",n),(0,E.zG)(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const qt=new R.Yd(He.i);function Wt(e,t){if(null==e&&(e="homestead"),"string"===typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1]){case"http":return new Ge.r(e);case"ws":return new We(e);default:qt.throwArgumentError("unsupported URL scheme","network",e)}}const r=(0,xe.getNetwork)(e);return r&&r._defaultProvider||qt.throwError("unsupported getDefaultProvider network",R.Yd.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:Rt,AlchemyProvider:Ze,CloudflareProvider:tt,EtherscanProvider:dt,InfuraProvider:kt,JsonRpcProvider:Ge.r,NodesmithProvider:xt,PocketProvider:Gt,Web3Provider:Ut,IpcProvider:Ct},t)}var Kt=r(84243),Vt=r(11388),Yt=r(61184),zt=r(8198);function Jt(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return(0,h.lE)(t)}function $t(e){e=(0,h.lE)(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}var Xt=r(84706),Zt=r(31886),Qt=r(59052),er=r(35637),tr=r(86237),rr=r(61744);const nr="ethers/5.5.4",ir=new R.Yd(nr);try{const e=window;null==e._ethers&&(e._ethers=s)}catch(or){}},92703:function(e,t,r){"use strict";var n=r(50414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,a){if(a!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i}
235;return r.PropTypes=r,r}},45697:function(e,t,r){e.exports=r(92703)()},50414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},79464:function(e,t,r){"use strict";var n=p(r(88239)),i=p(r(85105)),o=p(r(99663)),a=p(r(22600)),s=p(r(49135)),u=p(r(93196)),c=p(r(67294)),l=p(r(45697)),d=p(r(11248));function p(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){var e,r,n,a;(0,o.default)(this,t);for(var u=arguments.length,c=Array(u),l=0;l<u;l++)c[l]=arguments[l];return r=n=(0,s.default)(this,(e=t.__proto__||(0,i.default)(t)).call.apply(e,[this].concat(c))),n.handleClickToPause=function(){n.anim.isPaused?n.anim.play():n.anim.pause()},a=r,(0,s.default)(n,a)}return(0,u.default)(t,e),(0,a.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.options,r=e.eventListeners,i=t.loop,o=t.autoplay,a=t.animationData,s=t.rendererSettings,u=t.segments;this.options={container:this.el,renderer:"svg",loop:!1!==i,autoplay:!1!==o,segments:!1!==u,animationData:a,rendererSettings:s},this.options=(0,n.default)({},this.options,t),this.anim=d.default.loadAnimation(this.options),this.registerEvents(r)}},{key:"componentWillUpdate",value:function(e){this.options.animationData!==e.options.animationData&&(this.deRegisterEvents(this.props.eventListeners),this.destroy(),this.options=(0,n.default)({},this.options,e.options),this.anim=d.default.loadAnimation(this.options),this.registerEvents(e.eventListeners))}},{key:"componentDidUpdate",value:function(){this.props.isStopped?this.stop():this.props.segments?this.playSegments():this.play(),this.pause(),this.setSpeed(),this.setDirection()}},{key:"componentWillUnmount",value:function(){this.deRegisterEvents(this.props.eventListeners),this.destroy(),this.options.animationData=null,this.anim=null}},{key:"setSpeed",value:function(){this.anim.setSpeed(this.props.speed)}},{key:"setDirection",value:function(){this.anim.setDirection(this.props.direction)}},{key:"play",value:function(){this.anim.play()}},{key:"playSegments",value:function(){this.anim.playSegments(this.props.segments)}},{key:"stop",value:function(){this.anim.stop()}},{key:"pause",value:function(){(this.props.isPaused&&!this.anim.isPaused||!this.props.isPaused&&this.anim.isPaused)&&this.anim.pause()}},{key:"destroy",value:function(){this.anim.destroy()}},{key:"registerEvents",value:function(e){var t=this;e.forEach((function(e){t.anim.addEventListener(e.eventName,e.callback)}))}},{key:"deRegisterEvents",value:function(e){var t=this;e.forEach((function(e){t.anim.removeEventListener(e.eventName,e.callback)}))}},{key:"render",value:function(){var e=this,t=this.props,r=t.width,i=t.height,o=t.ariaRole,a=t.ariaLabel,s=t.isClickToPauseDisabled,u=t.title,l=function(e){return"number"===typeof e?e+"px":e||"100%"},d=(0,n.default)({width:l(r),height:l(i),overflow:"hidden",margin:"0 auto",outline:"none"},this.props.style),p=s?function(){return null}:this.handleClickToPause;return c.default.createElement("div",{ref:function(t){e.el=t},style:d,onClick:p,title:u,role:o,"aria-label":a,tabIndex:"0"})}}]),t}(c.default.Component);t.Z=f,f.propTypes={eventListeners:l.default.arrayOf(l.default.object),options:l.default.object.isRequired,height:l.default.oneOfType([l.default.string,l.default.number]),width:l.default.oneOfType([l.default.string,l.default.number]),isStopped:l.default.bool,isPaused:l.default.bool,speed:l.default.number,segments:l.default.arrayOf(l.default.number),direction:l.default.number,ariaRole:l.default.string,ariaLabel:l.default.string,isClickToPauseDisabled:l.default.bool,title:l.default.string},f.defaultProps={eventListeners:[],isStopped:!1,isPaused:!1,speed:1,ariaRole:"button",ariaLabel:"animation",isClickToPauseDisabled:!1,title:""}},91625:function(e,t,r){"use strict";r.r(t),r.d(t,{print:function(){return p}});var n="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function i(e){return i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){return a(e,[])}function a(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";
235var r=[].concat(t,[e]),i=function(e){var t=e[String(n)];if("function"===typeof t)return t;if("function"===typeof e.inspect)return e.inspect}(e);if(void 0!==i){var o=i.call(e);if(o!==e)return"string"===typeof o?o:a(o,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(a(e[o],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"===typeof e.constructor){var r=e.constructor.name;if("string"===typeof r&&""!==r)return r}return t}(e)+"]";var n=r.map((function(r){return r+": "+a(e[r],t)}));return"{ "+n.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}function s(e){var t=e.prototype.toJSON;"function"===typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,n&&(e.prototype[n]=t)}function u(e){return null!=e&&"string"===typeof e.kind}s(function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}()),s(function(){function e(e,t,r,n,i,o,a){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=a,this.prev=o,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}());var c={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},l=Object.freeze({});function d(e,t,r){var n=e[t];if(n){if(!r&&"function"===typeof n)return n;var i=r?n.leave:n.enter;if("function"===typeof i)return i}else{var o=r?e.leave:e.enter;if(o){if("function"===typeof o)return o;var a=o[t];if("function"===typeof a)return a}}}function p(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,n=void 0,i=Array.isArray(e),a=[e],s=-1,p=[],f=void 0,h=void 0,y=void 0,m=[],g=[],_=e;do{var b=++s===a.length,v=b&&0!==p.length;if(b){if(h=0===g.length?void 0:m[m.length-1],f=y,y=g.pop(),v){if(i)f=f.slice();else{for(var w={},E=0,S=Object.keys(f);E<S.length;E++){var A=S[E];w[A]=f[A]}f=w}for(var T=0,O=0;O<p.length;O++){var R=p[O][0],C=p[O][1];i&&(R-=T),i&&null===C?(f.splice(R,1),T++):f[R]=C}}s=n.index,a=n.keys,p=n.edits,i=n.inArray,n=n.prev}else{if(h=y?i?s:a[s]:void 0,null===(f=y?y[h]:_)||void 0===f)continue;y&&m.push(h)}var I,D=void 0;if(!Array.isArray(f)){if(!u(f))throw new Error("Invalid AST Node: ".concat(o(f),"."));var N=d(t,f.kind,b);if(N){if((D=N.call(t,f,h,y,m,g))===l)break;
vendor: 5,694 bytes, lines 235-236
235if(!1===D){if(!b){m.pop();continue}}else if(void 0!==D&&(p.push([h,D]),!b)){if(!u(D)){m.pop();continue}f=D}}}void 0===D&&v&&p.push([h,f]),b?m.pop():(n={inArray:i,index:s,keys:a,edits:p,prev:n},a=(i=Array.isArray(f))?f:null!==(I=r[f.kind])&&void 0!==I?I:[],s=-1,p=[],y&&g.push(y),y=f)}while(void 0!==n);return 0!==p.length&&(_=p[p.length-1][1]),_}(e,{leave:f})}var f={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return y(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=g("(",y(e.variableDefinitions,", "),")"),i=y(e.directives," "),o=e.selectionSet;return r||i||n||"query"!==t?y([t,y([r,n]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+g(" = ",n)+g(" ",y(i," "))},SelectionSet:function(e){return m(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,o=e.selectionSet,a=g("",t,": ")+r,s=a+g("(",y(n,", "),")");return s.length>80&&(s=a+g("(\n",_(y(n,"\n")),"\n)")),y([s,y(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+g(" ",y(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return y(["...",g("on ",t),y(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(g("(",y(n,", "),")")," ")+"on ".concat(r," ").concat(g("",y(i," ")," "))+o},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],o='"'===e[e.length-1],a="\\"===e[e.length-1],s=!n||o||a||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+y(e.values,", ")+"]"},ObjectValue:function(e){return"{"+y(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+g("(",y(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:h((function(e){var t=e.directives,r=e.operationTypes;return y(["schema",y(t," "),m(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:h((function(e){return y(["scalar",e.name,y(e.directives," ")]," ")})),ObjectTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return y(["type",t,g("implements ",y(r," & ")),y(n," "),m(i)]," ")})),FieldDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(v(r)?g("(\n",_(y(r,"\n")),"\n)"):g("(",y(r,", "),")"))+": "+n+g(" ",y(i," "))})),InputValueDefinition:h((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return y([t+": "+r,g("= ",n),y(i," ")]," ")})),InterfaceTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return y(["interface",t,g("implements ",y(r," & ")),y(n," "),m(i)]," ")})),UnionTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.types;return y(["union",t,y(r," "),n&&0!==n.length?"= "+y(n," | "):""]," ")})),EnumTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.values;return y(["enum",t,y(r," "),m(n)]," ")})),EnumValueDefinition:h((function(e){return y([e.name,y(e.directives," ")]," ")})),InputObjectTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.fields;return y(["input",t,y(r," "),m(n)]," ")})),DirectiveDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(v(r)?g("(\n",_(y(r,"\n")),"\n)"):g("(",y(r,", "),")"))+(n?" repeatable":"")+" on "+y(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return y(["extend schema",y(t," "),m(r)]," ")},ScalarTypeExtension:function(e){return y(["extend scalar",e.name,y(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return y(["extend type",t,g("implements ",y(r," & ")),y(n," "),m(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return y(["extend interface",t,g("implements ",y(r," & ")),y(n," "),m(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return y(["extend union",t,y(r," "),n&&0!==n.length?"= "+y(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return y(["extend enum",t,y(r," "),m(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return y(["extend input",t,y(r," "),m(n)]," ")}};function h(e){return function(t){return y([t.description,e(t)],"\n")}}function y(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null===e||void 0===e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function m(e){return g("{\n",_(y(e,"\n")),"\n}")}function g(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function _(e){return g(" ",e.replace(/\n/g,"\n "))}function b(e){return-1!==e.indexOf("\n")}function v(e){return null!=e&&e.some(b)}}}]); 236//# sourceMappingURL=5644-51ab87be1c2eee58.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.