@latchprotocol/widgets 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +649 -0
- package/dist/adapters/binDistribution.d.ts +19 -0
- package/dist/adapters/binDistribution.d.ts.map +1 -0
- package/dist/adapters/protocol.d.ts +409 -0
- package/dist/adapters/protocol.d.ts.map +1 -0
- package/dist/adapters/sale.d.ts +142 -0
- package/dist/adapters/sale.d.ts.map +1 -0
- package/dist/adapters/viem.d.ts +89 -0
- package/dist/adapters/viem.d.ts.map +1 -0
- package/dist/callpath/constants.d.ts +218 -0
- package/dist/callpath/constants.d.ts.map +1 -0
- package/dist/callpath/launch.d.ts +1979 -0
- package/dist/callpath/launch.d.ts.map +1 -0
- package/dist/callpath/liquidity.d.ts +103 -0
- package/dist/callpath/liquidity.d.ts.map +1 -0
- package/dist/callpath/plan.d.ts +34 -0
- package/dist/callpath/plan.d.ts.map +1 -0
- package/dist/callpath/swap.d.ts +129 -0
- package/dist/callpath/swap.d.ts.map +1 -0
- package/dist/chunks/SwapWidget-DgyHAVc8.js +2404 -0
- package/dist/chunks/SwapWidget-DgyHAVc8.js.map +1 -0
- package/dist/chunks/scan-Dhu7f4Nl.js +2497 -0
- package/dist/chunks/scan-Dhu7f4Nl.js.map +1 -0
- package/dist/chunks/useLocker-D1c_NTk-.js +1613 -0
- package/dist/chunks/useLocker-D1c_NTk-.js.map +1 -0
- package/dist/components/LaunchWidget.d.ts +117 -0
- package/dist/components/LaunchWidget.d.ts.map +1 -0
- package/dist/components/LiquidityWidget.d.ts +33 -0
- package/dist/components/LiquidityWidget.d.ts.map +1 -0
- package/dist/components/LockerWidget.d.ts +51 -0
- package/dist/components/LockerWidget.d.ts.map +1 -0
- package/dist/components/LocksWidgets.d.ts +61 -0
- package/dist/components/LocksWidgets.d.ts.map +1 -0
- package/dist/components/SwapWidget.d.ts +165 -0
- package/dist/components/SwapWidget.d.ts.map +1 -0
- package/dist/components/TokenTrustPanel.d.ts +32 -0
- package/dist/components/TokenTrustPanel.d.ts.map +1 -0
- package/dist/components/lockCharts.d.ts +29 -0
- package/dist/components/lockCharts.d.ts.map +1 -0
- package/dist/components/portal.d.ts +10 -0
- package/dist/components/portal.d.ts.map +1 -0
- package/dist/components/primitives.d.ts +139 -0
- package/dist/components/primitives.d.ts.map +1 -0
- package/dist/components/swap/SwapSettings.d.ts +12 -0
- package/dist/components/swap/SwapSettings.d.ts.map +1 -0
- package/dist/components/swap/TokenSelect.d.ts +61 -0
- package/dist/components/swap/TokenSelect.d.ts.map +1 -0
- package/dist/components/swap/state.d.ts +208 -0
- package/dist/components/swap/state.d.ts.map +1 -0
- package/dist/config/chain.d.ts +163 -0
- package/dist/config/chain.d.ts.map +1 -0
- package/dist/config/integrator.d.ts +121 -0
- package/dist/config/integrator.d.ts.map +1 -0
- package/dist/context/WidgetProvider.d.ts +78 -0
- package/dist/context/WidgetProvider.d.ts.map +1 -0
- package/dist/core/clMath.d.ts +98 -0
- package/dist/core/clMath.d.ts.map +1 -0
- package/dist/core/errors.d.ts +18 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/format.d.ts +47 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/liquidityGuards.d.ts +53 -0
- package/dist/core/liquidityGuards.d.ts.map +1 -0
- package/dist/core/liquidityRefresh.d.ts +35 -0
- package/dist/core/liquidityRefresh.d.ts.map +1 -0
- package/dist/core/math.d.ts +129 -0
- package/dist/core/math.d.ts.map +1 -0
- package/dist/core/pool.d.ts +33 -0
- package/dist/core/pool.d.ts.map +1 -0
- package/dist/core/tokenLists.d.ts +46 -0
- package/dist/core/tokenLists.d.ts.map +1 -0
- package/dist/embed/iframe.d.ts +185 -0
- package/dist/embed/iframe.d.ts.map +1 -0
- package/dist/embed/lockBadge.d.ts +55 -0
- package/dist/embed/lockBadge.d.ts.map +1 -0
- package/dist/embed/webComponent.d.ts +83 -0
- package/dist/embed/webComponent.d.ts.map +1 -0
- package/dist/embed.d.ts +25 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/embed.js +543 -0
- package/dist/embed.js.map +1 -0
- package/dist/headless.d.ts +60 -0
- package/dist/headless.d.ts.map +1 -0
- package/dist/headless.js +223 -0
- package/dist/headless.js.map +1 -0
- package/dist/hooks/useAsyncResource.d.ts +38 -0
- package/dist/hooks/useAsyncResource.d.ts.map +1 -0
- package/dist/hooks/useLaunch.d.ts +140 -0
- package/dist/hooks/useLaunch.d.ts.map +1 -0
- package/dist/hooks/useLiquidity.d.ts +91 -0
- package/dist/hooks/useLiquidity.d.ts.map +1 -0
- package/dist/hooks/useLocker.d.ts +77 -0
- package/dist/hooks/useLocker.d.ts.map +1 -0
- package/dist/hooks/useLocks.d.ts +33 -0
- package/dist/hooks/useLocks.d.ts.map +1 -0
- package/dist/hooks/useSwapExecute.d.ts +46 -0
- package/dist/hooks/useSwapExecute.d.ts.map +1 -0
- package/dist/hooks/useSwapQuote.d.ts +51 -0
- package/dist/hooks/useSwapQuote.d.ts.map +1 -0
- package/dist/hooks/useTokenLists.d.ts +26 -0
- package/dist/hooks/useTokenLists.d.ts.map +1 -0
- package/dist/hooks/useTokenTrust.d.ts +40 -0
- package/dist/hooks/useTokenTrust.d.ts.map +1 -0
- package/dist/hooks/useTokens.d.ts +15 -0
- package/dist/hooks/useTokens.d.ts.map +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1052 -0
- package/dist/index.js.map +1 -0
- package/dist/latch-embed.d.ts +19 -0
- package/dist/latch-embed.d.ts.map +1 -0
- package/dist/latch-embed.js +950 -0
- package/dist/latch-embed.js.map +1 -0
- package/dist/latch-embed.mjs +13162 -0
- package/dist/latch-embed.mjs.map +1 -0
- package/dist/locker/model.d.ts +73 -0
- package/dist/locker/model.d.ts.map +1 -0
- package/dist/locks/embedModel.d.ts +22 -0
- package/dist/locks/embedModel.d.ts.map +1 -0
- package/dist/locks/fetch.d.ts +60 -0
- package/dist/locks/fetch.d.ts.map +1 -0
- package/dist/locks/model.d.ts +143 -0
- package/dist/locks/model.d.ts.map +1 -0
- package/dist/locks/scan.d.ts +25 -0
- package/dist/locks/scan.d.ts.map +1 -0
- package/dist/styles/css.d.ts +32 -0
- package/dist/styles/css.d.ts.map +1 -0
- package/dist/styles.css +895 -0
- package/dist/trust/model.d.ts +48 -0
- package/dist/trust/model.d.ts.map +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1,950 @@
|
|
|
1
|
+
var LatchEmbed=function(v){"use strict";var ol=Object.defineProperty;var Zr=v=>{throw TypeError(v)};var sl=(v,A,k)=>A in v?ol(v,A,{enumerable:!0,configurable:!0,writable:!0,value:k}):v[A]=k;var zt=(v,A,k)=>sl(v,typeof A!="symbol"?A+"":A,k),jn=(v,A,k)=>A.has(v)||Zr("Cannot "+k);var _=(v,A,k)=>(jn(v,A,"read from private field"),k?k.call(v):A.get(v)),se=(v,A,k)=>A.has(v)?Zr("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(v):A.set(v,k),H=(v,A,k,F)=>(jn(v,A,"write to private field"),F?F.call(v,k):A.set(v,k),k),$=(v,A,k)=>(jn(v,A,"access private method"),k);var Yr=(v,A,k,F)=>({set _(bt){H(v,A,bt,k)},get _(){return _(v,A,F)}});var le,Re,re,ze,ve,ke,je,M,qn,jt,Jr,Gn,Ue,Ut;const A="1.2.3";let k=class Un extends Error{constructor(t,n={}){const a=n.cause instanceof Un?n.cause.details:n.cause?.message?n.cause.message:n.details,r=n.cause instanceof Un&&n.cause.docsPath||n.docsPath,i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...a?[`Details: ${a}`]:[],`Version: abitype@${A}`].join(`
|
|
2
|
+
`);super(i),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=a,this.docsPath=r,this.metaMessages=n.metaMessages,this.shortMessage=t}};function F(e,t){return e.exec(t)?.groups}const bt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Wn=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Vn=/^\(.+?\).*?$/,Kn=/^tuple(?<array>(\[(\d*)\])*)$/;function Ht(e){let t=e.type;if(Kn.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){const i=e.components[r];t+=Ht(i),r<n-1&&(t+=", ")}const a=F(Kn,e.type);return t+=`)${a?.array||""}`,Ht({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function He(e){let t="";const n=e.length;for(let a=0;a<n;a++){const r=e[a];t+=Ht(r),a!==n-1&&(t+=", ")}return t}function Qr(e){return e.type==="function"?`function ${e.name}(${He(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${He(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${He(e.inputs)})`:e.type==="error"?`error ${e.name}(${He(e.inputs)})`:e.type==="constructor"?`constructor(${He(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Xn=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function ei(e){return Xn.test(e)}function ti(e){return F(Xn,e)}const Zn=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function ni(e){return Zn.test(e)}function ai(e){return F(Zn,e)}const Yn=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function ri(e){return Yn.test(e)}function ii(e){return F(Yn,e)}const Jn=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function qt(e){return Jn.test(e)}function oi(e){return F(Jn,e)}const Qn=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function si(e){return Qn.test(e)}function ci(e){return F(Qn,e)}const ea=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function ui(e){return ea.test(e)}function li(e){return F(ea,e)}const di=/^receive\(\) external payable$/;function pi(e){return di.test(e)}const fi=new Set(["indexed"]),Gt=new Set(["calldata","memory","storage"]);class yi extends k{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class mi extends k{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class hi extends k{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class bi extends k{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class gi extends k{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class wi extends k{constructor({param:t,type:n,modifier:a}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${a}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class xi extends k{constructor({param:t,type:n,modifier:a}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${a}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${a}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class vi extends k{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Te extends k{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class ki extends k{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Ti extends k{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Ci extends k{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Ei extends k{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Ai(e,t,n){let a="";if(n)for(const r of Object.entries(n)){if(!r)continue;let i="";for(const o of r[1])i+=`[${o.type}${o.name?`:${o.name}`:""}]`;a+=`(${r[0]}{${i}})`}return t?`${t}:${e}${a}`:`${e}${a}`}const Wt=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Vt(e,t={}){if(ri(e))return Pi(e,t);if(ni(e))return Ii(e,t);if(ei(e))return Mi(e,t);if(si(e))return Bi(e,t);if(ui(e))return _i(e);if(pi(e))return{type:"receive",stateMutability:"payable"};throw new ki({signature:e})}function Pi(e,t={}){const n=ii(e);if(!n)throw new Te({signature:e,type:"function"});const a=q(n.parameters),r=[],i=a.length;for(let s=0;s<i;s++)r.push(ye(a[s],{modifiers:Gt,structs:t,type:"function"}));const o=[];if(n.returns){const s=q(n.returns),c=s.length;for(let l=0;l<c;l++)o.push(ye(s[l],{modifiers:Gt,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:r,outputs:o}}function Ii(e,t={}){const n=ai(e);if(!n)throw new Te({signature:e,type:"event"});const a=q(n.parameters),r=[],i=a.length;for(let o=0;o<i;o++)r.push(ye(a[o],{modifiers:fi,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:r}}function Mi(e,t={}){const n=ti(e);if(!n)throw new Te({signature:e,type:"error"});const a=q(n.parameters),r=[],i=a.length;for(let o=0;o<i;o++)r.push(ye(a[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:r}}function Bi(e,t={}){const n=ci(e);if(!n)throw new Te({signature:e,type:"constructor"});const a=q(n.parameters),r=[],i=a.length;for(let o=0;o<i;o++)r.push(ye(a[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:r}}function _i(e){const t=li(e);if(!t)throw new Te({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const Li=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,$i=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Si=/^u?int$/;function ye(e,t){const n=Ai(e,t?.type,t?.structs);if(Wt.has(n))return Wt.get(n);const a=Vn.test(e),r=F(a?$i:Li,e);if(!r)throw new bi({param:e});if(r.name&&Oi(r.name))throw new gi({param:e,name:r.name});const i=r.name?{name:r.name}:{},o=r.modifier==="indexed"?{indexed:!0}:{},s=t?.structs??{};let c,l={};if(a){c="tuple";const d=q(r.type),f=[],p=d.length;for(let m=0;m<p;m++)f.push(ye(d[m],{structs:s}));l={components:f}}else if(r.type in s)c="tuple",l={components:s[r.type]};else if(Si.test(r.type))c=`${r.type}256`;else if(r.type==="address payable")c="address";else if(c=r.type,t?.type!=="struct"&&!ta(c))throw new hi({type:c});if(r.modifier){if(!t?.modifiers?.has?.(r.modifier))throw new wi({param:e,type:t?.type,modifier:r.modifier});if(Gt.has(r.modifier)&&!Ni(c,!!r.array))throw new xi({param:e,type:t?.type,modifier:r.modifier})}const u={type:`${c}${r.array??""}`,...i,...o,...l};return Wt.set(n,u),u}function q(e,t=[],n="",a=0){const r=e.trim().length;for(let i=0;i<r;i++){const o=e[i],s=e.slice(i+1);switch(o){case",":return a===0?q(s,[...t,n.trim()]):q(s,t,`${n}${o}`,a);case"(":return q(s,t,`${n}${o}`,a+1);case")":return q(s,t,`${n}${o}`,a-1);default:return q(s,t,`${n}${o}`,a)}}if(n==="")return t;if(a!==0)throw new Ei({current:n,depth:a});return t.push(n.trim()),t}function ta(e){return e==="address"||e==="bool"||e==="function"||e==="string"||bt.test(e)||Wn.test(e)}const Fi=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function Oi(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||bt.test(e)||Wn.test(e)||Fi.test(e)}function Ni(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function na(e){const t={},n=e.length;for(let o=0;o<n;o++){const s=e[o];if(!qt(s))continue;const c=oi(s);if(!c)throw new Te({signature:s,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let f=0;f<d;f++){const m=l[f].trim();if(!m)continue;const y=ye(m,{type:"struct"});u.push(y)}if(!u.length)throw new Ti({signature:s});t[c.name]=u}const a={},r=Object.entries(t),i=r.length;for(let o=0;o<i;o++){const[s,c]=r[o];a[s]=aa(c,t)}return a}const Di=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function aa(e=[],t={},n=new Set){const a=[],r=e.length;for(let i=0;i<r;i++){const o=e[i];if(Vn.test(o.type))a.push(o);else{const c=F(Di,o.type);if(!c?.type)throw new vi({abiParameter:o});const{array:l,type:u}=c;if(u in t){if(n.has(u))throw new Ci({type:u});a.push({...o,type:`tuple${l??""}`,components:aa(t[u],t,new Set([...n,u]))})}else if(ta(u))a.push(o);else throw new mi({type:u})}}return a}function ra(e){const t=na(e),n=[],a=e.length;for(let r=0;r<a;r++){const i=e[r];qt(i)||n.push(Vt(i,t))}return n}function ia(e){let t;if(typeof e=="string")t=Vt(e);else{const n=na(e),a=e.length;for(let r=0;r<a;r++){const i=e[r];if(!qt(i)){t=Vt(i,n);break}}}if(!t)throw new yi({signature:e});return t}function Ri(e,t,n){const a=e[t.name];if(typeof a=="function")return a;const r=e[n];return typeof r=="function"?r:i=>t(e,i)}function G(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Qi(e.type);return`${e.name}(${gt(e.inputs,{includeName:t})})`}function gt(e,{includeName:t=!1}={}){return e?e.map(n=>zi(n,{includeName:t})).join(t?", ":","):""}function zi(e,{includeName:t}){return e.type.startsWith("tuple")?`(${gt(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Ce(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function L(e){return Ce(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const oa="2.56.3";let Kt={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${oa}`},b=class Hn extends Error{constructor(t,n={}){const a=n.cause instanceof Hn?n.cause.details:n.cause?.message?n.cause.message:n.details,r=n.cause instanceof Hn&&n.cause.docsPath||n.docsPath,i=Kt.getDocsUrl?.({...n,docsPath:r}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...a?[`Details: ${a}`]:[],...Kt.version?[`Version: ${Kt.version}`]:[]].join(`
|
|
3
|
+
`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=a,this.docsPath=r,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=oa}walk(t){return sa(this,t)}};function sa(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?sa(e.cause,t):t?null:e}class ji extends b{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
4
|
+
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class ca extends b{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
5
|
+
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class ua extends b{constructor({data:t,params:n,size:a}){super([`Data size of ${a} bytes is too small for given parameters.`].join(`
|
|
6
|
+
`),{metaMessages:[`Params: (${gt(n,{includeName:!0})})`,`Data: ${t} (${a} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=a}}class Xt extends b{constructor({cause:t}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:t})}}class Ui extends b{constructor({expectedLength:t,givenLength:n,type:a}){super([`ABI encoding array length mismatch for type ${a}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
|
|
7
|
+
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class Hi extends b{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${L(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class qi extends b{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
|
|
8
|
+
`),{name:"AbiEncodingLengthMismatchError"})}}class Gi extends b{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
|
|
9
|
+
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class la extends b{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
|
|
10
|
+
`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class da extends b{constructor(t,{docsPath:n,cause:a}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
11
|
+
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError",cause:a}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Wi extends b{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class Vi extends b{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
12
|
+
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class pa extends b{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
|
|
13
|
+
`),{docsPath:n,name:"AbiEventNotFoundError"})}}class Ee extends b{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
14
|
+
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class fa extends b{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
15
|
+
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class Ki extends b{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
16
|
+
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class Xi extends b{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${G(t.abiItem)}\`, and`,`\`${n.type}\` in \`${G(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class ya extends b{constructor({abiItem:t,data:n,params:a,size:r}){super([`Data size of ${r} bytes is too small for non-indexed event parameters.`].join(`
|
|
17
|
+
`),{metaMessages:[`Params: (${gt(a,{includeName:!0})})`,`Data: ${n} (${r} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=a,this.size=r}}class Zi extends b{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${G(t,{includeName:!0})}".`].join(`
|
|
18
|
+
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Yi extends b{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
19
|
+
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Ji extends b{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
20
|
+
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}class ma extends b{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
21
|
+
`),{name:"InvalidArrayError"})}}class Qi extends b{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
22
|
+
`),{name:"InvalidDefinitionTypeError"})}}class eo extends b{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}class ha extends b{constructor({offset:t,position:n,size:a}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${a}).`,{name:"SliceOffsetOutOfBoundsError"})}}let ba=class extends b{constructor({size:t,targetSize:n,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class ga extends b{constructor({size:t,targetSize:n,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} is expected to be ${n} ${a} long, but is ${t} ${a} long.`,{name:"InvalidBytesLengthError"})}}function Ae(e,{dir:t,size:n=32}={}){return typeof e=="string"?ce(e,{dir:t,size:n}):to(e,{dir:t,size:n})}function ce(e,{dir:t,size:n=32}={}){if(n===null)return e;const a=e.replace("0x","");if(a.length>n*2)throw new ba({size:Math.ceil(a.length/2),targetSize:n,type:"hex"});return`0x${a[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function to(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new ba({size:e.length,targetSize:n,type:"bytes"});const a=new Uint8Array(n);for(let r=0;r<n;r++){const i=t==="right";a[i?r:n-r-1]=e[i?r:e.length-r-1]}return a}let Zt=class extends b{constructor({max:t,min:n,signed:a,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${r*8}-bit ${a?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}};class no extends b{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class ao extends b{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function wa(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,a=0;for(let r=0;r<n.length-1&&n[t==="left"?r:n.length-r-1].toString()==="0";r++)a++;return n=t==="left"?n.slice(a):n.slice(0,n.length-a),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function K(e,{size:t}){if(L(e)>t)throw new ao({givenSize:L(e),maxSize:t})}function xa(e,t={}){const{signed:n}=t;t.size&&K(e,{size:t.size});const a=BigInt(e);if(!n)return a;const r=Math.ceil((e.length-2)/2),i=(1n<<BigInt(r)*8n-1n)-1n;return a<=i?a:a-BigInt(`0x${"f".padStart(r*2,"f")}`)-1n}function Yt(e,t={}){const n=xa(e,t),a=Number(n);if(!Number.isSafeInteger(a))throw new Zt({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return a}const ro=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function io(e,t={}){return typeof e=="number"||typeof e=="bigint"?I(e,t):typeof e=="string"?ka(e,t):typeof e=="boolean"?va(e,t):Q(e,t)}function va(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(K(n,{size:t.size}),Ae(n,{size:t.size})):n}function Q(e,t={}){let n="";for(let r=0;r<e.length;r++)n+=ro[e[r]];const a=`0x${n}`;return typeof t.size=="number"?(K(a,{size:t.size}),Ae(a,{dir:"right",size:t.size})):a}function I(e,t={}){const{signed:n,size:a}=t,r=BigInt(e);let i;a?n?i=(1n<<BigInt(a)*8n-1n)-1n:i=2n**(BigInt(a)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof i=="bigint"&&n?-i-1n:0;if(i&&r>i||r<o){const c=typeof e=="bigint"?"n":"";throw new Zt({max:i?`${i}${c}`:void 0,min:`${o}${c}`,signed:n,size:a,value:`${e}${c}`})}const s=`0x${(n&&r<0?(1n<<BigInt(a*8))+BigInt(r):r).toString(16)}`;return a?Ae(s,{size:a}):s}const oo=new TextEncoder;function ka(e,t={}){const n=oo.encode(e);return Q(n,t)}const so=new TextEncoder;function wt(e,t={}){return typeof e=="number"||typeof e=="bigint"?uo(e,t):typeof e=="boolean"?co(e,t):Ce(e)?Jt(e,t):Ca(e,t)}function co(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(K(n,{size:t.size}),Ae(n,{size:t.size})):n}const ee={zero:48,nine:57,A:65,F:70,a:97,f:102};function Ta(e){if(e>=ee.zero&&e<=ee.nine)return e-ee.zero;if(e>=ee.A&&e<=ee.F)return e-(ee.A-10);if(e>=ee.a&&e<=ee.f)return e-(ee.a-10)}function Jt(e,t={}){let n=e;t.size&&(K(n,{size:t.size}),n=Ae(n,{dir:"right",size:t.size}));let a=n.slice(2);a.length%2&&(a=`0${a}`);const r=a.length/2,i=new Uint8Array(r);for(let o=0,s=0;o<r;o++){const c=Ta(a.charCodeAt(s++)),l=Ta(a.charCodeAt(s++));if(c===void 0||l===void 0)throw new b(`Invalid byte sequence ("${a[s-2]}${a[s-1]}" in "${a}").`);i[o]=c*16+l}return i}function uo(e,t){const n=I(e,t);return Jt(n)}function Ca(e,t={}){const n=so.encode(e);return typeof t.size=="number"?(K(n,{size:t.size}),Ae(n,{dir:"right",size:t.size})):n}const xt=BigInt(2**32-1),Ea=BigInt(32);function lo(e,t=!1){return t?{h:Number(e&xt),l:Number(e>>Ea&xt)}:{h:Number(e>>Ea&xt)|0,l:Number(e&xt)|0}}function po(e,t=!1){const n=e.length;let a=new Uint32Array(n),r=new Uint32Array(n);for(let i=0;i<n;i++){const{h:o,l:s}=lo(e[i],t);[a[i],r[i]]=[o,s]}return[a,r]}const fo=(e,t,n)=>e<<n|t>>>32-n,yo=(e,t,n)=>t<<n|e>>>32-n,mo=(e,t,n)=>t<<n-32|e>>>64-n,ho=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function bo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Aa(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function vt(e,...t){if(!bo(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Pa(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function go(e,t){vt(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function wo(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ia(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const xo=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function vo(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function ko(e){for(let t=0;t<e.length;t++)e[t]=vo(e[t]);return e}const Ma=xo?e=>e:ko;function To(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ba(e){return typeof e=="string"&&(e=To(e)),vt(e),e}class Co{}function Eo(e){const t=a=>e().update(Ba(a)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const Ao=BigInt(0),qe=BigInt(1),Po=BigInt(2),Io=BigInt(7),Mo=BigInt(256),Bo=BigInt(113),_a=[],La=[],$a=[];for(let e=0,t=qe,n=1,a=0;e<24;e++){[n,a]=[a,(2*n+3*a)%5],_a.push(2*(5*a+n)),La.push((e+1)*(e+2)/2%64);let r=Ao;for(let i=0;i<7;i++)t=(t<<qe^(t>>Io)*Bo)%Mo,t&Po&&(r^=qe<<(qe<<BigInt(i))-qe);$a.push(r)}const Sa=po($a,!0),_o=Sa[0],Lo=Sa[1],Fa=(e,t,n)=>n>32?mo(e,t,n):fo(e,t,n),Oa=(e,t,n)=>n>32?ho(e,t,n):yo(e,t,n);function $o(e,t=24){const n=new Uint32Array(10);for(let a=24-t;a<24;a++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const s=(o+8)%10,c=(o+2)%10,l=n[c],u=n[c+1],d=Fa(l,u,1)^n[s],f=Oa(l,u,1)^n[s+1];for(let p=0;p<50;p+=10)e[o+p]^=d,e[o+p+1]^=f}let r=e[2],i=e[3];for(let o=0;o<24;o++){const s=La[o],c=Fa(r,i,s),l=Oa(r,i,s),u=_a[o];r=e[u],i=e[u+1],e[u]=c,e[u+1]=l}for(let o=0;o<50;o+=10){for(let s=0;s<10;s++)n[s]=e[o+s];for(let s=0;s<10;s++)e[o+s]^=~n[(s+2)%10]&n[(s+4)%10]}e[0]^=_o[a],e[1]^=Lo[a]}Ia(n)}class Qt extends Co{constructor(t,n,a,r=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=a,this.enableXOF=r,this.rounds=i,Aa(a),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=wo(this.state)}clone(){return this._cloneInto()}keccak(){Ma(this.state32),$o(this.state32,this.rounds),Ma(this.state32),this.posOut=0,this.pos=0}update(t){Pa(this),t=Ba(t),vt(t);const{blockLen:n,state:a}=this,r=t.length;for(let i=0;i<r;){const o=Math.min(n-this.pos,r-i);for(let s=0;s<o;s++)a[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:a,blockLen:r}=this;t[a]^=n,n&128&&a===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){Pa(this,!1),vt(t),this.finish();const n=this.state,{blockLen:a}=this;for(let r=0,i=t.length;r<i;){this.posOut>=a&&this.keccak();const o=Math.min(a-this.posOut,i-r);t.set(n.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Aa(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(go(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Ia(this.state)}_cloneInto(t){const{blockLen:n,suffix:a,outputLen:r,rounds:i,enableXOF:o}=this;return t||(t=new Qt(n,a,r,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=a,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}}const So=(e,t,n)=>Eo(()=>new Qt(t,e,n)),Fo=So(1,136,256/8);function kt(e,t){const n=t||"hex",a=Fo(Ce(e,{strict:!1})?wt(e):e);return n==="bytes"?a:io(a)}const Oo=e=>kt(wt(e));function No(e){return Oo(e)}function Do(e){let t=!0,n="",a=0,r="",i=!1;for(let o=0;o<e.length;o++){const s=e[o];if(["(",")",","].includes(s)&&(t=!0),s==="("&&a++,s===")"&&a--,!!t){if(a===0){if(s===" "&&["event","function",""].includes(r))r="";else if(r+=s,s===")"){i=!0;break}continue}if(s===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}r+=s,n+=s}}if(!i)throw new b("Unable to normalize signature.");return r}const Ro=e=>{const t=typeof e=="string"?e:Qr(e);return Do(t)};function Na(e){return No(Ro(e))}const Tt=Na;class Pe extends b{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class en extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&(super.delete(t),super.set(t,n)),n}set(t,n){if(super.has(t)&&super.delete(t),super.set(t,n),this.maxSize&&this.size>this.maxSize){const a=super.keys().next().value;a!==void 0&&super.delete(a)}return this}}const tn=new en(8192);function Da(e,t){if(tn.has(`${e}.${t}`))return tn.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),a=kt(Ca(n),"bytes"),r=n.split("");for(let o=0;o<40;o+=2)a[o>>1]>>4>=8&&r[o]&&(r[o]=r[o].toUpperCase()),(a[o>>1]&15)>=8&&r[o+1]&&(r[o+1]=r[o+1].toUpperCase());const i=`0x${r.join("")}`;return tn.set(`${e}.${t}`,i),i}const zo=/^0x[a-fA-F0-9]{40}$/,nn=new en(8192);function X(e,t){const{strict:n=!0}=t??{},a=`${e}.${n}`;if(nn.has(a))return nn.get(a);const r=zo.test(e)?e.toLowerCase()===e?!0:n?Da(e)===e:!0:!1;return nn.set(a,r),r}function jo(e){return typeof e[0]=="string"?Z(e):Uo(e)}function Uo(e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);let a=0;for(const r of e)n.set(r,a),a+=r.length;return n}function Z(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Ie(e,t,n,{strict:a}={}){return Ce(e,{strict:!1})?Ho(e,t,n,{strict:a}):ja(e,t,n,{strict:a})}function Ra(e,t){if(typeof t=="number"&&t>0&&t>L(e)-1)throw new ha({offset:t,position:"start",size:L(e)})}function za(e,t,n){if(typeof t=="number"&&typeof n=="number"&&L(e)!==n-t)throw new ha({offset:n,position:"end",size:L(e)})}function ja(e,t,n,{strict:a}={}){Ra(e,t);const r=e.slice(t,n);return a&&za(r,t,n),r}function Ho(e,t,n,{strict:a}={}){Ra(e,t);const r=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return a&&za(r,t,n),r}const qo=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Me(e,t){if(e.length!==t.length)throw new qi({expectedLength:e.length,givenLength:t.length});const n=Go({params:e,values:t});return rn(n)}function Go({params:e,values:t}){const n=[];for(let a=0;a<e.length;a++)n.push(an({param:e[a],value:t[a]}));return n}function an({param:e,value:t}){const n=Ct(e.type);if(n){const[a,r]=n;return Vo(t,{length:a,param:{...e,type:r}})}if(e.type==="tuple")return Jo(t,{param:e});if(e.type==="address")return Wo(t);if(e.type==="bool")return Xo(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const a=e.type.startsWith("int"),[,,r="256"]=qo.exec(e.type)??[];return Zo(t,{signed:a,size:Number(r)})}if(e.type.startsWith("bytes"))return Ko(t,{param:e});if(e.type==="string")return Yo(t);throw new Yi(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function rn(e){let t=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:s}=e[i];o?t+=32:t+=L(s)}const n=[],a=[];let r=0;for(let i=0;i<e.length;i++){const{dynamic:o,encoded:s}=e[i];o?(n.push(I(t+r,{size:32})),a.push(s),r+=L(s)):n.push(s)}return Z([...n,...a])}function Wo(e){if(!X(e))throw new Pe({address:e});return{dynamic:!1,encoded:ce(e.toLowerCase())}}function Vo(e,{length:t,param:n}){const a=t===null;if(!Array.isArray(e))throw new ma(e);if(!a&&e.length!==t)throw new Ui({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let r=e.length===0&&on(n);const i=[];for(let o=0;o<e.length;o++){const s=an({param:n,value:e[o]});s.dynamic&&(r=!0),i.push(s)}if(a||r){const o=rn(i);if(a){const s=I(i.length,{size:32});return{dynamic:!0,encoded:Z([s,o])}}if(r)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Z(i.map(({encoded:o})=>o))}}function Ko(e,{param:t}){const[,n]=t.type.split("bytes"),a=L(e);if(!n){let r=e;return a%32!==0&&(r=ce(r,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Z([ce(I(a,{size:32})),r])}}if(a!==Number.parseInt(n,10))throw new Hi({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:ce(e,{dir:"right"})}}function Xo(e){if(typeof e!="boolean")throw new b(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ce(va(e))}}function Zo(e,{signed:t,size:n=256}){if(typeof n=="number"){const a=2n**(BigInt(n)-(t?1n:0n))-1n,r=t?-a-1n:0n;if(e>a||e<r)throw new Zt({max:a.toString(),min:r.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:I(e,{size:32,signed:t})}}function Yo(e){const t=ka(e),n=Math.ceil(L(t)/32),a=[];for(let r=0;r<n;r++)a.push(ce(Ie(t,r*32,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Z([ce(I(L(t),{size:32})),...a])}}function Jo(e,{param:t}){let n=!1;const a=[];for(let r=0;r<t.components.length;r++){const i=t.components[r],o=Array.isArray(e)?r:i.name,s=an({param:i,value:e[o]});a.push(s),s.dynamic&&(n=!0)}return{dynamic:n,encoded:n?rn(a):Z(a.map(({encoded:r})=>r))}}function Ct(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function on(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components.some(on);const n=Ct(t);return n?on({...e,type:n[1]}):!1}const Ge=e=>Ie(Na(e),0,4);function me(e){const{abi:t,args:n=[],name:a}=e,r=Ce(a,{strict:!1}),i=t.filter(s=>r?s.type==="function"?Ge(s)===a:s.type==="event"?Tt(s)===a:!1:"name"in s&&s.name===a);if(i.length===0)return;if(i.length===1)return i[0];let o;for(const s of i){if(!("inputs"in s))continue;if(!n||n.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==n.length)continue;if(n.every((l,u)=>{const d="inputs"in s&&s.inputs[u];return d?sn(l,d):!1})){if(o&&"inputs"in o&&o.inputs){const l=Ua(s.inputs,o.inputs,n);if(l)throw new Xi({abiItem:s,type:l[0]},{abiItem:o,type:l[1]})}o=s}}return o||i[0]}function sn(e,t){const n=typeof e,a=t.type;switch(a){case"address":return X(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return a==="tuple"&&"components"in t?Object.values(t.components).every((r,i)=>n==="object"&&sn(Object.values(e)[i],r)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(a)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(a)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(a)?Array.isArray(e)&&e.every(r=>sn(r,{...t,type:a.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Ua(e,t,n){for(const a in e){const r=e[a],i=t[a];if(r.type==="tuple"&&i.type==="tuple"&&"components"in r&&"components"in i)return Ua(r.components,i.components,n[a]);const o=[r.type,i.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?X(n[a],{strict:!1}):o.includes("address")&&o.includes("bytes")?X(n[a],{strict:!1}):!1)return o}}const Ha="/docs/contract/encodeEventTopics";function Qo(e){const{abi:t,eventName:n,args:a}=e;let r=t[0];if(n){const c=me({abi:t,name:n});if(!c)throw new pa(n,{docsPath:Ha});r=c}if(r.type!=="event")throw new pa(void 0,{docsPath:Ha});let i=[];if(a&&"inputs"in r){const c=r.inputs?.filter(u=>"indexed"in u&&u.indexed),l=Array.isArray(a)?a:Object.values(a).length>0?c?.map(u=>a[u.name])??[]:[];l.length>0&&(i=c?.map((u,d)=>Array.isArray(l[d])?l[d].map((f,p)=>qa({param:u,value:l[d][p]})):typeof l[d]<"u"&&l[d]!==null?qa({param:u,value:l[d]}):null)??[])}if(r.anonymous)return i;const o=G(r);return[Tt(o),...i]}function qa({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return kt(wt(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new eo(e.type);return Me([e],[t])}function Et(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Ga="/docs/contract/encodeFunctionData";function es(e){const{abi:t,args:n,functionName:a}=e;let r=t[0];if(a){const i=me({abi:t,args:n,name:a});if(!i)throw new Ee(a,{docsPath:Ga});r=i}if(r.type!=="function")throw new Ee(void 0,{docsPath:Ga});return{abi:[r],functionName:Ge(G(r))}}function Wa(e){const{args:t}=e,{abi:n,functionName:a}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:es(e),r=n[0],i=a,o="inputs"in r&&r.inputs?Me(r.inputs,t??[]):void 0;return Z([i,o??"0x"])}const ts={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Va={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},ns={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class Ka extends b{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class Xa extends b{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class as extends b{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const rs={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new as({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Xa({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Ka({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Ka({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function is(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(rs);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function os(e,t={}){typeof t.size<"u"&&K(e,{size:t.size});const n=Q(e);return xa(n,t)}function ss(e,t={}){let n=e;if(typeof t.size<"u"&&(K(n,{size:t.size}),n=wa(n)),n.length>1||n[0]>1)throw new no(n);return!!n[0]}function te(e,t={}){typeof t.size<"u"&&K(e,{size:t.size});const n=Q(e);return Yt(n,t)}function cs(e,t={}){let n=e;return typeof t.size<"u"&&(K(n,{size:t.size}),n=wa(n,{dir:"right"})),new TextDecoder().decode(n)}function We(e,t){const n=typeof t=="string"?Jt(t):t,a=is(n);if(L(n)===0&&e.length>0)throw new Xt;if(L(t)&&L(t)<32)throw new ua({data:typeof t=="string"?t:Q(t),params:e,size:L(t)});let r=0;const i=[];for(let o=0;o<e.length;++o){const s=e[o];r<n.length&&a.setPosition(r);const[c,l]=Be(a,s,{staticPosition:0});r+=l,i.push(c)}return i}function Be(e,t,{staticPosition:n}){const a=Ct(t.type);if(a){const[r,i]=a;return ls(e,{...t,type:i},{length:r,staticPosition:n})}if(t.type==="tuple")return ys(e,t,{staticPosition:n});if(t.type==="address")return us(e);if(t.type==="bool")return ds(e);if(t.type.startsWith("bytes"))return ps(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return fs(e,t);if(t.type==="string")return ms(e,{staticPosition:n});throw new Ji(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Za=32,cn=32;function us(e){const t=e.readBytes(32);return[Da(Q(ja(t,-20))),32]}function ls(e,t,{length:n,staticPosition:a}){if(n===null){const o=te(e.readBytes(cn)),s=a+o,c=s+Za;e.setPosition(s);const l=te(e.readBytes(Za)),u=Ve(t);let d=0;const f=[];for(let p=0;p<l;++p){e.setPosition(c+(u?p*32:d));const[m,y]=Be(e,t,{staticPosition:c});d+=y,f.push(m),y===0&&(e.assertReadLimit(),e._touch())}return e.setPosition(a+32),[f,32]}if(Ve(t)){const o=te(e.readBytes(cn)),s=a+o,c=[];for(let l=0;l<n;++l){e.setPosition(s+l*32);const[u]=Be(e,t,{staticPosition:s});c.push(u)}return e.setPosition(a+32),[c,32]}let r=0;const i=[];for(let o=0;o<n;++o){const[s,c]=Be(e,t,{staticPosition:a+r});r+=c,i.push(s),c===0&&(e.assertReadLimit(),e._touch())}return[i,r]}function ds(e){return[ss(e.readBytes(32),{size:32}),32]}function ps(e,t,{staticPosition:n}){const[a,r]=t.type.split("bytes");if(!r){const o=te(e.readBytes(32));e.setPosition(n+o);const s=te(e.readBytes(32));if(s===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(s);return e.setPosition(n+32),[Q(c),32]}return[Q(e.readBytes(Number.parseInt(r,10),32)),32]}function fs(e,t){const n=t.type.startsWith("int"),a=Number.parseInt(t.type.split("int")[1]||"256",10),r=e.readBytes(32);return[a>48?os(r,{signed:n}):te(r,{signed:n}),32]}function ys(e,t,{staticPosition:n}){const a=t.components.length===0||t.components.some(({name:o})=>!o),r=a?[]:{};let i=0;if(Ve(t)){const o=te(e.readBytes(cn)),s=n+o;for(let c=0;c<t.components.length;++c){const l=t.components[c];e.setPosition(s+i);const[u,d]=Be(e,l,{staticPosition:s});i+=d,r[a?c:l?.name]=u}return e.setPosition(n+32),[r,32]}for(let o=0;o<t.components.length;++o){const s=t.components[o],[c,l]=Be(e,s,{staticPosition:n});r[a?o:s?.name]=c,i+=l}return[r,i]}function ms(e,{staticPosition:t}){const n=te(e.readBytes(32)),a=t+n;e.setPosition(a);const r=te(e.readBytes(32));if(r===0)return e.setPosition(t+32),["",32];const i=e.readBytes(r,32),o=cs(i);return e.setPosition(t+32),[o,32]}function Ve(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(Ve);const n=Ct(e.type);return!!(n&&Ve({...e,type:n[1]}))}function Ya(e){const{abi:t,data:n,cause:a}=e,r=Ie(n,0,4);if(r==="0x")throw new Xt({cause:a});const o=[...t||[],Va,ns].find(s=>s.type==="error"&&r===Ge(G(s)));if(!o)throw new da(r,{docsPath:"/docs/contract/decodeErrorResult",cause:a});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?We(o.inputs,Ie(n,4)):void 0,errorName:o.name}}const Y=(e,t,n)=>JSON.stringify(e,(a,r)=>typeof r=="bigint"?r.toString():r,n);function Ja({abiItem:e,args:t,includeFunctionName:n=!0,includeName:a=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((r,i)=>`${a&&r.name?`${r.name}: `:""}${typeof t[i]=="object"?Y(t[i]):t[i]}`).join(", ")})`}const At={wei:0,gwei:9,szabo:12,finney:15,ether:18};function Qa(e,t=0){if(!Number.isInteger(t)||t<0)throw new gs({decimals:t});let n=e.toString();const a=n.startsWith("-");a&&(n=n.slice(1)),n=n.padStart(t,"0");let[r,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${a?"-":""}${r||"0"}${i?`.${i}`:""}`}function hs(e,t="wei"){return Qa(e,At.ether-At[t])}function bs(e,t="wei"){return Qa(e,At.gwei-At[t])}class gs extends Error{constructor({decimals:t}){super(`\`decimals\` must be a non-negative integer. Got \`${t}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalsError"})}}function ws(e,t="wei"){return hs(e,t)}function he(e,t="wei"){return bs(e,t)}class xs extends b{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class vs extends b{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function er(e){return e.reduce((t,{slot:n,value:a})=>`${t} ${n}: ${a}
|
|
23
|
+
`,"")}function ks(e){return e.reduce((t,{address:n,...a})=>{let r=`${t} ${n}:
|
|
24
|
+
`;return a.nonce&&(r+=` nonce: ${a.nonce}
|
|
25
|
+
`),a.balance&&(r+=` balance: ${a.balance}
|
|
26
|
+
`),a.code&&(r+=` code: ${a.code}
|
|
27
|
+
`),a.state&&(r+=` state:
|
|
28
|
+
`,r+=er(a.state)),a.stateDiff&&(r+=` stateDiff:
|
|
29
|
+
`,r+=er(a.stateDiff)),r},` State Override:
|
|
30
|
+
`).slice(0,-1)}function tr(e){const t=Object.entries(e).map(([a,r])=>r===void 0||r===!1?null:[a,r]).filter(Boolean),n=t.reduce((a,[r])=>Math.max(a,r.length),0);return t.map(([a,r])=>` ${`${a}:`.padEnd(n+1)} ${r}`).join(`
|
|
31
|
+
`)}const Ts=e=>e;function W(e){if(e?.reason)return e.reason;if(typeof DOMException=="function")return new DOMException("This operation was aborted","AbortError");const t=new Error("This operation was aborted");return t.name="AbortError",t}function ue(e){return typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}const Ke=e=>{try{const t=new URL(e);return!t.username&&!t.password?e:(t.username="",t.password="",t.toString())}catch{return e}};class Cs extends b{constructor(t,{account:n,docsPath:a,chain:r,data:i,gas:o,gasPrice:s,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f,stateOverride:p}){const m=n?Et(n):void 0;let y=tr({from:m?.address,to:d,value:typeof f<"u"&&`${ws(f)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:o,gasPrice:typeof s<"u"&&`${he(s)} gwei`,maxFeePerGas:typeof c<"u"&&`${he(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${he(l)} gwei`,nonce:u});p&&(y+=`
|
|
32
|
+
${ks(p)}`),super(t.shortMessage,{cause:t,docsPath:a,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",y].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Es extends b{constructor(t,{abi:n,args:a,contractAddress:r,docsPath:i,functionName:o,sender:s}){const c=me({abi:n,args:a,name:o}),l=c?Ja({abiItem:c,args:a,includeFunctionName:!1,includeName:!1}):void 0,u=c?G(c,{includeName:!0}):void 0,d=tr({address:r&&Ts(r),function:u,args:l&&l!=="()"&&`${[...Array(o?.length??0).keys()].map(()=>" ").join("")}${l}`,sender:s});super(t.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=a,this.cause=t,this.contractAddress=r,this.functionName=o,this.sender=s}}class As extends b{constructor({abi:t,data:n,functionName:a,message:r,cause:i}){let o,s,c,l;if(n&&n!=="0x")try{s=Ya({abi:t,data:n,cause:i});const{abiItem:d,errorName:f,args:p}=s;if(f==="Error")l=p[0];else if(f==="Panic"){const[m]=p;l=ts[m]}else{const m=d?G(d,{includeName:!0}):void 0,y=d&&p?Ja({abiItem:d,args:p,includeFunctionName:!1,includeName:!1}):void 0;c=[m?`Error: ${m}`:"",y&&y!=="()"?` ${[...Array(f?.length??0).keys()].map(()=>" ").join("")}${y}`:""]}}catch(d){o=d}else r&&(l=r);let u;o instanceof da&&(u=o.signature,c=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${u}.`]),super(l&&l!=="execution reverted"||u?[`The contract function "${a}" reverted with the following ${u?"signature":"reason"}:`,l||u].join(`
|
|
33
|
+
`):`The contract function "${a}" reverted.`,{cause:o??i,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s,this.raw=n,this.reason=l,this.signature=u}}class Ps extends b{constructor({functionName:t,cause:n}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:n})}}class Is extends b{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class nr extends b{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class ne extends b{constructor({body:t,cause:n,details:a,headers:r,status:i,url:o}){super("HTTP request failed.",{cause:n,details:a,metaMessages:[i&&`Status: ${i}`,`URL: ${Ke(o)}`,t&&`Request body: ${Y(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=r,this.status=i,this.url=o}}class Pt extends b{constructor({maxSize:t,size:n}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${t} bytes`,`Received: ${n} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t,this.size=n}}class un extends b{constructor({body:t,error:n,url:a}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${Ke(a)}`,`Request body: ${Y(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=a}}class ln extends b{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Ke(n)}`,`Request body: ${Y(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const Ms=-1;class O extends b{constructor(t,{code:n,docsPath:a,metaMessages:r,name:i,shortMessage:o}){super(o,{cause:t,docsPath:a,metaMessages:r||t?.metaMessages,name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||t.name,this.code=t instanceof un?t.code:n??Ms}}class N extends O{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class Xe extends O{constructor(t){super(t,{code:Xe.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Ze extends O{constructor(t){super(t,{code:Ze.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Ye extends O{constructor(t,{method:n}={}){super(t,{code:Ye.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(Ye,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Je extends O{constructor(t){super(t,{code:Je.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
34
|
+
`)})}}Object.defineProperty(Je,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class be extends O{constructor(t){super(t,{code:be.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(be,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class _e extends O{constructor(t){super(t,{code:_e.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
35
|
+
`)})}}Object.defineProperty(_e,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Qe extends O{constructor(t){super(t,{code:Qe.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Qe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class et extends O{constructor(t){super(t,{code:et.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(et,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Le extends O{constructor(t){super(t,{code:Le.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Le,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class ge extends O{constructor(t,{method:n}={}){super(t,{code:ge.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class $e extends O{constructor(t){super(t,{code:$e.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty($e,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class tt extends O{constructor(t){super(t,{code:tt.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(tt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class we extends N{constructor(t){super(t,{code:we.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(we,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class nt extends N{constructor(t){super(t,{code:nt.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(nt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class at extends N{constructor(t,{method:n}={}){super(t,{code:at.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(at,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class rt extends N{constructor(t){super(t,{code:rt.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(rt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class it extends N{constructor(t){super(t,{code:it.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(it,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ot extends N{constructor(t){super(t,{code:ot.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(ot,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class st extends N{constructor(t){super(t,{code:st.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(st,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class ct extends N{constructor(t){super(t,{code:ct.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(ct,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class ut extends N{constructor(t){super(t,{code:ut.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(ut,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class lt extends N{constructor(t){super(t,{code:lt.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(lt,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class dt extends N{constructor(t){super(t,{code:dt.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(dt,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class pt extends N{constructor(t){super(t,{code:pt.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(pt,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class ft extends N{constructor(t){super(t,{code:ft.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(ft,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Se extends N{constructor(t){super(t,{code:Se.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(Se,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class Bs extends O{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const _s=3;function Ls(e,{abi:t,address:n,args:a,docsPath:r,functionName:i,sender:o}){const s=e instanceof nr?e:e instanceof b?e.walk(m=>"data"in m)||e.walk():{},{code:c,data:l,details:u,message:d,shortMessage:f}=s,p=e instanceof Xt?new Ps({functionName:i,cause:e}):[_s,be.code].includes(c)&&(l||u||d||f)||c===_e.code&&u==="execution reverted"&&l?new As({abi:t,data:typeof l=="object"?l.data:l,functionName:i,message:s instanceof un?u:f??d,cause:e}):e;return new Es(p,{abi:t,args:a,contractAddress:n,docsPath:r,functionName:i,sender:o})}class xe extends b{constructor({cause:t,message:n}={}){const a=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${a?`with reason: ${a}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(xe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class It extends b{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${he(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(It,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class dn extends b{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${he(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(dn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class pn extends b{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(pn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class fn extends b{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
36
|
+
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(fn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class yn extends b{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(yn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class mn extends b{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
37
|
+
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(mn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class hn extends b{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(hn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class bn extends b{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(bn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class gn extends b{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(gn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Mt extends b{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:a}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${he(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${a?` = ${he(a)} gwei`:""}).`].join(`
|
|
38
|
+
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Mt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class ar extends b{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function $s(e,t){const n=(e.details||"").toLowerCase(),a=e instanceof b?e.walk(r=>r?.code===xe.code):e;return a instanceof b?new xe({cause:e,message:a.details}):xe.nodeMessage.test(n)?new xe({cause:e,message:e.details}):It.nodeMessage.test(n)?new It({cause:e,maxFeePerGas:t?.maxFeePerGas}):dn.nodeMessage.test(n)?new dn({cause:e,maxFeePerGas:t?.maxFeePerGas}):pn.nodeMessage.test(n)?new pn({cause:e,nonce:t?.nonce}):fn.nodeMessage.test(n)?new fn({cause:e,nonce:t?.nonce}):yn.nodeMessage.test(n)?new yn({cause:e,nonce:t?.nonce}):mn.nodeMessage.test(n)?new mn({cause:e}):hn.nodeMessage.test(n)?new hn({cause:e,gas:t?.gas}):bn.nodeMessage.test(n)?new bn({cause:e,gas:t?.gas}):gn.nodeMessage.test(n)?new gn({cause:e}):Mt.nodeMessage.test(n)?new Mt({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new ar({cause:e})}function Ss(e,{format:t}){if(!t)return{};const n={};function a(i){const o=Object.keys(i);for(const s of o)s in e&&(n[s]=e[s]),i[s]&&typeof i[s]=="object"&&!Array.isArray(i[s])&&a(i[s])}const r=t(e||{});return a(r),n}const Fs={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Os(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Ns(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(a=>Q(a)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=I(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=I(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=I(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=I(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=I(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=I(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Fs[e.type]),typeof e.value<"u"&&(n.value=I(e.value)),n}function Ns(e){return e.map(t=>({address:t.address,r:t.r?I(BigInt(t.r)):t.r,s:t.s?I(BigInt(t.s)):t.s,chainId:I(t.chainId),nonce:I(t.nonce),...typeof t.yParity<"u"?{yParity:I(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:I(t.v)}:{}}))}function rr(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:a})=>{if(n.length!==66)throw new ga({size:n.length,targetSize:66,type:"hex"});if(a.length!==66)throw new ga({size:a.length,targetSize:66,type:"hex"});return t[n]=a,t},{})}function Ds(e){const{balance:t,nonce:n,state:a,stateDiff:r,code:i}=e,o={};if(i!==void 0&&(o.code=i),t!==void 0&&(o.balance=I(t)),n!==void 0&&(o.nonce=I(n)),a!==void 0&&(o.state=rr(a)),r!==void 0){if(o.state)throw new vs;o.stateDiff=rr(r)}return o}function Rs(e){if(!e)return;const t={};for(const{address:n,...a}of e){if(!X(n,{strict:!1}))throw new Pe({address:n});if(t[n])throw new xs({address:n});t[n]=Ds(a)}return t}const zs=2n**256n-1n;function js(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:a,to:r}=e,i=t?Et(t):void 0;if(i&&!X(i.address))throw new Pe({address:i.address});if(r&&!X(r))throw new Pe({address:r});if(n&&n>zs)throw new It({maxFeePerGas:n});if(a&&n&&a>n)throw new Mt({maxFeePerGas:n,maxPriorityFeePerGas:a})}class Us extends b{constructor({blockHash:t,blockNumber:n}){let a="Block";t&&(a=`Block at hash "${t}"`),n&&(a=`Block at number "${n}"`),super(`${a} could not be found.`,{name:"BlockNotFoundError"})}}const Hs={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function qs(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...e.blockTimestamp!=null&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?Yt(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Yt(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Hs[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=Gs(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function Gs(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Ws(e,t){const n=(e.transactions??[]).map(a=>typeof a=="string"?a:qs(a));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function Vs(e,{blockHash:t,blockNumber:n,blockTag:a=e.experimental_blockTag??"latest",includeTransactions:r}={}){const i=r??!1,o=n!==void 0?I(n):void 0;let s=null;if(t?s=await e.request({method:"eth_getBlockByHash",params:[t,i]},{dedupe:!0}):s=await e.request({method:"eth_getBlockByNumber",params:[o||a,i]},{dedupe:!!o}),!s)throw new Us({blockHash:t,blockNumber:n});return(e.chain?.formatters?.block?.format||Ws)(s,"getBlock")}function ir(e){const{blockHash:t,blockNumber:n,blockTag:a,requireCanonical:r}=e;if(r!==void 0&&!t)throw new b("`requireCanonical` can only be provided when `blockHash` is set.");return t?r?{blockHash:t,requireCanonical:r}:{blockHash:t}:typeof n=="bigint"?I(n):a??"latest"}function wn(e,t){if(!X(e,{strict:!1}))throw new Pe({address:e});if(!X(t,{strict:!1}))throw new Pe({address:t});return e.toLowerCase()===t.toLowerCase()}function or(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const sr="/docs/contract/decodeEventLog";function cr(e){const{abi:t,data:n,strict:a,topics:r}=e,i=a??!0,[o,...s]=r;if(!o)throw new Wi({docsPath:sr});const c=t.find(g=>g.type==="event"&&o===Tt(G(g)));if(!(c&&"name"in c)||c.type!=="event")throw new Vi(o,{docsPath:sr});const{name:l,inputs:u}=c,d=u?.some(g=>!("name"in g&&g.name)),f=d?[]:{},p=u.map((g,x)=>[g,x]).filter(([g])=>"indexed"in g&&g.indexed),m=[];for(let g=0;g<p.length;g++){const[x,w]=p[g],T=s[g];if(!T){if(i)throw new Zi({abiItem:c,param:x});m.push([x,w]);continue}f[d?w:x.name||w]=Ks({param:x,value:T})}const y=u.filter(g=>!("indexed"in g&&g.indexed)),h=i?y:[...m.map(([g])=>g),...y];if(h.length>0){if(n&&n!=="0x")try{const g=We(h,n);if(g){let x=0;if(!i)for(const[w,T]of m)f[d?T:w.name||T]=g[x++];if(d)for(let w=0;w<u.length;w++)f[w]===void 0&&x<g.length&&(f[w]=g[x++]);else for(let w=0;w<y.length;w++)f[y[w].name]=g[x++]}}catch(g){if(i)throw g instanceof ua||g instanceof Xa?new ya({abiItem:c,data:n,params:h,size:L(n)}):g}else if(i)throw new ya({abiItem:c,data:"0x",params:h,size:0})}return{eventName:l,args:Object.values(f).length>0?f:void 0}}function Ks({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(We([e],t)||[])[0]}function Xs(e){const{abi:t,args:n,logs:a,strict:r=!0}=e,i=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),o=t.filter(s=>s.type==="event").map(s=>({abi:s,selector:Tt(s)}));return a.map(s=>{const c=typeof s.blockNumber=="string"?or(s):s,l=o.filter(f=>c.topics[0]===f.selector);if(l.length===0)return null;let u,d;for(const f of l)try{u=cr({...c,abi:[f.abi],strict:!0}),d=f;break}catch{}if(!u&&!r){d=l[0];try{u=cr({data:c.data,topics:c.topics,abi:[d.abi],strict:!1})}catch{const f=d.abi.inputs?.some(p=>!("name"in p&&p.name));return{...c,args:f?[]:{},eventName:d.abi.name}}}return!u||!d||i&&!i.includes(u.eventName)||!Zs({args:u.args,inputs:d.abi.inputs,matchArgs:n})?null:{...u,...c}}).filter(Boolean)}function Zs(e){const{args:t,inputs:n,matchArgs:a}=e;if(!a)return!0;if(!t)return!1;function r(i,o,s){try{return i.type==="address"?wn(o,s):i.type==="string"||i.type==="bytes"?kt(wt(o))===s:o===s}catch{return!1}}return Array.isArray(t)&&Array.isArray(a)?a.every((i,o)=>{if(i==null)return!0;const s=n[o];return s?(Array.isArray(i)?i:[i]).some(l=>r(s,l,t[o])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof a=="object"&&!Array.isArray(a)?Object.entries(a).every(([i,o])=>{if(o==null)return!0;const s=n.find(l=>l.name===i);return s?(Array.isArray(o)?o:[o]).some(l=>r(s,l,t[i])):!1}):!1}async function Ys(e,{address:t,blockHash:n,fromBlock:a,toBlock:r,event:i,events:o,args:s,strict:c}={}){const l=c??!1,u=o??(i?[i]:void 0);let d=[];u&&(d=[u.flatMap(y=>Qo({abi:[y],eventName:y.name,args:o?void 0:s}))],i&&(d=d[0]));let f;n?f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:n}]}):f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof a=="bigint"?I(a):a,toBlock:typeof r=="bigint"?I(r):r}]});const p=f.map(m=>or(m));return u?Xs({abi:u,args:s,logs:p,strict:l}):p}const xn="/docs/contract/decodeFunctionResult";function ur(e){const{abi:t,args:n,functionName:a,data:r}=e;let i=t[0];if(a){const s=me({abi:t,args:n,name:a});if(!s)throw new Ee(a,{docsPath:xn});i=s}if(i.type!=="function")throw new Ee(void 0,{docsPath:xn});if(!i.outputs)throw new fa(i.name,{docsPath:xn});const o=We(i.outputs,r);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const Js="0.1.1";function Qs(){return Js}class D extends Error{static setStaticOptions(t){D.prototype.docsOrigin=t.docsOrigin,D.prototype.showVersion=t.showVersion,D.prototype.version=t.version}constructor(t,n={}){const a=(()=>{if(n.cause instanceof D){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:n.cause?.message?n.cause.message:n.details})(),r=n.cause instanceof D&&n.cause.docsPath||n.docsPath,i=n.docsOrigin??D.prototype.docsOrigin,o=`${i}${r??""}`,s=!!(n.version??D.prototype.showVersion),c=n.version??D.prototype.version,l=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...a||r||s?["",a?`Details: ${a}`:void 0,r?`See: ${o}`:void 0,s?`Version: ${c}`:void 0]:[]].filter(u=>typeof u=="string").join(`
|
|
39
|
+
`);super(l,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=a,this.docs=o,this.docsOrigin=i,this.docsPath=r,this.shortMessage=t,this.showVersion=s,this.version=c}walk(t){return lr(this,t)}}Object.defineProperty(D,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${Qs()}`}}),D.setStaticOptions(D.defaultStaticOptions);function lr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?lr(e.cause,t):t?null:e}function ec(e,t={}){const{dir:n,size:a=32}=t;if(a===0)return e;const r=e.replace("0x","");if(r.length>a*2)throw new ac({size:Math.ceil(r.length/2),targetSize:a,type:"Hex"});return`0x${r[n==="right"?"padEnd":"padStart"](a*2,"0")}`}function ae(e,t={}){const{signed:n,size:a}=t,r=BigInt(e);let i;a?n?i=(1n<<BigInt(a)*8n-1n)-1n:i=2n**(BigInt(a)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof i=="bigint"&&n?-i-1n:0;if(i&&r>i||r<o){const l=typeof e=="bigint"?"n":"";throw new nc({max:i?`${i}${l}`:void 0,min:`${o}${l}`,signed:n,size:a,value:`${e}${l}`})}const c=`0x${(n&&r<0?BigInt.asUintN(a*8,BigInt(r)):r).toString(16)}`;return a?tc(c,a):c}function tc(e,t){return ec(e,{dir:"left",size:t})}class nc extends D{constructor({max:t,min:n,signed:a,size:r,value:i}){super(`Number \`${i}\` is not in safe${r?` ${r*8}-bit`:""}${a?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class ac extends D{constructor({size:t,targetSize:n,type:a}){super(`${a.charAt(0).toUpperCase()}${a.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function rc(e){return{address:e.address,amount:ae(e.amount),index:ae(e.index),validatorIndex:ae(e.validatorIndex)}}function ic(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:ae(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:ae(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:ae(e.gasLimit)},...typeof e.number=="bigint"&&{number:ae(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:ae(e.prevRandao)},...typeof e.time=="bigint"&&{time:ae(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(rc)}}}const dr=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],vn=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],pr=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],oc="0x82ad56cb",sc="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",cc="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",uc="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class kn extends b{constructor({blockNumber:t,chain:n,contract:a}){super(`Chain "${n.name}" does not support contract "${a.name}".`,{metaMessages:["This could be due to any of the following:",...t&&a.blockCreated&&a.blockCreated>t?[`- The contract "${a.name}" was not deployed until block ${a.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${a.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class fr extends b{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const Tn="/docs/contract/encodeDeployData";function yr(e){const{abi:t,args:n,bytecode:a}=e;if(!n||n.length===0)return a;const r=t.find(o=>"type"in o&&o.type==="constructor");if(!r)throw new ji({docsPath:Tn});if(!("inputs"in r))throw new ca({docsPath:Tn});if(!r.inputs||r.inputs.length===0)throw new ca({docsPath:Tn});const i=Me(r.inputs,n);return Z([a,i])}function lc({blockNumber:e,chain:t,contract:n}){const a=t?.contracts?.[n];if(!a)throw new kn({chain:t,contract:{name:n}});if(e&&a.blockCreated&&a.blockCreated>e)throw new kn({blockNumber:e,chain:t,contract:{name:n,blockCreated:a.blockCreated}});return a.address}function dc(e,{docsPath:t,...n}){const a=(()=>{const r=$s(e,n);return r instanceof ar?e:r})();return new Cs(a,{docsPath:t,...n})}function pc(){let e=()=>{},t=()=>{};return{promise:new Promise((a,r)=>{e=a,t=r}),resolve:e,reject:t}}const Cn=new Map;function mr({fn:e,id:t,shouldSplitBatch:n,wait:a=0,sort:r}){const i=async()=>{const u=c();o();const d=u.map(({args:f})=>f);d.length!==0&&e(d).then(f=>{r&&Array.isArray(f)&&f.sort(r);for(let p=0;p<u.length;p++){const{resolve:m}=u[p];m?.([f[p],f])}}).catch(f=>{for(let p=0;p<u.length;p++){const{reject:m}=u[p];m?.(f)}})},o=()=>Cn.delete(t),s=()=>c().map(({args:u})=>u),c=()=>Cn.get(t)||[],l=u=>Cn.set(t,[...c(),u]);return{flush:o,async schedule(u){const{promise:d,resolve:f,reject:p}=pc();return n?.([...s(),u])&&i(),c().length>0?(l({args:u,resolve:f,reject:p}),d):(l({args:u,resolve:f,reject:p}),setTimeout(i,a),d)}}}async function hr(e,t){const{account:n=e.account,authorizationList:a,batch:r=!!e.batch?.multicall,blockHash:i,blockNumber:o,blockTag:s=e.experimental_blockTag??"latest",requireCanonical:c,accessList:l,blobs:u,blockOverrides:d,code:f,data:p,factory:m,factoryData:y,gas:h,gasPrice:g,maxFeePerBlobGas:x,maxFeePerGas:w,maxPriorityFeePerGas:T,nonce:C,requestOptions:P,to:E,value:B,stateOverride:S,...j}=t,ie=n?Et(n):void 0;if(f&&(m||y))throw new b("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(f&&E)throw new b("Cannot provide both `code` & `to` as parameters.");const U=f&&p,V=m&&y&&E&&p,de=U||V,R=U?wr({code:f,data:p}):V?gc({data:p,factory:m,factoryData:y,to:E}):p;try{js(t);const pe=ir({blockHash:i,blockNumber:o,blockTag:s,requireCanonical:c}),oe=d?ic(d):void 0,fe=Rs(S),Rt=e.chain?.formatters?.transactionRequest?.format,Rn=(Rt||Os)({...Ss(j,{format:Rt}),accessList:l,account:ie,authorizationList:a,blobs:u,data:R,gas:h,gasPrice:g,maxFeePerBlobGas:x,maxFeePerGas:w,maxPriorityFeePerGas:T,nonce:C,to:de?void 0:E,value:B},"call");if(r&&fc({request:Rn})&&!oe&&i===void 0)try{const{deployless:J=!1}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},zn=gr(e,{blockNumber:o,deployless:J});if(!zn||!bc(fe,zn))return await hc(e,{...Rn,blockHash:i,blockNumber:o,blockTag:s,multicallAddress:zn,requestOptions:P,requireCanonical:c,rpcStateOverride:fe})}catch(J){if(!(J instanceof fr)&&!(J instanceof kn))throw J}const il=(()=>{const J=[Rn,pe];return fe&&oe?[...J,fe,oe]:fe?[...J,fe]:oe?[...J,{},oe]:J})(),Xr=await e.request({method:"eth_call",params:il},P);return Xr==="0x"?{data:void 0}:{data:Xr}}catch(pe){if(P?.signal?.aborted)throw W(P.signal);if(ue(pe))throw pe;const oe=wc(pe),{offchainLookup:fe,offchainLookupSignature:Rt}=await Promise.resolve().then(()=>jc);if(e.ccipRead!==!1&&oe?.slice(0,10)===Rt&&E)return{data:await fe(e,{data:oe,requestOptions:P,to:E})};throw de&&oe?.slice(0,10)==="0x101bb98d"?new Is({factory:m}):dc(pe,{...t,account:ie,chain:e.chain})}}function fc({request:e}){const{data:t,to:n,...a}=e;return!(!t||t.startsWith(oc)||!n||Object.values(a).filter(r=>typeof r<"u").length>0)}let yc=0;const br=new WeakMap;function mc(e){if(!e)return"default";const t=br.get(e);if(t!==void 0)return t;const n=yc++;return br.set(e,n),n}async function hc(e,t){const{batchSize:n=1024,deployless:a=!1,wait:r=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockHash:i,blockNumber:o,blockTag:s=e.experimental_blockTag??"latest",requireCanonical:c,data:l,multicallAddress:u,requestOptions:d,rpcStateOverride:f,to:p}=t,m=u!==void 0?u:gr(e,{blockNumber:o,deployless:a}),y=ir({blockHash:i,blockNumber:o,blockTag:s,requireCanonical:c}),h=typeof y=="string"?y:JSON.stringify(y),g=f?`.${JSON.stringify(f)}`:"",{schedule:x}=mr({id:`${e.uid}.${h}.${mc(d)}${g}`,wait:r,shouldSplitBatch(C){return C.reduce((E,{data:B})=>E+(B.length-2),0)>n*2},fn:async C=>{const P=C.map(j=>({allowFailure:!0,callData:j.data,target:j.to})),E=Wa({abi:dr,args:[P],functionName:"aggregate3"}),B={...m===null?{data:wr({code:uc,data:E})}:{to:m,data:E}},S=await e.request({method:"eth_call",params:f?[B,y,f]:[B,y]},d);return ur({abi:dr,args:[P],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:w,success:T}]=await x({data:l,to:p});if(!T)throw new nr({data:w});return w==="0x"?{data:void 0}:{data:w}}function gr(e,t){const{blockNumber:n,deployless:a}=t;if(a)return null;if(e.chain)return lc({blockNumber:n,chain:e.chain,contract:"multicall3"});throw new fr}function bc(e,t){return e?Object.keys(e).some(n=>wn(n,t)):!1}function wr(e){const{code:t,data:n}=e;return yr({abi:ra(["constructor(bytes, bytes)"]),bytecode:sc,args:[t,n]})}function gc(e){const{data:t,factory:n,factoryData:a,to:r}=e;return yr({abi:ra(["constructor(address, bytes, address, bytes)"]),bytecode:cc,args:[r,t,n,a]})}function wc(e){if(!(e instanceof b))return;const t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}async function xc(e,t){const{abi:n,address:a,args:r,functionName:i,...o}=t,s=Wa({abi:n,args:r,functionName:i});try{const{data:c}=await Ri(e,hr,"call")({...o,data:s,to:a});return ur({abi:n,args:r,functionName:i,data:c||"0x"})}catch(c){throw Ls(c,{abi:n,address:a,args:r,docsPath:"/docs/contract/readContract",functionName:i})}}async function xr(e,{signal:t}={}){return new Promise((n,a)=>{if(t?.aborted){a(W(t));return}const r=()=>t?.removeEventListener("abort",o),i=setTimeout(()=>{r(),n()},e),o=()=>{clearTimeout(i),r(),a(W(t))};t?.addEventListener("abort",o,{once:!0})})}const vc=new Map,kc=new Map;function Tc(e){const t=(r,i)=>({clear:()=>i.delete(r),get:()=>i.get(r),set:o=>i.set(r,o)}),n=t(e,vc),a=t(e,kc);return{clear:()=>{n.clear(),a.clear()},promise:n,response:a}}async function Cc(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const a=Tc(t),r=a.response.get();if(r&&n>0&&Date.now()-r.created.getTime()<n)return r.data;let i=a.promise.get();i||(i=e(),a.promise.set(i));try{const o=await i;return a.response.set({created:new Date,data:o}),o}finally{a.promise.clear()}}const Ec=e=>`blockNumber.${e}`;async function Ac(e,{cacheTime:t=e.cacheTime}={}){const n=await Cc(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Ec(e.uid),cacheTime:t});return BigInt(n)}function Pc(e,{delay:t=100,retryCount:n=2,shouldRetry:a=()=>!0,signal:r}={}){return new Promise((i,o)=>{const s=async({count:c=0}={})=>{if(r?.aborted){o(W(r));return}const l=async({error:u})=>{const d=typeof t=="function"?t({count:c,error:u}):t;if(d)try{await xr(d,{signal:r})}catch(f){o(f);return}return s({count:c+1})};try{const u=await e();i(u)}catch(u){if(r?.aborted){o(W(r));return}if(ue(u)){o(u);return}if(c<n&&await a({count:c,error:u}))return l({error:u});o(u)}};s().catch(o)})}const En=256;let Bt=En,_t;function vr(e=11){if(!_t||Bt+e>En*2){_t="",Bt=0;for(let t=0;t<En;t++)_t+=(256+Math.random()*256|0).toString(16).substring(1)}return _t.substring(Bt,Bt+++e)}function Ic(e){const{batch:t,chain:n,ccipRead:a,dataSuffix:r,key:i="base",name:o="Base Client",tokens:s,type:c="base"}=e,l=e.experimental_blockTag??(typeof n?.experimental_preconfirmationTime=="number"?"pending":void 0),u=n?.blockTime??12e3,d=Math.min(Math.max(Math.floor(u/2),500),4e3),f=e.pollingInterval??d,p=e.cacheTime??f,m=e.account?Et(e.account):void 0,{config:y,request:h,value:g}=e.transport({account:m,chain:n,pollingInterval:f}),x={...y,...g},w={account:m,batch:t,cacheTime:p,ccipRead:a,chain:n,dataSuffix:r,key:i,name:o,pollingInterval:f,request:h,tokens:s,transport:x,type:c,uid:vr(),...l?{experimental_blockTag:l}:{}};function T(C){return P=>{const E=P(C);for(const S in w)delete E[S];const B={...C,...E};for(const S in E){const j=C[S],ie=E[S];kr(j)&&kr(ie)&&(B[S]={...j,...ie})}return Object.assign(B,{extend:T(B)})}}return Object.assign(w,{extend:T(w)})}function kr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Mc(e){const{abi:t,data:n}=e,a=Ie(n,0,4),r=t.find(i=>i.type==="function"&&a===Ge(G(i)));if(!r)throw new Ki(a,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:r.name,args:"inputs"in r&&r.inputs&&r.inputs.length>0?We(r.inputs,Ie(n,4)):void 0}}const An="/docs/contract/encodeErrorResult";function Tr(e){const{abi:t,errorName:n,args:a}=e;let r=t[0];if(n){const c=me({abi:t,args:a,name:n});if(!c)throw new la(n,{docsPath:An});r=c}if(r.type!=="error")throw new la(void 0,{docsPath:An});const i=G(r),o=Ge(i);let s="0x";if(a&&a.length>0){if(!r.inputs)throw new Gi(r.name,{docsPath:An});s=Me(r.inputs,a)}return Z([o,s])}const Pn="/docs/contract/encodeFunctionResult";function Bc(e){const{abi:t,functionName:n,result:a}=e;let r=t[0];if(n){const o=me({abi:t,name:n});if(!o)throw new Ee(n,{docsPath:Pn});r=o}if(r.type!=="function")throw new Ee(void 0,{docsPath:Pn});if(!r.outputs)throw new fa(r.name,{docsPath:Pn});const i=(()=>{if(r.outputs.length===0)return[];if(r.outputs.length===1)return[a];if(Array.isArray(a))return a;throw new ma(a)})();return Me(r.outputs,i)}const Cr="x-batch-gateway:true";async function Er(e){const{data:t,ccipRequest:n}=e,{args:[a]}=Mc({abi:vn,data:t}),r=[],i=[];return await Promise.all(a.map(async(o,s)=>{try{i[s]=o.urls.includes(Cr)?await Er({data:o.data,ccipRequest:n}):await n(o),r[s]=!1}catch(c){r[s]=!0,i[s]=_c(c)}})),Bc({abi:vn,functionName:"query",result:[r,i]})}function _c(e){return e.name==="HttpRequestError"&&e.status?Tr({abi:vn,errorName:"HttpError",args:[e.status,e.shortMessage]}):Tr({abi:[Va],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}const Lt=new en(8192);function Lc(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Lt.get(n))return Lt.get(n);const a=e().finally(()=>Lt.delete(n));return Lt.set(n,a),a}function $c(e,t={}){return async(n,a={})=>{const{dedupe:r=!1,methods:i,retryDelay:o=150,retryCount:s=3,signal:c,uid:l}={...t,...a},{method:u}=n;if(i?.exclude?.includes(u))throw new ge(new Error("method not supported"),{method:u});if(i?.include&&!i.include.includes(u))throw new ge(new Error("method not supported"),{method:u});if(c?.aborted)throw W(c);const d=r?Fc(`${l}.${Y(n)}`):void 0;return Lc(()=>Pc(async()=>{try{return await e(n,c?{signal:c}:void 0)}catch(f){if(c?.aborted)throw W(c);if(ue(f))throw f;const p=f;switch(p.code){case Xe.code:throw new Xe(p);case Ze.code:throw new Ze(p);case Ye.code:throw new Ye(p,{method:n.method});case Je.code:throw new Je(p);case be.code:throw new be(p);case _e.code:throw new _e(p);case Qe.code:throw new Qe(p);case et.code:throw new et(p);case Le.code:throw new Le(p);case ge.code:throw new ge(p,{method:n.method});case $e.code:throw new $e(p);case tt.code:throw new tt(p);case we.code:throw new we(p);case nt.code:throw new nt(p);case at.code:throw new at(p);case rt.code:throw new rt(p);case it.code:throw new it(p);case ot.code:throw new ot(p);case st.code:throw new st(p);case ct.code:throw new ct(p);case ut.code:throw new ut(p);case lt.code:throw new lt(p);case dt.code:throw new dt(p);case pt.code:throw new pt(p);case ft.code:throw new ft(p);case 5e3:throw new we(p);case Se.code:throw new Se(p);default:throw f instanceof b?f:new Bs(p)}}},{delay:({count:f,error:p})=>{if(p&&p instanceof ne){const m=p?.headers?.get("Retry-After");if(m?.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<f)*o},retryCount:s,signal:c,shouldRetry:({error:f})=>Sc(f)}),{enabled:r,id:d})}}function Sc(e){return ue(e)?!1:"code"in e&&typeof e.code=="number"?e.code===-1||e.code===$e.code||e.code===be.code||e.code===429:e instanceof ne&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function Fc(e,t=0){let n=3735928559^t,a=1103547991^t;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=Math.imul(n^i,2654435761),a=Math.imul(a^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(a^a>>>16,3266489909),a=Math.imul(a^a>>>16,2246822507),a^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&a)+(n>>>0)).toString(36)}class Oc extends b{constructor({callbackSelector:t,cause:n,data:a,extraData:r,sender:i,urls:o}){super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],n.metaMessages?.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map(s=>` ${Ke(s)}`)],` Sender: ${i}`,` Data: ${a}`,` Callback selector: ${t}`,` Extra data: ${r}`].flat(),name:"OffchainLookupError"})}}class Nc extends b{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${Ke(n)}`,`Response: ${Y(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Dc extends b{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const Rc="0x556f1830",Ar={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function zc(e,{blockNumber:t,blockTag:n,data:a,requestOptions:r,to:i}){const{args:o}=Ya({data:a,abi:[Ar]}),[s,c,l,u,d]=o,{ccipRead:f}=e,p=f&&typeof f?.request=="function"?f.request:Pr;try{if(!wn(i,s))throw new Dc({sender:s,to:i});const m=c.includes(Cr)?await Er({data:l,ccipRequest:h=>p({...h,requestOptions:r})}):await p({data:l,requestOptions:r,sender:s,urls:c}),{data:y}=await hr(e,{blockNumber:t,blockTag:n,data:jo([u,Me([{type:"bytes"},{type:"bytes"}],[m,d])]),requestOptions:r,to:i});return y}catch(m){throw r?.signal?.aborted?W(r.signal):ue(m)?m:new Oc({callbackSelector:u,cause:m,data:a,extraData:d,sender:s,urls:c})}}async function Pr({data:e,requestOptions:t,sender:n,urls:a}){let r=new Error("An unknown error occurred.");for(let i=0;i<a.length;i++){if(t?.signal?.aborted)throw W(t.signal);const o=a[i],s=o.includes("{data}")?"GET":"POST",c=s==="POST"?{data:e,sender:n}:void 0,l=s==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(o.replace("{sender}",n.toLowerCase()).replace("{data}",e),{body:JSON.stringify(c),headers:l,method:s,...t?.signal?{signal:t.signal}:{}});let d;if(u.headers.get("Content-Type")?.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){r=new ne({body:c,details:d?.error?Y(d.error):u.statusText,headers:u.headers,status:u.status,url:o});continue}if(!Ce(d)){r=new Nc({result:d,url:o});continue}return d}catch(u){if(t?.signal?.aborted)throw W(t.signal);if(ue(u))throw u;r=new ne({body:c,details:u.message,url:o})}}throw r}const jc=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Pr,offchainLookup:zc,offchainLookupAbiItem:Ar,offchainLookupSignature:Rc},Symbol.toStringTag,{value:"Module"}));function Uc(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:a}){return new Promise((r,i)=>{(async()=>{let o;const s=new AbortController;try{n>0&&(o=setTimeout(()=>{a&&s.abort()},n)),r(await e({signal:s?.signal||null}))}catch(c){if(s?.signal.aborted&&ue(c)){i(t);return}i(c)}finally{clearTimeout(o)}})()})}function Hc(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Ir=Hc(),qc=10485760;function Gc(e,t={}){const{url:n,headers:a}=Vc(e);return{async request(r){const{body:i,fetchFn:o=t.fetchFn??fetch,maxResponseBodySize:s=t.maxResponseBodySize??qc,onRequest:c=t.onRequest,onResponse:l=t.onResponse,timeout:u=t.timeout??1e4}=r,d={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:f,method:p,signal:m}=d;try{const y=await Uc(async({signal:x})=>{const w={...d,body:Array.isArray(i)?Y(i.map(E=>({jsonrpc:"2.0",id:E.id??Ir.take(),...E}))):Y({jsonrpc:"2.0",id:i.id??Ir.take(),...i}),headers:{...a,"Content-Type":"application/json",...f},method:p||"POST",signal:m||(u>0?x:null)},T=new Request(n,w),C=await c?.(T,w)??{...w,url:n};return await o(C.url??n,C)},{errorInstance:new ln({body:i,url:n}),timeout:u,signal:!0});l&&await l(y);let h;const g=await Wc(y,{maxResponseBodySize:s});if(y.headers.get("Content-Type")?.startsWith("application/json"))h=JSON.parse(g);else{h=g;try{h=JSON.parse(h||"{}")}catch(x){if(y.ok)throw x;h={error:h}}}if(!y.ok){if(typeof h.error?.code=="number"&&typeof h.error?.message=="string")return h;throw new ne({body:i,details:Y(h.error)||y.statusText,headers:y.headers,status:y.status,url:n})}return h}catch(y){throw m?.aborted?W(m):ue(y)||y instanceof ne||y instanceof Pt||y instanceof ln?y:new ne({body:i,cause:y,url:n})}}}}async function Wc(e,{maxResponseBodySize:t}){if(t===!1)return e.text();const n=e.headers.get("Content-Length");if(n){const s=Number(n);if(s>t)throw new Pt({maxSize:t,size:s})}if(!e.body){const s=await e.text(),c=new TextEncoder().encode(s).length;if(c>t)throw new Pt({maxSize:t,size:c});return s}const a=e.body.getReader(),r=new TextDecoder;let i="",o=0;try{for(;;){const{done:s,value:c}=await a.read();if(s)break;if(o+=c.byteLength,o>t)throw await a.cancel(),new Pt({maxSize:t,size:o});i+=r.decode(c,{stream:!0})}return i+=r.decode(),i}finally{a.releaseLock()}}function Vc(e){try{const t=new URL(e),n=(()=>{if(t.username){const a=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(a)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const z="0x0000000000000000000000000000000000000000";function Mr({key:e,methods:t,name:n,request:a,retryCount:r=3,retryDelay:i=150,timeout:o,type:s},c){const l=vr();return{config:{key:e,methods:t,name:n,request:a,retryCount:r,retryDelay:i,timeout:o,type:s},request:$c(a,{methods:t,retryCount:r,retryDelay:i,uid:l}),value:c}}function Kc(e,t={}){const{key:n="fallback",name:a="Fallback",rank:r=!1,shouldThrow:i=Xc,retryCount:o,retryDelay:s}=t;return({chain:c,pollingInterval:l=4e3,timeout:u,...d})=>{let f=e,p=()=>{};const m=Mr({key:n,name:a,async request({method:y,params:h}){let g;const x=async(w=0)=>{const T=f[w]({...d,chain:c,retryCount:0,timeout:u});try{const C=await T.request({method:y,params:h});return p({method:y,params:h,response:C,transport:T,status:"success"}),C}catch(C){if(p({error:C,method:y,params:h,transport:T,status:"error"}),i(C)||w===f.length-1||(g??(g=f.slice(w+1).some(P=>{const{include:E,exclude:B}=P({chain:c}).config.methods||{};return E?E.includes(y):B?!B.includes(y):!0})),!g))throw C;return x(w+1)}};return x()},retryCount:o,retryDelay:s,type:"fallback"},{onResponse:y=>p=y,transports:f.map(y=>y({chain:c,retryCount:0}))});if(r){const y=typeof r=="object"?r:{};Zc({chain:c,interval:y.interval??l,onTransports:h=>f=h,ping:y.ping,sampleCount:y.sampleCount,timeout:y.timeout,transports:f,weights:y.weights})}return m}}function Xc(e){return!!("code"in e&&typeof e.code=="number"&&(e.code===Le.code||e.code===we.code||e.code===Se.code||xe.nodeMessage.test(e.message)||e.code===5e3))}function Zc({chain:e,interval:t=4e3,onTransports:n,ping:a,sampleCount:r=10,timeout:i=1e3,transports:o,weights:s={}}){const{stability:c=.7,latency:l=.3}=s,u=[],d=async()=>{const f=await Promise.all(o.map(async y=>{const h=y({chain:e,retryCount:0,timeout:i}),g=Date.now();let x,w;try{await(a?a({transport:h}):h.request({method:"net_listening"})),w=1}catch{w=0}finally{x=Date.now()}return{latency:x-g,success:w}}));u.push(f),u.length>r&&u.shift();const p=Math.max(...u.map(y=>Math.max(...y.map(({latency:h})=>h)))),m=o.map((y,h)=>{const g=u.map(P=>P[h].latency),w=1-g.reduce((P,E)=>P+E,0)/g.length/p,T=u.map(P=>P[h].success),C=T.reduce((P,E)=>P+E,0)/T.length;return C===0?[0,h]:[l*w+c*C,h]}).sort((y,h)=>h[0]-y[0]);n(m.map(([,y])=>o[y])),await xr(t),d()};d()}class Yc extends b{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}let Jc=0;const Br=new WeakMap;function Qc(e){if(!e)return"default";const t=Br.get(e);if(t!==void 0)return t;const n=Jc++;return Br.set(e,n),n}function _r(e,t={}){const{batch:n,fetchFn:a,fetchOptions:r,key:i="http",maxResponseBodySize:o,methods:s,name:c="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:u,retryDelay:d,raw:f}=t;return({chain:p,retryCount:m,timeout:y})=>{const{batchSize:h=1e3,wait:g=0}=typeof n=="object"?n:{},x=t.retryCount??m,w=y??t.timeout??1e4,T=e||p?.rpcUrls.default.http[0];if(!T)throw new Yc;const C=Gc(T,{fetchFn:a,fetchOptions:r,maxResponseBodySize:o,onRequest:l,onResponse:u,timeout:w});return Mr({key:i,methods:s,name:c,async request({method:P,params:E},B){const S={method:P,params:E},j=B?.signal?{signal:B.signal}:void 0,{schedule:ie}=mr({id:`${T}.${Qc(B?.signal)}`,wait:g,shouldSplitBatch(R){return R.length>h},fn:R=>C.request({body:R,fetchOptions:j}),sort:(R,pe)=>R.id-pe.id}),U=async R=>n?ie(R):[await C.request({body:R,fetchOptions:j})],[{error:V,result:de}]=await U(S);if(f)return{error:V,result:de};if(V)throw new un({body:S,error:V,url:T});return de},retryCount:x,retryDelay:d,timeout:w,type:"http"},{fetchOptions:r,url:T})}}const In={version:"1.4.1",singleton:"0x41675C099F32341bf84BFc5382aF534df5C7461a",l2Singleton:"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",proxyFactory:"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",multiSend:"0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",multiSendCallOnly:"0x9641d764fc13c8B624c04430C7356C1C7C8102e2",fallbackHandler:"0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99",signMessageLib:"0xd53cd0aB83D845Ac265BE939c57F53AD838012c9",createCall:"0x9b35Af71d77eaf8d7e40252370304687390A1A52",simulateTxAccessor:"0x3d4BA2E0884aa488718476ca2FB8Efc291A46199"},$t={4663:In,8453:In,11155111:In};Object.keys($t).map(Number);const Mn={4663:{chainId:4663,key:"robinhood",name:"Robinhood Chain",explorer:"https://robin.etherscan.io",isMainnet:!0,deployedAtBlock:74028398n,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},contractBlockClock:"parent-l1",contractBlockTimeCentis:1200,vault:"0xaC44C903CE3d89054fD5b70e0E396f26b214CBE3",clPoolManager:"0x3d4afd3190b1e5036e410abb576f99c02D6fBb20",binPoolManager:"0xbD6274D94102C3fCafE043f8EF7C7F33f33B255A",clPoolManagerOwner:"0xa66f5f4aE2682a965956Fd6B0E448Ec7D8Ce1a3E",binPoolManagerOwner:"0xeA8480331310Cf1EEA2D1d8E41429AE163EcfA51",feeController:"0x197855617B40D79b4eaD1b4e0f8Bf6ab41022b19",clProtocolFeeController:null,binProtocolFeeController:null,governanceSafe:"0xeA7903Ed7d5FAE93CE1500ED2c4df138bDF0a038",safe:$t[4663],timelockCustody:"0x71E6B57d1dC373929899e6189771ee9115B4EF14",timelockPolicy:null,registry:"0x197855eBa41da04f2A380ba612AdD1C48f7a27aA",universalRouter:"0xd3dF9e77ed0Cf41B22BB0c7E527caE966CF79695",fillRouter:"0x197827dceB223ADDeE5cbdf123C08df6b73016E3",clPositionManager:"0x637A989326Fe99e9618A97f68D05621858B68973",binPositionManager:"0x585F7D8DAFEA7178ea91a54789f5059C2B1D3998",clQuoter:"0x0f971d005eC4E6E2f0dEe532ce4E9469c4D2651A",binQuoter:"0x684eD241c7B15eC83b1F4f93c049C6F74f504fEF",clPositionDescriptor:"0x69d18C3F0CFf468B9b2afb729b326D93eD2C7A22",create3Factory:"0x501D3a1F7674BE9f4BCe56bE81Dc3CafA1E51BD1",permit2:"0x000000000022D473030F116dDEE9F6B43aC78BA3",weth:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",revShareHook:"0x1978A2C6905aC690f21b23d581dc5b1E0Aa18266",launchRegistry:"0x1978f09B8F8886251e2693566822b7aCC30faD59",launchpadKit:null,launchGuardHook:null,launchpadV2:{launchpadKitV2:"0x19789C58f0d648146a698D6d3fAAA40Abb3e68a8",launchLegs:"0x1978bCCCe1CfaCD456a1908fe1c8c3198203917A",launchTokenFactory:"0x197865Bf8bEb9d597feAfd39136d5aDA2e8DBcD7",clLPLocker:"0x1978ECb2789423aE7fB4020dD432bc614741206c",binLPLocker:"0x1978029ec07FF1E85FA1fF53d430322D08F8F01f",clLaunchGuardHook:"0x1978493942bDE85721d047655Cee31Ef57C0303f",binLaunchGuardHook:"0x19785eB03DFeFea2371cc5C5Cd7130B5D829C195",padFactory:"0x1978b82718FfbE0f0D2Ab0FfDc575b87fAfeca1C"},splitFactory:"0x1978F55996c371A30CdE8CA8015B0D362b72Cd53",positionLock:"0x1978c7b933371bc4B238939De9dfE047653CFb85",tokenLock:"0x19784D694a07bB88380B1e9e3F5d6506190d2A7a",multisend:"0x1978DB38B8495b70FBa397b1F41f3dEd4A5FF2c2",dropFactory:"0x1978989f87B6F05000e2A0C04451114f1f50C04E",durationClocks:{revShareHook:"timestamp",launchpadKit:null,launchGuardHook:null},revShareHooks:[{address:"0x1978A2C6905aC690f21b23d581dc5b1E0Aa18266",durationClock:"timestamp",pendingShape:"timestamp-with-expiry",status:"current",note:"The redeployed stack (2026-09-27), timestamp source; same address as on Base."},{address:"0xfC00485AFB2f9C73Bd7F9f5e72d14709233E2aD2",durationClock:"contract-block",pendingShape:"block-with-expiry",status:"retired",note:"432,000-block delay declared at 0.1 s; on the real ~12 s contract clock that is ~60 days, and its proposal TTL ~360 days. No pools."},{address:"0x23CE34E8199927DD270dddd8579c947542bDE446",durationClock:"contract-block",pendingShape:"block-no-expiry",status:"retired",note:"Hosts the LTT1/LTT2 pool for as long as it exists. 3,600-block (~12 h) delay and NO expiry: a matured proposal stays armed until cancelled or frozen."}],tokens:[{address:"0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",symbol:"WETH",name:"WETH",decimals:18,isTestToken:!1},{address:"0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",symbol:"USDG",name:"Global Dollar",decimals:6,isTestToken:!1},{address:"0xd0601CE157Db5bdC3162BbaC2a2C8aF5320D9EEC",symbol:"NVDA",name:"NVIDIA • Robinhood Token",decimals:18,isTestToken:!1,stock:{issuer:"Robinhood",ticker:"NVDA"}},{address:"0x4a0E65A3EcceC6dBe60AE065F2e7bb85Fae35eEa",symbol:"SPCX",name:"Space Exploration Technologies Corp. Class A Common Stock • Robinhood Token",decimals:18,isTestToken:!1,stock:{issuer:"Robinhood",ticker:"SPCX"}},{address:"0x2A21c0826848f2D597B7C87A4B931dE1407958A6",symbol:"LTT1",name:"Latch Test Token One",decimals:18,isTestToken:!0},{address:"0xa29927045BDFfd61B8F539D491085F1b6f7A8bE4",symbol:"LTT2",name:"Latch Test Token Two",decimals:18,isTestToken:!0}]},8453:{chainId:8453,key:"base",name:"Base",explorer:"https://basescan.org",isMainnet:!0,deployedAtBlock:51856606n,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},contractBlockClock:"native",contractBlockTimeCentis:200,vault:"0xaC44C903CE3d89054fD5b70e0E396f26b214CBE3",clPoolManager:"0x3d4afd3190b1e5036e410abb576f99c02D6fBb20",binPoolManager:"0xbD6274D94102C3fCafE043f8EF7C7F33f33B255A",clPoolManagerOwner:"0xa66f5f4aE2682a965956Fd6B0E448Ec7D8Ce1a3E",binPoolManagerOwner:"0xeA8480331310Cf1EEA2D1d8E41429AE163EcfA51",feeController:"0x197855617B40D79b4eaD1b4e0f8Bf6ab41022b19",clProtocolFeeController:null,binProtocolFeeController:null,governanceSafe:"0xeA7903Ed7d5FAE93CE1500ED2c4df138bDF0a038",safe:$t[8453],timelockCustody:"0x71E6B57d1dC373929899e6189771ee9115B4EF14",timelockPolicy:null,registry:"0x197855eBa41da04f2A380ba612AdD1C48f7a27aA",universalRouter:"0xd3dF9e77ed0Cf41B22BB0c7E527caE966CF79695",fillRouter:"0x197827dceB223ADDeE5cbdf123C08df6b73016E3",clPositionManager:"0x637A989326Fe99e9618A97f68D05621858B68973",binPositionManager:"0x585F7D8DAFEA7178ea91a54789f5059C2B1D3998",clQuoter:"0x0f971d005eC4E6E2f0dEe532ce4E9469c4D2651A",binQuoter:"0x684eD241c7B15eC83b1F4f93c049C6F74f504fEF",clPositionDescriptor:"0x69d18C3F0CFf468B9b2afb729b326D93eD2C7A22",create3Factory:"0x501D3a1F7674BE9f4BCe56bE81Dc3CafA1E51BD1",permit2:"0x000000000022D473030F116dDEE9F6B43aC78BA3",weth:"0x4200000000000000000000000000000000000006",revShareHook:"0x1978A2C6905aC690f21b23d581dc5b1E0Aa18266",launchRegistry:"0x1978f09B8F8886251e2693566822b7aCC30faD59",launchpadKit:null,launchGuardHook:null,launchpadV2:{launchpadKitV2:"0x19789C58f0d648146a698D6d3fAAA40Abb3e68a8",launchLegs:"0x1978bCCCe1CfaCD456a1908fe1c8c3198203917A",launchTokenFactory:"0x197865Bf8bEb9d597feAfd39136d5aDA2e8DBcD7",clLPLocker:"0x1978ECb2789423aE7fB4020dD432bc614741206c",binLPLocker:"0x1978029ec07FF1E85FA1fF53d430322D08F8F01f",clLaunchGuardHook:"0x1978493942bDE85721d047655Cee31Ef57C0303f",binLaunchGuardHook:"0x19785eB03DFeFea2371cc5C5Cd7130B5D829C195",padFactory:"0x1978b82718FfbE0f0D2Ab0FfDc575b87fAfeca1C"},splitFactory:"0x1978F55996c371A30CdE8CA8015B0D362b72Cd53",positionLock:"0x1978c7b933371bc4B238939De9dfE047653CFb85",tokenLock:"0x19784D694a07bB88380B1e9e3F5d6506190d2A7a",multisend:"0x1978DB38B8495b70FBa397b1F41f3dEd4A5FF2c2",dropFactory:"0x1978989f87B6F05000e2A0C04451114f1f50C04E",durationClocks:{revShareHook:"timestamp",launchpadKit:null,launchGuardHook:null},revShareHooks:[{address:"0x1978A2C6905aC690f21b23d581dc5b1E0Aa18266",durationClock:"timestamp",pendingShape:"timestamp-with-expiry",status:"current",note:"Release-commit timestamp build: seconds-based delay and a 3-day proposal TTL."}],tokens:[{address:"0x4200000000000000000000000000000000000006",symbol:"WETH",name:"Wrapped Ether",decimals:18,isTestToken:!1}]},11155111:{chainId:11155111,key:"sepolia",name:"Ethereum Sepolia",explorer:"https://sepolia.etherscan.io",isMainnet:!1,deployedAtBlock:11778000n,nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},contractBlockClock:"native",contractBlockTimeCentis:1200,vault:"0xCe3d133eb486b448A53437A5073619FbE424d01B",clPoolManager:"0xb7C8a11E0B359616eD06256783aF57114841F738",binPoolManager:"0xdBA93F91BA5B8535AE2b38be6a3A6CdcfDE6f6f3",clPoolManagerOwner:null,binPoolManagerOwner:null,feeController:"0xc1b7A4e61A4B6ceBA3e308425dc2390c2CE57ea9",clProtocolFeeController:null,binProtocolFeeController:null,governanceSafe:"0xeA7903Ed7d5FAE93CE1500ED2c4df138bDF0a038",safe:$t[11155111],timelockCustody:"0x35D72DbEeD5F2CE95a4DFb3917D2CD3c43e544CA",timelockPolicy:"0x30897C9e7c1c336cDF68C7494f930C75A355d42F",registry:"0x1978048a2E1a896384E0540e6dBe7Edc89392695",universalRouter:"0xB647CEbd5b8d6bE38C198634828187F482f4874B",fillRouter:"0x19783226D9b43E2B3fC7401ae5507D75e4a2A9bc",clPositionManager:"0xb3505d48A84651c104a02D41B2b9D8CB84dFEC33",binPositionManager:"0x965b1D98BB0cd4E0125D78AD17ea4d2D1d62AE6f",clQuoter:"0x4471e61fE697204908CA97CdF4810EeAf406e9C1",binQuoter:"0x3544C594f12F7c89aa1D8C596d793b661206Ab17",clPositionDescriptor:"0xFe386132bE4A3D85267488A1C64061ba691cfc7a",create3Factory:"0x76473D174Aa17C23FBE49CAb50aAc4ED4d8c678F",permit2:"0x31c2F6fcFf4F8759b3Bd5Bf0e1084A055615c768",weth:"0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",revShareHook:"0x1C86dc775FF3FDADCCF87F132de7a4eb60B6bE28",launchRegistry:"0x19786475eFB20fB9972c8A07dBfD2Ed785E18D3C",launchpadKit:null,launchGuardHook:"0x19787323459816B6E76dF78507363269a9458197",launchpadV2:{launchpadKitV2:"0x1978DC12388ee2feda6cFDfD7245F543fB019cb8",launchLegs:"0x1978367629505f09d16AEd93616A643E25a71550",launchTokenFactory:"0x1978c70a0e59A6b52477ce34dce050CfC3E4b4A5",clLPLocker:"0x1978D33E07d2ED2E155c3F168E3510D027C49A48",binLPLocker:"0x19787F213d0988005934A2F87dBD8E5c5E7A0d5E",clLaunchGuardHook:"0x19787323459816B6E76dF78507363269a9458197",binLaunchGuardHook:"0x1978A3f6d11C9a6cAEa0Df547CbE54A3fa7280f7",padFactory:"0x19781ED911c36E5303c972545A31736C94D18604"},splitFactory:"0x19789714b1fEa5dfECF0761cbAf4Fd1B6FC0728D",positionLock:"0x1979B9a756D00149F695C88c2f37f88228746Df9",tokenLock:"0x1979481aad83348b537b12a320bd3771e0836Db4",multisend:"0x1979f6410B204A31E4f94587768a910Abd0aFAB4",dropFactory:"0x197961B758267BE455c9dEb94f9525978d30b392",durationClocks:{revShareHook:"contract-block",launchpadKit:null,launchGuardHook:"timestamp"},revShareHooks:[{address:"0x1C86dc775FF3FDADCCF87F132de7a4eb60B6bE28",durationClock:"contract-block",pendingShape:"block-no-expiry",status:"current",note:"Predates proposal expiry. An L1, so the contract block clock is the RPC one (12 s)."},{address:"0x197837E55B7EA86120743d8F6eD9d4bbe50FC9CA",durationClock:"timestamp",pendingShape:"timestamp-with-expiry",status:"live",note:"Release-commit timestamp build: seconds-based delay and a 3-day proposal TTL. Not yet the address book's revShareHook."}],tokens:[{address:"0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",symbol:"WETH",name:"Wrapped Ether",decimals:18,isTestToken:!1},{address:"0x5c00ea81EedcED610c5174b9D20F83Ca245e269C",symbol:"ltUSD",name:"Latch Test USD",decimals:18,isTestToken:!0},{address:"0xbEf6E0f94Fe1a96390Eb25D32759aad85fD1f067",symbol:"ltETH",name:"Latch Test ETH",decimals:18,isTestToken:!0}]}},Bn=Mn,Lr=Object.keys(Mn).map(Number).sort((e,t)=>e-t);Lr.filter(e=>Bn[e].isMainnet),Object.freeze(Object.fromEntries(Lr.map(e=>[e,Bn[e].nativeCurrency])));function eu(e){return Object.prototype.hasOwnProperty.call(Mn,e)}function tu(e){return eu(e)?Bn[e]:void 0}const Fe=[{type:"error",name:"AlreadyLocked",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"BpsDoNotSumToDenominator",inputs:[{name:"sum",type:"uint256",internalType:"uint256"}]},{type:"error",name:"EmptyPosition",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"HookInterceptsRemoval",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"hook",type:"address",internalType:"address"}]},{type:"error",name:"IntegratorBpsTooHigh",inputs:[{name:"integratorBps",type:"uint16",internalType:"uint16"},{name:"maxIntegratorBps",type:"uint16",internalType:"uint16"}]},{type:"error",name:"InvalidBpsBounds",inputs:[{name:"minProtocolBps",type:"uint16",internalType:"uint16"},{name:"maxProtocolBps",type:"uint16",internalType:"uint16"},{name:"maxIntegratorBps",type:"uint16",internalType:"uint16"}]},{type:"error",name:"InvalidCreator",inputs:[{name:"creator",type:"address",internalType:"address"}]},{type:"error",name:"InvalidIntegrator",inputs:[{name:"integrator",type:"address",internalType:"address"},{name:"integratorBps",type:"uint16",internalType:"uint16"}]},{type:"error",name:"InvalidLockData",inputs:[{name:"length",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NotCreator",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NotLocked",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NotOwnedByLocker",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NotPendingCreator",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NotPositionManager",inputs:[{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NothingToClaim",inputs:[]},{type:"error",name:"NothingToSkim",inputs:[]},{type:"error",name:"PositionManagerHasNoVault",inputs:[]},{type:"error",name:"ProtocolBpsOutOfRange",inputs:[{name:"protocolBps",type:"uint16",internalType:"uint16"},{name:"minProtocolBps",type:"uint16",internalType:"uint16"},{name:"maxProtocolBps",type:"uint16",internalType:"uint16"}]},{type:"error",name:"ProtocolRecipientIsLocker",inputs:[]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SubscriberAttached",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"subscriber",type:"address",internalType:"address"}]},{type:"error",name:"UnexpectedNativeSender",inputs:[{name:"sender",type:"address",internalType:"address"}]},{type:"error",name:"ZeroAddress",inputs:[]},{type:"event",name:"Claimed",inputs:[{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"currency",type:"address",indexed:!0,internalType:"Currency"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"CreatorTransferStarted",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"creator",type:"address",indexed:!0,internalType:"address"},{name:"pending",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"CreatorTransferred",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"previousCreator",type:"address",indexed:!0,internalType:"address"},{name:"newCreator",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"FeesCollected",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"currency",type:"address",indexed:!0,internalType:"Currency"},{name:"caller",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"creatorShare",type:"uint256",indexed:!1,internalType:"uint256"},{name:"integratorShare",type:"uint256",indexed:!1,internalType:"uint256"},{name:"protocolShare",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"PositionLocked",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"poolId",type:"bytes32",indexed:!0,internalType:"PoolId"},{name:"creator",type:"address",indexed:!0,internalType:"address"},{name:"integrator",type:"address",indexed:!1,internalType:"address"},{name:"creatorBps",type:"uint16",indexed:!1,internalType:"uint16"},{name:"integratorBps",type:"uint16",indexed:!1,internalType:"uint16"},{name:"protocolBps",type:"uint16",indexed:!1,internalType:"uint16"},{name:"liquidity",type:"uint128",indexed:!1,internalType:"uint128"},{name:"from",type:"address",indexed:!1,internalType:"address"},{name:"operator",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"Skimmed",inputs:[{name:"currency",type:"address",indexed:!0,internalType:"Currency"},{name:"caller",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"function",name:"BPS_DENOMINATOR",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"acceptCreator",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claim",inputs:[{name:"currency",type:"address",internalType:"Currency"},{name:"to",type:"address",internalType:"address"}],outputs:[{name:"amount",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"claimable",inputs:[{name:"account",type:"address",internalType:"address"},{name:"currency",type:"address",internalType:"Currency"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"collectFees",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"amount0",type:"uint256",internalType:"uint256"},{name:"amount1",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"getLock",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"tuple",internalType:"struct Lock",components:[{name:"creator",type:"address",internalType:"address"},{name:"creatorBps",type:"uint16",internalType:"uint16"},{name:"integratorBps",type:"uint16",internalType:"uint16"},{name:"protocolBps",type:"uint16",internalType:"uint16"},{name:"lockedAt",type:"uint48",internalType:"uint48"},{name:"integrator",type:"address",internalType:"address"},{name:"currency0",type:"address",internalType:"Currency"},{name:"currency1",type:"address",internalType:"Currency"},{name:"poolId",type:"bytes32",internalType:"PoolId"}]}],stateMutability:"view"},{type:"function",name:"isLocked",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"lockCount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxIntegratorBps",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"maxProtocolBps",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"minProtocolBps",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"pendingCreator",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"positionManager",inputs:[],outputs:[{name:"",type:"address",internalType:"contract ICLPositionManager"}],stateMutability:"view"},{type:"function",name:"protocolRecipient",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"skim",inputs:[{name:"currency",type:"address",internalType:"Currency"}],outputs:[{name:"surplus",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"splitAmount",inputs:[{name:"amount",type:"uint256",internalType:"uint256"},{name:"creatorBps",type:"uint16",internalType:"uint16"},{name:"integratorBps",type:"uint16",internalType:"uint16"}],outputs:[{name:"creatorShare",type:"uint256",internalType:"uint256"},{name:"integratorShare",type:"uint256",internalType:"uint256"},{name:"protocolShare",type:"uint256",internalType:"uint256"}],stateMutability:"pure"},{type:"function",name:"totalOwed",inputs:[{name:"currency",type:"address",internalType:"Currency"}],outputs:[{name:"amount",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"transferCreator",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"newCreator",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"vault",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"}],Oe=[{type:"error",name:"BinIdsNotStrictlyIncreasing",inputs:[{name:"index",type:"uint256",internalType:"uint256"}]},{type:"error",name:"BpsDoNotSumToDenominator",inputs:[{name:"sum",type:"uint256",internalType:"uint256"}]},{type:"error",name:"EmptyBin",inputs:[{name:"binId",type:"uint24",internalType:"uint24"}]},{type:"error",name:"HookInterceptsRemoval",inputs:[{name:"hook",type:"address",internalType:"address"}]},{type:"error",name:"IntegratorBpsTooHigh",inputs:[{name:"integratorBps",type:"uint16",internalType:"uint16"},{name:"maxIntegratorBps",type:"uint16",internalType:"uint16"}]},{type:"error",name:"InvalidBinCount",inputs:[{name:"count",type:"uint256",internalType:"uint256"},{name:"maxBinsPerLock",type:"uint16",internalType:"uint16"}]},{type:"error",name:"InvalidBpsBounds",inputs:[{name:"minProtocolBps",type:"uint16",internalType:"uint16"},{name:"maxProtocolBps",type:"uint16",internalType:"uint16"},{name:"maxIntegratorBps",type:"uint16",internalType:"uint16"}]},{type:"error",name:"InvalidCreator",inputs:[{name:"creator",type:"address",internalType:"address"}]},{type:"error",name:"InvalidIntegrator",inputs:[{name:"integrator",type:"address",internalType:"address"},{name:"integratorBps",type:"uint16",internalType:"uint16"}]},{type:"error",name:"InvalidMaxBinsPerLock",inputs:[{name:"maxBinsPerLock",type:"uint16",internalType:"uint16"}]},{type:"error",name:"LengthMismatch",inputs:[{name:"binIds",type:"uint256",internalType:"uint256"},{name:"shares",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NotCreator",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NotLocked",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NotPendingCreator",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NothingToClaim",inputs:[]},{type:"error",name:"NothingToCollect",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NothingToSkim",inputs:[]},{type:"error",name:"PoolManagerMismatch",inputs:[{name:"poolManager",type:"address",internalType:"address"}]},{type:"error",name:"PositionManagerHasNoPoolManager",inputs:[]},{type:"error",name:"PositionManagerHasNoVault",inputs:[]},{type:"error",name:"ProtocolBpsOutOfRange",inputs:[{name:"protocolBps",type:"uint16",internalType:"uint16"},{name:"minProtocolBps",type:"uint16",internalType:"uint16"},{name:"maxProtocolBps",type:"uint16",internalType:"uint16"}]},{type:"error",name:"ProtocolRecipientIsLocker",inputs:[]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"SharesNotReceived",inputs:[{name:"binId",type:"uint24",internalType:"uint24"},{name:"expected",type:"uint256",internalType:"uint256"},{name:"received",type:"uint256",internalType:"uint256"}]},{type:"error",name:"UnexpectedNativeSender",inputs:[{name:"sender",type:"address",internalType:"address"}]},{type:"error",name:"ZeroAddress",inputs:[]},{type:"error",name:"ZeroShares",inputs:[{name:"binId",type:"uint24",internalType:"uint24"}]},{type:"event",name:"BinsLocked",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"poolId",type:"bytes32",indexed:!0,internalType:"PoolId"},{name:"creator",type:"address",indexed:!0,internalType:"address"},{name:"integrator",type:"address",indexed:!1,internalType:"address"},{name:"creatorBps",type:"uint16",indexed:!1,internalType:"uint16"},{name:"integratorBps",type:"uint16",indexed:!1,internalType:"uint16"},{name:"protocolBps",type:"uint16",indexed:!1,internalType:"uint16"},{name:"binIds",type:"uint24[]",indexed:!1,internalType:"uint24[]"},{name:"shares",type:"uint256[]",indexed:!1,internalType:"uint256[]"},{name:"principals",type:"uint256[]",indexed:!1,internalType:"uint256[]"},{name:"from",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"Claimed",inputs:[{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"currency",type:"address",indexed:!0,internalType:"Currency"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"CreatorTransferStarted",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"creator",type:"address",indexed:!0,internalType:"address"},{name:"pending",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"CreatorTransferred",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"previousCreator",type:"address",indexed:!0,internalType:"address"},{name:"newCreator",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"FeeSharesBurned",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"caller",type:"address",indexed:!0,internalType:"address"},{name:"binIds",type:"uint256[]",indexed:!1,internalType:"uint256[]"},{name:"sharesBurned",type:"uint256[]",indexed:!1,internalType:"uint256[]"}],anonymous:!1},{type:"event",name:"FeesCollected",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"currency",type:"address",indexed:!0,internalType:"Currency"},{name:"caller",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"creatorShare",type:"uint256",indexed:!1,internalType:"uint256"},{name:"integratorShare",type:"uint256",indexed:!1,internalType:"uint256"},{name:"protocolShare",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Skimmed",inputs:[{name:"currency",type:"address",indexed:!0,internalType:"Currency"},{name:"caller",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"function",name:"BPS_DENOMINATOR",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"MAX_BINS_HARD_CAP",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"acceptCreator",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"binPoolManager",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IBinPoolManager"}],stateMutability:"view"},{type:"function",name:"claim",inputs:[{name:"currency",type:"address",internalType:"Currency"},{name:"to",type:"address",internalType:"address"}],outputs:[{name:"amount",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"claimable",inputs:[{name:"account",type:"address",internalType:"address"},{name:"currency",type:"address",internalType:"Currency"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"collectFees",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"amount0",type:"uint256",internalType:"uint256"},{name:"amount1",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"getLock",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"tuple",internalType:"struct BinLock",components:[{name:"creator",type:"address",internalType:"address"},{name:"creatorBps",type:"uint16",internalType:"uint16"},{name:"integratorBps",type:"uint16",internalType:"uint16"},{name:"protocolBps",type:"uint16",internalType:"uint16"},{name:"lockedAt",type:"uint48",internalType:"uint48"},{name:"integrator",type:"address",internalType:"address"},{name:"binCount",type:"uint16",internalType:"uint16"},{name:"poolId",type:"bytes32",internalType:"PoolId"}]}],stateMutability:"view"},{type:"function",name:"getLockedBins",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"binIds",type:"uint24[]",internalType:"uint24[]"},{name:"shares",type:"uint256[]",internalType:"uint256[]"},{name:"principals",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"getPoolKey",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"tuple",internalType:"struct PoolKey",components:[{name:"currency0",type:"address",internalType:"Currency"},{name:"currency1",type:"address",internalType:"Currency"},{name:"hooks",type:"address",internalType:"contract IHooks"},{name:"poolManager",type:"address",internalType:"contract IPoolManager"},{name:"fee",type:"uint24",internalType:"uint24"},{name:"parameters",type:"bytes32",internalType:"bytes32"}]}],stateMutability:"view"},{type:"function",name:"harvestableShares",inputs:[{name:"shares",type:"uint256",internalType:"uint256"},{name:"principal",type:"uint256",internalType:"uint256"},{name:"binReserveX",type:"uint128",internalType:"uint128"},{name:"binReserveY",type:"uint128",internalType:"uint128"},{name:"binLiquidity",type:"uint256",internalType:"uint256"},{name:"binShares",type:"uint256",internalType:"uint256"}],outputs:[{name:"burn",type:"uint256",internalType:"uint256"}],stateMutability:"pure"},{type:"function",name:"isLocked",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"lock",inputs:[{name:"key",type:"tuple",internalType:"struct PoolKey",components:[{name:"currency0",type:"address",internalType:"Currency"},{name:"currency1",type:"address",internalType:"Currency"},{name:"hooks",type:"address",internalType:"contract IHooks"},{name:"poolManager",type:"address",internalType:"contract IPoolManager"},{name:"fee",type:"uint24",internalType:"uint24"},{name:"parameters",type:"bytes32",internalType:"bytes32"}]},{name:"binIds",type:"uint24[]",internalType:"uint24[]"},{name:"shares",type:"uint256[]",internalType:"uint256[]"},{name:"p",type:"tuple",internalType:"struct LockParams",components:[{name:"creator",type:"address",internalType:"address"},{name:"creatorBps",type:"uint16",internalType:"uint16"},{name:"integrator",type:"address",internalType:"address"},{name:"integratorBps",type:"uint16",internalType:"uint16"},{name:"protocolBps",type:"uint16",internalType:"uint16"}]}],outputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"lockCount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxBinsPerLock",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"maxIntegratorBps",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"maxProtocolBps",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"minProtocolBps",inputs:[],outputs:[{name:"",type:"uint16",internalType:"uint16"}],stateMutability:"view"},{type:"function",name:"pendingCreator",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"positionManager",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IBinPositionManager"}],stateMutability:"view"},{type:"function",name:"previewCollect",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"sharesToBurn",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"protocolRecipient",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"skim",inputs:[{name:"currency",type:"address",internalType:"Currency"}],outputs:[{name:"surplus",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"splitAmount",inputs:[{name:"amount",type:"uint256",internalType:"uint256"},{name:"creatorBps",type:"uint16",internalType:"uint16"},{name:"integratorBps",type:"uint16",internalType:"uint16"}],outputs:[{name:"creatorShare",type:"uint256",internalType:"uint256"},{name:"integratorShare",type:"uint256",internalType:"uint256"},{name:"protocolShare",type:"uint256",internalType:"uint256"}],stateMutability:"pure"},{type:"function",name:"totalOwed",inputs:[{name:"currency",type:"address",internalType:"Currency"}],outputs:[{name:"amount",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"transferCreator",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"},{name:"newCreator",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"vault",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"}],Ne=[{type:"error",name:"AddressEmptyCode",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"AddressInsufficientBalance",inputs:[{name:"account",type:"address",internalType:"address"}]},{type:"error",name:"AlreadyLocked",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"EmptyPosition",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"FailedInnerCall",inputs:[]},{type:"error",name:"FeeAboveCap",inputs:[{name:"feeWei",type:"uint256",internalType:"uint256"},{name:"capWei",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InsufficientFee",inputs:[{name:"required",type:"uint256",internalType:"uint256"},{name:"sent",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidNotice",inputs:[{name:"noticeSeconds",type:"uint32",internalType:"uint32"}]},{type:"error",name:"InvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"InvalidUnlock",inputs:[{name:"unlockAt",type:"uint48",internalType:"uint48"}]},{type:"error",name:"NativeTransferFailed",inputs:[{name:"to",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NoPendingFee",inputs:[]},{type:"error",name:"NotLater",inputs:[{name:"current",type:"uint48",internalType:"uint48"},{name:"proposed",type:"uint48",internalType:"uint48"}]},{type:"error",name:"NotLockOwner",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NotLocked",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NotPendingOwner",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NotPositionOwner",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NothingToFlush",inputs:[]},{type:"error",name:"NothingToRescue",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"OwnableInvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"OwnableUnauthorizedAccount",inputs:[{name:"account",type:"address",internalType:"address"}]},{type:"error",name:"PositionIsLocked",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"RenounceDisabled",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"StillLocked",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"unlockAt",type:"uint48",internalType:"uint48"}]},{type:"error",name:"ZeroAddress",inputs:[]},{type:"event",name:"ERC20Rescued",inputs:[{name:"token",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"FeeChanged",inputs:[{name:"previousWei",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newWei",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"FeeIncreaseScheduled",inputs:[{name:"currentWei",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newWei",type:"uint256",indexed:!1,internalType:"uint256"},{name:"effectiveAt",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"FeePaid",inputs:[{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"feeWei",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"FeesCollected",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"to",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"LockExtended",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"previousUnlockAt",type:"uint48",indexed:!1,internalType:"uint48"},{name:"newUnlockAt",type:"uint48",indexed:!1,internalType:"uint48"}],anonymous:!1},{type:"event",name:"LockOwnerTransferStarted",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"LockOwnerTransferred",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipTransferStarted",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"PendingFeeCancelled",inputs:[{name:"cancelledWei",type:"uint256",indexed:!1,internalType:"uint256"},{name:"effectiveAt",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"PositionLocked",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"poolId",type:"bytes32",indexed:!0,internalType:"PoolId"},{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"unlockAt",type:"uint48",indexed:!1,internalType:"uint48"},{name:"liquidity",type:"uint128",indexed:!1,internalType:"uint128"},{name:"locker",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"PositionRescued",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"to",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"PositionWithdrawn",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"to",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ProtocolFeesFlushed",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"owed",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"function",name:"MAX_FEE_NOTICE_SECONDS",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"MAX_LOCK_SECONDS",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"MIN_FEE_NOTICE_SECONDS",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"acceptLockOwner",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"acceptOwnership",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"cancelPendingFee",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"collectFees",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"extend",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"newUnlockAt",type:"uint48",internalType:"uint48"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"feeNoticeSeconds",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"feeWei",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"flushProtocolFees",inputs:[],outputs:[{name:"amount",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"getLock",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"tuple",internalType:"struct LatchPositionLock.PositionLock",components:[{name:"owner",type:"address",internalType:"address"},{name:"lockedAt",type:"uint48",internalType:"uint48"},{name:"unlockAt",type:"uint48",internalType:"uint48"},{name:"pendingOwner",type:"address",internalType:"address"},{name:"poolId",type:"bytes32",internalType:"PoolId"},{name:"currency0",type:"address",internalType:"Currency"},{name:"currency1",type:"address",internalType:"Currency"},{name:"withdrawn",type:"bool",internalType:"bool"}]}],stateMutability:"view"},{type:"function",name:"isLocked",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"lock",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"unlockAt",type:"uint48",internalType:"uint48"},{name:"owner",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"lockCount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"lockIds",inputs:[{name:"start",type:"uint256",internalType:"uint256"},{name:"end",type:"uint256",internalType:"uint256"}],outputs:[{name:"page",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"maxFeeWei",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"owner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"pendingFee",inputs:[],outputs:[{name:"newFeeWei",type:"uint256",internalType:"uint256"},{name:"effectiveAt",type:"uint64",internalType:"uint64"}],stateMutability:"view"},{type:"function",name:"pendingOwner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"poolLockCount",inputs:[{name:"poolId",type:"bytes32",internalType:"PoolId"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"poolLockIds",inputs:[{name:"poolId",type:"bytes32",internalType:"PoolId"},{name:"start",type:"uint256",internalType:"uint256"},{name:"end",type:"uint256",internalType:"uint256"}],outputs:[{name:"page",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"positionManager",inputs:[],outputs:[{name:"",type:"address",internalType:"contract ICLPositionManager"}],stateMutability:"view"},{type:"function",name:"protocolFeeRecipient",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"protocolFeesOwed",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"pure"},{type:"function",name:"rescueERC20",inputs:[{name:"token",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"rescuePosition",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"to",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setFee",inputs:[{name:"newFeeWei",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferLockOwner",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"withdraw",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"to",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"}],St=[{type:"error",name:"AddressEmptyCode",inputs:[{name:"target",type:"address",internalType:"address"}]},{type:"error",name:"AddressInsufficientBalance",inputs:[{name:"account",type:"address",internalType:"address"}]},{type:"error",name:"FailedInnerCall",inputs:[]},{type:"error",name:"FeeAboveCap",inputs:[{name:"feeWei",type:"uint256",internalType:"uint256"},{name:"capWei",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InsufficientFee",inputs:[{name:"required",type:"uint256",internalType:"uint256"},{name:"sent",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidBeneficiary",inputs:[{name:"beneficiary",type:"address",internalType:"address"}]},{type:"error",name:"InvalidNotice",inputs:[{name:"noticeSeconds",type:"uint32",internalType:"uint32"}]},{type:"error",name:"InvalidSchedule",inputs:[{name:"start",type:"uint48",internalType:"uint48"},{name:"cliff",type:"uint48",internalType:"uint48"},{name:"end",type:"uint48",internalType:"uint48"}]},{type:"error",name:"MathOverflowedMulDiv",inputs:[]},{type:"error",name:"NativeTransferFailed",inputs:[{name:"to",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NativeValueMismatch",inputs:[{name:"expected",type:"uint256",internalType:"uint256"},{name:"sent",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NoPendingFee",inputs:[]},{type:"error",name:"NoSuchLock",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NotBeneficiary",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NotPendingBeneficiary",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"},{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NothingToClaim",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}]},{type:"error",name:"NothingToFlush",inputs:[]},{type:"error",name:"NothingToRescue",inputs:[{name:"currency",type:"address",internalType:"Currency"}]},{type:"error",name:"OwnableInvalidOwner",inputs:[{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"OwnableUnauthorizedAccount",inputs:[{name:"account",type:"address",internalType:"address"}]},{type:"error",name:"ReentrancyGuardReentrantCall",inputs:[]},{type:"error",name:"RenounceDisabled",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"ZeroAddress",inputs:[]},{type:"error",name:"ZeroAmount",inputs:[]},{type:"event",name:"BeneficiaryTransferStarted",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"beneficiary",type:"address",indexed:!0,internalType:"address"},{name:"newBeneficiary",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"BeneficiaryTransferred",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"previous",type:"address",indexed:!0,internalType:"address"},{name:"newBeneficiary",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Claimed",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"beneficiary",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"FeeChanged",inputs:[{name:"previousWei",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newWei",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"FeeIncreaseScheduled",inputs:[{name:"currentWei",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newWei",type:"uint256",indexed:!1,internalType:"uint256"},{name:"effectiveAt",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"FeePaid",inputs:[{name:"payer",type:"address",indexed:!0,internalType:"address"},{name:"feeWei",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Locked",inputs:[{name:"lockId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"currency",type:"address",indexed:!0,internalType:"Currency"},{name:"beneficiary",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"start",type:"uint48",indexed:!1,internalType:"uint48"},{name:"cliff",type:"uint48",indexed:!1,internalType:"uint48"},{name:"end",type:"uint48",indexed:!1,internalType:"uint48"},{name:"creator",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipTransferStarted",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"previousOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"PendingFeeCancelled",inputs:[{name:"cancelledWei",type:"uint256",indexed:!1,internalType:"uint256"},{name:"effectiveAt",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"ProtocolFeesFlushed",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"},{name:"owed",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"SurplusRescued",inputs:[{name:"currency",type:"address",indexed:!0,internalType:"Currency"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"function",name:"MAX_FEE_NOTICE_SECONDS",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"MAX_LOCK_SECONDS",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"MIN_FEE_NOTICE_SECONDS",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"acceptBeneficiary",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"acceptOwnership",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"beneficiaryLockIds",inputs:[{name:"account",type:"address",internalType:"address"},{name:"start",type:"uint256",internalType:"uint256"},{name:"end",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"cancelPendingFee",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claim",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"},{name:"to",type:"address",internalType:"address"}],outputs:[{name:"amount",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"claimable",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"currencyLockCount",inputs:[{name:"currency",type:"address",internalType:"Currency"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"currencyLockIds",inputs:[{name:"currency",type:"address",internalType:"Currency"},{name:"start",type:"uint256",internalType:"uint256"},{name:"end",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"feeNoticeSeconds",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"feeWei",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"flushProtocolFees",inputs:[],outputs:[{name:"amount",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"getLock",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"tuple",internalType:"struct LatchTokenLock.TokenLock",components:[{name:"currency",type:"address",internalType:"Currency"},{name:"beneficiary",type:"address",internalType:"address"},{name:"start",type:"uint48",internalType:"uint48"},{name:"cliff",type:"uint48",internalType:"uint48"},{name:"end",type:"uint48",internalType:"uint48"},{name:"pendingBeneficiary",type:"address",internalType:"address"},{name:"amount",type:"uint256",internalType:"uint256"},{name:"claimed",type:"uint256",internalType:"uint256"},{name:"creator",type:"address",internalType:"address"}]}],stateMutability:"view"},{type:"function",name:"lock",inputs:[{name:"currency",type:"address",internalType:"Currency"},{name:"amount",type:"uint256",internalType:"uint256"},{name:"beneficiary",type:"address",internalType:"address"},{name:"start",type:"uint48",internalType:"uint48"},{name:"cliff",type:"uint48",internalType:"uint48"},{name:"end",type:"uint48",internalType:"uint48"}],outputs:[{name:"lockId",type:"uint256",internalType:"uint256"}],stateMutability:"payable"},{type:"function",name:"lockCount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxFeeWei",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"owner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"pendingFee",inputs:[],outputs:[{name:"newFeeWei",type:"uint256",internalType:"uint256"},{name:"effectiveAt",type:"uint64",internalType:"uint64"}],stateMutability:"view"},{type:"function",name:"pendingOwner",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"protocolFeeRecipient",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"protocolFeesOwed",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"pure"},{type:"function",name:"rescueSurplus",inputs:[{name:"currency",type:"address",internalType:"Currency"},{name:"to",type:"address",internalType:"address"}],outputs:[{name:"amount",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"setFee",inputs:[{name:"newFeeWei",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"totalHeld",inputs:[{name:"",type:"address",internalType:"Currency"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"transferBeneficiary",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"},{name:"newBeneficiary",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"vestedAt",inputs:[{name:"lockId",type:"uint256",internalType:"uint256"},{name:"timestamp",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"}];function nu(e){return e.toLowerCase()===z}const $r=-887272,Sr=887272,au=1n<<32n,ru=1n<<128n,iu=(1n<<256n)-1n,Fr=[0xfffcb933bd6fad37aa2d162d1a594001n,0xfff97272373d413259a46990580e213an,0xfff2e50f5f656932ef12357cf3c7fdccn,0xffe5caca7e10e4e61c3624eaa0941cd0n,0xffcb9843d60f6159c9db58835c926644n,0xff973b41fa98c081472e6896dfb254c0n,0xff2ea16466c96a3843ec78b326b52861n,0xfe5dee046a99a2a811c461f1969c3053n,0xfcbe86c7900a88aedcffc83b479aa3a4n,0xf987a7253ac413176f2b074cf7815e54n,0xf3392b0822b70005940c7a398e4b70f3n,0xe7159475a2c29b7443b29c7fa6e889d9n,0xd097f3bdfd2022b8845ad8f792aa5825n,0xa9f746462d870fdf8a65dc1f90e061e5n,0x70d869a156d2a1b890bb3df62baf32f7n,0x31be135f97d08fd981231505542fcfa6n,0x9aa508b5b7a84e1c677de54f3e99bc9n,0x5d6af8dedb81196699c329225ee604n,0x2216e584f5fa1ea926041bedfe98n,0x48a170391f7dc42444e8fa2n];function ou(e){if(!Number.isInteger(e)||e<$r||e>Sr)throw new RangeError(`tick ${e} is outside [${$r}, ${Sr}]`)}function Or(e){ou(e);const t=Math.abs(e);let n=ru;for(let a=0;a<Fr.length;a++)t>>a&1&&(n=n*Fr[a]>>128n);return e>0&&(n=iu/n),(n>>32n)+(n%au===0n?0n:1n)}const Nr=2n**96n;function Dr(e,t,n){return e>t&&([e,t]=[t,e]),e===0n?0n:n*Nr*(t-e)/t/e}function Rr(e,t,n){return e>t&&([e,t]=[t,e]),n*(t-e)/Nr}function _n(e){const{liquidity:t,tickLower:n,tickUpper:a,tick:r,sqrtPriceX96:i}=e,o=Or(n),s=Or(a);return r<n?{amount0:Dr(o,s,t),amount1:0n,inRange:!1}:r>=a?{amount0:0n,amount1:Rr(o,s,t),inRange:!1}:{amount0:Dr(i,s,t),amount1:Rr(o,i,t),inRange:!0}}const yt=[{type:"error",name:"AlreadySubscribed",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"},{name:"subscriber",type:"address",internalType:"address"}]},{type:"error",name:"BurnNotificationReverted",inputs:[{name:"subscriber",type:"address",internalType:"address"},{name:"reason",type:"bytes",internalType:"bytes"}]},{type:"error",name:"ContractLocked",inputs:[]},{type:"error",name:"DeadlinePassed",inputs:[{name:"deadline",type:"uint256",internalType:"uint256"}]},{type:"error",name:"DeltaNotNegative",inputs:[{name:"currency",type:"address",internalType:"Currency"}]},{type:"error",name:"DeltaNotPositive",inputs:[{name:"currency",type:"address",internalType:"Currency"}]},{type:"error",name:"GasLimitTooLow",inputs:[]},{type:"error",name:"InputLengthMismatch",inputs:[]},{type:"error",name:"InsufficientBalance",inputs:[]},{type:"error",name:"InvalidContractSignature",inputs:[]},{type:"error",name:"InvalidEthSender",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"InvalidSignatureLength",inputs:[]},{type:"error",name:"InvalidSigner",inputs:[]},{type:"error",name:"InvalidTick",inputs:[{name:"tick",type:"int24",internalType:"int24"}]},{type:"error",name:"InvalidTokenID",inputs:[]},{type:"error",name:"MaximumAmountExceeded",inputs:[{name:"maximumAmount",type:"uint128",internalType:"uint128"},{name:"amountRequested",type:"uint128",internalType:"uint128"}]},{type:"error",name:"MinimumAmountInsufficient",inputs:[{name:"minimumAmount",type:"uint128",internalType:"uint128"},{name:"amountReceived",type:"uint128",internalType:"uint128"}]},{type:"error",name:"ModifyLiquidityNotificationReverted",inputs:[{name:"subscriber",type:"address",internalType:"address"},{name:"reason",type:"bytes",internalType:"bytes"}]},{type:"error",name:"NoCodeSubscriber",inputs:[]},{type:"error",name:"NoSelfPermit",inputs:[]},{type:"error",name:"NonceAlreadyUsed",inputs:[]},{type:"error",name:"NotApproved",inputs:[{name:"caller",type:"address",internalType:"address"}]},{type:"error",name:"NotSubscribed",inputs:[]},{type:"error",name:"NotVault",inputs:[]},{type:"error",name:"SafeCastOverflow",inputs:[]},{type:"error",name:"SignatureDeadlineExpired",inputs:[]},{type:"error",name:"SubscriptionReverted",inputs:[{name:"subscriber",type:"address",internalType:"address"},{name:"reason",type:"bytes",internalType:"bytes"}]},{type:"error",name:"Unauthorized",inputs:[]},{type:"error",name:"UnsupportedAction",inputs:[{name:"action",type:"uint256",internalType:"uint256"}]},{type:"error",name:"VaultMustBeUnlocked",inputs:[]},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"spender",type:"address",indexed:!0,internalType:"address"},{name:"id",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"event",name:"ApprovalForAll",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"operator",type:"address",indexed:!0,internalType:"address"},{name:"approved",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"MintPosition",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"event",name:"ModifyLiquidity",inputs:[{name:"tokenId",type:"uint256",indexed:!0,internalType:"uint256"},{name:"liquidityChange",type:"int256",indexed:!1,internalType:"int256"},{name:"feesAccrued",type:"int256",indexed:!1,internalType:"BalanceDelta"}],anonymous:!1},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"id",type:"uint256",indexed:!0,internalType:"uint256"}],anonymous:!1},{type:"function",name:"WETH9",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IWETH9"}],stateMutability:"view"},{type:"function",name:"approve",inputs:[{name:"spender",type:"address",internalType:"address"},{name:"id",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"balanceOf",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"clPoolManager",inputs:[],outputs:[{name:"",type:"address",internalType:"contract ICLPoolManager"}],stateMutability:"view"},{type:"function",name:"getApproved",inputs:[{name:"",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"getPoolAndPositionInfo",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"poolKey",type:"tuple",internalType:"struct PoolKey",components:[{name:"currency0",type:"address",internalType:"Currency"},{name:"currency1",type:"address",internalType:"Currency"},{name:"hooks",type:"address",internalType:"contract IHooks"},{name:"poolManager",type:"address",internalType:"contract IPoolManager"},{name:"fee",type:"uint24",internalType:"uint24"},{name:"parameters",type:"bytes32",internalType:"bytes32"}]},{name:"info",type:"uint256",internalType:"CLPositionInfo"}],stateMutability:"view"},{type:"function",name:"getPositionLiquidity",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"liquidity",type:"uint128",internalType:"uint128"}],stateMutability:"view"},{type:"function",name:"initializePool",inputs:[{name:"key",type:"tuple",internalType:"struct PoolKey",components:[{name:"currency0",type:"address",internalType:"Currency"},{name:"currency1",type:"address",internalType:"Currency"},{name:"hooks",type:"address",internalType:"contract IHooks"},{name:"poolManager",type:"address",internalType:"contract IPoolManager"},{name:"fee",type:"uint24",internalType:"uint24"},{name:"parameters",type:"bytes32",internalType:"bytes32"}]},{name:"sqrtPriceX96",type:"uint160",internalType:"uint160"}],outputs:[{name:"",type:"int24",internalType:"int24"}],stateMutability:"payable"},{type:"function",name:"isApprovedForAll",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"modifyLiquidities",inputs:[{name:"payload",type:"bytes",internalType:"bytes"},{name:"deadline",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"payable"},{type:"function",name:"modifyLiquiditiesWithoutLock",inputs:[{name:"actions",type:"bytes",internalType:"bytes"},{name:"params",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"payable"},{type:"function",name:"nextTokenId",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"ownerOf",inputs:[{name:"id",type:"uint256",internalType:"uint256"}],outputs:[{name:"owner",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"permit2",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IAllowanceTransfer"}],stateMutability:"view"},{type:"function",name:"poolKeys",inputs:[{name:"poolId",type:"bytes25",internalType:"bytes25"}],outputs:[{name:"currency0",type:"address",internalType:"Currency"},{name:"currency1",type:"address",internalType:"Currency"},{name:"hooks",type:"address",internalType:"contract IHooks"},{name:"poolManager",type:"address",internalType:"contract IPoolManager"},{name:"fee",type:"uint24",internalType:"uint24"},{name:"parameters",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"positionInfo",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"info",type:"uint256",internalType:"CLPositionInfo"}],stateMutability:"view"},{type:"function",name:"positions",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"poolKey",type:"tuple",internalType:"struct PoolKey",components:[{name:"currency0",type:"address",internalType:"Currency"},{name:"currency1",type:"address",internalType:"Currency"},{name:"hooks",type:"address",internalType:"contract IHooks"},{name:"poolManager",type:"address",internalType:"contract IPoolManager"},{name:"fee",type:"uint24",internalType:"uint24"},{name:"parameters",type:"bytes32",internalType:"bytes32"}]},{name:"tickLower",type:"int24",internalType:"int24"},{name:"tickUpper",type:"int24",internalType:"int24"},{name:"liquidity",type:"uint128",internalType:"uint128"},{name:"feeGrowthInside0LastX128",type:"uint256",internalType:"uint256"},{name:"feeGrowthInside1LastX128",type:"uint256",internalType:"uint256"},{name:"_subscriber",type:"address",internalType:"contract ICLSubscriber"}],stateMutability:"view"},{type:"function",name:"setApprovalForAll",inputs:[{name:"operator",type:"address",internalType:"address"},{name:"approved",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"tokenURI",inputs:[{name:"tokenId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"transferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"id",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"vault",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IVault"}],stateMutability:"view"}],su=me({abi:Fe,name:"PositionLocked"}),Ln=[ia("function getSlot0(bytes32 id) view returns (uint24 activeId, uint24 protocolFee, uint24 lpFee)"),ia("function getBin(bytes32 id, uint24 binId) view returns (uint128 binReserveX, uint128 binReserveY, uint256 binLiquidity, uint256 totalShares)")];async function Ft(e,t,n,a){const r=await e.getLogs({address:t,event:su,...a!==void 0?{args:{poolId:a}}:{},fromBlock:n.fromBlock,toBlock:n.toBlock}),i=[];for(const o of r){const s=o.args.tokenId,c=o.args.poolId;s===void 0||c===void 0||i.some(l=>l.tokenId===s)||i.push({tokenId:s,poolId:c})}return i}async function $n(e,t,n,a=new Map){if(n.length===0)return[];const r=await e.readContract({address:t,abi:Fe,functionName:"positionManager"});return(await Promise.all(n.map(async o=>{const[s,c,l]=await Promise.all([e.readContract({address:t,abi:Fe,functionName:"isLocked",args:[o]}),e.readContract({address:t,abi:Fe,functionName:"getLock",args:[o]}),e.readContract({address:r,abi:yt,functionName:"positions",args:[o]})]);if(!s)return null;const u=Number(l[1]),d=Number(l[2]),f=l[3],p=c.poolId,m=a.get(p.toLowerCase())??null,y=m===null?null:_n({liquidity:f,tickLower:u,tickUpper:d,tick:m.tick,sqrtPriceX96:m.sqrtPriceX96});return{kind:"cl-lp-locker",locker:t,tokenId:o,poolId:p,currency0:c.currency0,currency1:c.currency1,creator:c.creator,lockedAt:BigInt(c.lockedAt),tickLower:u,tickUpper:d,liquidity:f,amount0:y?.amount0??null,amount1:y?.amount1??null,inRange:y?.inRange??null}}))).filter(o=>o!==null)}async function zr(e,t,n={}){const[a,r]=await Promise.all([e.readContract({address:t,abi:Oe,functionName:"lockCount"}),e.readContract({address:t,abi:Oe,functionName:"binPoolManager"})]),i=Number(a),o=n.maxLocks??2e3,s=i>o?i-o+1:1,c=[];for(let p=s;p<=i;p++)c.push(BigInt(p));const l=await Promise.all(c.map(p=>e.readContract({address:t,abi:Oe,functionName:"getLock",args:[p]}))),u=n.poolId?.toLowerCase(),d=c.map((p,m)=>({id:p,rec:l[m]})).filter(p=>u===void 0||p.rec.poolId.toLowerCase()===u);return{locks:await Promise.all(d.map(async({id:p,rec:m})=>{const[y,h]=await Promise.all([e.readContract({address:t,abi:Oe,functionName:"getPoolKey",args:[p]}),e.readContract({address:t,abi:Oe,functionName:"getLockedBins",args:[p]})]),[g,x]=h,w=m.poolId,T=await Promise.all(g.map(B=>e.readContract({address:r,abi:Ln,functionName:"getBin",args:[w,Number(B)]})));let C=0n,P=0n;const E=g.map((B,S)=>{const[j,ie,,U]=T[S],V=x[S]??0n,de=U===0n?0n:BigInt(j)*V/U,R=U===0n?0n:BigInt(ie)*V/U;return C+=de,P+=R,{binId:Number(B),shares:V,totalShares:U,shareBps:U===0n?null:Number(V*10000n/U),amountX:de,amountY:R}});return{kind:"bin-lp-locker",locker:t,lockId:p,poolId:w,currency0:y.currency0,currency1:y.currency1,creator:m.creator,lockedAt:BigInt(m.lockedAt),bins:E,amount0:C,amount1:P}})),total:i,truncated:s>1}}function cu(e,t,n){let a=0n,r=0n,i=0n;for(const s of t){a+=s.amount0,r+=s.amount1;for(const c of s.bins)n!==null&&c.binId===n.activeId&&(i+=c.shares)}const o=n===null||n.totalShares===0n||i===0n?null:Number(i*10000n/n.totalShares);return{poolId:e,activeId:n?.activeId??null,locks:t,amount0:a,amount1:r,activeBinLockedBps:o}}async function uu(e,t,n){const{locks:a}=await zr(e,t,{poolId:n}),r=await e.readContract({address:t,abi:Oe,functionName:"binPoolManager"}),i=await e.readContract({address:r,abi:Ln,functionName:"getSlot0",args:[n]}).then(async([o])=>{const[,,,s]=await e.readContract({address:r,abi:Ln,functionName:"getBin",args:[n,Number(o)]});return{activeId:Number(o),totalShares:s}}).catch(()=>null);return cu(n,a,i)}function lu(e,t,n){const a=e.toLowerCase(),r=new Map;let i=0;const o=(c,l,u,d,f,p)=>{const m=u.toLowerCase()===a;if(!m&&d.toLowerCase()!==a)return;const y=m?f:p;y===null&&(i+=1);const h=`${l}:${c.toLowerCase()}`,g=r.get(h)??{poolId:c,kind:l,pairedWith:m?d:u,amount:0n,locks:0};g.amount+=y??0n,g.locks+=1,r.set(h,g)};for(const c of t)o(c.poolId,c.kind,c.currency0,c.currency1,c.amount0,c.amount1);for(const c of n)o(c.poolId,c.kind,c.currency0,c.currency1,c.amount0,c.amount1);const s=[...r.values()];return{pools:s,total:s.reduce((c,l)=>c+l.amount,0n),unpriced:i}}async function du(e,t,n){const a=await $n(e,t,n);if(a.length===0)return a;const r=await e.readContract({address:t,abi:Fe,functionName:"positionManager"}),i=await e.readContract({address:r,abi:yt,functionName:"clPoolManager"}),o=[...new Set(a.map(l=>l.poolId.toLowerCase()))],s=await Promise.all(o.map(l=>Sn(e,i,l).catch(()=>null))),c=new Map(o.map((l,u)=>[l,s[u]??null]));return a.map(l=>{const u=c.get(l.poolId.toLowerCase())??null;if(u===null)return l;const d=_n({liquidity:l.liquidity,tickLower:l.tickLower,tickUpper:l.tickUpper,tick:u.tick,sqrtPriceX96:u.sqrtPriceX96});return{...l,amount0:d.amount0,amount1:d.amount1,inRange:d.inRange}})}async function pu(e,t,n,a){const r=await e.readContract({address:t,abi:Fe,functionName:"positionManager"}),i=await e.readContract({address:r,abi:yt,functionName:"clPoolManager"}),o=a.tokenIds??(a.logRange?(await Ft(e,t,a.logRange,n)).map(u=>u.tokenId):[]),s=await Sn(e,i,n).catch(()=>null),c=new Map([[n.toLowerCase(),s]]),l=(await $n(e,t,o,c)).filter(u=>u.poolId.toLowerCase()===n.toLowerCase());return{pool:s,permanent:l}}const jr=[{type:"function",name:"getSlot0",stateMutability:"view",inputs:[{name:"id",type:"bytes32"}],outputs:[{name:"sqrtPriceX96",type:"uint160"},{name:"tick",type:"int24"},{name:"protocolFee",type:"uint24"},{name:"lpFee",type:"uint24"}]},{type:"function",name:"getLiquidity",stateMutability:"view",inputs:[{name:"id",type:"bytes32"}],outputs:[{name:"liquidity",type:"uint128"}]}];function fu(e,t){return e.withdrawn?"withdrawn":t<e.unlockAt?"locked":"unlockable"}function yu(e,t,n){return n.owner===z?null:{lock:e,tokenId:t,owner:n.owner,pendingOwner:n.pendingOwner===z?null:n.pendingOwner,lockedAt:BigInt(n.lockedAt),unlockAt:BigInt(n.unlockAt),poolId:n.poolId,currency0:n.currency0,currency1:n.currency1,withdrawn:n.withdrawn}}async function mu(e,t){const n=await e.readContract({address:t,abi:Ne,functionName:"positionManager"}),a=await e.readContract({address:n,abi:yt,functionName:"clPoolManager"});return{lock:t,positionManager:n,poolManager:a}}async function hu(e,t,n){const a=await e.readContract({address:t,abi:Ne,functionName:"getLock",args:[n]});return yu(t,n,a)}async function Ur(e,t,n){const a=[];for(let r=0n;r<e;r+=n)a.push(...await t(r,r+n));return a}async function bu(e,t,n={}){const a=n.pageSize??500n;if(n.poolId!==void 0){const i=n.poolId,o=await e.readContract({address:t,abi:Ne,functionName:"poolLockCount",args:[i]});return Ur(o,(s,c)=>e.readContract({address:t,abi:Ne,functionName:"poolLockIds",args:[i,s,c]}),a)}const r=await e.readContract({address:t,abi:Ne,functionName:"lockCount"});return Ur(r,(i,o)=>e.readContract({address:t,abi:Ne,functionName:"lockIds",args:[i,o]}),a)}async function Sn(e,t,n){const[a,r]=await Promise.all([e.readContract({address:t,abi:jr,functionName:"getSlot0",args:[n]}),e.readContract({address:t,abi:jr,functionName:"getLiquidity",args:[n]})]);if(a[0]===0n)throw new Error(`pool ${n} is not initialized on this CL pool manager`);return{poolId:n,sqrtPriceX96:a[0],tick:Number(a[1]),lpFee:Number(a[3]),activeLiquidity:r}}async function mt(e){return(await e.getBlock({blockTag:"latest"})).timestamp}async function gu(e,t,n,a,r){return Promise.all(n.map(async i=>{const o=fu(i,a);if(o==="withdrawn")return{...i,status:o,tickLower:null,tickUpper:null,liquidity:null,amount0:null,amount1:null,inRange:null};const s=await e.readContract({address:t.positionManager,abi:yt,functionName:"positions",args:[i.tokenId]}),c=Number(s[1]),l=Number(s[2]),u=s[3],d=r.get(i.poolId.toLowerCase())??null;if(d===null)return{...i,status:o,tickLower:c,tickUpper:l,liquidity:u,amount0:null,amount1:null,inRange:null};const f=_n({liquidity:u,tickLower:c,tickUpper:l,tick:d.tick,sqrtPriceX96:d.sqrtPriceX96});return{...i,status:o,tickLower:c,tickUpper:l,liquidity:u,amount0:f.amount0,amount1:f.amount1,inRange:f.inRange}}))}function Fn(e){let t=0,n=0,a=0n,r=0n,i=0n,o=0,s=null,c=null;for(const h of e.locks)h.status!=="withdrawn"&&(t+=1,h.status==="locked"&&(n+=1,(s===null||h.unlockAt<s)&&(s=h.unlockAt),(c===null||h.unlockAt>c)&&(c=h.unlockAt),r+=h.amount0??0n,i+=h.amount1??0n,h.inRange===!0&&h.liquidity!==null?a+=h.liquidity:h.inRange===!1&&(o+=1)));const l=e.permanent??[];let u=0n,d=0n,f=0n,p=0;for(const h of l)d+=h.amount0??0n,f+=h.amount1??0n,h.inRange===!0?u+=h.liquidity:h.inRange===!1&&(p+=1);const m=e.pool?.activeLiquidity??0n,y=h=>m===0n?null:Number(h*10000n/m);return{timeLockedActiveLiquidity:a,timeLockedActiveBps:y(a),timeLockedAmount0:r,timeLockedAmount1:i,permanent:l,permanentActiveLiquidity:u,permanentActiveBps:y(u),permanentAmount0:d,permanentAmount1:f,permanentOutOfRange:p,poolId:e.poolId,currency0:e.currency0,currency1:e.currency1,pool:e.pool,locks:e.locks,liveCount:t,lockedCount:n,lockedActiveLiquidity:a+u,lockedActiveBps:y(a+u),lockedAmount0:r+d,lockedAmount1:i+f,outOfRangeLocked:o,nextUnlockAt:s,lastUnlockAt:c}}async function wu(e,t,n){return(await Promise.all(n.map(r=>hu(e,t,r)))).filter(r=>r!==null)}async function xu(e,t,n){const a=[...new Set(n.map(i=>i.toLowerCase()))],r=await Promise.all(a.map(i=>Sn(e,t,i).catch(()=>null)));return new Map(a.map((i,o)=>[i,r[o]??null]))}async function vu(e,t,n,a={}){const r=a.context??await mu(e,t),[i,o]=await Promise.all([bu(e,t,{poolId:n}),a.now??mt(e)]),s=await wu(e,t,i),c=await xu(e,r.poolManager,[n]),l=await gu(e,r,s,o,c),u=s[0],d=c.get(n.toLowerCase())??null;let f=[];if(a.lpLocker){const y=a.lpLockerTokenIds??(a.lpLockerLogRange?(await Ft(e,a.lpLocker,a.lpLockerLogRange,n)).map(h=>h.tokenId):[]);f=(await $n(e,a.lpLocker,y,c)).filter(h=>h.poolId.toLowerCase()===n.toLowerCase())}const p=u?.currency0??f[0]?.currency0??z,m=u?.currency1??f[0]?.currency1??z;return{...Fn({poolId:n,currency0:p,currency1:m,pool:d,locks:l,permanent:f}),now:o}}function ku(e,t){return t<e.cliff?0n:t>=e.end?e.amount:e.amount*(t-e.start)/(e.end-e.start)}function Tu(e,t,n){return{lock:e,lockId:t,currency:n.currency,beneficiary:n.beneficiary,pendingBeneficiary:n.pendingBeneficiary===z?null:n.pendingBeneficiary,start:BigInt(n.start),cliff:BigInt(n.cliff),end:BigInt(n.end),amount:n.amount,claimed:n.claimed,creator:n.creator}}function Cu(e,t){const n=ku(e,t),a=n>e.claimed?n-e.claimed:0n,r=e.claimed>=e.amount?"claimed":t<e.cliff?"cliff":t>=e.end?"vested":"vesting";return{...e,vested:n,claimable:a,unvested:e.amount-n,status:r}}async function Eu(e,t,n){const a=await e.readContract({address:t,abi:St,functionName:"getLock",args:[n]});return Tu(t,n,a)}async function Au(e,t,n=500n){const a=[];for(let r=0n;r<e;r+=n)a.push(...await t(r,r+n));return a}async function Pu(e,t,n,a){return(await Promise.all(n.map(i=>Eu(e,t,i)))).map(i=>Cu(i,a))}const Iu=[{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{name:"",type:"uint256"}]}];function Mu(e){let t=0n,n=null,a=null;for(const o of e.locks){if(t+=o.unvested,o.unvested===0n)continue;const s=e.now<o.cliff?o.cliff:o.end;(n===null||s<n)&&(n=s),(a===null||o.end>a)&&(a=o.end)}const r=e.totalSupply,i=o=>r===null||r===0n?null:Number(o*10000n/r);return{currency:e.currency,locks:e.locks,totalHeld:e.totalHeld,unvested:t,totalSupply:r,heldBps:i(e.totalHeld),unvestedBps:i(t),nextCliffOrEnd:n,lastEnd:a}}async function Bu(e,t,n,a={}){const[r,i,o,s]=await Promise.all([e.readContract({address:t,abi:St,functionName:"currencyLockCount",args:[n]}),e.readContract({address:t,abi:St,functionName:"totalHeld",args:[n]}),nu(n)?Promise.resolve(null):e.readContract({address:n,abi:Iu,functionName:"totalSupply"}).catch(()=>null),a.now??mt(e)]),c=await Au(r,(u,d)=>e.readContract({address:t,abi:St,functionName:"currencyLockIds",args:[n,u,d]})),l=await Pu(e,t,c,s);return{...Mu({currency:n,locks:l,totalHeld:i,totalSupply:o,now:s}),now:s}}const _u={ethereum:{chainId:1,name:"Ethereum",supportsEip1153:!0,endpoints:[{url:"https://1.rpc.thirdweb.com",latencyMs:37,eip1153:!0},{url:"https://eth.drpc.org",latencyMs:57,eip1153:!0},{url:"https://eth-mainnet.public.blastapi.io",latencyMs:99,eip1153:!0},{url:"https://eth.rpc.blxrbdn.com",latencyMs:101,eip1153:!0},{url:"https://0xrpc.io/eth",latencyMs:185,eip1153:!0}]},base:{chainId:8453,name:"Base",supportsEip1153:!0,endpoints:[{url:"https://8453.rpc.thirdweb.com",latencyMs:43,eip1153:!0},{url:"https://base.drpc.org",latencyMs:46,eip1153:!0},{url:"https://base.gateway.tenderly.co",latencyMs:96,eip1153:!0},{url:"https://base-mainnet.public.blastapi.io",latencyMs:105,eip1153:!0},{url:"https://mainnet.base.org",latencyMs:114,eip1153:!0}]},bsc:{chainId:56,name:"BNB Smart Chain",supportsEip1153:!0,endpoints:[{url:"https://56.rpc.thirdweb.com",latencyMs:45,eip1153:!0},{url:"https://bsc-dataseed.bnbchain.org",latencyMs:90,eip1153:!0},{url:"https://bsc-dataseed1.ninicoin.io",latencyMs:93,eip1153:!0},{url:"https://bsc-dataseed1.defibit.io",latencyMs:102,eip1153:!0},{url:"https://bsc-rpc.publicnode.com",latencyMs:131,eip1153:!0}]},linea:{chainId:59144,name:"Linea",supportsEip1153:!0,endpoints:[{url:"https://linea.drpc.org",latencyMs:61,eip1153:!0},{url:"https://59144.rpc.thirdweb.com",latencyMs:106,eip1153:!0},{url:"https://rpc.linea.build",latencyMs:118,eip1153:!0},{url:"https://linea-rpc.publicnode.com",latencyMs:132,eip1153:!0}]},robinhood:{chainId:4663,name:"Robinhood Chain",supportsEip1153:!0,endpoints:[{url:"https://rpc.mainnet.chain.robinhood.com",latencyMs:108,eip1153:!0},{url:"https://rpc.ordofi.network",latencyMs:51,eip1153:!0},{url:"https://robinhood.rpc.blxrbdn.com",latencyMs:81,eip1153:!0},{url:"https://robinhood-rpc.publicnode.com",latencyMs:122,eip1153:!0},{url:"https://rpc-robinhood.blockmachine.io",latencyMs:205,eip1153:!0}]},ink:{chainId:57073,name:"Ink",supportsEip1153:!0,endpoints:[{url:"https://ink.drpc.org",latencyMs:67,eip1153:!0},{url:"https://rpc-qnd.inkonchain.com",latencyMs:115,eip1153:!0},{url:"https://rpc-gel.inkonchain.com",latencyMs:166,eip1153:!0},{url:"https://57073.rpc.thirdweb.com",latencyMs:183,eip1153:!0},{url:"https://ink-rpc.publicnode.com",latencyMs:289,eip1153:!0}]},xlayer:{chainId:196,name:"X Layer",supportsEip1153:!0,endpoints:[{url:"https://xlayer.drpc.org",latencyMs:59,eip1153:!0},{url:"https://xlayerrpc.okx.com",latencyMs:181,eip1153:!0},{url:"https://196.rpc.thirdweb.com",latencyMs:205,eip1153:!0},{url:"https://api.zan.top/xlayer-mainnet",latencyMs:234,eip1153:null}]},hyperevm:{chainId:999,name:"HyperEVM",supportsEip1153:!0,endpoints:[{url:"https://rpc.purroofgroup.com",latencyMs:44,eip1153:!0},{url:"https://hyperliquid.drpc.org",latencyMs:52,eip1153:!0},{url:"https://999.rpc.thirdweb.com",latencyMs:103,eip1153:!0},{url:"https://hyperliquid-rpc.publicnode.com",latencyMs:125,eip1153:!0},{url:"https://rpc.hyperliquid.xyz/evm",latencyMs:141,eip1153:!0}]},monad:{chainId:143,name:"Monad",supportsEip1153:!0,endpoints:[{url:"https://rpc.monad.xyz",latencyMs:55,eip1153:!0},{url:"https://143.rpc.thirdweb.com",latencyMs:70,eip1153:!0},{url:"https://rpc2.monad.xyz",latencyMs:96,eip1153:!0},{url:"https://api.zan.top/monad-mainnet",latencyMs:236,eip1153:null},{url:"https://monad.drpc.org",latencyMs:266,eip1153:null}]},plasma:{chainId:9745,name:"Plasma",supportsEip1153:!0,endpoints:[{url:"https://rpc.plasma.to",latencyMs:96,eip1153:!0},{url:"https://9745.rpc.thirdweb.com",latencyMs:119,eip1153:!0},{url:"https://plasma.gateway.tenderly.co",latencyMs:115,eip1153:!0}]},stable:{chainId:988,name:"Stable",supportsEip1153:!0,endpoints:[{url:"https://stable.drpc.org",latencyMs:58,eip1153:!0},{url:"https://rpc.stable.xyz",latencyMs:174,eip1153:!0},{url:"https://988.rpc.thirdweb.com",latencyMs:203,eip1153:!0},{url:"https://stable.gateway.tenderly.co",latencyMs:97,eip1153:!0}]},anubis:{chainId:6714,name:"Anubis Network",supportsEip1153:!0,endpoints:[{url:"https://rpc.anubispace.org",latencyMs:803,eip1153:!0}]},sepolia:{chainId:11155111,name:"Ethereum Sepolia",supportsEip1153:!0,endpoints:[{url:"https://11155111.rpc.thirdweb.com",latencyMs:46,eip1153:!0},{url:"https://ethereum-sepolia-rpc.publicnode.com",latencyMs:131,eip1153:!0},{url:"https://0xrpc.io/sep",latencyMs:194,eip1153:!0},{url:"https://rpc.sepolia.ethpandaops.io",latencyMs:207,eip1153:!0}]},stableTestnet:{chainId:2201,name:"Stable Testnet",supportsEip1153:!0,endpoints:[{url:"https://rpc.testnet.stable.xyz",latencyMs:176,eip1153:!0},{url:"https://2201.rpc.thirdweb.com",latencyMs:255,eip1153:!0},{url:"https://stable-testnet.gateway.tenderly.co",latencyMs:103,eip1153:!0}]},arcTestnet:{chainId:5042002,name:"Arc Testnet",supportsEip1153:!0,endpoints:[{url:"https://5042002.rpc.thirdweb.com",latencyMs:42,eip1153:!0},{url:"https://rpc.quicknode.testnet.arc.io",latencyMs:61,eip1153:!0},{url:"https://rpc.drpc.testnet.arc.io",latencyMs:65,eip1153:!0},{url:"https://rpc.testnet.arc.io",latencyMs:70,eip1153:!0},{url:"https://rpc.blockdaemon.testnet.arc.io",latencyMs:171,eip1153:!0}]}},Lu=new Map(Object.values(_u).map(e=>[e.chainId,e]));function $u(e){return Lu.get(e)}function Su(e,t={},n={}){const a=Fu(e,t),r=n.publicFallback??!a.some(Ou);if(a.length>0&&!r)return[...new Set(a)];const i=$u(e)?.endpoints.map(o=>o.url)??[];return[...new Set([...a,...i])]}function Fu(e,t){return(t[`LATCH_RPC_${e}`]??"").split(",").map(n=>n.trim()).filter(Boolean)}function Ou(e){let t;try{t=new URL(e).hostname.toLowerCase().replace(/^\[|\]$/g,"")}catch{return!1}if(t==="localhost"||t.endsWith(".localhost")||t.endsWith(".local")||t==="host.docker.internal"||t==="::1"||t==="0.0.0.0")return!0;const n=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(n===null)return!1;const a=Number(n[1]),r=Number(n[2]);return a===127||a===10||a===172&&r>=16&&r<=31||a===192&&r===168||a===169&&r===254}const Ot=new Map;class Hr extends ne{constructor(n,a){super({url:n,details:`endpoint cooling down after failures; next attempt after ${new Date(a).toISOString()}`});zt(this,"name","EndpointCoolingDownError");zt(this,"retryAt");this.retryAt=a}}function Nu(e){return e===void 0||e===401||e===403||e===408||e===429||e>=500}function Du(e,t){return e instanceof Hr?!1:e instanceof ln?t:e instanceof ne?Nu(e.status):!1}function Ru(e,t=Date.now()){const n=Ot.get(e);return n!==void 0&&t<n.until?{until:n.until,fails:n.fails}:null}function zu(e,t={},n=Date.now()){const a=t.baseMs??15e3,r=t.maxMs??12e4,i=Ot.get(e)??{fails:0,until:0};return n<i.until||(i.fails+=1,i.until=n+Math.min(r,a*2**(i.fails-1)),Ot.set(e,i)),i.until}function ju(e,t={},n={}){const a=_r(e,t),r=n.coolOnTimeout??!0;return i=>{const o=a(i);return{...o,request:async(c,l)=>{const u=Ru(e);if(u!==null)throw new Hr(e,u.until);try{const d=await o.request(c,l);return Ot.delete(e),d}catch(d){throw Du(d,r)&&zu(e,n),d}}}}}class Uu extends Error{constructor(n){super(`No RPC endpoints known for chain ${n}. Add it to CHAIN_RPCS after probing it, or pass one via LATCH_RPC_${n}.`);zt(this,"chainId");this.chainId=n,this.name="UnknownChainError"}}function Hu(e,t={}){const{env:n={},rank:a=!1,retryCount:r=2,perEndpointRetries:i=0,timeout:o=1e4,httpConfig:s,cooldown:c={},publicFallback:l}=t,u=Su(e,n,l===void 0?{}:{publicFallback:l});if(u.length===0)throw new Uu(e);return Kc(u.map(d=>ju(d,{retryCount:i,timeout:o,...s},c===!1?{baseMs:0,maxMs:0}:c)),{rank:a,retryCount:r})}function qu(e){return e.length<=12?e:`${e.slice(0,6)}...${e.slice(-4)}`}const qr={symbol:"ETH",decimals:18};async function ht(e,t,n){if(t.toLowerCase()===z)return{address:z,symbol:n.symbol,decimals:n.decimals};const[a,r]=await Promise.all([e.readContract({address:t,abi:pr,functionName:"symbol"}).catch(()=>null),e.readContract({address:t,abi:pr,functionName:"decimals"}).catch(()=>null)]);return{address:t,symbol:a??qu(t),decimals:r===null?null:Number(r)}}async function Gr(e,t,n){if(!t.lpLocker)return[];if(t.lpLockerTokenIds)return t.lpLockerTokenIds;if(t.lpLockerFromBlock===void 0)return[];const a=await e.getBlockNumber();return(await Ft(e,t.lpLocker,{fromBlock:t.lpLockerFromBlock,toBlock:a},n)).map(r=>r.tokenId)}async function Gu(e,t,n,a={}){const r=a.native??qr,i=a.lp??{};if(i.poolType==="bin"){const[f,p]=await Promise.all([uu(e,i.binLpLocker,n),mt(e)]),m=Date.now(),y=f.locks[0],[h,g]=await Promise.all([ht(e,y?.currency0??z,r),ht(e,y?.currency1??z,r)]);return{summary:Fn({poolId:n,currency0:h.address,currency1:g.address,pool:null,locks:[]}),bin:f,currency0:h,currency1:g,chainNow:p,readAtMs:m}}const o=await Gr(e,i,n);let s,c;if(t!==null){const f=await vu(e,t,n,{lpLocker:i.lpLocker??null,lpLockerTokenIds:o});s=f,c=f.now}else{const[f,p]=await Promise.all([pu(e,i.lpLocker,n,{tokenIds:o}),mt(e)]),m=f.permanent[0];s=Fn({poolId:n,currency0:m?.currency0??z,currency1:m?.currency1??z,pool:f.pool,locks:[],permanent:f.permanent}),c=p}const l=Date.now(),[u,d]=await Promise.all([ht(e,s.currency0,r),ht(e,s.currency1,r)]);return{summary:s,bin:null,currency0:u,currency1:d,chainNow:c,readAtMs:l}}async function Wu(e,t,n,a={}){const r=a.native??qr,i=a.lp??{},o=!!i.lpLocker||!!i.binLpLocker,[s,c,l,u]=await Promise.all([t===null?Promise.resolve(null):Bu(e,t,n),ht(e,n,r),mt(e),o?(async()=>{const d=await Gr(e,i),[f,p]=await Promise.all([i.lpLocker?du(e,i.lpLocker,d):Promise.resolve([]),i.binLpLocker?zr(e,i.binLpLocker).then(m=>m.locks):Promise.resolve([])]);return lu(n,f,p)})():Promise.resolve(null)]);return{summary:s,permanent:u,token:c,chainNow:s?.now??l,readAtMs:Date.now()}}function Vu(e,t,n={}){const a=e.replace(/\/+$/,""),r=`/${(n.pathBase??"/app/locks").replace(/^\/+|\/+$/g,"")}`,i=n.query?`?${n.query.replace(/^\?/,"")}`:"";return t.kind==="pool"?`${a}${r}/pool/${t.poolId??""}${i}`:`${a}${r}/token/${t.token??""}${i}`}function De(e){const t=Math.floor(e/100),n=e%100;return n===0?`${t}%`:`${t}.${String(n).padStart(2,"0")}%`}function Ku(e){if(e<=0n)return"now";const t=Number(e),n=Math.floor(t/86400),a=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),i=t%60,o=s=>String(s).padStart(2,"0");return n>=365?`${Math.floor(n/365)}y ${n%365}d`:n>0?`${n}d ${o(a)}h ${o(r)}m`:a>0?`${a}h ${o(r)}m ${o(i)}s`:`${r}m ${o(i)}s`}function On(e){return`${new Date(Number(e)*1e3).toISOString().replace("T"," ").slice(0,16)} UTC`}function Nt(e,t,n=6){if(t.decimals===null)return`${e.toLocaleString("en-US")} base units ${t.symbol}`;if(e===0n)return`0 ${t.symbol}`;const a=10n**BigInt(t.decimals),r=e/a,i=(e%a).toString().padStart(t.decimals,"0").slice(0,n).replace(/0+$/,"");return r===0n&&i===""?`<0.${"0".repeat(Math.max(0,n-1))}1 ${t.symbol}`:`${r.toLocaleString("en-US")}${i===""?"":`.${i}`} ${t.symbol}`}const Dt=(e,t,n)=>`${e.toLocaleString("en-US")} ${e===1?t:n}`;function Xu(e){const t=e.permanent??[],n=t.length>0;if(e.locks.length===0&&!n)return{tone:"none",headline:"No locked liquidity",detail:"No position in this pool is time-locked (LatchPositionLock) or held permanently by the protocol's LP locker.",countdownTo:null,countdownLabel:null};if(e.lockedCount===0&&!n){const i=e.liveCount;return{tone:"open",headline:"No time-locked positions now",detail:i>0?`${Dt(i,"lock is","locks are")} past the unlock date and can be withdrawn by the lock owner.`:"Every lock on this pool has been withdrawn.",countdownTo:null,countdownLabel:null}}const a=e.lockedActiveBps===null?n&&e.lockedCount===0?"Locked permanently (LP locker) · share of active liquidity not measurable":`${Dt(e.lockedCount+t.length,"locked position","locked positions")} · share of active liquidity not measurable`:`${De(e.lockedActiveBps)} of active liquidity locked`,r=[];if(e.lockedActiveBps===null)r.push(e.pool===null?"The pool's state could not be read.":"The pool has no liquidity at the current price, so no share can be measured.");else{const i=[];n&&i.push(`${De(e.permanentActiveBps??0)} locked permanently (LP locker, no withdraw path)`),e.lockedCount>0&&i.push(`${De(e.timeLockedActiveBps??0)} time-locked until a date`),r.push(`${i.join(", ")}. The share is of liquidity at the current price and moves with it.`);const o=e.outOfRangeLocked+(e.permanentOutOfRange??0);o>0&&r.push(`${Dt(o,"locked position is","locked positions are")} out of range and not counted.`)}return e.lastUnlockAt!==null&&e.nextUnlockAt!==null&&e.lastUnlockAt!==e.nextUnlockAt&&r.push(`Last time-lock unlock ${On(e.lastUnlockAt)}.`),{tone:"locked",headline:a,detail:r.join(" "),countdownTo:e.nextUnlockAt,countdownLabel:e.nextUnlockAt===null?null:`first time-lock unlock ${On(e.nextUnlockAt)}`}}function Zu(e,t,n){if(e.locks.length===0)return{tone:"none",headline:"No locked liquidity",detail:"The protocol's Bin LP locker holds nothing in this pool. Time locks cover CL positions only.",countdownTo:null,countdownLabel:null};const a=`${Nt(e.amount0,t)} + ${Nt(e.amount1,n)}`,r=e.locks.reduce((i,o)=>i+o.bins.length,0);return{tone:"locked",headline:e.activeBinLockedBps===null?"Locked permanently (LP locker)":`${De(e.activeBinLockedBps)} of the active bin locked permanently (LP locker)`,detail:`${a} held forever by the Bin LP locker across ${Dt(r,"bin","bins")}.${e.activeBinLockedBps===null?" No lock holds the bin that trades at the current price.":" The share is of the bin that trades at the current price; a pool-wide share across all bins is not computed."}`,countdownTo:null,countdownLabel:null}}function Yu(e,t,n){return e+BigInt(Math.max(0,Math.floor((n-t)/1e3)))}function Ju(e){return e.bin!==null?Zu(e.bin,e.currency0,e.currency1):Xu(e.summary)}function Qu(e){const t=e.summary,n=e.token,a=e.permanent!==null&&e.permanent.pools.length>0?e.permanent:null,r=t?.totalSupply??null,i=a===null?null:`${Nt(a.total,n)}${r!==null&&r>0n?` (${De(Number(a.total*10000n/r))} of supply)`:""} locked permanently as liquidity (LP locker)`;if(t!==null&&t.unvested>0n){const o=t.unvestedBps===null?`${Nt(t.unvested,n)} locked`:t.unvestedBps===0?"<0.01% of supply locked":`${De(t.unvestedBps)} of supply locked`,s=[`Not yet vested in ${t.locks.length===1?"1 Latch token lock":`${t.locks.length.toLocaleString("en-US")} Latch token locks`}.`];return i!==null&&s.push(`${i}.`),{tone:"locked",headline:o,detail:s.join(" "),countdownTo:t.nextCliffOrEnd,countdownLabel:t.nextCliffOrEnd===null?null:`next release ${On(t.nextCliffOrEnd)}`}}return i!==null?{tone:"locked",headline:"Liquidity locked permanently (LP locker)",detail:`${i}.`,countdownTo:null,countdownLabel:null}:t!==null&&t.locks.length>0?{tone:"open",headline:`No ${n.symbol} locked now`,detail:"Every Latch token lock of it has fully vested.",countdownTo:null,countdownLabel:null}:{tone:"none",headline:`No ${n.symbol} locked`,detail:"No Latch token lock or LP-locker liquidity holds it.",countdownTo:null,countdownLabel:null}}function el(e,t,n){if(n<=0n)throw new RangeError("window size must be positive");const a=[];for(let r=e;r<=t;r+=n)a.push({from:r,to:r+n-1n>t?t:r+n-1n});return a}async function tl(e,t,n,a){const r=n.toBlock??await e.getBlockNumber(),i=n.minWindow??2000n,o=new Set,s=[],c=async(l,u)=>{try{const d=await Ft(e,t,{fromBlock:l,toBlock:u},a);for(const f of d){const p=f.tokenId.toString();o.has(p)||(o.add(p),s.push(f.tokenId))}}catch(d){const f=u-l+1n;if(f<=i)throw d;const p=l+f/2n;await c(l,p-1n),await c(p,u)}};for(const l of el(n.fromBlock,r,n.window??500000n))await c(l.from,l.to);return s}const nl=`
|
|
40
|
+
.latch-widget {
|
|
41
|
+
/* Palette */
|
|
42
|
+
--latch-bg: #ffffff;
|
|
43
|
+
--latch-bg-elevated: #f6f7f9;
|
|
44
|
+
--latch-bg-sunken: #eceef2;
|
|
45
|
+
--latch-border: #dfe3e8;
|
|
46
|
+
--latch-border-strong: #c4cad3;
|
|
47
|
+
--latch-text: #10131a;
|
|
48
|
+
--latch-text-muted: #5c6472;
|
|
49
|
+
--latch-text-inverted: #ffffff;
|
|
50
|
+
--latch-accent: #3b5bdb;
|
|
51
|
+
--latch-accent-hover: #2f49b2;
|
|
52
|
+
--latch-accent-text: #ffffff;
|
|
53
|
+
--latch-success: #157347;
|
|
54
|
+
--latch-warning: #9a6700;
|
|
55
|
+
--latch-warning-bg: #fff8e1;
|
|
56
|
+
--latch-danger: #b42318;
|
|
57
|
+
--latch-danger-bg: #fef3f2;
|
|
58
|
+
--latch-focus: #3b5bdb;
|
|
59
|
+
/* The compact swap's Buy side: the CVD-safe "up" colour, with a dark label (6:1). */
|
|
60
|
+
--latch-buy: #1f9e89;
|
|
61
|
+
--latch-buy-hover: #23b39b;
|
|
62
|
+
--latch-buy-text: #04060c;
|
|
63
|
+
|
|
64
|
+
/* Shape and type */
|
|
65
|
+
--latch-radius: 14px;
|
|
66
|
+
--latch-radius-sm: 9px;
|
|
67
|
+
--latch-font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
68
|
+
--latch-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
|
69
|
+
--latch-font-size: 14px;
|
|
70
|
+
--latch-font-size-sm: 12px;
|
|
71
|
+
--latch-font-size-lg: 22px;
|
|
72
|
+
--latch-gap: 12px;
|
|
73
|
+
--latch-padding: 16px;
|
|
74
|
+
--latch-control-height: 44px;
|
|
75
|
+
--latch-shadow: 0 1px 2px rgba(16, 19, 26, 0.06), 0 8px 24px rgba(16, 19, 26, 0.06);
|
|
76
|
+
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
gap: var(--latch-gap);
|
|
81
|
+
width: 100%;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
max-width: 480px;
|
|
84
|
+
padding: var(--latch-padding);
|
|
85
|
+
background: var(--latch-bg);
|
|
86
|
+
color: var(--latch-text);
|
|
87
|
+
border: 1px solid var(--latch-border);
|
|
88
|
+
border-radius: var(--latch-radius);
|
|
89
|
+
box-shadow: var(--latch-shadow);
|
|
90
|
+
font-family: var(--latch-font);
|
|
91
|
+
font-size: var(--latch-font-size);
|
|
92
|
+
line-height: 1.45;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.latch-widget *,
|
|
96
|
+
.latch-widget *::before,
|
|
97
|
+
.latch-widget *::after {
|
|
98
|
+
box-sizing: inherit;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Text takes the WIDGET's ink, not the host page's. A host rule such as
|
|
102
|
+
\`h2 { color: var(--ink) }\` otherwise beats inheritance: a dark-themed widget
|
|
103
|
+
on a light page drew its title in the page's near-black on the widget's
|
|
104
|
+
near-black (1.1:1, axe, the locker embed 2026-09-26). Specificity (0,1,0)
|
|
105
|
+
beats any element selector; every widget class rule below comes later and
|
|
106
|
+
still sets its own colour. A host's own content in a slot is left alone. */
|
|
107
|
+
.latch-widget :where(h1, h2, h3, h4, h5, h6, p, label, legend, dt, dd, li, th, td, figcaption, caption):where(:not(.latch-slot *)) {
|
|
108
|
+
color: inherit;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.latch-widget[data-latch-theme="dark"] {
|
|
112
|
+
--latch-bg: #14161b;
|
|
113
|
+
--latch-bg-elevated: #1c1f26;
|
|
114
|
+
--latch-bg-sunken: #23262f;
|
|
115
|
+
--latch-border: #2b2f38;
|
|
116
|
+
--latch-border-strong: #3d4350;
|
|
117
|
+
--latch-text: #f2f4f8;
|
|
118
|
+
--latch-text-muted: #98a1b1;
|
|
119
|
+
--latch-text-inverted: #14161b;
|
|
120
|
+
--latch-accent: #6b8afd;
|
|
121
|
+
--latch-accent-hover: #849dff;
|
|
122
|
+
--latch-accent-text: #0b0d12;
|
|
123
|
+
--latch-success: #4ade80;
|
|
124
|
+
--latch-warning: #fbbf5c;
|
|
125
|
+
--latch-warning-bg: #33280f;
|
|
126
|
+
--latch-danger: #ff8a80;
|
|
127
|
+
--latch-danger-bg: #3a1a17;
|
|
128
|
+
--latch-focus: #849dff;
|
|
129
|
+
--latch-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media (prefers-color-scheme: dark) {
|
|
133
|
+
.latch-widget[data-latch-theme="system"] {
|
|
134
|
+
--latch-bg: #14161b;
|
|
135
|
+
--latch-bg-elevated: #1c1f26;
|
|
136
|
+
--latch-bg-sunken: #23262f;
|
|
137
|
+
--latch-border: #2b2f38;
|
|
138
|
+
--latch-border-strong: #3d4350;
|
|
139
|
+
--latch-text: #f2f4f8;
|
|
140
|
+
--latch-text-muted: #98a1b1;
|
|
141
|
+
--latch-text-inverted: #14161b;
|
|
142
|
+
--latch-accent: #6b8afd;
|
|
143
|
+
--latch-accent-hover: #849dff;
|
|
144
|
+
--latch-accent-text: #0b0d12;
|
|
145
|
+
--latch-success: #4ade80;
|
|
146
|
+
--latch-warning: #fbbf5c;
|
|
147
|
+
--latch-warning-bg: #33280f;
|
|
148
|
+
--latch-danger: #ff8a80;
|
|
149
|
+
--latch-danger-bg: #3a1a17;
|
|
150
|
+
--latch-focus: #849dff;
|
|
151
|
+
--latch-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.latch-header {
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: baseline;
|
|
158
|
+
justify-content: space-between;
|
|
159
|
+
gap: 8px;
|
|
160
|
+
flex-wrap: wrap;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.latch-title {
|
|
164
|
+
margin: 0;
|
|
165
|
+
font-size: 16px;
|
|
166
|
+
font-weight: 650;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.latch-subtitle {
|
|
170
|
+
margin: 0;
|
|
171
|
+
color: var(--latch-text-muted);
|
|
172
|
+
font-size: var(--latch-font-size-sm);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.latch-mock-banner {
|
|
176
|
+
display: flex;
|
|
177
|
+
gap: 8px;
|
|
178
|
+
align-items: flex-start;
|
|
179
|
+
padding: 10px 12px;
|
|
180
|
+
border: 1px solid var(--latch-warning);
|
|
181
|
+
border-radius: var(--latch-radius-sm);
|
|
182
|
+
background: var(--latch-warning-bg);
|
|
183
|
+
color: var(--latch-warning);
|
|
184
|
+
font-size: var(--latch-font-size-sm);
|
|
185
|
+
font-weight: 600;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.latch-mock-banner span {
|
|
189
|
+
font-weight: 500;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.latch-field {
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
gap: 6px;
|
|
196
|
+
padding: 12px;
|
|
197
|
+
background: var(--latch-bg-elevated);
|
|
198
|
+
border: 1px solid var(--latch-border);
|
|
199
|
+
border-radius: var(--latch-radius-sm);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.latch-field-row {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
gap: 8px;
|
|
206
|
+
flex-wrap: wrap;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.latch-label {
|
|
210
|
+
display: block;
|
|
211
|
+
color: var(--latch-text-muted);
|
|
212
|
+
font-size: var(--latch-font-size-sm);
|
|
213
|
+
font-weight: 600;
|
|
214
|
+
letter-spacing: 0.01em;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.latch-amount-input {
|
|
218
|
+
flex: 1 1 120px;
|
|
219
|
+
min-width: 0;
|
|
220
|
+
padding: 0;
|
|
221
|
+
border: 0;
|
|
222
|
+
background: transparent;
|
|
223
|
+
color: var(--latch-text);
|
|
224
|
+
font-family: var(--latch-font);
|
|
225
|
+
font-size: var(--latch-font-size-lg);
|
|
226
|
+
font-weight: 600;
|
|
227
|
+
line-height: 1.2;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.latch-amount-input::placeholder {
|
|
231
|
+
color: var(--latch-text-muted);
|
|
232
|
+
font-weight: 500;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.latch-amount-input:focus-visible,
|
|
236
|
+
.latch-select:focus-visible,
|
|
237
|
+
.latch-button:focus-visible,
|
|
238
|
+
.latch-icon-button:focus-visible,
|
|
239
|
+
.latch-slider:focus-visible,
|
|
240
|
+
.latch-chip:focus-visible {
|
|
241
|
+
outline: 2px solid var(--latch-focus);
|
|
242
|
+
outline-offset: 2px;
|
|
243
|
+
border-radius: 4px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.latch-select {
|
|
247
|
+
flex: 0 1 auto;
|
|
248
|
+
max-width: 100%;
|
|
249
|
+
height: 34px;
|
|
250
|
+
padding: 0 8px;
|
|
251
|
+
background: var(--latch-bg);
|
|
252
|
+
color: var(--latch-text);
|
|
253
|
+
border: 1px solid var(--latch-border-strong);
|
|
254
|
+
border-radius: 999px;
|
|
255
|
+
font-family: inherit;
|
|
256
|
+
font-size: var(--latch-font-size);
|
|
257
|
+
font-weight: 600;
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.latch-meta {
|
|
262
|
+
display: flex;
|
|
263
|
+
justify-content: space-between;
|
|
264
|
+
gap: 8px;
|
|
265
|
+
color: var(--latch-text-muted);
|
|
266
|
+
font-size: var(--latch-font-size-sm);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.latch-meta-value {
|
|
270
|
+
font-variant-numeric: tabular-nums;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.latch-switch-row {
|
|
274
|
+
display: flex;
|
|
275
|
+
justify-content: center;
|
|
276
|
+
margin: -6px 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.latch-icon-button {
|
|
280
|
+
display: inline-flex;
|
|
281
|
+
align-items: center;
|
|
282
|
+
justify-content: center;
|
|
283
|
+
width: 32px;
|
|
284
|
+
height: 32px;
|
|
285
|
+
padding: 0;
|
|
286
|
+
background: var(--latch-bg);
|
|
287
|
+
color: var(--latch-text);
|
|
288
|
+
border: 1px solid var(--latch-border-strong);
|
|
289
|
+
border-radius: 999px;
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
font-size: 15px;
|
|
292
|
+
line-height: 1;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.latch-icon-button:hover {
|
|
296
|
+
background: var(--latch-bg-sunken);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.latch-summary {
|
|
300
|
+
display: flex;
|
|
301
|
+
flex-direction: column;
|
|
302
|
+
gap: 6px;
|
|
303
|
+
padding: 12px;
|
|
304
|
+
background: var(--latch-bg-sunken);
|
|
305
|
+
border-radius: var(--latch-radius-sm);
|
|
306
|
+
font-size: var(--latch-font-size-sm);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.latch-summary dl {
|
|
310
|
+
display: flex;
|
|
311
|
+
flex-direction: column;
|
|
312
|
+
gap: 6px;
|
|
313
|
+
margin: 0;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.latch-summary-row {
|
|
317
|
+
display: flex;
|
|
318
|
+
align-items: baseline;
|
|
319
|
+
justify-content: space-between;
|
|
320
|
+
gap: 10px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.latch-summary-row dt {
|
|
324
|
+
color: var(--latch-text-muted);
|
|
325
|
+
min-width: 0;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.latch-summary-row dd {
|
|
329
|
+
margin: 0;
|
|
330
|
+
text-align: right;
|
|
331
|
+
font-variant-numeric: tabular-nums;
|
|
332
|
+
overflow-wrap: anywhere;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.latch-summary-row[data-latch-emphasis="fee"] dd {
|
|
336
|
+
color: var(--latch-accent);
|
|
337
|
+
font-weight: 650;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.latch-summary-row[data-latch-severity="high"] dd,
|
|
341
|
+
.latch-summary-row[data-latch-severity="severe"] dd {
|
|
342
|
+
color: var(--latch-danger);
|
|
343
|
+
font-weight: 650;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.latch-route {
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-wrap: wrap;
|
|
349
|
+
align-items: center;
|
|
350
|
+
gap: 4px;
|
|
351
|
+
font-size: var(--latch-font-size-sm);
|
|
352
|
+
color: var(--latch-text-muted);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.latch-route-token {
|
|
356
|
+
padding: 2px 8px;
|
|
357
|
+
background: var(--latch-bg);
|
|
358
|
+
border: 1px solid var(--latch-border);
|
|
359
|
+
border-radius: 999px;
|
|
360
|
+
color: var(--latch-text);
|
|
361
|
+
font-weight: 600;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.latch-button {
|
|
365
|
+
display: inline-flex;
|
|
366
|
+
align-items: center;
|
|
367
|
+
justify-content: center;
|
|
368
|
+
gap: 8px;
|
|
369
|
+
width: 100%;
|
|
370
|
+
min-height: var(--latch-control-height);
|
|
371
|
+
padding: 0 16px;
|
|
372
|
+
background: var(--latch-accent);
|
|
373
|
+
color: var(--latch-accent-text);
|
|
374
|
+
border: 1px solid transparent;
|
|
375
|
+
border-radius: var(--latch-radius-sm);
|
|
376
|
+
font-family: inherit;
|
|
377
|
+
font-size: 15px;
|
|
378
|
+
font-weight: 650;
|
|
379
|
+
cursor: pointer;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.latch-button:hover:not(:disabled) {
|
|
383
|
+
background: var(--latch-accent-hover);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.latch-button:disabled {
|
|
387
|
+
opacity: 0.55;
|
|
388
|
+
cursor: not-allowed;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.latch-button[data-latch-variant="secondary"] {
|
|
392
|
+
background: var(--latch-bg-elevated);
|
|
393
|
+
color: var(--latch-text);
|
|
394
|
+
border-color: var(--latch-border-strong);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.latch-button[data-latch-variant="danger"] {
|
|
398
|
+
background: var(--latch-danger);
|
|
399
|
+
color: var(--latch-text-inverted);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.latch-status {
|
|
403
|
+
min-height: 18px;
|
|
404
|
+
margin: 0;
|
|
405
|
+
font-size: var(--latch-font-size-sm);
|
|
406
|
+
color: var(--latch-text-muted);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.latch-status[data-latch-tone="error"] {
|
|
410
|
+
color: var(--latch-danger);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.latch-status[data-latch-tone="success"] {
|
|
414
|
+
color: var(--latch-success);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.latch-error {
|
|
418
|
+
padding: 10px 12px;
|
|
419
|
+
background: var(--latch-danger-bg);
|
|
420
|
+
border: 1px solid var(--latch-danger);
|
|
421
|
+
border-radius: var(--latch-radius-sm);
|
|
422
|
+
color: var(--latch-danger);
|
|
423
|
+
font-size: var(--latch-font-size-sm);
|
|
424
|
+
overflow-wrap: anywhere;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.latch-tabs {
|
|
428
|
+
display: flex;
|
|
429
|
+
gap: 4px;
|
|
430
|
+
padding: 3px;
|
|
431
|
+
background: var(--latch-bg-sunken);
|
|
432
|
+
border-radius: 999px;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.latch-chip {
|
|
436
|
+
flex: 1 1 0;
|
|
437
|
+
min-width: 0;
|
|
438
|
+
padding: 7px 10px;
|
|
439
|
+
background: transparent;
|
|
440
|
+
color: var(--latch-text-muted);
|
|
441
|
+
border: 0;
|
|
442
|
+
border-radius: 999px;
|
|
443
|
+
font-family: inherit;
|
|
444
|
+
font-size: var(--latch-font-size-sm);
|
|
445
|
+
font-weight: 650;
|
|
446
|
+
cursor: pointer;
|
|
447
|
+
white-space: nowrap;
|
|
448
|
+
overflow: hidden;
|
|
449
|
+
text-overflow: ellipsis;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.latch-chip[aria-selected="true"],
|
|
453
|
+
.latch-chip[aria-pressed="true"] {
|
|
454
|
+
background: var(--latch-bg);
|
|
455
|
+
color: var(--latch-text);
|
|
456
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.latch-progress {
|
|
460
|
+
height: 8px;
|
|
461
|
+
background: var(--latch-bg-sunken);
|
|
462
|
+
border-radius: 999px;
|
|
463
|
+
overflow: hidden;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.latch-progress-fill {
|
|
467
|
+
height: 100%;
|
|
468
|
+
background: var(--latch-accent);
|
|
469
|
+
border-radius: 999px;
|
|
470
|
+
transition: width 200ms ease;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.latch-slider {
|
|
474
|
+
width: 100%;
|
|
475
|
+
accent-color: var(--latch-accent);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.latch-range-grid {
|
|
479
|
+
display: grid;
|
|
480
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
481
|
+
gap: 8px;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.latch-range-grid input {
|
|
485
|
+
width: 100%;
|
|
486
|
+
min-width: 0;
|
|
487
|
+
height: 36px;
|
|
488
|
+
padding: 0 10px;
|
|
489
|
+
background: var(--latch-bg);
|
|
490
|
+
color: var(--latch-text);
|
|
491
|
+
border: 1px solid var(--latch-border-strong);
|
|
492
|
+
border-radius: var(--latch-radius-sm);
|
|
493
|
+
font-family: var(--latch-font-mono);
|
|
494
|
+
font-size: var(--latch-font-size);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.latch-curve {
|
|
498
|
+
display: block;
|
|
499
|
+
width: 100%;
|
|
500
|
+
height: auto;
|
|
501
|
+
border-radius: var(--latch-radius-sm);
|
|
502
|
+
background: var(--latch-bg-sunken);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.latch-visually-hidden {
|
|
506
|
+
position: absolute;
|
|
507
|
+
width: 1px;
|
|
508
|
+
height: 1px;
|
|
509
|
+
margin: -1px;
|
|
510
|
+
padding: 0;
|
|
511
|
+
border: 0;
|
|
512
|
+
clip: rect(0 0 0 0);
|
|
513
|
+
clip-path: inset(50%);
|
|
514
|
+
overflow: hidden;
|
|
515
|
+
white-space: nowrap;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.latch-footer {
|
|
519
|
+
display: flex;
|
|
520
|
+
justify-content: space-between;
|
|
521
|
+
gap: 8px;
|
|
522
|
+
color: var(--latch-text-muted);
|
|
523
|
+
font-size: 11px;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.latch-footer a {
|
|
527
|
+
color: inherit;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.latch-launch-legs {
|
|
531
|
+
display: grid;
|
|
532
|
+
gap: 16px;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.latch-empty {
|
|
536
|
+
margin: 0;
|
|
537
|
+
color: var(--latch-text-muted);
|
|
538
|
+
font-size: 13px;
|
|
539
|
+
line-height: 1.5;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
@media (max-width: 380px) {
|
|
543
|
+
.latch-widget {
|
|
544
|
+
--latch-padding: 12px;
|
|
545
|
+
--latch-font-size-lg: 20px;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.latch-range-grid {
|
|
549
|
+
grid-template-columns: minmax(0, 1fr);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
@media (prefers-reduced-motion: reduce) {
|
|
554
|
+
.latch-progress-fill {
|
|
555
|
+
transition: none;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/* ============================================================================
|
|
560
|
+
Swap surface (SwapWidget): panels, big inputs, token buttons, dialog,
|
|
561
|
+
popover, CTA, details. Every colour is a --latch-* token above.
|
|
562
|
+
============================================================================ */
|
|
563
|
+
|
|
564
|
+
.latch-swap { max-width: 480px; }
|
|
565
|
+
.latch-swap__form { display: flex; flex-direction: column; gap: 4px; }
|
|
566
|
+
|
|
567
|
+
.latch-panel {
|
|
568
|
+
background: var(--latch-bg-elevated);
|
|
569
|
+
border: 1px solid transparent;
|
|
570
|
+
border-radius: var(--latch-radius);
|
|
571
|
+
padding: 14px 16px 12px;
|
|
572
|
+
transition: border-color 120ms ease, background 120ms ease;
|
|
573
|
+
}
|
|
574
|
+
.latch-panel:focus-within { border-color: var(--latch-border-strong); background: var(--latch-bg); }
|
|
575
|
+
/* The amount field draws no outline of its own (it is the panel's big number), so the PANEL carries
|
|
576
|
+
the keyboard focus ring; the border-strong change alone was invisible on a dark theme (WCAG 2.4.7). */
|
|
577
|
+
.latch-panel:has(.latch-big-input:focus-visible) { border-color: var(--latch-focus); box-shadow: 0 0 0 1px var(--latch-focus); }
|
|
578
|
+
.latch-panel__top { display: flex; justify-content: space-between; align-items: center; min-height: 18px; }
|
|
579
|
+
.latch-panel__balance { font-size: var(--latch-font-size-sm); color: var(--latch-text-muted); display: inline-flex; gap: 8px; align-items: center; }
|
|
580
|
+
/* Quick amounts under "You pay": real fractions of the balance just read, one row of equal chips. */
|
|
581
|
+
.latch-portions { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 8px; margin-top: 12px; }
|
|
582
|
+
.latch-portion {
|
|
583
|
+
font: inherit; font-size: var(--latch-font-size-sm); font-weight: 600; min-height: 36px; padding: 0 8px; border-radius: var(--latch-radius-sm);
|
|
584
|
+
border: 1px solid var(--latch-border); background: var(--latch-bg); color: var(--latch-text); cursor: pointer;
|
|
585
|
+
transition: border-color 120ms, color 120ms;
|
|
586
|
+
}
|
|
587
|
+
.latch-portion:hover { border-color: var(--latch-accent); color: var(--latch-accent); }
|
|
588
|
+
.latch-portion:focus-visible { outline: 2px solid var(--latch-focus); outline-offset: 2px; }
|
|
589
|
+
|
|
590
|
+
/* The compact variant's Buy / Sell pill, in the header where the title was. */
|
|
591
|
+
.latch-sides {
|
|
592
|
+
flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; min-width: 0;
|
|
593
|
+
border: 1px solid var(--latch-border); border-radius: 999px; background: var(--latch-bg-sunken);
|
|
594
|
+
}
|
|
595
|
+
.latch-sides__btn {
|
|
596
|
+
min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--latch-text);
|
|
597
|
+
font: inherit; font-weight: 600; cursor: pointer; transition: background 120ms, color 120ms;
|
|
598
|
+
}
|
|
599
|
+
.latch-sides__btn:hover { background: var(--latch-bg-elevated); }
|
|
600
|
+
.latch-sides__btn:focus-visible { outline: 2px solid var(--latch-focus); outline-offset: 2px; }
|
|
601
|
+
.latch-sides__btn[data-latch-side="buy"][aria-pressed="true"] { background: var(--latch-buy); color: var(--latch-buy-text); }
|
|
602
|
+
.latch-sides__btn[data-latch-side="sell"][aria-pressed="true"] { background: var(--latch-accent); color: var(--latch-accent-text); }
|
|
603
|
+
.latch-swap .latch-header:has(.latch-sides) { align-items: center; flex-wrap: nowrap; }
|
|
604
|
+
|
|
605
|
+
/* The compact variant's lines, always visible above the button, one fee per line. */
|
|
606
|
+
.latch-lines { margin: 8px 0 0; padding: 4px 4px 0; display: grid; gap: 8px; }
|
|
607
|
+
.latch-lines .latch-details__row { font-size: 13px; }
|
|
608
|
+
.latch-lines output { font: inherit; transition: opacity 150ms; }
|
|
609
|
+
.latch-lines output.is-refreshing { opacity: 0.55; }
|
|
610
|
+
.latch-swap__form[data-latch-variant="compact"][data-latch-swap-side="buy"] .latch-cta { background: var(--latch-buy); color: var(--latch-buy-text); }
|
|
611
|
+
.latch-swap__form[data-latch-variant="compact"][data-latch-swap-side="buy"] .latch-cta:hover:not(:disabled) { background: var(--latch-buy-hover); }
|
|
612
|
+
.latch-panel__main { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
|
|
613
|
+
.latch-big-input {
|
|
614
|
+
flex: 1 1 auto; min-width: 0; width: 100%;
|
|
615
|
+
font-family: var(--latch-font); font-size: 32px; font-weight: 500; letter-spacing: -0.01em;
|
|
616
|
+
background: transparent; border: 0; color: var(--latch-text); padding: 4px 0; outline: none;
|
|
617
|
+
}
|
|
618
|
+
.latch-big-input::placeholder, .latch-big-input__placeholder { color: var(--latch-text-muted); opacity: 0.7; }
|
|
619
|
+
.latch-big-input--out { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 150ms; }
|
|
620
|
+
.latch-big-input--out.is-refreshing { opacity: 0.55; }
|
|
621
|
+
.latch-panel__error { margin: 6px 0 0; font-size: var(--latch-font-size-sm); color: var(--latch-danger); }
|
|
622
|
+
.latch-panel__note { margin: 6px 0 0; font-size: var(--latch-font-size-sm); color: var(--latch-text-muted); }
|
|
623
|
+
|
|
624
|
+
.latch-token-button {
|
|
625
|
+
flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
|
|
626
|
+
padding: 6px 10px 6px 6px; border-radius: 999px; font: inherit; font-weight: 650; cursor: pointer;
|
|
627
|
+
background: var(--latch-bg); color: var(--latch-text); border: 1px solid var(--latch-border);
|
|
628
|
+
box-shadow: 0 1px 2px rgba(0,0,0,0.06); transition: border-color 120ms, transform 80ms;
|
|
629
|
+
}
|
|
630
|
+
.latch-token-button:hover { border-color: var(--latch-border-strong); }
|
|
631
|
+
.latch-token-button:active { transform: scale(0.98); }
|
|
632
|
+
.latch-token-button__chevron { color: var(--latch-text-muted); font-size: 12px; }
|
|
633
|
+
.latch-token-button--locked { cursor: default; box-shadow: none; background: var(--latch-bg-sunken); }
|
|
634
|
+
.latch-token-button--locked:hover { border-color: var(--latch-border); }
|
|
635
|
+
.latch-slot { display: block; }
|
|
636
|
+
.latch-slot--header { margin-top: -4px; }
|
|
637
|
+
.latch-token-logo { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--latch-bg-sunken); }
|
|
638
|
+
.latch-token-logo--initials {
|
|
639
|
+
display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
|
|
640
|
+
color: #fff; letter-spacing: 0.01em; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
|
|
641
|
+
background: linear-gradient(140deg, hsl(var(--latch-mono-hue, 215) 62% 52%), hsl(calc(var(--latch-mono-hue, 215) + 28) 58% 34%));
|
|
642
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.latch-flip { display: flex; justify-content: center; height: 0; position: relative; z-index: 1; }
|
|
646
|
+
.latch-flip__button {
|
|
647
|
+
position: relative; top: -16px; width: 36px; height: 36px; border-radius: 12px; cursor: pointer;
|
|
648
|
+
background: var(--latch-bg); border: 4px solid var(--latch-bg); color: var(--latch-text);
|
|
649
|
+
box-shadow: 0 0 0 1px var(--latch-border); font-size: 16px; line-height: 1;
|
|
650
|
+
display: inline-flex; align-items: center; justify-content: center; transition: transform 160ms ease, background 120ms;
|
|
651
|
+
}
|
|
652
|
+
.latch-flip__button:hover { background: var(--latch-bg-sunken); transform: rotate(180deg); }
|
|
653
|
+
|
|
654
|
+
.latch-cta {
|
|
655
|
+
margin-top: 8px; width: 100%; height: 52px; border: 0; border-radius: var(--latch-radius);
|
|
656
|
+
background: var(--latch-accent); color: var(--latch-accent-text); font: inherit; font-size: 17px; font-weight: 700;
|
|
657
|
+
cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
|
|
658
|
+
transition: background 120ms, transform 80ms, opacity 120ms;
|
|
659
|
+
}
|
|
660
|
+
.latch-cta:hover:not(:disabled) { background: var(--latch-accent-hover); }
|
|
661
|
+
.latch-cta:active:not(:disabled) { transform: scale(0.995); }
|
|
662
|
+
.latch-cta:disabled { background: var(--latch-bg-sunken); color: var(--latch-text-muted); cursor: not-allowed; }
|
|
663
|
+
.latch-cta[data-latch-busy="true"] { opacity: 0.85; cursor: progress; }
|
|
664
|
+
.latch-spinner {
|
|
665
|
+
width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
|
|
666
|
+
animation: latch-spin 0.8s linear infinite;
|
|
667
|
+
}
|
|
668
|
+
@keyframes latch-spin { to { transform: rotate(360deg); } }
|
|
669
|
+
|
|
670
|
+
.latch-ack {
|
|
671
|
+
display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; padding: 10px 12px;
|
|
672
|
+
border-radius: var(--latch-radius-sm); background: var(--latch-warning-bg); color: var(--latch-text); font-size: var(--latch-font-size-sm);
|
|
673
|
+
}
|
|
674
|
+
.latch-ack input { margin-top: 2px; }
|
|
675
|
+
|
|
676
|
+
.latch-details { margin-top: 8px; border: 1px solid var(--latch-border); border-radius: var(--latch-radius-sm); overflow: hidden; }
|
|
677
|
+
.latch-details__toggle {
|
|
678
|
+
width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
|
|
679
|
+
padding: 10px 12px; background: transparent; border: 0; font: inherit; color: var(--latch-text); cursor: pointer; text-align: left;
|
|
680
|
+
}
|
|
681
|
+
.latch-details__toggle:hover { background: var(--latch-bg-elevated); }
|
|
682
|
+
.latch-details__rate { font-weight: 600; cursor: pointer; }
|
|
683
|
+
.latch-details__hint { display: inline-flex; gap: 10px; align-items: center; color: var(--latch-text-muted); font-size: var(--latch-font-size-sm); }
|
|
684
|
+
.latch-details__list { margin: 0; padding: 4px 12px 10px; display: grid; gap: 6px; border-top: 1px solid var(--latch-border); }
|
|
685
|
+
.latch-details__row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--latch-font-size-sm); }
|
|
686
|
+
.latch-details__row dt { color: var(--latch-text-muted); }
|
|
687
|
+
.latch-details__row dd { margin: 0; text-align: right; color: var(--latch-text); overflow-wrap: anywhere; }
|
|
688
|
+
[data-latch-severity="high"] { color: var(--latch-danger) !important; }
|
|
689
|
+
[data-latch-severity="medium"] { color: var(--latch-warning) !important; }
|
|
690
|
+
|
|
691
|
+
.latch-settings-trigger { display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 0 10px; border-radius: 999px; }
|
|
692
|
+
.latch-settings-trigger__value { font-size: var(--latch-font-size-sm); font-weight: 600; }
|
|
693
|
+
|
|
694
|
+
/* Overlays. Portalled into .latch-widget, so they inherit the tokens. */
|
|
695
|
+
.latch-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(2px); animation: latch-fade 120ms ease; z-index: 50; }
|
|
696
|
+
.latch-dialog {
|
|
697
|
+
position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 51;
|
|
698
|
+
width: min(420px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 32px));
|
|
699
|
+
display: flex; flex-direction: column; gap: 10px;
|
|
700
|
+
background: var(--latch-bg); color: var(--latch-text); border: 1px solid var(--latch-border);
|
|
701
|
+
border-radius: var(--latch-radius); box-shadow: var(--latch-shadow); padding: 14px 14px 8px;
|
|
702
|
+
font-family: var(--latch-font); font-size: var(--latch-font-size); animation: latch-pop 140ms ease;
|
|
703
|
+
}
|
|
704
|
+
@keyframes latch-fade { from { opacity: 0; } }
|
|
705
|
+
@keyframes latch-pop { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } }
|
|
706
|
+
.latch-dialog__head { display: flex; justify-content: space-between; align-items: center; }
|
|
707
|
+
.latch-dialog__title { margin: 0; font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
|
|
708
|
+
.latch-dialog__count {
|
|
709
|
+
font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
|
|
710
|
+
color: var(--latch-text-muted); background: var(--latch-bg-elevated); border: 1px solid var(--latch-border);
|
|
711
|
+
}
|
|
712
|
+
.latch-search-wrap { position: relative; display: flex; align-items: center; }
|
|
713
|
+
.latch-search-wrap__icon { position: absolute; left: 14px; color: var(--latch-text-muted); pointer-events: none; }
|
|
714
|
+
.latch-search-wrap__clear {
|
|
715
|
+
position: absolute; right: 8px; width: 28px; height: 28px; border-radius: 999px; border: 0; cursor: pointer;
|
|
716
|
+
background: var(--latch-bg-sunken); color: var(--latch-text-muted); font-size: 16px; line-height: 1;
|
|
717
|
+
}
|
|
718
|
+
.latch-search-wrap__clear:hover { color: var(--latch-text); }
|
|
719
|
+
.latch-search {
|
|
720
|
+
width: 100%; font: inherit; font-size: 16px; padding: 12px 40px; border-radius: 999px;
|
|
721
|
+
border: 1px solid var(--latch-border); background: var(--latch-bg-elevated); color: var(--latch-text); outline: none;
|
|
722
|
+
transition: border-color 120ms, box-shadow 120ms;
|
|
723
|
+
}
|
|
724
|
+
.latch-search:focus { border-color: var(--latch-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--latch-accent) 22%, transparent); }
|
|
725
|
+
.latch-common { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 4px; }
|
|
726
|
+
.latch-chip--token {
|
|
727
|
+
flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 6px;
|
|
728
|
+
border-radius: 999px; border: 1px solid var(--latch-border); background: var(--latch-bg-elevated); color: var(--latch-text);
|
|
729
|
+
font-weight: 600; transition: border-color 120ms, background 120ms;
|
|
730
|
+
}
|
|
731
|
+
.latch-chip--token:hover { border-color: color-mix(in srgb, var(--latch-accent) 55%, var(--latch-border)); }
|
|
732
|
+
.latch-chip--token[aria-pressed="true"] { border-color: var(--latch-accent); background: color-mix(in srgb, var(--latch-accent) 14%, var(--latch-bg-elevated)); }
|
|
733
|
+
.latch-token-list { list-style: none; margin: 0 -14px; padding: 6px 8px 8px; overflow-y: auto; border-top: 1px solid var(--latch-border); }
|
|
734
|
+
.latch-token-row {
|
|
735
|
+
width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; min-height: 56px; background: transparent; border: 0;
|
|
736
|
+
border-radius: 12px; font: inherit; color: var(--latch-text); cursor: pointer; text-align: left; transition: background 100ms;
|
|
737
|
+
}
|
|
738
|
+
.latch-token-row:hover:not(:disabled), .latch-token-row:focus-visible { background: var(--latch-bg-elevated); outline: none; }
|
|
739
|
+
.latch-token-row:focus-visible { box-shadow: inset 0 0 0 2px var(--latch-accent); }
|
|
740
|
+
.latch-token-row[aria-selected="true"] { background: color-mix(in srgb, var(--latch-accent) 10%, transparent); }
|
|
741
|
+
.latch-token-row:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
742
|
+
.latch-token-row--note { color: var(--latch-text-muted); font-size: var(--latch-font-size-sm); cursor: default; min-height: 0; }
|
|
743
|
+
.latch-token-row--empty { justify-content: center; text-align: center; padding: 28px 16px; }
|
|
744
|
+
.latch-token-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
|
|
745
|
+
.latch-token-row__symbol { font-weight: 650; font-size: 15px; display: inline-flex; align-items: center; flex-wrap: wrap; }
|
|
746
|
+
.latch-token-row__name { font-size: var(--latch-font-size-sm); color: var(--latch-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
747
|
+
.latch-token-row__balance { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; color: var(--latch-text); font-weight: 600; }
|
|
748
|
+
.latch-token-row__balance-sym { font-size: 11px; font-weight: 500; color: var(--latch-text-muted); }
|
|
749
|
+
.latch-token-row__check { color: var(--latch-accent); font-weight: 700; font-size: 15px; margin-left: 4px; }
|
|
750
|
+
@media (prefers-reduced-motion: reduce) {
|
|
751
|
+
.latch-token-row, .latch-chip--token, .latch-search { transition: none; }
|
|
752
|
+
}
|
|
753
|
+
.latch-token-row--unlisted { background: color-mix(in srgb, var(--latch-warning) 8%, transparent); }
|
|
754
|
+
.latch-token-row__badges { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: middle; }
|
|
755
|
+
.latch-badge {
|
|
756
|
+
display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 16px; letter-spacing: 0.01em;
|
|
757
|
+
border: 1px solid var(--latch-border); background: var(--latch-bg-elevated); color: var(--latch-text-muted); white-space: nowrap;
|
|
758
|
+
}
|
|
759
|
+
.latch-badge[data-latch-tone="info"] { color: var(--latch-accent); border-color: color-mix(in srgb, var(--latch-accent) 35%, transparent); }
|
|
760
|
+
.latch-badge[data-latch-tone="warn"] { color: var(--latch-warning); border-color: color-mix(in srgb, var(--latch-warning) 45%, transparent); }
|
|
761
|
+
.latch-token-group { list-style: none; }
|
|
762
|
+
.latch-token-group__label {
|
|
763
|
+
display: block; padding: 8px 14px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
|
|
764
|
+
color: var(--latch-text-muted); border-top: 1px solid var(--latch-border);
|
|
765
|
+
}
|
|
766
|
+
.latch-token-group:first-child .latch-token-group__label { border-top: 0; }
|
|
767
|
+
.latch-token-group__list { list-style: none; margin: 0; padding: 0; }
|
|
768
|
+
|
|
769
|
+
.latch-popover {
|
|
770
|
+
z-index: 51; width: min(320px, calc(100vw - 32px)); background: var(--latch-bg); color: var(--latch-text);
|
|
771
|
+
border: 1px solid var(--latch-border); border-radius: var(--latch-radius); box-shadow: var(--latch-shadow); padding: 12px;
|
|
772
|
+
display: flex; flex-direction: column; gap: 8px; font-family: var(--latch-font); font-size: var(--latch-font-size); animation: latch-fade 120ms ease;
|
|
773
|
+
}
|
|
774
|
+
.latch-popover__row { display: flex; justify-content: space-between; align-items: center; }
|
|
775
|
+
.latch-popover__value { font-size: var(--latch-font-size-sm); color: var(--latch-text-muted); }
|
|
776
|
+
.latch-custom-slippage { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
|
|
777
|
+
.latch-custom-slippage input {
|
|
778
|
+
width: 56px; font: inherit; font-size: var(--latch-font-size-sm); padding: 6px 8px; border-radius: 999px;
|
|
779
|
+
border: 1px solid var(--latch-border); background: var(--latch-bg); color: var(--latch-text); text-align: right; outline: none;
|
|
780
|
+
}
|
|
781
|
+
.latch-custom-slippage input:focus { border-color: var(--latch-accent); }
|
|
782
|
+
.latch-note { margin: 0; font-size: var(--latch-font-size-sm); color: var(--latch-text-muted); }
|
|
783
|
+
.latch-note--warn { color: var(--latch-warning); }
|
|
784
|
+
.latch-footer--brand { justify-content: center; color: var(--latch-text-muted); font-size: 11px; }
|
|
785
|
+
.latch-footer a { color: var(--latch-accent); text-decoration: none; }
|
|
786
|
+
|
|
787
|
+
/* ============================================================================
|
|
788
|
+
Locks (LocksBadge, LocksPanel): the locked share and a countdown. Every
|
|
789
|
+
colour is a --latch-* token above.
|
|
790
|
+
============================================================================ */
|
|
791
|
+
.latch-locks { gap: 6px; }
|
|
792
|
+
.latch-locks--badge { display: inline-flex; flex-direction: column; width: auto; max-width: 100%; padding: 10px 14px; box-shadow: none; border-radius: var(--latch-radius-sm); }
|
|
793
|
+
.latch-locks--panel { max-width: none; }
|
|
794
|
+
.latch-locks__headline { margin: 0; display: flex; align-items: baseline; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
|
|
795
|
+
.latch-locks__headline--muted { color: var(--latch-text-muted); font-weight: 500; }
|
|
796
|
+
.latch-locks__headline--error { color: var(--latch-danger); font-weight: 500; }
|
|
797
|
+
.latch-locks__dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--latch-text-muted); transform: translateY(-1px); }
|
|
798
|
+
.latch-locks__dot--locked { background: var(--latch-success); }
|
|
799
|
+
.latch-locks__dot--open { background: var(--latch-warning); }
|
|
800
|
+
.latch-locks__dot--none { background: var(--latch-border-strong); }
|
|
801
|
+
.latch-locks__countdown { margin: 0; font-size: var(--latch-font-size-sm); color: var(--latch-text-muted); overflow-wrap: anywhere; }
|
|
802
|
+
.latch-locks__timer { font-family: var(--latch-font-mono); font-variant-numeric: tabular-nums; color: var(--latch-text); }
|
|
803
|
+
.latch-locks__link { font-size: var(--latch-font-size-sm); color: var(--latch-accent); text-decoration: none; font-weight: 600; }
|
|
804
|
+
.latch-locks__link:hover { text-decoration: underline; }
|
|
805
|
+
.latch-locks__link:focus-visible { outline: 2px solid var(--latch-focus); outline-offset: 2px; border-radius: 4px; }
|
|
806
|
+
.latch-locks__list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
|
|
807
|
+
.latch-locks__item { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--latch-border); border-radius: var(--latch-radius-sm); background: var(--latch-bg-elevated); min-width: 0; }
|
|
808
|
+
.latch-locks__item[data-status="withdrawn"], .latch-locks__item[data-status="claimed"] { opacity: 0.72; }
|
|
809
|
+
.latch-locks__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
|
|
810
|
+
.latch-locks__status { flex: 0 0 auto; padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
|
|
811
|
+
.latch-locks__status--locked, .latch-locks__status--cliff, .latch-locks__status--vesting { color: var(--latch-success); }
|
|
812
|
+
.latch-locks__status--unlockable, .latch-locks__status--vested { color: var(--latch-warning); }
|
|
813
|
+
.latch-locks__status--withdrawn, .latch-locks__status--claimed { color: var(--latch-text-muted); }
|
|
814
|
+
.latch-locks__status--permanent { color: var(--latch-accent, var(--latch-success)); }
|
|
815
|
+
.latch-locks__facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 12px; font-size: var(--latch-font-size-sm); }
|
|
816
|
+
.latch-locks__facts div { min-width: 0; }
|
|
817
|
+
.latch-locks__facts dt { color: var(--latch-text-muted); }
|
|
818
|
+
.latch-locks__facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
|
|
819
|
+
|
|
820
|
+
/* Lock charts (lockCharts.tsx): a locked-share bar that grows in, and a release
|
|
821
|
+
schedule that draws on. Motion off under prefers-reduced-motion. */
|
|
822
|
+
.latch-sharebar { display: grid; gap: 6px; min-width: 0; }
|
|
823
|
+
.latch-locks--badge .latch-sharebar { min-width: 180px; }
|
|
824
|
+
.latch-sharebar__track { height: 8px; border-radius: 999px; overflow: hidden; background: var(--latch-bg-sunken); }
|
|
825
|
+
.latch-sharebar__grow { display: flex; height: 100%; transform-origin: left center; animation: latch-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
|
|
826
|
+
.latch-sharebar__part { flex: 0 0 auto; height: 100%; }
|
|
827
|
+
.latch-sharebar__part + .latch-sharebar__part { box-shadow: inset 2px 0 0 var(--latch-bg); }
|
|
828
|
+
.latch-sharebar__part--permanent, .latch-sharebar__part--lp { background: var(--latch-success); }
|
|
829
|
+
.latch-sharebar__part--time, .latch-sharebar__part--unvested { background: var(--latch-accent); }
|
|
830
|
+
.latch-sharebar__part--vested { background: var(--latch-accent); opacity: 0.45; }
|
|
831
|
+
.latch-sharebar__key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 11px; color: var(--latch-text-muted); font-variant-numeric: tabular-nums; }
|
|
832
|
+
.latch-sharebar__key li { display: inline-flex; align-items: center; gap: 5px; }
|
|
833
|
+
.latch-sharebar__sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
|
|
834
|
+
.latch-spark { margin: 2px 0 0; display: grid; gap: 4px; }
|
|
835
|
+
.latch-spark__svg { display: block; width: 100%; height: 44px; overflow: visible; cursor: crosshair; border-radius: 4px; }
|
|
836
|
+
.latch-spark__svg:focus-visible { outline: 2px solid var(--latch-focus); outline-offset: 2px; }
|
|
837
|
+
.latch-spark__base { stroke: var(--latch-border); stroke-width: 1; }
|
|
838
|
+
.latch-spark__line { stroke: var(--latch-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 2000; animation: latch-draw 1.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
|
|
839
|
+
.latch-spark__now { stroke: var(--latch-text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
|
|
840
|
+
.latch-spark__cross { stroke: var(--latch-accent); stroke-width: 1; opacity: 0.6; }
|
|
841
|
+
.latch-spark__cap { font-size: 11px; color: var(--latch-text-muted); overflow-wrap: anywhere; }
|
|
842
|
+
.latch-locks .latch-progress-fill, .latch-locker .latch-progress-fill { transform-origin: left center; animation: latch-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
|
|
843
|
+
@keyframes latch-grow { from { transform: scaleX(0.02); } to { transform: scaleX(1); } }
|
|
844
|
+
@keyframes latch-draw { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }
|
|
845
|
+
@media (prefers-reduced-motion: reduce) {
|
|
846
|
+
.latch-sharebar__grow, .latch-spark__line, .latch-locks .latch-progress-fill, .latch-locker .latch-progress-fill { animation: none; transform: none; stroke-dashoffset: 0; }
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
/* ============================================================================
|
|
850
|
+
Token trust (TokenTrustPanel): labelled rows, each with its source.
|
|
851
|
+
============================================================================ */
|
|
852
|
+
.latch-trust { max-width: none; gap: 8px; }
|
|
853
|
+
.latch-trust__list { margin: 0; display: grid; gap: 0; }
|
|
854
|
+
.latch-trust__row { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 4px 14px; padding: 9px 0; border-top: 1px solid var(--latch-border); min-width: 0; }
|
|
855
|
+
.latch-trust__row:first-child { border-top: 0; }
|
|
856
|
+
@media (max-width: 520px) { .latch-trust__row { grid-template-columns: 1fr; } }
|
|
857
|
+
.latch-trust__label { color: var(--latch-text-muted); font-size: var(--latch-font-size-sm); font-weight: 600; }
|
|
858
|
+
.latch-trust__value { margin: 0; min-width: 0; display: grid; gap: 3px; }
|
|
859
|
+
.latch-trust__headline { margin: 0; display: flex; align-items: baseline; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
|
|
860
|
+
.latch-trust__detail { margin: 0; font-size: var(--latch-font-size-sm); color: var(--latch-text-muted); overflow-wrap: anywhere; }
|
|
861
|
+
.latch-trust__source { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; font-family: var(--latch-font-mono); font-size: 11px; color: var(--latch-text-muted); overflow-wrap: anywhere; }
|
|
862
|
+
.latch-trust__source a { color: inherit; text-decoration: underline; text-decoration-color: var(--latch-border-strong); }
|
|
863
|
+
.latch-trust__source a:hover { color: var(--latch-accent); }
|
|
864
|
+
.latch-trust__dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--latch-border-strong); transform: translateY(-1px); }
|
|
865
|
+
.latch-trust__dot--locked { background: var(--latch-success); }
|
|
866
|
+
.latch-trust__dot--neutral { background: var(--latch-text-muted); }
|
|
867
|
+
.latch-trust__dot--caution { background: var(--latch-warning); }
|
|
868
|
+
.latch-trust__dot--flagged, .latch-trust__dot--error { background: var(--latch-danger); }
|
|
869
|
+
.latch-trust__row[data-tone="flagged"] .latch-trust__headline, .latch-trust__row[data-tone="error"] .latch-trust__headline { color: var(--latch-danger); }
|
|
870
|
+
.latch-trust__subhead { margin: 6px 0 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--latch-text-muted); }
|
|
871
|
+
.latch-trust__pool { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--latch-border); border-radius: var(--latch-radius-sm); background: var(--latch-bg-elevated); min-width: 0; }
|
|
872
|
+
.latch-trust__pool-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
|
|
873
|
+
.latch-trust__pool-head code { font-family: var(--latch-font-mono); font-size: 11px; color: var(--latch-text-muted); }
|
|
874
|
+
.latch-trust__found { margin: 0; font-size: 11px; color: var(--latch-text-muted); }
|
|
875
|
+
.latch-trust__link { font-size: var(--latch-font-size-sm); color: var(--latch-accent); text-decoration: none; font-weight: 600; margin-left: auto; }
|
|
876
|
+
.latch-trust__link:hover { text-decoration: underline; }
|
|
877
|
+
.latch-trust__state { margin: 0; color: var(--latch-text-muted); }
|
|
878
|
+
.latch-trust__state--error { color: var(--latch-danger); }
|
|
879
|
+
.latch-trust__retry { font: inherit; background: none; border: 0; padding: 0; color: var(--latch-accent); cursor: pointer; text-decoration: underline; }
|
|
880
|
+
|
|
881
|
+
/* ============================================================================
|
|
882
|
+
Locker (LockerWidget): lock a position, lock or vest tokens, manage locks.
|
|
883
|
+
============================================================================ */
|
|
884
|
+
.latch-locker { gap: 10px; }
|
|
885
|
+
.latch-locker__tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--latch-bg-sunken); }
|
|
886
|
+
.latch-locker__tab { flex: 1; font: inherit; font-size: var(--latch-font-size-sm); font-weight: 600; padding: 7px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--latch-text-muted); cursor: pointer; }
|
|
887
|
+
.latch-locker__tab[aria-selected="true"] { background: var(--latch-bg); color: var(--latch-text); box-shadow: var(--latch-shadow); }
|
|
888
|
+
.latch-locker__field { display: grid; gap: 4px; font-size: var(--latch-font-size-sm); }
|
|
889
|
+
.latch-locker__field > span { color: var(--latch-text-muted); font-weight: 600; }
|
|
890
|
+
.latch-locker__input { width: 100%; font: inherit; padding: 10px 12px; border-radius: var(--latch-radius-sm); border: 1px solid var(--latch-border); background: var(--latch-bg-elevated); color: var(--latch-text); outline: none; min-width: 0; }
|
|
891
|
+
.latch-locker__input:focus { border-color: var(--latch-accent); }
|
|
892
|
+
.latch-locker__row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
|
|
893
|
+
@media (max-width: 420px) { .latch-locker__row2 { grid-template-columns: 1fr; } }
|
|
894
|
+
.latch-locker__issues { margin: 0; padding-left: 18px; color: var(--latch-danger); font-size: var(--latch-font-size-sm); }
|
|
895
|
+
.latch-locker__fee { margin: 0; padding: 8px 10px; border-radius: var(--latch-radius-sm); background: var(--latch-bg-elevated); font-size: var(--latch-font-size-sm); display: grid; gap: 2px; }
|
|
896
|
+
.latch-locker__fee strong { font-variant-numeric: tabular-nums; }
|
|
897
|
+
.latch-locker__steps { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: var(--latch-font-size-sm); color: var(--latch-text-muted); }
|
|
898
|
+
.latch-locker__steps li[data-state="done"] { color: var(--latch-success); }
|
|
899
|
+
.latch-locker__steps li[data-state="active"] { color: var(--latch-text); font-weight: 600; }
|
|
900
|
+
.latch-locker__status { margin: 0; font-size: var(--latch-font-size-sm); overflow-wrap: anywhere; }
|
|
901
|
+
.latch-locker__status[data-kind="error"] { color: var(--latch-danger); }
|
|
902
|
+
.latch-locker__status[data-kind="success"] { color: var(--latch-success); }
|
|
903
|
+
.latch-locker__actions { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
904
|
+
.latch-locker__btn { font: inherit; font-size: var(--latch-font-size-sm); font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--latch-border-strong); background: var(--latch-bg); color: var(--latch-text); cursor: pointer; }
|
|
905
|
+
.latch-locker__btn:hover:not(:disabled) { border-color: var(--latch-accent); color: var(--latch-accent); }
|
|
906
|
+
.latch-locker__btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
907
|
+
.latch-locker__choice { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--latch-font-size-sm); }
|
|
908
|
+
.latch-locker__choice label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
|
|
909
|
+
|
|
910
|
+
/* ============================================================================
|
|
911
|
+
The Latch mark (brand kit masters/latch-mark.svg, loaded as shipped, never
|
|
912
|
+
redrawn). 24 px wide is the kit's minimum; the margin is its clear space
|
|
913
|
+
(the height of the hook's eye at this size).
|
|
914
|
+
============================================================================ */
|
|
915
|
+
.latch-brand { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; color: var(--latch-text-muted); }
|
|
916
|
+
.latch-brand__mark { flex: 0 0 auto; width: 24px; height: auto; margin: 4px; display: block; }
|
|
917
|
+
.latch-brand__spacer { flex: 1; }
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
/* ============================================================================
|
|
921
|
+
Touch (pointer: coarse): 44px targets, and inputs at 16px so iOS Safari does
|
|
922
|
+
not zoom the host page when a field is focused.
|
|
923
|
+
============================================================================ */
|
|
924
|
+
@media (pointer: coarse) {
|
|
925
|
+
.latch-widget input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
|
|
926
|
+
.latch-widget select,
|
|
927
|
+
.latch-widget textarea,
|
|
928
|
+
.latch-locker input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
|
|
929
|
+
.latch-locker select { font-size: max(16px, 1em); }
|
|
930
|
+
.latch-portion, .latch-chip, .latch-select, .latch-settings-trigger, .latch-icon-button,
|
|
931
|
+
.latch-locker__tab, .latch-locker__input, .latch-locker__btn, .latch-button, .latch-token-button { min-height: 44px; }
|
|
932
|
+
.latch-locker__choice label { min-height: 44px; }
|
|
933
|
+
}
|
|
934
|
+
`,Nn="latch-lock-badge",al=`
|
|
935
|
+
:host { display: inline-block; max-width: 100%; vertical-align: middle; }
|
|
936
|
+
.latch-embed-badge[data-latch-theme] {
|
|
937
|
+
--latch-accent: var(--latch-brand-accent, #0A63E0);
|
|
938
|
+
--latch-font: var(--latch-brand-font, "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif);
|
|
939
|
+
--latch-font-mono: var(--latch-brand-font-mono, "IBM Plex Mono", ui-monospace, monospace);
|
|
940
|
+
}
|
|
941
|
+
.latch-embed-badge[data-latch-theme="dark"] { --latch-accent: var(--latch-brand-accent, #2B8BFF); --latch-success: var(--latch-brand-success, #5FD39A); }
|
|
942
|
+
@media (prefers-color-scheme: dark) {
|
|
943
|
+
.latch-embed-badge[data-latch-theme="system"] { --latch-accent: var(--latch-brand-accent, #2B8BFF); --latch-success: var(--latch-brand-success, #5FD39A); }
|
|
944
|
+
}
|
|
945
|
+
:host([hidden]) { display: none; }
|
|
946
|
+
.latch-embed-badge { gap: 4px; }
|
|
947
|
+
.latch-embed-badge__retry { font: inherit; font-size: 11px; background: none; border: 0; padding: 0; color: var(--latch-accent); cursor: pointer; text-decoration: underline; }
|
|
948
|
+
`,rl=typeof HTMLElement>"u"?class{}:HTMLElement,Dn=new Map;function Wr(e){const t=Number(e("chain")??"");if(!Number.isInteger(t)||t<=0)return{ok:!1,message:'Set the chain attribute to a chain id, e.g. chain="4663".'};const n=e("pool"),a=e("token");if(n!==null&&n!==""){if(!/^0x[0-9a-fA-F]{64}$/.test(n))return{ok:!1,message:"The pool attribute is not a 32-byte pool id."};const r=(e("pool-type")??"cl").toLowerCase();return{ok:!0,chainId:t,target:{kind:"pool",poolId:n,poolType:r==="bin"?"bin":"cl"}}}return a!==null&&a!==""?X(a,{strict:!1})?{ok:!0,chainId:t,target:{kind:"token",token:a}}:{ok:!1,message:"The token attribute is not an address."}:{ok:!1,message:"Set a pool or a token attribute."}}class Vr extends rl{constructor(){super(...arguments);se(this,M);se(this,le,null);se(this,Re,null);se(this,re,{k:"loading"});se(this,ze,0);se(this,ve,null);se(this,ke,null);se(this,je,null)}static get observedAttributes(){return["chain","pool","token","pool-type","rpc","site","theme","refresh"]}connectedCallback(){if(_(this,le)===null){H(this,le,this.attachShadow({mode:"open"}));const n=document.createElement("style");n.textContent=`${nl}
|
|
949
|
+
${al}`,_(this,le).appendChild(n),H(this,Re,document.createElement("div")),_(this,le).appendChild(_(this,Re))}$(this,M,jt).call(this)}disconnectedCallback(){$(this,M,qn).call(this),H(this,ze,_(this,ze)+1)}attributeChangedCallback(){_(this,le)!==null&&this.isConnected&&$(this,M,jt).call(this)}}le=new WeakMap,Re=new WeakMap,re=new WeakMap,ze=new WeakMap,ve=new WeakMap,ke=new WeakMap,je=new WeakMap,M=new WeakSet,qn=function(){_(this,ve)!==null&&clearInterval(_(this,ve)),_(this,ke)!==null&&clearInterval(_(this,ke)),H(this,ve,null),H(this,ke,null)},jt=function(){$(this,M,qn).call(this),H(this,re,{k:"loading"}),$(this,M,Ut).call(this),$(this,M,Gn).call(this);const n=Number(this.getAttribute("refresh")??"60");Number.isFinite(n)&&n>0&&H(this,ve,setInterval(()=>void $(this,M,Gn).call(this),Math.max(15,n)*1e3)),H(this,ke,setInterval(()=>{_(this,re).k==="ready"&&_(this,re).view.countdownTo!==null&&$(this,M,Ut).call(this)},1e3))},Jr=function(n){const a=this.getAttribute("rpc"),r=`${n}|${a??""}`;if(_(this,je)?.key===r)return _(this,je).client;const i=a!==null&&a.trim()!==""?_r(a.trim()):Hu(n),o=Ic({transport:i}),s={...o,readContract:c=>xc(o,c),getBlock:c=>Vs(o,c),getBlockNumber:c=>Ac(o,c),getLogs:c=>Ys(o,c)};return H(this,je,{key:r,client:s}),s},Gn=async function(){const n=++Yr(this,ze)._,a=Wr(u=>this.getAttribute(u));if(!a.ok)return $(this,M,Ue).call(this,n,{k:"message",tone:"error",text:a.message,retry:!1});const r=tu(a.chainId);if(r===void 0)return $(this,M,Ue).call(this,n,{k:"message",tone:"none",text:`Latch does not support chain ${a.chainId}.`,retry:!1});const i={symbol:r.nativeCurrency.symbol,decimals:r.nativeCurrency.decimals},o=r.launchpadV2.clLPLocker,s=r.launchpadV2.binLPLocker,c=a.target;if(!(c.kind==="pool"?c.poolType==="bin"?s!==null:r.positionLock!==null||o!==null:r.tokenLock!==null||o!==null||s!==null))return $(this,M,Ue).call(this,n,{k:"message",tone:"none",text:`Latch locks are coming soon on ${r.name}.`,retry:!1});try{const u=$(this,M,Jr).call(this,a.chainId);let d=[];if(o!==null&&!(c.kind==="pool"&&c.poolType==="bin")){const g=`${a.chainId}|${o.toLowerCase()}|${this.getAttribute("rpc")??""}`;let x=Dn.get(g);x===void 0&&(x=tl(u,o,{fromBlock:r.deployedAtBlock}),Dn.set(g,x),x.catch(()=>Dn.delete(g))),d=await x}const f={...o!==null?{lpLocker:o,lpLockerTokenIds:d}:{},...s!==null?{binLpLocker:s}:{}};let p,m;if(c.kind==="pool"){const g=await Gu(u,r.positionLock,c.poolId,{native:i,lp:{...f,poolType:c.poolType}});p=g,m=Ju(g)}else{const g=await Wu(u,r.tokenLock,c.token,{native:i,lp:f});p=g,m=Qu(g)}const y=this.getAttribute("site"),h=y===null||y.trim()===""?null:Vu(y.trim(),c.kind==="pool"?{kind:"pool",poolId:c.poolId}:{kind:"token",token:c.token},{pathBase:"/locks",query:`net=${r.key}`});$(this,M,Ue).call(this,n,{k:"ready",view:m,chainNow:p.chainNow,readAtMs:p.readAtMs,href:h})}catch{if(_(this,re).k==="ready")return;$(this,M,Ue).call(this,n,{k:"message",tone:"error",text:"Locks could not be read: the chain did not answer.",retry:!0})}},Ue=function(n,a){n===_(this,ze)&&(H(this,re,a),$(this,M,Ut).call(this))},Ut=function(){const n=_(this,Re);if(n===null)return;const a=this.getAttribute("theme"),r=_(this,re),i=document.createElement("div");i.className="latch-widget latch-locks latch-locks--badge latch-embed-badge",i.dataset.latchTheme=a==="light"||a==="dark"?a:"system";const o=(d,f,p)=>{const m=document.createElement("p");if(m.className=d,p!==void 0){const h=document.createElement("span");h.className=`latch-locks__dot latch-locks__dot--${p}`,h.setAttribute("aria-hidden","true"),m.appendChild(h)}const y=document.createElement("span");return y.textContent=f,m.appendChild(y),m};if(r.k==="loading")i.appendChild(o("latch-locks__headline latch-locks__headline--muted","Reading locks…")),i.setAttribute("role","status");else if(r.k==="message"){const d=o(`latch-locks__headline${r.tone==="error"?" latch-locks__headline--error":""}`,r.text,r.tone==="none"?"none":void 0);if(i.appendChild(d),r.retry){const f=document.createElement("button");f.type="button",f.className="latch-embed-badge__retry",f.textContent="Retry",f.addEventListener("click",()=>$(this,M,jt).call(this)),i.appendChild(f)}}else{const d=o("latch-locks__headline",r.view.headline,r.view.tone);if(d.title=r.view.detail??"",i.dataset.tone=r.view.tone,i.appendChild(d),r.view.countdownTo!==null){const f=Yu(r.chainNow,r.readAtMs,Date.now()),p=document.createElement("p");p.className="latch-locks__countdown";const m=document.createElement("span");m.className="latch-locks__timer",m.textContent=Ku(r.view.countdownTo-f),p.append(m,` to ${r.view.countdownLabel??"the next unlock"}`),i.appendChild(p)}}const s=document.createElement("p");s.className="latch-brand";const c=this.getAttribute("site");if(c!==null&&c.trim()!==""){const d=document.createElement("img");d.className="latch-brand__mark";const f=i.dataset.latchTheme,m=f==="light"||f==="system"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: light)").matches?"-onlight":"";d.src=`${c.trim().replace(/\/+$/,"")}/brand/masters/latch-mark${m}.svg`,d.width=665,d.height=765,d.alt="Latch",s.appendChild(d)}const l=document.createElement("span");l.textContent="Read from chain",s.appendChild(l);const u=document.createElement("span");if(u.className="latch-brand__spacer",s.appendChild(u),r.k==="ready"&&r.href!==null){const d=document.createElement("a");d.className="latch-locks__link",d.href=r.href,d.target="_blank",d.rel="noopener",d.textContent="Lock details →",s.appendChild(d)}i.appendChild(s),n.replaceChildren(i)};function Kr(){typeof customElements>"u"||customElements.get(Nn)===void 0&&customElements.define(Nn,Vr)}return Kr(),v.LOCK_BADGE_TAG=Nn,v.LatchLockBadgeElement=Vr,v.defineLatchLockBadge=Kr,v.parseLockBadgeAttributes=Wr,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),v}({});
|
|
950
|
+
//# sourceMappingURL=latch-embed.js.map
|