@myx-trade/sdk 1.0.24-beta.13 → 1.0.24-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var viem=require('viem'),_n=require('wretch'),cryptoEs=require('crypto-es'),la=require('dayjs'),lodashEs=require('lodash-es');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var _n__default=/*#__PURE__*/_interopDefault(_n);var la__default=/*#__PURE__*/_interopDefault(la);var cn=Object.defineProperty;var We=t=>{throw TypeError(t)};var W=(t,e)=>{for(var n in e)cn(t,n,{get:e[n],enumerable:true});};var Qe=(t,e,n)=>e.has(t)||We("Cannot "+n);var He=(t,e,n)=>(Qe(t,e,"read from private field"),n?n.call(t):e.get(t)),Je=(t,e,n)=>e.has(t)?We("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ye=(t,e,n,a)=>(Qe(t,e,"write to private field"),e.set(t,n),n);var Kt={};W(Kt,{claimBasePoolRebate:()=>Bt,claimBasePoolRebates:()=>Ut,deposit:()=>Qt,getLpPrice:()=>$t,getRewards:()=>jt,previewUserWithdrawData:()=>zt,withdraw:()=>Xt,withdrawableLpAmount:()=>Yt});var M=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"DifferentMarket",inputs:[{type:"bytes32",name:"fromPoolId"},{type:"bytes32",name:"toPoolId"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"ForwardedRecipientMustBeMasterAccount",inputs:[{type:"address",name:"recipient"},{type:"address",name:"master"}]},{type:"error",name:"InsufficientQuoteIn",inputs:[{type:"uint256",name:"orderId"},{type:"uint256",name:"quoteIn"},{type:"uint256",name:"exchangeDelta"}]},{type:"error",name:"InvalidAmount",inputs:[{type:"uint256",name:"amount"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidLiquidityAmount",inputs:[]},{type:"error",name:"InvalidTpsl",inputs:[{type:"uint256",name:"orderId"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"NotReachedPrice",inputs:[{type:"uint256",name:"orderId"},{type:"uint256",name:"price"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"}]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"SamePoolMigration",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"SlippageExceeded",inputs:[{type:"uint256",name:"expected"},{type:"uint256",name:"actual"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"addTpsl",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"poolType"},{type:"tuple[]",name:"tpslParams",components:[{type:"uint256",name:"amount"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"},{type:"uint256",name:"minQuoteOut"}]}]}],outputs:[]},{type:"function",name:"cancelTpsl",constant:false,payable:false,inputs:[{type:"uint256",name:"orderId"}],outputs:[]},{type:"function",name:"claimBasePoolRebate",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"recipient"}],outputs:[]},{type:"function",name:"claimBasePoolRebates",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"address",name:"recipient"}],outputs:[]},{type:"function",name:"claimQuotePoolRebate",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"recipient"}],outputs:[]},{type:"function",name:"claimQuotePoolRebates",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"address",name:"recipient"}],outputs:[]},{type:"function",name:"currentOrderId",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"depositBase",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"recipient"},{type:"tuple[]",name:"tpslParams",components:[{type:"uint256",name:"amount"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"},{type:"uint256",name:"minQuoteOut"}]}]}],outputs:[]},{type:"function",name:"depositQuote",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"recipient"},{type:"tuple[]",name:"tpslParams",components:[{type:"uint256",name:"amount"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"},{type:"uint256",name:"minQuoteOut"}]}]}],outputs:[]},{type:"function",name:"executeTpsl",constant:false,payable:false,inputs:[{type:"uint256",name:"orderId"},{type:"uint256",name:"quoteInIfNecessary"},{type:"uint256",name:"minOut"}],outputs:[{type:"uint256",name:"baseOut"},{type:"uint256",name:"quoteOut"}]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getTpslData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint256",name:"orderId"}],outputs:[{type:"tuple",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint8",name:"poolType"},{type:"uint256",name:"amount"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"},{type:"uint256",name:"minQuoteOut"}]}]},{type:"function",name:"getUserTpslOrderIds",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"}],outputs:[{type:"uint256[]"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"migrateLiquidity",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"fromPoolId"},{type:"bytes32",name:"toPoolId"},{type:"uint256",name:"amount"},{type:"uint256",name:"minLpOut"}]}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"withdrawBase",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"recipient"}]}],outputs:[]},{type:"function",name:"withdrawQuote",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"recipient"}]}],outputs:[]}];var Xe=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"BoostFeeClaimFailed",inputs:[]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ExceedMaxExchangeableAmount",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InsufficientReturnAmount",inputs:[{type:"uint256",name:"expected"},{type:"uint256",name:"received"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolBoostReserveInsufficient",inputs:[]},{type:"error",name:"PoolOracleFeeCharged",inputs:[]},{type:"error",name:"PoolOracleFeeNotCharged",inputs:[]},{type:"error",name:"PoolOracleFeeNotExisted",inputs:[]},{type:"error",name:"PoolOracleFeeNotSoldOut",inputs:[]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"OracleFeeExchanged",inputs:[{type:"bytes32",name:"poolId",indexed:true},{type:"uint256",name:"quoteAmount",indexed:false},{type:"uint256",name:"baseAmount",indexed:false},{type:"address",name:"recipient",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"chargeBoostFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"proposer"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"chargeOracleFeeFromPoolVault",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"poolVault"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"chargeOracleFeeFromPrimer",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"primer"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"claimBoostFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[]},{type:"function",name:"confirmBoostFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"bool",name:"isAllow"}],outputs:[]},{type:"function",name:"exchangeBaseFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"recipient"},{type:"bytes",name:"data"}],outputs:[{type:"uint256",name:"baseOut"}]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExchangeableBaseFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"quoteIn"},{type:"uint256",name:"baseOut"}]},{type:"function",name:"getPoolBoostFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"address",name:"proposer"},{type:"uint256",name:"amount"},{type:"bool",name:"isClaimable"}]}]},{type:"function",name:"getPoolOracleFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"address",name:"primer"},{type:"uint8",name:"state"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isBaseFeeSoldOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"bool"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"refreshOracleFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"withdrawOracleFee",constant:false,payable:false,inputs:[{type:"address",name:"token"},{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[]}];var gn=(o=>(o[o.LINEA_SEPOLIA=59141]="LINEA_SEPOLIA",o[o.LINEA_MAINNET=59144]="LINEA_MAINNET",o[o.ARB_TESTNET=421614]="ARB_TESTNET",o[o.ARB_MAINNET=42161]="ARB_MAINNET",o[o.BSC_TESTNET=97]="BSC_TESTNET",o[o.BSC_MAINNET=56]="BSC_MAINNET",o))(gn||{});var In=[421614,59141,97,42161,59144,56];function je(t){return !!t&&In.includes(t)}var S=10;var La={42161:130n,421614:130n,59144:130n,59141:130n,56:150n,97:150n},$e=1500000n;var Ke={chainInfo:{explorer:"https://sepolia.lineascan.build/",explorerOfTX:"https://sepolia.lineascan.build/tx/",publicJsonRPCUrl:["https://rpc.sepolia.linea.build","https://linea-sepolia.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"],label:"Linea Sepolia",logoUrl:"",faucetUrl:"",chainSymbol:"Linea",gasPriceRatio:1.3,gasLimitRatio:1.2,gasAmountRatio:2,gasFeeReservedForCollateral:(.525+1)*S,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},gasPrice:0n}};var Ze={chainInfo:{privateJsonRPCUrl:"",publicJsonRPCUrl:["https://sepolia-rollup.arbitrum.io/rpc"],label:" Arbitrum Sepolia",chainSymbol:"Arb Sepolia",explorer:"https://sepolia.arbiscan.io/",explorerOfTX:"https://sepolia.arbiscan.io/tx/",faucetUrl:"https://bwarelabs.com/faucets/arbitrum-sepolia",logoUrl:"",gasPriceRatio:1.5,gasLimitRatio:1.3,gasAmountRatio:2,gasFeeReservedForCollateral:(.055+1)*S,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},gasPrice:0n}};var et={chainInfo:{privateJsonRPCUrl:"",publicJsonRPCUrl:["https://bsc-testnet-dataseed.bnbchain.org"],label:"BNB Chain Testnet",chainSymbol:"BNB Chain Testnet",explorer:"https://testnet.bscscan.com/",explorerOfTX:"https://testnet.bscscan.com/tx/",faucetUrl:"https://docs.bnbchain.org/bnb-smart-chain/developers/faucet/",logoUrl:"",gasPriceRatio:2,gasLimitRatio:2,gasAmountRatio:2,gasFeeReservedForCollateral:(5e-4+1)*S,nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},gasPrice:0n}};var tt={chainInfo:{label:"Linea Mainnet",explorer:"https://lineascan.build/",logoUrl:"",explorerOfTX:"https://lineascan.build/tx/",publicJsonRPCUrl:["https://rpc.linea.build/","https://linea.blockpi.network/v1/rpc/public","https://1rpc.io/linea","https://rpc.linea.build"],chainSymbol:"Linea",gasPriceRatio:1.3,gasLimitRatio:1.2,gasAmountRatio:2,gasFeeReservedForCollateral:(.525+.35)*S,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},gasPrice:0n}};var nt={chainInfo:{privateJsonRPCUrl:"",publicJsonRPCUrl:["https://arb1.arbitrum.io/rpc"],label:" Arbitrum One",chainSymbol:"Arbitrum One",explorer:"https://arbiscan.io/",explorerOfTX:"https://arbiscan.io/tx/",logoUrl:"",gasPriceRatio:1.5,gasLimitRatio:1.3,gasAmountRatio:2,gasFeeReservedForCollateral:(.055+.175)*S,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},gasPrice:0n}};var at={chainInfo:{privateJsonRPCUrl:"",publicJsonRPCUrl:["https://bsc-dataseed.bnbchain.org"],label:"BNB Chain",chainSymbol:"BNB Chain",explorer:"https://bscscan.com/",explorerOfTX:"https://bscscan.com/tx/",faucetUrl:"https://docs.bnbchain.org/bnb-smart-chain/developers/faucet/",logoUrl:"",gasPriceRatio:1.5,gasLimitRatio:2,gasAmountRatio:2,gasFeeReservedForCollateral:(5e-4+1)*S,nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},gasPrice:100000000n}};var g={59141:Ke.chainInfo,421614:Ze.chainInfo,97:et.chainInfo,59144:tt.chainInfo,42161:nt.chainInfo,56:at.chainInfo};function ie(t){let e=g[t];if(!e)throw new Error(`Could not find information with chain id ${t}`);return e}var pe={};function Cn(t){if(!pe[t]){let e=ie(t),n=[...e.privateJsonRPCUrl?[e.privateJsonRPCUrl]:[],...Array.isArray(e.publicJsonRPCUrl)?[...e.publicJsonRPCUrl]:[]].filter(Boolean);if(n.length===0)throw new Error(`${t} has no jsonRPCUrl configured`);pe[t]={id:t,name:e.label||`Chain ${t}`,nativeCurrency:e.nativeCurrency,rpcUrls:{default:{http:n}}};}return pe[t]}var ue={};function c(t){if(!ue[t]){let e=ie(t),n=[...e.privateJsonRPCUrl?[e.privateJsonRPCUrl]:[],...Array.isArray(e.publicJsonRPCUrl)?[...e.publicJsonRPCUrl]:[]].filter(Boolean);if(n.length===0)throw new Error(`${t} has no jsonRPCUrl configured`);let a=n.length===1?viem.http(n[0]):viem.fallback(n.map(s=>viem.http(s)));ue[t]=viem.createPublicClient({chain:Cn(t),transport:a});}return ue[t]}var me=null;function Pn(t){me=t;}function En(){return me}async function v(t){let e=me;if(!e?.hasSigner())throw new Error("No signer: call auth({ signer }) or auth({ walletClient })");return e.getViemWalletClient(t)}var de=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"BaseFeeNotSoldOut",inputs:[]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidBaseToken",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"LPNotFullyMinted",inputs:[]},{type:"error",name:"MarketNotExist",inputs:[{type:"bytes32",name:"marketId"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolDebtNotCleared",inputs:[]},{type:"error",name:"PoolExists",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PoolNotExist",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PositionNotEmpty",inputs:[]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"error",name:"UnauthorizedUnboost",inputs:[]},{type:"error",name:"UnexpectedPoolState",inputs:[]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"benchPool",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple[]",name:"prices",components:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"oracleType"},{type:"uint64",name:"publishTime"},{type:"bytes",name:"oracleUpdateData"}]},{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"string",name:"remark"}]}],outputs:[]},{type:"function",name:"boostPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"}]}],outputs:[]},{type:"function",name:"checkPoolExists",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"bool"}]},{type:"function",name:"deployPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"marketId"},{type:"address",name:"baseToken"}]}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getMarketPool",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"address",name:"asset"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"marketId"},{type:"bytes32",name:"poolId"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"state"},{type:"bool",name:"compoundEnabled"},{type:"address",name:"basePoolToken"},{type:"address",name:"quotePoolToken"},{type:"address",name:"poolVault"},{type:"address",name:"tradingVault"}]}]},{type:"function",name:"getPairToken",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"}]},{type:"function",name:"getPool",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"marketId"},{type:"bytes32",name:"poolId"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"state"},{type:"bool",name:"compoundEnabled"},{type:"address",name:"basePoolToken"},{type:"address",name:"quotePoolToken"},{type:"address",name:"poolVault"},{type:"address",name:"tradingVault"}]}]},{type:"function",name:"getPoolMarket",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"bytes32",name:"marketId"},{type:"tuple",components:[{type:"address",name:"quoteToken"},{type:"uint32",name:"baseReserveRatio"},{type:"uint32",name:"quoteReserveRatio"},{type:"uint64",name:"oracleFeeUsd"},{type:"uint64",name:"boostFeeUsd"},{type:"uint64",name:"boostRefundFeeUsd"},{type:"uint128",name:"poolPrimeThreshold"},{type:"uint128",name:"executionFee"},{type:"uint128",name:"maxExecutionFee"},{type:"uint128",name:"forwardFee"},{type:"uint128",name:"maxForwardFee"}]}]},{type:"function",name:"getPoolMarketExecutionFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"executionFee"}]},{type:"function",name:"getPoolMarketForwardFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"forwardFee"}]},{type:"function",name:"getPoolMarketId",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"bytes32",name:"marketId"}]},{type:"function",name:"getPoolRiskTier",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint8"}]},{type:"function",name:"getPoolVault",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"address"}]},{type:"function",name:"getPools",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32[]",name:"pools"}]},{type:"function",name:"getTradingVault",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"address"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isPoolAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"addr"}],outputs:[{type:"bool"}]},{type:"function",name:"perBenchPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"string",name:"remark"}]}],outputs:[]},{type:"function",name:"primePool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"referencePrice"}]}],outputs:[]},{type:"function",name:"primePoolFromBoost",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"}]}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"reprimePool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"}]}],outputs:[]},{type:"function",name:"trenchPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"bytes32",name:"oracleFeedId"},{type:"uint32",name:"oracleDecimals"},{type:"uint8",name:"oracleType"},{type:"uint8",name:"riskTier"}]}],outputs:[]},{type:"function",name:"unboostPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"}]}],outputs:[]},{type:"function",name:"updatePoolCompoundEnabled",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"bool",name:"enabled"}]}],outputs:[]},{type:"function",name:"updatePoolRiskTiers",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"riskTier"}]}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var O=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{anonymous:false,inputs:[{indexed:true,internalType:"address",name:"owner",type:"address"},{indexed:true,internalType:"address",name:"spender",type:"address"},{indexed:false,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:false,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:false,inputs:[{indexed:true,internalType:"address",name:"previousOwner",type:"address"},{indexed:true,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:false,inputs:[{indexed:true,internalType:"address",name:"from",type:"address"},{indexed:true,internalType:"address",name:"to",type:"address"},{indexed:false,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];var le=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InsufficientOutputAmount",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolNotActive",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PoolNotExist",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeCastOverflowedUintToInt",inputs:[{type:"uint256",name:"value"}]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"QuotePoolProfitDistributed",inputs:[{type:"bytes32",name:"poolId",indexed:false},{type:"uint256",name:"amount",indexed:false},{type:"uint256",name:"genesisAmount",indexed:false},{type:"uint256",name:"price",indexed:false},{type:"uint256",name:"exchangeRate",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"EXCHANGE_RATE_PRECISION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"POOL_TOKEN_DECIMALS",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"REBATE_INDEX_PRECISION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"claimUserRebate",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"rebateOut"}]},{type:"function",name:"claimUserRebates",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256[]",name:"rebateOut"}]},{type:"function",name:"deposit",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"amountOut"}]},{type:"function",name:"distribute",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amount"},{type:"uint256",name:"genesisAmount"},{type:"uint256",name:"price"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExchangeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getExchangeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getPoolData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"uint256",name:"genesisRebateIndex"}]}]},{type:"function",name:"getPoolTokenPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"getUserData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"}],outputs:[{type:"tuple",components:[{type:"uint256",name:"index"},{type:"uint256",name:"accrued"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"pendingUserRebates",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewLpAmountOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"quoteAmountIn"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewPoolTokenPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewQuoteAmountOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"lpAmountIn"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewUserWithdrawData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"lpAmountIn"},{type:"address",name:"user"},{type:"uint256",name:"price"}],outputs:[{type:"uint256",name:"quoteAmountOut"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"updatePool",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"oraclePrice"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"withdraw",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"amountOut"},{type:"uint256",name:"rebateOut"}]},{type:"function",name:"withdrawableLpAmount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]}];var ye=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ExceedMaxProfit",inputs:[]},{type:"error",name:"ExceedMinOutputAmount",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InsufficientOutputAmount",inputs:[]},{type:"error",name:"InsufficientReturnAmount",inputs:[{type:"uint256",name:"expected"},{type:"uint256",name:"received"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolNotActive",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PoolNotCompoundable",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PoolNotExist",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeCastOverflowedUintToInt",inputs:[{type:"uint256",name:"value"}]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"BasePoolProfitDistributed",inputs:[{type:"bytes32",name:"poolId",indexed:true},{type:"uint256",name:"baseAmount",indexed:false},{type:"uint256",name:"quoteAmount",indexed:false},{type:"uint256",name:"price",indexed:false},{type:"uint256",name:"exchangeRate",indexed:false},{type:"uint256",name:"rebateIndex",indexed:false},{type:"uint256",name:"genesisRebateIndex",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"PoolProfitExchanged",inputs:[{type:"bytes32",name:"poolId",indexed:true},{type:"uint256",name:"baseIn",indexed:false},{type:"uint256",name:"quoteOut",indexed:false},{type:"uint256",name:"price",indexed:false},{type:"address",name:"recipient",indexed:false}]},{type:"event",anonymous:false,name:"PoolRebateIndexUpdated",inputs:[{type:"bytes32",name:"poolId",indexed:true},{type:"uint256",name:"unexchangedProfits",indexed:false},{type:"uint256",name:"oldIndex",indexed:false},{type:"uint256",name:"newIndex",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"EXCHANGE_RATE_PRECISION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"POOL_TOKEN_DECIMALS",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"REBATE_INDEX_PRECISION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"claimUserRebate",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"rebateOut"}]},{type:"function",name:"claimUserRebates",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256[]",name:"rebateOut"}]},{type:"function",name:"deposit",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"amountOut"}]},{type:"function",name:"distribute",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"},{type:"uint256",name:"genesisAmount"},{type:"uint256",name:"price"}],outputs:[]},{type:"function",name:"exchangeProfit",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"baseIn"},{type:"uint256",name:"minQuoteOut"},{type:"address",name:"recipient"},{type:"bytes",name:"data"}],outputs:[{type:"uint256",name:"quoteOut"}]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExchangeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getExchangeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"getExchangeableProfit",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256",name:"baseIn"},{type:"uint256",name:"quoteOut"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getPoolData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"uint256",name:"rebateIndex"},{type:"uint256",name:"genesisRebateIndex"},{type:"uint256",name:"exchangeableProfits"}]}]},{type:"function",name:"getPoolTokenPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"getUserData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"}],outputs:[{type:"tuple",components:[{type:"uint256",name:"index"},{type:"uint256",name:"genesisIndex"},{type:"uint256",name:"accrued"},{type:"uint256",name:"genesisAccrued"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"pendingUserRebates",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"uint256",name:"price"}],outputs:[{type:"uint256",name:"rebates"},{type:"uint256",name:"genesisRebates"}]},{type:"function",name:"previewBaseAmountOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"lpAmountIn"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewExchangeableProfit",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"baseIn"},{type:"uint256",name:"quoteOut"}]},{type:"function",name:"previewLpAmountOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"baseAmountIn"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewPoolTokenPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewUserWithdrawData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"lpAmountIn"},{type:"address",name:"user"},{type:"uint256",name:"price"}],outputs:[{type:"uint256",name:"baseAmountOut"},{type:"uint256",name:"rebateAmount"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"updatePool",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"oraclePrice"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"withdraw",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"amountOut"},{type:"uint256",name:"rebateOut"}]},{type:"function",name:"withdrawableLpAmount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]}];var ce=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ECDSAInvalidSignature",inputs:[]},{type:"error",name:"ECDSAInvalidSignatureLength",inputs:[{type:"uint256",name:"length"}]},{type:"error",name:"ECDSAInvalidSignatureS",inputs:[{type:"bytes32",name:"s"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ExpiredFeeData",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InsufficientBalance",inputs:[]},{type:"error",name:"InvalidFeeRate",inputs:[]},{type:"error",name:"InvalidFeeTier",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"NoRebateToClaim",inputs:[]},{type:"error",name:"NotBrokerSigner",inputs:[{type:"address",name:"signer"}]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"OwnableInvalidOwner",inputs:[{type:"address",name:"owner"}]},{type:"error",name:"OwnableUnauthorizedAccount",inputs:[{type:"address",name:"account"}]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"error",name:"UnsupportedAssetClass",inputs:[{type:"uint8",name:"assetClass"}]},{type:"error",name:"UnsupportedFeeTier",inputs:[{type:"uint8",name:"tier"}]},{type:"event",anonymous:false,name:"BrokerFeesWithdrawn",inputs:[{type:"address",name:"broker",indexed:true},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false},{type:"address",name:"recipient",indexed:false}]},{type:"event",anonymous:false,name:"BrokerStatusUpdated",inputs:[{type:"address",name:"broker",indexed:false},{type:"bool",name:"isActive",indexed:false}]},{type:"event",anonymous:false,name:"EIP712DomainChanged",inputs:[]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"OwnershipTransferStarted",inputs:[{type:"address",name:"previousOwner",indexed:true},{type:"address",name:"newOwner",indexed:true}]},{type:"event",anonymous:false,name:"OwnershipTransferred",inputs:[{type:"address",name:"previousOwner",indexed:true},{type:"address",name:"newOwner",indexed:true}]},{type:"event",anonymous:false,name:"RebateClaimed",inputs:[{type:"address",name:"user",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"SignerUpdated",inputs:[{type:"address",name:"signer",indexed:false},{type:"bool",name:"isSigner",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"FEE_TYPEHASH",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"acceptOwnership",constant:false,payable:false,inputs:[],outputs:[]},{type:"function",name:"activeFeeTiers",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"}],outputs:[{type:"uint256[]"}]},{type:"function",name:"activeSpecialFeeTierList",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"}],outputs:[{type:"uint256[]"}]},{type:"function",name:"addressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"batchSetSpecialFeeTiers",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"},{type:"int32",name:"makerFeeRate"},{type:"uint32",name:"takerFeeRate"}]}],outputs:[]},{type:"function",name:"batchUpdateFeeTiers",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"},{type:"tuple",name:"addOnFeeRate",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}]}],outputs:[]},{type:"function",name:"checkAndResetExpiredTier",constant:false,payable:false,inputs:[{type:"address",name:"user"}],outputs:[]},{type:"function",name:"claimRebate",constant:false,payable:false,inputs:[{type:"address",name:"token"}],outputs:[]},{type:"function",name:"claimRebates",constant:false,payable:false,inputs:[{type:"address[]",name:"tokens"}],outputs:[]},{type:"function",name:"domainSeparatorV4",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"eip712Domain",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes1",name:"fields"},{type:"string",name:"name"},{type:"string",name:"version"},{type:"uint256",name:"chainId"},{type:"address",name:"verifyingContract"},{type:"bytes32",name:"salt"},{type:"uint256[]",name:"extensions"}]},{type:"function",name:"getAddOnFeeTier",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"}],outputs:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]},{type:"function",name:"getBaseFeeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"}],outputs:[{type:"tuple",name:"baseFeeRate",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}]},{type:"function",name:"getSpecialFeeTier",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"}],outputs:[{type:"int32",name:"makerFeeRate"},{type:"uint32",name:"takerFeeRate"}]},{type:"function",name:"getUserFeeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"},{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"}],outputs:[{type:"uint32",name:"takerFeeRate"},{type:"int32",name:"makerFeeRate"},{type:"uint32",name:"baseTakerFeeRate"},{type:"uint32",name:"baseMakerFeeRate"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"_addressManager"},{type:"address",name:"owner"},{type:"string",name:"_brokerName"},{type:"address[]",name:"brokerSigners"},{type:"uint8[]",name:"assetClasses"},{type:"tuple[]",name:"baseFeeRates",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}],outputs:[]},{type:"function",name:"isActive",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"name",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"onBrokerFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"address",name:"token"},{type:"uint256",name:"feeAmount"}],outputs:[{type:"uint256",name:"totalReferralRebate"},{type:"uint256",name:"referrerRebate"},{type:"address",name:"referrer"}]},{type:"function",name:"owner",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"pendingOwner",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"renounceOwnership",constant:false,payable:false,inputs:[],outputs:[]},{type:"function",name:"setSigner",constant:false,payable:false,inputs:[{type:"address",name:"signer"},{type:"bool",name:"isSigner"}],outputs:[]},{type:"function",name:"setSpecialFeeTier",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"},{type:"int32",name:"makerFeeRate"},{type:"uint32",name:"takerFeeRate"}]}],outputs:[]},{type:"function",name:"setUserFeeData",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"address",name:"user"},{type:"uint64",name:"nonce"},{type:"uint64",name:"deadline"},{type:"tuple",name:"feeData",components:[{type:"uint8",name:"tier"},{type:"address",name:"referrer"},{type:"uint32",name:"totalReferralRebatePct"},{type:"uint32",name:"referrerRebatePct"},{type:"uint64",name:"expiry"}]},{type:"bytes",name:"signature"}]}],outputs:[]},{type:"function",name:"setUserSpecialFeeTier",constant:false,payable:false,inputs:[{type:"address",name:"user"},{type:"uint8",name:"feeTier"}],outputs:[]},{type:"function",name:"supportedAssetClasses",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256[]"}]},{type:"function",name:"syncAssetClass",constant:false,payable:false,inputs:[{type:"uint8",name:"assetClass"}],outputs:[]},{type:"function",name:"transferOwnership",constant:false,payable:false,inputs:[{type:"address",name:"newOwner"}],outputs:[]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"updateBaseFeeRates",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"uint8",name:"assetClass"},{type:"bool",name:"isEnable"},{type:"tuple",name:"baseFeeRate",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}]}],outputs:[]},{type:"function",name:"updateBrokerStatus",constant:false,payable:false,inputs:[{type:"bool",name:"active"}],outputs:[]},{type:"function",name:"updateFeeTier",constant:false,payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"},{type:"tuple",name:"feeRate",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}],outputs:[]},{type:"function",name:"updateUserFeeData",constant:false,payable:false,inputs:[{type:"address",name:"user"},{type:"tuple",name:"feeData",components:[{type:"uint8",name:"tier"},{type:"address",name:"referrer"},{type:"uint32",name:"totalReferralRebatePct"},{type:"uint32",name:"referrerRebatePct"},{type:"uint64",name:"expiry"}]}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"userFeeData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"}],outputs:[{type:"uint8",name:"tier"},{type:"address",name:"referrer"},{type:"uint32",name:"totalReferralRebatePct"},{type:"uint32",name:"referrerRebatePct"},{type:"uint64",name:"expiry"}]},{type:"function",name:"userNonces",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"}],outputs:[{type:"uint64",name:"nonce"}]},{type:"function",name:"userRebates",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"rebateAmount"}]},{type:"function",name:"withdrawBrokerFees",constant:false,payable:false,inputs:[{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"address",name:"recipient"}],outputs:[]}];var fe=[{type:"constructor",payable:false,inputs:[]},{type:"error",name:"ERC20InsufficientAllowance",inputs:[{type:"address",name:"spender"},{type:"uint256",name:"allowance"},{type:"uint256",name:"needed"}]},{type:"error",name:"ERC20InsufficientBalance",inputs:[{type:"address",name:"sender"},{type:"uint256",name:"balance"},{type:"uint256",name:"needed"}]},{type:"error",name:"ERC20InvalidApprover",inputs:[{type:"address",name:"approver"}]},{type:"error",name:"ERC20InvalidReceiver",inputs:[{type:"address",name:"receiver"}]},{type:"error",name:"ERC20InvalidSender",inputs:[{type:"address",name:"sender"}]},{type:"error",name:"ERC20InvalidSpender",inputs:[{type:"address",name:"spender"}]},{type:"error",name:"InsufficientBalance",inputs:[{type:"address",name:"account"},{type:"uint256",name:"balance"},{type:"uint256",name:"needed"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"event",anonymous:false,name:"Approval",inputs:[{type:"address",name:"owner",indexed:true},{type:"address",name:"spender",indexed:true},{type:"uint256",name:"value",indexed:false}]},{type:"event",anonymous:false,name:"GenesisShareBurned",inputs:[{type:"address",name:"account",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"GenesisShareMinted",inputs:[{type:"address",name:"account",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"Transfer",inputs:[{type:"address",name:"from",indexed:true},{type:"address",name:"to",indexed:true},{type:"uint256",name:"value",indexed:false}]},{type:"function",name:"addressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"allowance",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"owner"},{type:"address",name:"spender"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",constant:false,payable:false,inputs:[{type:"address",name:"spender"},{type:"uint256",name:"value"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"}],outputs:[{type:"uint256"}]},{type:"function",name:"burnFrom",constant:false,payable:false,inputs:[{type:"address",name:"from"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"decimals",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"_addressManager"},{type:"bytes32",name:"_poolId"},{type:"address",name:"_underlyingToken"},{type:"string",name:"name"},{type:"string",name:"symbol"}],outputs:[]},{type:"function",name:"mint",constant:false,payable:false,inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"name",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"poolId",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"symbol",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalGenesisShare",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"totalSupply",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",constant:false,payable:false,inputs:[{type:"address",name:"to"},{type:"uint256",name:"value"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",constant:false,payable:false,inputs:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"}],outputs:[{type:"bool"}]},{type:"function",name:"underlyingToken",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"userGenesisShare",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"}],outputs:[{type:"uint256"}]}];var be=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"InvalidQuoteTokenAddress",inputs:[]},{type:"error",name:"InvalidRatioParams",inputs:[]},{type:"error",name:"MarketAlreadyExisted",inputs:[]},{type:"error",name:"MarketNotExisted",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"ExecutionFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint256",name:"oldExecutionFee",indexed:false},{type:"uint256",name:"newExecutionFee",indexed:false}]},{type:"event",anonymous:false,name:"ForwardFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint256",name:"oldForwardFee",indexed:false},{type:"uint256",name:"newForwardFee",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"MaxExecutionFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint256",name:"oldMaxExecutionFee",indexed:false},{type:"uint256",name:"newMaxExecutionFee",indexed:false}]},{type:"event",anonymous:false,name:"MaxForwardFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint256",name:"oldMaxForwardFee",indexed:false},{type:"uint256",name:"newMaxForwardFee",indexed:false}]},{type:"event",anonymous:false,name:"OracleFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint64",name:"newOracleFeeUsd",indexed:false}]},{type:"event",anonymous:false,name:"PoolPrimeThresholdUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint128",name:"newPoolPrimeThreshold",indexed:false}]},{type:"event",anonymous:false,name:"ReserveRatioUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint32",name:"newBaseReserveRatio",indexed:false},{type:"uint32",name:"newQuoteReserveRatio",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"createMarket",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"uint64",name:"chainId"},{type:"address",name:"quoteToken"},{type:"uint32",name:"baseReserveRatio"},{type:"uint32",name:"quoteReserveRatio"},{type:"uint64",name:"oracleFeeUsd"},{type:"uint64",name:"boostFeeUsd"},{type:"uint64",name:"boostRefundFeeUsd"},{type:"uint128",name:"poolPrimeThreshold"},{type:"uint128",name:"executionFee"},{type:"uint128",name:"maxExecutionFee"},{type:"uint128",name:"forwardFee"},{type:"uint128",name:"maxForwardFee"}]},{type:"tuple",name:"quoteParams",components:[{type:"address",name:"priceContract"},{type:"bool",name:"applyExchangeRate"},{type:"uint16",name:"minDeviationRatio"}]}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getBoostFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getBoostRefundFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExecutionFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getExecutionFeeByToken",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"quoteToken"}],outputs:[{type:"uint256"}]},{type:"function",name:"getForwardFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getForwardFeeByToken",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"quoteToken"}],outputs:[{type:"uint256"}]},{type:"function",name:"getMarket",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"tuple",components:[{type:"address",name:"quoteToken"},{type:"uint32",name:"baseReserveRatio"},{type:"uint32",name:"quoteReserveRatio"},{type:"uint64",name:"oracleFeeUsd"},{type:"uint64",name:"boostFeeUsd"},{type:"uint64",name:"boostRefundFeeUsd"},{type:"uint128",name:"poolPrimeThreshold"},{type:"uint128",name:"executionFee"},{type:"uint128",name:"maxExecutionFee"},{type:"uint128",name:"forwardFee"},{type:"uint128",name:"maxForwardFee"}]}]},{type:"function",name:"getMarketIds",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32[]"}]},{type:"function",name:"getOracleFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"marketExists",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"bool"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"updateExecutionFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_executionFee"}],outputs:[]},{type:"function",name:"updateForwardFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_forwardFee"}],outputs:[]},{type:"function",name:"updateMarketQuoteConfiguration",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"tuple",name:"quoteParams",components:[{type:"address",name:"priceContract"},{type:"bool",name:"applyExchangeRate"},{type:"uint16",name:"minDeviationRatio"}]}],outputs:[]},{type:"function",name:"updateMaxExecutionFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_maxExecutionFee"}],outputs:[]},{type:"function",name:"updateMaxForwardFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_maxForwardFee"}],outputs:[]},{type:"function",name:"updateOracleFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint64",name:"_oracleFeeUsd"}],outputs:[]},{type:"function",name:"updatePoolPrimeThreshold",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_poolPrimeThreshold"}],outputs:[]},{type:"function",name:"updateReserveRatio",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint32",name:"_baseReserveRatio"},{type:"uint32",name:"_quoteReserveRatio"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var ge=[{type:"error",name:"PositionNotHealthy",inputs:[{type:"bytes32",name:"positionId"},{type:"uint256",name:"marginRatio"}]},{type:"error",name:"SafeCastOverflowedUintToInt",inputs:[{type:"uint256",name:"value"}]},{type:"function",name:"ADDRESS_MANAGER",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getAccountInfo",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"}],outputs:[{type:"tuple",name:"accountInfo",components:[{type:"uint256",name:"freeMargin"},{type:"uint256",name:"walletBalance"},{type:"uint256",name:"freeBaseAmount"},{type:"uint256",name:"baseProfit"},{type:"uint256",name:"quoteProfit"},{type:"uint256",name:"reservedAmount"},{type:"uint64",name:"releaseTime"}]}]},{type:"function",name:"getAvailableLiquiditySize",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint256",name:"executePrice"}],outputs:[{type:"uint256"}]},{type:"function",name:"getBrokerFeeTiers",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"brokerAddress"},{type:"uint8[]",name:"assetClasses"},{type:"uint8[]",name:"riskTiers"},{type:"bool",name:"isMYXBroker"}],outputs:[{type:"tuple[]",name:"brokerFees",components:[{type:"uint8",name:"asset"},{type:"tuple[]",name:"riskTieredBrokerFees",components:[{type:"uint8",name:"riskTier"},{type:"tuple[]",name:"addOnFeeTiers",components:[{type:"uint8",name:"tier"},{type:"uint32",name:"takerFeeRate"},{type:"int32",name:"makerFeeRate"}]},{type:"tuple[]",name:"baseFeeRate",components:[{type:"uint8",name:"assetClass"},{type:"uint32",name:"makerFeeRate"},{type:"uint32",name:"takerFeeRate"}]},{type:"tuple[]",name:"specialFeeTiers",components:[{type:"uint8",name:"tier"},{type:"uint32",name:"takerFeeRate"},{type:"int32",name:"makerFeeRate"}]}]}]}]},{type:"function",name:"getExchangeables",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"uint256[]",name:"marketPrices"}],outputs:[{type:"tuple[]",name:"exchangeables",components:[{type:"uint256",name:"maxBaseIn"},{type:"uint256",name:"maxQuoteIn"},{type:"uint256",name:"maxBaseOut"},{type:"uint256",name:"maxQuoteOut"}]}]},{type:"function",name:"getLiquidationPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"positionId"},{type:"uint256",name:"marketPrice"}],outputs:[{type:"uint256"}]},{type:"function",name:"getPoolInfo",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"marketPrice"}],outputs:[{type:"tuple",components:[{type:"tuple",name:"basePool",components:[{type:"address",name:"poolToken"},{type:"uint256",name:"exchangeRate"},{type:"uint256",name:"poolTokenPrice"},{type:"uint256",name:"poolTokenSupply"},{type:"uint256",name:"totalDebt"},{type:"uint256",name:"baseCollateral"}]},{type:"tuple",name:"quotePool",components:[{type:"address",name:"poolToken"},{type:"uint256",name:"exchangeRate"},{type:"uint256",name:"poolTokenPrice"},{type:"uint256",name:"poolTokenSupply"},{type:"uint256",name:"totalDebt"},{type:"uint256",name:"baseCollateral"}]},{type:"tuple",name:"reserveInfo",components:[{type:"uint256",name:"baseTotalAmount"},{type:"uint256",name:"baseReservedAmount"},{type:"uint256",name:"quoteTotalAmount"},{type:"uint256",name:"quoteReservedAmount"}]},{type:"tuple",name:"fundingInfo",components:[{type:"int256",name:"nextFundingRate"},{type:"int256",name:"lastFundingFeeTracker"},{type:"uint256",name:"nextEpochTime"}]},{type:"tuple",name:"oi",components:[{type:"int256",name:"tracker"},{type:"uint256",name:"longSize"},{type:"uint256",name:"shortSize"},{type:"uint256",name:"poolEntryPrice"}]},{type:"tuple",name:"liquidityInfo",components:[{type:"uint256",name:"windowCaps"},{type:"int256",name:"openInterest"}]}]}]},{type:"function",name:"getPoolInfos",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"uint256[]",name:"marketPrices"}],outputs:[{type:"tuple[]",components:[{type:"tuple",name:"basePool",components:[{type:"address",name:"poolToken"},{type:"uint256",name:"exchangeRate"},{type:"uint256",name:"poolTokenPrice"},{type:"uint256",name:"poolTokenSupply"},{type:"uint256",name:"totalDebt"},{type:"uint256",name:"baseCollateral"}]},{type:"tuple",name:"quotePool",components:[{type:"address",name:"poolToken"},{type:"uint256",name:"exchangeRate"},{type:"uint256",name:"poolTokenPrice"},{type:"uint256",name:"poolTokenSupply"},{type:"uint256",name:"totalDebt"},{type:"uint256",name:"baseCollateral"}]},{type:"tuple",name:"reserveInfo",components:[{type:"uint256",name:"baseTotalAmount"},{type:"uint256",name:"baseReservedAmount"},{type:"uint256",name:"quoteTotalAmount"},{type:"uint256",name:"quoteReservedAmount"}]},{type:"tuple",name:"fundingInfo",components:[{type:"int256",name:"nextFundingRate"},{type:"int256",name:"lastFundingFeeTracker"},{type:"uint256",name:"nextEpochTime"}]},{type:"tuple",name:"oi",components:[{type:"int256",name:"tracker"},{type:"uint256",name:"longSize"},{type:"uint256",name:"shortSize"},{type:"uint256",name:"poolEntryPrice"}]},{type:"tuple",name:"liquidityInfo",components:[{type:"uint256",name:"windowCaps"},{type:"int256",name:"openInterest"}]}]}]},{type:"function",name:"getPoolTokenPrices",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"uint256[]",name:"marketPrices"}],outputs:[{type:"tuple[]",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"basePoolTokenPrice"},{type:"uint256",name:"quotePoolTokenPrice"}]}]},{type:"function",name:"getPositionFees",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"positionId"},{type:"address",name:"broker"},{type:"uint256",name:"price"}],outputs:[{type:"int256",name:"netCollateral"},{type:"uint256",name:"collateralAmount"},{type:"int256",name:"tradingFee"},{type:"int256",name:"fundingFee"},{type:"int256",name:"unrealizedPnl"}]},{type:"function",name:"getRiskParameters",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"maxRiskTier"}],outputs:[{type:"tuple[]",name:"params",components:[{type:"tuple",name:"tradeLimitParams",components:[{type:"uint64",name:"minTradeUsd"},{type:"uint16",name:"maxPriceDeviation"}]},{type:"tuple",name:"riskLockParams",components:[{type:"uint64",name:"windowCapUsd"},{type:"uint64",name:"liquidityWindowSize"},{type:"uint64",name:"profitWindowSize"},{type:"uint16",name:"priceRangePct"},{type:"uint32",name:"baseSlippage"}]},{type:"tuple",name:"poolConfigParams",components:[{type:"uint16",name:"leverage"},{type:"uint16",name:"maintainMarginRate"},{type:"uint16",name:"baseTokenCollateralRatio"},{type:"uint16",name:"exchangeIncentiveRate"},{type:"uint16",name:"genesisRebateRatio"},{type:"uint8",name:"assetClass"}]},{type:"tuple",name:"fundingRateParams",components:[{type:"int32",name:"maxRate"},{type:"uint32",name:"equilibriumRange"},{type:"int32",name:"lowGrowthRate"},{type:"int32",name:"highGrowthRate"},{type:"uint32",name:"epochDuration"}]}]}]},{type:"function",name:"getSumProfitLock",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address[]",name:"respondents"}],outputs:[{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"},{type:"tuple[]",name:"infos",components:[{type:"address",name:"account"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}]}]},{type:"function",name:"getUserPositionInfos",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"},{type:"bytes32[]",name:"poolIds"}],outputs:[{type:"tuple[]",name:"positions",components:[{type:"bytes32",name:"positionId"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"size"},{type:"uint256",name:"entryPrice"},{type:"int256",name:"fundingRateIndex"},{type:"uint256",name:"earlyClosePrice"},{type:"uint8",name:"direction"},{type:"uint8",name:"riskTier"},{type:"uint64",name:"lastUpdateTime"},{type:"uint256",name:"collateralAmount"}]}]}];var Ie=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ERC2771ForwarderExpiredRequest",inputs:[{type:"uint48",name:"deadline"}]},{type:"error",name:"ERC2771ForwarderInvalidSigner",inputs:[{type:"address",name:"signer"},{type:"address",name:"from"}]},{type:"error",name:"ERC2771ForwarderMismatchedValue",inputs:[{type:"uint256",name:"requestedValue"},{type:"uint256",name:"msgValue"}]},{type:"error",name:"ERC2771UntrustfulTarget",inputs:[{type:"address",name:"target"},{type:"address",name:"forwarder"}]},{type:"error",name:"ExceedsMaximumRelayFee",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InconsistentParamsLength",inputs:[]},{type:"error",name:"InsufficientBalance",inputs:[{type:"uint256",name:"balance"},{type:"uint256",name:"needed"}]},{type:"error",name:"InsufficientFeeAllowance",inputs:[{type:"address",name:"user"},{type:"uint256",name:"allowance"},{type:"uint256",name:"required"}]},{type:"error",name:"InsufficientFeeBalance",inputs:[{type:"address",name:"user"},{type:"uint256",name:"balance"},{type:"uint256",name:"required"}]},{type:"error",name:"InvalidAccountNonce",inputs:[{type:"address",name:"account"},{type:"uint256",name:"currentNonce"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"MismatchExecuteFee",inputs:[{type:"uint256",name:"balanceBefore"},{type:"uint256",name:"balanceAfter"},{type:"uint256",name:"expected"}]},{type:"error",name:"MismatchedSender",inputs:[{type:"address",name:"sender"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotAllowedTarget",inputs:[{type:"address",name:"target"}]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"OnlyRelayer",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"RelayerRegistered",inputs:[{type:"address",name:"relayer"}]},{type:"error",name:"RemoveRelayerFailed",inputs:[]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"AddAllowedTarget",inputs:[{type:"address",name:"target",indexed:false}]},{type:"event",anonymous:false,name:"ChargeForwardFee",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"feeToken",indexed:false},{type:"uint256",name:"relayFee",indexed:false}]},{type:"event",anonymous:false,name:"EIP712DomainChanged",inputs:[]},{type:"event",anonymous:false,name:"ERC20PermitFailed",inputs:[{type:"address",name:"token",indexed:false},{type:"string",name:"reason",indexed:false}]},{type:"event",anonymous:false,name:"ERC20PermitLowLevelFailed",inputs:[{type:"bytes",name:"data",indexed:false}]},{type:"event",anonymous:false,name:"ExecutedForwardRequest",inputs:[{type:"address",name:"signer",indexed:true},{type:"uint256",name:"nonce",indexed:false},{type:"bool",name:"success",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"RemoveAllowedTarget",inputs:[{type:"address",name:"target",indexed:false}]},{type:"event",anonymous:false,name:"SetUserRelayer",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"relayer",indexed:false},{type:"bool",name:"enable",indexed:false}]},{type:"event",anonymous:false,name:"UpdateAcquiescentFeeToken",inputs:[{type:"address",name:"sender",indexed:false},{type:"address",name:"oldRelayGas",indexed:false},{type:"address",name:"newRelayGas",indexed:false}]},{type:"event",anonymous:false,name:"UpdateEquilibriumGas",inputs:[{type:"address",name:"sender",indexed:false},{type:"uint256",name:"oldRelayGas",indexed:false},{type:"uint256",name:"newRelayGas",indexed:false}]},{type:"event",anonymous:false,name:"UpdateMaxRelayFee",inputs:[{type:"address",name:"sender",indexed:false},{type:"uint256",name:"oldMaxRelayFee",indexed:false},{type:"uint256",name:"newMaxRelayFee",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"addAllowedTarget",constant:false,payable:false,inputs:[{type:"address",name:"target"}],outputs:[]},{type:"function",name:"batchExecuteForwarder",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"forwardFeeToken"},{type:"tuple[]",name:"bundleParams",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]}],outputs:[]},{type:"function",name:"eip712Domain",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes1",name:"fields"},{type:"string",name:"name"},{type:"string",name:"version"},{type:"uint256",name:"chainId"},{type:"address",name:"verifyingContract"},{type:"bytes32",name:"salt"},{type:"uint256[]",name:"extensions"}]},{type:"function",name:"equilibriumGas",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"execute",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]},{type:"address"}],outputs:[]},{type:"function",name:"executeBatch",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple[]",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]},{type:"address"},{type:"address"}],outputs:[]},{type:"function",name:"executeForwarder",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"forwardFeeToken"},{type:"tuple",name:"params",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]}],outputs:[]},{type:"function",name:"exitForwardMode",constant:false,payable:false,inputs:[],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getAllowedTargets",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address[]"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getDesignatedToken",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getEquilibriumGas",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getUserRelayers",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"}],outputs:[{type:"address[]"}]},{type:"function",name:"inForwardMode",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"},{type:"uint256",name:"_equilibriumGas"}],outputs:[]},{type:"function",name:"isAllowedTargets",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"contractAddr"}],outputs:[{type:"bool"}]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"isUserRelayerEnabled",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"},{type:"address",name:"relayer"}],outputs:[{type:"bool"}]},{type:"function",name:"nonces",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"owner"}],outputs:[{type:"uint256"}]},{type:"function",name:"originAccount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"relayer"}],outputs:[{type:"address",name:"account"}]},{type:"function",name:"permitAndApproveForwarder",constant:false,payable:false,inputs:[{type:"address",name:"relayer"},{type:"bool",name:"enable"},{type:"tuple[]",name:"permitParams",components:[{type:"address",name:"token"},{type:"address",name:"owner"},{type:"address",name:"spender"},{type:"uint256",name:"value"},{type:"uint256",name:"deadline"},{type:"uint8",name:"v"},{type:"bytes32",name:"r"},{type:"bytes32",name:"s"}]}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"removeAllowedTarget",constant:false,payable:false,inputs:[{type:"address",name:"target"}],outputs:[]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"updateEquilibriumGas",constant:false,payable:false,inputs:[{type:"uint256",name:"_equilibriumGas"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"verify",constant:true,stateMutability:"view",payable:false,inputs:[{type:"tuple",name:"request",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]}],outputs:[{type:"bool"}]}];var xe=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"AlreadyClaimed",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"user"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidAmount",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"user"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"MerkleTreeVerificationFailed",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"user"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReimbursementValidity",inputs:[{type:"uint256",name:"caseId"}]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"TreeAlreadySet",inputs:[]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementClaimExpired",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"user",indexed:false},{type:"address",name:"baseToken",indexed:false},{type:"address",name:"quoteToken",indexed:false},{type:"uint256",name:"baseAmount",indexed:false},{type:"uint256",name:"quoteAmount",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementClaimed",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"user",indexed:false},{type:"address",name:"baseToken",indexed:false},{type:"address",name:"quoteToken",indexed:false},{type:"uint256",name:"baseAmount",indexed:false},{type:"uint256",name:"quoteAmount",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementInfoSet",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"bytes32",name:"merkleRoot",indexed:false},{type:"address",name:"baseToken",indexed:false},{type:"address",name:"quoteToken",indexed:false},{type:"uint256",name:"totalBaseAmount",indexed:false},{type:"uint256",name:"totalQuoteAmount",indexed:false},{type:"uint256",name:"claimedBaseAmount",indexed:false},{type:"uint256",name:"claimedQuoteAmount",indexed:false},{type:"uint256",name:"expireTime",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"claimExpiredCases",constant:false,payable:false,inputs:[{type:"uint256[]",name:"caseIds"},{type:"address",name:"receiver"}],outputs:[]},{type:"function",name:"claimReimbursement",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"},{type:"bytes32[]",name:"merkleProof"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getReimbursementInfo",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"merkleRoot"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"},{type:"uint256",name:"claimedBaseAmount"},{type:"uint256",name:"claimedQuoteAmount"},{type:"uint256",name:"expireTime"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"setReimbursementInfo",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"tuple",name:"reimbursementInfo",components:[{type:"bytes32",name:"merkleRoot"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"},{type:"uint256",name:"claimedBaseAmount"},{type:"uint256",name:"claimedQuoteAmount"},{type:"uint256",name:"expireTime"}]},{type:"bytes32[]",name:"zeroMerkleProof"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var Ae=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"BondNotReleased",inputs:[]},{type:"error",name:"BondZeroAmount",inputs:[]},{type:"error",name:"CaseAppealNotFinished",inputs:[]},{type:"error",name:"CaseDeadlineNotReached",inputs:[]},{type:"error",name:"CaseDeadlineReached",inputs:[]},{type:"error",name:"CaseNotAccepted",inputs:[]},{type:"error",name:"CaseNotExist",inputs:[{type:"uint256",name:"caseId"}]},{type:"error",name:"CaseRespondentAppealed",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"respondent"}]},{type:"error",name:"DisputeNotAllowed",inputs:[]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"InvalidPoolToken",inputs:[]},{type:"error",name:"InvalidProfitAmount",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotCaseRespondent",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"respondent"}]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"OnlyRelayer",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"RiskCloseNotCompleted",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"error",name:"UnexpectedCaseState",inputs:[]},{type:"error",name:"UnexpectedCaseType",inputs:[]},{type:"event",anonymous:false,name:"AppealCanceled",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"appealCaseId",indexed:false},{type:"address",name:"complainant",indexed:false},{type:"bool",name:"isMalicious",indexed:false}]},{type:"event",anonymous:false,name:"AppealFiled",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"appealCaseId",indexed:false},{type:"address",name:"respondent",indexed:false},{type:"address",name:"appealToken",indexed:false},{type:"uint256",name:"appealBond",indexed:false},{type:"uint64",name:"appealDeadline",indexed:false}]},{type:"event",anonymous:false,name:"AppealResolved",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"appealCaseId",indexed:false},{type:"uint8",name:"resolution",indexed:false},{type:"address",name:"complainant",indexed:false}]},{type:"event",anonymous:false,name:"BondClaimed",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"user",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"CaseAppealsResolved",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"remaining",indexed:false}]},{type:"event",anonymous:false,name:"CaseRiskClosed",inputs:[{type:"uint256",name:"caseId",indexed:false}]},{type:"event",anonymous:false,name:"DisputeCanceled",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"complainant",indexed:false},{type:"bool",name:"isMalicious",indexed:false}]},{type:"event",anonymous:false,name:"DisputeConfigurationUpdated",inputs:[{type:"tuple",name:"newDisputeConfigration",indexed:false,components:[{type:"address",name:"appealToken"},{type:"uint64",name:"disputeBondUsd"},{type:"uint64",name:"appealBondUsd"},{type:"uint64",name:"disputeThresholdUsd"},{type:"uint64",name:"caseDuration"},{type:"uint64",name:"voteDuration"},{type:"uint64",name:"resolveDuration"}]}]},{type:"event",anonymous:false,name:"DisputeFiled",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"bytes32",name:"poolId",indexed:false},{type:"address",name:"complainant",indexed:false},{type:"address",name:"poolToken",indexed:false},{type:"uint256",name:"disputeBond",indexed:false},{type:"uint64",name:"caseDeadline",indexed:false}]},{type:"event",anonymous:false,name:"DisputeResolved",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint8",name:"resolution",indexed:false},{type:"uint64",name:"appealDeadline",indexed:false}]},{type:"event",anonymous:false,name:"ForfeitBondsClaimed",inputs:[{type:"address",name:"receiver",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementProcessed",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"tuple",name:"reimbursementInfo",indexed:false,components:[{type:"bytes32",name:"merkleRoot"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"},{type:"uint256",name:"claimedBaseAmount"},{type:"uint256",name:"claimedQuoteAmount"},{type:"uint256",name:"expireTime"}]}]},{type:"event",anonymous:false,name:"ReimbursementVoteOpened",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"bytes32",name:"merkleRoot",indexed:false},{type:"uint256",name:"totalBaseAmount",indexed:false},{type:"uint256",name:"totalQuoteAmount",indexed:false},{type:"uint64",name:"voteDeadline",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementVoteRejected",inputs:[{type:"uint256",name:"caseId",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementVoteSubmitted",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"validator",indexed:false},{type:"uint8",name:"voteOption",indexed:false}]},{type:"event",anonymous:false,name:"RelayerAdded",inputs:[{type:"address",name:"relayer",indexed:false}]},{type:"event",anonymous:false,name:"RelayerRemoved",inputs:[{type:"address",name:"relayer",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"event",anonymous:false,name:"Voted",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"voter",indexed:false},{type:"uint8",name:"voteOption",indexed:false}]},{type:"event",anonymous:false,name:"VotingOpened",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"evidenceId",indexed:false},{type:"uint64",name:"voteDeadline",indexed:false},{type:"address[]",name:"respondents",indexed:false}]},{type:"event",anonymous:false,name:"WormholeConfigurationUpdated",inputs:[{type:"tuple",name:"newWormholeConfiguration",indexed:false,components:[{type:"address",name:"wormhole"},{type:"address",name:"validatorView"},{type:"uint32",name:"maxAge"},{type:"bytes4",name:"selector"}]}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"addRelayers",constant:false,payable:false,inputs:[{type:"address[]",name:"relayers"}],outputs:[]},{type:"function",name:"appeal",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[]},{type:"function",name:"canRiskControlClose",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[{type:"bool"}]},{type:"function",name:"cancelAppeal",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"uint256",name:"appealCaseId"},{type:"bool",name:"isMalicious"}],outputs:[]},{type:"function",name:"cancelDispute",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"bool",name:"isMalicious"}],outputs:[]},{type:"function",name:"caseIdSequencer",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"checkRiskControlCloseCompleted",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[]},{type:"function",name:"claimBond",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[]},{type:"function",name:"claimForfeitBonds",constant:false,payable:false,inputs:[{type:"address",name:"receiver"}],outputs:[]},{type:"function",name:"fileDispute",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"poolToken"}],outputs:[]},{type:"function",name:"fileDisputeFromStaker",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getDisputeConfiguration",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"tuple",components:[{type:"address",name:"appealToken"},{type:"uint64",name:"disputeBondUsd"},{type:"uint64",name:"appealBondUsd"},{type:"uint64",name:"disputeThresholdUsd"},{type:"uint64",name:"caseDuration"},{type:"uint64",name:"voteDuration"},{type:"uint64",name:"resolveDuration"}]},{type:"uint32"},{type:"uint32"}]},{type:"function",name:"getRelayers",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address[]"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isCaseRespondents",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"account"}],outputs:[{type:"bool"}]},{type:"function",name:"openReimbursementVote",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"bytes32",name:"merkleRoot"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"}],outputs:[]},{type:"function",name:"openVoting",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"uint256",name:"evidenceId"},{type:"address[]",name:"respondents"}],outputs:[]},{type:"function",name:"processReimbursement",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"tuple",name:"reimbursementInfo",components:[{type:"bytes32",name:"merkleRoot"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"},{type:"uint256",name:"claimedBaseAmount"},{type:"uint256",name:"claimedQuoteAmount"},{type:"uint256",name:"expireTime"}]},{type:"bytes32[]",name:"zeroMerkleProof"}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"removeRelayers",constant:false,payable:false,inputs:[{type:"address[]",name:"relayers"}],outputs:[]},{type:"function",name:"resolveCaseAppeals",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"uint256",name:"limit"}],outputs:[]},{type:"function",name:"resolveDispute",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[]},{type:"function",name:"updateDisputeConfiguration",constant:false,payable:false,inputs:[{type:"tuple",name:"disputeConfiguration",components:[{type:"address",name:"appealToken"},{type:"uint64",name:"disputeBondUsd"},{type:"uint64",name:"appealBondUsd"},{type:"uint64",name:"disputeThresholdUsd"},{type:"uint64",name:"caseDuration"},{type:"uint64",name:"voteDuration"},{type:"uint64",name:"resolveDuration"}]},{type:"uint32",name:"voteCountRate"},{type:"uint32",name:"effectiveVoteRate"}],outputs:[]},{type:"function",name:"updateWormholeConfiguration",constant:false,payable:false,inputs:[{type:"tuple",name:"wormholeConfiguration",components:[{type:"address",name:"wormhole"},{type:"address",name:"validatorView"},{type:"uint32",name:"maxAge"},{type:"bytes4",name:"selector"}]}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"vote",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"validator"},{type:"uint8",name:"voteOption"},{type:"uint256",name:"deadline"},{type:"uint8",name:"v"},{type:"bytes32",name:"r"},{type:"bytes32",name:"s"}],outputs:[]},{type:"function",name:"voteReimbursement",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"validator"},{type:"uint8",name:"voteOption"},{type:"uint256",name:"deadline"},{type:"uint8",name:"v"},{type:"bytes32",name:"r"},{type:"bytes32",name:"s"}],outputs:[]}];var ot=[{type:"error",name:"AccountInsufficientFreeAmount",inputs:[]},{type:"error",name:"AccountInsufficientReservedAmount",inputs:[]},{type:"error",name:"AccountInsufficientTradableAmount",inputs:[{type:"uint256",name:"accountTradableAmount"},{type:"uint256",name:"requiredTradableAmount"}]},{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"DepositToAccount",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"ExecuteCompensation",inputs:[{type:"bytes32",name:"poolId",indexed:false},{type:"uint256",name:"baseAmount",indexed:false},{type:"uint256",name:"quoteAmount",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"PayWithPrincipal",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"receiver",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"PayWithProfitFirst",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"receiver",indexed:false},{type:"bytes32",name:"poolId",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"usedFreeAmount",indexed:false},{type:"uint256",name:"usedRestrictedAmount",indexed:false}]},{type:"event",anonymous:false,name:"ReleaseForOrder",inputs:[{type:"bytes32",name:"poolId",indexed:false},{type:"uint256",name:"orderId",indexed:false},{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"ReleaseProfit",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"ReserveForOrder",inputs:[{type:"bytes32",name:"poolId",indexed:false},{type:"uint256",name:"orderId",indexed:false},{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"SettleToAccount",inputs:[{type:"address",name:"account",indexed:false},{type:"bytes32",name:"positionId",indexed:false},{type:"address",name:"baseToken",indexed:false},{type:"address",name:"quoteToken",indexed:false},{type:"uint256",name:"freeBase",indexed:false},{type:"uint256",name:"profitBase",indexed:false},{type:"uint256",name:"freeAmount",indexed:false},{type:"uint256",name:"profitAmount",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"event",anonymous:false,name:"WithdrawFromAccount",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"deposit",constant:false,payable:false,inputs:[{type:"address",name:"account"},{type:"address",name:"token"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"executeCompensation",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"reimbursement"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getPoolWithdrawableBaseToken",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"},{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"baseAmount"}]},{type:"function",name:"getTradableAmount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"},{type:"bytes32",name:"poolId"}],outputs:[{type:"bool"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},{type:"function",name:"getUserAsset",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"amount"}]},{type:"function",name:"getUserAssets",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"}],outputs:[{type:"tuple[]",components:[{type:"address",name:"asset"},{type:"uint256",name:"amount"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"payWithPrincipal",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"account"},{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"address",name:"receiver"}],outputs:[]},{type:"function",name:"payWithProfitFirst",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"orderId"},{type:"address",name:"account"},{type:"address",name:"token"},{type:"uint256",name:"amount"}],outputs:[{type:"uint256",name:"usedFreeAmount"},{type:"uint256",name:"usedRestrictedAmount"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"releaseForCancelOrder",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"orderId"},{type:"address",name:"account"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"releaseFromProfitUnlock",constant:false,payable:false,inputs:[{type:"address",name:"account"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"reserveForOrder",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"orderId"},{type:"address",name:"account"},{type:"address",name:"token"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"settlementDeposit",constant:false,payable:false,inputs:[{type:"bytes32",name:"positionId"},{type:"address",name:"account"},{type:"tuple",name:"pool",components:[{type:"bytes32",name:"marketId"},{type:"bytes32",name:"poolId"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"state"},{type:"address",name:"basePoolToken"},{type:"address",name:"quotePoolToken"},{type:"uint16",name:"maxPriceDeviation"},{type:"bool",name:"compoundEnabled"},{type:"uint64",name:"windowCapUsd"},{type:"address",name:"poolVault"},{type:"address",name:"tradingVault"}]},{type:"uint256",name:"freeBaseAmount"},{type:"uint256",name:"freeQuoteAmount"},{type:"uint256",name:"receivedBaseAmount"},{type:"uint256",name:"receivedQuoteAmount"}],outputs:[]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"updateAndWithdraw",constant:false,payable:false,inputs:[{type:"address",name:"receiver"},{type:"bytes32",name:"poolId"},{type:"bool",name:"isQuoteToken"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var rt={USDC:"0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",POOL_MANAGER:"0xb394948BC6c5d13189440Bd44E481f7833d29694",Account:"0x3edb8F5838603f70896d37233AD7F618D024c351",POSITION_MANAGER:"0xb8fAf2037788594e1BD27F1905A6eF090A5857ad",ORDER_MANAGER:"0xC016fD1b62A22991aa7085D4F7851C35e45d1B1b",PYTH:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",ERC20:"0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",LIQUIDITY_ROUTER:"0xD375b2096602D613725E465c9a83e2C078B0273E",BASE_POOL:"0x2e217CB7e52cFca09132aDf4b12a04F4a9aB79E7",QUOTE_POOL:"0xBD8559b42aCd1c86b5Bf32e9858b559d3b71D94f",ORACLE:"0xFe2a1b4b799310e77F6F0aB2Ea40d2Ea7f9D9FFC",EIP7702Delegation:"0x7823b642DA17419717A8362B035E8a951110152E",MARKET_MANAGER:"0xf7810B57cb9A54fa751A4d82C4AeC4e2518CEb23",DATA_PROVIDER:"0x5B23C37A89f7F631D1cbA333545ad6Dce7B0da9E",ORACLE_RESERVE:"0x4Ffaf942B6d678Ca65001Fe87A30A0019393a2eE",FORWARDER:"0x5793932070EDeb981128650Aed7178F9B2F05690",TRADING_ROUTER:"0xA2cF15a8c3788802060F7d68cf888B28dA962b08",REIMBURSEMENT:"0xB26B967964498a1db1a77d3Aa62080D0B2dBff9e",DISPUTE_COURT:"0x62b6a26ae299cF31d01A77DAde7E5b39CC4A1eB0",EXECUTION_POOL:"0xBe0376091a2527690f1391358f4307f23b568ffB"};var it={USDC:"0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",POOL_MANAGER:"0x05314a21Fc97B74f168730153b2B63A870D25dE5",Account:"0xAC0ca67fd6C7Ff9c80DE58420B840115b6d51c6e",POSITION_MANAGER:"0x1a8cC8391Ee19c3817de64a52904D0557f519bA5",ORDER_MANAGER:"0x3138f425f11f14fE33a180e9Bbf0661C8dc6d8AD",PYTH:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",ERC20:"0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",LIQUIDITY_ROUTER:"0xfb790ECE13Cd9e296b4a06ABF38D10431360c236",BASE_POOL:"0x1F767BEa83EDe5E0C18904f439C579f52c2c0F1b",QUOTE_POOL:"0x50ad7da312c58c6689bEF028954a366cb5b8ee13",ORACLE:"0x3e437094C5687Ed6eDb1883b0bd445Efa9103a55",EIP7702Delegation:"0xc68fdf81ca68B26fdB296645F42a734c12E63751",MARKET_MANAGER:"0x71b57CcB7539aB761fd5C5767362A207a295e337",DATA_PROVIDER:"0xd4FdE3cc72D29b71507823cA43Dd6fD520644E92",ORACLE_RESERVE:"0x4fC26Cf34e5d486BFF211315bf17D77d34130971",FORWARDER:"0x58fb1a663b08871A755734231C387E1d10ac2B10",TRADING_ROUTER:"0x89ba8EDBD63f577cAA1095F25Df0A44A226f28bc",REIMBURSEMENT:"0xDbCe02B080C68671EF6EcEc1a01A789441A3a564",DISPUTE_COURT:"0x47648D171925a69b3A334898AaaE6e7cc41B1735",EXECUTION_POOL:"0x0000000000000000000000000000000000000000"};var pt={USDC:"0xD984fd34f91F92DA0586e1bE82E262fF27DC431b",POOL_MANAGER:"0x79412588c9dC5022f04b989595bd8e96Fd58A5fa",Account:"0x37C7B6ED8129312Ed51c9ee2CBd162F2096816c0",POSITION_MANAGER:"0x7d56F5ac970873741Ec29b95e48b8216574338Aa",ORDER_MANAGER:"0xc31d5b922eE6A6B829D2ad214bA5edC225401942",PYTH:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",ERC20:"0xD984fd34f91F92DA0586e1bE82E262fF27DC431b",LIQUIDITY_ROUTER:"0x248F77f2E55Dd14715c5f35F4327Bb5feDB39B2B",BASE_POOL:"0x2c04502Fc87D55cBF91FD8aC32D5197c0FD54c13",QUOTE_POOL:"0x4bdB9C8B96e4cf8c7C1CcC05c2607ba781f49eeF",ORACLE:"0x05ff1e3E1bd8ac4142085446e6705Cb791D77CF9",EIP7702Delegation:"0x7e3d707599aee82C06435F8338A9548f57fAa28e",MARKET_MANAGER:"0x9D0e83123AB97E93b3810913462746c7A4815b5E",DATA_PROVIDER:"0xf80999c3bB3C67c06bb0Bc917B430f9f79c51A7B",ORACLE_RESERVE:"0x666A9CD9920e0D751198b17c02B6eA0b620A3de0",FORWARDER:"0x45cc7768bb3D9242E5E9C63D7eb41Db3B4B32066",TRADING_ROUTER:"0x5dAea62F75fB4192Ec96Ec721895Bdbe12b47Cbe",REIMBURSEMENT:"0xd1a496A628a48bd56d465b99f8600F3FAcc40a35",DISPUTE_COURT:"0x7f17EF3779BbE5671Ad9b4Bb73C0849CbaC34e11",EXECUTION_POOL:"0xeFf66e22e573146c809BA5d88ad7B12D4d33cFb2"};var ut={POOL_MANAGER:"0xcf51a6895864c6D8E507fC31EF16b9011287c5f4",Account:"0x35054EfE58Bbdae792aeCaD7bC2e4939c169560f",POSITION_MANAGER:"0x689A0C7E46785584FF7636700ceF5d5e7c141F8D",ORDER_MANAGER:"0xa0B5E5AE9D3E214096C90DDeC04D39B27ED9B272",PYTH:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",ERC20:"0xD984fd34f91F92DA0586e1bE82E262fF27DC431b",LIQUIDITY_ROUTER:"0x0AE31989318565620c03d35889a0B2536b8fba5C",BASE_POOL:"0xc9e3826c42183207B418116A16827C1605132c51",QUOTE_POOL:"0x9A9934D3b22103dE822d94A22A3177d728FE0e5a",ORACLE:"0x0dD8293765358cF7f2646D0B91bA59804E197FC6",EIP7702Delegation:"0x4686F8a0d44b056037b2A51c4342EE7FA8e0A48F",MARKET_MANAGER:"0xe99dAB65c5546D7C87850Bbc40C6a7BEd7328Efa",DATA_PROVIDER:"0x5b6Be9839552a49302d552aB3C223b60Adb8BF1D",ORACLE_RESERVE:"0xB3D5a67223905FE73a0749e7A03525838063C54C",USDC:"0xD984fd34f91F92DA0586e1bE82E262fF27DC431b",FORWARDER:"0x6C40462A4d45BA4119af59Fb9e41b8eaC9293962",TRADING_ROUTER:"0x0000000000000000000000000000000000000000",REIMBURSEMENT:"0x0000000000000000000000000000000000000000",DISPUTE_COURT:"0x0000000000000000000000000000000000000000",EXECUTION_POOL:"0x0000000000000000000000000000000000000000"};var mt={USDC:"0x9C452Ef0e7b158F81A0e00a81aaea8ae04132cBc",POOL_MANAGER:"0x48855b7c2168D38F029E3fdb3Bc96C8f35Bab955",Account:"0xB6BFE4cC301718AA5d3C2a3ccac52Ff9C5b7E20E",POSITION_MANAGER:"0xb5fa0Bde66D892f1451CD298A6f9a7a7e39409b0",ORDER_MANAGER:"0xdbC710cD74737d4Dd08E637177c475665273a798",PYTH:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",ERC20:"0x9C452Ef0e7b158F81A0e00a81aaea8ae04132cBc",LIQUIDITY_ROUTER:"0x42E93f7dC6eA3e35b87529d2e0fc2deda7D4De85",BASE_POOL:"0x7553AA06c47E94F43128dC99e4FF83FB05304B8c",QUOTE_POOL:"0x573933e9e3299Ef4DB0f8207037BB4010C8728DD",ORACLE:"0x9aaE414d63ee3f52c8bFfB68175497c3Bf837272",EIP7702Delegation:"0x415f1bFf28023888B54E757eF9Ff0292ae309c6A",MARKET_MANAGER:"0xdA9D9Bf96466c1F4e4CF3D5667CF160834b46da8",DATA_PROVIDER:"0xe6C8e5F948BB33B78c157A995F48008c0bF7CcF1",ORACLE_RESERVE:"0xE7147190274E1175610D8e0e3CC5E8bb8670d148",FORWARDER:"0xDeA7223732f9Aa1740A94409633A65D45AA3571A",TRADING_ROUTER:"0xe3d6eEAF463ece18a57b2D5BbE7Bd7fF2836C4c4",REIMBURSEMENT:"0x53656983Bb07987729e1DA65bad53bCc9E618589",DISPUTE_COURT:"0xF4f535b61600735C6786e04A2a307B515C66f05B",EXECUTION_POOL:"0x8c284F005622DC553835f30041b10b2fAfE054a3"};var dt={USDC:"0xe944d7c0f7005a76E898Ee3B9Ec10479EbA9Cc02",POOL_MANAGER:"0x9E84a999e15CCdb2F64a5AF10939c25769dF6b07",Account:"0x42A1BC012CeC51Ebf3bbf79142bf2a912396FB0e",POSITION_MANAGER:"0x011a25Fe39b2f9033E49d1587CF24780242e40dA",ORDER_MANAGER:"0xfc30D3C858B72a9EDfE6679Fc3355039D276f811",PYTH:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",ERC20:"0xe944d7c0f7005a76E898Ee3B9Ec10479EbA9Cc02",LIQUIDITY_ROUTER:"0x0F4C6f18Fb136DD1eBd6Da3C5d86a86597CF79a3",BASE_POOL:"0x51B62554a76197d5DF2D5dC4D57FF54d40775938",QUOTE_POOL:"0x783Ed065a12e1C1D33c2a8d6408385C1843D3084",ORACLE:"0xaF26d69BC0A6f1DEf8AeB00B6DAD28398ba67a53",EIP7702Delegation:"0xc8558cD3905F273ff45B1dd6D10894445bFa622f",MARKET_MANAGER:"0x3b809daB550f9DD0DbE82567f6EA6137C174532c",DATA_PROVIDER:"0x4B5888025570934cC9D31807feBAAEDaC823Cb8e",ORACLE_RESERVE:"0x3011dA5822c1ECA7fcda64716779769D0089945D",FORWARDER:"0x2943a063ae2A772f4314FaA28E00De827A491Dd3",TRADING_ROUTER:"0xaA16801F36e49cDD4f87938032487C7E6cfbb389",REIMBURSEMENT:"0xBF72B69bA547D0bB7D1255B43Ff5D7f2615326dF",DISPUTE_COURT:"0xeD8B129a5919c45c7391AA73632eA691A471C672",EXECUTION_POOL:"0x0000000000000000000000000000000000000000"};var Z=_n__default.default(),Bn=(t,e)=>e?(e=JSON.parse(JSON.stringify(e)),t.includes("?")?t+"&"+new URLSearchParams(e).toString():t+"?"+new URLSearchParams(e).toString()):t,B={get:(t,e,n={})=>{let a=Bn(t,e);return Z.url(a).options(n).get().json()},post:(t,e,n={})=>Z.url(t).options(n).post(e).json(),put:(t,e,n={})=>Z.url(t).options(n).put(e).json(),delete:(t,e={})=>Z.url(t).options(e).delete().json()};var Un=(p=>(p[p.SUCCESS=9200]="SUCCESS",p[p.SUCCESS_ORIGIN=0]="SUCCESS_ORIGIN",p[p.IDENTITY_VERIFICATION_FAILED=9401]="IDENTITY_VERIFICATION_FAILED",p[p.PERMISSION_DENIED=9403]="PERMISSION_DENIED",p[p.NOT_EXIST=9404]="NOT_EXIST",p[p.REQUEST_LIMIT=9429]="REQUEST_LIMIT",p[p.SERVICE_ERROR=9500]="SERVICE_ERROR",p[p.MISS_REQUESTED_PARAMETER=9900]="MISS_REQUESTED_PARAMETER",p[p.INVALID_PARAMETER=9901]="INVALID_PARAMETER",p.NETWORK_ERROR="ERR_NETWORK",p))(Un||{}),Ln=(o=>(o[o.Cook=0]="Cook",o[o.Boosted=1]="Boosted",o[o.Primed=2]="Primed",o[o.Trench=3]="Trench",o[o.PreBench=4]="PreBench",o[o.Bench=5]="Bench",o))(Ln||{}),lt=(n=>(n[n.Chainlink=1]="Chainlink",n[n.Pyth=2]="Pyth",n))(lt||{}),qn=(i=>(i[i.Minute1=1]="Minute1",i[i.Minute5=5]="Minute5",i[i.Minute15=15]="Minute15",i[i.Minute30=30]="Minute30",i[i.Hour1=60]="Hour1",i[i.Hour4=240]="Hour4",i[i.Day1=1440]="Day1",i[i.Week1=10080]="Week1",i[i.Month1=40320]="Month1",i))(qn||{}),Gn=(s=>(s[s.Contract=1]="Contract",s[s.Cook=2]="Cook",s[s.Earn=3]="Earn",s[s.Cooking=4]="Cooking",s))(Gn||{}),zn=(r=>(r[r.All=0]="All",r[r.Contract=1]="Contract",r[r.Cook=2]="Cook",r[r.Earn=3]="Earn",r[r.Cooking=4]="Cooking",r))(zn||{}),Vn=(n=>(n[n.BlueChips=1]="BlueChips",n[n.Alpha=2]="Alpha",n))(Vn||{}),Wn=(a=>(a[a.BlueChips=1]="BlueChips",a[a.Alpha=2]="Alpha",a[a.Favorite=3]="Favorite",a))(Wn||{});var Qn=(s=>(s[s.Market=0]="Market",s[s.Limit=1]="Limit",s[s.Stop=2]="Stop",s[s.Conditional=3]="Conditional",s))(Qn||{}),Hn=(n=>(n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease",n))(Hn||{}),Jn=(y=>(y[y.Increase=0]="Increase",y[y.Decrease=1]="Decrease",y[y.AddMargin=2]="AddMargin",y[y.RemoveMargin=3]="RemoveMargin",y[y.CancelOrder=4]="CancelOrder",y[y.ADL=5]="ADL",y[y.Liquidation=6]="Liquidation",y[y.MarketClose=7]="MarketClose",y[y.EarlyClose=8]="EarlyClose",y[y.AddTPSL=9]="AddTPSL",y[y.SecurityDeposit=10]="SecurityDeposit",y[y.TransferToWallet=11]="TransferToWallet",y[y.MarginAccountDeposit=12]="MarginAccountDeposit",y[y.ReferralReward=13]="ReferralReward",y[y.ReferralRewardClaim=14]="ReferralRewardClaim",y))(Jn||{}),Yn=(a=>(a[a.Unknown=0]="Unknown",a[a.GTE=1]="GTE",a[a.LTE=2]="LTE",a))(Yn||{}),Xn=(n=>(n[n.Long=0]="Long",n[n.Short=1]="Short",n))(Xn||{}),jn=(s=>(s[s.Cancelled=1]="Cancelled",s[s.Expired=2]="Expired",s[s.Successful=9]="Successful",s[s.PartialFilled=8]="PartialFilled",s))(jn||{}),$n=(i=>(i[i.Market=1]="Market",i[i.Limit=2]="Limit",i[i.TP=3]="TP",i[i.SL=4]="SL",i[i.ADL=5]="ADL",i[i.ADLTrigger=6]="ADLTrigger",i[i.Liquidation=7]="Liquidation",i[i.EarlyClose=8]="EarlyClose",i[i.MarketClose=9]="MarketClose",i))($n||{}),Kn=(p=>(p[p.Open=0]="Open",p[p.PartialClose=1]="PartialClose",p[p.FullClose=2]="FullClose",p[p.Liquidation=3]="Liquidation",p[p.EarlyClose=4]="EarlyClose",p[p.MarketClose=5]="MarketClose",p[p.ADL=6]="ADL",p[p.TP=7]="TP",p[p.SL=8]="SL",p[p.Increase=9]="Increase",p))(Kn||{}),Zn=(a=>(a[a.MarginAccount=1]="MarginAccount",a[a.WalletAccount=2]="WalletAccount",a[a.ReferralReward=3]="ReferralReward",a))(Zn||{});var ea=(s=>(s[s.EXECUTING=1]="EXECUTING",s[s.BROADCAST_FAILED=2]="BROADCAST_FAILED",s[s.TIMEOUT_CANCEL=3]="TIMEOUT_CANCEL",s[s.EXECUTED=9]="EXECUTED",s))(ea||{});var Ns=async()=>B.get(`${L()}/openapi/gateway/scan/market/list`);var L=()=>{let{isTestnet:t,isBetaMode:e}=k?.getConfigManager()?.getConfig()||{};return e?"https://api-beta.myx.finance":t?"https://api-test.myx.cash":"https://api.myx.finance"},q=async(t,e=[])=>e.length?B.get(`${L()}/openapi/gateway/quote/price/oracles`,{chainId:t,poolIds:e.join(",")}):Promise.reject(new Error("Invalid pool id")),yt=async(t,e)=>await B.get(`${L()}/openapi/gateway/scan/market/info?chainId=${t}&poolId=${e}`),ct=async(t,e,n)=>await B.get(`${L()}/openapi/gateway/scan/market/pool-order/open?chainId=${n}`,void 0,{headers:{myx_openapi_access_token:t,myx_openapi_account:e}}),Ls=async({chainId:t,poolIds:e},n)=>B.get(`${L()}/openapi/gateway/quote/candle/tickers`,{chainId:t,poolIds:e.join(",")}),qs=async({...t})=>B.get(`${L()}/openapi/gateway/scan/market/base-details`,t),Gs=async({...t})=>B.get(`${L()}/openapi/gateway/scan/market/detail`,t),ft=async()=>B.get(`${L()}/openapi/gateway/scan/market`);var j,Ce=class Ce{constructor(){this.version="1.0.24-beta.13";Je(this,j);}setConfigManager(e){Ye(this,j,e);}getConfigManager(){return He(this,j)}setProvider(e){this.provider=e;}getProvider(){return this.provider}static getInstance(){return this._instance||(this._instance=new Ce),this._instance}async getMarkets(){try{let n=(await ft())?.data||[];return this.Markets=n,n}catch(e){throw e}}};j=new WeakMap;var X=Ce,bt=X.getInstance(),k=bt,Xs=async t=>{let e=bt.getConfigManager();if(!e?.hasSigner())throw new Error("No signer: call auth({ signer }) or auth({ walletClient })");return e.getViemWalletClient(t)};var gt={USDC:"0x55d398326f99059fF775485246999027B3197955",POOL_MANAGER:"0x4A92b2E6476630F18D3BedCEcDc2fF726a687724",Account:"0xF1b79eEC9ac795798D4E289Ca37C67516dD72389",POSITION_MANAGER:"0x4dF5284F67f5eb4F804D4Dfb26baA75d3a0d0f48",ORDER_MANAGER:"0x283907b70F85431F7D0E86627fA53870D91a47ba",PYTH:"0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594",ERC20:"0x55d398326f99059fF775485246999027B3197955",LIQUIDITY_ROUTER:"0x8Ec82e7E2c9DAf55502d5215934236530a3991df",BASE_POOL:"0x02c48173a260Fa22E99c27BEc530E2052bE5a528",QUOTE_POOL:"0x695cd70D9CFcD8Dc6a8Ac702C3C4310332B9c750",ORACLE:"0x34951eA0a25Da088509B68294130D02a8A744542",EIP7702Delegation:"0xa3aaa9111e8C2672A9C8d04223D42D0846D724c5",MARKET_MANAGER:"0x9E225c924Ea63f04CF445F85f13df66659cc4e06",DATA_PROVIDER:"0x515beDD7d357671e9c8bF7da67ac0839Aec1FFAa",ORACLE_RESERVE:"0x7c090B41997D2e3809B2648f297DE47Fc491F14C",FORWARDER:"0x048A4bC2E2a6e9494268895CE4644d67FAa65525",TRADING_ROUTER:"0xe418929503a8BA7bA4B6337BEe668956b0752A84",REIMBURSEMENT:"0x0c20de588d6D2C577A4360e114d4560fB2a48Fd4",DISPUTE_COURT:"0xf85895AC9c9f449DC4A4718c7011BFA31c6056B4",EXECUTION_POOL:"0x6C3F4ACccD708dE6A8f7E7adB4b14D2b407ff809"};var x=t=>{let{isBetaMode:e}=k?.getConfigManager()?.getConfig()||{};switch(t){case 421614:return e?it:rt;case 59141:return e?ut:pt;case 97:return e?dt:mt;case 56:return gt;default:return {}}};var It=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"DesignatedTokenMismatch",inputs:[{type:"address",name:"collectToken"},{type:"address",name:"designatedToken"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"ForwardedRecipientMustBeMasterAccount",inputs:[{type:"address",name:"recipient"},{type:"address",name:"master"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotActiveBroker",inputs:[{type:"address",name:"broker"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotForwardAllowedTarget",inputs:[{type:"address",name:"from"}]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotOrderOwner",inputs:[]},{type:"error",name:"NotPositionOwner",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"CollectExecutionFee",inputs:[{type:"uint8",name:"source",indexed:false},{type:"bytes32",name:"positionId",indexed:false},{type:"address",name:"account",indexed:false},{type:"uint256",name:"executionFee",indexed:false},{type:"address",name:"token",indexed:false}]},{type:"event",anonymous:false,name:"CollectForwardFee",inputs:[{type:"uint8",name:"source",indexed:false},{type:"bytes32",name:"positionId",indexed:false},{type:"address",name:"account",indexed:false},{type:"uint256",name:"forwardFee",indexed:false},{type:"address",name:"token",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"adjustCollateral",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"bytes32",name:"positionId"},{type:"int256",name:"adjustAmount"}],outputs:[]},{type:"function",name:"cancelOrder",constant:false,payable:false,inputs:[{type:"uint256",name:"orderId"}],outputs:[]},{type:"function",name:"cancelOrders",constant:false,payable:false,inputs:[{type:"uint256[]",name:"orderIds"}],outputs:[]},{type:"function",name:"collectExecutionFee",constant:false,payable:false,inputs:[{type:"uint8",name:"source"},{type:"bytes",name:"data"},{type:"address",name:"feeRecipient"}],outputs:[]},{type:"function",name:"collectForwardFeeIfNecessary",constant:false,payable:false,inputs:[{type:"uint8",name:"source"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"depositToAccount",constant:false,payable:false,inputs:[{type:"address",name:"recipient"},{type:"address",name:"token"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"placeOrderWithPosition",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"bytes32",name:"positionId"},{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"tuple",name:"orderParams",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"collateralAmount"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"uint8",name:"orderType"},{type:"uint8",name:"triggerType"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint8",name:"timeInForce"},{type:"bool",name:"postOnly"},{type:"uint16",name:"slippagePct"},{type:"uint16",name:"leverage"},{type:"address",name:"broker"},{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}],outputs:[]},{type:"function",name:"placeOrderWithSalt",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"uint64",name:"userPositionSalt"},{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"tuple",name:"orderParams",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"collateralAmount"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"uint8",name:"orderType"},{type:"uint8",name:"triggerType"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint8",name:"timeInForce"},{type:"bool",name:"postOnly"},{type:"uint16",name:"slippagePct"},{type:"uint16",name:"leverage"},{type:"address",name:"broker"},{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}],outputs:[]},{type:"function",name:"placeOrdersWithPosition",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"bytes32[]",name:"positionIds"},{type:"tuple[]",name:"orderParams",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"collateralAmount"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"uint8",name:"orderType"},{type:"uint8",name:"triggerType"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint8",name:"timeInForce"},{type:"bool",name:"postOnly"},{type:"uint16",name:"slippagePct"},{type:"uint16",name:"leverage"},{type:"address",name:"broker"},{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}],outputs:[]},{type:"function",name:"placeOrdersWithSalt",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"uint64[]",name:"userPositionSalts"},{type:"tuple[]",name:"orderParams",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"collateralAmount"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"uint8",name:"orderType"},{type:"uint8",name:"triggerType"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint8",name:"timeInForce"},{type:"bool",name:"postOnly"},{type:"uint16",name:"slippagePct"},{type:"uint16",name:"leverage"},{type:"address",name:"broker"},{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"updateOrder",constant:false,payable:false,inputs:[{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"tuple",name:"params",components:[{type:"uint256",name:"orderId"},{type:"address",name:"broker"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"tuple",name:"tpsl",components:[{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}]}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var Pe=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"CollectFailed",inputs:[]},{type:"error",name:"DeadlineInPast",inputs:[]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ExecutionExpired",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"ExecutionNotExpired",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"ExecutionsNotExist",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"GracePeriodNotExpired",inputs:[]},{type:"error",name:"InsufficientGasEscrow",inputs:[]},{type:"error",name:"InvalidDataLength",inputs:[]},{type:"error",name:"InvalidGasEscrow",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidRequest",inputs:[]},{type:"error",name:"MaxPendingExceeded",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotExecutionOwner",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolNotExists",inputs:[{type:"bytes32"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"RefundExceedsEscrow",inputs:[{type:"uint256",name:"refund"},{type:"uint256",name:"escrow"}]},{type:"error",name:"RefundFailed",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"SelectorNotRegistered",inputs:[{type:"bytes4",name:"selector"}]},{type:"error",name:"TxIdAlreadyExists",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"ExecutionCancelled",inputs:[{type:"bytes32",name:"txId",indexed:false},{type:"string",name:"remark",indexed:false}]},{type:"event",anonymous:false,name:"ExecutionExecuted",inputs:[{type:"bytes32[]",name:"txIds",indexed:false}]},{type:"event",anonymous:false,name:"ExecutionSubmitted",inputs:[{type:"bytes32",name:"txId",indexed:false},{type:"bytes32[]",name:"poolId",indexed:false},{type:"address",name:"from",indexed:false},{type:"uint64",name:"deadline",indexed:false}]},{type:"event",anonymous:false,name:"GasCollected",inputs:[{type:"bytes32[]",name:"txIds",indexed:false},{type:"uint256",name:"gasAmount",indexed:false}]},{type:"event",anonymous:false,name:"GasEscrowSelectorRemoved",inputs:[{type:"bytes4",name:"selector",indexed:false}]},{type:"event",anonymous:false,name:"GasEscrowSelectorUpdated",inputs:[{type:"bytes4",name:"selector",indexed:false},{type:"uint256",name:"gasEscrow",indexed:false}]},{type:"event",anonymous:false,name:"GracePeriodUpdated",inputs:[{type:"uint64",name:"gracePeriod",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"MaxPendingUpdated",inputs:[{type:"uint256",name:"maxPendingPerUser",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"cancel",constant:false,payable:false,inputs:[{type:"bytes32",name:"txId"}],outputs:[]},{type:"function",name:"cancelExpired",constant:false,payable:false,inputs:[{type:"bytes32",name:"txId"}],outputs:[]},{type:"function",name:"consumeExecutions",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"txIds"}],outputs:[]},{type:"function",name:"executePublic",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"bytes32",name:"txId"},{type:"tuple[]",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"oracleType"},{type:"uint64",name:"publishTime"},{type:"bytes",name:"oracleUpdateData"}]}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getAllGasEscrowSelectors",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32[]",name:"selectors"},{type:"uint256[]",name:"escrows"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExecutionRequest",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"txId"}],outputs:[{type:"bool",name:"isExpired"},{type:"tuple",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]}]},{type:"function",name:"getGasEscrowForSelector",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes4",name:"selector"}],outputs:[{type:"uint256"}]},{type:"function",name:"gracePeriod",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint64"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"maxPendingCount",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"pendingCount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"}],outputs:[{type:"uint256",name:"count"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"removeGasEscrowForSelector",constant:false,payable:false,inputs:[{type:"bytes4",name:"selector"}],outputs:[]},{type:"function",name:"setGasEscrowForSelector",constant:false,payable:false,inputs:[{type:"bytes4",name:"selector"},{type:"uint256",name:"escrow"}],outputs:[]},{type:"function",name:"setGracePeriod",constant:false,payable:false,inputs:[{type:"uint64",name:"_gracePeriod"}],outputs:[]},{type:"function",name:"setMaxPendingCount",constant:false,payable:false,inputs:[{type:"uint256",name:"_maxPendingCount"}],outputs:[]},{type:"function",name:"submit",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"bytes32",name:"txId"},{type:"tuple",name:"execution",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"createdAt"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"}]},{type:"bytes32[]",name:"updatePricePoolIds"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var Oo=(t,e)=>{let n=c(t);return viem.getContract({address:e,abi:O,client:n})},Fo=async t=>{let e=x(t),n=await v(t);return viem.getContract({address:e.TRADING_ROUTER,abi:It,client:n})},xt=async(t,e)=>{let n=await v(t);return viem.getContract({address:e,abi:O,client:n})},E=async t=>{let e=await v(t),[n]=await e.getAddresses();return n??void 0},Q=async t=>{let e=x(t),n=await v(t);return viem.getContract({address:e.LIQUIDITY_ROUTER,abi:M,client:n})},At=async t=>{let e=x(t),n=await v(t);return viem.getContract({address:e.ORACLE_RESERVE,abi:Xe,client:n})},_=(t,e=1)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.POOL_MANAGER,abi:de,client:a})):v(t).then(s=>viem.getContract({address:n.POOL_MANAGER,abi:de,client:s}))};var G=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.QUOTE_POOL,abi:le,client:a})):v(t).then(s=>viem.getContract({address:n.QUOTE_POOL,abi:le,client:s}))},U=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.BASE_POOL,abi:ye,client:a})):v(t).then(s=>viem.getContract({address:n.BASE_POOL,abi:ye,client:s}))},So=async(t,e)=>{let n=await v(t);return viem.getContract({address:e,abi:ce,client:n})},Ct=async t=>{let e=await v(t),n=x(t);return viem.getContract({address:n.EXECUTION_POOL,abi:Pe,client:e})},Pt=async t=>{let e=await c(t),n=x(t);return viem.getContract({address:n.EXECUTION_POOL,abi:Pe,client:e})};var ko=(t,e)=>{let n=c(t);return viem.getContract({address:e,abi:ce,client:n})};var Et=(t,e,n=0)=>{let a=n===0?c(t):null;return a?Promise.resolve(viem.getContract({address:e,abi:fe,client:a})):v(t).then(s=>viem.getContract({address:e,abi:fe,client:s}))},ee=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.MARKET_MANAGER,abi:be,client:a})):v(t).then(s=>viem.getContract({address:n.MARKET_MANAGER,abi:be,client:s}))},Rt=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.DATA_PROVIDER,abi:ge,client:a})):v(t).then(s=>viem.getContract({address:n.DATA_PROVIDER,abi:ge,client:s}))},No=async t=>{let e=x(t),n=await v(t);return viem.getContract({address:e.Account,abi:ot,client:n})},wt=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.FORWARDER,abi:Ie,client:a})):v(t).then(s=>viem.getContract({address:n.FORWARDER,abi:Ie,client:s}))},_o=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.REIMBURSEMENT,abi:xe,client:a})):v(t).then(s=>viem.getContract({address:n.REIMBURSEMENT,abi:xe,client:s}))},Bo=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.DISPUTE_COURT,abi:Ae,client:a})):v(t).then(s=>viem.getContract({address:n.DISPUTE_COURT,abi:Ae,client:s}))};var H=null;function aa(t){H=t;}function Ee(){return H??{}}function Re(){}function sa(...t){(H?.log??H?.info??Re)(...t);}function oa(...t){(H?.warn??Re)(...t);}function l(...t){(H?.error??Re)(...t);}var vt=class{constructor(e){this.options={...e,logLevel:e?.logLevel??"info"};}get out(){return this.options.sink??Ee()}debug(e,...n){this.options.logLevel!=="none"&&this.options.logLevel==="debug"&&(this.out.log??this.out.info)?.(`[MYX-SDK-DEBUG] ${e}`,...n);}info(e,...n){this.options.logLevel!=="none"&&(this.options.logLevel==="debug"||this.options.logLevel==="info")&&(this.out.log??this.out.info)?.(`[MYX-SDK-INFO] ${e}`,...n);}error(e,...n){this.options.logLevel!=="none"&&(this.options.logLevel==="debug"||this.options.logLevel==="info"||this.options.logLevel==="error")&&this.out.error?.(`[MYX-SDK-ERROR] ${e}`,...n);}warn(e,...n){this.options.logLevel!=="none"&&this.out.warn?.(`[MYX-SDK-WARN] ${e}`,...n);}};var we={"0xfa52dfc0":"AccountInsufficientFreeAmount()","0xe2a1a260":"AccountInsufficientReservedAmount()","0xffd10028":"AccountInsufficientTradableAmount(uint256,uint256)","0x9996b315":"AddressEmptyCode(address)","0x4c9c8ce3":"ERC1967InvalidImplementation(address)","0xb398979f":"ERC1967NonPayable()","0xd6bda275":"FailedCall()","0x62b925f6":"ForwardedRecipientMustBeMasterAccount(address,address)","0xf92ee8a9":"InvalidInitialization()","0x44d3438f":"NotAddressManager()","0x3fc81f20":"NotDependencyManager()","0xd7e6bcf8":"NotInitializing()","0x507f487a":"NotProxyAdmin()","0xe03f6024":"PermissionDenied(address,address)","0x5274afe7":"SafeERC20FailedOperation(address)","0xe07c8dba":"UUPSUnauthorizedCallContext()","0xaa1d49a4":"UUPSUnsupportedProxiableUUID(bytes32)","0x24775e06":"SafeCastOverflowedUintToInt(uint256)","0xba767932":"ConvertAmountMismatch(uint256,uint256)","0xd93c0665":"EnforcedPause()","0x8dfc202b":"ExpectedPause()","0xc7cbe25a":"GracePeriodNotExpired()","0xdb42144d":"InsufficientBalance(address,uint256,uint256)","0x42301c23":"InsufficientOutputAmount()","0xcaa99aac":"MismatchExecuteFee(uint256,uint256,uint256)","0x70c770c6":"OnlyMarketDecreaseOrder(OrderId)","0x4578ddb8":"OnlyRelayer()","0x25e25e9e":"OrderNotExpired(OrderId)","0x1e4fbdf7":"OwnableInvalidOwner(address)","0x118cdaa7":"OwnableUnauthorizedAccount(address)","0x230e8e43":"PoolNotInPreBenchState(PoolId)","0x3ee5aeb5":"ReentrancyGuardReentrantCall()","0xe356c1d3":"TargetNotAllowed(address)","0x90b8ec18":"TransferFailed()","0xbe1af266":"InternalOnly()","0x856bc1d7":"ExceedMaxOrderCount()","0x3385aa1f":"ExceedOrderSize(uint256)","0xb07e3bc4":"InsufficientCollateral(uint256,uint256)","0x613970e0":"InvalidParameter()","0x8ea9158f":"InvalidPosition(PositionId)","0xf2b2d412":"InvalidTriggerType()","0x70d645e3":"NotPositionOwner()","0xe75316c6":"OrderNotExist(OrderId)","0xba01b06f":"PoolNotActive(PoolId)","0xba0d3752":"PositionNotInitialized(PositionId)","0xddefae28":"AlreadyMinted()","0x64283d7b":"ERC721IncorrectOwner(address,uint256,address)","0x177e802f":"ERC721InsufficientApproval(address,uint256)","0xa9fbf51f":"ERC721InvalidApprover(address)","0x5b08ba18":"ERC721InvalidOperator(address)","0x89c62b64":"ERC721InvalidOwner(address)","0x64a0ae92":"ERC721InvalidReceiver(address)","0x73c6ac6e":"ERC721InvalidSender(address)","0x7e273289":"ERC721NonexistentToken(uint256)","0xb4762117":"ExceedMaxLeverage(PositionId)","0x29143a42":"ExceedPositionSize()","0xa5afd143":"PositionNotHealthy(PositionId,uint256)","0xf4d678b8":"InsufficientBalance()","0x6aee3c1a":"InsufficientRiskReserves()","0x2c5211c6":"InvalidAmount()","0x82cb17ef":"InvalidSplitConfig()","0xe921c36b":"AlreadyMigrated(PositionId,PositionId)","0xd34e366f":"ExceedBaseCollateral(uint256,uint256)","0xc7544914":"ExceedDebt(uint256,uint256)","0xe7aa687a":"ExceedExchangeable()","0x4b3c8f33":"ExceedMaxBaseProfit()","0xdc82bd68":"ExceedMinOutputAmount()","0x5646203f":"InsufficientCollateral(PositionId,uint256)","0x9ac13039":"InsufficientPoolProfit()","0x1b5305a8":"InsufficientRedeemable()","0x14be833f":"InsufficientReturnAmount(uint256,uint256)","0x419ecd12":"MatchNotSupported()","0x5e6797f9":"NotEligibleForLiquidation()","0x9ed303a0":"PoolFundingFeeNotPositive()","0xba8f5df5":"PoolNotCompoundable(PoolId)","0xf645eedf":"ECDSAInvalidSignature()","0xfce698f7":"ECDSAInvalidSignatureLength(uint256)","0xd78bce0c":"ECDSAInvalidSignatureS(bytes32)","0x48834bee":"ExpiredFeeData()","0x56d69198":"InvalidFeeRate()","0x80577032":"NoRebateToClaim()","0x6e6b79b0":"NotBrokerSigner(address)","0xff70343d":"UnsupportedAssetClass(AssetClass)","0x60b25fe4":"BrokerAlreadyExists()","0x7eb4a674":"BrokerNotFound()","0x3e4f8296":"InvalidFeeRateLength()","0x8c3b5bf0":"NotBrokerAdmin()","0x3733548a":"InvalidFeeTier()","0x192105d7":"InitializationFunctionReverted(address,bytes)","0x97c7f537":"ExcessiveSlippage()","0x700deaad":"InvalidADLPosition(OrderId,PositionId)","0xf64fa6a8":"InvalidOrder(OrderId)","0xd4944235":"NoADLNeeded(OrderId)","0xe079169e":"NotReachedPrice(OrderId,uint256,uint256,TriggerType)","0xc60eb335":"OnlyKeeper()","0xa8ce4432":"SafeCastOverflowedIntToUint(int256)","0x17229ec4":"NotMeetEarlyCloseCriteria(PositionId)","0x0dc149f0":"AlreadyInitialized()","0x7a5c919f":"InvalidRewindPrice()","0xc53f84e7":"PositionRemainsHealthy(PositionId)","0x1dab59cf":"InvalidOrderPair(OrderId,OrderId)","0x107dec14":"RiskCloseNotAllowed()","0x664431a8":"NotAllowedTarget(address)","0xaa2c80d8":"CollectFailed()","0xbec00580":"DeadlineInPast()","0x59392ffb":"ExecutionExpired(TxId)","0x09bb89be":"ExecutionNotExpired(TxId)","0xc6a092ef":"ExecutionsNotExist(TxId)","0x5eb3095c":"InsufficientGasEscrow()","0xdfe93090":"InvalidDataLength()","0x73a65a48":"InvalidGasEscrow()","0x41abc801":"InvalidRequest()","0x1b463d8f":"MaxPendingExceeded()","0x8bfbae9a":"NotExecutionOwner(TxId)","0xd2a28b55":"PoolNotExists(PoolId)","0xf0a6cb04":"RefundExceedsEscrow(uint256,uint256)","0x919c2db4":"RefundFailed(TxId)","0x57d5ae0c":"SelectorNotRegistered(bytes4)","0xf1532544":"TxIdAlreadyExists(TxId)","0x03357c6c":"ExceedsMaximumRelayFee()","0x0d10f63b":"InconsistentParamsLength()","0x38802743":"InsufficientFeeAllowance(address,uint256,uint256)","0xd95b4ad5":"InsufficientFeeBalance(address,uint256,uint256)","0xa3972305":"MismatchedSender(address)","0xc3b80e86":"RelayerRegistered(address)","0xee0844a3":"RemoveRelayerFailed()","0xc583a8da":"IncorrectFee(uint256)","0x00bfc921":"InvalidPrice()","0xd96ce906":"PriceIdMismatch()","0x148cd0dd":"VerifyPriceFailed()","0x296e3882":"BoostFeeClaimFailed()","0xdacec8b1":"PoolBoostReserveInsufficient()","0xa83325d4":"PoolOracleFeeCharged()","0x6b75f90d":"PoolOracleFeeNotCharged()","0x42a0e2a7":"PoolOracleFeeNotExisted()","0x8ee01e1c":"PoolOracleFeeNotSoldOut()","0x5e0a829b":"ETHTransferFailed(address,uint256)","0x4ba6536f":"GasLimitExceeded(address,uint256,uint256)","0xca1aae4b":"GasLimitNotSet(address)","0x3728b83d":"InvalidAmount(uint256)","0x3484727e":"BaseFeeNotSoldOut()","0x0251bde4":"LPNotFullyMinted()","0x7decb035":"PoolDebtNotCleared()","0x1acb203e":"PositionNotEmpty()","0xdb752ffd":"UnauthorizedUnboost()","0x2be7b24b":"UnexpectedPoolState()","0x759b3876":"UnhealthyAfterRiskTierApplied(PositionId)","0x7bd42a2e":"NotEmptyAddress()","0x6697b232":"AccessControlBadConfirmation()","0xe2517d3f":"AccessControlUnauthorizedAccount(address,bytes32)","0x7c9a1cf9":"AlreadyVoted()","0x752d88c0":"InvalidAccountNonce(address,uint256)","0x0819bdcd":"SignatureExpired()","0xc00ca938":"UnexpectedCaseState()","0x29ca666b":"UntrustfulVoting()","0x796ea3a6":"BondNotReleased()","0x6511c20d":"BondZeroAmount()","0xf38e5973":"CaseAppealNotFinished()","0x1eaa4a59":"CaseDeadlineNotReached()","0xe6c67e3a":"CaseDeadlineReached()","0x0fc957b1":"CaseNotAccepted()","0x3ddb819d":"CaseNotExist(CaseId)","0x79eab18d":"CaseRespondentAppealed(CaseId,address)","0x311c16d3":"DisputeNotAllowed()","0xdcdedda9":"InvalidPoolToken()","0x3471a3c2":"InvalidProfitAmount()","0xc546bca4":"NotCaseRespondent(CaseId,address)","0x4cf72652":"RiskCloseNotCompleted()","0x7935e939":"UnexpectedCaseType()","0xa9214540":"AlreadyClaimed(CaseId,address)","0xd4ac59c1":"InvalidAmount(CaseId,address)","0x7a6f5328":"MerkleTreeVerificationFailed(CaseId,address)","0x094a5cfe":"ReimbursementValidity(CaseId)","0x8b922563":"TreeAlreadySet()","0xa179f8c9":"ChainIdMismatch()","0x78ee2fc5":"EthCallCountMismatch()","0xa710429d":"InvalidContractAddress()","0x8076dd8a":"InvalidFunctionSignature()","0xc37906a0":"InvalidPayloadLength(uint256,uint256)","0x1d9617a0":"InvalidResponseVersion()","0x9284b197":"InvalidSourceChain()","0x84ae4a30":"NumberOfResponsesMismatch()","0x02164961":"RequestTypeMismatch()","0x6882d7a1":"ResponseCountMismatch()","0x12f1361a":"StaleEthCall()","0x5e7bd6ec":"UnexpectedNumberOfResults()","0x51ee5853":"UnsupportedQueryType(uint8)","0x439cc0cd":"VerificationFailed()","0x714f5513":"VersionMismatch()","0x96b8e05b":"WrongQueryType(uint8,uint8)","0xbb6b170d":"ZeroQueries()","0x7b27120a":"InDisputeMode()","0xb04111ef":"InsufficientFreeCollateral(PositionId,uint256)","0x12f1b11a":"InsufficientLockedCollateral(PositionId,uint256)","0xe12dff41":"InvalidProfitLock()","0x3f902c55":"NoActiveDispute()","0xb923cca7":"PositionHasLockedAmount()","0x6dfcc650":"SafeCastOverflowedUintDowncast(uint8,uint256)","0xd24b47fb":"UserProfitFrozen()","0x176ae915":"InvalidBaseSlippage()","0xd1d452de":"InvalidBaseTokenCollateralRatio()","0x7469d2b7":"InvalidEpochDuration(uint32)","0xeae25452":"InvalidExchangeIncentiveRate()","0x894b012b":"InvalidGenesisRebateRatio()","0x7fd13972":"InvalidLeverage()","0x69fc7240":"InvalidMaintainMarginRate()","0x8f11d7d2":"InvalidMaxCloseSlippage()","0x75e50d4b":"InvalidMaxPriceDeviation()","0xc2c20924":"InvalidMinTradeUsd()","0x9a50eaa5":"InvalidPriceRangePct()","0xa61eabbd":"InvalidWindowCapUsd()","0xa147bb92":"InvalidWindowSize()","0x1c151780":"ExceedMinOutput(uint256,uint256)","0xe1f0493d":"NotAllowedCaller(address)","0xfb8f41b2":"ERC20InsufficientAllowance(address,uint256,uint256)","0xe450d38c":"ERC20InsufficientBalance(address,uint256,uint256)","0xe602df05":"ERC20InvalidApprover(address)","0xec442f05":"ERC20InvalidReceiver(address)","0x96c6fd1e":"ERC20InvalidSender(address)","0x94280d62":"ERC20InvalidSpender(address)","0x62791302":"ERC2612ExpiredSignature(uint256)","0x4b800e46":"ERC2612InvalidSigner(address,address)","0xb3512b0c":"InvalidShortString()","0x305a27a9":"StringTooLong(string)","0xfd0f789d":"ExceedMaxPriceDeviation()","0x407b87e5":"ExchangeRateAlreadyApplied()","0x5c6c5686":"ExchangeRateAlreadyDisabled()","0x1ae17fcd":"InvalidDeviationRatio()","0x37bc9350":"InvalidPriceTimestamp()","0xe47b1dbe":"InvalidPriceUpdater()","0x18b88897":"InvalidUpdateFee()","0x37d0adb4":"MismatchedPriceWithRewindPair()","0xf76740e3":"PriceDeviationBelowMinimum()","0x49386283":"PriceDeviationThresholdReached()","0x5d3751fc":"PriceSourceNotHealthy()","0x43fc1c57":"PriceUpdaterAlreadyAdded(address)","0x8e2b6896":"PriceUpdaterNotFound(address)","0x7f84faec":"PublishTimeMismatch()","0x19abf40e":"StalePrice()","0xe351cd13":"ExceedMaxExchangeableAmount()","0x15912a6f":"NotSupportVersion()","0xf1364a74":"ArrayEmpty()","0x15ed381d":"ExceedMaxProfit()","0x51aeee6c":"PoolNotExist(PoolId)","0x70f6c197":"InvalidQuoteTokenAddress()","0x0b8457f4":"InvalidRatioParams()","0x29dae146":"MarketAlreadyExisted()","0xf040b67a":"MarketNotExisted()","0x0e442a4a":"InvalidBaseToken()","0x24e219c7":"MarketNotExist(MarketId)","0xcc36f935":"PoolExists(PoolId)","0xd54d0fc4":"InsufficientLiquidity(uint256,uint256,uint256)","0x7e562a65":"InvalidDistributionAmount()","0x94eef58a":"ERC2771ForwarderExpiredRequest(uint48)","0xc845a056":"ERC2771ForwarderInvalidSigner(address,address)","0x70647f79":"ERC2771ForwarderMismatchedValue(uint256,uint256)","0xd2650cd1":"ERC2771UntrustfulTarget(address,address)","0xcf479181":"InsufficientBalance(uint256,uint256)","0x4c150d8f":"DifferentMarket(PoolId,PoolId)","0xaa98b06a":"InsufficientQuoteIn(uint256,uint256,uint256)","0x3e589bee":"InvalidLiquidityAmount()","0xaebd3617":"InvalidTpsl(uint256)","0x7fe81129":"SamePoolMigration(PoolId)","0x71c4efed":"SlippageExceeded(uint256,uint256)","0x62b9bc7b":"DesignatedTokenMismatch(address,address)","0x27d08510":"NotActiveBroker(address)","0x49465eb0":"NotForwardAllowedTarget(address)","0xf6412b5a":"NotOrderOwner()","0x301b6707":"ExecutionFeeNotCollected()","0xc6e8248a":"InsufficientSize()","0xd15b4fe2":"InvalidQuoteToken()","0xd8daec7c":"MarketNotInitialized()","0xcd4891b6":"NotInDisputeMode()","0x1ad308dc":"OrderExpired(OrderId)","0x486aa307":"PoolNotInitialized()"};var C={1:"Invalid Chain",2:"Invalid Token Address",4001:"User Rejected",3:"Insufficient Balance",4:"Insufficient Amount Of Approved",4002:"Invalid Base Token Address",4003:"Invalid Slippage",4004:"Invalid Amount",4005:"Invalid Pool State",4006:"Invalid Params",4007:"Invalid Amount Withdrawable LP Amount"};function ra(t){let e=t;for(;e;){if(e.name==="UserRejectedRequestError"||e.code===4001)return true;let n=(e.message||"").toLowerCase();if(n.includes("user rejected")||n.includes("user denied")||n.includes("rejected the request"))return true;e=e.cause;}return false}function ve(t){if(!t||typeof t!="string")return null;let e=t.match(/(0x[0-9a-fA-F]{8,})/);if(!e)return null;let n=e[1].slice(0,10).toLowerCase(),a=Object.keys(we).find(s=>s.toLowerCase()===n);return a?{selector:n,message:we[a]}:null}function Tt(t){let e=t;for(;e;){if(typeof e.data=="string"){let n=ve(e.data);if(n)return n}if(typeof e.details=="string"){let n=ve(e.details);if(n)return n}for(let n of ["message","shortMessage"])if(typeof e[n]=="string"){let a=ve(e[n]);if(a)return a}e=e.cause;}return null}function ht(t){if(!t)return "Unknown error";if(t?.data?.errorName)return `${t.data.errorName}()`;if(Array.isArray(t?.metaMessages)){let n=t.metaMessages.find(a=>a.includes("Error:"));if(n)return n.replace("Error: ","").trim()}let e=Tt(t);return e?e.message:t?.cause?ht(t.cause):t?.reason?t.reason:t?.shortMessage?t.shortMessage:t?.message?t.message:String(t)}async function d(t){if(typeof t=="string")return {error:t};if(ra(t))return {error:C[4001]};let e=Tt(t);if(e)return {error:{code:e.selector,message:e.message}};let n=ht(t);return {error:{code:t?.code||t?.name||"Unknown Error",message:n}}}var Mt=async(t,e,n)=>{try{return await c(t).readContract({address:n,abi:O,functionName:"balanceOf",args:[e]})}catch(a){throw l(a),a}};var Dt=async(t,e,n,a,s)=>{try{return await c(t).readContract({address:n,abi:O,functionName:"allowance",args:[e,a]})>=s}catch(r){throw r}};var F=30,V=18;var R=(t,e)=>BigInt(t)*viem.parseUnits(e.toString(),8)/BigInt(10**8),T=async t=>{try{let e=g[t],n=e?.gasPrice||0n,s=await c(t).getGasPrice();if(s==null)throw new Error("Network Error");let r=R(s,e.gasPriceRatio);return {gasPrice:r>n?r:n}}catch(e){throw e}},Ot=async(t,e)=>{let n=g[t],a=R(e,n.gasLimitRatio),{gasPrice:s}=await T(t);return {gasLimit:a,gasPrice:s}},J=(t,e=.01)=>{let n=viem.parseUnits("1",8)-viem.parseUnits(e.toString(),8);return t*n/BigInt(10**8)};var Ft=async(t,e,n,a,s)=>{try{let r=g[t],o=await xt(t,n);if(!o.write)throw new Error("Wallet client required for write");let u=await o.estimateGas.approve([a,s]),m=R(u,r.gasLimitRatio),{gasPrice:i}=await T(t);console.log("before approve-->",{gasLimit:m,gasPrice:i});let p=await o.write.approve([a,s],{gasLimit:m,gasPrice:i});await c(t).waitForTransactionReceipt({hash:p});}catch(r){throw r}};var f=async t=>{if("chainId"in t&&!je(t.chainId))throw new Error(C[1]);if("slippage"in t&&!(Number(t?.slippage)<=1&&Number(t?.slippage)>0))throw new Error(C[4003]);if("amount"in t&&(Number(t.amount)===Number.NaN||Number(t.amount)<0))throw new Error(C[4004]);let{tokenAddress:e,contractAddress:n,chainId:a,amount:s,decimals:r,account:o}=t;if(s&&a&&Number(r)>=0&&o){let u=viem.parseUnits(s.toString(),Number(r));if(e){let m=await Mt(a,o,e);if(!m||m<u)throw new Error(C[3])}if(n&&e){let m=await Dt(a,o,e,n,u);console.log("checkParams-->",m),m||await Ft(a,o,e,n,viem.maxUint256);}}};async function ma(t){try{return (await fetch(t,{method:"HEAD"})).ok}catch{return false}}var Cr=async(t,e,n)=>{try{let a=c(t),s=e,[r,o,u,m]=await Promise.all([a.readContract({address:s,abi:O,functionName:"name"}),a.readContract({address:s,abi:O,functionName:"symbol"}),a.readContract({address:s,abi:O,functionName:"decimals"}),a.readContract({address:s,abi:O,functionName:"totalSupply"})]),i=viem.getAddress(s),p=`https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/${t}/assets/${i}/logo.png`,A=await ma(p)?p:"",P;if(n){let h=await a.readContract({address:s,abi:O,functionName:"balanceOf",args:[n]});P=Number(viem.formatUnits(h,Number(u)));}return {address:e,name:r,symbol:o,decimals:Number(u),icon:A,totalSupply:Number(viem.formatUnits(m,Number(u))),...n?{balance:P}:{}}}catch(a){throw l(a),a}};var $={};W($,{buildHexDataAndExecutionGasFee:()=>ga,buildSignData:()=>ba,generateTxId:()=>kt,getExecutionTimestamp:()=>Nt});var kt=()=>`0x${cryptoEs.WordArray.random(32).toString()}`,Nt=()=>{let t=la__default.default(),e=t.unix(),n=t.add(1,"minute").unix();return {createAt:e,deadline:n}},ba=async({chainId:t,data:e,from:n,to:a})=>{let{createAt:s,deadline:r}=Nt(),o=kt();return {createAt:s,deadline:r,txId:o,signData:{from:n,to:a,deadline:r,data:e,value:0n,gas:$e}}},ga=async({chainId:t,abi:e,method:n,args:a})=>{let s=viem.encodeFunctionData({abi:e,functionName:n,args:a}),r=viem.getAbiItem({abi:e,name:n}),o=viem.toFunctionSelector(r);console.log("functionSelector-->",o);let m=await(await Pt(t)).read.getGasEscrowForSelector([o]);return {hexData:s,executionGasFee:m}};var _t={};W(_t,{getForwardEip712Domain:()=>Ia,getForwardRequestTypes:()=>xa});var Ia=async t=>{let n=await(await wt(t)).read.eip712Domain();return {name:n[1],version:n[2],chainId:n[3],verifyingContract:n[4]}},xa=()=>({types:{ForwardRequest:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"gas",type:"uint256"},{name:"deadline",type:"uint48"},{name:"data",type:"bytes"}]},primaryType:"ForwardRequest"});var ne={};W(ne,{waitForTransactionReceipt:()=>Aa});var Aa=async(t,e)=>c(t).waitForTransactionReceipt({hash:e});var D=async({chainId:t,account:e,abi:n,method:a,args:s,poolIds:r,to:o})=>{let u=x(t),m=o||u.LIQUIDITY_ROUTER,{hexData:i,executionGasFee:p}=await $.buildHexDataAndExecutionGasFee({abi:n,method:a,args:s,chainId:t}),{createAt:b,txId:A,signData:P}=await $.buildSignData({from:e,chainId:t,to:m,data:i}),h=await Ct(t),y=[A,{...P,createdAt:BigInt(b)},r],Y=await h.estimateGas.submit(y,{value:p}),{gasLimit:ze,gasPrice:ln}=await Ot(t,Y),Ve=await h.write.submit(y,{value:p,gasLimit:ze,gasPrice:ln}),yn=await ne.waitForTransactionReceipt(t,Ve);return {hash:Ve,txId:A,receipt:yn}};var Bt=async t=>{try{let{chainId:e,poolId:n}=t,a=await E(e);return await f({account:a,chainId:e}),await D({chainId:e,account:a,abi:M,method:"claimBasePoolRebate",args:[n,a],poolIds:[n]})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}},Ut=async t=>{try{let{chainId:e,poolIds:n}=t;if(n.length===0)return;let a=await E(e);return await f({account:a,chainId:e}),await D({chainId:e,account:a,abi:M,method:"claimBasePoolRebates",args:[n,a],poolIds:n})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var qt=async({chainId:t,amountIn:e,poolId:n,price:a=0n})=>{try{let s=g[t];return await(await U(t)).read.previewLpAmountOut([n,e,a])}catch(s){throw l(s),typeof s=="string"?s:await d(s)}},Gt=async({chainId:t,amountIn:e,poolId:n,price:a=0n})=>{try{let s=g[t];return await(await U(t)).read.previewBaseAmountOut([n,e,a])}catch(s){throw l(s),typeof s=="string"?s:await d(s)}},zt=async({chainId:t,account:e,poolId:n,amount:a=0})=>{try{if(!t||!e||!n)return;if(!a)return {baseAmountOut:0n,rebateAmount:0n};let s=g[t],r=18;await f({decimals:r,account:e,chainId:t,amount:a});let o=viem.parseUnits(a.toString(),r),m=(await q(t,[n])).data?.[0]?.price||"0",i=viem.parseUnits(m,30),b=await(await U(t)).read.previewUserWithdrawData([n,o,e,i]),[A,P]=b;return {baseAmountOut:A,rebateAmount:P}}catch(s){throw typeof s=="string"?s:await d(s)}};var w=async(t,e)=>{try{return !t||!e?void 0:(await yt(t,e)).data}catch(n){throw typeof n=="string"?n:await d(n)}};var Vt=async(t,e)=>await Promise.all(e.map(async a=>{let{publishTime:s,vaa:r,oracleType:o,nativeFee:u,price:m,poolId:i}=a,p=lodashEs.isNil(u)?1n:BigInt(u);return {poolId:i,price:m,value:p,publishTime:s,oracleType:o??2,vaa:r}})),yi=async(t,e)=>{if(!e||!e.length)return;let n=await q(t,e);return await Vt(t,n.data)},N=async(t,e)=>{if(!e)return;let a=(await q(t,[e]))?.data?.[0];if(!a)throw new Error(`Unable to get price for ${e}`);return (await Vt(t,[a]))?.[0]};function Wt(t){return t.includes(".")?t.split(".")[1].length:0}var ae=(t=.01,e=[],n=18,a)=>{if(e.length===0)return [];if(e.filter(r=>r.amount&&r.triggerPrice&&r.triggerType).length===0)throw new Error(C[4006]);return e.map(r=>{let o=viem.parseUnits(r.amount.toString(),n),u=viem.parseUnits(r.triggerPrice.toString(),30),m=Wt(r.triggerPrice.toString()),i=viem.parseUnits(r.triggerPrice.toString(),m),p=J(o*i*BigInt(10**a)/BigInt(10**(m+n)),t);return {amount:o,triggerPrice:u,triggerType:BigInt(r.triggerType),minQuoteOut:p}})};var se=t=>!(t===0||t===1||t===2||t===5);var oe=async({poolId:t,chainId:e,account:n,amountIn:a,amount:s,slippage:r,state:o,quoteDecimals:u,tpsl:m,previewLpAmountOut:i})=>{let p=se(o),b;if(p){let y=await N(e,t);if(!y)return;let Y=viem.parseUnits(y.price,30);b=await i({chainId:e,poolId:t,amountIn:a,price:Y});}else b=await i({chainId:e,poolId:t,amountIn:a});let A=J(b,r),P=m.map(y=>({amount:s,triggerPrice:y.triggerPrice,triggerType:y.triggerType})),h=ae(r,P,18,u);return {data:{poolId:t,amountIn:a,minAmountOut:A,recipient:n,tpslParams:h}}};var Qt=async t=>{try{let{poolId:e,chainId:n,amount:a,slippage:s=.01,tpsl:r=[]}=t;await f(t);let o=await w(n,e);if(!o)throw new Error(C[4006]);let u=o?.baseDecimals,m=o?.quoteDecimals,i=o?.baseToken,p=await E(n),A=x(n).BASE_POOL;await f({tokenAddress:i,contractAddress:A,decimals:u,account:p,chainId:n,amount:a});let P=viem.parseUnits(a.toString(),u),h=await oe({poolId:e,chainId:n,account:p,amountIn:P,amount:a,slippage:s,state:o.state,quoteDecimals:m,tpsl:r,previewLpAmountOut:qt});return h?await D({chainId:n,account:p,abi:M,method:"depositBase",args:[h.data],poolIds:[e]}):void 0}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var K=async({chainId:t,baseToken:e,marketId:n})=>{try{if(!e)throw new Error(C[2]);let a=x(t),s=await _(t,0),r=[n,e],o=await s.read.getMarketPool(r);return o.poolId==="0x0000000000000000000000000000000000000000000000000000000000000000"||!o.poolId?void 0:o.poolId}catch(a){throw l(a),typeof a=="string"?a:await d(a)}},Me=async t=>{try{return await(await _(t)).read.getPools()||[]}catch(e){throw l(e),typeof e=="string"?e:await d(e)}},De=async(t,e,n=0n)=>{try{let s=await(await Rt(t)).read.getPoolInfo([e,n]);return {quotePool:{poolToken:s.quotePool.poolToken,exchangeRate:s.quotePool.exchangeRate,poolTokenPrice:s.quotePool.poolTokenPrice,poolTokenSupply:s.quotePool.poolTokenSupply,totalDebt:s.quotePool.totalDebt,baseCollateral:s.quotePool.baseCollateral},basePool:{poolToken:s.basePool.poolToken,exchangeRate:s.basePool.exchangeRate,poolTokenPrice:s.basePool.poolTokenPrice,poolTokenSupply:s.basePool.poolTokenSupply,totalDebt:s.basePool.totalDebt,baseCollateral:s.basePool.baseCollateral},reserveInfo:{baseTotalAmount:s.reserveInfo.baseTotalAmount,baseReservedAmount:s.reserveInfo.baseReservedAmount,quoteTotalAmount:s.reserveInfo.quoteTotalAmount,quoteReservedAmount:s.reserveInfo.quoteReservedAmount},fundingInfo:{nextFundingRate:s.fundingInfo.nextFundingRate,lastFundingFeeTracker:s.fundingInfo.lastFundingFeeTracker,nextEpochTime:s.fundingInfo.nextEpochTime},ioTracker:{tracker:s.oi.tracker,longSize:s.oi.longSize,shortSize:s.oi.shortSize,poolEntryPrice:s.oi.poolEntryPrice},liquidityInfo:{windowCaps:s.liquidityInfo.windowCaps,openInterest:s.liquidityInfo.openInterest}}}catch(a){throw l(a),typeof a=="string"?a:await d(a)}};var Oe=async({chainId:t,baseToken:e,marketId:n})=>{try{if(!e)throw new Error(C[2]);let a=g[t],s=await _(t),r={marketId:n,baseToken:e},o=await s.estimateGas.deployPool([r]),u=R(o,a.gasLimitRatio),{gasPrice:m}=await T(t),i=await s.write.deployPool([r],{gasLimit:u,gasPrice:m});if(await c(t).waitForTransactionReceipt({hash:i}))return await K({chainId:t,baseToken:e,marketId:n})}catch(a){throw typeof a=="string"?a:await d(a)}};var Fe=async(t,e,n)=>{try{return await(await Et(t,e)).read.userGenesisShare([n])}catch(a){throw l(a),typeof a=="string"?a:await d(a)}};var Se=async t=>{try{let{chainId:e,poolId:n,poolType:a,slippage:s=.01,tpsl:r=[]}=t;await f(t);let o=await w(e,n);if(!o)throw new Error(C[4006]);let u=18,m=o.quoteDecimals,i=ae(s,r,u,m),p=g[e],b=await Q(e),A={poolId:n,poolType:BigInt(a),tpslParams:i},P=await b.estimateGas.addTpsl([A]),h=R(P,p.gasLimitRatio),{gasPrice:y}=await T(e),Y=await b.write.addTpsl([A],{gasLimit:h,gasPrice:y});return await c(e).waitForTransactionReceipt({hash:Y})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var ke=async t=>{try{let{chainId:e,orderId:n}=t;await f(t);let a=g[e],s=await Q(e),r=await s.estimateGas.cancelTpsl([n]),o=R(r,a.gasLimitRatio),{gasPrice:u}=await T(e),m=await s.write.cancelTpsl([n],{gasLimit:o,gasPrice:u});return await c(e).waitForTransactionReceipt({hash:m})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var Ne=async(t,e,n)=>{try{await f({chainId:t});let a=await w(t,e);if(!a)throw new Error(C[4006]);let s=await E(t),o=((k?.Markets?.length?k?.Markets:await k.getMarkets())||[])?.find(y=>y.chainId===t&&y.marketId===n);if(!o)throw new Error("Invalid Market");let u=viem.parseUnits(o.oracleFeeUsd.toString(),a.quoteDecimals);if(!u)throw new Error("Invalid Market");await f({tokenAddress:a.quoteToken,contractAddress:x(t).ORACLE_RESERVE,decimals:a.quoteDecimals,account:s,chainId:t,amount:viem.formatUnits(u,a.quoteDecimals)});let m=g[t],i=await _(t),p=await i.estimateGas.reprimePool([{poolId:e}]),b=R(p,m.gasLimitRatio),{gasPrice:A}=await T(t),P=await i.write.reprimePool([{poolId:e}],{gasLimit:b,gasPrice:A});return await c(t).waitForTransactionReceipt({hash:P})}catch(a){throw l(a),typeof a=="string"?a:await d(a)}};var _e=async(t,e)=>{try{let n=await X.getInstance().getConfigManager()?.getAccessToken();if(!n)throw new Error("Failed to obtain accessToken");return (await ct(n,e,t)).data||[]}catch(n){throw l(n),n}};var Be=async t=>{try{let{chainId:e,poolId:n}=t;await f({chainId:e});let a=await w(e,n);if(!a)throw new Error(C[4006]);let s=await E(e),o=((k?.Markets?.length?k?.Markets:await k.getMarkets())||[])?.find(y=>y.chainId===e&&y.marketId===a.marketId);if(!o)throw new Error("Invalid Market");let u=viem.parseUnits(o.boostFeeUsd.toString(),a.quoteDecimals);if(!u)throw new Error("Invalid Market");await f({tokenAddress:a.quoteToken,contractAddress:x(e).ORACLE_RESERVE,decimals:a.quoteDecimals,account:s,chainId:e,amount:viem.formatUnits(u,a.quoteDecimals)});let m=g[e],i=await _(e),p=await i.estimateGas.boostPool([{poolId:n}]),b=R(p,m.gasLimitRatio),{gasPrice:A}=await T(e),P=await i.write.boostPool([{poolId:n}],{gasLimit:b,gasPrice:A});return await c(e).waitForTransactionReceipt({hash:P})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var Ue=async t=>{try{let{chainId:e,poolId:n}=t;await f({chainId:e});let a=g[e],s=await _(e),r=await s.estimateGas.unboostPool([{poolId:n}]),o=R(r,a.gasLimitRatio),{gasPrice:u}=await T(e),m=await s.write.unboostPool([{poolId:n}],{gasLimit:o,gasPrice:u});return await c(e).waitForTransactionReceipt({hash:m})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var Le=async t=>{try{let{chainId:e,poolId:n}=t;await f({chainId:e});let a=g[e],s=await At(e),r=await s.estimateGas.claimBoostFee([n]),o=R(r,a.gasLimitRatio),{gasPrice:u}=await T(e),m=await s.write.claimBoostFee([n],{gasLimit:o,gasPrice:u});return await c(e).waitForTransactionReceipt({hash:m})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var Ht=async({chainId:t,amountIn:e,poolId:n,price:a=0n})=>{try{return await(await G(t)).read.previewLpAmountOut([n,e,a])}catch(s){throw l(s),typeof s=="string"?s:await d(s)}},Jt=async({chainId:t,amountIn:e,poolId:n,price:a=0n})=>{try{return await(await G(t)).read.previewQuoteAmountOut([n,e,a])}catch(s){throw l(s),typeof s=="string"?s:await d(s)}};var re=async({amountIn:t,chainId:e,poolId:n,state:a,slippage:s,poolType:r,account:o})=>{let u=se(a),m,i=r===0?Gt:Jt;if(u)try{let b=await N(e,n);if(b){let A=viem.parseUnits(b.price,30);m=await i({chainId:e,poolId:n,amountIn:t,price:A});}}catch(b){console.error(b),m=await i({chainId:e,poolId:n,amountIn:t});}else m=await i({chainId:e,poolId:n,amountIn:t});return {data:{poolId:n,amountIn:t,minAmountOut:J(m,s),recipient:o}}};var Yt=async t=>{try{let{chainId:e,poolId:n,price:a}=t,s=a,r=await U(e);if(typeof a>"u"||a===null)try{let u=await N(e,n);s=viem.parseUnits(u?.price||"0",30);}catch{s=viem.parseUnits("0",30);}return await r.read.withdrawableLpAmount([n,s||0n])}catch(e){throw typeof e=="string"?e:await d(e)}},Xt=async t=>{try{let{chainId:e,poolId:n,amount:a,slippage:s=.01}=t,r=await w(e,n),o=r?.basePoolToken,u=g[e],m=await E(e),i=18;await f({tokenAddress:o,decimals:i,account:m,chainId:e,amount:a});let p=viem.parseUnits(a.toString(),i),{data:b}=await re({poolId:n,chainId:e,account:m,amountIn:p,slippage:s,poolType:0,state:r?.state});return await D({chainId:e,account:m,abi:M,method:"withdrawBase",args:[b],poolIds:[n]})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var jt=async t=>{try{let{chainId:e,account:n,poolId:a}=t;if(!e||!n||!a)return;let s=g[e],r=0n,u=(await q(e,[a])).data?.[0]?.price||"0",m=viem.parseUnits(u,30),p=await(await U(e)).read.pendingUserRebates([a,n,m]),[b,A]=p;return {rebates:b,genesisRebates:A}}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var $t=async(t,e)=>{if(e)try{let n=await U(t),a=0n,s=await N(t,e);return s?.price&&(a=viem.parseUnits(s.price,30)),await n.read.getPoolTokenPrice([e,a])}catch(n){throw typeof n=="string"?n:await d(n)}};var pn={};W(pn,{claimQuotePoolRebate:()=>sn,claimQuotePoolRebates:()=>on,deposit:()=>Zt,getLpPrice:()=>rn,getRewards:()=>an,transfer:()=>nn,withdraw:()=>tn,withdrawableLpAmount:()=>en});var Zt=async t=>{try{let{poolId:e,chainId:n,amount:a,slippage:s=.01,tpsl:r=[]}=t;await f(t);let o=await w(n,e);if(!o)throw new Error(C[4006]);let u=await E(n),i=x(n).QUOTE_POOL,p=o.quoteToken,b=o?.quoteDecimals;await f({tokenAddress:p,contractAddress:i,decimals:b,account:u,chainId:n,amount:a});let A=viem.parseUnits(a.toString(),b),P=await oe({poolId:e,chainId:n,account:u,amountIn:A,amount:a,slippage:s,state:o.state,quoteDecimals:b,tpsl:r,previewLpAmountOut:Ht});return P?await D({chainId:n,account:u,abi:M,method:"depositQuote",args:[P.data],poolIds:[e]}):void 0}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var en=async t=>{try{let{chainId:e,poolId:n,price:a}=t,s=a,r=await G(e);if(typeof a>"u"||a===null)try{let u=await N(e,n);s=viem.parseUnits(u?.price||"0",30);}catch{s=viem.parseUnits("0",30);}return await r.read.withdrawableLpAmount([n,s||0n])}catch(e){throw l(e),typeof e=="string"?e:await d(e)}},tn=async t=>{try{let{chainId:e,poolId:n,amount:a,slippage:s=.01}=t,r=await w(e,n),o=r?.quotePoolToken,u=await E(e),m=18;await f({tokenAddress:o,decimals:m,account:u,chainId:e,amount:a});let i=viem.parseUnits(a.toString(),m),{data:p}=await re({poolId:n,chainId:e,account:u,amountIn:i,slippage:s,poolType:1,state:r?.state});return await D({chainId:e,account:u,abi:M,method:"withdrawQuote",args:[p],poolIds:[n]})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var nn=async(t,e,n,a)=>{try{let s=await w(t,e),r=await w(t,n);if(!r||!s)return null;if([4,5].includes(r.state))throw new Error(C[4005]);let o=await E(t),u=g[t],m=18;await f({chainId:t,amount:a,account:o,decimals:m,tokenAddress:s.quotePoolToken});let i={fromPoolId:e,toPoolId:n,minLpOut:0n,amount:viem.parseUnits(a.toString(),m)},p=await Q(t),b=await p.estimateGas.migrateLiquidity([i]),A=R(b,u.gasLimitRatio),{gasPrice:P}=await T(t),h=await p.write.migrateLiquidity([i],{gasLimit:A,gasPrice:P});return await c(t).waitForTransactionReceipt({hash:h})}catch(s){throw typeof s=="string"?s:await d(s)}};var an=async t=>{try{let{chainId:e,account:n,poolId:a}=t;if(!e||!n||!a)return;let r=(await q(e,[a])).data?.[0]?.price||"0",o=viem.parseUnits(r,30);return await(await G(e)).read.pendingUserRebates([a,n,o])}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var sn=async t=>{try{let{chainId:e,poolId:n}=t,a=await E(e);return await f({account:a,chainId:e}),await D({chainId:e,account:a,abi:M,method:"claimQuotePoolRebate",args:[n,a],poolIds:[n]})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}},on=async t=>{try{let{chainId:e,poolIds:n}=t;if(n.length===0)return;let a=await E(e);return await f({account:a,chainId:e}),await D({chainId:e,account:a,abi:M,method:"claimQuotePoolRebates",args:[n,a],poolIds:n})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var rn=async(t,e)=>{if(e)try{let n=await G(t),a=0n,s=await N(t,e);return s?.price&&(a=viem.parseUnits(s.price,30)),await n.read.getPoolTokenPrice([e,a])}catch(n){throw l(n),typeof n=="string"?n:await d(n)}};var dn={};W(dn,{getMarket:()=>un,getOracleFee:()=>mn});var un=async(t,e)=>{try{if(await f({chainId:t}),!e)return;let a=await(await ee(t)).read.getMarket([e]),{quoteToken:s,baseReserveRatio:r,quoteReserveRatio:o,oracleFeeUsd:u,boostFeeUsd:m,boostRefundFeeUsd:i,poolPrimeThreshold:p,executionFee:b,maxExecutionFee:A,forwardFee:P,maxForwardFee:h}=a;return a}catch(n){throw l(n),typeof n=="string"?n:await d(n)}};var mn=async(t,e)=>{try{return await f({chainId:t}),e?await(await ee(t)).read.getOracleFee([e]):void 0}catch(n){throw l(n),typeof n=="string"?n:await d(n)}};var wd={createPool:Oe,getMarketPoolId:K,getMarketPools:Me,getPoolInfo:De,getUserGenesisShare:Fe,addTpSl:Se,cancelTpSl:ke,reprime:Ne,getPoolDetail:w,getOpenOrders:_e,boostPool:Be,unBoostPool:Ue,claimBoostFee:Le};
|
|
1
|
+
'use strict';var viem=require('viem'),_n=require('wretch'),cryptoEs=require('crypto-es'),la=require('dayjs'),lodashEs=require('lodash-es');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var _n__default=/*#__PURE__*/_interopDefault(_n);var la__default=/*#__PURE__*/_interopDefault(la);var cn=Object.defineProperty;var We=t=>{throw TypeError(t)};var W=(t,e)=>{for(var n in e)cn(t,n,{get:e[n],enumerable:true});};var Qe=(t,e,n)=>e.has(t)||We("Cannot "+n);var He=(t,e,n)=>(Qe(t,e,"read from private field"),n?n.call(t):e.get(t)),Je=(t,e,n)=>e.has(t)?We("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ye=(t,e,n,a)=>(Qe(t,e,"write to private field"),e.set(t,n),n);var Kt={};W(Kt,{claimBasePoolRebate:()=>Bt,claimBasePoolRebates:()=>Ut,deposit:()=>Qt,getLpPrice:()=>$t,getRewards:()=>jt,previewUserWithdrawData:()=>zt,withdraw:()=>Xt,withdrawableLpAmount:()=>Yt});var M=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"DifferentMarket",inputs:[{type:"bytes32",name:"fromPoolId"},{type:"bytes32",name:"toPoolId"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"ForwardedRecipientMustBeMasterAccount",inputs:[{type:"address",name:"recipient"},{type:"address",name:"master"}]},{type:"error",name:"InsufficientQuoteIn",inputs:[{type:"uint256",name:"orderId"},{type:"uint256",name:"quoteIn"},{type:"uint256",name:"exchangeDelta"}]},{type:"error",name:"InvalidAmount",inputs:[{type:"uint256",name:"amount"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidLiquidityAmount",inputs:[]},{type:"error",name:"InvalidTpsl",inputs:[{type:"uint256",name:"orderId"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"NotReachedPrice",inputs:[{type:"uint256",name:"orderId"},{type:"uint256",name:"price"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"}]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"SamePoolMigration",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"SlippageExceeded",inputs:[{type:"uint256",name:"expected"},{type:"uint256",name:"actual"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"addTpsl",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"poolType"},{type:"tuple[]",name:"tpslParams",components:[{type:"uint256",name:"amount"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"},{type:"uint256",name:"minQuoteOut"}]}]}],outputs:[]},{type:"function",name:"cancelTpsl",constant:false,payable:false,inputs:[{type:"uint256",name:"orderId"}],outputs:[]},{type:"function",name:"claimBasePoolRebate",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"recipient"}],outputs:[]},{type:"function",name:"claimBasePoolRebates",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"address",name:"recipient"}],outputs:[]},{type:"function",name:"claimQuotePoolRebate",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"recipient"}],outputs:[]},{type:"function",name:"claimQuotePoolRebates",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"address",name:"recipient"}],outputs:[]},{type:"function",name:"currentOrderId",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"depositBase",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"recipient"},{type:"tuple[]",name:"tpslParams",components:[{type:"uint256",name:"amount"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"},{type:"uint256",name:"minQuoteOut"}]}]}],outputs:[]},{type:"function",name:"depositQuote",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"recipient"},{type:"tuple[]",name:"tpslParams",components:[{type:"uint256",name:"amount"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"},{type:"uint256",name:"minQuoteOut"}]}]}],outputs:[]},{type:"function",name:"executeTpsl",constant:false,payable:false,inputs:[{type:"uint256",name:"orderId"},{type:"uint256",name:"quoteInIfNecessary"},{type:"uint256",name:"minOut"}],outputs:[{type:"uint256",name:"baseOut"},{type:"uint256",name:"quoteOut"}]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getTpslData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint256",name:"orderId"}],outputs:[{type:"tuple",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint8",name:"poolType"},{type:"uint256",name:"amount"},{type:"uint256",name:"triggerPrice"},{type:"uint8",name:"triggerType"},{type:"uint256",name:"minQuoteOut"}]}]},{type:"function",name:"getUserTpslOrderIds",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"}],outputs:[{type:"uint256[]"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"migrateLiquidity",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"fromPoolId"},{type:"bytes32",name:"toPoolId"},{type:"uint256",name:"amount"},{type:"uint256",name:"minLpOut"}]}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"withdrawBase",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"recipient"}]}],outputs:[]},{type:"function",name:"withdrawQuote",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"recipient"}]}],outputs:[]}];var Xe=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"BoostFeeClaimFailed",inputs:[]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ExceedMaxExchangeableAmount",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InsufficientReturnAmount",inputs:[{type:"uint256",name:"expected"},{type:"uint256",name:"received"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolBoostReserveInsufficient",inputs:[]},{type:"error",name:"PoolOracleFeeCharged",inputs:[]},{type:"error",name:"PoolOracleFeeNotCharged",inputs:[]},{type:"error",name:"PoolOracleFeeNotExisted",inputs:[]},{type:"error",name:"PoolOracleFeeNotSoldOut",inputs:[]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"OracleFeeExchanged",inputs:[{type:"bytes32",name:"poolId",indexed:true},{type:"uint256",name:"quoteAmount",indexed:false},{type:"uint256",name:"baseAmount",indexed:false},{type:"address",name:"recipient",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"chargeBoostFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"proposer"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"chargeOracleFeeFromPoolVault",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"poolVault"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"chargeOracleFeeFromPrimer",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"primer"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"claimBoostFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[]},{type:"function",name:"confirmBoostFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"bool",name:"isAllow"}],outputs:[]},{type:"function",name:"exchangeBaseFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"recipient"},{type:"bytes",name:"data"}],outputs:[{type:"uint256",name:"baseOut"}]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExchangeableBaseFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"quoteIn"},{type:"uint256",name:"baseOut"}]},{type:"function",name:"getPoolBoostFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"address",name:"proposer"},{type:"uint256",name:"amount"},{type:"bool",name:"isClaimable"}]}]},{type:"function",name:"getPoolOracleFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"address",name:"primer"},{type:"uint8",name:"state"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isBaseFeeSoldOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"bool"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"refreshOracleFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"withdrawOracleFee",constant:false,payable:false,inputs:[{type:"address",name:"token"},{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[]}];var gn=(o=>(o[o.LINEA_SEPOLIA=59141]="LINEA_SEPOLIA",o[o.LINEA_MAINNET=59144]="LINEA_MAINNET",o[o.ARB_TESTNET=421614]="ARB_TESTNET",o[o.ARB_MAINNET=42161]="ARB_MAINNET",o[o.BSC_TESTNET=97]="BSC_TESTNET",o[o.BSC_MAINNET=56]="BSC_MAINNET",o))(gn||{});var In=[421614,59141,97,42161,59144,56];function je(t){return !!t&&In.includes(t)}var S=10;var La={42161:130n,421614:130n,59144:130n,59141:130n,56:150n,97:150n},$e=1500000n;var Ke={chainInfo:{explorer:"https://sepolia.lineascan.build/",explorerOfTX:"https://sepolia.lineascan.build/tx/",publicJsonRPCUrl:["https://rpc.sepolia.linea.build","https://linea-sepolia.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"],label:"Linea Sepolia",logoUrl:"",faucetUrl:"",chainSymbol:"Linea",gasPriceRatio:1.3,gasLimitRatio:1.2,gasAmountRatio:2,gasFeeReservedForCollateral:(.525+1)*S,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},gasPrice:0n}};var Ze={chainInfo:{privateJsonRPCUrl:"",publicJsonRPCUrl:["https://sepolia-rollup.arbitrum.io/rpc"],label:" Arbitrum Sepolia",chainSymbol:"Arb Sepolia",explorer:"https://sepolia.arbiscan.io/",explorerOfTX:"https://sepolia.arbiscan.io/tx/",faucetUrl:"https://bwarelabs.com/faucets/arbitrum-sepolia",logoUrl:"",gasPriceRatio:1.5,gasLimitRatio:1.3,gasAmountRatio:2,gasFeeReservedForCollateral:(.055+1)*S,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},gasPrice:0n}};var et={chainInfo:{privateJsonRPCUrl:"",publicJsonRPCUrl:["https://bsc-testnet-dataseed.bnbchain.org"],label:"BNB Chain Testnet",chainSymbol:"BNB Chain Testnet",explorer:"https://testnet.bscscan.com/",explorerOfTX:"https://testnet.bscscan.com/tx/",faucetUrl:"https://docs.bnbchain.org/bnb-smart-chain/developers/faucet/",logoUrl:"",gasPriceRatio:2,gasLimitRatio:2,gasAmountRatio:2,gasFeeReservedForCollateral:(5e-4+1)*S,nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},gasPrice:0n}};var tt={chainInfo:{label:"Linea Mainnet",explorer:"https://lineascan.build/",logoUrl:"",explorerOfTX:"https://lineascan.build/tx/",publicJsonRPCUrl:["https://rpc.linea.build/","https://linea.blockpi.network/v1/rpc/public","https://1rpc.io/linea","https://rpc.linea.build"],chainSymbol:"Linea",gasPriceRatio:1.3,gasLimitRatio:1.2,gasAmountRatio:2,gasFeeReservedForCollateral:(.525+.35)*S,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},gasPrice:0n}};var nt={chainInfo:{privateJsonRPCUrl:"",publicJsonRPCUrl:["https://arb1.arbitrum.io/rpc"],label:" Arbitrum One",chainSymbol:"Arbitrum One",explorer:"https://arbiscan.io/",explorerOfTX:"https://arbiscan.io/tx/",logoUrl:"",gasPriceRatio:1.5,gasLimitRatio:1.3,gasAmountRatio:2,gasFeeReservedForCollateral:(.055+.175)*S,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},gasPrice:0n}};var at={chainInfo:{privateJsonRPCUrl:"",publicJsonRPCUrl:["https://bsc-dataseed.bnbchain.org"],label:"BNB Chain",chainSymbol:"BNB Chain",explorer:"https://bscscan.com/",explorerOfTX:"https://bscscan.com/tx/",faucetUrl:"https://docs.bnbchain.org/bnb-smart-chain/developers/faucet/",logoUrl:"",gasPriceRatio:1.5,gasLimitRatio:2,gasAmountRatio:2,gasFeeReservedForCollateral:(5e-4+1)*S,nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},gasPrice:100000000n}};var g={59141:Ke.chainInfo,421614:Ze.chainInfo,97:et.chainInfo,59144:tt.chainInfo,42161:nt.chainInfo,56:at.chainInfo};function ie(t){let e=g[t];if(!e)throw new Error(`Could not find information with chain id ${t}`);return e}var pe={};function Cn(t){if(!pe[t]){let e=ie(t),n=[...e.privateJsonRPCUrl?[e.privateJsonRPCUrl]:[],...Array.isArray(e.publicJsonRPCUrl)?[...e.publicJsonRPCUrl]:[]].filter(Boolean);if(n.length===0)throw new Error(`${t} has no jsonRPCUrl configured`);pe[t]={id:t,name:e.label||`Chain ${t}`,nativeCurrency:e.nativeCurrency,rpcUrls:{default:{http:n}}};}return pe[t]}var ue={};function c(t){if(!ue[t]){let e=ie(t),n=[...e.privateJsonRPCUrl?[e.privateJsonRPCUrl]:[],...Array.isArray(e.publicJsonRPCUrl)?[...e.publicJsonRPCUrl]:[]].filter(Boolean);if(n.length===0)throw new Error(`${t} has no jsonRPCUrl configured`);let a=n.length===1?viem.http(n[0]):viem.fallback(n.map(s=>viem.http(s)));ue[t]=viem.createPublicClient({chain:Cn(t),transport:a});}return ue[t]}var me=null;function Pn(t){me=t;}function En(){return me}async function v(t){let e=me;if(!e?.hasSigner())throw new Error("No signer: call auth({ signer }) or auth({ walletClient })");return e.getViemWalletClient(t)}var de=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"BaseFeeNotSoldOut",inputs:[]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidBaseToken",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"LPNotFullyMinted",inputs:[]},{type:"error",name:"MarketNotExist",inputs:[{type:"bytes32",name:"marketId"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolDebtNotCleared",inputs:[]},{type:"error",name:"PoolExists",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PoolNotExist",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PositionNotEmpty",inputs:[]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"error",name:"UnauthorizedUnboost",inputs:[]},{type:"error",name:"UnexpectedPoolState",inputs:[]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"benchPool",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple[]",name:"prices",components:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"oracleType"},{type:"uint64",name:"publishTime"},{type:"bytes",name:"oracleUpdateData"}]},{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"string",name:"remark"}]}],outputs:[]},{type:"function",name:"boostPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"}]}],outputs:[]},{type:"function",name:"checkPoolExists",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"bool"}]},{type:"function",name:"deployPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"marketId"},{type:"address",name:"baseToken"}]}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getMarketPool",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"address",name:"asset"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"marketId"},{type:"bytes32",name:"poolId"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"state"},{type:"bool",name:"compoundEnabled"},{type:"address",name:"basePoolToken"},{type:"address",name:"quotePoolToken"},{type:"address",name:"poolVault"},{type:"address",name:"tradingVault"}]}]},{type:"function",name:"getPairToken",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"}]},{type:"function",name:"getPool",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"marketId"},{type:"bytes32",name:"poolId"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"state"},{type:"bool",name:"compoundEnabled"},{type:"address",name:"basePoolToken"},{type:"address",name:"quotePoolToken"},{type:"address",name:"poolVault"},{type:"address",name:"tradingVault"}]}]},{type:"function",name:"getPoolMarket",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"bytes32",name:"marketId"},{type:"tuple",components:[{type:"address",name:"quoteToken"},{type:"uint32",name:"baseReserveRatio"},{type:"uint32",name:"quoteReserveRatio"},{type:"uint64",name:"oracleFeeUsd"},{type:"uint64",name:"boostFeeUsd"},{type:"uint64",name:"boostRefundFeeUsd"},{type:"uint128",name:"poolPrimeThreshold"},{type:"uint128",name:"executionFee"},{type:"uint128",name:"maxExecutionFee"},{type:"uint128",name:"forwardFee"},{type:"uint128",name:"maxForwardFee"}]}]},{type:"function",name:"getPoolMarketExecutionFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"executionFee"}]},{type:"function",name:"getPoolMarketForwardFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"forwardFee"}]},{type:"function",name:"getPoolMarketId",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"bytes32",name:"marketId"}]},{type:"function",name:"getPoolRiskTier",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint8"}]},{type:"function",name:"getPoolVault",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"address"}]},{type:"function",name:"getPools",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32[]",name:"pools"}]},{type:"function",name:"getTradingVault",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"address"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isPoolAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"addr"}],outputs:[{type:"bool"}]},{type:"function",name:"perBenchPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"string",name:"remark"}]}],outputs:[]},{type:"function",name:"primePool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"referencePrice"}]}],outputs:[]},{type:"function",name:"primePoolFromBoost",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"}]}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"reprimePool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"}]}],outputs:[]},{type:"function",name:"trenchPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"bytes32",name:"oracleFeedId"},{type:"uint32",name:"oracleDecimals"},{type:"uint8",name:"oracleType"},{type:"uint8",name:"riskTier"}]}],outputs:[]},{type:"function",name:"unboostPool",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"bytes32",name:"poolId"}]}],outputs:[]},{type:"function",name:"updatePoolCompoundEnabled",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"bool",name:"enabled"}]}],outputs:[]},{type:"function",name:"updatePoolRiskTiers",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"riskTier"}]}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var O=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{anonymous:false,inputs:[{indexed:true,internalType:"address",name:"owner",type:"address"},{indexed:true,internalType:"address",name:"spender",type:"address"},{indexed:false,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:false,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:false,inputs:[{indexed:true,internalType:"address",name:"previousOwner",type:"address"},{indexed:true,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:false,inputs:[{indexed:true,internalType:"address",name:"from",type:"address"},{indexed:true,internalType:"address",name:"to",type:"address"},{indexed:false,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];var le=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InsufficientOutputAmount",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolNotActive",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PoolNotExist",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeCastOverflowedUintToInt",inputs:[{type:"uint256",name:"value"}]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"QuotePoolProfitDistributed",inputs:[{type:"bytes32",name:"poolId",indexed:false},{type:"uint256",name:"amount",indexed:false},{type:"uint256",name:"genesisAmount",indexed:false},{type:"uint256",name:"price",indexed:false},{type:"uint256",name:"exchangeRate",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"EXCHANGE_RATE_PRECISION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"POOL_TOKEN_DECIMALS",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"REBATE_INDEX_PRECISION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"claimUserRebate",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"rebateOut"}]},{type:"function",name:"claimUserRebates",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256[]",name:"rebateOut"}]},{type:"function",name:"deposit",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"amountOut"}]},{type:"function",name:"distribute",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amount"},{type:"uint256",name:"genesisAmount"},{type:"uint256",name:"price"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExchangeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getExchangeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getPoolData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"uint256",name:"genesisRebateIndex"}]}]},{type:"function",name:"getPoolTokenPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"getUserData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"}],outputs:[{type:"tuple",components:[{type:"uint256",name:"index"},{type:"uint256",name:"accrued"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"pendingUserRebates",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewLpAmountOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"quoteAmountIn"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewPoolTokenPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewQuoteAmountOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"lpAmountIn"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewUserWithdrawData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"lpAmountIn"},{type:"address",name:"user"},{type:"uint256",name:"price"}],outputs:[{type:"uint256",name:"quoteAmountOut"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"updatePool",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"oraclePrice"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"withdraw",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"amountOut"},{type:"uint256",name:"rebateOut"}]},{type:"function",name:"withdrawableLpAmount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]}];var ye=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ExceedMaxProfit",inputs:[]},{type:"error",name:"ExceedMinOutputAmount",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InsufficientOutputAmount",inputs:[]},{type:"error",name:"InsufficientReturnAmount",inputs:[{type:"uint256",name:"expected"},{type:"uint256",name:"received"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolNotActive",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PoolNotCompoundable",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"PoolNotExist",inputs:[{type:"bytes32",name:"poolId"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeCastOverflowedUintToInt",inputs:[{type:"uint256",name:"value"}]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"BasePoolProfitDistributed",inputs:[{type:"bytes32",name:"poolId",indexed:true},{type:"uint256",name:"baseAmount",indexed:false},{type:"uint256",name:"quoteAmount",indexed:false},{type:"uint256",name:"price",indexed:false},{type:"uint256",name:"exchangeRate",indexed:false},{type:"uint256",name:"rebateIndex",indexed:false},{type:"uint256",name:"genesisRebateIndex",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"PoolProfitExchanged",inputs:[{type:"bytes32",name:"poolId",indexed:true},{type:"uint256",name:"baseIn",indexed:false},{type:"uint256",name:"quoteOut",indexed:false},{type:"uint256",name:"price",indexed:false},{type:"address",name:"recipient",indexed:false}]},{type:"event",anonymous:false,name:"PoolRebateIndexUpdated",inputs:[{type:"bytes32",name:"poolId",indexed:true},{type:"uint256",name:"unexchangedProfits",indexed:false},{type:"uint256",name:"oldIndex",indexed:false},{type:"uint256",name:"newIndex",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"EXCHANGE_RATE_PRECISION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"POOL_TOKEN_DECIMALS",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"REBATE_INDEX_PRECISION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"claimUserRebate",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"rebateOut"}]},{type:"function",name:"claimUserRebates",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256[]",name:"rebateOut"}]},{type:"function",name:"deposit",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"amountOut"}]},{type:"function",name:"distribute",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"},{type:"uint256",name:"genesisAmount"},{type:"uint256",name:"price"}],outputs:[]},{type:"function",name:"exchangeProfit",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"baseIn"},{type:"uint256",name:"minQuoteOut"},{type:"address",name:"recipient"},{type:"bytes",name:"data"}],outputs:[{type:"uint256",name:"quoteOut"}]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExchangeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getExchangeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"getExchangeableProfit",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256",name:"baseIn"},{type:"uint256",name:"quoteOut"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getPoolData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"tuple",components:[{type:"uint256",name:"rebateIndex"},{type:"uint256",name:"genesisRebateIndex"},{type:"uint256",name:"exchangeableProfits"}]}]},{type:"function",name:"getPoolTokenPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"getUserData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"}],outputs:[{type:"tuple",components:[{type:"uint256",name:"index"},{type:"uint256",name:"genesisIndex"},{type:"uint256",name:"accrued"},{type:"uint256",name:"genesisAccrued"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"pendingUserRebates",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"uint256",name:"price"}],outputs:[{type:"uint256",name:"rebates"},{type:"uint256",name:"genesisRebates"}]},{type:"function",name:"previewBaseAmountOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"lpAmountIn"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewExchangeableProfit",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"baseIn"},{type:"uint256",name:"quoteOut"}]},{type:"function",name:"previewLpAmountOut",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"baseAmountIn"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewPoolTokenPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256"}]},{type:"function",name:"previewUserWithdrawData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"lpAmountIn"},{type:"address",name:"user"},{type:"uint256",name:"price"}],outputs:[{type:"uint256",name:"baseAmountOut"},{type:"uint256",name:"rebateAmount"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"updatePool",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"oraclePrice"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"withdraw",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"amountIn"},{type:"uint256",name:"minAmountOut"},{type:"address",name:"user"},{type:"address",name:"recipient"}],outputs:[{type:"uint256",name:"amountOut"},{type:"uint256",name:"rebateOut"}]},{type:"function",name:"withdrawableLpAmount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"price"}],outputs:[{type:"uint256"}]}];var ce=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ECDSAInvalidSignature",inputs:[]},{type:"error",name:"ECDSAInvalidSignatureLength",inputs:[{type:"uint256",name:"length"}]},{type:"error",name:"ECDSAInvalidSignatureS",inputs:[{type:"bytes32",name:"s"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ExpiredFeeData",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InsufficientBalance",inputs:[]},{type:"error",name:"InvalidFeeRate",inputs:[]},{type:"error",name:"InvalidFeeTier",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"NoRebateToClaim",inputs:[]},{type:"error",name:"NotBrokerSigner",inputs:[{type:"address",name:"signer"}]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"OwnableInvalidOwner",inputs:[{type:"address",name:"owner"}]},{type:"error",name:"OwnableUnauthorizedAccount",inputs:[{type:"address",name:"account"}]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"error",name:"UnsupportedAssetClass",inputs:[{type:"uint8",name:"assetClass"}]},{type:"error",name:"UnsupportedFeeTier",inputs:[{type:"uint8",name:"tier"}]},{type:"event",anonymous:false,name:"BrokerFeesWithdrawn",inputs:[{type:"address",name:"broker",indexed:true},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false},{type:"address",name:"recipient",indexed:false}]},{type:"event",anonymous:false,name:"BrokerStatusUpdated",inputs:[{type:"address",name:"broker",indexed:false},{type:"bool",name:"isActive",indexed:false}]},{type:"event",anonymous:false,name:"EIP712DomainChanged",inputs:[]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"OwnershipTransferStarted",inputs:[{type:"address",name:"previousOwner",indexed:true},{type:"address",name:"newOwner",indexed:true}]},{type:"event",anonymous:false,name:"OwnershipTransferred",inputs:[{type:"address",name:"previousOwner",indexed:true},{type:"address",name:"newOwner",indexed:true}]},{type:"event",anonymous:false,name:"RebateClaimed",inputs:[{type:"address",name:"user",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"SignerUpdated",inputs:[{type:"address",name:"signer",indexed:false},{type:"bool",name:"isSigner",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"FEE_TYPEHASH",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"acceptOwnership",constant:false,payable:false,inputs:[],outputs:[]},{type:"function",name:"activeFeeTiers",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"}],outputs:[{type:"uint256[]"}]},{type:"function",name:"activeSpecialFeeTierList",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"}],outputs:[{type:"uint256[]"}]},{type:"function",name:"addressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"batchSetSpecialFeeTiers",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"},{type:"int32",name:"makerFeeRate"},{type:"uint32",name:"takerFeeRate"}]}],outputs:[]},{type:"function",name:"batchUpdateFeeTiers",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"},{type:"tuple",name:"addOnFeeRate",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}]}],outputs:[]},{type:"function",name:"checkAndResetExpiredTier",constant:false,payable:false,inputs:[{type:"address",name:"user"}],outputs:[]},{type:"function",name:"claimRebate",constant:false,payable:false,inputs:[{type:"address",name:"token"}],outputs:[]},{type:"function",name:"claimRebates",constant:false,payable:false,inputs:[{type:"address[]",name:"tokens"}],outputs:[]},{type:"function",name:"domainSeparatorV4",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"eip712Domain",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes1",name:"fields"},{type:"string",name:"name"},{type:"string",name:"version"},{type:"uint256",name:"chainId"},{type:"address",name:"verifyingContract"},{type:"bytes32",name:"salt"},{type:"uint256[]",name:"extensions"}]},{type:"function",name:"getAddOnFeeTier",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"}],outputs:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]},{type:"function",name:"getBaseFeeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"}],outputs:[{type:"tuple",name:"baseFeeRate",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}]},{type:"function",name:"getSpecialFeeTier",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"}],outputs:[{type:"int32",name:"makerFeeRate"},{type:"uint32",name:"takerFeeRate"}]},{type:"function",name:"getUserFeeRate",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"},{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"}],outputs:[{type:"uint32",name:"takerFeeRate"},{type:"int32",name:"makerFeeRate"},{type:"uint32",name:"baseTakerFeeRate"},{type:"uint32",name:"baseMakerFeeRate"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"_addressManager"},{type:"address",name:"owner"},{type:"string",name:"_brokerName"},{type:"address[]",name:"brokerSigners"},{type:"uint8[]",name:"assetClasses"},{type:"tuple[]",name:"baseFeeRates",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}],outputs:[]},{type:"function",name:"isActive",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"name",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"onBrokerFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"},{type:"address",name:"token"},{type:"uint256",name:"feeAmount"}],outputs:[{type:"uint256",name:"totalReferralRebate"},{type:"uint256",name:"referrerRebate"},{type:"address",name:"referrer"}]},{type:"function",name:"owner",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"pendingOwner",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"renounceOwnership",constant:false,payable:false,inputs:[],outputs:[]},{type:"function",name:"setSigner",constant:false,payable:false,inputs:[{type:"address",name:"signer"},{type:"bool",name:"isSigner"}],outputs:[]},{type:"function",name:"setSpecialFeeTier",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"},{type:"int32",name:"makerFeeRate"},{type:"uint32",name:"takerFeeRate"}]}],outputs:[]},{type:"function",name:"setUserFeeData",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"address",name:"user"},{type:"uint64",name:"nonce"},{type:"uint64",name:"deadline"},{type:"tuple",name:"feeData",components:[{type:"uint8",name:"tier"},{type:"address",name:"referrer"},{type:"uint32",name:"totalReferralRebatePct"},{type:"uint32",name:"referrerRebatePct"},{type:"uint64",name:"expiry"}]},{type:"bytes",name:"signature"}]}],outputs:[]},{type:"function",name:"setUserSpecialFeeTier",constant:false,payable:false,inputs:[{type:"address",name:"user"},{type:"uint8",name:"feeTier"}],outputs:[]},{type:"function",name:"supportedAssetClasses",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256[]"}]},{type:"function",name:"syncAssetClass",constant:false,payable:false,inputs:[{type:"uint8",name:"assetClass"}],outputs:[]},{type:"function",name:"transferOwnership",constant:false,payable:false,inputs:[{type:"address",name:"newOwner"}],outputs:[]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"updateBaseFeeRates",constant:false,payable:false,inputs:[{type:"tuple[]",name:"params",components:[{type:"uint8",name:"assetClass"},{type:"bool",name:"isEnable"},{type:"tuple",name:"baseFeeRate",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}]}],outputs:[]},{type:"function",name:"updateBrokerStatus",constant:false,payable:false,inputs:[{type:"bool",name:"active"}],outputs:[]},{type:"function",name:"updateFeeTier",constant:false,payable:false,inputs:[{type:"uint8",name:"assetClass"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"feeTier"},{type:"tuple",name:"feeRate",components:[{type:"uint32",name:"takerFeeRate"},{type:"uint32",name:"makerFeeRate"}]}],outputs:[]},{type:"function",name:"updateUserFeeData",constant:false,payable:false,inputs:[{type:"address",name:"user"},{type:"tuple",name:"feeData",components:[{type:"uint8",name:"tier"},{type:"address",name:"referrer"},{type:"uint32",name:"totalReferralRebatePct"},{type:"uint32",name:"referrerRebatePct"},{type:"uint64",name:"expiry"}]}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"userFeeData",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"}],outputs:[{type:"uint8",name:"tier"},{type:"address",name:"referrer"},{type:"uint32",name:"totalReferralRebatePct"},{type:"uint32",name:"referrerRebatePct"},{type:"uint64",name:"expiry"}]},{type:"function",name:"userNonces",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"}],outputs:[{type:"uint64",name:"nonce"}]},{type:"function",name:"userRebates",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"rebateAmount"}]},{type:"function",name:"withdrawBrokerFees",constant:false,payable:false,inputs:[{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"address",name:"recipient"}],outputs:[]}];var fe=[{type:"constructor",payable:false,inputs:[]},{type:"error",name:"ERC20InsufficientAllowance",inputs:[{type:"address",name:"spender"},{type:"uint256",name:"allowance"},{type:"uint256",name:"needed"}]},{type:"error",name:"ERC20InsufficientBalance",inputs:[{type:"address",name:"sender"},{type:"uint256",name:"balance"},{type:"uint256",name:"needed"}]},{type:"error",name:"ERC20InvalidApprover",inputs:[{type:"address",name:"approver"}]},{type:"error",name:"ERC20InvalidReceiver",inputs:[{type:"address",name:"receiver"}]},{type:"error",name:"ERC20InvalidSender",inputs:[{type:"address",name:"sender"}]},{type:"error",name:"ERC20InvalidSpender",inputs:[{type:"address",name:"spender"}]},{type:"error",name:"InsufficientBalance",inputs:[{type:"address",name:"account"},{type:"uint256",name:"balance"},{type:"uint256",name:"needed"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"event",anonymous:false,name:"Approval",inputs:[{type:"address",name:"owner",indexed:true},{type:"address",name:"spender",indexed:true},{type:"uint256",name:"value",indexed:false}]},{type:"event",anonymous:false,name:"GenesisShareBurned",inputs:[{type:"address",name:"account",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"GenesisShareMinted",inputs:[{type:"address",name:"account",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"Transfer",inputs:[{type:"address",name:"from",indexed:true},{type:"address",name:"to",indexed:true},{type:"uint256",name:"value",indexed:false}]},{type:"function",name:"addressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"allowance",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"owner"},{type:"address",name:"spender"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",constant:false,payable:false,inputs:[{type:"address",name:"spender"},{type:"uint256",name:"value"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"}],outputs:[{type:"uint256"}]},{type:"function",name:"burnFrom",constant:false,payable:false,inputs:[{type:"address",name:"from"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"decimals",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"_addressManager"},{type:"bytes32",name:"_poolId"},{type:"address",name:"_underlyingToken"},{type:"string",name:"name"},{type:"string",name:"symbol"}],outputs:[]},{type:"function",name:"mint",constant:false,payable:false,inputs:[{type:"address",name:"to"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"name",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"poolId",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"symbol",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalGenesisShare",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"totalSupply",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",constant:false,payable:false,inputs:[{type:"address",name:"to"},{type:"uint256",name:"value"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",constant:false,payable:false,inputs:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"}],outputs:[{type:"bool"}]},{type:"function",name:"underlyingToken",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"userGenesisShare",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"}],outputs:[{type:"uint256"}]}];var be=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"InvalidQuoteTokenAddress",inputs:[]},{type:"error",name:"InvalidRatioParams",inputs:[]},{type:"error",name:"MarketAlreadyExisted",inputs:[]},{type:"error",name:"MarketNotExisted",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"ExecutionFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint256",name:"oldExecutionFee",indexed:false},{type:"uint256",name:"newExecutionFee",indexed:false}]},{type:"event",anonymous:false,name:"ForwardFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint256",name:"oldForwardFee",indexed:false},{type:"uint256",name:"newForwardFee",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"MaxExecutionFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint256",name:"oldMaxExecutionFee",indexed:false},{type:"uint256",name:"newMaxExecutionFee",indexed:false}]},{type:"event",anonymous:false,name:"MaxForwardFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint256",name:"oldMaxForwardFee",indexed:false},{type:"uint256",name:"newMaxForwardFee",indexed:false}]},{type:"event",anonymous:false,name:"OracleFeeUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint64",name:"newOracleFeeUsd",indexed:false}]},{type:"event",anonymous:false,name:"PoolPrimeThresholdUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint128",name:"newPoolPrimeThreshold",indexed:false}]},{type:"event",anonymous:false,name:"ReserveRatioUpdated",inputs:[{type:"bytes32",name:"marketId",indexed:false},{type:"uint32",name:"newBaseReserveRatio",indexed:false},{type:"uint32",name:"newQuoteReserveRatio",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"createMarket",constant:false,payable:false,inputs:[{type:"tuple",name:"params",components:[{type:"uint64",name:"chainId"},{type:"address",name:"quoteToken"},{type:"uint32",name:"baseReserveRatio"},{type:"uint32",name:"quoteReserveRatio"},{type:"uint64",name:"oracleFeeUsd"},{type:"uint64",name:"boostFeeUsd"},{type:"uint64",name:"boostRefundFeeUsd"},{type:"uint128",name:"poolPrimeThreshold"},{type:"uint128",name:"executionFee"},{type:"uint128",name:"maxExecutionFee"},{type:"uint128",name:"forwardFee"},{type:"uint128",name:"maxForwardFee"}]},{type:"tuple",name:"quoteParams",components:[{type:"address",name:"priceContract"},{type:"bool",name:"applyExchangeRate"},{type:"uint16",name:"minDeviationRatio"}]}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getBoostFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getBoostRefundFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExecutionFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getExecutionFeeByToken",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"quoteToken"}],outputs:[{type:"uint256"}]},{type:"function",name:"getForwardFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"getForwardFeeByToken",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"quoteToken"}],outputs:[{type:"uint256"}]},{type:"function",name:"getMarket",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"tuple",components:[{type:"address",name:"quoteToken"},{type:"uint32",name:"baseReserveRatio"},{type:"uint32",name:"quoteReserveRatio"},{type:"uint64",name:"oracleFeeUsd"},{type:"uint64",name:"boostFeeUsd"},{type:"uint64",name:"boostRefundFeeUsd"},{type:"uint128",name:"poolPrimeThreshold"},{type:"uint128",name:"executionFee"},{type:"uint128",name:"maxExecutionFee"},{type:"uint128",name:"forwardFee"},{type:"uint128",name:"maxForwardFee"}]}]},{type:"function",name:"getMarketIds",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32[]"}]},{type:"function",name:"getOracleFee",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"uint256"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"marketExists",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"marketId"}],outputs:[{type:"bool"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"updateExecutionFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_executionFee"}],outputs:[]},{type:"function",name:"updateForwardFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_forwardFee"}],outputs:[]},{type:"function",name:"updateMarketQuoteConfiguration",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"tuple",name:"quoteParams",components:[{type:"address",name:"priceContract"},{type:"bool",name:"applyExchangeRate"},{type:"uint16",name:"minDeviationRatio"}]}],outputs:[]},{type:"function",name:"updateMaxExecutionFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_maxExecutionFee"}],outputs:[]},{type:"function",name:"updateMaxForwardFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_maxForwardFee"}],outputs:[]},{type:"function",name:"updateOracleFee",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint64",name:"_oracleFeeUsd"}],outputs:[]},{type:"function",name:"updatePoolPrimeThreshold",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint128",name:"_poolPrimeThreshold"}],outputs:[]},{type:"function",name:"updateReserveRatio",constant:false,payable:false,inputs:[{type:"bytes32",name:"marketId"},{type:"uint32",name:"_baseReserveRatio"},{type:"uint32",name:"_quoteReserveRatio"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var ge=[{type:"error",name:"PositionNotHealthy",inputs:[{type:"bytes32",name:"positionId"},{type:"uint256",name:"marginRatio"}]},{type:"error",name:"SafeCastOverflowedUintToInt",inputs:[{type:"uint256",name:"value"}]},{type:"function",name:"ADDRESS_MANAGER",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getAccountInfo",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"user"}],outputs:[{type:"tuple",name:"accountInfo",components:[{type:"uint256",name:"freeMargin"},{type:"uint256",name:"walletBalance"},{type:"uint256",name:"freeBaseAmount"},{type:"uint256",name:"baseProfit"},{type:"uint256",name:"quoteProfit"},{type:"uint256",name:"reservedAmount"},{type:"uint64",name:"releaseTime"}]}]},{type:"function",name:"getAvailableLiquiditySize",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint256",name:"executePrice"}],outputs:[{type:"uint256"}]},{type:"function",name:"getBrokerFeeTiers",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"brokerAddress"},{type:"uint8[]",name:"assetClasses"},{type:"uint8[]",name:"riskTiers"},{type:"bool",name:"isMYXBroker"}],outputs:[{type:"tuple[]",name:"brokerFees",components:[{type:"uint8",name:"asset"},{type:"tuple[]",name:"riskTieredBrokerFees",components:[{type:"uint8",name:"riskTier"},{type:"tuple[]",name:"addOnFeeTiers",components:[{type:"uint8",name:"tier"},{type:"uint32",name:"takerFeeRate"},{type:"int32",name:"makerFeeRate"}]},{type:"tuple[]",name:"baseFeeRate",components:[{type:"uint8",name:"assetClass"},{type:"uint32",name:"makerFeeRate"},{type:"uint32",name:"takerFeeRate"}]},{type:"tuple[]",name:"specialFeeTiers",components:[{type:"uint8",name:"tier"},{type:"uint32",name:"takerFeeRate"},{type:"int32",name:"makerFeeRate"}]}]}]}]},{type:"function",name:"getExchangeables",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"uint256[]",name:"marketPrices"}],outputs:[{type:"tuple[]",name:"exchangeables",components:[{type:"uint256",name:"maxBaseIn"},{type:"uint256",name:"maxQuoteIn"},{type:"uint256",name:"maxBaseOut"},{type:"uint256",name:"maxQuoteOut"}]}]},{type:"function",name:"getLiquidationPrice",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"positionId"},{type:"uint256",name:"marketPrice"}],outputs:[{type:"uint256"}]},{type:"function",name:"getPoolInfo",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"marketPrice"}],outputs:[{type:"tuple",components:[{type:"tuple",name:"basePool",components:[{type:"address",name:"poolToken"},{type:"uint256",name:"exchangeRate"},{type:"uint256",name:"poolTokenPrice"},{type:"uint256",name:"poolTokenSupply"},{type:"uint256",name:"totalDebt"},{type:"uint256",name:"baseCollateral"}]},{type:"tuple",name:"quotePool",components:[{type:"address",name:"poolToken"},{type:"uint256",name:"exchangeRate"},{type:"uint256",name:"poolTokenPrice"},{type:"uint256",name:"poolTokenSupply"},{type:"uint256",name:"totalDebt"},{type:"uint256",name:"baseCollateral"}]},{type:"tuple",name:"reserveInfo",components:[{type:"uint256",name:"baseTotalAmount"},{type:"uint256",name:"baseReservedAmount"},{type:"uint256",name:"quoteTotalAmount"},{type:"uint256",name:"quoteReservedAmount"}]},{type:"tuple",name:"fundingInfo",components:[{type:"int256",name:"nextFundingRate"},{type:"int256",name:"lastFundingFeeTracker"},{type:"uint256",name:"nextEpochTime"}]},{type:"tuple",name:"oi",components:[{type:"int256",name:"tracker"},{type:"uint256",name:"longSize"},{type:"uint256",name:"shortSize"},{type:"uint256",name:"poolEntryPrice"}]},{type:"tuple",name:"liquidityInfo",components:[{type:"uint256",name:"windowCaps"},{type:"int256",name:"openInterest"}]}]}]},{type:"function",name:"getPoolInfos",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"uint256[]",name:"marketPrices"}],outputs:[{type:"tuple[]",components:[{type:"tuple",name:"basePool",components:[{type:"address",name:"poolToken"},{type:"uint256",name:"exchangeRate"},{type:"uint256",name:"poolTokenPrice"},{type:"uint256",name:"poolTokenSupply"},{type:"uint256",name:"totalDebt"},{type:"uint256",name:"baseCollateral"}]},{type:"tuple",name:"quotePool",components:[{type:"address",name:"poolToken"},{type:"uint256",name:"exchangeRate"},{type:"uint256",name:"poolTokenPrice"},{type:"uint256",name:"poolTokenSupply"},{type:"uint256",name:"totalDebt"},{type:"uint256",name:"baseCollateral"}]},{type:"tuple",name:"reserveInfo",components:[{type:"uint256",name:"baseTotalAmount"},{type:"uint256",name:"baseReservedAmount"},{type:"uint256",name:"quoteTotalAmount"},{type:"uint256",name:"quoteReservedAmount"}]},{type:"tuple",name:"fundingInfo",components:[{type:"int256",name:"nextFundingRate"},{type:"int256",name:"lastFundingFeeTracker"},{type:"uint256",name:"nextEpochTime"}]},{type:"tuple",name:"oi",components:[{type:"int256",name:"tracker"},{type:"uint256",name:"longSize"},{type:"uint256",name:"shortSize"},{type:"uint256",name:"poolEntryPrice"}]},{type:"tuple",name:"liquidityInfo",components:[{type:"uint256",name:"windowCaps"},{type:"int256",name:"openInterest"}]}]}]},{type:"function",name:"getPoolTokenPrices",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32[]",name:"poolIds"},{type:"uint256[]",name:"marketPrices"}],outputs:[{type:"tuple[]",components:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"basePoolTokenPrice"},{type:"uint256",name:"quotePoolTokenPrice"}]}]},{type:"function",name:"getPositionFees",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"positionId"},{type:"address",name:"broker"},{type:"uint256",name:"price"}],outputs:[{type:"int256",name:"netCollateral"},{type:"uint256",name:"collateralAmount"},{type:"int256",name:"tradingFee"},{type:"int256",name:"fundingFee"},{type:"int256",name:"unrealizedPnl"}]},{type:"function",name:"getRiskParameters",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint8",name:"maxRiskTier"}],outputs:[{type:"tuple[]",name:"params",components:[{type:"tuple",name:"tradeLimitParams",components:[{type:"uint64",name:"minTradeUsd"},{type:"uint16",name:"maxPriceDeviation"}]},{type:"tuple",name:"riskLockParams",components:[{type:"uint64",name:"windowCapUsd"},{type:"uint64",name:"liquidityWindowSize"},{type:"uint64",name:"profitWindowSize"},{type:"uint16",name:"priceRangePct"},{type:"uint32",name:"baseSlippage"}]},{type:"tuple",name:"poolConfigParams",components:[{type:"uint16",name:"leverage"},{type:"uint16",name:"maintainMarginRate"},{type:"uint16",name:"baseTokenCollateralRatio"},{type:"uint16",name:"exchangeIncentiveRate"},{type:"uint16",name:"genesisRebateRatio"},{type:"uint8",name:"assetClass"}]},{type:"tuple",name:"fundingRateParams",components:[{type:"int32",name:"maxRate"},{type:"uint32",name:"equilibriumRange"},{type:"int32",name:"lowGrowthRate"},{type:"int32",name:"highGrowthRate"},{type:"uint32",name:"epochDuration"}]}]}]},{type:"function",name:"getSumProfitLock",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address[]",name:"respondents"}],outputs:[{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"},{type:"tuple[]",name:"infos",components:[{type:"address",name:"account"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}]}]},{type:"function",name:"getUserPositionInfos",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"},{type:"bytes32[]",name:"poolIds"}],outputs:[{type:"tuple[]",name:"positions",components:[{type:"bytes32",name:"positionId"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"size"},{type:"uint256",name:"entryPrice"},{type:"int256",name:"fundingRateIndex"},{type:"uint256",name:"earlyClosePrice"},{type:"uint8",name:"direction"},{type:"uint8",name:"riskTier"},{type:"uint64",name:"lastUpdateTime"},{type:"uint256",name:"collateralAmount"}]}]}];var Ie=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ERC2771ForwarderExpiredRequest",inputs:[{type:"uint48",name:"deadline"}]},{type:"error",name:"ERC2771ForwarderInvalidSigner",inputs:[{type:"address",name:"signer"},{type:"address",name:"from"}]},{type:"error",name:"ERC2771ForwarderMismatchedValue",inputs:[{type:"uint256",name:"requestedValue"},{type:"uint256",name:"msgValue"}]},{type:"error",name:"ERC2771UntrustfulTarget",inputs:[{type:"address",name:"target"},{type:"address",name:"forwarder"}]},{type:"error",name:"ExceedsMaximumRelayFee",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InconsistentParamsLength",inputs:[]},{type:"error",name:"InsufficientBalance",inputs:[{type:"uint256",name:"balance"},{type:"uint256",name:"needed"}]},{type:"error",name:"InsufficientFeeAllowance",inputs:[{type:"address",name:"user"},{type:"uint256",name:"allowance"},{type:"uint256",name:"required"}]},{type:"error",name:"InsufficientFeeBalance",inputs:[{type:"address",name:"user"},{type:"uint256",name:"balance"},{type:"uint256",name:"required"}]},{type:"error",name:"InvalidAccountNonce",inputs:[{type:"address",name:"account"},{type:"uint256",name:"currentNonce"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"MismatchExecuteFee",inputs:[{type:"uint256",name:"balanceBefore"},{type:"uint256",name:"balanceAfter"},{type:"uint256",name:"expected"}]},{type:"error",name:"MismatchedSender",inputs:[{type:"address",name:"sender"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotAllowedTarget",inputs:[{type:"address",name:"target"}]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"OnlyRelayer",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"RelayerRegistered",inputs:[{type:"address",name:"relayer"}]},{type:"error",name:"RemoveRelayerFailed",inputs:[]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"AddAllowedTarget",inputs:[{type:"address",name:"target",indexed:false}]},{type:"event",anonymous:false,name:"ChargeForwardFee",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"feeToken",indexed:false},{type:"uint256",name:"relayFee",indexed:false}]},{type:"event",anonymous:false,name:"EIP712DomainChanged",inputs:[]},{type:"event",anonymous:false,name:"ERC20PermitFailed",inputs:[{type:"address",name:"token",indexed:false},{type:"string",name:"reason",indexed:false}]},{type:"event",anonymous:false,name:"ERC20PermitLowLevelFailed",inputs:[{type:"bytes",name:"data",indexed:false}]},{type:"event",anonymous:false,name:"ExecutedForwardRequest",inputs:[{type:"address",name:"signer",indexed:true},{type:"uint256",name:"nonce",indexed:false},{type:"bool",name:"success",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"RemoveAllowedTarget",inputs:[{type:"address",name:"target",indexed:false}]},{type:"event",anonymous:false,name:"SetUserRelayer",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"relayer",indexed:false},{type:"bool",name:"enable",indexed:false}]},{type:"event",anonymous:false,name:"UpdateAcquiescentFeeToken",inputs:[{type:"address",name:"sender",indexed:false},{type:"address",name:"oldRelayGas",indexed:false},{type:"address",name:"newRelayGas",indexed:false}]},{type:"event",anonymous:false,name:"UpdateEquilibriumGas",inputs:[{type:"address",name:"sender",indexed:false},{type:"uint256",name:"oldRelayGas",indexed:false},{type:"uint256",name:"newRelayGas",indexed:false}]},{type:"event",anonymous:false,name:"UpdateMaxRelayFee",inputs:[{type:"address",name:"sender",indexed:false},{type:"uint256",name:"oldMaxRelayFee",indexed:false},{type:"uint256",name:"newMaxRelayFee",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"addAllowedTarget",constant:false,payable:false,inputs:[{type:"address",name:"target"}],outputs:[]},{type:"function",name:"batchExecuteForwarder",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"forwardFeeToken"},{type:"tuple[]",name:"bundleParams",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]}],outputs:[]},{type:"function",name:"eip712Domain",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes1",name:"fields"},{type:"string",name:"name"},{type:"string",name:"version"},{type:"uint256",name:"chainId"},{type:"address",name:"verifyingContract"},{type:"bytes32",name:"salt"},{type:"uint256[]",name:"extensions"}]},{type:"function",name:"equilibriumGas",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"execute",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]},{type:"address"}],outputs:[]},{type:"function",name:"executeBatch",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple[]",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]},{type:"address"},{type:"address"}],outputs:[]},{type:"function",name:"executeForwarder",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"forwardFeeToken"},{type:"tuple",name:"params",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]}],outputs:[]},{type:"function",name:"exitForwardMode",constant:false,payable:false,inputs:[],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getAllowedTargets",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address[]"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getDesignatedToken",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getEquilibriumGas",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getUserRelayers",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"}],outputs:[{type:"address[]"}]},{type:"function",name:"inForwardMode",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bool"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"},{type:"uint256",name:"_equilibriumGas"}],outputs:[]},{type:"function",name:"isAllowedTargets",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"contractAddr"}],outputs:[{type:"bool"}]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"isUserRelayerEnabled",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"},{type:"address",name:"relayer"}],outputs:[{type:"bool"}]},{type:"function",name:"nonces",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"owner"}],outputs:[{type:"uint256"}]},{type:"function",name:"originAccount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"relayer"}],outputs:[{type:"address",name:"account"}]},{type:"function",name:"permitAndApproveForwarder",constant:false,payable:false,inputs:[{type:"address",name:"relayer"},{type:"bool",name:"enable"},{type:"tuple[]",name:"permitParams",components:[{type:"address",name:"token"},{type:"address",name:"owner"},{type:"address",name:"spender"},{type:"uint256",name:"value"},{type:"uint256",name:"deadline"},{type:"uint8",name:"v"},{type:"bytes32",name:"r"},{type:"bytes32",name:"s"}]}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"removeAllowedTarget",constant:false,payable:false,inputs:[{type:"address",name:"target"}],outputs:[]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"updateEquilibriumGas",constant:false,payable:false,inputs:[{type:"uint256",name:"_equilibriumGas"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"verify",constant:true,stateMutability:"view",payable:false,inputs:[{type:"tuple",name:"request",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]}],outputs:[{type:"bool"}]}];var xe=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"AlreadyClaimed",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"user"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidAmount",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"user"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"MerkleTreeVerificationFailed",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"user"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReimbursementValidity",inputs:[{type:"uint256",name:"caseId"}]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"TreeAlreadySet",inputs:[]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementClaimExpired",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"user",indexed:false},{type:"address",name:"baseToken",indexed:false},{type:"address",name:"quoteToken",indexed:false},{type:"uint256",name:"baseAmount",indexed:false},{type:"uint256",name:"quoteAmount",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementClaimed",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"user",indexed:false},{type:"address",name:"baseToken",indexed:false},{type:"address",name:"quoteToken",indexed:false},{type:"uint256",name:"baseAmount",indexed:false},{type:"uint256",name:"quoteAmount",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementInfoSet",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"bytes32",name:"merkleRoot",indexed:false},{type:"address",name:"baseToken",indexed:false},{type:"address",name:"quoteToken",indexed:false},{type:"uint256",name:"totalBaseAmount",indexed:false},{type:"uint256",name:"totalQuoteAmount",indexed:false},{type:"uint256",name:"claimedBaseAmount",indexed:false},{type:"uint256",name:"claimedQuoteAmount",indexed:false},{type:"uint256",name:"expireTime",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"claimExpiredCases",constant:false,payable:false,inputs:[{type:"uint256[]",name:"caseIds"},{type:"address",name:"receiver"}],outputs:[]},{type:"function",name:"claimReimbursement",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"},{type:"bytes32[]",name:"merkleProof"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getReimbursementInfo",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[{type:"tuple",components:[{type:"bytes32",name:"merkleRoot"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"},{type:"uint256",name:"claimedBaseAmount"},{type:"uint256",name:"claimedQuoteAmount"},{type:"uint256",name:"expireTime"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"setReimbursementInfo",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"tuple",name:"reimbursementInfo",components:[{type:"bytes32",name:"merkleRoot"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"},{type:"uint256",name:"claimedBaseAmount"},{type:"uint256",name:"claimedQuoteAmount"},{type:"uint256",name:"expireTime"}]},{type:"bytes32[]",name:"zeroMerkleProof"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var Ae=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"BondNotReleased",inputs:[]},{type:"error",name:"BondZeroAmount",inputs:[]},{type:"error",name:"CaseAppealNotFinished",inputs:[]},{type:"error",name:"CaseDeadlineNotReached",inputs:[]},{type:"error",name:"CaseDeadlineReached",inputs:[]},{type:"error",name:"CaseNotAccepted",inputs:[]},{type:"error",name:"CaseNotExist",inputs:[{type:"uint256",name:"caseId"}]},{type:"error",name:"CaseRespondentAppealed",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"respondent"}]},{type:"error",name:"DisputeNotAllowed",inputs:[]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidParameter",inputs:[]},{type:"error",name:"InvalidPoolToken",inputs:[]},{type:"error",name:"InvalidProfitAmount",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotCaseRespondent",inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"respondent"}]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"OnlyRelayer",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"RiskCloseNotCompleted",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"error",name:"UnexpectedCaseState",inputs:[]},{type:"error",name:"UnexpectedCaseType",inputs:[]},{type:"event",anonymous:false,name:"AppealCanceled",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"appealCaseId",indexed:false},{type:"address",name:"complainant",indexed:false},{type:"bool",name:"isMalicious",indexed:false}]},{type:"event",anonymous:false,name:"AppealFiled",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"appealCaseId",indexed:false},{type:"address",name:"respondent",indexed:false},{type:"address",name:"appealToken",indexed:false},{type:"uint256",name:"appealBond",indexed:false},{type:"uint64",name:"appealDeadline",indexed:false}]},{type:"event",anonymous:false,name:"AppealResolved",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"appealCaseId",indexed:false},{type:"uint8",name:"resolution",indexed:false},{type:"address",name:"complainant",indexed:false}]},{type:"event",anonymous:false,name:"BondClaimed",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"user",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"CaseAppealsResolved",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"remaining",indexed:false}]},{type:"event",anonymous:false,name:"CaseRiskClosed",inputs:[{type:"uint256",name:"caseId",indexed:false}]},{type:"event",anonymous:false,name:"DisputeCanceled",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"complainant",indexed:false},{type:"bool",name:"isMalicious",indexed:false}]},{type:"event",anonymous:false,name:"DisputeConfigurationUpdated",inputs:[{type:"tuple",name:"newDisputeConfigration",indexed:false,components:[{type:"address",name:"appealToken"},{type:"uint64",name:"disputeBondUsd"},{type:"uint64",name:"appealBondUsd"},{type:"uint64",name:"disputeThresholdUsd"},{type:"uint64",name:"caseDuration"},{type:"uint64",name:"voteDuration"},{type:"uint64",name:"resolveDuration"}]}]},{type:"event",anonymous:false,name:"DisputeFiled",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"bytes32",name:"poolId",indexed:false},{type:"address",name:"complainant",indexed:false},{type:"address",name:"poolToken",indexed:false},{type:"uint256",name:"disputeBond",indexed:false},{type:"uint64",name:"caseDeadline",indexed:false}]},{type:"event",anonymous:false,name:"DisputeResolved",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint8",name:"resolution",indexed:false},{type:"uint64",name:"appealDeadline",indexed:false}]},{type:"event",anonymous:false,name:"ForfeitBondsClaimed",inputs:[{type:"address",name:"receiver",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementProcessed",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"tuple",name:"reimbursementInfo",indexed:false,components:[{type:"bytes32",name:"merkleRoot"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"},{type:"uint256",name:"claimedBaseAmount"},{type:"uint256",name:"claimedQuoteAmount"},{type:"uint256",name:"expireTime"}]}]},{type:"event",anonymous:false,name:"ReimbursementVoteOpened",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"bytes32",name:"merkleRoot",indexed:false},{type:"uint256",name:"totalBaseAmount",indexed:false},{type:"uint256",name:"totalQuoteAmount",indexed:false},{type:"uint64",name:"voteDeadline",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementVoteRejected",inputs:[{type:"uint256",name:"caseId",indexed:false}]},{type:"event",anonymous:false,name:"ReimbursementVoteSubmitted",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"validator",indexed:false},{type:"uint8",name:"voteOption",indexed:false}]},{type:"event",anonymous:false,name:"RelayerAdded",inputs:[{type:"address",name:"relayer",indexed:false}]},{type:"event",anonymous:false,name:"RelayerRemoved",inputs:[{type:"address",name:"relayer",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"event",anonymous:false,name:"Voted",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"address",name:"voter",indexed:false},{type:"uint8",name:"voteOption",indexed:false}]},{type:"event",anonymous:false,name:"VotingOpened",inputs:[{type:"uint256",name:"caseId",indexed:false},{type:"uint256",name:"evidenceId",indexed:false},{type:"uint64",name:"voteDeadline",indexed:false},{type:"address[]",name:"respondents",indexed:false}]},{type:"event",anonymous:false,name:"WormholeConfigurationUpdated",inputs:[{type:"tuple",name:"newWormholeConfiguration",indexed:false,components:[{type:"address",name:"wormhole"},{type:"address",name:"validatorView"},{type:"uint32",name:"maxAge"},{type:"bytes4",name:"selector"}]}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"addRelayers",constant:false,payable:false,inputs:[{type:"address[]",name:"relayers"}],outputs:[]},{type:"function",name:"appeal",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[]},{type:"function",name:"canRiskControlClose",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[{type:"bool"}]},{type:"function",name:"cancelAppeal",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"uint256",name:"appealCaseId"},{type:"bool",name:"isMalicious"}],outputs:[]},{type:"function",name:"cancelDispute",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"bool",name:"isMalicious"}],outputs:[]},{type:"function",name:"caseIdSequencer",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"checkRiskControlCloseCompleted",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[]},{type:"function",name:"claimBond",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[]},{type:"function",name:"claimForfeitBonds",constant:false,payable:false,inputs:[{type:"address",name:"receiver"}],outputs:[]},{type:"function",name:"fileDispute",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"poolToken"}],outputs:[]},{type:"function",name:"fileDisputeFromStaker",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getDisputeConfiguration",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"tuple",components:[{type:"address",name:"appealToken"},{type:"uint64",name:"disputeBondUsd"},{type:"uint64",name:"appealBondUsd"},{type:"uint64",name:"disputeThresholdUsd"},{type:"uint64",name:"caseDuration"},{type:"uint64",name:"voteDuration"},{type:"uint64",name:"resolveDuration"}]},{type:"uint32"},{type:"uint32"}]},{type:"function",name:"getRelayers",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address[]"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isCaseRespondents",constant:true,stateMutability:"view",payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"account"}],outputs:[{type:"bool"}]},{type:"function",name:"openReimbursementVote",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"bytes32",name:"merkleRoot"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"}],outputs:[]},{type:"function",name:"openVoting",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"uint256",name:"evidenceId"},{type:"address[]",name:"respondents"}],outputs:[]},{type:"function",name:"processReimbursement",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"tuple",name:"reimbursementInfo",components:[{type:"bytes32",name:"merkleRoot"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint256",name:"totalBaseAmount"},{type:"uint256",name:"totalQuoteAmount"},{type:"uint256",name:"claimedBaseAmount"},{type:"uint256",name:"claimedQuoteAmount"},{type:"uint256",name:"expireTime"}]},{type:"bytes32[]",name:"zeroMerkleProof"}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"removeRelayers",constant:false,payable:false,inputs:[{type:"address[]",name:"relayers"}],outputs:[]},{type:"function",name:"resolveCaseAppeals",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"uint256",name:"limit"}],outputs:[]},{type:"function",name:"resolveDispute",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"}],outputs:[]},{type:"function",name:"updateDisputeConfiguration",constant:false,payable:false,inputs:[{type:"tuple",name:"disputeConfiguration",components:[{type:"address",name:"appealToken"},{type:"uint64",name:"disputeBondUsd"},{type:"uint64",name:"appealBondUsd"},{type:"uint64",name:"disputeThresholdUsd"},{type:"uint64",name:"caseDuration"},{type:"uint64",name:"voteDuration"},{type:"uint64",name:"resolveDuration"}]},{type:"uint32",name:"voteCountRate"},{type:"uint32",name:"effectiveVoteRate"}],outputs:[]},{type:"function",name:"updateWormholeConfiguration",constant:false,payable:false,inputs:[{type:"tuple",name:"wormholeConfiguration",components:[{type:"address",name:"wormhole"},{type:"address",name:"validatorView"},{type:"uint32",name:"maxAge"},{type:"bytes4",name:"selector"}]}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"vote",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"validator"},{type:"uint8",name:"voteOption"},{type:"uint256",name:"deadline"},{type:"uint8",name:"v"},{type:"bytes32",name:"r"},{type:"bytes32",name:"s"}],outputs:[]},{type:"function",name:"voteReimbursement",constant:false,payable:false,inputs:[{type:"uint256",name:"caseId"},{type:"address",name:"validator"},{type:"uint8",name:"voteOption"},{type:"uint256",name:"deadline"},{type:"uint8",name:"v"},{type:"bytes32",name:"r"},{type:"bytes32",name:"s"}],outputs:[]}];var ot=[{type:"error",name:"AccountInsufficientFreeAmount",inputs:[]},{type:"error",name:"AccountInsufficientReservedAmount",inputs:[]},{type:"error",name:"AccountInsufficientTradableAmount",inputs:[{type:"uint256",name:"accountTradableAmount"},{type:"uint256",name:"requiredTradableAmount"}]},{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"DepositToAccount",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"ExecuteCompensation",inputs:[{type:"bytes32",name:"poolId",indexed:false},{type:"uint256",name:"baseAmount",indexed:false},{type:"uint256",name:"quoteAmount",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"PayWithPrincipal",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"receiver",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"PayWithProfitFirst",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"receiver",indexed:false},{type:"bytes32",name:"poolId",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"usedFreeAmount",indexed:false},{type:"uint256",name:"usedRestrictedAmount",indexed:false}]},{type:"event",anonymous:false,name:"ReleaseForOrder",inputs:[{type:"bytes32",name:"poolId",indexed:false},{type:"uint256",name:"orderId",indexed:false},{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"ReleaseProfit",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"ReserveForOrder",inputs:[{type:"bytes32",name:"poolId",indexed:false},{type:"uint256",name:"orderId",indexed:false},{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"event",anonymous:false,name:"SettleToAccount",inputs:[{type:"address",name:"account",indexed:false},{type:"bytes32",name:"positionId",indexed:false},{type:"address",name:"baseToken",indexed:false},{type:"address",name:"quoteToken",indexed:false},{type:"uint256",name:"freeBase",indexed:false},{type:"uint256",name:"profitBase",indexed:false},{type:"uint256",name:"freeAmount",indexed:false},{type:"uint256",name:"profitAmount",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"event",anonymous:false,name:"WithdrawFromAccount",inputs:[{type:"address",name:"account",indexed:false},{type:"address",name:"token",indexed:false},{type:"uint256",name:"amount",indexed:false}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"deposit",constant:false,payable:false,inputs:[{type:"address",name:"account"},{type:"address",name:"token"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"executeCompensation",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"reimbursement"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getImplementation",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getPoolWithdrawableBaseToken",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"},{type:"bytes32",name:"poolId"}],outputs:[{type:"uint256",name:"baseAmount"}]},{type:"function",name:"getTradableAmount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"},{type:"bytes32",name:"poolId"}],outputs:[{type:"bool"},{type:"uint256"},{type:"uint256"},{type:"uint256"}]},{type:"function",name:"getUserAsset",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"},{type:"address",name:"token"}],outputs:[{type:"uint256",name:"amount"}]},{type:"function",name:"getUserAssets",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"account"}],outputs:[{type:"tuple[]",components:[{type:"address",name:"asset"},{type:"uint256",name:"amount"}]}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"payWithPrincipal",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"address",name:"account"},{type:"address",name:"token"},{type:"uint256",name:"amount"},{type:"address",name:"receiver"}],outputs:[]},{type:"function",name:"payWithProfitFirst",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"orderId"},{type:"address",name:"account"},{type:"address",name:"token"},{type:"uint256",name:"amount"}],outputs:[{type:"uint256",name:"usedFreeAmount"},{type:"uint256",name:"usedRestrictedAmount"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"releaseForCancelOrder",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"orderId"},{type:"address",name:"account"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"releaseFromProfitUnlock",constant:false,payable:false,inputs:[{type:"address",name:"account"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"baseAmount"},{type:"uint256",name:"quoteAmount"}],outputs:[]},{type:"function",name:"reserveForOrder",constant:false,payable:false,inputs:[{type:"bytes32",name:"poolId"},{type:"uint256",name:"orderId"},{type:"address",name:"account"},{type:"address",name:"token"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"settlementDeposit",constant:false,payable:false,inputs:[{type:"bytes32",name:"positionId"},{type:"address",name:"account"},{type:"tuple",name:"pool",components:[{type:"bytes32",name:"marketId"},{type:"bytes32",name:"poolId"},{type:"address",name:"baseToken"},{type:"address",name:"quoteToken"},{type:"uint8",name:"riskTier"},{type:"uint8",name:"state"},{type:"address",name:"basePoolToken"},{type:"address",name:"quotePoolToken"},{type:"uint16",name:"maxPriceDeviation"},{type:"bool",name:"compoundEnabled"},{type:"uint64",name:"windowCapUsd"},{type:"address",name:"poolVault"},{type:"address",name:"tradingVault"}]},{type:"uint256",name:"freeBaseAmount"},{type:"uint256",name:"freeQuoteAmount"},{type:"uint256",name:"receivedBaseAmount"},{type:"uint256",name:"receivedQuoteAmount"}],outputs:[]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"updateAndWithdraw",constant:false,payable:false,inputs:[{type:"address",name:"receiver"},{type:"bytes32",name:"poolId"},{type:"bool",name:"isQuoteToken"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"upgradeTo",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var rt={USDC:"0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",POOL_MANAGER:"0xb394948BC6c5d13189440Bd44E481f7833d29694",Account:"0x3edb8F5838603f70896d37233AD7F618D024c351",POSITION_MANAGER:"0xb8fAf2037788594e1BD27F1905A6eF090A5857ad",ORDER_MANAGER:"0xC016fD1b62A22991aa7085D4F7851C35e45d1B1b",PYTH:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",ERC20:"0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",LIQUIDITY_ROUTER:"0xD375b2096602D613725E465c9a83e2C078B0273E",BASE_POOL:"0x2e217CB7e52cFca09132aDf4b12a04F4a9aB79E7",QUOTE_POOL:"0xBD8559b42aCd1c86b5Bf32e9858b559d3b71D94f",ORACLE:"0xFe2a1b4b799310e77F6F0aB2Ea40d2Ea7f9D9FFC",EIP7702Delegation:"0x7823b642DA17419717A8362B035E8a951110152E",MARKET_MANAGER:"0xf7810B57cb9A54fa751A4d82C4AeC4e2518CEb23",DATA_PROVIDER:"0x5B23C37A89f7F631D1cbA333545ad6Dce7B0da9E",ORACLE_RESERVE:"0x4Ffaf942B6d678Ca65001Fe87A30A0019393a2eE",FORWARDER:"0x5793932070EDeb981128650Aed7178F9B2F05690",TRADING_ROUTER:"0xA2cF15a8c3788802060F7d68cf888B28dA962b08",REIMBURSEMENT:"0xB26B967964498a1db1a77d3Aa62080D0B2dBff9e",DISPUTE_COURT:"0x62b6a26ae299cF31d01A77DAde7E5b39CC4A1eB0",EXECUTION_POOL:"0x3f518818a371698f1A37B9DfE46F18e4DC5Ff39A"};var it={USDC:"0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",POOL_MANAGER:"0x05314a21Fc97B74f168730153b2B63A870D25dE5",Account:"0xAC0ca67fd6C7Ff9c80DE58420B840115b6d51c6e",POSITION_MANAGER:"0x1a8cC8391Ee19c3817de64a52904D0557f519bA5",ORDER_MANAGER:"0x3138f425f11f14fE33a180e9Bbf0661C8dc6d8AD",PYTH:"0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",ERC20:"0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",LIQUIDITY_ROUTER:"0xfb790ECE13Cd9e296b4a06ABF38D10431360c236",BASE_POOL:"0x1F767BEa83EDe5E0C18904f439C579f52c2c0F1b",QUOTE_POOL:"0x50ad7da312c58c6689bEF028954a366cb5b8ee13",ORACLE:"0x3e437094C5687Ed6eDb1883b0bd445Efa9103a55",EIP7702Delegation:"0xc68fdf81ca68B26fdB296645F42a734c12E63751",MARKET_MANAGER:"0x71b57CcB7539aB761fd5C5767362A207a295e337",DATA_PROVIDER:"0xd4FdE3cc72D29b71507823cA43Dd6fD520644E92",ORACLE_RESERVE:"0x4fC26Cf34e5d486BFF211315bf17D77d34130971",FORWARDER:"0x58fb1a663b08871A755734231C387E1d10ac2B10",TRADING_ROUTER:"0x89ba8EDBD63f577cAA1095F25Df0A44A226f28bc",REIMBURSEMENT:"0xDbCe02B080C68671EF6EcEc1a01A789441A3a564",DISPUTE_COURT:"0x47648D171925a69b3A334898AaaE6e7cc41B1735",EXECUTION_POOL:"0x0000000000000000000000000000000000000000"};var pt={USDC:"0xD984fd34f91F92DA0586e1bE82E262fF27DC431b",POOL_MANAGER:"0x79412588c9dC5022f04b989595bd8e96Fd58A5fa",Account:"0x37C7B6ED8129312Ed51c9ee2CBd162F2096816c0",POSITION_MANAGER:"0x7d56F5ac970873741Ec29b95e48b8216574338Aa",ORDER_MANAGER:"0xc31d5b922eE6A6B829D2ad214bA5edC225401942",PYTH:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",ERC20:"0xD984fd34f91F92DA0586e1bE82E262fF27DC431b",LIQUIDITY_ROUTER:"0x248F77f2E55Dd14715c5f35F4327Bb5feDB39B2B",BASE_POOL:"0x2c04502Fc87D55cBF91FD8aC32D5197c0FD54c13",QUOTE_POOL:"0x4bdB9C8B96e4cf8c7C1CcC05c2607ba781f49eeF",ORACLE:"0x05ff1e3E1bd8ac4142085446e6705Cb791D77CF9",EIP7702Delegation:"0x7e3d707599aee82C06435F8338A9548f57fAa28e",MARKET_MANAGER:"0x9D0e83123AB97E93b3810913462746c7A4815b5E",DATA_PROVIDER:"0xf80999c3bB3C67c06bb0Bc917B430f9f79c51A7B",ORACLE_RESERVE:"0x666A9CD9920e0D751198b17c02B6eA0b620A3de0",FORWARDER:"0x45cc7768bb3D9242E5E9C63D7eb41Db3B4B32066",TRADING_ROUTER:"0x5dAea62F75fB4192Ec96Ec721895Bdbe12b47Cbe",REIMBURSEMENT:"0xd1a496A628a48bd56d465b99f8600F3FAcc40a35",DISPUTE_COURT:"0x7f17EF3779BbE5671Ad9b4Bb73C0849CbaC34e11",EXECUTION_POOL:"0x817991FF7230EBA444F64F321A4A8e80e93De4e2"};var ut={POOL_MANAGER:"0xcf51a6895864c6D8E507fC31EF16b9011287c5f4",Account:"0x35054EfE58Bbdae792aeCaD7bC2e4939c169560f",POSITION_MANAGER:"0x689A0C7E46785584FF7636700ceF5d5e7c141F8D",ORDER_MANAGER:"0xa0B5E5AE9D3E214096C90DDeC04D39B27ED9B272",PYTH:"0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",ERC20:"0xD984fd34f91F92DA0586e1bE82E262fF27DC431b",LIQUIDITY_ROUTER:"0x0AE31989318565620c03d35889a0B2536b8fba5C",BASE_POOL:"0xc9e3826c42183207B418116A16827C1605132c51",QUOTE_POOL:"0x9A9934D3b22103dE822d94A22A3177d728FE0e5a",ORACLE:"0x0dD8293765358cF7f2646D0B91bA59804E197FC6",EIP7702Delegation:"0x4686F8a0d44b056037b2A51c4342EE7FA8e0A48F",MARKET_MANAGER:"0xe99dAB65c5546D7C87850Bbc40C6a7BEd7328Efa",DATA_PROVIDER:"0x5b6Be9839552a49302d552aB3C223b60Adb8BF1D",ORACLE_RESERVE:"0xB3D5a67223905FE73a0749e7A03525838063C54C",USDC:"0xD984fd34f91F92DA0586e1bE82E262fF27DC431b",FORWARDER:"0x6C40462A4d45BA4119af59Fb9e41b8eaC9293962",TRADING_ROUTER:"0x0000000000000000000000000000000000000000",REIMBURSEMENT:"0x0000000000000000000000000000000000000000",DISPUTE_COURT:"0x0000000000000000000000000000000000000000",EXECUTION_POOL:"0x0000000000000000000000000000000000000000"};var mt={USDC:"0x9C452Ef0e7b158F81A0e00a81aaea8ae04132cBc",POOL_MANAGER:"0x48855b7c2168D38F029E3fdb3Bc96C8f35Bab955",Account:"0xB6BFE4cC301718AA5d3C2a3ccac52Ff9C5b7E20E",POSITION_MANAGER:"0xb5fa0Bde66D892f1451CD298A6f9a7a7e39409b0",ORDER_MANAGER:"0xdbC710cD74737d4Dd08E637177c475665273a798",PYTH:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",ERC20:"0x9C452Ef0e7b158F81A0e00a81aaea8ae04132cBc",LIQUIDITY_ROUTER:"0x42E93f7dC6eA3e35b87529d2e0fc2deda7D4De85",BASE_POOL:"0x7553AA06c47E94F43128dC99e4FF83FB05304B8c",QUOTE_POOL:"0x573933e9e3299Ef4DB0f8207037BB4010C8728DD",ORACLE:"0x9aaE414d63ee3f52c8bFfB68175497c3Bf837272",EIP7702Delegation:"0x415f1bFf28023888B54E757eF9Ff0292ae309c6A",MARKET_MANAGER:"0xdA9D9Bf96466c1F4e4CF3D5667CF160834b46da8",DATA_PROVIDER:"0xe6C8e5F948BB33B78c157A995F48008c0bF7CcF1",ORACLE_RESERVE:"0xE7147190274E1175610D8e0e3CC5E8bb8670d148",FORWARDER:"0xDeA7223732f9Aa1740A94409633A65D45AA3571A",TRADING_ROUTER:"0xe3d6eEAF463ece18a57b2D5BbE7Bd7fF2836C4c4",REIMBURSEMENT:"0x53656983Bb07987729e1DA65bad53bCc9E618589",DISPUTE_COURT:"0xF4f535b61600735C6786e04A2a307B515C66f05B",EXECUTION_POOL:"0xC9728b433c389554CB79523EC3476614acF755Cf"};var dt={USDC:"0xe944d7c0f7005a76E898Ee3B9Ec10479EbA9Cc02",POOL_MANAGER:"0x9E84a999e15CCdb2F64a5AF10939c25769dF6b07",Account:"0x42A1BC012CeC51Ebf3bbf79142bf2a912396FB0e",POSITION_MANAGER:"0x011a25Fe39b2f9033E49d1587CF24780242e40dA",ORDER_MANAGER:"0xfc30D3C858B72a9EDfE6679Fc3355039D276f811",PYTH:"0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",ERC20:"0xe944d7c0f7005a76E898Ee3B9Ec10479EbA9Cc02",LIQUIDITY_ROUTER:"0x0F4C6f18Fb136DD1eBd6Da3C5d86a86597CF79a3",BASE_POOL:"0x51B62554a76197d5DF2D5dC4D57FF54d40775938",QUOTE_POOL:"0x783Ed065a12e1C1D33c2a8d6408385C1843D3084",ORACLE:"0xaF26d69BC0A6f1DEf8AeB00B6DAD28398ba67a53",EIP7702Delegation:"0xc8558cD3905F273ff45B1dd6D10894445bFa622f",MARKET_MANAGER:"0x3b809daB550f9DD0DbE82567f6EA6137C174532c",DATA_PROVIDER:"0x4B5888025570934cC9D31807feBAAEDaC823Cb8e",ORACLE_RESERVE:"0x3011dA5822c1ECA7fcda64716779769D0089945D",FORWARDER:"0x2943a063ae2A772f4314FaA28E00De827A491Dd3",TRADING_ROUTER:"0xaA16801F36e49cDD4f87938032487C7E6cfbb389",REIMBURSEMENT:"0xBF72B69bA547D0bB7D1255B43Ff5D7f2615326dF",DISPUTE_COURT:"0xeD8B129a5919c45c7391AA73632eA691A471C672",EXECUTION_POOL:"0x0000000000000000000000000000000000000000"};var Z=_n__default.default(),Bn=(t,e)=>e?(e=JSON.parse(JSON.stringify(e)),t.includes("?")?t+"&"+new URLSearchParams(e).toString():t+"?"+new URLSearchParams(e).toString()):t,B={get:(t,e,n={})=>{let a=Bn(t,e);return Z.url(a).options(n).get().json()},post:(t,e,n={})=>Z.url(t).options(n).post(e).json(),put:(t,e,n={})=>Z.url(t).options(n).put(e).json(),delete:(t,e={})=>Z.url(t).options(e).delete().json()};var Un=(p=>(p[p.SUCCESS=9200]="SUCCESS",p[p.SUCCESS_ORIGIN=0]="SUCCESS_ORIGIN",p[p.IDENTITY_VERIFICATION_FAILED=9401]="IDENTITY_VERIFICATION_FAILED",p[p.PERMISSION_DENIED=9403]="PERMISSION_DENIED",p[p.NOT_EXIST=9404]="NOT_EXIST",p[p.REQUEST_LIMIT=9429]="REQUEST_LIMIT",p[p.SERVICE_ERROR=9500]="SERVICE_ERROR",p[p.MISS_REQUESTED_PARAMETER=9900]="MISS_REQUESTED_PARAMETER",p[p.INVALID_PARAMETER=9901]="INVALID_PARAMETER",p.NETWORK_ERROR="ERR_NETWORK",p))(Un||{}),Ln=(o=>(o[o.Cook=0]="Cook",o[o.Boosted=1]="Boosted",o[o.Primed=2]="Primed",o[o.Trench=3]="Trench",o[o.PreBench=4]="PreBench",o[o.Bench=5]="Bench",o))(Ln||{}),lt=(n=>(n[n.Chainlink=1]="Chainlink",n[n.Pyth=2]="Pyth",n))(lt||{}),qn=(i=>(i[i.Minute1=1]="Minute1",i[i.Minute5=5]="Minute5",i[i.Minute15=15]="Minute15",i[i.Minute30=30]="Minute30",i[i.Hour1=60]="Hour1",i[i.Hour4=240]="Hour4",i[i.Day1=1440]="Day1",i[i.Week1=10080]="Week1",i[i.Month1=40320]="Month1",i))(qn||{}),Gn=(s=>(s[s.Contract=1]="Contract",s[s.Cook=2]="Cook",s[s.Earn=3]="Earn",s[s.Cooking=4]="Cooking",s))(Gn||{}),zn=(r=>(r[r.All=0]="All",r[r.Contract=1]="Contract",r[r.Cook=2]="Cook",r[r.Earn=3]="Earn",r[r.Cooking=4]="Cooking",r))(zn||{}),Vn=(n=>(n[n.BlueChips=1]="BlueChips",n[n.Alpha=2]="Alpha",n))(Vn||{}),Wn=(a=>(a[a.BlueChips=1]="BlueChips",a[a.Alpha=2]="Alpha",a[a.Favorite=3]="Favorite",a))(Wn||{});var Qn=(s=>(s[s.Market=0]="Market",s[s.Limit=1]="Limit",s[s.Stop=2]="Stop",s[s.Conditional=3]="Conditional",s))(Qn||{}),Hn=(n=>(n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease",n))(Hn||{}),Jn=(y=>(y[y.Increase=0]="Increase",y[y.Decrease=1]="Decrease",y[y.AddMargin=2]="AddMargin",y[y.RemoveMargin=3]="RemoveMargin",y[y.CancelOrder=4]="CancelOrder",y[y.ADL=5]="ADL",y[y.Liquidation=6]="Liquidation",y[y.MarketClose=7]="MarketClose",y[y.EarlyClose=8]="EarlyClose",y[y.AddTPSL=9]="AddTPSL",y[y.SecurityDeposit=10]="SecurityDeposit",y[y.TransferToWallet=11]="TransferToWallet",y[y.MarginAccountDeposit=12]="MarginAccountDeposit",y[y.ReferralReward=13]="ReferralReward",y[y.ReferralRewardClaim=14]="ReferralRewardClaim",y))(Jn||{}),Yn=(a=>(a[a.Unknown=0]="Unknown",a[a.GTE=1]="GTE",a[a.LTE=2]="LTE",a))(Yn||{}),Xn=(n=>(n[n.Long=0]="Long",n[n.Short=1]="Short",n))(Xn||{}),jn=(s=>(s[s.Cancelled=1]="Cancelled",s[s.Expired=2]="Expired",s[s.Successful=9]="Successful",s[s.PartialFilled=8]="PartialFilled",s))(jn||{}),$n=(i=>(i[i.Market=1]="Market",i[i.Limit=2]="Limit",i[i.TP=3]="TP",i[i.SL=4]="SL",i[i.ADL=5]="ADL",i[i.ADLTrigger=6]="ADLTrigger",i[i.Liquidation=7]="Liquidation",i[i.EarlyClose=8]="EarlyClose",i[i.MarketClose=9]="MarketClose",i))($n||{}),Kn=(p=>(p[p.Open=0]="Open",p[p.PartialClose=1]="PartialClose",p[p.FullClose=2]="FullClose",p[p.Liquidation=3]="Liquidation",p[p.EarlyClose=4]="EarlyClose",p[p.MarketClose=5]="MarketClose",p[p.ADL=6]="ADL",p[p.TP=7]="TP",p[p.SL=8]="SL",p[p.Increase=9]="Increase",p))(Kn||{}),Zn=(a=>(a[a.MarginAccount=1]="MarginAccount",a[a.WalletAccount=2]="WalletAccount",a[a.ReferralReward=3]="ReferralReward",a))(Zn||{});var ea=(s=>(s[s.EXECUTING=1]="EXECUTING",s[s.BROADCAST_FAILED=2]="BROADCAST_FAILED",s[s.TIMEOUT_CANCEL=3]="TIMEOUT_CANCEL",s[s.EXECUTED=9]="EXECUTED",s))(ea||{});var Ns=async()=>B.get(`${L()}/openapi/gateway/scan/market/list`);var L=()=>{let{isTestnet:t,isBetaMode:e}=k?.getConfigManager()?.getConfig()||{};return e?"https://api-beta.myx.finance":t?"https://api-test.myx.cash":"https://api.myx.finance"},q=async(t,e=[])=>e.length?B.get(`${L()}/openapi/gateway/quote/price/oracles`,{chainId:t,poolIds:e.join(",")}):Promise.reject(new Error("Invalid pool id")),yt=async(t,e)=>await B.get(`${L()}/openapi/gateway/scan/market/info?chainId=${t}&poolId=${e}`),ct=async(t,e,n)=>await B.get(`${L()}/openapi/gateway/scan/market/pool-order/open?chainId=${n}`,void 0,{headers:{myx_openapi_access_token:t,myx_openapi_account:e}}),Ls=async({chainId:t,poolIds:e},n)=>B.get(`${L()}/openapi/gateway/quote/candle/tickers`,{chainId:t,poolIds:e.join(",")}),qs=async({...t})=>B.get(`${L()}/openapi/gateway/scan/market/base-details`,t),Gs=async({...t})=>B.get(`${L()}/openapi/gateway/scan/market/detail`,t),ft=async()=>B.get(`${L()}/openapi/gateway/scan/market`);var j,Ce=class Ce{constructor(){this.version="1.0.24-beta.15";Je(this,j);}setConfigManager(e){Ye(this,j,e);}getConfigManager(){return He(this,j)}setProvider(e){this.provider=e;}getProvider(){return this.provider}static getInstance(){return this._instance||(this._instance=new Ce),this._instance}async getMarkets(){try{let n=(await ft())?.data||[];return this.Markets=n,n}catch(e){throw e}}};j=new WeakMap;var X=Ce,bt=X.getInstance(),k=bt,Xs=async t=>{let e=bt.getConfigManager();if(!e?.hasSigner())throw new Error("No signer: call auth({ signer }) or auth({ walletClient })");return e.getViemWalletClient(t)};var gt={USDC:"0x55d398326f99059fF775485246999027B3197955",POOL_MANAGER:"0x4A92b2E6476630F18D3BedCEcDc2fF726a687724",Account:"0xF1b79eEC9ac795798D4E289Ca37C67516dD72389",POSITION_MANAGER:"0x4dF5284F67f5eb4F804D4Dfb26baA75d3a0d0f48",ORDER_MANAGER:"0x283907b70F85431F7D0E86627fA53870D91a47ba",PYTH:"0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594",ERC20:"0x55d398326f99059fF775485246999027B3197955",LIQUIDITY_ROUTER:"0x8Ec82e7E2c9DAf55502d5215934236530a3991df",BASE_POOL:"0x02c48173a260Fa22E99c27BEc530E2052bE5a528",QUOTE_POOL:"0x695cd70D9CFcD8Dc6a8Ac702C3C4310332B9c750",ORACLE:"0x34951eA0a25Da088509B68294130D02a8A744542",EIP7702Delegation:"0xa3aaa9111e8C2672A9C8d04223D42D0846D724c5",MARKET_MANAGER:"0x9E225c924Ea63f04CF445F85f13df66659cc4e06",DATA_PROVIDER:"0x515beDD7d357671e9c8bF7da67ac0839Aec1FFAa",ORACLE_RESERVE:"0x7c090B41997D2e3809B2648f297DE47Fc491F14C",FORWARDER:"0x048A4bC2E2a6e9494268895CE4644d67FAa65525",TRADING_ROUTER:"0xe418929503a8BA7bA4B6337BEe668956b0752A84",REIMBURSEMENT:"0x0c20de588d6D2C577A4360e114d4560fB2a48Fd4",DISPUTE_COURT:"0xf85895AC9c9f449DC4A4718c7011BFA31c6056B4",EXECUTION_POOL:"0x6C3F4ACccD708dE6A8f7E7adB4b14D2b407ff809"};var x=t=>{let{isBetaMode:e}=k?.getConfigManager()?.getConfig()||{};switch(t){case 421614:return e?it:rt;case 59141:return e?ut:pt;case 97:return e?dt:mt;case 56:return gt;default:return {}}};var It=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"DesignatedTokenMismatch",inputs:[{type:"address",name:"collectToken"},{type:"address",name:"designatedToken"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"ForwardedRecipientMustBeMasterAccount",inputs:[{type:"address",name:"recipient"},{type:"address",name:"master"}]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"NotActiveBroker",inputs:[{type:"address",name:"broker"}]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotForwardAllowedTarget",inputs:[{type:"address",name:"from"}]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotOrderOwner",inputs:[]},{type:"error",name:"NotPositionOwner",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{type:"address",name:"token"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"CollectExecutionFee",inputs:[{type:"uint8",name:"source",indexed:false},{type:"bytes32",name:"positionId",indexed:false},{type:"address",name:"account",indexed:false},{type:"uint256",name:"executionFee",indexed:false},{type:"address",name:"token",indexed:false}]},{type:"event",anonymous:false,name:"CollectForwardFee",inputs:[{type:"uint8",name:"source",indexed:false},{type:"bytes32",name:"positionId",indexed:false},{type:"address",name:"account",indexed:false},{type:"uint256",name:"forwardFee",indexed:false},{type:"address",name:"token",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"__ERC2771ContextUpgradeable_init",constant:false,payable:false,inputs:[{type:"address",name:"trustedForwarder_"}],outputs:[]},{type:"function",name:"adjustCollateral",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"bytes32",name:"positionId"},{type:"int256",name:"adjustAmount"}],outputs:[]},{type:"function",name:"cancelOrder",constant:false,payable:false,inputs:[{type:"uint256",name:"orderId"}],outputs:[]},{type:"function",name:"cancelOrders",constant:false,payable:false,inputs:[{type:"uint256[]",name:"orderIds"}],outputs:[]},{type:"function",name:"collectExecutionFee",constant:false,payable:false,inputs:[{type:"uint8",name:"source"},{type:"bytes",name:"data"},{type:"address",name:"feeRecipient"}],outputs:[]},{type:"function",name:"collectForwardFeeIfNecessary",constant:false,payable:false,inputs:[{type:"uint8",name:"source"},{type:"bytes",name:"data"}],outputs:[]},{type:"function",name:"depositToAccount",constant:false,payable:false,inputs:[{type:"address",name:"recipient"},{type:"address",name:"token"},{type:"uint256",name:"amount"}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"isTrustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"forwarder"}],outputs:[{type:"bool"}]},{type:"function",name:"placeOrderWithPosition",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"bytes32",name:"positionId"},{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"tuple",name:"orderParams",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"collateralAmount"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"uint8",name:"orderType"},{type:"uint8",name:"triggerType"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint8",name:"timeInForce"},{type:"bool",name:"postOnly"},{type:"uint16",name:"slippagePct"},{type:"uint16",name:"leverage"},{type:"address",name:"broker"},{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}],outputs:[]},{type:"function",name:"placeOrderWithSalt",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"uint64",name:"userPositionSalt"},{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"tuple",name:"orderParams",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"collateralAmount"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"uint8",name:"orderType"},{type:"uint8",name:"triggerType"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint8",name:"timeInForce"},{type:"bool",name:"postOnly"},{type:"uint16",name:"slippagePct"},{type:"uint16",name:"leverage"},{type:"address",name:"broker"},{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}],outputs:[]},{type:"function",name:"placeOrdersWithPosition",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"bytes32[]",name:"positionIds"},{type:"tuple[]",name:"orderParams",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"collateralAmount"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"uint8",name:"orderType"},{type:"uint8",name:"triggerType"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint8",name:"timeInForce"},{type:"bool",name:"postOnly"},{type:"uint16",name:"slippagePct"},{type:"uint16",name:"leverage"},{type:"address",name:"broker"},{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}],outputs:[]},{type:"function",name:"placeOrdersWithSalt",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"uint64[]",name:"userPositionSalts"},{type:"tuple[]",name:"orderParams",components:[{type:"address",name:"user"},{type:"bytes32",name:"poolId"},{type:"uint256",name:"collateralAmount"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"uint8",name:"orderType"},{type:"uint8",name:"triggerType"},{type:"uint8",name:"operation"},{type:"uint8",name:"direction"},{type:"uint8",name:"timeInForce"},{type:"bool",name:"postOnly"},{type:"uint16",name:"slippagePct"},{type:"uint16",name:"leverage"},{type:"address",name:"broker"},{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}],outputs:[]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"trustedForwarder",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"updateOrder",constant:false,payable:false,inputs:[{type:"tuple",name:"depositParams",components:[{type:"address",name:"token"},{type:"uint256",name:"amount"}]},{type:"tuple",name:"params",components:[{type:"uint256",name:"orderId"},{type:"address",name:"broker"},{type:"uint256",name:"size"},{type:"uint256",name:"price"},{type:"tuple",name:"tpsl",components:[{type:"uint256",name:"tpSize"},{type:"uint256",name:"tpPrice"},{type:"uint256",name:"slSize"},{type:"uint256",name:"slPrice"}]}]}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var Pe=[{type:"error",name:"AddressEmptyCode",inputs:[{type:"address",name:"target"}]},{type:"error",name:"CollectFailed",inputs:[]},{type:"error",name:"DeadlineInPast",inputs:[]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{type:"address",name:"implementation"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ExecutionExpired",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"ExecutionNotExpired",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"ExecutionsNotExist",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"FailedCall",inputs:[]},{type:"error",name:"GracePeriodNotExpired",inputs:[]},{type:"error",name:"InsufficientGasEscrow",inputs:[]},{type:"error",name:"InvalidDataLength",inputs:[]},{type:"error",name:"InvalidGasEscrow",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidRequest",inputs:[]},{type:"error",name:"MaxPendingExceeded",inputs:[]},{type:"error",name:"NotAddressManager",inputs:[]},{type:"error",name:"NotDependencyManager",inputs:[]},{type:"error",name:"NotExecutionOwner",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"NotProxyAdmin",inputs:[]},{type:"error",name:"PermissionDenied",inputs:[{type:"address",name:"caller"},{type:"address",name:"target"}]},{type:"error",name:"PoolNotExists",inputs:[{type:"bytes32"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"RefundExceedsEscrow",inputs:[{type:"uint256",name:"refund"},{type:"uint256",name:"escrow"}]},{type:"error",name:"RefundFailed",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"SelectorNotRegistered",inputs:[{type:"bytes4",name:"selector"}]},{type:"error",name:"TxIdAlreadyExists",inputs:[{type:"bytes32",name:"txId"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{type:"bytes32",name:"slot"}]},{type:"event",anonymous:false,name:"ExecutionCancelled",inputs:[{type:"bytes32",name:"txId",indexed:false},{type:"string",name:"remark",indexed:false}]},{type:"event",anonymous:false,name:"ExecutionExecuted",inputs:[{type:"bytes32[]",name:"txIds",indexed:false}]},{type:"event",anonymous:false,name:"ExecutionSubmitted",inputs:[{type:"bytes32",name:"txId",indexed:false},{type:"bytes32[]",name:"poolId",indexed:false},{type:"address",name:"from",indexed:false},{type:"uint64",name:"deadline",indexed:false}]},{type:"event",anonymous:false,name:"GasCollected",inputs:[{type:"bytes32[]",name:"txIds",indexed:false},{type:"uint256",name:"gasAmount",indexed:false}]},{type:"event",anonymous:false,name:"GasEscrowSelectorRemoved",inputs:[{type:"bytes4",name:"selector",indexed:false}]},{type:"event",anonymous:false,name:"GasEscrowSelectorUpdated",inputs:[{type:"bytes4",name:"selector",indexed:false},{type:"uint256",name:"gasEscrow",indexed:false}]},{type:"event",anonymous:false,name:"GracePeriodUpdated",inputs:[{type:"uint64",name:"gracePeriod",indexed:false}]},{type:"event",anonymous:false,name:"Initialized",inputs:[{type:"uint64",name:"version",indexed:false}]},{type:"event",anonymous:false,name:"MaxPendingUpdated",inputs:[{type:"uint256",name:"maxPendingPerUser",indexed:false}]},{type:"event",anonymous:false,name:"Upgraded",inputs:[{type:"address",name:"implementation",indexed:true}]},{type:"function",name:"UPGRADE_INTERFACE_VERSION",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"string"}]},{type:"function",name:"cancel",constant:false,payable:false,inputs:[{type:"bytes32",name:"txId"}],outputs:[]},{type:"function",name:"cancelExpired",constant:false,payable:false,inputs:[{type:"bytes32",name:"txId"}],outputs:[]},{type:"function",name:"consumeExecutions",constant:false,payable:false,inputs:[{type:"bytes32[]",name:"txIds"}],outputs:[]},{type:"function",name:"executePublic",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"bytes32",name:"txId"},{type:"tuple[]",name:"params",components:[{type:"bytes32",name:"poolId"},{type:"uint8",name:"oracleType"},{type:"uint64",name:"publishTime"},{type:"bytes",name:"oracleUpdateData"}]}],outputs:[]},{type:"function",name:"getAddressManager",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"address"}]},{type:"function",name:"getAllGasEscrowSelectors",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32[]",name:"selectors"},{type:"uint256[]",name:"escrows"}]},{type:"function",name:"getDependencyAddress",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"identifier"}],outputs:[{type:"address"}]},{type:"function",name:"getExecutionRequest",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes32",name:"txId"}],outputs:[{type:"bool",name:"isExpired"},{type:"tuple",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"},{type:"bytes",name:"signature"}]}]},{type:"function",name:"getGasEscrowForSelector",constant:true,stateMutability:"view",payable:false,inputs:[{type:"bytes4",name:"selector"}],outputs:[{type:"uint256"}]},{type:"function",name:"gracePeriod",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint64"}]},{type:"function",name:"initialize",constant:false,payable:false,inputs:[{type:"address",name:"addressManager"}],outputs:[]},{type:"function",name:"maxPendingCount",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"pendingCount",constant:true,stateMutability:"view",payable:false,inputs:[{type:"address",name:"user"}],outputs:[{type:"uint256",name:"count"}]},{type:"function",name:"proxiableUUID",constant:true,stateMutability:"view",payable:false,inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"removeGasEscrowForSelector",constant:false,payable:false,inputs:[{type:"bytes4",name:"selector"}],outputs:[]},{type:"function",name:"setGasEscrowForSelector",constant:false,payable:false,inputs:[{type:"bytes4",name:"selector"},{type:"uint256",name:"escrow"}],outputs:[]},{type:"function",name:"setGracePeriod",constant:false,payable:false,inputs:[{type:"uint64",name:"_gracePeriod"}],outputs:[]},{type:"function",name:"setMaxPendingCount",constant:false,payable:false,inputs:[{type:"uint256",name:"_maxPendingCount"}],outputs:[]},{type:"function",name:"submit",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"bytes32",name:"txId"},{type:"tuple",name:"execution",components:[{type:"address",name:"from"},{type:"address",name:"to"},{type:"uint256",name:"value"},{type:"uint256",name:"gas"},{type:"uint48",name:"createdAt"},{type:"uint48",name:"deadline"},{type:"bytes",name:"data"}]},{type:"bytes32[]",name:"updatePricePoolIds"}],outputs:[]},{type:"function",name:"upgradeToAndCall",constant:false,stateMutability:"payable",payable:true,inputs:[{type:"address",name:"newImplementation"},{type:"bytes",name:"data"}],outputs:[]}];var Oo=(t,e)=>{let n=c(t);return viem.getContract({address:e,abi:O,client:n})},Fo=async t=>{let e=x(t),n=await v(t);return viem.getContract({address:e.TRADING_ROUTER,abi:It,client:n})},xt=async(t,e)=>{let n=await v(t);return viem.getContract({address:e,abi:O,client:n})},E=async t=>{let e=await v(t),[n]=await e.getAddresses();return n??void 0},Q=async t=>{let e=x(t),n=await v(t);return viem.getContract({address:e.LIQUIDITY_ROUTER,abi:M,client:n})},At=async t=>{let e=x(t),n=await v(t);return viem.getContract({address:e.ORACLE_RESERVE,abi:Xe,client:n})},_=(t,e=1)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.POOL_MANAGER,abi:de,client:a})):v(t).then(s=>viem.getContract({address:n.POOL_MANAGER,abi:de,client:s}))};var G=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.QUOTE_POOL,abi:le,client:a})):v(t).then(s=>viem.getContract({address:n.QUOTE_POOL,abi:le,client:s}))},U=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.BASE_POOL,abi:ye,client:a})):v(t).then(s=>viem.getContract({address:n.BASE_POOL,abi:ye,client:s}))},So=async(t,e)=>{let n=await v(t);return viem.getContract({address:e,abi:ce,client:n})},Ct=async t=>{let e=await v(t),n=x(t);return viem.getContract({address:n.EXECUTION_POOL,abi:Pe,client:e})},Pt=async t=>{let e=await c(t),n=x(t);return viem.getContract({address:n.EXECUTION_POOL,abi:Pe,client:e})};var ko=(t,e)=>{let n=c(t);return viem.getContract({address:e,abi:ce,client:n})};var Et=(t,e,n=0)=>{let a=n===0?c(t):null;return a?Promise.resolve(viem.getContract({address:e,abi:fe,client:a})):v(t).then(s=>viem.getContract({address:e,abi:fe,client:s}))},ee=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.MARKET_MANAGER,abi:be,client:a})):v(t).then(s=>viem.getContract({address:n.MARKET_MANAGER,abi:be,client:s}))},Rt=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.DATA_PROVIDER,abi:ge,client:a})):v(t).then(s=>viem.getContract({address:n.DATA_PROVIDER,abi:ge,client:s}))},No=async t=>{let e=x(t),n=await v(t);return viem.getContract({address:e.Account,abi:ot,client:n})},wt=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.FORWARDER,abi:Ie,client:a})):v(t).then(s=>viem.getContract({address:n.FORWARDER,abi:Ie,client:s}))},_o=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.REIMBURSEMENT,abi:xe,client:a})):v(t).then(s=>viem.getContract({address:n.REIMBURSEMENT,abi:xe,client:s}))},Bo=(t,e=0)=>{let n=x(t),a=e===0?c(t):null;return a?Promise.resolve(viem.getContract({address:n.DISPUTE_COURT,abi:Ae,client:a})):v(t).then(s=>viem.getContract({address:n.DISPUTE_COURT,abi:Ae,client:s}))};var H=null;function aa(t){H=t;}function Ee(){return H??{}}function Re(){}function sa(...t){(H?.log??H?.info??Re)(...t);}function oa(...t){(H?.warn??Re)(...t);}function l(...t){(H?.error??Re)(...t);}var vt=class{constructor(e){this.options={...e,logLevel:e?.logLevel??"info"};}get out(){return this.options.sink??Ee()}debug(e,...n){this.options.logLevel!=="none"&&this.options.logLevel==="debug"&&(this.out.log??this.out.info)?.(`[MYX-SDK-DEBUG] ${e}`,...n);}info(e,...n){this.options.logLevel!=="none"&&(this.options.logLevel==="debug"||this.options.logLevel==="info")&&(this.out.log??this.out.info)?.(`[MYX-SDK-INFO] ${e}`,...n);}error(e,...n){this.options.logLevel!=="none"&&(this.options.logLevel==="debug"||this.options.logLevel==="info"||this.options.logLevel==="error")&&this.out.error?.(`[MYX-SDK-ERROR] ${e}`,...n);}warn(e,...n){this.options.logLevel!=="none"&&this.out.warn?.(`[MYX-SDK-WARN] ${e}`,...n);}};var we={"0xfa52dfc0":"AccountInsufficientFreeAmount()","0xe2a1a260":"AccountInsufficientReservedAmount()","0xffd10028":"AccountInsufficientTradableAmount(uint256,uint256)","0x9996b315":"AddressEmptyCode(address)","0x4c9c8ce3":"ERC1967InvalidImplementation(address)","0xb398979f":"ERC1967NonPayable()","0xd6bda275":"FailedCall()","0x62b925f6":"ForwardedRecipientMustBeMasterAccount(address,address)","0xf92ee8a9":"InvalidInitialization()","0x44d3438f":"NotAddressManager()","0x3fc81f20":"NotDependencyManager()","0xd7e6bcf8":"NotInitializing()","0x507f487a":"NotProxyAdmin()","0xe03f6024":"PermissionDenied(address,address)","0x5274afe7":"SafeERC20FailedOperation(address)","0xe07c8dba":"UUPSUnauthorizedCallContext()","0xaa1d49a4":"UUPSUnsupportedProxiableUUID(bytes32)","0x24775e06":"SafeCastOverflowedUintToInt(uint256)","0xba767932":"ConvertAmountMismatch(uint256,uint256)","0xd93c0665":"EnforcedPause()","0x8dfc202b":"ExpectedPause()","0xc7cbe25a":"GracePeriodNotExpired()","0xdb42144d":"InsufficientBalance(address,uint256,uint256)","0x42301c23":"InsufficientOutputAmount()","0xcaa99aac":"MismatchExecuteFee(uint256,uint256,uint256)","0x70c770c6":"OnlyMarketDecreaseOrder(OrderId)","0x4578ddb8":"OnlyRelayer()","0x25e25e9e":"OrderNotExpired(OrderId)","0x1e4fbdf7":"OwnableInvalidOwner(address)","0x118cdaa7":"OwnableUnauthorizedAccount(address)","0x230e8e43":"PoolNotInPreBenchState(PoolId)","0x3ee5aeb5":"ReentrancyGuardReentrantCall()","0xe356c1d3":"TargetNotAllowed(address)","0x90b8ec18":"TransferFailed()","0xbe1af266":"InternalOnly()","0x856bc1d7":"ExceedMaxOrderCount()","0x3385aa1f":"ExceedOrderSize(uint256)","0xb07e3bc4":"InsufficientCollateral(uint256,uint256)","0x613970e0":"InvalidParameter()","0x8ea9158f":"InvalidPosition(PositionId)","0xf2b2d412":"InvalidTriggerType()","0x70d645e3":"NotPositionOwner()","0xe75316c6":"OrderNotExist(OrderId)","0xba01b06f":"PoolNotActive(PoolId)","0xba0d3752":"PositionNotInitialized(PositionId)","0xddefae28":"AlreadyMinted()","0x64283d7b":"ERC721IncorrectOwner(address,uint256,address)","0x177e802f":"ERC721InsufficientApproval(address,uint256)","0xa9fbf51f":"ERC721InvalidApprover(address)","0x5b08ba18":"ERC721InvalidOperator(address)","0x89c62b64":"ERC721InvalidOwner(address)","0x64a0ae92":"ERC721InvalidReceiver(address)","0x73c6ac6e":"ERC721InvalidSender(address)","0x7e273289":"ERC721NonexistentToken(uint256)","0xb4762117":"ExceedMaxLeverage(PositionId)","0x29143a42":"ExceedPositionSize()","0xa5afd143":"PositionNotHealthy(PositionId,uint256)","0xf4d678b8":"InsufficientBalance()","0x6aee3c1a":"InsufficientRiskReserves()","0x2c5211c6":"InvalidAmount()","0x82cb17ef":"InvalidSplitConfig()","0xe921c36b":"AlreadyMigrated(PositionId,PositionId)","0xd34e366f":"ExceedBaseCollateral(uint256,uint256)","0xc7544914":"ExceedDebt(uint256,uint256)","0xe7aa687a":"ExceedExchangeable()","0x4b3c8f33":"ExceedMaxBaseProfit()","0xdc82bd68":"ExceedMinOutputAmount()","0x5646203f":"InsufficientCollateral(PositionId,uint256)","0x9ac13039":"InsufficientPoolProfit()","0x1b5305a8":"InsufficientRedeemable()","0x14be833f":"InsufficientReturnAmount(uint256,uint256)","0x419ecd12":"MatchNotSupported()","0x5e6797f9":"NotEligibleForLiquidation()","0x9ed303a0":"PoolFundingFeeNotPositive()","0xba8f5df5":"PoolNotCompoundable(PoolId)","0xf645eedf":"ECDSAInvalidSignature()","0xfce698f7":"ECDSAInvalidSignatureLength(uint256)","0xd78bce0c":"ECDSAInvalidSignatureS(bytes32)","0x48834bee":"ExpiredFeeData()","0x56d69198":"InvalidFeeRate()","0x80577032":"NoRebateToClaim()","0x6e6b79b0":"NotBrokerSigner(address)","0xff70343d":"UnsupportedAssetClass(AssetClass)","0x60b25fe4":"BrokerAlreadyExists()","0x7eb4a674":"BrokerNotFound()","0x3e4f8296":"InvalidFeeRateLength()","0x8c3b5bf0":"NotBrokerAdmin()","0x3733548a":"InvalidFeeTier()","0x192105d7":"InitializationFunctionReverted(address,bytes)","0x97c7f537":"ExcessiveSlippage()","0x700deaad":"InvalidADLPosition(OrderId,PositionId)","0xf64fa6a8":"InvalidOrder(OrderId)","0xd4944235":"NoADLNeeded(OrderId)","0xe079169e":"NotReachedPrice(OrderId,uint256,uint256,TriggerType)","0xc60eb335":"OnlyKeeper()","0xa8ce4432":"SafeCastOverflowedIntToUint(int256)","0x17229ec4":"NotMeetEarlyCloseCriteria(PositionId)","0x0dc149f0":"AlreadyInitialized()","0x7a5c919f":"InvalidRewindPrice()","0xc53f84e7":"PositionRemainsHealthy(PositionId)","0x1dab59cf":"InvalidOrderPair(OrderId,OrderId)","0x107dec14":"RiskCloseNotAllowed()","0x664431a8":"NotAllowedTarget(address)","0xaa2c80d8":"CollectFailed()","0xbec00580":"DeadlineInPast()","0x59392ffb":"ExecutionExpired(TxId)","0x09bb89be":"ExecutionNotExpired(TxId)","0xc6a092ef":"ExecutionsNotExist(TxId)","0x5eb3095c":"InsufficientGasEscrow()","0xdfe93090":"InvalidDataLength()","0x73a65a48":"InvalidGasEscrow()","0x41abc801":"InvalidRequest()","0x1b463d8f":"MaxPendingExceeded()","0x8bfbae9a":"NotExecutionOwner(TxId)","0xd2a28b55":"PoolNotExists(PoolId)","0xf0a6cb04":"RefundExceedsEscrow(uint256,uint256)","0x919c2db4":"RefundFailed(TxId)","0x57d5ae0c":"SelectorNotRegistered(bytes4)","0xf1532544":"TxIdAlreadyExists(TxId)","0x03357c6c":"ExceedsMaximumRelayFee()","0x0d10f63b":"InconsistentParamsLength()","0x38802743":"InsufficientFeeAllowance(address,uint256,uint256)","0xd95b4ad5":"InsufficientFeeBalance(address,uint256,uint256)","0xa3972305":"MismatchedSender(address)","0xc3b80e86":"RelayerRegistered(address)","0xee0844a3":"RemoveRelayerFailed()","0xc583a8da":"IncorrectFee(uint256)","0x00bfc921":"InvalidPrice()","0xd96ce906":"PriceIdMismatch()","0x148cd0dd":"VerifyPriceFailed()","0x296e3882":"BoostFeeClaimFailed()","0xdacec8b1":"PoolBoostReserveInsufficient()","0xa83325d4":"PoolOracleFeeCharged()","0x6b75f90d":"PoolOracleFeeNotCharged()","0x42a0e2a7":"PoolOracleFeeNotExisted()","0x8ee01e1c":"PoolOracleFeeNotSoldOut()","0x5e0a829b":"ETHTransferFailed(address,uint256)","0x4ba6536f":"GasLimitExceeded(address,uint256,uint256)","0xca1aae4b":"GasLimitNotSet(address)","0x3728b83d":"InvalidAmount(uint256)","0x3484727e":"BaseFeeNotSoldOut()","0x0251bde4":"LPNotFullyMinted()","0x7decb035":"PoolDebtNotCleared()","0x1acb203e":"PositionNotEmpty()","0xdb752ffd":"UnauthorizedUnboost()","0x2be7b24b":"UnexpectedPoolState()","0x759b3876":"UnhealthyAfterRiskTierApplied(PositionId)","0x7bd42a2e":"NotEmptyAddress()","0x6697b232":"AccessControlBadConfirmation()","0xe2517d3f":"AccessControlUnauthorizedAccount(address,bytes32)","0x7c9a1cf9":"AlreadyVoted()","0x752d88c0":"InvalidAccountNonce(address,uint256)","0x0819bdcd":"SignatureExpired()","0xc00ca938":"UnexpectedCaseState()","0x29ca666b":"UntrustfulVoting()","0x796ea3a6":"BondNotReleased()","0x6511c20d":"BondZeroAmount()","0xf38e5973":"CaseAppealNotFinished()","0x1eaa4a59":"CaseDeadlineNotReached()","0xe6c67e3a":"CaseDeadlineReached()","0x0fc957b1":"CaseNotAccepted()","0x3ddb819d":"CaseNotExist(CaseId)","0x79eab18d":"CaseRespondentAppealed(CaseId,address)","0x311c16d3":"DisputeNotAllowed()","0xdcdedda9":"InvalidPoolToken()","0x3471a3c2":"InvalidProfitAmount()","0xc546bca4":"NotCaseRespondent(CaseId,address)","0x4cf72652":"RiskCloseNotCompleted()","0x7935e939":"UnexpectedCaseType()","0xa9214540":"AlreadyClaimed(CaseId,address)","0xd4ac59c1":"InvalidAmount(CaseId,address)","0x7a6f5328":"MerkleTreeVerificationFailed(CaseId,address)","0x094a5cfe":"ReimbursementValidity(CaseId)","0x8b922563":"TreeAlreadySet()","0xa179f8c9":"ChainIdMismatch()","0x78ee2fc5":"EthCallCountMismatch()","0xa710429d":"InvalidContractAddress()","0x8076dd8a":"InvalidFunctionSignature()","0xc37906a0":"InvalidPayloadLength(uint256,uint256)","0x1d9617a0":"InvalidResponseVersion()","0x9284b197":"InvalidSourceChain()","0x84ae4a30":"NumberOfResponsesMismatch()","0x02164961":"RequestTypeMismatch()","0x6882d7a1":"ResponseCountMismatch()","0x12f1361a":"StaleEthCall()","0x5e7bd6ec":"UnexpectedNumberOfResults()","0x51ee5853":"UnsupportedQueryType(uint8)","0x439cc0cd":"VerificationFailed()","0x714f5513":"VersionMismatch()","0x96b8e05b":"WrongQueryType(uint8,uint8)","0xbb6b170d":"ZeroQueries()","0x7b27120a":"InDisputeMode()","0xb04111ef":"InsufficientFreeCollateral(PositionId,uint256)","0x12f1b11a":"InsufficientLockedCollateral(PositionId,uint256)","0xe12dff41":"InvalidProfitLock()","0x3f902c55":"NoActiveDispute()","0xb923cca7":"PositionHasLockedAmount()","0x6dfcc650":"SafeCastOverflowedUintDowncast(uint8,uint256)","0xd24b47fb":"UserProfitFrozen()","0x176ae915":"InvalidBaseSlippage()","0xd1d452de":"InvalidBaseTokenCollateralRatio()","0x7469d2b7":"InvalidEpochDuration(uint32)","0xeae25452":"InvalidExchangeIncentiveRate()","0x894b012b":"InvalidGenesisRebateRatio()","0x7fd13972":"InvalidLeverage()","0x69fc7240":"InvalidMaintainMarginRate()","0x8f11d7d2":"InvalidMaxCloseSlippage()","0x75e50d4b":"InvalidMaxPriceDeviation()","0xc2c20924":"InvalidMinTradeUsd()","0x9a50eaa5":"InvalidPriceRangePct()","0xa61eabbd":"InvalidWindowCapUsd()","0xa147bb92":"InvalidWindowSize()","0x1c151780":"ExceedMinOutput(uint256,uint256)","0xe1f0493d":"NotAllowedCaller(address)","0xfb8f41b2":"ERC20InsufficientAllowance(address,uint256,uint256)","0xe450d38c":"ERC20InsufficientBalance(address,uint256,uint256)","0xe602df05":"ERC20InvalidApprover(address)","0xec442f05":"ERC20InvalidReceiver(address)","0x96c6fd1e":"ERC20InvalidSender(address)","0x94280d62":"ERC20InvalidSpender(address)","0x62791302":"ERC2612ExpiredSignature(uint256)","0x4b800e46":"ERC2612InvalidSigner(address,address)","0xb3512b0c":"InvalidShortString()","0x305a27a9":"StringTooLong(string)","0xfd0f789d":"ExceedMaxPriceDeviation()","0x407b87e5":"ExchangeRateAlreadyApplied()","0x5c6c5686":"ExchangeRateAlreadyDisabled()","0x1ae17fcd":"InvalidDeviationRatio()","0x37bc9350":"InvalidPriceTimestamp()","0xe47b1dbe":"InvalidPriceUpdater()","0x18b88897":"InvalidUpdateFee()","0x37d0adb4":"MismatchedPriceWithRewindPair()","0xf76740e3":"PriceDeviationBelowMinimum()","0x49386283":"PriceDeviationThresholdReached()","0x5d3751fc":"PriceSourceNotHealthy()","0x43fc1c57":"PriceUpdaterAlreadyAdded(address)","0x8e2b6896":"PriceUpdaterNotFound(address)","0x7f84faec":"PublishTimeMismatch()","0x19abf40e":"StalePrice()","0xe351cd13":"ExceedMaxExchangeableAmount()","0x15912a6f":"NotSupportVersion()","0xf1364a74":"ArrayEmpty()","0x15ed381d":"ExceedMaxProfit()","0x51aeee6c":"PoolNotExist(PoolId)","0x70f6c197":"InvalidQuoteTokenAddress()","0x0b8457f4":"InvalidRatioParams()","0x29dae146":"MarketAlreadyExisted()","0xf040b67a":"MarketNotExisted()","0x0e442a4a":"InvalidBaseToken()","0x24e219c7":"MarketNotExist(MarketId)","0xcc36f935":"PoolExists(PoolId)","0xd54d0fc4":"InsufficientLiquidity(uint256,uint256,uint256)","0x7e562a65":"InvalidDistributionAmount()","0x94eef58a":"ERC2771ForwarderExpiredRequest(uint48)","0xc845a056":"ERC2771ForwarderInvalidSigner(address,address)","0x70647f79":"ERC2771ForwarderMismatchedValue(uint256,uint256)","0xd2650cd1":"ERC2771UntrustfulTarget(address,address)","0xcf479181":"InsufficientBalance(uint256,uint256)","0x4c150d8f":"DifferentMarket(PoolId,PoolId)","0xaa98b06a":"InsufficientQuoteIn(uint256,uint256,uint256)","0x3e589bee":"InvalidLiquidityAmount()","0xaebd3617":"InvalidTpsl(uint256)","0x7fe81129":"SamePoolMigration(PoolId)","0x71c4efed":"SlippageExceeded(uint256,uint256)","0x62b9bc7b":"DesignatedTokenMismatch(address,address)","0x27d08510":"NotActiveBroker(address)","0x49465eb0":"NotForwardAllowedTarget(address)","0xf6412b5a":"NotOrderOwner()","0x301b6707":"ExecutionFeeNotCollected()","0xc6e8248a":"InsufficientSize()","0xd15b4fe2":"InvalidQuoteToken()","0xd8daec7c":"MarketNotInitialized()","0xcd4891b6":"NotInDisputeMode()","0x1ad308dc":"OrderExpired(OrderId)","0x486aa307":"PoolNotInitialized()"};var C={1:"Invalid Chain",2:"Invalid Token Address",4001:"User Rejected",3:"Insufficient Balance",4:"Insufficient Amount Of Approved",4002:"Invalid Base Token Address",4003:"Invalid Slippage",4004:"Invalid Amount",4005:"Invalid Pool State",4006:"Invalid Params",4007:"Invalid Amount Withdrawable LP Amount"};function ra(t){let e=t;for(;e;){if(e.name==="UserRejectedRequestError"||e.code===4001)return true;let n=(e.message||"").toLowerCase();if(n.includes("user rejected")||n.includes("user denied")||n.includes("rejected the request"))return true;e=e.cause;}return false}function ve(t){if(!t||typeof t!="string")return null;let e=t.match(/(0x[0-9a-fA-F]{8,})/);if(!e)return null;let n=e[1].slice(0,10).toLowerCase(),a=Object.keys(we).find(s=>s.toLowerCase()===n);return a?{selector:n,message:we[a]}:null}function Tt(t){let e=t;for(;e;){if(typeof e.data=="string"){let n=ve(e.data);if(n)return n}if(typeof e.details=="string"){let n=ve(e.details);if(n)return n}for(let n of ["message","shortMessage"])if(typeof e[n]=="string"){let a=ve(e[n]);if(a)return a}e=e.cause;}return null}function ht(t){if(!t)return "Unknown error";if(t?.data?.errorName)return `${t.data.errorName}()`;if(Array.isArray(t?.metaMessages)){let n=t.metaMessages.find(a=>a.includes("Error:"));if(n)return n.replace("Error: ","").trim()}let e=Tt(t);return e?e.message:t?.cause?ht(t.cause):t?.reason?t.reason:t?.shortMessage?t.shortMessage:t?.message?t.message:String(t)}async function d(t){if(typeof t=="string")return {error:t};if(ra(t))return {error:C[4001]};let e=Tt(t);if(e)return {error:{code:e.selector,message:e.message}};let n=ht(t);return {error:{code:t?.code||t?.name||"Unknown Error",message:n}}}var Mt=async(t,e,n)=>{try{return await c(t).readContract({address:n,abi:O,functionName:"balanceOf",args:[e]})}catch(a){throw l(a),a}};var Dt=async(t,e,n,a,s)=>{try{return await c(t).readContract({address:n,abi:O,functionName:"allowance",args:[e,a]})>=s}catch(r){throw r}};var F=30,V=18;var R=(t,e)=>BigInt(t)*viem.parseUnits(e.toString(),8)/BigInt(10**8),T=async t=>{try{let e=g[t],n=e?.gasPrice||0n,s=await c(t).getGasPrice();if(s==null)throw new Error("Network Error");let r=R(s,e.gasPriceRatio);return {gasPrice:r>n?r:n}}catch(e){throw e}},Ot=async(t,e)=>{let n=g[t],a=R(e,n.gasLimitRatio),{gasPrice:s}=await T(t);return {gasLimit:a,gasPrice:s}},J=(t,e=.01)=>{let n=viem.parseUnits("1",8)-viem.parseUnits(e.toString(),8);return t*n/BigInt(10**8)};var Ft=async(t,e,n,a,s)=>{try{let r=g[t],o=await xt(t,n);if(!o.write)throw new Error("Wallet client required for write");let u=await o.estimateGas.approve([a,s]),m=R(u,r.gasLimitRatio),{gasPrice:i}=await T(t);console.log("before approve-->",{gasLimit:m,gasPrice:i});let p=await o.write.approve([a,s],{gasLimit:m,gasPrice:i});await c(t).waitForTransactionReceipt({hash:p});}catch(r){throw r}};var f=async t=>{if("chainId"in t&&!je(t.chainId))throw new Error(C[1]);if("slippage"in t&&!(Number(t?.slippage)<=1&&Number(t?.slippage)>0))throw new Error(C[4003]);if("amount"in t&&(Number(t.amount)===Number.NaN||Number(t.amount)<0))throw new Error(C[4004]);let{tokenAddress:e,contractAddress:n,chainId:a,amount:s,decimals:r,account:o}=t;if(s&&a&&Number(r)>=0&&o){let u=viem.parseUnits(s.toString(),Number(r));if(e){let m=await Mt(a,o,e);if(!m||m<u)throw new Error(C[3])}if(n&&e){let m=await Dt(a,o,e,n,u);console.log("checkParams-->",m),m||await Ft(a,o,e,n,viem.maxUint256);}}};async function ma(t){try{return (await fetch(t,{method:"HEAD"})).ok}catch{return false}}var Cr=async(t,e,n)=>{try{let a=c(t),s=e,[r,o,u,m]=await Promise.all([a.readContract({address:s,abi:O,functionName:"name"}),a.readContract({address:s,abi:O,functionName:"symbol"}),a.readContract({address:s,abi:O,functionName:"decimals"}),a.readContract({address:s,abi:O,functionName:"totalSupply"})]),i=viem.getAddress(s),p=`https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/${t}/assets/${i}/logo.png`,A=await ma(p)?p:"",P;if(n){let h=await a.readContract({address:s,abi:O,functionName:"balanceOf",args:[n]});P=Number(viem.formatUnits(h,Number(u)));}return {address:e,name:r,symbol:o,decimals:Number(u),icon:A,totalSupply:Number(viem.formatUnits(m,Number(u))),...n?{balance:P}:{}}}catch(a){throw l(a),a}};var $={};W($,{buildHexDataAndExecutionGasFee:()=>ga,buildSignData:()=>ba,generateTxId:()=>kt,getExecutionTimestamp:()=>Nt});var kt=()=>`0x${cryptoEs.WordArray.random(32).toString()}`,Nt=()=>{let t=la__default.default(),e=t.unix(),n=t.add(1,"minute").unix();return {createAt:e,deadline:n}},ba=async({chainId:t,data:e,from:n,to:a})=>{let{createAt:s,deadline:r}=Nt(),o=kt();return {createAt:s,deadline:r,txId:o,signData:{from:n,to:a,deadline:r,data:e,value:0n,gas:$e}}},ga=async({chainId:t,abi:e,method:n,args:a})=>{let s=viem.encodeFunctionData({abi:e,functionName:n,args:a}),r=viem.getAbiItem({abi:e,name:n}),o=viem.toFunctionSelector(r);console.log("functionSelector-->",o);let m=await(await Pt(t)).read.getGasEscrowForSelector([o]);return {hexData:s,executionGasFee:m}};var _t={};W(_t,{getForwardEip712Domain:()=>Ia,getForwardRequestTypes:()=>xa});var Ia=async t=>{let n=await(await wt(t)).read.eip712Domain();return {name:n[1],version:n[2],chainId:n[3],verifyingContract:n[4]}},xa=()=>({types:{ForwardRequest:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"gas",type:"uint256"},{name:"deadline",type:"uint48"},{name:"data",type:"bytes"}]},primaryType:"ForwardRequest"});var ne={};W(ne,{waitForTransactionReceipt:()=>Aa});var Aa=async(t,e)=>c(t).waitForTransactionReceipt({hash:e});var D=async({chainId:t,account:e,abi:n,method:a,args:s,poolIds:r,to:o})=>{let u=x(t),m=o||u.LIQUIDITY_ROUTER,{hexData:i,executionGasFee:p}=await $.buildHexDataAndExecutionGasFee({abi:n,method:a,args:s,chainId:t}),{createAt:b,txId:A,signData:P}=await $.buildSignData({from:e,chainId:t,to:m,data:i}),h=await Ct(t),y=[A,{...P,createdAt:BigInt(b)},r],Y=await h.estimateGas.submit(y,{value:p}),{gasLimit:ze,gasPrice:ln}=await Ot(t,Y),Ve=await h.write.submit(y,{value:p,gasLimit:ze,gasPrice:ln}),yn=await ne.waitForTransactionReceipt(t,Ve);return {hash:Ve,txId:A,receipt:yn}};var Bt=async t=>{try{let{chainId:e,poolId:n}=t,a=await E(e);return await f({account:a,chainId:e}),await D({chainId:e,account:a,abi:M,method:"claimBasePoolRebate",args:[n,a],poolIds:[n]})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}},Ut=async t=>{try{let{chainId:e,poolIds:n}=t;if(n.length===0)return;let a=await E(e);return await f({account:a,chainId:e}),await D({chainId:e,account:a,abi:M,method:"claimBasePoolRebates",args:[n,a],poolIds:n})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var qt=async({chainId:t,amountIn:e,poolId:n,price:a=0n})=>{try{let s=g[t];return await(await U(t)).read.previewLpAmountOut([n,e,a])}catch(s){throw l(s),typeof s=="string"?s:await d(s)}},Gt=async({chainId:t,amountIn:e,poolId:n,price:a=0n})=>{try{let s=g[t];return await(await U(t)).read.previewBaseAmountOut([n,e,a])}catch(s){throw l(s),typeof s=="string"?s:await d(s)}},zt=async({chainId:t,account:e,poolId:n,amount:a=0})=>{try{if(!t||!e||!n)return;if(!a)return {baseAmountOut:0n,rebateAmount:0n};let s=g[t],r=18;await f({decimals:r,account:e,chainId:t,amount:a});let o=viem.parseUnits(a.toString(),r),m=(await q(t,[n])).data?.[0]?.price||"0",i=viem.parseUnits(m,30),b=await(await U(t)).read.previewUserWithdrawData([n,o,e,i]),[A,P]=b;return {baseAmountOut:A,rebateAmount:P}}catch(s){throw typeof s=="string"?s:await d(s)}};var w=async(t,e)=>{try{return !t||!e?void 0:(await yt(t,e)).data}catch(n){throw typeof n=="string"?n:await d(n)}};var Vt=async(t,e)=>await Promise.all(e.map(async a=>{let{publishTime:s,vaa:r,oracleType:o,nativeFee:u,price:m,poolId:i}=a,p=lodashEs.isNil(u)?1n:BigInt(u);return {poolId:i,price:m,value:p,publishTime:s,oracleType:o??2,vaa:r}})),yi=async(t,e)=>{if(!e||!e.length)return;let n=await q(t,e);return await Vt(t,n.data)},N=async(t,e)=>{if(!e)return;let a=(await q(t,[e]))?.data?.[0];if(!a)throw new Error(`Unable to get price for ${e}`);return (await Vt(t,[a]))?.[0]};function Wt(t){return t.includes(".")?t.split(".")[1].length:0}var ae=(t=.01,e=[],n=18,a)=>{if(e.length===0)return [];if(e.filter(r=>r.amount&&r.triggerPrice&&r.triggerType).length===0)throw new Error(C[4006]);return e.map(r=>{let o=viem.parseUnits(r.amount.toString(),n),u=viem.parseUnits(r.triggerPrice.toString(),30),m=Wt(r.triggerPrice.toString()),i=viem.parseUnits(r.triggerPrice.toString(),m),p=J(o*i*BigInt(10**a)/BigInt(10**(m+n)),t);return {amount:o,triggerPrice:u,triggerType:BigInt(r.triggerType),minQuoteOut:p}})};var se=t=>!(t===0||t===1||t===2||t===5);var oe=async({poolId:t,chainId:e,account:n,amountIn:a,amount:s,slippage:r,state:o,quoteDecimals:u,tpsl:m,previewLpAmountOut:i})=>{let p=se(o),b;if(p){let y=await N(e,t);if(!y)return;let Y=viem.parseUnits(y.price,30);b=await i({chainId:e,poolId:t,amountIn:a,price:Y});}else b=await i({chainId:e,poolId:t,amountIn:a});let A=J(b,r),P=m.map(y=>({amount:s,triggerPrice:y.triggerPrice,triggerType:y.triggerType})),h=ae(r,P,18,u);return {data:{poolId:t,amountIn:a,minAmountOut:A,recipient:n,tpslParams:h}}};var Qt=async t=>{try{let{poolId:e,chainId:n,amount:a,slippage:s=.01,tpsl:r=[]}=t;await f(t);let o=await w(n,e);if(!o)throw new Error(C[4006]);let u=o?.baseDecimals,m=o?.quoteDecimals,i=o?.baseToken,p=await E(n),A=x(n).BASE_POOL;await f({tokenAddress:i,contractAddress:A,decimals:u,account:p,chainId:n,amount:a});let P=viem.parseUnits(a.toString(),u),h=await oe({poolId:e,chainId:n,account:p,amountIn:P,amount:a,slippage:s,state:o.state,quoteDecimals:m,tpsl:r,previewLpAmountOut:qt});return h?await D({chainId:n,account:p,abi:M,method:"depositBase",args:[h.data],poolIds:[e]}):void 0}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var K=async({chainId:t,baseToken:e,marketId:n})=>{try{if(!e)throw new Error(C[2]);let a=x(t),s=await _(t,0),r=[n,e],o=await s.read.getMarketPool(r);return o.poolId==="0x0000000000000000000000000000000000000000000000000000000000000000"||!o.poolId?void 0:o.poolId}catch(a){throw l(a),typeof a=="string"?a:await d(a)}},Me=async t=>{try{return await(await _(t)).read.getPools()||[]}catch(e){throw l(e),typeof e=="string"?e:await d(e)}},De=async(t,e,n=0n)=>{try{let s=await(await Rt(t)).read.getPoolInfo([e,n]);return {quotePool:{poolToken:s.quotePool.poolToken,exchangeRate:s.quotePool.exchangeRate,poolTokenPrice:s.quotePool.poolTokenPrice,poolTokenSupply:s.quotePool.poolTokenSupply,totalDebt:s.quotePool.totalDebt,baseCollateral:s.quotePool.baseCollateral},basePool:{poolToken:s.basePool.poolToken,exchangeRate:s.basePool.exchangeRate,poolTokenPrice:s.basePool.poolTokenPrice,poolTokenSupply:s.basePool.poolTokenSupply,totalDebt:s.basePool.totalDebt,baseCollateral:s.basePool.baseCollateral},reserveInfo:{baseTotalAmount:s.reserveInfo.baseTotalAmount,baseReservedAmount:s.reserveInfo.baseReservedAmount,quoteTotalAmount:s.reserveInfo.quoteTotalAmount,quoteReservedAmount:s.reserveInfo.quoteReservedAmount},fundingInfo:{nextFundingRate:s.fundingInfo.nextFundingRate,lastFundingFeeTracker:s.fundingInfo.lastFundingFeeTracker,nextEpochTime:s.fundingInfo.nextEpochTime},ioTracker:{tracker:s.oi.tracker,longSize:s.oi.longSize,shortSize:s.oi.shortSize,poolEntryPrice:s.oi.poolEntryPrice},liquidityInfo:{windowCaps:s.liquidityInfo.windowCaps,openInterest:s.liquidityInfo.openInterest}}}catch(a){throw l(a),typeof a=="string"?a:await d(a)}};var Oe=async({chainId:t,baseToken:e,marketId:n})=>{try{if(!e)throw new Error(C[2]);let a=g[t],s=await _(t),r={marketId:n,baseToken:e},o=await s.estimateGas.deployPool([r]),u=R(o,a.gasLimitRatio),{gasPrice:m}=await T(t),i=await s.write.deployPool([r],{gasLimit:u,gasPrice:m});if(await c(t).waitForTransactionReceipt({hash:i}))return await K({chainId:t,baseToken:e,marketId:n})}catch(a){throw typeof a=="string"?a:await d(a)}};var Fe=async(t,e,n)=>{try{return await(await Et(t,e)).read.userGenesisShare([n])}catch(a){throw l(a),typeof a=="string"?a:await d(a)}};var Se=async t=>{try{let{chainId:e,poolId:n,poolType:a,slippage:s=.01,tpsl:r=[]}=t;await f(t);let o=await w(e,n);if(!o)throw new Error(C[4006]);let u=18,m=o.quoteDecimals,i=ae(s,r,u,m),p=g[e],b=await Q(e),A={poolId:n,poolType:BigInt(a),tpslParams:i},P=await b.estimateGas.addTpsl([A]),h=R(P,p.gasLimitRatio),{gasPrice:y}=await T(e),Y=await b.write.addTpsl([A],{gasLimit:h,gasPrice:y});return await c(e).waitForTransactionReceipt({hash:Y})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var ke=async t=>{try{let{chainId:e,orderId:n}=t;await f(t);let a=g[e],s=await Q(e),r=await s.estimateGas.cancelTpsl([n]),o=R(r,a.gasLimitRatio),{gasPrice:u}=await T(e),m=await s.write.cancelTpsl([n],{gasLimit:o,gasPrice:u});return await c(e).waitForTransactionReceipt({hash:m})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var Ne=async(t,e,n)=>{try{await f({chainId:t});let a=await w(t,e);if(!a)throw new Error(C[4006]);let s=await E(t),o=((k?.Markets?.length?k?.Markets:await k.getMarkets())||[])?.find(y=>y.chainId===t&&y.marketId===n);if(!o)throw new Error("Invalid Market");let u=viem.parseUnits(o.oracleFeeUsd.toString(),a.quoteDecimals);if(!u)throw new Error("Invalid Market");await f({tokenAddress:a.quoteToken,contractAddress:x(t).ORACLE_RESERVE,decimals:a.quoteDecimals,account:s,chainId:t,amount:viem.formatUnits(u,a.quoteDecimals)});let m=g[t],i=await _(t),p=await i.estimateGas.reprimePool([{poolId:e}]),b=R(p,m.gasLimitRatio),{gasPrice:A}=await T(t),P=await i.write.reprimePool([{poolId:e}],{gasLimit:b,gasPrice:A});return await c(t).waitForTransactionReceipt({hash:P})}catch(a){throw l(a),typeof a=="string"?a:await d(a)}};var _e=async(t,e)=>{try{let n=await X.getInstance().getConfigManager()?.getAccessToken();if(!n)throw new Error("Failed to obtain accessToken");return (await ct(n,e,t)).data||[]}catch(n){throw l(n),n}};var Be=async t=>{try{let{chainId:e,poolId:n}=t;await f({chainId:e});let a=await w(e,n);if(!a)throw new Error(C[4006]);let s=await E(e),o=((k?.Markets?.length?k?.Markets:await k.getMarkets())||[])?.find(y=>y.chainId===e&&y.marketId===a.marketId);if(!o)throw new Error("Invalid Market");let u=viem.parseUnits(o.boostFeeUsd.toString(),a.quoteDecimals);if(!u)throw new Error("Invalid Market");await f({tokenAddress:a.quoteToken,contractAddress:x(e).ORACLE_RESERVE,decimals:a.quoteDecimals,account:s,chainId:e,amount:viem.formatUnits(u,a.quoteDecimals)});let m=g[e],i=await _(e),p=await i.estimateGas.boostPool([{poolId:n}]),b=R(p,m.gasLimitRatio),{gasPrice:A}=await T(e),P=await i.write.boostPool([{poolId:n}],{gasLimit:b,gasPrice:A});return await c(e).waitForTransactionReceipt({hash:P})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var Ue=async t=>{try{let{chainId:e,poolId:n}=t;await f({chainId:e});let a=g[e],s=await _(e),r=await s.estimateGas.unboostPool([{poolId:n}]),o=R(r,a.gasLimitRatio),{gasPrice:u}=await T(e),m=await s.write.unboostPool([{poolId:n}],{gasLimit:o,gasPrice:u});return await c(e).waitForTransactionReceipt({hash:m})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var Le=async t=>{try{let{chainId:e,poolId:n}=t;await f({chainId:e});let a=g[e],s=await At(e),r=await s.estimateGas.claimBoostFee([n]),o=R(r,a.gasLimitRatio),{gasPrice:u}=await T(e),m=await s.write.claimBoostFee([n],{gasLimit:o,gasPrice:u});return await c(e).waitForTransactionReceipt({hash:m})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var Ht=async({chainId:t,amountIn:e,poolId:n,price:a=0n})=>{try{return await(await G(t)).read.previewLpAmountOut([n,e,a])}catch(s){throw l(s),typeof s=="string"?s:await d(s)}},Jt=async({chainId:t,amountIn:e,poolId:n,price:a=0n})=>{try{return await(await G(t)).read.previewQuoteAmountOut([n,e,a])}catch(s){throw l(s),typeof s=="string"?s:await d(s)}};var re=async({amountIn:t,chainId:e,poolId:n,state:a,slippage:s,poolType:r,account:o})=>{let u=se(a),m,i=r===0?Gt:Jt;if(u)try{let b=await N(e,n);if(b){let A=viem.parseUnits(b.price,30);m=await i({chainId:e,poolId:n,amountIn:t,price:A});}}catch(b){console.error(b),m=await i({chainId:e,poolId:n,amountIn:t});}else m=await i({chainId:e,poolId:n,amountIn:t});return {data:{poolId:n,amountIn:t,minAmountOut:J(m,s),recipient:o}}};var Yt=async t=>{try{let{chainId:e,poolId:n,price:a}=t,s=a,r=await U(e);if(typeof a>"u"||a===null)try{let u=await N(e,n);s=viem.parseUnits(u?.price||"0",30);}catch{s=viem.parseUnits("0",30);}return await r.read.withdrawableLpAmount([n,s||0n])}catch(e){throw typeof e=="string"?e:await d(e)}},Xt=async t=>{try{let{chainId:e,poolId:n,amount:a,slippage:s=.01}=t,r=await w(e,n),o=r?.basePoolToken,u=g[e],m=await E(e),i=18;await f({tokenAddress:o,decimals:i,account:m,chainId:e,amount:a});let p=viem.parseUnits(a.toString(),i),{data:b}=await re({poolId:n,chainId:e,account:m,amountIn:p,slippage:s,poolType:0,state:r?.state});return await D({chainId:e,account:m,abi:M,method:"withdrawBase",args:[b],poolIds:[n]})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var jt=async t=>{try{let{chainId:e,account:n,poolId:a}=t;if(!e||!n||!a)return;let s=g[e],r=0n,u=(await q(e,[a])).data?.[0]?.price||"0",m=viem.parseUnits(u,30),p=await(await U(e)).read.pendingUserRebates([a,n,m]),[b,A]=p;return {rebates:b,genesisRebates:A}}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var $t=async(t,e)=>{if(e)try{let n=await U(t),a=0n,s=await N(t,e);return s?.price&&(a=viem.parseUnits(s.price,30)),await n.read.getPoolTokenPrice([e,a])}catch(n){throw typeof n=="string"?n:await d(n)}};var pn={};W(pn,{claimQuotePoolRebate:()=>sn,claimQuotePoolRebates:()=>on,deposit:()=>Zt,getLpPrice:()=>rn,getRewards:()=>an,transfer:()=>nn,withdraw:()=>tn,withdrawableLpAmount:()=>en});var Zt=async t=>{try{let{poolId:e,chainId:n,amount:a,slippage:s=.01,tpsl:r=[]}=t;await f(t);let o=await w(n,e);if(!o)throw new Error(C[4006]);let u=await E(n),i=x(n).QUOTE_POOL,p=o.quoteToken,b=o?.quoteDecimals;await f({tokenAddress:p,contractAddress:i,decimals:b,account:u,chainId:n,amount:a});let A=viem.parseUnits(a.toString(),b),P=await oe({poolId:e,chainId:n,account:u,amountIn:A,amount:a,slippage:s,state:o.state,quoteDecimals:b,tpsl:r,previewLpAmountOut:Ht});return P?await D({chainId:n,account:u,abi:M,method:"depositQuote",args:[P.data],poolIds:[e]}):void 0}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var en=async t=>{try{let{chainId:e,poolId:n,price:a}=t,s=a,r=await G(e);if(typeof a>"u"||a===null)try{let u=await N(e,n);s=viem.parseUnits(u?.price||"0",30);}catch{s=viem.parseUnits("0",30);}return await r.read.withdrawableLpAmount([n,s||0n])}catch(e){throw l(e),typeof e=="string"?e:await d(e)}},tn=async t=>{try{let{chainId:e,poolId:n,amount:a,slippage:s=.01}=t,r=await w(e,n),o=r?.quotePoolToken,u=await E(e),m=18;await f({tokenAddress:o,decimals:m,account:u,chainId:e,amount:a});let i=viem.parseUnits(a.toString(),m),{data:p}=await re({poolId:n,chainId:e,account:u,amountIn:i,slippage:s,poolType:1,state:r?.state});return await D({chainId:e,account:u,abi:M,method:"withdrawQuote",args:[p],poolIds:[n]})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var nn=async(t,e,n,a)=>{try{let s=await w(t,e),r=await w(t,n);if(!r||!s)return null;if([4,5].includes(r.state))throw new Error(C[4005]);let o=await E(t),u=g[t],m=18;await f({chainId:t,amount:a,account:o,decimals:m,tokenAddress:s.quotePoolToken});let i={fromPoolId:e,toPoolId:n,minLpOut:0n,amount:viem.parseUnits(a.toString(),m)},p=await Q(t),b=await p.estimateGas.migrateLiquidity([i]),A=R(b,u.gasLimitRatio),{gasPrice:P}=await T(t),h=await p.write.migrateLiquidity([i],{gasLimit:A,gasPrice:P});return await c(t).waitForTransactionReceipt({hash:h})}catch(s){throw typeof s=="string"?s:await d(s)}};var an=async t=>{try{let{chainId:e,account:n,poolId:a}=t;if(!e||!n||!a)return;let r=(await q(e,[a])).data?.[0]?.price||"0",o=viem.parseUnits(r,30);return await(await G(e)).read.pendingUserRebates([a,n,o])}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var sn=async t=>{try{let{chainId:e,poolId:n}=t,a=await E(e);return await f({account:a,chainId:e}),await D({chainId:e,account:a,abi:M,method:"claimQuotePoolRebate",args:[n,a],poolIds:[n]})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}},on=async t=>{try{let{chainId:e,poolIds:n}=t;if(n.length===0)return;let a=await E(e);return await f({account:a,chainId:e}),await D({chainId:e,account:a,abi:M,method:"claimQuotePoolRebates",args:[n,a],poolIds:n})}catch(e){throw l(e),typeof e=="string"?e:await d(e)}};var rn=async(t,e)=>{if(e)try{let n=await G(t),a=0n,s=await N(t,e);return s?.price&&(a=viem.parseUnits(s.price,30)),await n.read.getPoolTokenPrice([e,a])}catch(n){throw l(n),typeof n=="string"?n:await d(n)}};var dn={};W(dn,{getMarket:()=>un,getOracleFee:()=>mn});var un=async(t,e)=>{try{if(await f({chainId:t}),!e)return;let a=await(await ee(t)).read.getMarket([e]),{quoteToken:s,baseReserveRatio:r,quoteReserveRatio:o,oracleFeeUsd:u,boostFeeUsd:m,boostRefundFeeUsd:i,poolPrimeThreshold:p,executionFee:b,maxExecutionFee:A,forwardFee:P,maxForwardFee:h}=a;return a}catch(n){throw l(n),typeof n=="string"?n:await d(n)}};var mn=async(t,e)=>{try{return await f({chainId:t}),e?await(await ee(t)).read.getOracleFee([e]):void 0}catch(n){throw l(n),typeof n=="string"?n:await d(n)}};var wd={createPool:Oe,getMarketPoolId:K,getMarketPools:Me,getPoolInfo:De,getUserGenesisShare:Fe,addTpSl:Se,cancelTpSl:ke,reprime:Ne,getPoolDetail:w,getOpenOrders:_e,boostPool:Be,unBoostPool:Ue,claimBoostFee:Le};
|
|
2
2
|
Object.defineProperty(exports,"Aa",{enumerable:true,get:function(){return viem.formatUnits}});Object.defineProperty(exports,"Ba",{enumerable:true,get:function(){return viem.parseUnits}});exports.$=Rt;exports.A=Yn;exports.B=Xn;exports.C=jn;exports.Ca=D;exports.D=$n;exports.Da=yi;exports.E=Kn;exports.Ea=N;exports.F=Zn;exports.Fa=Kt;exports.G=ea;exports.Ga=pn;exports.H=Ns;exports.Ha=dn;exports.I=L;exports.Ia=wd;exports.J=q;exports.K=yt;exports.L=ct;exports.M=Ls;exports.N=qs;exports.O=Gs;exports.P=ft;exports.Q=X;exports.R=Xs;exports.S=x;exports.T=It;exports.U=Oo;exports.V=Fo;exports.W=xt;exports.X=So;exports.Y=Ct;exports.Z=ko;exports._=ee;exports.a=gn;exports.aa=No;exports.b=je;exports.ba=wt;exports.c=La;exports.ca=_o;exports.d=$e;exports.da=Bo;exports.e=g;exports.ea=aa;exports.f=ie;exports.fa=Ee;exports.g=c;exports.ga=sa;exports.h=Pn;exports.ha=oa;exports.i=En;exports.ia=l;exports.j=v;exports.ja=vt;exports.k=ce;exports.ka=we;exports.l=Ie;exports.la=ra;exports.m=Ae;exports.ma=d;exports.n=ot;exports.na=Mt;exports.o=B;exports.oa=Dt;exports.p=Un;exports.pa=F;exports.q=Ln;exports.qa=V;exports.r=lt;exports.ra=R;exports.s=qn;exports.sa=T;exports.t=Gn;exports.ta=Ot;exports.u=zn;exports.ua=J;exports.v=Vn;exports.va=Ft;exports.w=Wn;exports.wa=Cr;exports.x=Qn;exports.xa=$;exports.y=Hn;exports.ya=_t;exports.z=Jn;exports.za=ne;
|