@pufferfinance/puffer-sdk 1.0.2 → 1.2.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.
Files changed (47) hide show
  1. package/README.md +8 -7
  2. package/dist/api/puffer-client.d.ts +16 -0
  3. package/dist/ccip-CzWPognK.js +158 -0
  4. package/dist/ccip-CzWPognK.js.map +1 -0
  5. package/dist/ccip-DNUqn1xf.cjs +2 -0
  6. package/dist/ccip-DNUqn1xf.cjs.map +1 -0
  7. package/dist/chains/constants.d.ts +2 -3
  8. package/dist/contracts/abis/holesky/PufferDepositor.d.ts +283 -0
  9. package/dist/contracts/abis/mainnet/ERC20Permit.d.ts +396 -0
  10. package/dist/contracts/abis/mainnet/PufLocker.d.ts +476 -0
  11. package/dist/contracts/abis/mainnet/PufToken.d.ts +676 -0
  12. package/dist/contracts/abis/mainnet/PufferDepositor.d.ts +283 -0
  13. package/dist/contracts/abis/mainnet/PufferL2Depositor.d.ts +351 -0
  14. package/dist/contracts/abis/puf-locker-abis.d.ts +480 -0
  15. package/dist/contracts/abis/puf-token-abis.d.ts +680 -0
  16. package/dist/contracts/abis/puffer-depositor-abis.d.ts +642 -0
  17. package/dist/contracts/abis/{abis.d.ts → puffer-vault-abis.d.ts} +3 -1367
  18. package/dist/contracts/abis/tokens-abis.d.ts +396 -0
  19. package/dist/contracts/addresses.d.ts +4 -7
  20. package/dist/contracts/handlers/erc20-permit-handler.d.ts +13705 -0
  21. package/dist/contracts/handlers/puf-locker-handler.d.ts +31064 -0
  22. package/dist/contracts/handlers/puffer-depositor-handler.d.ts +9923 -0
  23. package/dist/contracts/handlers/puffer-depositor-handler.test.d.ts +1 -0
  24. package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +22867 -0
  25. package/dist/contracts/handlers/puffer-l2-depositor-handler.test.d.ts +1 -0
  26. package/dist/contracts/tokens.d.ts +27 -0
  27. package/dist/main--Ww95s5e.cjs +41 -0
  28. package/dist/main--Ww95s5e.cjs.map +1 -0
  29. package/dist/{main-CiwlneBr.js → main-Cl9ZFxdC.js} +5939 -3509
  30. package/dist/main-Cl9ZFxdC.js.map +1 -0
  31. package/dist/main.cjs +1 -1
  32. package/dist/main.d.ts +2 -0
  33. package/dist/main.js +8 -5
  34. package/dist/utils/time.d.ts +1 -0
  35. package/package.json +12 -10
  36. package/dist/ccip-Bv7jv7p7.cjs +0 -2
  37. package/dist/ccip-Bv7jv7p7.cjs.map +0 -1
  38. package/dist/ccip-n5cHM2-q.js +0 -165
  39. package/dist/ccip-n5cHM2-q.js.map +0 -1
  40. package/dist/contracts/abis/anvil/PufferVaultV2.d.ts +0 -1361
  41. package/dist/contracts/handlers/puffer-vault-handler.d.ts +0 -79
  42. package/dist/main-CiwlneBr.js.map +0 -1
  43. package/dist/main-DY0whdxp.cjs +0 -39
  44. package/dist/main-DY0whdxp.cjs.map +0 -1
  45. /package/dist/{api/puffer-client-helpers.test.d.ts → contracts/handlers/erc20-permit-handler.test.d.ts} +0 -0
  46. /package/dist/{api/puffer-client.test.d.ts → contracts/handlers/puf-locker-handler.test.d.ts} +0 -0
  47. /package/dist/{errors/validation-errors.test.d.ts → contracts/handlers/puf-token-handler.test.d.ts} +0 -0
@@ -1,39 +0,0 @@
1
- "use strict";var $s=Object.defineProperty;var Os=(e,t,n)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var nt=(e,t,n)=>(Os(e,typeof t!="symbol"?t+"":t,n),n);function Rs(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Mr=/^tuple(?<array>(\[(\d*)\])*)$/;function xn(e){let t=e.type;if(Mr.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let a=0;a<n;a++){const s=e.components[a];t+=xn(s),a<n-1&&(t+=", ")}const r=Rs(Mr,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,xn({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function rt(e){let t="";const n=e.length;for(let r=0;r<n;r++){const a=e[r];t+=xn(a),r!==n-1&&(t+=", ")}return t}function Fs(e){return e.type==="function"?`function ${e.name}(${rt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${rt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${rt(e.inputs)})`:e.type==="error"?`error ${e.name}(${rt(e.inputs)})`:e.type==="constructor"?`constructor(${rt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?"fallback()":"receive() external payable"}function M(e,t,n){return r=>{var a,s;return((a=e[t.name])==null?void 0:a.call(e,r))??((s=e[n])==null?void 0:s.call(e,r))??t(e,r)}}function de(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Ks(e.type);return`${e.name}(${Gt(e.inputs,{includeName:t})})`}function Gt(e,{includeName:t=!1}={}){return e?e.map(n=>Ns(n,{includeName:t})).join(t?", ":","):""}function Ns(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 X(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function U(e){return X(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const ks="2.10.8",js=e=>e,Wt=e=>e,Ls=()=>`viem@${ks}`;class v extends Error{constructor(t,n={}){var s;super(),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:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:Ls()});const r=n.cause instanceof v?n.cause.details:(s=n.cause)!=null&&s.message?n.cause.message:n.details,a=n.cause instanceof v&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: https://viem.sh${a}${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
2
- `),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=a,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return sa(this,t)}}function sa(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e?sa(e.cause,t):t?null:e}class Us extends v{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(`
3
- `),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class Sr extends v{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(`
4
- `),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class ia extends v{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
5
- `),{metaMessages:[`Params: (${Gt(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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=r}}class Vt extends v{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class zs extends v{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
6
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Hs extends v{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${U(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Ds extends v{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
7
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class oa extends v{constructor(t,{docsPath:n}){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://openchain.xyz/signatures?query=${t}.`].join(`
8
- `),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class qs extends v{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class ua extends v{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://openchain.xyz/signatures?query=${t}.`].join(`
9
- `),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class $r extends v{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(`
10
- `),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class Lt extends v{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(`
11
- `),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class _s extends v{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(`
12
- `),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Gs extends v{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${de(t.abiItem)}\`, and`,`\`${n.type}\` in \`${de(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class Ws extends v{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class it extends v{constructor({abiItem:t,data:n,params:r,size:a}){super([`Data size of ${a} bytes is too small for non-indexed event parameters.`].join(`
13
- `),{metaMessages:[`Params: (${Gt(r,{includeName:!0})})`,`Data: ${n} (${a} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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=r,this.size=a}}class Zt extends v{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${de(t,{includeName:!0})}".`].join(`
14
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Vs extends v{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
15
- `),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class Zs extends v{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
16
- `),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class Ys extends v{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
17
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Ks extends v{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
18
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class Js extends v{constructor(t){super(`Filter type "${t}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}class ca extends v{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class la extends v{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class Or extends v{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function Ke(e,{dir:t,size:n=32}={}){return typeof e=="string"?ge(e,{dir:t,size:n}):Qs(e,{dir:t,size:n})}function ge(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new la({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Qs(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new la({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let a=0;a<n;a++){const s=t==="right";r[s?a:n-a-1]=e[s?a:e.length-a-1]}return r}class Xs extends v{constructor({max:t,min:n,signed:r,size:a,value:s}){super(`Number "${s}" is not in safe ${a?`${a*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class ei extends v{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.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class ti extends v{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function Yt(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let a=0;a<n.length-1&&n[t==="left"?a:n.length-a-1].toString()==="0";a++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function ie(e,{size:t}){if(U(e)>t)throw new ti({givenSize:U(e),maxSize:t})}function qe(e,t={}){const{signed:n}=t;t.size&&ie(e,{size:t.size});const r=BigInt(e);if(!n)return r;const a=(e.length-2)/2,s=(1n<<BigInt(a)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(a*2,"f")}`)-1n}function Te(e,t={}){return Number(qe(e,t))}const ni=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ae(e,t={}){return typeof e=="number"||typeof e=="bigint"?O(e,t):typeof e=="string"?Gn(e,t):typeof e=="boolean"?da(e,t):q(e,t)}function da(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(ie(n,{size:t.size}),Ke(n,{size:t.size})):n}function q(e,t={}){let n="";for(let a=0;a<e.length;a++)n+=ni[e[a]];const r=`0x${n}`;return typeof t.size=="number"?(ie(r,{size:t.size}),Ke(r,{dir:"right",size:t.size})):r}function O(e,t={}){const{signed:n,size:r}=t,a=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&a>s||a<i){const u=typeof e=="bigint"?"n":"";throw new Xs({max:s?`${s}${u}`:void 0,min:`${i}${u}`,signed:n,size:r,value:`${e}${u}`})}const o=`0x${(n&&a<0?(1n<<BigInt(r*8))+BigInt(a):a).toString(16)}`;return r?Ke(o,{size:r}):o}const ri=new TextEncoder;function Gn(e,t={}){const n=ri.encode(e);return q(n,t)}const ai=new TextEncoder;function ve(e,t={}){return typeof e=="number"||typeof e=="bigint"?ii(e,t):typeof e=="boolean"?si(e,t):X(e)?Oe(e,t):ce(e,t)}function si(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(ie(n,{size:t.size}),Ke(n,{size:t.size})):n}const oe={zero:48,nine:57,A:65,F:70,a:97,f:102};function Rr(e){if(e>=oe.zero&&e<=oe.nine)return e-oe.zero;if(e>=oe.A&&e<=oe.F)return e-(oe.A-10);if(e>=oe.a&&e<=oe.f)return e-(oe.a-10)}function Oe(e,t={}){let n=e;t.size&&(ie(n,{size:t.size}),n=Ke(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const a=r.length/2,s=new Uint8Array(a);for(let i=0,o=0;i<a;i++){const u=Rr(r.charCodeAt(o++)),c=Rr(r.charCodeAt(o++));if(u===void 0||c===void 0)throw new v(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);s[i]=u*16+c}return s}function ii(e,t){const n=O(e,t);return Oe(n)}function ce(e,t={}){const n=ai.encode(e);return typeof t.size=="number"?(ie(n,{size:t.size}),Ke(n,{dir:"right",size:t.size})):n}function Ut(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Wn(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function oi(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ut(e.outputLen),Ut(e.blockLen)}function _e(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 pa(e,t){Wn(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const Rt=BigInt(2**32-1),Fr=BigInt(32);function ui(e,t=!1){return t?{h:Number(e&Rt),l:Number(e>>Fr&Rt)}:{h:Number(e>>Fr&Rt)|0,l:Number(e&Rt)|0}}function ci(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:s,l:i}=ui(e[a],t);[n[a],r[a]]=[s,i]}return[n,r]}const li=(e,t,n)=>e<<n|t>>>32-n,di=(e,t,n)=>t<<n|e>>>32-n,pi=(e,t,n)=>t<<n-32|e>>>64-n,yi=(e,t,n)=>e<<n-32|t>>>64-n,dn=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ya=e=>e instanceof Uint8Array,fi=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),pn=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),re=(e,t)=>e<<32-t|e>>>t,mi=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!mi)throw new Error("Non little-endian hardware is not supported");function bi(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Kt(e){if(typeof e=="string"&&(e=bi(e)),!ya(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function hi(...e){const t=new Uint8Array(e.reduce((r,a)=>r+a.length,0));let n=0;return e.forEach(r=>{if(!ya(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class Vn{clone(){return this._cloneInto()}}function fa(e){const t=r=>e().update(Kt(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function gi(e=32){if(dn&&typeof dn.getRandomValues=="function")return dn.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[ma,ba,ha]=[[],[],[]],wi=BigInt(0),at=BigInt(1),Ti=BigInt(2),vi=BigInt(7),xi=BigInt(256),Ei=BigInt(113);for(let e=0,t=at,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],ma.push(2*(5*r+n)),ba.push((e+1)*(e+2)/2%64);let a=wi;for(let s=0;s<7;s++)t=(t<<at^(t>>vi)*Ei)%xi,t&Ti&&(a^=at<<(at<<BigInt(s))-at);ha.push(a)}const[Pi,Ai]=ci(ha,!0),Nr=(e,t,n)=>n>32?pi(e,t,n):li(e,t,n),kr=(e,t,n)=>n>32?yi(e,t,n):di(e,t,n);function Ii(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const o=(i+8)%10,u=(i+2)%10,c=n[u],d=n[u+1],l=Nr(c,d,1)^n[o],y=kr(c,d,1)^n[o+1];for(let b=0;b<50;b+=10)e[i+b]^=l,e[i+b+1]^=y}let a=e[2],s=e[3];for(let i=0;i<24;i++){const o=ba[i],u=Nr(a,s,o),c=kr(a,s,o),d=ma[i];a=e[d],s=e[d+1],e[d]=u,e[d+1]=c}for(let i=0;i<50;i+=10){for(let o=0;o<10;o++)n[o]=e[i+o];for(let o=0;o<10;o++)e[i+o]^=~n[(o+2)%10]&n[(o+4)%10]}e[0]^=Pi[r],e[1]^=Ai[r]}n.fill(0)}class Zn extends Vn{constructor(t,n,r,a=!1,s=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=a,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Ut(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=fi(this.state)}keccak(){Ii(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){_e(this);const{blockLen:n,state:r}=this;t=Kt(t);const a=t.length;for(let s=0;s<a;){const i=Math.min(n-this.pos,a-s);for(let o=0;o<i;o++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:a}=this;t[r]^=n,n&128&&r===a-1&&this.keccak(),t[a-1]^=128,this.keccak()}writeInto(t){_e(this,!1),Wn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let a=0,s=t.length;a<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-a);t.set(n.subarray(this.posOut,this.posOut+i),a),this.posOut+=i,a+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Ut(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(pa(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,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:a,rounds:s,enableXOF:i}=this;return t||(t=new Zn(n,r,a,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=a,t.enableXOF=i,t.destroyed=this.destroyed,t}}const Ci=(e,t,n)=>fa(()=>new Zn(t,e,n)),Bi=Ci(1,136,256/8);function G(e,t){const n=t||"hex",r=Bi(X(e,{strict:!1})?ve(e):e);return n==="bytes"?r:Ae(r)}const Mi=e=>G(ve(e));function Si(e){return Mi(e)}function $i(e){let t=!0,n="",r=0,a="",s=!1;for(let i=0;i<e.length;i++){const o=e[i];if(["(",")",","].includes(o)&&(t=!0),o==="("&&r++,o===")"&&r--,!!t){if(r===0){if(o===" "&&["event","function",""].includes(a))a="";else if(a+=o,o===")"){s=!0;break}continue}if(o===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}a+=o,n+=o}}if(!s)throw new v("Unable to normalize signature.");return a}const Oi=e=>{const t=typeof e=="string"?e:Fs(e);return $i(t)};function ga(e){return Si(Oi(e))}const Yn=ga;class Re extends v{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."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class wa extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}set(t,n){return super.set(t,n),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}const yn=new wa(8192);function Jt(e,t){if(yn.has(`${e}.${t}`))return yn.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=G(ce(n),"bytes"),a=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&a[i]&&(a[i]=a[i].toUpperCase()),(r[i>>1]&15)>=8&&a[i+1]&&(a[i+1]=a[i+1].toUpperCase());const s=`0x${a.join("")}`;return yn.set(`${e}.${t}`,s),s}function Ri(e,t){if(!ae(e,{strict:!1}))throw new Re({address:e});return Jt(e,t)}const Fi=/^0x[a-fA-F0-9]{40}$/,fn=new wa(8192);function ae(e,t){const{strict:n=!0}=t??{};if(fn.has(e))return fn.get(e);const r=Fi.test(e)?e.toLowerCase()===e?!0:n?Jt(e)===e:!0:!1;return fn.set(e,r),r}function se(e){return typeof e[0]=="string"?Kn(e):Ni(e)}function Ni(e){let t=0;for(const a of e)t+=a.length;const n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}function Kn(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function zt(e,t,n,{strict:r}={}){return X(e,{strict:!1})?ki(e,t,n,{strict:r}):xa(e,t,n,{strict:r})}function Ta(e,t){if(typeof t=="number"&&t>0&&t>U(e)-1)throw new ca({offset:t,position:"start",size:U(e)})}function va(e,t,n){if(typeof t=="number"&&typeof n=="number"&&U(e)!==n-t)throw new ca({offset:n,position:"end",size:U(e)})}function xa(e,t,n,{strict:r}={}){Ta(e,t);const a=e.slice(t,n);return r&&va(a,t,n),a}function ki(e,t,n,{strict:r}={}){Ta(e,t);const a=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&va(a,t,n),a}function Je(e,t){if(e.length!==t.length)throw new Ds({expectedLength:e.length,givenLength:t.length});const n=ji({params:e,values:t}),r=Qn(n);return r.length===0?"0x":r}function ji({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Jn({param:e[r],value:t[r]}));return n}function Jn({param:e,value:t}){const n=Xn(e.type);if(n){const[r,a]=n;return Ui(t,{length:r,param:{...e,type:a}})}if(e.type==="tuple")return _i(t,{param:e});if(e.type==="address")return Li(t);if(e.type==="bool")return Hi(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int");return Di(t,{signed:r})}if(e.type.startsWith("bytes"))return zi(t,{param:e});if(e.type==="string")return qi(t);throw new Vs(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Qn(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:o}=e[s];i?t+=32:t+=U(o)}const n=[],r=[];let a=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:o}=e[s];i?(n.push(O(t+a,{size:32})),r.push(o),a+=U(o)):n.push(o)}return se([...n,...r])}function Li(e){if(!ae(e))throw new Re({address:e});return{dynamic:!1,encoded:ge(e.toLowerCase())}}function Ui(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Ys(e);if(!r&&e.length!==t)throw new zs({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let a=!1;const s=[];for(let i=0;i<e.length;i++){const o=Jn({param:n,value:e[i]});o.dynamic&&(a=!0),s.push(o)}if(r||a){const i=Qn(s);if(r){const o=O(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?se([o,i]):o}}if(a)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:se(s.map(({encoded:i})=>i))}}function zi(e,{param:t}){const[,n]=t.type.split("bytes"),r=U(e);if(!n){let a=e;return r%32!==0&&(a=ge(a,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:se([ge(O(r,{size:32})),a])}}if(r!==Number.parseInt(n))throw new Hs({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:ge(e,{dir:"right"})}}function Hi(e){if(typeof e!="boolean")throw new v(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ge(da(e))}}function Di(e,{signed:t}){return{dynamic:!1,encoded:O(e,{size:32,signed:t})}}function qi(e){const t=Gn(e),n=Math.ceil(U(t)/32),r=[];for(let a=0;a<n;a++)r.push(ge(zt(t,a*32,(a+1)*32),{dir:"right"}));return{dynamic:!0,encoded:se([ge(O(U(t),{size:32})),...r])}}function _i(e,{param:t}){let n=!1;const r=[];for(let a=0;a<t.components.length;a++){const s=t.components[a],i=Array.isArray(e)?a:s.name,o=Jn({param:s,value:e[i]});r.push(o),o.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Qn(r):se(r.map(({encoded:a})=>a))}}function Xn(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const er=e=>zt(ga(e),0,4);function Pt(e){const{abi:t,args:n=[],name:r}=e,a=X(r,{strict:!1}),s=t.filter(o=>a?o.type==="function"?er(o)===r:o.type==="event"?Yn(o)===r:!1:"name"in o&&o.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const o of s){if(!("inputs"in o))continue;if(!n||n.length===0){if(!o.inputs||o.inputs.length===0)return o;continue}if(!o.inputs||o.inputs.length===0||o.inputs.length!==n.length)continue;if(n.every((c,d)=>{const l="inputs"in o&&o.inputs[d];return l?En(c,l):!1})){if(i&&"inputs"in i&&i.inputs){const c=Ea(o.inputs,i.inputs,n);if(c)throw new Gs({abiItem:o,type:c[0]},{abiItem:i,type:c[1]})}i=o}}return i||s[0]}function En(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ae(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((a,s)=>En(Object.values(e)[s],a)):/^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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(a=>En(a,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Ea(e,t,n){for(const r in e){const a=e[r],s=t[r];if(a.type==="tuple"&&s.type==="tuple"&&"components"in a&&"components"in s)return Ea(a.components,s.components,n[r]);const i=[a.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?ae(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?ae(n[r],{strict:!1}):!1)return i}}const jr="/docs/contract/encodeEventTopics";function At(e){var u;const{abi:t,eventName:n,args:r}=e;let a=t[0];if(n){const c=Pt({abi:t,name:n});if(!c)throw new $r(n,{docsPath:jr});a=c}if(a.type!=="event")throw new $r(void 0,{docsPath:jr});const s=de(a),i=Yn(s);let o=[];if(r&&"inputs"in a){const c=(u=a.inputs)==null?void 0:u.filter(l=>"indexed"in l&&l.indexed),d=Array.isArray(r)?r:Object.values(r).length>0?(c==null?void 0:c.map(l=>r[l.name]))??[]:[];d.length>0&&(o=(c==null?void 0:c.map((l,y)=>Array.isArray(d[y])?d[y].map((b,f)=>Lr({param:l,value:d[y][f]})):d[y]?Lr({param:l,value:d[y]}):null))??[])}return[i,...o]}function Lr({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return G(ve(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Js(e.type);return Je([e],[t])}function Qt(e,{method:t}){var r,a;const n={};return e.transport.type==="fallback"&&((a=(r=e.transport).onResponse)==null||a.call(r,({method:s,response:i,status:o,transport:u})=>{o==="success"&&t===s&&(n[i]=u.request)})),s=>n[s]||e.request}async function tr(e,t){const{address:n,abi:r,args:a,eventName:s,fromBlock:i,strict:o,toBlock:u}=t,c=Qt(e,{method:"eth_newFilter"}),d=s?At({abi:r,args:a,eventName:s}):void 0,l=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?O(i):i,toBlock:typeof u=="bigint"?O(u):u,topics:d}]});return{abi:r,args:a,eventName:s,id:l,request:c(l),strict:!!o,type:"event"}}function ee(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Ur="/docs/contract/encodeFunctionData";function Gi(e){const{abi:t,args:n,functionName:r}=e;let a=t[0];if(r){const s=Pt({abi:t,args:n,name:r});if(!s)throw new Lt(r,{docsPath:Ur});a=s}if(a.type!=="function")throw new Lt(void 0,{docsPath:Ur});return{abi:[a],functionName:er(de(a))}}function Ie(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var o;return e.abi.length===1&&((o=e.functionName)!=null&&o.startsWith("0x"))?e:Gi(e)})(),a=n[0],s=r,i="inputs"in a&&a.inputs?Je(a.inputs,t??[]):void 0;return Kn([s,i??"0x"])}const Pa={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."},Wi={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Vi={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class zr extends v{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class Aa extends v{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class Zi extends v{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const Yi={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 Zi({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Aa({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new zr({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 zr({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 Ia(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Yi);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Ki(e,t={}){typeof t.size<"u"&&ie(e,{size:t.size});const n=q(e,t);return qe(n,t)}function Ji(e,t={}){let n=e;if(typeof t.size<"u"&&(ie(n,{size:t.size}),n=Yt(n)),n.length>1||n[0]>1)throw new ei(n);return!!n[0]}function le(e,t={}){typeof t.size<"u"&&ie(e,{size:t.size});const n=q(e,t);return Te(n,t)}function Qi(e,t={}){let n=e;return typeof t.size<"u"&&(ie(n,{size:t.size}),n=Yt(n,{dir:"right"})),new TextDecoder().decode(n)}function Xt(e,t){const n=typeof t=="string"?Oe(t):t,r=Ia(n);if(U(n)===0&&e.length>0)throw new Vt;if(U(t)&&U(t)<32)throw new ia({data:typeof t=="string"?t:q(t),params:e,size:U(t)});let a=0;const s=[];for(let i=0;i<e.length;++i){const o=e[i];r.setPosition(a);const[u,c]=He(r,o,{staticPosition:0});a+=c,s.push(u)}return s}function He(e,t,{staticPosition:n}){const r=Xn(t.type);if(r){const[a,s]=r;return eo(e,{...t,type:s},{length:a,staticPosition:n})}if(t.type==="tuple")return ao(e,t,{staticPosition:n});if(t.type==="address")return Xi(e);if(t.type==="bool")return to(e);if(t.type.startsWith("bytes"))return no(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return ro(e,t);if(t.type==="string")return so(e,{staticPosition:n});throw new Zs(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Hr=32,Pn=32;function Xi(e){const t=e.readBytes(32);return[Jt(q(xa(t,-20))),32]}function eo(e,t,{length:n,staticPosition:r}){if(!n){const i=le(e.readBytes(Pn)),o=r+i,u=o+Hr;e.setPosition(o);const c=le(e.readBytes(Hr)),d=ot(t);let l=0;const y=[];for(let b=0;b<c;++b){e.setPosition(u+(d?b*32:l));const[f,p]=He(e,t,{staticPosition:u});l+=p,y.push(f)}return e.setPosition(r+32),[y,32]}if(ot(t)){const i=le(e.readBytes(Pn)),o=r+i,u=[];for(let c=0;c<n;++c){e.setPosition(o+c*32);const[d]=He(e,t,{staticPosition:o});u.push(d)}return e.setPosition(r+32),[u,32]}let a=0;const s=[];for(let i=0;i<n;++i){const[o,u]=He(e,t,{staticPosition:r+a});a+=u,s.push(o)}return[s,a]}function to(e){return[Ji(e.readBytes(32),{size:32}),32]}function no(e,t,{staticPosition:n}){const[r,a]=t.type.split("bytes");if(!a){const i=le(e.readBytes(32));e.setPosition(n+i);const o=le(e.readBytes(32));if(o===0)return e.setPosition(n+32),["0x",32];const u=e.readBytes(o);return e.setPosition(n+32),[q(u),32]}return[q(e.readBytes(Number.parseInt(a),32)),32]}function ro(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),a=e.readBytes(32);return[r>48?Ki(a,{signed:n}):le(a,{signed:n}),32]}function ao(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),a=r?[]:{};let s=0;if(ot(t)){const i=le(e.readBytes(Pn)),o=n+i;for(let u=0;u<t.components.length;++u){const c=t.components[u];e.setPosition(o+s);const[d,l]=He(e,c,{staticPosition:o});s+=l,a[r?u:c==null?void 0:c.name]=d}return e.setPosition(n+32),[a,32]}for(let i=0;i<t.components.length;++i){const o=t.components[i],[u,c]=He(e,o,{staticPosition:n});a[r?i:o==null?void 0:o.name]=u,s+=c}return[a,s]}function so(e,{staticPosition:t}){const n=le(e.readBytes(32)),r=t+n;e.setPosition(r);const a=le(e.readBytes(32));if(a===0)return e.setPosition(t+32),["",32];const s=e.readBytes(a,32),i=Qi(Yt(s));return e.setPosition(t+32),[i,32]}function ot(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(ot);const n=Xn(e.type);return!!(n&&ot({...e,type:n[1]}))}function Ca(e){const{abi:t,data:n}=e,r=zt(n,0,4);if(r==="0x")throw new Vt;const s=[...t||[],Wi,Vi].find(i=>i.type==="error"&&r===er(de(i)));if(!s)throw new oa(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Xt(s.inputs,zt(n,4)):void 0,errorName:s.name}}const D=(e,t,n)=>JSON.stringify(e,(r,a)=>{const s=typeof a=="bigint"?a.toString():a;return typeof t=="function"?t(r,s):s},n);function Ba({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((a,s)=>`${r&&a.name?`${a.name}: `:""}${typeof t[s]=="object"?D(t[s]):t[s]}`).join(", ")})`}const io={gwei:9,wei:18},oo={ether:-9,wei:9};function Ma(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[a,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${a||"0"}${s?`.${s}`:""}`}function nr(e,t="wei"){return Ma(e,io[t])}function W(e,t="wei"){return Ma(e,oo[t])}class uo extends v{constructor({address:t}){super(`State for account "${t}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class co extends v{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function Dr(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
19
- `,"")}function lo(e){return e.reduce((t,{address:n,...r})=>{let a=`${t} ${n}:
20
- `;return r.nonce&&(a+=` nonce: ${r.nonce}
21
- `),r.balance&&(a+=` balance: ${r.balance}
22
- `),r.code&&(a+=` code: ${r.code}
23
- `),r.state&&(a+=` state:
24
- `,a+=Dr(r.state)),r.stateDiff&&(a+=` stateDiff:
25
- `,a+=Dr(r.stateDiff)),a},` State Override:
26
- `).slice(0,-1)}function It(e){const t=Object.entries(e).map(([r,a])=>a===void 0||a===!1?null:[r,a]).filter(Boolean),n=t.reduce((r,[a])=>Math.max(r,a.length),0);return t.map(([r,a])=>` ${`${r}:`.padEnd(n+1)} ${a}`).join(`
27
- `)}class po extends v{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
28
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class yo extends v{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",It(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class fo extends v{constructor(t,{account:n,docsPath:r,chain:a,data:s,gas:i,gasPrice:o,maxFeePerGas:u,maxPriorityFeePerGas:c,nonce:d,to:l,value:y}){var f;const b=It({chain:a&&`${a==null?void 0:a.name} (id: ${a==null?void 0:a.id})`,from:n==null?void 0:n.address,to:l,value:typeof y<"u"&&`${nr(y)} ${((f=a==null?void 0:a.nativeCurrency)==null?void 0:f.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof o<"u"&&`${W(o)} gwei`,maxFeePerGas:typeof u<"u"&&`${W(u)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${W(c)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",b].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=t}}class Sa extends v{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:a,index:s}){let i="Transaction";r&&s!==void 0&&(i=`Transaction at block time "${r}" at index "${s}"`),t&&s!==void 0&&(i=`Transaction at block hash "${t}" at index "${s}"`),n&&s!==void 0&&(i=`Transaction at block number "${n}" at index "${s}"`),a&&(i=`Transaction with hash "${a}"`),super(`${i} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class $a extends v{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class mo extends v{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}class Oa extends v{constructor(t,{account:n,docsPath:r,chain:a,data:s,gas:i,gasPrice:o,maxFeePerGas:u,maxPriorityFeePerGas:c,nonce:d,to:l,value:y,stateOverride:b}){var m;const f=n?ee(n):void 0;let p=It({from:f==null?void 0:f.address,to:l,value:typeof y<"u"&&`${nr(y)} ${((m=a==null?void 0:a.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof o<"u"&&`${W(o)} gwei`,maxFeePerGas:typeof u<"u"&&`${W(u)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${W(c)} gwei`,nonce:d});b&&(p+=`
29
- ${lo(b)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=t}}class bo extends v{constructor(t,{abi:n,args:r,contractAddress:a,docsPath:s,functionName:i,sender:o}){const u=Pt({abi:n,args:r,name:i}),c=u?Ba({abiItem:u,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=u?de(u,{includeName:!0}):void 0,l=It({address:a&&js(a),function:d,args:c&&c!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:o});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Contract Call:",l].filter(Boolean)}),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}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=a,this.functionName=i,this.sender=o}}class An extends v{constructor({abi:t,data:n,functionName:r,message:a}){let s,i,o,u;if(n&&n!=="0x")try{i=Ca({abi:t,data:n});const{abiItem:d,errorName:l,args:y}=i;if(l==="Error")u=y[0];else if(l==="Panic"){const[b]=y;u=Pa[b]}else{const b=d?de(d,{includeName:!0}):void 0,f=d&&y?Ba({abiItem:d,args:y,includeFunctionName:!1,includeName:!1}):void 0;o=[b?`Error: ${b}`:"",f&&f!=="()"?` ${[...Array((l==null?void 0:l.length)??0).keys()].map(()=>" ").join("")}${f}`:""]}}catch(d){s=d}else a&&(u=a);let c;s instanceof oa&&(c=s.signature,o=[`Unable to decode signature "${c}" 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://openchain.xyz/signatures?query=${c}.`]),super(u&&u!=="execution reverted"||c?[`The contract function "${r}" reverted with the following ${c?"signature":"reason"}:`,u||c].join(`
30
- `):`The contract function "${r}" reverted.`,{cause:s,metaMessages:o}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{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=i,this.reason=u,this.signature=c}}class ho extends v{constructor({functionName:t}){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."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class rr extends v{constructor({data:t,message:n}){super(n||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class De extends v{constructor({body:t,details:n,headers:r,status:a,url:s}){super("HTTP request failed.",{details:n,metaMessages:[a&&`Status: ${a}`,`URL: ${Wt(s)}`,t&&`Request body: ${D(t)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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=a,this.url=s}}class Ra extends v{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${Wt(r)}`,`Request body: ${D(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code}}class qr extends v{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Wt(n)}`,`Request body: ${D(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const go=-1;class V extends v{constructor(t,{code:n,docsPath:r,metaMessages:a,shortMessage:s}){super(s,{cause:t,docsPath:r,metaMessages:a||(t==null?void 0:t.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t.name,this.code=t instanceof Ra?t.code:n??go}}class Qe extends V{constructor(t,n){super(t,n),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class ut extends V{constructor(t){super(t,{code:ut.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(ut,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class ct extends V{constructor(t){super(t,{code:ct.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(ct,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class lt extends V{constructor(t){super(t,{code:lt.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(lt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class dt extends V{constructor(t){super(t,{code:dt.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
31
- `)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(dt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Fe extends V{constructor(t){super(t,{code:Fe.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(Fe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Ne extends V{constructor(t){super(t,{code:Ne.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
32
- `)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(Ne,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class pt extends V{constructor(t){super(t,{code:pt.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(pt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class yt extends V{constructor(t){super(t,{code:yt.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(yt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Ge extends V{constructor(t){super(t,{code:Ge.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(Ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class ft extends V{constructor(t){super(t,{code:ft.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(ft,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class We extends V{constructor(t){super(t,{code:We.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(We,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class mt extends V{constructor(t){super(t,{code:mt.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(mt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Se extends Qe{constructor(t){super(t,{code:Se.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Se,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class bt extends Qe{constructor(t){super(t,{code:bt.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(bt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class ht extends Qe{constructor(t){super(t,{code:ht.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(ht,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class gt extends Qe{constructor(t){super(t,{code:gt.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(gt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class wt extends Qe{constructor(t){super(t,{code:wt.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(wt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Tt extends Qe{constructor(t){super(t,{code:Tt.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(Tt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class wo extends V{constructor(t){super(t,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const To=3;function vt(e,{abi:t,address:n,args:r,docsPath:a,functionName:s,sender:i}){const{code:o,data:u,message:c,shortMessage:d}=e instanceof rr?e:e instanceof v?e.walk(y=>"data"in y)||e.walk():{},l=e instanceof Vt?new ho({functionName:s}):[To,Fe.code].includes(o)&&(u||c||d)?new An({abi:t,data:typeof u=="object"?u.data:u,functionName:s,message:d??c}):e;return new bo(l,{abi:t,args:r,contractAddress:n,docsPath:a,functionName:s,sender:i})}class vo extends v{constructor(t,{account:n,docsPath:r,chain:a,data:s,gas:i,gasPrice:o,maxFeePerGas:u,maxPriorityFeePerGas:c,nonce:d,to:l,value:y}){var f;const b=It({from:n==null?void 0:n.address,to:l,value:typeof y<"u"&&`${nr(y)} ${((f=a==null?void 0:a.nativeCurrency)==null?void 0:f.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof o<"u"&&`${W(o)} gwei`,maxFeePerGas:typeof u<"u"&&`${W(u)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${W(c)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",b].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=t}}class ze extends v{constructor({cause:t,message:n}={}){var a;const r=(a=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:a.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ze,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Ht extends v{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${W(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(Ht,"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 In extends v{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${W(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(In,"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 Cn extends v{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(Cn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Bn extends v{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(`
33
- `),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(Bn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Mn extends v{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(Mn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Sn extends v{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
34
- `),{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."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(Sn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class $n extends v{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}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty($n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class On extends v{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(On,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Rn extends v{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Rn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Dt extends v{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${W(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${W(r)} gwei`:""}).`].join(`
35
- `),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(Dt,"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 en extends v{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function ar(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof v?e.walk(a=>a.code===ze.code):e;return r instanceof v?new ze({cause:e,message:r.details}):ze.nodeMessage.test(n)?new ze({cause:e,message:e.details}):Ht.nodeMessage.test(n)?new Ht({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):In.nodeMessage.test(n)?new In({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):Cn.nodeMessage.test(n)?new Cn({cause:e,nonce:t==null?void 0:t.nonce}):Bn.nodeMessage.test(n)?new Bn({cause:e,nonce:t==null?void 0:t.nonce}):Mn.nodeMessage.test(n)?new Mn({cause:e,nonce:t==null?void 0:t.nonce}):Sn.nodeMessage.test(n)?new Sn({cause:e}):$n.nodeMessage.test(n)?new $n({cause:e,gas:t==null?void 0:t.gas}):On.nodeMessage.test(n)?new On({cause:e,gas:t==null?void 0:t.gas}):Rn.nodeMessage.test(n)?new Rn({cause:e}):Dt.nodeMessage.test(n)?new Dt({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new en({cause:e})}function xo(e,{docsPath:t,...n}){const r=(()=>{const a=ar(e,n);return a instanceof en?e:a})();return new vo(r,{docsPath:t,...n})}function sr(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const o of i)o in e&&(n[o]=e[o]),s[o]&&typeof s[o]=="object"&&!Array.isArray(s[o])&&r(s[o])}const a=t(e||{});return r(a),n}const Eo={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function tn(e){const t={};return typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>q(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=O(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=O(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=O(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=O(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=O(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=O(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Eo[e.type]),typeof e.value<"u"&&(t.value=O(e.value)),t}function Ct(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:a,to:s}=e,i=t?ee(t):void 0;if(i&&!ae(i.address))throw new Re({address:i.address});if(s&&!ae(s))throw new Re({address:s});if(typeof n<"u"&&(typeof r<"u"||typeof a<"u"))throw new po;if(r&&r>2n**256n-1n)throw new Ht({maxFeePerGas:r});if(a&&r&&a>r)throw new Dt({maxFeePerGas:r,maxPriorityFeePerGas:a})}class Po extends v{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class ir extends v{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Ao extends v{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${W(t)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Fa extends v{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const Na={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function ka(e){const t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Te(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?Te(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Na[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 t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof t.v=="bigint"){if(t.v===0n||t.v===27n)return 0;if(t.v===1n||t.v===28n)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),t.type==="legacy"&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),t.type==="eip2930"&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),t.type==="eip1559"&&delete t.maxFeePerBlobGas,t}function ja(e){var n;const t=(n=e.transactions)==null?void 0:n.map(r=>typeof r=="string"?r:ka(r));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:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function xe(e,{blockHash:t,blockNumber:n,blockTag:r,includeTransactions:a}={}){var d,l,y;const s=r??"latest",i=a??!1,o=n!==void 0?O(n):void 0;let u=null;if(t?u=await e.request({method:"eth_getBlockByHash",params:[t,i]}):u=await e.request({method:"eth_getBlockByNumber",params:[o||s,i]}),!u)throw new Fa({blockHash:t,blockNumber:n});return(((y=(l=(d=e.chain)==null?void 0:d.formatters)==null?void 0:l.block)==null?void 0:y.format)||ja)(u)}async function or(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Io(e,t){return La(e,t)}async function La(e,t){var s,i,o;const{block:n,chain:r=e.chain,request:a}=t||{};if(typeof((s=r==null?void 0:r.fees)==null?void 0:s.defaultPriorityFee)=="function"){const u=n||await M(e,xe,"getBlock")({});return r.fees.defaultPriorityFee({block:u,client:e,request:a})}if(typeof((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee)<"u")return(o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee;try{const u=await e.request({method:"eth_maxPriorityFeePerGas"});return qe(u)}catch{const[u,c]=await Promise.all([n?Promise.resolve(n):M(e,xe,"getBlock")({}),M(e,or,"getGasPrice")({})]);if(typeof u.baseFeePerGas!="bigint")throw new ir;const d=c-u.baseFeePerGas;return d<0n?0n:d}}async function Co(e,t){return Fn(e,t)}async function Fn(e,t){var y,b;const{block:n,chain:r=e.chain,request:a,type:s="eip1559"}=t||{},i=await(async()=>{var f,p;return typeof((f=r==null?void 0:r.fees)==null?void 0:f.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:a}):((p=r==null?void 0:r.fees)==null?void 0:p.baseFeeMultiplier)??1.2})();if(i<1)throw new Po;const u=10**(((y=i.toString().split(".")[1])==null?void 0:y.length)??0),c=f=>f*BigInt(Math.ceil(i*u))/BigInt(u),d=n||await M(e,xe,"getBlock")({});if(typeof((b=r==null?void 0:r.fees)==null?void 0:b.estimateFeesPerGas)=="function"){const f=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:a,type:s});if(f!==null)return f}if(s==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new ir;const f=typeof(a==null?void 0:a.maxPriorityFeePerGas)=="bigint"?a.maxPriorityFeePerGas:await La(e,{block:d,chain:r,request:a}),p=c(d.baseFeePerGas);return{maxFeePerGas:(a==null?void 0:a.maxFeePerGas)??p+f,maxPriorityFeePerGas:f}}return{gasPrice:(a==null?void 0:a.gasPrice)??c(await M(e,or,"getGasPrice")({}))}}async function Ua(e,{address:t,blockTag:n="latest",blockNumber:r}){const a=await e.request({method:"eth_getTransactionCount",params:[t,r?O(r):n]});return Te(a)}function za(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(s=>Oe(s)):e.blobs,a=[];for(const s of r)a.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?a:a.map(s=>q(s))}function Ha(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>Oe(i)):e.blobs,a=typeof e.commitments[0]=="string"?e.commitments.map(i=>Oe(i)):e.commitments,s=[];for(let i=0;i<r.length;i++){const o=r[i],u=a[i];s.push(Uint8Array.from(t.computeBlobKzgProof(o,u)))}return n==="bytes"?s:s.map(i=>q(i))}function Bo(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const a=BigInt(32),s=BigInt(4294967295),i=Number(n>>a&s),o=Number(n&s),u=r?4:0,c=r?0:4;e.setUint32(t+u,i,r),e.setUint32(t+c,o,r)}class Mo extends Vn{constructor(t,n,r,a){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=a,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=pn(this.buffer)}update(t){_e(this);const{view:n,buffer:r,blockLen:a}=this;t=Kt(t);const s=t.length;for(let i=0;i<s;){const o=Math.min(a-this.pos,s-i);if(o===a){const u=pn(t);for(;a<=s-i;i+=a)this.process(u,i);continue}r.set(t.subarray(i,i+o),this.pos),this.pos+=o,i+=o,this.pos===a&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){_e(this),pa(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:a,isLE:s}=this;let{pos:i}=this;n[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>a-i&&(this.process(r,0),i=0);for(let l=i;l<a;l++)n[l]=0;Bo(r,a-8,BigInt(this.length*8),s),this.process(r,0);const o=pn(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=u/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<c;l++)o.setUint32(4*l,d[l],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:a,finished:s,destroyed:i,pos:o}=this;return t.length=a,t.pos=o,t.finished=s,t.destroyed=i,a%n&&t.buffer.set(r),t}}const So=(e,t,n)=>e&t^~e&n,$o=(e,t,n)=>e&t^e&n^t&n,Oo=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),be=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),he=new Uint32Array(64);class Ro extends Mo{constructor(){super(64,32,8,!1),this.A=be[0]|0,this.B=be[1]|0,this.C=be[2]|0,this.D=be[3]|0,this.E=be[4]|0,this.F=be[5]|0,this.G=be[6]|0,this.H=be[7]|0}get(){const{A:t,B:n,C:r,D:a,E:s,F:i,G:o,H:u}=this;return[t,n,r,a,s,i,o,u]}set(t,n,r,a,s,i,o,u){this.A=t|0,this.B=n|0,this.C=r|0,this.D=a|0,this.E=s|0,this.F=i|0,this.G=o|0,this.H=u|0}process(t,n){for(let l=0;l<16;l++,n+=4)he[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const y=he[l-15],b=he[l-2],f=re(y,7)^re(y,18)^y>>>3,p=re(b,17)^re(b,19)^b>>>10;he[l]=p+he[l-7]+f+he[l-16]|0}let{A:r,B:a,C:s,D:i,E:o,F:u,G:c,H:d}=this;for(let l=0;l<64;l++){const y=re(o,6)^re(o,11)^re(o,25),b=d+y+So(o,u,c)+Oo[l]+he[l]|0,p=(re(r,2)^re(r,13)^re(r,22))+$o(r,a,s)|0;d=c,c=u,u=o,o=i+b|0,i=s,s=a,a=r,r=b+p|0}r=r+this.A|0,a=a+this.B|0,s=s+this.C|0,i=i+this.D|0,o=o+this.E|0,u=u+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(r,a,s,i,o,u,c,d)}roundClean(){he.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Da=fa(()=>new Ro);function Fo(e,t){return Da(X(e,{strict:!1})?ve(e):e)}function No(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),a=Fo(t);return a.set([n],0),r==="bytes"?a:q(a)}function ko(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),a=[];for(const s of t)a.push(No({commitment:s,to:r,version:n}));return a}const _r=6,qa=32,ur=4096,_a=qa*ur,Gr=_a*_r-1-1*ur*_r;class jo extends v{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class Lo extends v{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}function Uo(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?Oe(e.data):e.data,r=U(n);if(!r)throw new Lo;if(r>Gr)throw new jo({maxSize:Gr,size:r});const a=[];let s=!0,i=0;for(;s;){const o=Ia(new Uint8Array(_a));let u=0;for(;u<ur;){const c=n.slice(i,i+(qa-1));if(o.pushByte(0),o.pushBytes(c),c.length<31){o.pushByte(128),s=!1;break}u++,i+=31}a.push(o)}return t==="bytes"?a.map(o=>o.bytes):a.map(o=>q(o.bytes))}function zo(e){const{data:t,kzg:n,to:r}=e,a=e.blobs??Uo({data:t,to:r}),s=e.commitments??za({blobs:a,kzg:n,to:r}),i=e.proofs??Ha({blobs:a,commitments:s,kzg:n,to:r}),o=[];for(let u=0;u<a.length;u++)o.push({blob:a[u],commitment:s[u],proof:i[u]});return o}function Ho(e){if(e.type)return e.type;if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new yo({transaction:e})}async function Bt(e){const t=await e.request({method:"eth_chainId"});return Te(t)}const Ga=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function nn(e,t){const{account:n=e.account,blobs:r,chain:a,chainId:s,gas:i,kzg:o,nonce:u,parameters:c=Ga,type:d}=t,l=n?ee(n):void 0,y={...t,...l?{from:l==null?void 0:l.address}:{}};let b;async function f(){return b||(b=await M(e,xe,"getBlock")({blockTag:"latest"}),b)}if((c.includes("blobVersionedHashes")||c.includes("sidecars"))&&r&&o){const p=za({blobs:r,kzg:o});if(c.includes("blobVersionedHashes")){const m=ko({commitments:p,to:"hex"});y.blobVersionedHashes=m}if(c.includes("sidecars")){const m=Ha({blobs:r,commitments:p,kzg:o}),h=zo({blobs:r,commitments:p,proofs:m,to:"hex"});y.sidecars=h}}if(c.includes("chainId")&&(a?y.chainId=a.id:typeof s<"u"?y.chainId=s:y.chainId=await M(e,Bt,"getChainId")({})),c.includes("nonce")&&typeof u>"u"&&l&&(y.nonce=await M(e,Ua,"getTransactionCount")({address:l.address,blockTag:"pending"})),(c.includes("fees")||c.includes("type"))&&typeof d>"u")try{y.type=Ho(y)}catch{const p=await f();y.type=typeof(p==null?void 0:p.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(y.type!=="legacy"&&y.type!=="eip2930"){if(typeof y.maxFeePerGas>"u"||typeof y.maxPriorityFeePerGas>"u"){const p=await f(),{maxFeePerGas:m,maxPriorityFeePerGas:h}=await Fn(e,{block:p,chain:a,request:y});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<h)throw new Ao({maxPriorityFeePerGas:h});y.maxPriorityFeePerGas=h,y.maxFeePerGas=m}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new ir;const p=await f(),{gasPrice:m}=await Fn(e,{block:p,chain:a,request:y,type:"legacy"});y.gasPrice=m}return c.includes("gas")&&typeof i>"u"&&(y.gas=await M(e,cr,"estimateGas")({...y,account:l?{address:l.address,type:"json-rpc"}:void 0})),Ct(y),delete y.parameters,y}async function cr(e,t){var a,s,i;const n=t.account??e.account,r=n?ee(n):void 0;try{const{accessList:o,blobs:u,blobVersionedHashes:c,blockNumber:d,blockTag:l,data:y,gas:b,gasPrice:f,maxFeePerBlobGas:p,maxFeePerGas:m,maxPriorityFeePerGas:h,nonce:g,to:w,value:x,...P}=await nn(e,{...t,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),E=(d?O(d):void 0)||l;Ct(t);const A=(i=(s=(a=e.chain)==null?void 0:a.formatters)==null?void 0:s.transactionRequest)==null?void 0:i.format,$=(A||tn)({...sr(P,{format:A}),from:r==null?void 0:r.address,accessList:o,blobs:u,blobVersionedHashes:c,data:y,gas:b,gasPrice:f,maxFeePerBlobGas:p,maxFeePerGas:m,maxPriorityFeePerGas:h,nonce:g,to:w,value:x}),S=await e.request({method:"eth_estimateGas",params:E?[$,E]:[$]});return BigInt(S)}catch(o){throw xo(o,{...t,account:r,chain:e.chain})}}async function Wa(e,t){const{abi:n,address:r,args:a,functionName:s,...i}=t,o=Ie({abi:n,args:a,functionName:s});try{return await M(e,cr,"estimateGas")({data:o,to:r,...i})}catch(u){const c=i.account?ee(i.account):void 0;throw vt(u,{abi:n,address:r,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:c==null?void 0:c.address})}}const Wr="/docs/contract/decodeEventLog";function lr(e){const{abi:t,data:n,strict:r,topics:a}=e,s=r??!0,[i,...o]=a;if(!i)throw new qs({docsPath:Wr});const u=t.find(p=>p.type==="event"&&i===Yn(de(p)));if(!(u&&"name"in u)||u.type!=="event")throw new ua(i,{docsPath:Wr});const{name:c,inputs:d}=u,l=d==null?void 0:d.some(p=>!("name"in p&&p.name));let y=l?[]:{};const b=d.filter(p=>"indexed"in p&&p.indexed);for(let p=0;p<b.length;p++){const m=b[p],h=o[p];if(!h)throw new Zt({abiItem:u,param:m});y[l?p:m.name||p]=Do({param:m,value:h})}const f=d.filter(p=>!("indexed"in p&&p.indexed));if(f.length>0){if(n&&n!=="0x")try{const p=Xt(f,n);if(p)if(l)y=[...y,...p];else for(let m=0;m<f.length;m++)y[f[m].name]=p[m]}catch(p){if(s)throw p instanceof ia||p instanceof Aa?new it({abiItem:u,data:n,params:f,size:U(n)}):p}else if(s)throw new it({abiItem:u,data:"0x",params:f,size:0})}return{eventName:c,args:Object.values(y).length>0?y:void 0}}function Do({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Xt([e],t)||[])[0]}function dr({abi:e,eventName:t,logs:n,strict:r=!0}){return n.map(a=>{var s;try{const i=lr({...a,abi:e,strict:r});return t&&!t.includes(i.eventName)?null:{...i,...a}}catch(i){let o,u;if(i instanceof ua)return null;if(i instanceof it||i instanceof Zt){if(r)return null;o=i.abiItem.name,u=(s=i.abiItem.inputs)==null?void 0:s.some(c=>!("name"in c&&c.name))}return{...a,args:u?[]:{},eventName:o}}}).filter(Boolean)}function Ee(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,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}:{}}}async function pr(e,{address:t,blockHash:n,fromBlock:r,toBlock:a,event:s,events:i,args:o,strict:u}={}){const c=u??!1,d=i??(s?[s]:void 0);let l=[];d&&(l=[d.flatMap(f=>At({abi:[f],eventName:f.name,args:o}))],s&&(l=l[0]));let y;n?y=await e.request({method:"eth_getLogs",params:[{address:t,topics:l,blockHash:n}]}):y=await e.request({method:"eth_getLogs",params:[{address:t,topics:l,fromBlock:typeof r=="bigint"?O(r):r,toBlock:typeof a=="bigint"?O(a):a}]});const b=y.map(f=>Ee(f));return d?dr({abi:d,logs:b,strict:c}):b}async function yr(e,t){const{abi:n,address:r,args:a,blockHash:s,eventName:i,fromBlock:o,toBlock:u,strict:c}=t,d=i?Pt({abi:n,name:i}):void 0,l=d?void 0:n.filter(y=>y.type==="event");return M(e,pr,"getLogs")({address:r,args:a,blockHash:s,event:d,events:l,fromBlock:o,toBlock:u,strict:c})}const mn="/docs/contract/decodeFunctionResult";function Xe(e){const{abi:t,args:n,functionName:r,data:a}=e;let s=t[0];if(r){const o=Pt({abi:t,args:n,name:r});if(!o)throw new Lt(r,{docsPath:mn});s=o}if(s.type!=="function")throw new Lt(void 0,{docsPath:mn});if(!s.outputs)throw new _s(s.name,{docsPath:mn});const i=Xt(s.outputs,a);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const Nn=[{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"}],Va=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Za=[...Va,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],qo=[...Va,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],Vr=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Zr=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],_o=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Go="0x82ad56cb";class kn extends v{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class Wo extends v{constructor({chain:t,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${t.id} – ${t.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class Vo extends v{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
36
- `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class Ya extends v{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}function et({blockNumber:e,chain:t,contract:n}){var a;const r=(a=t==null?void 0:t.contracts)==null?void 0:a[n];if(!r)throw new kn({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new kn({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function Zo(e,{docsPath:t,...n}){const r=(()=>{const a=ar(e,n);return a instanceof en?e:a})();return new Oa(r,{docsPath:t,...n})}const bn=new Map;function Ka({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:a}){const s=async()=>{const d=u();i();const l=d.map(({args:y})=>y);l.length!==0&&e(l).then(y=>{var b;a&&Array.isArray(y)&&y.sort(a);for(let f=0;f<d.length;f++){const{pendingPromise:p}=d[f];(b=p.resolve)==null||b.call(p,[y[f],y])}}).catch(y=>{var b;for(let f=0;f<d.length;f++){const{pendingPromise:p}=d[f];(b=p.reject)==null||b.call(p,y)}})},i=()=>bn.delete(t),o=()=>u().map(({args:d})=>d),u=()=>bn.get(t)||[],c=d=>bn.set(t,[...u(),d]);return{flush:i,async schedule(d){const l={},y=new Promise((p,m)=>{l.resolve=p,l.reject=m});return(n==null?void 0:n([...o(),d]))&&s(),u().length>0?(c({args:d,pendingPromise:l}),y):(c({args:d,pendingPromise:l}),setTimeout(s,r),y)}}}async function Mt(e,t){var x,P,T,E;const{account:n=e.account,batch:r=!!((x=e.batch)!=null&&x.multicall),blockNumber:a,blockTag:s="latest",accessList:i,blobs:o,data:u,gas:c,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:y,maxPriorityFeePerGas:b,nonce:f,to:p,value:m,stateOverride:h,...g}=t,w=n?ee(n):void 0;try{Ct(t);const C=(a?O(a):void 0)||s,$=Xo(h),S=(E=(T=(P=e.chain)==null?void 0:P.formatters)==null?void 0:T.transactionRequest)==null?void 0:E.format,F=(S||tn)({...sr(g,{format:S}),from:w==null?void 0:w.address,accessList:i,blobs:o,data:u,gas:c,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:y,maxPriorityFeePerGas:b,nonce:f,to:p,value:m});if(r&&Yo({request:F})&&!$)try{return await Ko(e,{...F,blockNumber:a,blockTag:s})}catch(I){if(!(I instanceof Ya)&&!(I instanceof kn))throw I}const Z=await e.request({method:"eth_call",params:$?[F,C,$]:[F,C]});return Z==="0x"?{data:void 0}:{data:Z}}catch(A){const C=Jo(A),{offchainLookup:$,offchainLookupSignature:S}=await Promise.resolve().then(()=>require("./ccip-Bv7jv7p7.cjs"));if(e.ccipRead!==!1&&(C==null?void 0:C.slice(0,10))===S&&p)return{data:await $(e,{data:C,to:p})};throw Zo(A,{...t,account:w,chain:e.chain})}}function Yo({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(Go)||!n||Object.values(r).filter(a=>typeof a<"u").length>0)}async function Ko(e,t){var p;const{batchSize:n=1024,wait:r=0}=typeof((p=e.batch)==null?void 0:p.multicall)=="object"?e.batch.multicall:{},{blockNumber:a,blockTag:s="latest",data:i,multicallAddress:o,to:u}=t;let c=o;if(!c){if(!e.chain)throw new Ya;c=et({blockNumber:a,chain:e.chain,contract:"multicall3"})}const l=(a?O(a):void 0)||s,{schedule:y}=Ka({id:`${e.uid}.${l}`,wait:r,shouldSplitBatch(m){return m.reduce((g,{data:w})=>g+(w.length-2),0)>n*2},fn:async m=>{const h=m.map(x=>({allowFailure:!0,callData:x.data,target:x.to})),g=Ie({abi:Nn,args:[h],functionName:"aggregate3"}),w=await e.request({method:"eth_call",params:[{data:g,to:c},l]});return Xe({abi:Nn,args:[h],functionName:"aggregate3",data:w||"0x"})}}),[{returnData:b,success:f}]=await y({data:i,to:u});if(!f)throw new rr({data:b});return b==="0x"?{data:void 0}:{data:b}}function Jo(e){var n;if(!(e instanceof v))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}function Yr(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Or({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Or({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Qo(e){const{balance:t,nonce:n,state:r,stateDiff:a,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=O(t)),n!==void 0&&(i.nonce=O(n)),r!==void 0&&(i.state=Yr(r)),a!==void 0){if(i.state)throw new co;i.stateDiff=Yr(a)}return i}function Xo(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ae(n,{strict:!1}))throw new Re({address:n});if(t[n])throw new uo({address:n});t[n]=Qo(r)}return t}async function pe(e,t){const{abi:n,address:r,args:a,functionName:s,...i}=t,o=Ie({abi:n,args:a,functionName:s});try{const{data:u}=await M(e,Mt,"call")({...i,data:o,to:r});return Xe({abi:n,args:a,functionName:s,data:u||"0x"})}catch(u){throw vt(u,{abi:n,address:r,args:a,docsPath:"/docs/contract/readContract",functionName:s})}}async function Ja(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,u=o.account?ee(o.account):e.account,c=Ie({abi:n,args:a,functionName:i});try{const{data:d}=await M(e,Mt,"call")({batch:!1,data:`${c}${s?s.replace("0x",""):""}`,to:r,...o,account:u}),l=Xe({abi:n,args:a,functionName:i,data:d||"0x"}),y=n.filter(b=>"name"in b&&b.name===t.functionName);return{result:l,request:{abi:y,address:r,args:a,dataSuffix:s,functionName:i,...o,account:u}}}catch(d){throw vt(d,{abi:n,address:r,args:a,docsPath:"/docs/contract/simulateContract",functionName:i,sender:u==null?void 0:u.address})}}const hn=new Map,Kr=new Map;let eu=0;function Pe(e,t,n){const r=++eu,a=()=>hn.get(e)||[],s=()=>{const d=a();hn.set(e,d.filter(l=>l.id!==r))},i=()=>{const d=Kr.get(e);a().length===1&&d&&d(),s()},o=a();if(hn.set(e,[...o,{id:r,fns:t}]),o&&o.length>0)return i;const u={};for(const d in t)u[d]=(...l)=>{var b,f;const y=a();if(y.length!==0)for(const p of y)(f=(b=p.fns)[d])==null||f.call(b,...l)};const c=n(u);return typeof c=="function"&&Kr.set(e,c),i}async function qt(e){return new Promise(t=>setTimeout(t,e))}function St(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let a=!0;const s=()=>a=!1;return(async()=>{let o;t&&(o=await e({unpoll:s}));const u=await(n==null?void 0:n(o))??r;await qt(u);const c=async()=>{a&&(await e({unpoll:s}),await qt(r),c())};c()})(),s}const tu=new Map,nu=new Map;function ru(e){const t=(a,s)=>({clear:()=>s.delete(a),get:()=>s.get(a),set:i=>s.set(a,i)}),n=t(e,tu),r=t(e,nu);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function au(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=ru(t),a=r.response.get();if(a&&n>0&&new Date().getTime()-a.created.getTime()<n)return a.data;let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const i=await s;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const su=e=>`blockNumber.${e}`;async function $t(e,{cacheTime:t=e.cacheTime}={}){const n=await au(()=>e.request({method:"eth_blockNumber"}),{cacheKey:su(e.uid),cacheTime:t});return BigInt(n)}async function rn(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const a=r.map(s=>Ee(s));return!("abi"in t)||!t.abi?a:dr({abi:t.abi,logs:a,strict:n})}async function an(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function Qa(e,t){const{abi:n,address:r,args:a,batch:s=!0,eventName:i,fromBlock:o,onError:u,onLogs:c,poll:d,pollingInterval:l=e.pollingInterval,strict:y}=t;return(typeof d<"u"?d:typeof o=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const m=y??!1,h=D(["watchContractEvent",r,a,s,e.uid,i,l,m,o]);return Pe(h,{onLogs:c,onError:u},g=>{let w;o!==void 0&&(w=o-1n);let x,P=!1;const T=St(async()=>{var E;if(!P){try{x=await M(e,tr,"createContractEventFilter")({abi:n,address:r,args:a,eventName:i,strict:m,fromBlock:o})}catch{}P=!0;return}try{let A;if(x)A=await M(e,rn,"getFilterChanges")({filter:x});else{const C=await M(e,$t,"getBlockNumber")({});w&&w!==C?A=await M(e,yr,"getContractEvents")({abi:n,address:r,args:a,eventName:i,fromBlock:w+1n,toBlock:C,strict:m}):A=[],w=C}if(A.length===0)return;if(s)g.onLogs(A);else for(const C of A)g.onLogs([C])}catch(A){x&&A instanceof Ne&&(P=!1),(E=g.onError)==null||E.call(g,A)}},{emitOnBegin:!0,interval:l});return async()=>{x&&await M(e,an,"uninstallFilter")({filter:x}),T()}})})():(()=>{const m=y??!1,h=D(["watchContractEvent",r,a,s,e.uid,i,l,m]);let g=!0,w=()=>g=!1;return Pe(h,{onLogs:c,onError:u},x=>((async()=>{try{const P=(()=>{if(e.transport.type==="fallback"){const A=e.transport.transports.find(C=>C.config.type==="webSocket");return A?A.value:e.transport}return e.transport})(),T=i?At({abi:n,eventName:i,args:a}):[],{unsubscribe:E}=await P.subscribe({params:["logs",{address:r,topics:T}],onData(A){var $;if(!g)return;const C=A.result;try{const{eventName:S,args:k}=lr({abi:n,data:C.data,topics:C.topics,strict:y}),F=Ee(C,{args:k,eventName:S});x.onLogs([F])}catch(S){let k,F;if(S instanceof it||S instanceof Zt){if(y)return;k=S.abiItem.name,F=($=S.abiItem.inputs)==null?void 0:$.some(I=>!("name"in I&&I.name))}const Z=Ee(C,{args:F?[]:{},eventName:k});x.onLogs([Z])}},onError(A){var C;(C=x.onError)==null||C.call(x,A)}});w=E,g||w()}catch(P){u==null||u(P)}})(),()=>w()))})()}class sn extends v{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(`
37
- `),{docsPath:t,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}function Xa({chain:e,currentChainId:t}){if(!e)throw new Vo;if(t!==e.id)throw new Wo({chain:e,currentChainId:t})}function iu(e,{docsPath:t,...n}){const r=(()=>{const a=ar(e,n);return a instanceof en?e:a})();return new fo(r,{docsPath:t,...n})}async function fr(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function mr(e,t){var h,g,w,x;const{account:n=e.account,chain:r=e.chain,accessList:a,blobs:s,data:i,gas:o,gasPrice:u,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:l,nonce:y,to:b,value:f,...p}=t;if(!n)throw new sn({docsPath:"/docs/actions/wallet/sendTransaction"});const m=ee(n);try{Ct(t);let P;if(r!==null&&(P=await M(e,Bt,"getChainId")({}),Xa({currentChainId:P,chain:r})),m.type==="local"){const C=await M(e,nn,"prepareTransactionRequest")({account:m,accessList:a,blobs:s,chain:r,chainId:P,data:i,gas:o,gasPrice:u,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:l,nonce:y,parameters:[...Ga,"sidecars"],to:b,value:f,...p}),$=(h=r==null?void 0:r.serializers)==null?void 0:h.transaction,S=await m.signTransaction(C,{serializer:$});return await M(e,fr,"sendRawTransaction")({serializedTransaction:S})}const T=(x=(w=(g=e.chain)==null?void 0:g.formatters)==null?void 0:w.transactionRequest)==null?void 0:x.format,A=(T||tn)({...sr(p,{format:T}),accessList:a,blobs:s,data:i,from:m.address,gas:o,gasPrice:u,maxFeePerBlobGas:c,maxFeePerGas:d,maxPriorityFeePerGas:l,nonce:y,to:b,value:f});return await e.request({method:"eth_sendTransaction",params:[A]},{retryCount:0})}catch(P){throw iu(P,{...t,account:m,chain:t.chain||void 0})}}async function es(e,t){const{abi:n,address:r,args:a,dataSuffix:s,functionName:i,...o}=t,u=Ie({abi:n,args:a,functionName:i});return M(e,mr,"sendTransaction")({data:`${u}${s?s.replace("0x",""):""}`,to:r,...o})}function ou({abi:e,address:t,client:n}){const r=n,[a,s]=r?"public"in r&&"wallet"in r?[r.public,r.wallet]:"public"in r?[r.public,void 0]:"wallet"in r?[void 0,r.wallet]:[r,r]:[void 0,void 0],i=a!=null,o=s!=null,u={};let c=!1,d=!1,l=!1;for(const y of e)if(y.type==="function"?y.stateMutability==="view"||y.stateMutability==="pure"?c=!0:d=!0:y.type==="event"&&(l=!0),c&&d&&l)break;return i&&(c&&(u.read=new Proxy({},{get(y,b){return(...f)=>{const{args:p,options:m}=Ft(f);return M(a,pe,"readContract")({abi:e,address:t,functionName:b,args:p,...m})}}})),d&&(u.simulate=new Proxy({},{get(y,b){return(...f)=>{const{args:p,options:m}=Ft(f);return M(a,Ja,"simulateContract")({abi:e,address:t,functionName:b,args:p,...m})}}})),l&&(u.createEventFilter=new Proxy({},{get(y,b){return(...f)=>{const p=e.find(g=>g.type==="event"&&g.name===b),{args:m,options:h}=gn(f,p);return M(a,tr,"createContractEventFilter")({abi:e,address:t,eventName:b,args:m,...h})}}}),u.getEvents=new Proxy({},{get(y,b){return(...f)=>{const p=e.find(g=>g.type==="event"&&g.name===b),{args:m,options:h}=gn(f,p);return M(a,yr,"getContractEvents")({abi:e,address:t,eventName:b,args:m,...h})}}}),u.watchEvent=new Proxy({},{get(y,b){return(...f)=>{const p=e.find(g=>g.type==="event"&&g.name===b),{args:m,options:h}=gn(f,p);return M(a,Qa,"watchContractEvent")({abi:e,address:t,eventName:b,args:m,...h})}}}))),o&&d&&(u.write=new Proxy({},{get(y,b){return(...f)=>{const{args:p,options:m}=Ft(f);return M(s,es,"writeContract")({abi:e,address:t,functionName:b,args:p,...m})}}})),(i||o)&&d&&(u.estimateGas=new Proxy({},{get(y,b){return(...f)=>{const{args:p,options:m}=Ft(f);return M(a??s,Wa,"estimateContractGas")({abi:e,address:t,functionName:b,args:p,...m,account:m.account??s.account})}}})),u.address=t,u.abi=e,u}function Ft(e){const t=e.length&&Array.isArray(e[0]),n=t?e[0]:[],r=(t?e[1]:e[0])??{};return{args:n,options:r}}function gn(e,t){let n=!1;Array.isArray(e[0])?n=!0:e.length===1?n=t.inputs.some(s=>s.indexed):e.length===2&&(n=!0);const r=n?e[0]:void 0,a=(n?e[1]:e[0])??{};return{args:r,options:a}}async function uu(e,{chain:t}){const{id:n,name:r,nativeCurrency:a,rpcUrls:s,blockExplorers:i}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:O(n),chainName:r,nativeCurrency:a,rpcUrls:s.default.http,blockExplorerUrls:i?Object.values(i).map(({url:o})=>o):void 0}]},{retryCount:0})}const jn=256;let Nt=jn,kt;function cu(e=11){if(!kt||Nt+e>jn*2){kt="",Nt=0;for(let t=0;t<jn;t++)kt+=(256+Math.random()*256|0).toString(16).substring(1)}return kt.substring(Nt,Nt+++e)}function ts(e){const{batch:t,cacheTime:n=e.pollingInterval??4e3,ccipRead:r,key:a="base",name:s="Base Client",pollingInterval:i=4e3,type:o="base"}=e,u=e.chain,c=e.account?ee(e.account):void 0,{config:d,request:l,value:y}=e.transport({chain:u,pollingInterval:i}),b={...d,...y},f={account:c,batch:t,cacheTime:n,ccipRead:r,chain:u,key:a,name:s,pollingInterval:i,request:l,transport:b,type:o,uid:cu()};function p(m){return h=>{const g=h(m);for(const x in f)delete g[x];const w={...m,...g};return Object.assign(w,{extend:p(w)})}}return Object.assign(f,{extend:p(f)})}function Ln(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((a,s)=>{const i=async({count:o=0}={})=>{const u=async({error:c})=>{const d=typeof t=="function"?t({count:o,error:c}):t;d&&await qt(d),i({count:o+1})};try{const c=await e();a(c)}catch(c){if(o<n&&await r({count:o,error:c}))return u({error:c});s(c)}};i()})}function lu(e,t={}){return async(n,r={})=>{const{retryDelay:a=150,retryCount:s=3}={...t,...r};return Ln(async()=>{try{return await e(n)}catch(i){const o=i;switch(o.code){case ut.code:throw new ut(o);case ct.code:throw new ct(o);case lt.code:throw new lt(o);case dt.code:throw new dt(o);case Fe.code:throw new Fe(o);case Ne.code:throw new Ne(o);case pt.code:throw new pt(o);case yt.code:throw new yt(o);case Ge.code:throw new Ge(o);case ft.code:throw new ft(o);case We.code:throw new We(o);case mt.code:throw new mt(o);case Se.code:throw new Se(o);case bt.code:throw new bt(o);case ht.code:throw new ht(o);case gt.code:throw new gt(o);case wt.code:throw new wt(o);case Tt.code:throw new Tt(o);case 5e3:throw new Se(o);default:throw i instanceof v?i:new wo(o)}}},{delay:({count:i,error:o})=>{var u;if(o&&o instanceof De){const c=(u=o==null?void 0:o.headers)==null?void 0:u.get("Retry-After");if(c!=null&&c.match(/\d/))return Number.parseInt(c)*1e3}return~~(1<<i)*a},retryCount:s,shouldRetry:({error:i})=>du(i)})}}function du(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===We.code||e.code===Fe.code:e instanceof De&&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 br({key:e,name:t,request:n,retryCount:r=3,retryDelay:a=150,timeout:s,type:i},o){return{config:{key:e,name:t,request:n,retryCount:r,retryDelay:a,timeout:s,type:i},request:lu(n,{retryCount:r,retryDelay:a}),value:o}}function pu(e,t={}){const{key:n="custom",name:r="Custom Provider",retryDelay:a}=t;return({retryCount:s})=>br({key:n,name:r,request:e.request.bind(e),retryCount:t.retryCount??s,retryDelay:a,type:"custom"})}function yu(e,t={}){const{key:n="fallback",name:r="Fallback",rank:a=!1,retryCount:s,retryDelay:i}=t;return({chain:o,pollingInterval:u=4e3,timeout:c,...d})=>{let l=e,y=()=>{};const b=br({key:n,name:r,async request({method:f,params:p}){const m=async(h=0)=>{const g=l[h]({...d,chain:o,retryCount:0,timeout:c});try{const w=await g.request({method:f,params:p});return y({method:f,params:p,response:w,transport:g,status:"success"}),w}catch(w){if(y({error:w,method:f,params:p,transport:g,status:"error"}),fu(w)||h===l.length-1)throw w;return m(h+1)}};return m()},retryCount:s,retryDelay:i,type:"fallback"},{onResponse:f=>y=f,transports:l.map(f=>f({chain:o,retryCount:0}))});if(a){const f=typeof a=="object"?a:{};mu({chain:o,interval:f.interval??u,onTransports:p=>l=p,sampleCount:f.sampleCount,timeout:f.timeout,transports:l,weights:f.weights})}return b}}function fu(e){return"code"in e&&typeof e.code=="number"&&(e.code===Ge.code||e.code===Se.code||e.code===5e3)}function mu({chain:e,interval:t=4e3,onTransports:n,sampleCount:r=10,timeout:a=1e3,transports:s,weights:i={}}){const{stability:o=.7,latency:u=.3}=i,c=[],d=async()=>{const l=await Promise.all(s.map(async f=>{const p=f({chain:e,retryCount:0,timeout:a}),m=Date.now();let h,g;try{await p.request({method:"net_listening"}),g=1}catch{g=0}finally{h=Date.now()}return{latency:h-m,success:g}}));c.push(l),c.length>r&&c.shift();const y=Math.max(...c.map(f=>Math.max(...f.map(({latency:p})=>p)))),b=s.map((f,p)=>{const m=c.map(P=>P[p].latency),g=1-m.reduce((P,T)=>P+T,0)/m.length/y,w=c.map(P=>P[p].success),x=w.reduce((P,T)=>P+T,0)/w.length;return x===0?[0,p]:[u*g+o*x,p]}).sort((f,p)=>p[0]-f[0]);n(b.map(([,f])=>s[f])),await qt(t),d()};d()}class bu extends v{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function hu(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((a,s)=>{(async()=>{let i;try{const o=new AbortController;n>0&&(i=setTimeout(()=>{r?o.abort():s(t)},n)),a(await e({signal:(o==null?void 0:o.signal)||null}))}catch(o){o.name==="AbortError"&&s(t),s(o)}finally{clearTimeout(i)}})()})}function gu(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Jr=gu();function wu(e,t={}){return{async request(n){var l;const{body:r,onRequest:a=t.onRequest,onResponse:s=t.onResponse,timeout:i=t.timeout??1e4}=n,o={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:u,method:c,signal:d}=o;try{const y=await hu(async({signal:f})=>{const p={...o,body:Array.isArray(r)?D(r.map(g=>({jsonrpc:"2.0",id:g.id??Jr.take(),...g}))):D({jsonrpc:"2.0",id:r.id??Jr.take(),...r}),headers:{...u,"Content-Type":"application/json"},method:c||"POST",signal:d||(i>0?f:null)},m=new Request(e,p);return a&&await a(m),await fetch(e,p)},{errorInstance:new qr({body:r,url:e}),timeout:i,signal:!0});s&&await s(y);let b;if((l=y.headers.get("Content-Type"))!=null&&l.startsWith("application/json")?b=await y.json():(b=await y.text(),b=JSON.parse(b||"{}")),!y.ok)throw new De({body:r,details:D(b.error)||y.statusText,headers:y.headers,status:y.status,url:e});return b}catch(y){throw y instanceof De||y instanceof qr?y:new De({body:r,details:y.message,url:e})}}}}function Un(e,t={}){const{batch:n,fetchOptions:r,key:a="http",name:s="HTTP JSON-RPC",onFetchRequest:i,onFetchResponse:o,retryDelay:u}=t;return({chain:c,retryCount:d,timeout:l})=>{const{batchSize:y=1e3,wait:b=0}=typeof n=="object"?n:{},f=t.retryCount??d,p=l??t.timeout??1e4,m=e||(c==null?void 0:c.rpcUrls.default.http[0]);if(!m)throw new bu;const h=wu(m,{fetchOptions:r,onRequest:i,onResponse:o,timeout:p});return br({key:a,name:s,async request({method:g,params:w}){const x={method:g,params:w},{schedule:P}=Ka({id:m,wait:b,shouldSplitBatch(C){return C.length>y},fn:C=>h.request({body:C}),sort:(C,$)=>C.id-$.id}),T=async C=>n?P(C):[await h.request({body:C})],[{error:E,result:A}]=await T(x);if(E)throw new Ra({body:x,error:E,url:m});return A},retryCount:f,retryDelay:u,timeout:p,type:"http"},{fetchOptions:r,url:m})}}function hr(e,t){var r,a,s,i,o,u;if(!(e instanceof v))return!1;const n=e.walk(c=>c instanceof An);return n instanceof An?!!(((r=n.data)==null?void 0:r.errorName)==="ResolverNotFound"||((a=n.data)==null?void 0:a.errorName)==="ResolverWildcardNotSupported"||((s=n.data)==null?void 0:s.errorName)==="ResolverNotContract"||((i=n.data)==null?void 0:i.errorName)==="ResolverError"||((o=n.data)==null?void 0:o.errorName)==="HttpError"||(u=n.reason)!=null&&u.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&n.reason===Pa[50]):!1}function ns(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return X(t)?t:null}function jt(e){let t=new Uint8Array(32).fill(0);if(!e)return q(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const a=ns(n[r]),s=a?ve(a):G(ce(n[r]),"bytes");t=G(se([t,s]),"bytes")}return q(t)}function Tu(e){return`[${e.slice(2)}]`}function vu(e){const t=new Uint8Array(32).fill(0);return e?ns(e)||G(ce(e)):q(t)}function on(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(ce(t).byteLength+2);let r=0;const a=t.split(".");for(let s=0;s<a.length;s++){let i=ce(a[s]);i.byteLength>255&&(i=ce(Tu(vu(a[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function xu(e,{blockNumber:t,blockTag:n,coinType:r,name:a,gatewayUrls:s,strict:i,universalResolverAddress:o}){let u=o;if(!u){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");u=et({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const c=Ie({abi:Zr,functionName:"addr",...r!=null?{args:[jt(a),BigInt(r)]}:{args:[jt(a)]}}),d={address:u,abi:Za,functionName:"resolve",args:[Ae(on(a)),c],blockNumber:t,blockTag:n},l=M(e,pe,"readContract"),y=s?await l({...d,args:[...d.args,s]}):await l(d);if(y[0]==="0x")return null;const b=Xe({abi:Zr,args:r!=null?[jt(a),BigInt(r)]:void 0,functionName:"addr",data:y[0]});return b==="0x"||Yt(b)==="0x00"?null:b}catch(c){if(i)throw c;if(hr(c,"resolve"))return null;throw c}}class Eu extends v{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class st extends v{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class gr extends v{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class Pu extends v{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const Au=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Iu=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Cu=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Bu=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Mu(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function Qr(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function rs({uri:e,gatewayUrls:t}){const n=Cu.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Qr(t==null?void 0:t.ipfs,"https://ipfs.io"),a=Qr(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(Au),{protocol:i,subpath:o,target:u,subtarget:c=""}=(s==null?void 0:s.groups)||{},d=i==="ipns:/"||o==="ipns/",l=i==="ipfs:/"||o==="ipfs/"||Iu.test(e);if(e.startsWith("http")&&!d&&!l){let b=e;return t!=null&&t.arweave&&(b=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:b,isOnChain:!1,isEncoded:!1}}if((d||l)&&u)return{uri:`${r}/${d?"ipns":"ipfs"}/${u}${c}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&u)return{uri:`${a}/${u}${c||""}`,isOnChain:!1,isEncoded:!1};let y=e.replace(Bu,"");if(y.startsWith("<svg")&&(y=`data:image/svg+xml;base64,${btoa(y)}`),y.startsWith("data:")||y.startsWith("{"))return{uri:y,isOnChain:!0,isEncoded:!1};throw new gr({uri:e})}function as(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Eu({data:e});return e.image||e.image_url||e.image_data}async function Su({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(a=>a.json());return await wr({gatewayUrls:e,uri:as(n)})}catch{throw new gr({uri:t})}}async function wr({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=rs({uri:t,gatewayUrls:e});if(r||await Mu(n))return n;throw new gr({uri:t})}function $u(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,a]=t.split("/"),[s,i]=n.split(":"),[o,u]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new st({reason:"Only EIP-155 supported"});if(!i)throw new st({reason:"Chain ID not found"});if(!u)throw new st({reason:"Contract address not found"});if(!a)throw new st({reason:"Token ID not found"});if(!o)throw new st({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i),namespace:o.toLowerCase(),contractAddress:u,tokenID:a}}async function Ou(e,{nft:t}){if(t.namespace==="erc721")return pe(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return pe(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Pu({namespace:t.namespace})}async function Ru(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Fu(e,{gatewayUrls:t,record:n}):wr({uri:n,gatewayUrls:t})}async function Fu(e,{gatewayUrls:t,record:n}){const r=$u(n),a=await Ou(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:o}=rs({uri:a,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const c=o?atob(s.replace("data:application/json;base64,","")):s,d=JSON.parse(c);return wr({uri:as(d),gatewayUrls:t})}let u=r.tokenID;return r.namespace==="erc1155"&&(u=u.replace("0x","").padStart(64,"0")),Su({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,u)})}async function ss(e,{blockNumber:t,blockTag:n,name:r,key:a,gatewayUrls:s,strict:i,universalResolverAddress:o}){let u=o;if(!u){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");u=et({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const c={address:u,abi:Za,functionName:"resolve",args:[Ae(on(r)),Ie({abi:Vr,functionName:"text",args:[jt(r),a]})],blockNumber:t,blockTag:n},d=M(e,pe,"readContract"),l=s?await d({...c,args:[...c.args,s]}):await d(c);if(l[0]==="0x")return null;const y=Xe({abi:Vr,functionName:"text",data:l[0]});return y===""?null:y}catch(c){if(i)throw c;if(hr(c,"resolve"))return null;throw c}}async function Nu(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:a,gatewayUrls:s,strict:i,universalResolverAddress:o}){const u=await M(e,ss,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:a,universalResolverAddress:o,gatewayUrls:s,strict:i});if(!u)return null;try{return await Ru(e,{record:u,gatewayUrls:r})}catch{return null}}async function ku(e,{address:t,blockNumber:n,blockTag:r,gatewayUrls:a,strict:s,universalResolverAddress:i}){let o=i;if(!o){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=et({blockNumber:n,chain:e.chain,contract:"ensUniversalResolver"})}const u=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:o,abi:qo,functionName:"reverse",args:[Ae(on(u))],blockNumber:n,blockTag:r},d=M(e,pe,"readContract"),[l,y]=a?await d({...c,args:[...c.args,a]}):await d(c);return t.toLowerCase()!==y.toLowerCase()?null:l}catch(c){if(s)throw c;if(hr(c,"reverse"))return null;throw c}}async function ju(e,{blockNumber:t,blockTag:n,name:r,universalResolverAddress:a}){let s=a;if(!s){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=et({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[i]=await M(e,pe,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ae(on(r))],blockNumber:t,blockTag:n});return i}async function Lu(e){const t=Qt(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function is(e,{address:t,args:n,event:r,events:a,fromBlock:s,strict:i,toBlock:o}={}){const u=a??(r?[r]:void 0),c=Qt(e,{method:"eth_newFilter"});let d=[];u&&(d=[u.flatMap(y=>At({abi:[y],eventName:y.name,args:n}))],r&&(d=d[0]));const l=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?O(s):s,toBlock:typeof o=="bigint"?O(o):o,...d.length?{topics:d}:{}}]});return{abi:u,args:n,eventName:r?r.name:void 0,fromBlock:s,id:l,request:c(l),strict:!!i,toBlock:o,type:"event"}}async function os(e){const t=Qt(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Uu(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=n?O(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,a||r]});return BigInt(s)}async function zu(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Hu(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const a=n!==void 0?O(n):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[a||r]}),Te(s)}async function Du(e,{address:t,blockNumber:n,blockTag:r="latest"}){const a=n!==void 0?O(n):void 0,s=await e.request({method:"eth_getCode",params:[t,a||r]});if(s!=="0x")return s}function qu(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function _u(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:a}){const s=n?O(n):void 0,i=await e.request({method:"eth_feeHistory",params:[O(t),s||r,a]});return qu(i)}async function Gu(e,{filter:t}){const n=t.strict??!1,a=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Ee(s));return t.abi?dr({abi:t.abi,logs:a,strict:n}):a}function Tr(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const Wu=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Vu=/^(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 Zu(e){const{domain:t={},message:n,primaryType:r}=e,a={EIP712Domain:ys({domain:t}),...e.types};ps({domain:t,message:n,primaryType:r,types:a});const s=["0x1901"];return t&&s.push(Yu({domain:t,types:a})),r!=="EIP712Domain"&&s.push(us({data:n,primaryType:r,types:a})),G(se(s))}function Yu({domain:e,types:t}){return us({data:e,primaryType:"EIP712Domain",types:t})}function us({data:e,primaryType:t,types:n}){const r=cs({data:e,primaryType:t,types:n});return G(r)}function cs({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],a=[Ku({primaryType:t,types:n})];for(const s of n[t]){const[i,o]=ds({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),a.push(o)}return Je(r,a)}function Ku({primaryType:e,types:t}){const n=Ae(Ju({primaryType:e,types:t}));return G(n)}function Ju({primaryType:e,types:t}){let n="";const r=ls({primaryType:e,types:t});r.delete(e);const a=[e,...Array.from(r).sort()];for(const s of a)n+=`${s}(${t[s].map(({name:i,type:o})=>`${o} ${i}`).join(",")})`;return n}function ls({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),a=r==null?void 0:r[0];if(n.has(a)||t[a]===void 0)return n;n.add(a);for(const s of t[a])ls({primaryType:s.type,types:t},n);return n}function ds({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},G(cs({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},G(r)];if(n==="string")return[{type:"bytes32"},G(Ae(r))];if(n.lastIndexOf("]")===n.length-1){const a=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>ds({name:t,type:a,types:e,value:i}));return[{type:"bytes32"},G(Je(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}function ps(e){const{domain:t,message:n,primaryType:r,types:a}=e,s=(i,o)=>{for(const u of i){const{name:c,type:d}=u,l=o[c],y=d.match(Vu);if(y&&(typeof l=="number"||typeof l=="bigint")){const[p,m,h]=y;O(l,{signed:m==="int",size:Number.parseInt(h)/8})}if(d==="address"&&typeof l=="string"&&!ae(l))throw new Re({address:l});const b=d.match(Wu);if(b){const[p,m]=b;if(m&&U(l)!==Number.parseInt(m))throw new Ws({expectedSize:Number.parseInt(m),givenSize:U(l)})}const f=a[d];f&&s(f,l)}};if(a.EIP712Domain&&t&&s(a.EIP712Domain,t),r!=="EIP712Domain"){const i=a[r];s(i,n)}}function ys({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},typeof(e==null?void 0:e.chainId)=="number"&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const wn="/docs/contract/encodeDeployData";function fs(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const a=t.find(i=>"type"in i&&i.type==="constructor");if(!a)throw new Us({docsPath:wn});if(!("inputs"in a))throw new Sr({docsPath:wn});if(!a.inputs||a.inputs.length===0)throw new Sr({docsPath:wn});const s=Je(a.inputs,n);return Kn([r,s])}const Qu={"0x0":"reverted","0x1":"success"};function Xu(e){const t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>Ee(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Te(e.transactionIndex):null,status:e.status?Qu[e.status]:null,type:e.type?Na[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t}const ec=`Ethereum Signed Message:
38
- `;function tc(e,t){const n=typeof e=="string"?ce(e):e.raw instanceof Uint8Array?e.raw:ve(e.raw),r=ce(`${ec}${n.length}`);return G(se([r,n]),t)}function nc(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function rc(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Te(e.nonce):void 0,storageProof:e.storageProof?nc(e.storageProof):void 0}}async function ac(e,{address:t,blockNumber:n,blockTag:r,storageKeys:a}){const s=r??"latest",i=n!==void 0?O(n):void 0,o=await e.request({method:"eth_getProof",params:[t,a,i||s]});return rc(o)}async function sc(e,{address:t,blockNumber:n,blockTag:r="latest",slot:a}){const s=n!==void 0?O(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,a,s||r]})}async function vr(e,{blockHash:t,blockNumber:n,blockTag:r,hash:a,index:s}){var d,l,y;const i=r||"latest",o=n!==void 0?O(n):void 0;let u=null;if(a?u=await e.request({method:"eth_getTransactionByHash",params:[a]}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,O(s)]}):(o||i)&&(u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||i,O(s)]})),!u)throw new Sa({blockHash:t,blockNumber:n,blockTag:i,hash:a,index:s});return(((y=(l=(d=e.chain)==null?void 0:d.formatters)==null?void 0:l.transaction)==null?void 0:y.format)||ka)(u)}async function ic(e,{hash:t,transactionReceipt:n}){const[r,a]=await Promise.all([M(e,$t,"getBlockNumber")({}),t?M(e,vr,"getBlockNumber")({hash:t}):void 0]),s=(n==null?void 0:n.blockNumber)||(a==null?void 0:a.blockNumber);return s?r-s+1n:0n}async function zn(e,{hash:t}){var a,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!n)throw new $a({hash:t});return(((i=(s=(a=e.chain)==null?void 0:a.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||Xu)(n)}async function oc(e,t){var m;const{allowFailure:n=!0,batchSize:r,blockNumber:a,blockTag:s,multicallAddress:i,stateOverride:o}=t,u=t.contracts,c=r??(typeof((m=e.batch)==null?void 0:m.multicall)=="object"&&e.batch.multicall.batchSize||1024);let d=i;if(!d){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");d=et({blockNumber:a,chain:e.chain,contract:"multicall3"})}const l=[[]];let y=0,b=0;for(let h=0;h<u.length;h++){const{abi:g,address:w,args:x,functionName:P}=u[h];try{const T=Ie({abi:g,args:x,functionName:P});b+=(T.length-2)/2,c>0&&b>c&&l[y].length>0&&(y++,b=(T.length-2)/2,l[y]=[]),l[y]=[...l[y],{allowFailure:!0,callData:T,target:w}]}catch(T){const E=vt(T,{abi:g,address:w,args:x,docsPath:"/docs/contract/multicall",functionName:P});if(!n)throw E;l[y]=[...l[y],{allowFailure:!0,callData:"0x",target:w}]}}const f=await Promise.allSettled(l.map(h=>M(e,pe,"readContract")({abi:Nn,address:d,args:[h],blockNumber:a,blockTag:s,functionName:"aggregate3",stateOverride:o}))),p=[];for(let h=0;h<f.length;h++){const g=f[h];if(g.status==="rejected"){if(!n)throw g.reason;for(let x=0;x<l[h].length;x++)p.push({status:"failure",error:g.reason,result:void 0});continue}const w=g.value;for(let x=0;x<w.length;x++){const{returnData:P,success:T}=w[x],{callData:E}=l[h][x],{abi:A,address:C,functionName:$,args:S}=u[p.length];try{if(E==="0x")throw new Vt;if(!T)throw new rr({data:P});const k=Xe({abi:A,args:S,data:P,functionName:$});p.push(n?{result:k,status:"success"}:k)}catch(k){const F=vt(k,{abi:A,address:C,args:S,docsPath:"/docs/contract/multicall",functionName:$});if(!n)throw F;p.push({error:F,result:void 0,status:"failure"})}}}if(p.length!==u.length)throw new v("multicall results mismatch");return p}const uc="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ms=BigInt(0),un=BigInt(1),cc=BigInt(2),cn=e=>e instanceof Uint8Array,lc=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ve(e){if(!cn(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=lc[e[n]];return t}function bs(e){const t=e.toString(16);return t.length&1?`0${t}`:t}function xr(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function Ze(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let r=0;r<n.length;r++){const a=r*2,s=e.slice(a,a+2),i=Number.parseInt(s,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");n[r]=i}return n}function $e(e){return xr(Ve(e))}function Er(e){if(!cn(e))throw new Error("Uint8Array expected");return xr(Ve(Uint8Array.from(e).reverse()))}function Ye(e,t){return Ze(e.toString(16).padStart(t*2,"0"))}function Pr(e,t){return Ye(e,t).reverse()}function dc(e){return Ze(bs(e))}function ne(e,t,n){let r;if(typeof t=="string")try{r=Ze(t)}catch(s){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${s}`)}else if(cn(t))r=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const a=r.length;if(typeof n=="number"&&a!==n)throw new Error(`${e} expected ${n} bytes, got ${a}`);return r}function xt(...e){const t=new Uint8Array(e.reduce((r,a)=>r+a.length,0));let n=0;return e.forEach(r=>{if(!cn(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function hs(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function pc(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function yc(e){let t;for(t=0;e>ms;e>>=un,t+=1);return t}function fc(e,t){return e>>BigInt(t)&un}const mc=(e,t,n)=>e|(n?un:ms)<<BigInt(t),Ar=e=>(cc<<BigInt(e-1))-un,Tn=e=>new Uint8Array(e),Xr=e=>Uint8Array.from(e);function gs(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Tn(e),a=Tn(e),s=0;const i=()=>{r.fill(1),a.fill(0),s=0},o=(...l)=>n(a,r,...l),u=(l=Tn())=>{a=o(Xr([0]),l),r=o(),l.length!==0&&(a=o(Xr([1]),l),r=o())},c=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let l=0;const y=[];for(;l<t;){r=o();const b=r.slice();y.push(b),l+=r.length}return xt(...y)};return(l,y)=>{i(),u(l);let b;for(;!(b=y(c()));)u();return i(),b}}const bc={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ot(e,t,n={}){const r=(a,s,i)=>{const o=bc[s];if(typeof o!="function")throw new Error(`Invalid validator "${s}", expected function`);const u=e[a];if(!(i&&u===void 0)&&!o(u,e))throw new Error(`Invalid param ${String(a)}=${u} (${typeof u}), expected ${s}`)};for(const[a,s]of Object.entries(t))r(a,s,!1);for(const[a,s]of Object.entries(n))r(a,s,!0);return e}const hc=Object.freeze(Object.defineProperty({__proto__:null,bitGet:fc,bitLen:yc,bitMask:Ar,bitSet:mc,bytesToHex:Ve,bytesToNumberBE:$e,bytesToNumberLE:Er,concatBytes:xt,createHmacDrbg:gs,ensureBytes:ne,equalBytes:hs,hexToBytes:Ze,hexToNumber:xr,numberToBytesBE:Ye,numberToBytesLE:Pr,numberToHexUnpadded:bs,numberToVarBytesBE:dc,utf8ToBytes:pc,validateObject:Ot},Symbol.toStringTag,{value:"Module"}));function gc(e,t){const n=X(e)?ve(e):e,r=X(t)?ve(t):t;return hs(n,r)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const H=BigInt(0),L=BigInt(1),Be=BigInt(2),wc=BigInt(3),Hn=BigInt(4),ea=BigInt(5),ta=BigInt(8);BigInt(9);BigInt(16);function _(e,t){const n=e%t;return n>=H?n:t+n}function Tc(e,t,n){if(n<=H||t<H)throw new Error("Expected power/modulo > 0");if(n===L)return H;let r=L;for(;t>H;)t&L&&(r=r*e%n),e=e*e%n,t>>=L;return r}function J(e,t,n){let r=e;for(;t-- >H;)r*=r,r%=n;return r}function Dn(e,t){if(e===H||t<=H)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=_(e,t),r=t,a=H,s=L;for(;n!==H;){const o=r/n,u=r%n,c=a-s*o;r=n,n=u,a=s,s=c}if(r!==L)throw new Error("invert: does not exist");return _(a,t)}function vc(e){const t=(e-L)/Be;let n,r,a;for(n=e-L,r=0;n%Be===H;n/=Be,r++);for(a=Be;a<e&&Tc(a,t,e)!==e-L;a++);if(r===1){const i=(e+L)/Hn;return function(u,c){const d=u.pow(c,i);if(!u.eql(u.sqr(d),c))throw new Error("Cannot find square root");return d}}const s=(n+L)/Be;return function(o,u){if(o.pow(u,t)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=r,d=o.pow(o.mul(o.ONE,a),n),l=o.pow(u,s),y=o.pow(u,n);for(;!o.eql(y,o.ONE);){if(o.eql(y,o.ZERO))return o.ZERO;let b=1;for(let p=o.sqr(y);b<c&&!o.eql(p,o.ONE);b++)p=o.sqr(p);const f=o.pow(d,L<<BigInt(c-b-1));d=o.sqr(f),l=o.mul(l,f),y=o.mul(y,d),c=b}return l}}function xc(e){if(e%Hn===wc){const t=(e+L)/Hn;return function(r,a){const s=r.pow(a,t);if(!r.eql(r.sqr(s),a))throw new Error("Cannot find square root");return s}}if(e%ta===ea){const t=(e-ea)/ta;return function(r,a){const s=r.mul(a,Be),i=r.pow(s,t),o=r.mul(a,i),u=r.mul(r.mul(o,Be),i),c=r.mul(o,r.sub(u,r.ONE));if(!r.eql(r.sqr(c),a))throw new Error("Cannot find square root");return c}}return vc(e)}const Ec=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Pc(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Ec.reduce((r,a)=>(r[a]="function",r),t);return Ot(e,n)}function Ac(e,t,n){if(n<H)throw new Error("Expected power > 0");if(n===H)return e.ONE;if(n===L)return t;let r=e.ONE,a=t;for(;n>H;)n&L&&(r=e.mul(r,a)),a=e.sqr(a),n>>=L;return r}function Ic(e,t){const n=new Array(t.length),r=t.reduce((s,i,o)=>e.is0(i)?s:(n[o]=s,e.mul(s,i)),e.ONE),a=e.inv(r);return t.reduceRight((s,i,o)=>e.is0(i)?s:(n[o]=e.mul(s,n[o]),e.mul(s,i)),a),n}function ws(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function Cc(e,t,n=!1,r={}){if(e<=H)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:a,nByteLength:s}=ws(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const i=xc(e),o=Object.freeze({ORDER:e,BITS:a,BYTES:s,MASK:Ar(a),ZERO:H,ONE:L,create:u=>_(u,e),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return H<=u&&u<e},is0:u=>u===H,isOdd:u=>(u&L)===L,neg:u=>_(-u,e),eql:(u,c)=>u===c,sqr:u=>_(u*u,e),add:(u,c)=>_(u+c,e),sub:(u,c)=>_(u-c,e),mul:(u,c)=>_(u*c,e),pow:(u,c)=>Ac(o,u,c),div:(u,c)=>_(u*Dn(c,e),e),sqrN:u=>u*u,addN:(u,c)=>u+c,subN:(u,c)=>u-c,mulN:(u,c)=>u*c,inv:u=>Dn(u,e),sqrt:r.sqrt||(u=>i(o,u)),invertBatch:u=>Ic(o,u),cmov:(u,c,d)=>d?c:u,toBytes:u=>n?Pr(u,s):Ye(u,s),fromBytes:u=>{if(u.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${u.length}`);return n?Er(u):$e(u)}});return Object.freeze(o)}function Ts(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function vs(e){const t=Ts(e);return t+Math.ceil(t/2)}function Bc(e,t,n=!1){const r=e.length,a=Ts(t),s=vs(t);if(r<16||r<s||r>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${r}`);const i=n?$e(e):Er(e),o=_(i,t-L)+L;return n?Pr(o,a):Ye(o,a)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Mc=BigInt(0),vn=BigInt(1);function Sc(e,t){const n=(a,s)=>{const i=s.negate();return a?i:s},r=a=>{const s=Math.ceil(t/a)+1,i=2**(a-1);return{windows:s,windowSize:i}};return{constTimeNegate:n,unsafeLadder(a,s){let i=e.ZERO,o=a;for(;s>Mc;)s&vn&&(i=i.add(o)),o=o.double(),s>>=vn;return i},precomputeWindow(a,s){const{windows:i,windowSize:o}=r(s),u=[];let c=a,d=c;for(let l=0;l<i;l++){d=c,u.push(d);for(let y=1;y<o;y++)d=d.add(c),u.push(d);c=d.double()}return u},wNAF(a,s,i){const{windows:o,windowSize:u}=r(a);let c=e.ZERO,d=e.BASE;const l=BigInt(2**a-1),y=2**a,b=BigInt(a);for(let f=0;f<o;f++){const p=f*u;let m=Number(i&l);i>>=b,m>u&&(m-=y,i+=vn);const h=p,g=p+Math.abs(m)-1,w=f%2!==0,x=m<0;m===0?d=d.add(n(w,s[h])):c=c.add(n(x,s[g]))}return{p:c,f:d}},wNAFCached(a,s,i,o){const u=a._WINDOW_SIZE||1;let c=s.get(a);return c||(c=this.precomputeWindow(a,u),u!==1&&s.set(a,o(c))),this.wNAF(u,c,i)}}}function xs(e){return Pc(e.Fp),Ot(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ws(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $c(e){const t=xs(e);Ot(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a}=t;if(n){if(!r.eql(a,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:Oc,hexToBytes:Rc}=hc,Me={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Me;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Oc(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Me,n=typeof e=="string"?Rc(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:a,l:s}=Me._parseInt(n.subarray(2)),{d:i,l:o}=Me._parseInt(s);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r:a,s:i}},hexFromSig(e){const t=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const d=c.toString(16);return d.length&1?`0${d}`:d},r=t(n(e.s)),a=t(n(e.r)),s=r.length/2,i=a.length/2,o=n(s),u=n(i);return`30${n(i+s+4)}02${u}${a}02${o}${r}`}},ue=BigInt(0),Q=BigInt(1);BigInt(2);const na=BigInt(3);BigInt(4);function Fc(e){const t=$c(e),{Fp:n}=t,r=t.toBytes||((f,p,m)=>{const h=p.toAffine();return xt(Uint8Array.from([4]),n.toBytes(h.x),n.toBytes(h.y))}),a=t.fromBytes||(f=>{const p=f.subarray(1),m=n.fromBytes(p.subarray(0,n.BYTES)),h=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:m,y:h}});function s(f){const{a:p,b:m}=t,h=n.sqr(f),g=n.mul(h,f);return n.add(n.add(g,n.mul(f,p)),m)}if(!n.eql(n.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function i(f){return typeof f=="bigint"&&ue<f&&f<t.n}function o(f){if(!i(f))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(f){const{allowedPrivateKeyLengths:p,nByteLength:m,wrapPrivateKey:h,n:g}=t;if(p&&typeof f!="bigint"){if(f instanceof Uint8Array&&(f=Ve(f)),typeof f!="string"||!p.includes(f.length))throw new Error("Invalid key");f=f.padStart(m*2,"0")}let w;try{w=typeof f=="bigint"?f:$e(ne("private key",f,m))}catch{throw new Error(`private key must be ${m} bytes, hex or bigint, not ${typeof f}`)}return h&&(w=_(w,g)),o(w),w}const c=new Map;function d(f){if(!(f instanceof l))throw new Error("ProjectivePoint expected")}class l{constructor(p,m,h){if(this.px=p,this.py=m,this.pz=h,p==null||!n.isValid(p))throw new Error("x required");if(m==null||!n.isValid(m))throw new Error("y required");if(h==null||!n.isValid(h))throw new Error("z required")}static fromAffine(p){const{x:m,y:h}=p||{};if(!p||!n.isValid(m)||!n.isValid(h))throw new Error("invalid affine point");if(p instanceof l)throw new Error("projective point not allowed");const g=w=>n.eql(w,n.ZERO);return g(m)&&g(h)?l.ZERO:new l(m,h,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const m=n.invertBatch(p.map(h=>h.pz));return p.map((h,g)=>h.toAffine(m[g])).map(l.fromAffine)}static fromHex(p){const m=l.fromAffine(a(ne("pointHex",p)));return m.assertValidity(),m}static fromPrivateKey(p){return l.BASE.multiply(u(p))}_setWindowSize(p){this._WINDOW_SIZE=p,c.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:p,y:m}=this.toAffine();if(!n.isValid(p)||!n.isValid(m))throw new Error("bad point: x or y not FE");const h=n.sqr(m),g=s(p);if(!n.eql(h,g))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){d(p);const{px:m,py:h,pz:g}=this,{px:w,py:x,pz:P}=p,T=n.eql(n.mul(m,P),n.mul(w,g)),E=n.eql(n.mul(h,P),n.mul(x,g));return T&&E}negate(){return new l(this.px,n.neg(this.py),this.pz)}double(){const{a:p,b:m}=t,h=n.mul(m,na),{px:g,py:w,pz:x}=this;let P=n.ZERO,T=n.ZERO,E=n.ZERO,A=n.mul(g,g),C=n.mul(w,w),$=n.mul(x,x),S=n.mul(g,w);return S=n.add(S,S),E=n.mul(g,x),E=n.add(E,E),P=n.mul(p,E),T=n.mul(h,$),T=n.add(P,T),P=n.sub(C,T),T=n.add(C,T),T=n.mul(P,T),P=n.mul(S,P),E=n.mul(h,E),$=n.mul(p,$),S=n.sub(A,$),S=n.mul(p,S),S=n.add(S,E),E=n.add(A,A),A=n.add(E,A),A=n.add(A,$),A=n.mul(A,S),T=n.add(T,A),$=n.mul(w,x),$=n.add($,$),A=n.mul($,S),P=n.sub(P,A),E=n.mul($,C),E=n.add(E,E),E=n.add(E,E),new l(P,T,E)}add(p){d(p);const{px:m,py:h,pz:g}=this,{px:w,py:x,pz:P}=p;let T=n.ZERO,E=n.ZERO,A=n.ZERO;const C=t.a,$=n.mul(t.b,na);let S=n.mul(m,w),k=n.mul(h,x),F=n.mul(g,P),Z=n.add(m,h),I=n.add(w,x);Z=n.mul(Z,I),I=n.add(S,k),Z=n.sub(Z,I),I=n.add(m,g);let B=n.add(w,P);return I=n.mul(I,B),B=n.add(S,F),I=n.sub(I,B),B=n.add(h,g),T=n.add(x,P),B=n.mul(B,T),T=n.add(k,F),B=n.sub(B,T),A=n.mul(C,I),T=n.mul($,F),A=n.add(T,A),T=n.sub(k,A),A=n.add(k,A),E=n.mul(T,A),k=n.add(S,S),k=n.add(k,S),F=n.mul(C,F),I=n.mul($,I),k=n.add(k,F),F=n.sub(S,F),F=n.mul(C,F),I=n.add(I,F),S=n.mul(k,I),E=n.add(E,S),S=n.mul(B,I),T=n.mul(Z,T),T=n.sub(T,S),S=n.mul(Z,k),A=n.mul(B,A),A=n.add(A,S),new l(T,E,A)}subtract(p){return this.add(p.negate())}is0(){return this.equals(l.ZERO)}wNAF(p){return b.wNAFCached(this,c,p,m=>{const h=n.invertBatch(m.map(g=>g.pz));return m.map((g,w)=>g.toAffine(h[w])).map(l.fromAffine)})}multiplyUnsafe(p){const m=l.ZERO;if(p===ue)return m;if(o(p),p===Q)return this;const{endo:h}=t;if(!h)return b.unsafeLadder(this,p);let{k1neg:g,k1:w,k2neg:x,k2:P}=h.splitScalar(p),T=m,E=m,A=this;for(;w>ue||P>ue;)w&Q&&(T=T.add(A)),P&Q&&(E=E.add(A)),A=A.double(),w>>=Q,P>>=Q;return g&&(T=T.negate()),x&&(E=E.negate()),E=new l(n.mul(E.px,h.beta),E.py,E.pz),T.add(E)}multiply(p){o(p);let m=p,h,g;const{endo:w}=t;if(w){const{k1neg:x,k1:P,k2neg:T,k2:E}=w.splitScalar(m);let{p:A,f:C}=this.wNAF(P),{p:$,f:S}=this.wNAF(E);A=b.constTimeNegate(x,A),$=b.constTimeNegate(T,$),$=new l(n.mul($.px,w.beta),$.py,$.pz),h=A.add($),g=C.add(S)}else{const{p:x,f:P}=this.wNAF(m);h=x,g=P}return l.normalizeZ([h,g])[0]}multiplyAndAddUnsafe(p,m,h){const g=l.BASE,w=(P,T)=>T===ue||T===Q||!P.equals(g)?P.multiplyUnsafe(T):P.multiply(T),x=w(this,m).add(w(p,h));return x.is0()?void 0:x}toAffine(p){const{px:m,py:h,pz:g}=this,w=this.is0();p==null&&(p=w?n.ONE:n.inv(g));const x=n.mul(m,p),P=n.mul(h,p),T=n.mul(g,p);if(w)return{x:n.ZERO,y:n.ZERO};if(!n.eql(T,n.ONE))throw new Error("invZ was invalid");return{x,y:P}}isTorsionFree(){const{h:p,isTorsionFree:m}=t;if(p===Q)return!0;if(m)return m(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:m}=t;return p===Q?this:m?m(l,this):this.multiplyUnsafe(t.h)}toRawBytes(p=!0){return this.assertValidity(),r(l,this,p)}toHex(p=!0){return Ve(this.toRawBytes(p))}}l.BASE=new l(t.Gx,t.Gy,n.ONE),l.ZERO=new l(n.ZERO,n.ONE,n.ZERO);const y=t.nBitLength,b=Sc(l,t.endo?Math.ceil(y/2):y);return{CURVE:t,ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:s,isWithinCurveOrder:i}}function Nc(e){const t=xs(e);return Ot(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function kc(e){const t=Nc(e),{Fp:n,n:r}=t,a=n.BYTES+1,s=2*n.BYTES+1;function i(I){return ue<I&&I<n.ORDER}function o(I){return _(I,r)}function u(I){return Dn(I,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:d,weierstrassEquation:l,isWithinCurveOrder:y}=Fc({...t,toBytes(I,B,R){const j=B.toAffine(),N=n.toBytes(j.x),z=xt;return R?z(Uint8Array.from([B.hasEvenY()?2:3]),N):z(Uint8Array.from([4]),N,n.toBytes(j.y))},fromBytes(I){const B=I.length,R=I[0],j=I.subarray(1);if(B===a&&(R===2||R===3)){const N=$e(j);if(!i(N))throw new Error("Point is not on curve");const z=l(N);let Y=n.sqrt(z);const K=(Y&Q)===Q;return(R&1)===1!==K&&(Y=n.neg(Y)),{x:N,y:Y}}else if(B===s&&R===4){const N=n.fromBytes(j.subarray(0,n.BYTES)),z=n.fromBytes(j.subarray(n.BYTES,2*n.BYTES));return{x:N,y:z}}else throw new Error(`Point of length ${B} was invalid. Expected ${a} compressed bytes or ${s} uncompressed bytes`)}}),b=I=>Ve(Ye(I,t.nByteLength));function f(I){const B=r>>Q;return I>B}function p(I){return f(I)?o(-I):I}const m=(I,B,R)=>$e(I.slice(B,R));class h{constructor(B,R,j){this.r=B,this.s=R,this.recovery=j,this.assertValidity()}static fromCompact(B){const R=t.nByteLength;return B=ne("compactSignature",B,R*2),new h(m(B,0,R),m(B,R,2*R))}static fromDER(B){const{r:R,s:j}=Me.toSig(ne("DER",B));return new h(R,j)}assertValidity(){if(!y(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!y(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(B){return new h(this.r,this.s,B)}recoverPublicKey(B){const{r:R,s:j,recovery:N}=this,z=E(ne("msgHash",B));if(N==null||![0,1,2,3].includes(N))throw new Error("recovery id invalid");const Y=N===2||N===3?R+t.n:R;if(Y>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const K=N&1?"03":"02",ye=c.fromHex(K+b(Y)),fe=u(Y),ke=o(-z*fe),tt=o(j*fe),me=c.BASE.multiplyAndAddUnsafe(ye,ke,tt);if(!me)throw new Error("point at infinify");return me.assertValidity(),me}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new h(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return Ze(this.toDERHex())}toDERHex(){return Me.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ze(this.toCompactHex())}toCompactHex(){return b(this.r)+b(this.s)}}const g={isValidPrivateKey(I){try{return d(I),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const I=vs(t.n);return Bc(t.randomBytes(I),t.n)},precompute(I=8,B=c.BASE){return B._setWindowSize(I),B.multiply(BigInt(3)),B}};function w(I,B=!0){return c.fromPrivateKey(I).toRawBytes(B)}function x(I){const B=I instanceof Uint8Array,R=typeof I=="string",j=(B||R)&&I.length;return B?j===a||j===s:R?j===2*a||j===2*s:I instanceof c}function P(I,B,R=!0){if(x(I))throw new Error("first arg must be private key");if(!x(B))throw new Error("second arg must be public key");return c.fromHex(B).multiply(d(I)).toRawBytes(R)}const T=t.bits2int||function(I){const B=$e(I),R=I.length*8-t.nBitLength;return R>0?B>>BigInt(R):B},E=t.bits2int_modN||function(I){return o(T(I))},A=Ar(t.nBitLength);function C(I){if(typeof I!="bigint")throw new Error("bigint expected");if(!(ue<=I&&I<A))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Ye(I,t.nByteLength)}function $(I,B,R=S){if(["recovered","canonical"].some(Ce=>Ce in R))throw new Error("sign() legacy options not supported");const{hash:j,randomBytes:N}=t;let{lowS:z,prehash:Y,extraEntropy:K}=R;z==null&&(z=!0),I=ne("msgHash",I),Y&&(I=ne("prehashed msgHash",j(I)));const ye=E(I),fe=d(B),ke=[C(fe),C(ye)];if(K!=null){const Ce=K===!0?N(n.BYTES):K;ke.push(ne("extraEntropy",Ce))}const tt=xt(...ke),me=ye;function ln(Ce){const je=T(Ce);if(!y(je))return;const Ir=u(je),Le=c.BASE.multiply(je).toAffine(),te=o(Le.x);if(te===ue)return;const Ue=o(Ir*o(me+te*fe));if(Ue===ue)return;let Cr=(Le.x===te?0:2)|Number(Le.y&Q),Br=Ue;return z&&f(Ue)&&(Br=p(Ue),Cr^=1),new h(te,Br,Cr)}return{seed:tt,k2sig:ln}}const S={lowS:t.lowS,prehash:!1},k={lowS:t.lowS,prehash:!1};function F(I,B,R=S){const{seed:j,k2sig:N}=$(I,B,R),z=t;return gs(z.hash.outputLen,z.nByteLength,z.hmac)(j,N)}c.BASE._setWindowSize(8);function Z(I,B,R,j=k){var Le;const N=I;if(B=ne("msgHash",B),R=ne("publicKey",R),"strict"in j)throw new Error("options.strict was renamed to lowS");const{lowS:z,prehash:Y}=j;let K,ye;try{if(typeof N=="string"||N instanceof Uint8Array)try{K=h.fromDER(N)}catch(te){if(!(te instanceof Me.Err))throw te;K=h.fromCompact(N)}else if(typeof N=="object"&&typeof N.r=="bigint"&&typeof N.s=="bigint"){const{r:te,s:Ue}=N;K=new h(te,Ue)}else throw new Error("PARSE");ye=c.fromHex(R)}catch(te){if(te.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(z&&K.hasHighS())return!1;Y&&(B=t.hash(B));const{r:fe,s:ke}=K,tt=E(B),me=u(ke),ln=o(tt*me),Ce=o(fe*me),je=(Le=c.BASE.multiplyAndAddUnsafe(ye,ln,Ce))==null?void 0:Le.toAffine();return je?o(je.x)===fe:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:P,sign:F,verify:Z,ProjectivePoint:c,Signature:h,utils:g}}class Es extends Vn{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,oi(t);const r=Kt(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const a=this.blockLen,s=new Uint8Array(a);s.set(r.length>a?t.create().update(r).digest():r);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),s.fill(0)}update(t){return _e(this),this.iHash.update(t),this}digestInto(t){_e(this),Wn(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:a,destroyed:s,blockLen:i,outputLen:o}=this;return t=t,t.finished=a,t.destroyed=s,t.blockLen=i,t.outputLen=o,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Ps=(e,t,n)=>new Es(e,t).update(n).digest();Ps.create=(e,t)=>new Es(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jc(e){return{hash:e,hmac:(t,...n)=>Ps(e,t,hi(...n)),randomBytes:gi}}function Lc(e,t){const n=r=>kc({...e,...jc(r)});return Object.freeze({...n(t),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const As=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ra=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Uc=BigInt(1),qn=BigInt(2),aa=(e,t)=>(e+t/qn)/t;function zc(e){const t=As,n=BigInt(3),r=BigInt(6),a=BigInt(11),s=BigInt(22),i=BigInt(23),o=BigInt(44),u=BigInt(88),c=e*e*e%t,d=c*c*e%t,l=J(d,n,t)*d%t,y=J(l,n,t)*d%t,b=J(y,qn,t)*c%t,f=J(b,a,t)*b%t,p=J(f,s,t)*f%t,m=J(p,o,t)*p%t,h=J(m,u,t)*m%t,g=J(h,o,t)*p%t,w=J(g,n,t)*d%t,x=J(w,i,t)*f%t,P=J(x,r,t)*c%t,T=J(P,qn,t);if(!_n.eql(_n.sqr(T),e))throw new Error("Cannot find square root");return T}const _n=Cc(As,void 0,void 0,{sqrt:zc}),Is=Lc({a:BigInt(0),b:BigInt(7),Fp:_n,n:ra,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=ra,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Uc*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),o=aa(s*e,t),u=aa(-r*e,t);let c=_(e-o*n-u*a,t),d=_(-o*r-u*s,t);const l=c>i,y=d>i;if(l&&(c=t-c),y&&(d=t-d),c>i||d>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:l,k1:c,k2neg:y,k2:d}}}},Da);BigInt(0);Is.ProjectivePoint;function Hc({r:e,s:t,v:n,yParity:r}){const a=(()=>{if(r===0||r===1)return r;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new Is.Signature(qe(e),qe(t)).toCompactHex()}${a===0?"1b":"1c"}`}async function Cs(e,{address:t,hash:n,signature:r,...a}){const s=X(r)?r:typeof r=="object"&&"r"in r&&"s"in r?Hc(r):q(r);try{const{data:i}=await M(e,Mt,"call")({data:fs({abi:_o,args:[t,n,s],bytecode:uc}),...a});return gc(i??"0x0","0x1")}catch(i){if(i instanceof Oa)return!1;throw i}}async function Dc(e,{address:t,message:n,signature:r,...a}){const s=tc(n);return Cs(e,{address:t,hash:s,signature:r,...a})}async function qc(e,t){const{address:n,signature:r,message:a,primaryType:s,types:i,domain:o,...u}=t,c=Zu({message:a,primaryType:s,types:i,domain:o});return Cs(e,{address:n,hash:c,signature:r,...u})}function Bs(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:a,poll:s,pollingInterval:i=e.pollingInterval}){const o=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket");let u;return o?(()=>{const l=D(["watchBlockNumber",e.uid,t,n,i]);return Pe(l,{onBlockNumber:r,onError:a},y=>St(async()=>{var b;try{const f=await M(e,$t,"getBlockNumber")({cacheTime:0});if(u){if(f===u)return;if(f-u>1&&n)for(let p=u+1n;p<f;p++)y.onBlockNumber(p,u),u=p}(!u||f>u)&&(y.onBlockNumber(f,u),u=f)}catch(f){(b=y.onError)==null||b.call(y,f)}},{emitOnBegin:t,interval:i}))})():(()=>{const l=D(["watchBlockNumber",e.uid,t,n]);return Pe(l,{onBlockNumber:r,onError:a},y=>{let b=!0,f=()=>b=!1;return(async()=>{try{const p=(()=>{if(e.transport.type==="fallback"){const h=e.transport.transports.find(g=>g.config.type==="webSocket");return h?h.value:e.transport}return e.transport})(),{unsubscribe:m}=await p.subscribe({params:["newHeads"],onData(h){var w;if(!b)return;const g=qe((w=h.result)==null?void 0:w.number);y.onBlockNumber(g,u),u=g},onError(h){var g;(g=y.onError)==null||g.call(y,h)}});f=m,b||f()}catch(p){a==null||a(p)}})(),()=>f()})})()}async function _c(e,{confirmations:t=1,hash:n,onReplaced:r,pollingInterval:a=e.pollingInterval,retryCount:s=6,retryDelay:i=({count:u})=>~~(1<<u)*200,timeout:o}){const u=D(["waitForTransactionReceipt",e.uid,n]);let c,d,l,y=!1;return new Promise((b,f)=>{o&&setTimeout(()=>f(new mo({hash:n})),o);const p=Pe(u,{onReplaced:r,resolve:b,reject:f},m=>{const h=M(e,Bs,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:a,async onBlockNumber(g){if(y)return;let w=g;const x=P=>{h(),P(),p()};try{if(l){if(t>1&&(!l.blockNumber||w-l.blockNumber+1n<t))return;x(()=>m.resolve(l));return}if(c||(y=!0,await Ln(async()=>{c=await M(e,vr,"getTransaction")({hash:n}),c.blockNumber&&(w=c.blockNumber)},{delay:i,retryCount:s}),y=!1),l=await M(e,zn,"getTransactionReceipt")({hash:n}),t>1&&(!l.blockNumber||w-l.blockNumber+1n<t))return;x(()=>m.resolve(l))}catch(P){if(P instanceof Sa||P instanceof $a){if(!c){y=!1;return}try{d=c,y=!0;const T=await Ln(()=>M(e,xe,"getBlock")({blockNumber:w,includeTransactions:!0}),{delay:i,retryCount:s,shouldRetry:({error:C})=>C instanceof Fa});y=!1;const E=T.transactions.find(({from:C,nonce:$})=>C===d.from&&$===d.nonce);if(!E||(l=await M(e,zn,"getTransactionReceipt")({hash:E.hash}),t>1&&(!l.blockNumber||w-l.blockNumber+1n<t)))return;let A="replaced";E.to===d.to&&E.value===d.value?A="repriced":E.from===E.to&&E.value===0n&&(A="cancelled"),x(()=>{var C;(C=m.onReplaced)==null||C.call(m,{reason:A,replacedTransaction:d,transaction:E,transactionReceipt:l}),m.resolve(l)})}catch(T){x(()=>m.reject(T))}}else x(()=>m.reject(P))}}})})})}function Gc(e,{blockTag:t="latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:a,onError:s,includeTransactions:i,poll:o,pollingInterval:u=e.pollingInterval}){const c=typeof o<"u"?o:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),d=i??!1;let l;return c?(()=>{const f=D(["watchBlocks",e.uid,t,n,r,d,u]);return Pe(f,{onBlock:a,onError:s},p=>St(async()=>{var m;try{const h=await M(e,xe,"getBlock")({blockTag:t,includeTransactions:d});if(h.number&&(l!=null&&l.number)){if(h.number===l.number)return;if(h.number-l.number>1&&n)for(let g=(l==null?void 0:l.number)+1n;g<h.number;g++){const w=await M(e,xe,"getBlock")({blockNumber:g,includeTransactions:d});p.onBlock(w,l),l=w}}(!(l!=null&&l.number)||t==="pending"&&!(h!=null&&h.number)||h.number&&h.number>l.number)&&(p.onBlock(h,l),l=h)}catch(h){(m=p.onError)==null||m.call(p,h)}},{emitOnBegin:r,interval:u}))})():(()=>{let f=!0,p=()=>f=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const g=e.transport.transports.find(w=>w.config.type==="webSocket");return g?g.value:e.transport}return e.transport})(),{unsubscribe:h}=await m.subscribe({params:["newHeads"],onData(g){var P,T,E;if(!f)return;const x=(((E=(T=(P=e.chain)==null?void 0:P.formatters)==null?void 0:T.block)==null?void 0:E.format)||ja)(g.result);a(x,l),l=x},onError(g){s==null||s(g)}});p=h,f||p()}catch(m){s==null||s(m)}})(),()=>p()})()}function Wc(e,{address:t,args:n,batch:r=!0,event:a,events:s,fromBlock:i,onError:o,onLogs:u,poll:c,pollingInterval:d=e.pollingInterval,strict:l}){const y=typeof c<"u"?c:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),b=l??!1;return y?(()=>{const m=D(["watchEvent",t,n,r,e.uid,a,d,i]);return Pe(m,{onLogs:u,onError:o},h=>{let g;i!==void 0&&(g=i-1n);let w,x=!1;const P=St(async()=>{var T;if(!x){try{w=await M(e,is,"createEventFilter")({address:t,args:n,event:a,events:s,strict:b,fromBlock:i})}catch{}x=!0;return}try{let E;if(w)E=await M(e,rn,"getFilterChanges")({filter:w});else{const A=await M(e,$t,"getBlockNumber")({});g&&g!==A?E=await M(e,pr,"getLogs")({address:t,args:n,event:a,events:s,fromBlock:g+1n,toBlock:A}):E=[],g=A}if(E.length===0)return;if(r)h.onLogs(E);else for(const A of E)h.onLogs([A])}catch(E){w&&E instanceof Ne&&(x=!1),(T=h.onError)==null||T.call(h,E)}},{emitOnBegin:!0,interval:d});return async()=>{w&&await M(e,an,"uninstallFilter")({filter:w}),P()}})})():(()=>{let m=!0,h=()=>m=!1;return(async()=>{try{const g=(()=>{if(e.transport.type==="fallback"){const T=e.transport.transports.find(E=>E.config.type==="webSocket");return T?T.value:e.transport}return e.transport})(),w=s??(a?[a]:void 0);let x=[];w&&(x=[w.flatMap(T=>At({abi:[T],eventName:T.name,args:n}))],a&&(x=x[0]));const{unsubscribe:P}=await g.subscribe({params:["logs",{address:t,topics:x}],onData(T){var A;if(!m)return;const E=T.result;try{const{eventName:C,args:$}=lr({abi:w??[],data:E.data,topics:E.topics,strict:b}),S=Ee(E,{args:$,eventName:C});u([S])}catch(C){let $,S;if(C instanceof it||C instanceof Zt){if(l)return;$=C.abiItem.name,S=(A=C.abiItem.inputs)==null?void 0:A.some(F=>!("name"in F&&F.name))}const k=Ee(E,{args:S?[]:{},eventName:$});u([k])}},onError(T){o==null||o(T)}});h=P,m||h()}catch(g){o==null||o(g)}})(),()=>h()})()}function Vc(e,{batch:t=!0,onError:n,onTransactions:r,poll:a,pollingInterval:s=e.pollingInterval}){return(typeof a<"u"?a:e.transport.type!=="webSocket")?(()=>{const c=D(["watchPendingTransactions",e.uid,t,s]);return Pe(c,{onTransactions:r,onError:n},d=>{let l;const y=St(async()=>{var b;try{if(!l)try{l=await M(e,os,"createPendingTransactionFilter")({});return}catch(p){throw y(),p}const f=await M(e,rn,"getFilterChanges")({filter:l});if(f.length===0)return;if(t)d.onTransactions(f);else for(const p of f)d.onTransactions([p])}catch(f){(b=d.onError)==null||b.call(d,f)}},{emitOnBegin:!0,interval:s});return async()=>{l&&await M(e,an,"uninstallFilter")({filter:l}),y()}})})():(()=>{let c=!0,d=()=>c=!1;return(async()=>{try{const{unsubscribe:l}=await e.transport.subscribe({params:["newPendingTransactions"],onData(y){if(!c)return;const b=y.result;r([b])},onError(y){n==null||n(y)}});d=l,c||d()}catch(l){n==null||n(l)}})(),()=>d()})()}function Zc(e){return{call:t=>Mt(e,t),createBlockFilter:()=>Lu(e),createContractEventFilter:t=>tr(e,t),createEventFilter:t=>is(e,t),createPendingTransactionFilter:()=>os(e),estimateContractGas:t=>Wa(e,t),estimateGas:t=>cr(e,t),getBalance:t=>Uu(e,t),getBlobBaseFee:()=>zu(e),getBlock:t=>xe(e,t),getBlockNumber:t=>$t(e,t),getBlockTransactionCount:t=>Hu(e,t),getBytecode:t=>Du(e,t),getChainId:()=>Bt(e),getContractEvents:t=>yr(e,t),getEnsAddress:t=>xu(e,t),getEnsAvatar:t=>Nu(e,t),getEnsName:t=>ku(e,t),getEnsResolver:t=>ju(e,t),getEnsText:t=>ss(e,t),getFeeHistory:t=>_u(e,t),estimateFeesPerGas:t=>Co(e,t),getFilterChanges:t=>rn(e,t),getFilterLogs:t=>Gu(e,t),getGasPrice:()=>or(e),getLogs:t=>pr(e,t),getProof:t=>ac(e,t),estimateMaxPriorityFeePerGas:t=>Io(e,t),getStorageAt:t=>sc(e,t),getTransaction:t=>vr(e,t),getTransactionConfirmations:t=>ic(e,t),getTransactionCount:t=>Ua(e,t),getTransactionReceipt:t=>zn(e,t),multicall:t=>oc(e,t),prepareTransactionRequest:t=>nn(e,t),readContract:t=>pe(e,t),sendRawTransaction:t=>fr(e,t),simulateContract:t=>Ja(e,t),verifyMessage:t=>Dc(e,t),verifyTypedData:t=>qc(e,t),uninstallFilter:t=>an(e,t),waitForTransactionReceipt:t=>_c(e,t),watchBlocks:t=>Gc(e,t),watchBlockNumber:t=>Bs(e,t),watchContractEvent:t=>Qa(e,t),watchEvent:t=>Wc(e,t),watchPendingTransactions:t=>Vc(e,t)}}function Ms(e){const{key:t="public",name:n="Public Client"}=e;return ts({...e,key:t,name:n,type:"publicClient"}).extend(Zc)}function Yc(e,t){const{abi:n,args:r,bytecode:a,...s}=t,i=fs({abi:n,args:r,bytecode:a});return mr(e,{...s,data:i})}async function Kc(e){var n;return((n=e.account)==null?void 0:n.type)==="local"?[e.account.address]:(await e.request({method:"eth_accounts"})).map(r=>Jt(r))}async function Jc(e){return await e.request({method:"wallet_getPermissions"})}async function Qc(e){return(await e.request({method:"eth_requestAccounts"},{retryCount:0})).map(n=>Ri(n))}async function Xc(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function el(e,{account:t=e.account,message:n}){if(!t)throw new sn({docsPath:"/docs/actions/wallet/signMessage"});const r=ee(t);if(r.type==="local")return r.signMessage({message:n});const a=typeof n=="string"?Gn(n):n.raw instanceof Uint8Array?Ae(n.raw):n.raw;return e.request({method:"personal_sign",params:[a,r.address]},{retryCount:0})}async function tl(e,t){var c,d,l,y;const{account:n=e.account,chain:r=e.chain,...a}=t;if(!n)throw new sn({docsPath:"/docs/actions/wallet/signTransaction"});const s=ee(n);Ct({account:s,...t});const i=await M(e,Bt,"getChainId")({});r!==null&&Xa({currentChainId:i,chain:r});const o=(r==null?void 0:r.formatters)||((c=e.chain)==null?void 0:c.formatters),u=((d=o==null?void 0:o.transactionRequest)==null?void 0:d.format)||tn;return s.type==="local"?s.signTransaction({...a,chainId:i},{serializer:(y=(l=e.chain)==null?void 0:l.serializers)==null?void 0:y.transaction}):await e.request({method:"eth_signTransaction",params:[{...u(a),chainId:O(i),from:s.address}]},{retryCount:0})}async function nl(e,t){const{account:n=e.account,domain:r,message:a,primaryType:s}=t;if(!n)throw new sn({docsPath:"/docs/actions/wallet/signTypedData"});const i=ee(n),o={EIP712Domain:ys({domain:r}),...t.types};if(ps({domain:r,message:a,primaryType:s,types:o}),i.type==="local")return i.signTypedData({domain:r,message:a,primaryType:s,types:o});const u=D({domain:r??{},message:a,primaryType:s,types:o},(c,d)=>X(d)?d.toLowerCase():d);return e.request({method:"eth_signTypedData_v4",params:[i.address,u]},{retryCount:0})}async function rl(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:O(t)}]},{retryCount:0})}async function al(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}function sl(e){return{addChain:t=>uu(e,t),deployContract:t=>Yc(e,t),getAddresses:()=>Kc(e),getChainId:()=>Bt(e),getPermissions:()=>Jc(e),prepareTransactionRequest:t=>nn(e,t),requestAddresses:()=>Qc(e),requestPermissions:t=>Xc(e,t),sendRawTransaction:t=>fr(e,t),sendTransaction:t=>mr(e,t),signMessage:t=>el(e,t),signTransaction:t=>tl(e,t),signTypedData:t=>nl(e,t),switchChain:t=>rl(e,t),watchAsset:t=>al(e,t),writeContract:t=>es(e,t)}}function Ss(e){const{key:t="wallet",name:n="Wallet Client",transport:r}=e;return ts({...e,key:t,name:n,transport:r,type:"walletClient"}).extend(sl)}const il=Tr({id:31337,name:"Anvil",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}}),ol=Tr({id:17e3,name:"Holesky",nativeCurrency:{name:"Holesky Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky-rpc.publicnode.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://holesky.etherscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:77},ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",blockCreated:801613},ensUniversalResolver:{address:"0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",blockCreated:973484}},testnet:!0}),ul=Tr({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});var we=(e=>(e.Mainnet="mainnet",e.Holesky="holesky",e.Anvil="anvil",e))(we||{});const Et={mainnet:ul,holesky:ol,anvil:il},cl=[{type:"constructor",inputs:[{name:"stETH",type:"address",internalType:"contract IStETH"},{name:"weth",type:"address",internalType:"contract IWETH"},{name:"lidoWithdrawalQueue",type:"address",internalType:"contract ILidoWithdrawalQueue"},{name:"stETHStrategy",type:"address",internalType:"contract IStrategy"},{name:"eigenStrategyManager",type:"address",internalType:"contract IEigenLayer"},{name:"oracle",type:"address",internalType:"contract IPufferOracle"},{name:"delegationManager",type:"address",internalType:"contract IDelegationManager"}],stateMutability:"nonpayable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"DOMAIN_SEPARATOR",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"PUFFER_ORACLE",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IPufferOracle"}],stateMutability:"view"},{type:"function",name:"UPGRADE_INTERFACE_VERSION",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"allowance",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"spender",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"approve",inputs:[{name:"spender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"asset",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"authority",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"balanceOf",inputs:[{name:"account",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"burn",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claimWithdrawalFromEigenLayer",inputs:[{name:"queuedWithdrawal",type:"tuple",internalType:"struct IEigenLayer.QueuedWithdrawal",components:[{name:"strategies",type:"address[]",internalType:"contract IStrategy[]"},{name:"shares",type:"uint256[]",internalType:"uint256[]"},{name:"depositor",type:"address",internalType:"address"},{name:"withdrawerAndNonce",type:"tuple",internalType:"struct IEigenLayer.WithdrawerAndNonce",components:[{name:"withdrawer",type:"address",internalType:"address"},{name:"nonce",type:"uint96",internalType:"uint96"}]},{name:"withdrawalStartBlock",type:"uint32",internalType:"uint32"},{name:"delegatedAddress",type:"address",internalType:"address"}]},{name:"tokens",type:"address[]",internalType:"contract IERC20[]"},{name:"middlewareTimesIndex",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claimWithdrawalFromEigenLayerM2",inputs:[{name:"queuedWithdrawal",type:"tuple",internalType:"struct IEigenLayer.QueuedWithdrawal",components:[{name:"strategies",type:"address[]",internalType:"contract IStrategy[]"},{name:"shares",type:"uint256[]",internalType:"uint256[]"},{name:"depositor",type:"address",internalType:"address"},{name:"withdrawerAndNonce",type:"tuple",internalType:"struct IEigenLayer.WithdrawerAndNonce",components:[{name:"withdrawer",type:"address",internalType:"address"},{name:"nonce",type:"uint96",internalType:"uint96"}]},{name:"withdrawalStartBlock",type:"uint32",internalType:"uint32"},{name:"delegatedAddress",type:"address",internalType:"address"}]},{name:"tokens",type:"address[]",internalType:"contract IERC20[]"},{name:"middlewareTimesIndex",type:"uint256",internalType:"uint256"},{name:"nonce",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claimWithdrawalsFromLido",inputs:[{name:"requestIds",type:"uint256[]",internalType:"uint256[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"convertToAssets",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"convertToShares",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"convertToSharesUp",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"decimals",inputs:[],outputs:[{name:"",type:"uint8",internalType:"uint8"}],stateMutability:"pure"},{type:"function",name:"deposit",inputs:[{name:"assets",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"depositETH",inputs:[{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"payable"},{type:"function",name:"depositStETH",inputs:[{name:"stETHSharesAmount",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"depositToEigenLayer",inputs:[{name:"amount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"getELBackingEthAmount",inputs:[],outputs:[{name:"ethAmount",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getExitFeeBasisPoints",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getPendingLidoETHAmount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getRemainingAssetsDailyWithdrawalLimit",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"initialize",inputs:[{name:"accessManager",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"initiateETHWithdrawalsFromLido",inputs:[{name:"amounts",type:"uint256[]",internalType:"uint256[]"}],outputs:[{name:"requestIds",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"nonpayable"},{type:"function",name:"initiateStETHWithdrawalFromEigenLayer",inputs:[{name:"sharesToWithdraw",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isConsumingScheduledOp",inputs:[],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"maxDeposit",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxMint",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxRedeem",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"maxShares",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxWithdraw",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"maxAssets",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"mint",inputs:[{name:"shares",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"name",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"nonces",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"permit",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"spender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"deadline",type:"uint256",internalType:"uint256"},{name:"v",type:"uint8",internalType:"uint8"},{name:"r",type:"bytes32",internalType:"bytes32"},{name:"s",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"previewDeposit",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewMint",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewRedeem",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewWithdraw",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"proxiableUUID",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"redeem",inputs:[{name:"shares",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"setAuthority",inputs:[{name:"newAuthority",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setDailyWithdrawalLimit",inputs:[{name:"newLimit",type:"uint96",internalType:"uint96"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setExitFeeBasisPoints",inputs:[{name:"newExitFeeBasisPoints",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"symbol",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"totalAssets",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"totalSupply",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"transfer",inputs:[{name:"to",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"transferETH",inputs:[{name:"to",type:"address",internalType:"address"},{name:"ethAmount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"upgradeToAndCall",inputs:[{name:"newImplementation",type:"address",internalType:"address"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"withdraw",inputs:[{name:"assets",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"spender",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"AssetsWithdrawnToday",inputs:[{name:"withdrawalAmount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"AuthorityUpdated",inputs:[{name:"authority",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ClaimedWithdrawals",inputs:[{name:"requestIds",type:"uint256[]",indexed:!1,internalType:"uint256[]"}],anonymous:!1},{type:"event",name:"DailyWithdrawalLimitReset",inputs:[],anonymous:!1},{type:"event",name:"DailyWithdrawalLimitSet",inputs:[{name:"oldLimit",type:"uint96",indexed:!1,internalType:"uint96"},{name:"newLimit",type:"uint96",indexed:!1,internalType:"uint96"}],anonymous:!1},{type:"event",name:"Deposit",inputs:[{name:"sender",type:"address",indexed:!0,internalType:"address"},{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"assets",type:"uint256",indexed:!1,internalType:"uint256"},{name:"shares",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"EIP712DomainChanged",inputs:[],anonymous:!1},{type:"event",name:"ExitFeeBasisPointsSet",inputs:[{name:"previousFee",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newFee",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Initialized",inputs:[{name:"version",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"LidoWithdrawal",inputs:[{name:"expectedWithdrawal",type:"uint256",indexed:!1,internalType:"uint256"},{name:"actualWithdrawal",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RequestedWithdrawals",inputs:[{name:"requestIds",type:"uint256[]",indexed:!1,internalType:"uint256[]"}],anonymous:!1},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"TransferredETH",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Withdraw",inputs:[{name:"sender",type:"address",indexed:!0,internalType:"address"},{name:"receiver",type:"address",indexed:!0,internalType:"address"},{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"assets",type:"uint256",indexed:!1,internalType:"uint256"},{name:"shares",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AccessManagedInvalidAuthority",inputs:[{name:"authority",type:"address",internalType:"address"}]},{type:"error",name:"AccessManagedRequiredDelay",inputs:[{name:"caller",type:"address",internalType:"address"},{name:"delay",type:"uint32",internalType:"uint32"}]},{type:"error",name:"AccessManagedUnauthorized",inputs:[{name:"caller",type:"address",internalType:"address"}]},{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:"DepositAndWithdrawalForbidden",inputs:[]},{type:"error",name:"ECDSAInvalidSignature",inputs:[]},{type:"error",name:"ECDSAInvalidSignatureLength",inputs:[{name:"length",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ECDSAInvalidSignatureS",inputs:[{name:"s",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{name:"implementation",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ERC20InsufficientAllowance",inputs:[{name:"spender",type:"address",internalType:"address"},{name:"allowance",type:"uint256",internalType:"uint256"},{name:"needed",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC20InsufficientBalance",inputs:[{name:"sender",type:"address",internalType:"address"},{name:"balance",type:"uint256",internalType:"uint256"},{name:"needed",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC20InvalidApprover",inputs:[{name:"approver",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidReceiver",inputs:[{name:"receiver",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidSender",inputs:[{name:"sender",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidSpender",inputs:[{name:"spender",type:"address",internalType:"address"}]},{type:"error",name:"ERC2612ExpiredSignature",inputs:[{name:"deadline",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC2612InvalidSigner",inputs:[{name:"signer",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC4626ExceededMaxDeposit",inputs:[{name:"receiver",type:"address",internalType:"address"},{name:"assets",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxMint",inputs:[{name:"receiver",type:"address",internalType:"address"},{name:"shares",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxRedeem",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"shares",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxWithdraw",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"assets",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ETHTransferFailed",inputs:[]},{type:"error",name:"EnumerableMapNonexistentKey",inputs:[{name:"key",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"FailedInnerCall",inputs:[]},{type:"error",name:"InvalidAccountNonce",inputs:[{name:"account",type:"address",internalType:"address"},{name:"currentNonce",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidExitFeeBasisPoints",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidWithdrawal",inputs:[]},{type:"error",name:"MathOverflowedMulDiv",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{name:"slot",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"WithdrawalsAreDisabled",inputs:[]}],ll=[{type:"constructor",inputs:[{name:"stETH",type:"address",internalType:"contract IStETH"},{name:"weth",type:"address",internalType:"contract IWETH"},{name:"lidoWithdrawalQueue",type:"address",internalType:"contract ILidoWithdrawalQueue"},{name:"stETHStrategy",type:"address",internalType:"contract IStrategy"},{name:"eigenStrategyManager",type:"address",internalType:"contract IEigenLayer"},{name:"oracle",type:"address",internalType:"contract IPufferOracle"}],stateMutability:"nonpayable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"DOMAIN_SEPARATOR",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"PUFFER_ORACLE",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IPufferOracle"}],stateMutability:"view"},{type:"function",name:"UPGRADE_INTERFACE_VERSION",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"allowance",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"spender",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"approve",inputs:[{name:"spender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"asset",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"authority",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"balanceOf",inputs:[{name:"account",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"burn",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claimWithdrawalFromEigenLayer",inputs:[{name:"queuedWithdrawal",type:"tuple",internalType:"struct IEigenLayer.QueuedWithdrawal",components:[{name:"strategies",type:"address[]",internalType:"contract IStrategy[]"},{name:"shares",type:"uint256[]",internalType:"uint256[]"},{name:"depositor",type:"address",internalType:"address"},{name:"withdrawerAndNonce",type:"tuple",internalType:"struct IEigenLayer.WithdrawerAndNonce",components:[{name:"withdrawer",type:"address",internalType:"address"},{name:"nonce",type:"uint96",internalType:"uint96"}]},{name:"withdrawalStartBlock",type:"uint32",internalType:"uint32"},{name:"delegatedAddress",type:"address",internalType:"address"}]},{name:"tokens",type:"address[]",internalType:"contract IERC20[]"},{name:"middlewareTimesIndex",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claimWithdrawalsFromLido",inputs:[{name:"requestIds",type:"uint256[]",internalType:"uint256[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"convertToAssets",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"convertToShares",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"convertToSharesUp",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"decimals",inputs:[],outputs:[{name:"",type:"uint8",internalType:"uint8"}],stateMutability:"pure"},{type:"function",name:"deposit",inputs:[{name:"assets",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"depositETH",inputs:[{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"payable"},{type:"function",name:"depositStETH",inputs:[{name:"stETHSharesAmount",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"depositToEigenLayer",inputs:[{name:"amount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"getELBackingEthAmount",inputs:[],outputs:[{name:"ethAmount",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getExitFeeBasisPoints",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getPendingLidoETHAmount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getRemainingAssetsDailyWithdrawalLimit",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"initialize",inputs:[{name:"accessManager",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"initiateETHWithdrawalsFromLido",inputs:[{name:"amounts",type:"uint256[]",internalType:"uint256[]"}],outputs:[{name:"requestIds",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"nonpayable"},{type:"function",name:"initiateStETHWithdrawalFromEigenLayer",inputs:[{name:"sharesToWithdraw",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isConsumingScheduledOp",inputs:[],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"maxDeposit",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxMint",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxRedeem",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"maxShares",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxWithdraw",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"maxAssets",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"mint",inputs:[{name:"shares",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"name",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"nonces",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"permit",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"spender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"deadline",type:"uint256",internalType:"uint256"},{name:"v",type:"uint8",internalType:"uint8"},{name:"r",type:"bytes32",internalType:"bytes32"},{name:"s",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"previewDeposit",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewMint",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewRedeem",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewWithdraw",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"proxiableUUID",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"redeem",inputs:[{name:"shares",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"setAuthority",inputs:[{name:"newAuthority",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setDailyWithdrawalLimit",inputs:[{name:"newLimit",type:"uint96",internalType:"uint96"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setExitFeeBasisPoints",inputs:[{name:"newExitFeeBasisPoints",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"symbol",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"totalAssets",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"totalSupply",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"transfer",inputs:[{name:"to",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"transferETH",inputs:[{name:"to",type:"address",internalType:"address"},{name:"ethAmount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"upgradeToAndCall",inputs:[{name:"newImplementation",type:"address",internalType:"address"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"withdraw",inputs:[{name:"assets",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"spender",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"AssetsWithdrawnToday",inputs:[{name:"withdrawalAmount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"AuthorityUpdated",inputs:[{name:"authority",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ClaimedWithdrawals",inputs:[{name:"requestIds",type:"uint256[]",indexed:!1,internalType:"uint256[]"}],anonymous:!1},{type:"event",name:"DailyWithdrawalLimitReset",inputs:[],anonymous:!1},{type:"event",name:"DailyWithdrawalLimitSet",inputs:[{name:"oldLimit",type:"uint96",indexed:!1,internalType:"uint96"},{name:"newLimit",type:"uint96",indexed:!1,internalType:"uint96"}],anonymous:!1},{type:"event",name:"Deposit",inputs:[{name:"sender",type:"address",indexed:!0,internalType:"address"},{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"assets",type:"uint256",indexed:!1,internalType:"uint256"},{name:"shares",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"EIP712DomainChanged",inputs:[],anonymous:!1},{type:"event",name:"ExitFeeBasisPointsSet",inputs:[{name:"previousFee",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newFee",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Initialized",inputs:[{name:"version",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"LidoWithdrawal",inputs:[{name:"expectedWithdrawal",type:"uint256",indexed:!1,internalType:"uint256"},{name:"actualWithdrawal",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RequestedWithdrawals",inputs:[{name:"requestIds",type:"uint256[]",indexed:!1,internalType:"uint256[]"}],anonymous:!1},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"TransferredETH",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Withdraw",inputs:[{name:"sender",type:"address",indexed:!0,internalType:"address"},{name:"receiver",type:"address",indexed:!0,internalType:"address"},{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"assets",type:"uint256",indexed:!1,internalType:"uint256"},{name:"shares",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AccessManagedInvalidAuthority",inputs:[{name:"authority",type:"address",internalType:"address"}]},{type:"error",name:"AccessManagedRequiredDelay",inputs:[{name:"caller",type:"address",internalType:"address"},{name:"delay",type:"uint32",internalType:"uint32"}]},{type:"error",name:"AccessManagedUnauthorized",inputs:[{name:"caller",type:"address",internalType:"address"}]},{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:"DepositAndWithdrawalForbidden",inputs:[]},{type:"error",name:"ECDSAInvalidSignature",inputs:[]},{type:"error",name:"ECDSAInvalidSignatureLength",inputs:[{name:"length",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ECDSAInvalidSignatureS",inputs:[{name:"s",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{name:"implementation",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ERC20InsufficientAllowance",inputs:[{name:"spender",type:"address",internalType:"address"},{name:"allowance",type:"uint256",internalType:"uint256"},{name:"needed",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC20InsufficientBalance",inputs:[{name:"sender",type:"address",internalType:"address"},{name:"balance",type:"uint256",internalType:"uint256"},{name:"needed",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC20InvalidApprover",inputs:[{name:"approver",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidReceiver",inputs:[{name:"receiver",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidSender",inputs:[{name:"sender",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidSpender",inputs:[{name:"spender",type:"address",internalType:"address"}]},{type:"error",name:"ERC2612ExpiredSignature",inputs:[{name:"deadline",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC2612InvalidSigner",inputs:[{name:"signer",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC4626ExceededMaxDeposit",inputs:[{name:"receiver",type:"address",internalType:"address"},{name:"assets",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxMint",inputs:[{name:"receiver",type:"address",internalType:"address"},{name:"shares",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxRedeem",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"shares",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxWithdraw",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"assets",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ETHTransferFailed",inputs:[]},{type:"error",name:"EnumerableMapNonexistentKey",inputs:[{name:"key",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"FailedInnerCall",inputs:[]},{type:"error",name:"InvalidAccountNonce",inputs:[{name:"account",type:"address",internalType:"address"},{name:"currentNonce",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidExitFeeBasisPoints",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidWithdrawal",inputs:[]},{type:"error",name:"MathOverflowedMulDiv",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{name:"slot",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"WithdrawalsAreDisabled",inputs:[]}],dl=[{type:"constructor",inputs:[{name:"stETH",type:"address",internalType:"contract IStETH"},{name:"weth",type:"address",internalType:"contract IWETH"},{name:"lidoWithdrawalQueue",type:"address",internalType:"contract ILidoWithdrawalQueue"},{name:"stETHStrategy",type:"address",internalType:"contract IStrategy"},{name:"eigenStrategyManager",type:"address",internalType:"contract IEigenLayer"},{name:"oracle",type:"address",internalType:"contract IPufferOracle"}],stateMutability:"nonpayable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"DOMAIN_SEPARATOR",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"PUFFER_ORACLE",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IPufferOracle"}],stateMutability:"view"},{type:"function",name:"UPGRADE_INTERFACE_VERSION",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"allowance",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"spender",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"approve",inputs:[{name:"spender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"asset",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"authority",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"balanceOf",inputs:[{name:"account",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"burn",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claimWithdrawalFromEigenLayer",inputs:[{name:"queuedWithdrawal",type:"tuple",internalType:"struct IEigenLayer.QueuedWithdrawal",components:[{name:"strategies",type:"address[]",internalType:"contract IStrategy[]"},{name:"shares",type:"uint256[]",internalType:"uint256[]"},{name:"depositor",type:"address",internalType:"address"},{name:"withdrawerAndNonce",type:"tuple",internalType:"struct IEigenLayer.WithdrawerAndNonce",components:[{name:"withdrawer",type:"address",internalType:"address"},{name:"nonce",type:"uint96",internalType:"uint96"}]},{name:"withdrawalStartBlock",type:"uint32",internalType:"uint32"},{name:"delegatedAddress",type:"address",internalType:"address"}]},{name:"tokens",type:"address[]",internalType:"contract IERC20[]"},{name:"middlewareTimesIndex",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"claimWithdrawalsFromLido",inputs:[{name:"requestIds",type:"uint256[]",internalType:"uint256[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"convertToAssets",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"convertToShares",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"convertToSharesUp",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"decimals",inputs:[],outputs:[{name:"",type:"uint8",internalType:"uint8"}],stateMutability:"pure"},{type:"function",name:"deposit",inputs:[{name:"assets",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"depositETH",inputs:[{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"payable"},{type:"function",name:"depositStETH",inputs:[{name:"stETHSharesAmount",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"depositToEigenLayer",inputs:[{name:"amount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"getELBackingEthAmount",inputs:[],outputs:[{name:"ethAmount",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getExitFeeBasisPoints",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getPendingLidoETHAmount",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getRemainingAssetsDailyWithdrawalLimit",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"initialize",inputs:[{name:"accessManager",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"initiateETHWithdrawalsFromLido",inputs:[{name:"amounts",type:"uint256[]",internalType:"uint256[]"}],outputs:[{name:"requestIds",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"nonpayable"},{type:"function",name:"initiateStETHWithdrawalFromEigenLayer",inputs:[{name:"sharesToWithdraw",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isConsumingScheduledOp",inputs:[],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"maxDeposit",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxMint",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxRedeem",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"maxShares",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"maxWithdraw",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"maxAssets",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"mint",inputs:[{name:"shares",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"name",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"nonces",inputs:[{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"nonpayable"},{type:"function",name:"permit",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"spender",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"deadline",type:"uint256",internalType:"uint256"},{name:"v",type:"uint8",internalType:"uint8"},{name:"r",type:"bytes32",internalType:"bytes32"},{name:"s",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"previewDeposit",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewMint",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewRedeem",inputs:[{name:"shares",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"previewWithdraw",inputs:[{name:"assets",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"proxiableUUID",inputs:[],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"redeem",inputs:[{name:"shares",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"setAuthority",inputs:[{name:"newAuthority",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setDailyWithdrawalLimit",inputs:[{name:"newLimit",type:"uint96",internalType:"uint96"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setExitFeeBasisPoints",inputs:[{name:"newExitFeeBasisPoints",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"symbol",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"totalAssets",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"totalSupply",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"transfer",inputs:[{name:"to",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"transferETH",inputs:[{name:"to",type:"address",internalType:"address"},{name:"ethAmount",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"transferFrom",inputs:[{name:"from",type:"address",internalType:"address"},{name:"to",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"nonpayable"},{type:"function",name:"upgradeToAndCall",inputs:[{name:"newImplementation",type:"address",internalType:"address"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"withdraw",inputs:[{name:"assets",type:"uint256",internalType:"uint256"},{name:"receiver",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"event",name:"Approval",inputs:[{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"spender",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"AssetsWithdrawnToday",inputs:[{name:"withdrawalAmount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"AuthorityUpdated",inputs:[{name:"authority",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ClaimedWithdrawals",inputs:[{name:"requestIds",type:"uint256[]",indexed:!1,internalType:"uint256[]"}],anonymous:!1},{type:"event",name:"DailyWithdrawalLimitReset",inputs:[],anonymous:!1},{type:"event",name:"DailyWithdrawalLimitSet",inputs:[{name:"oldLimit",type:"uint96",indexed:!1,internalType:"uint96"},{name:"newLimit",type:"uint96",indexed:!1,internalType:"uint96"}],anonymous:!1},{type:"event",name:"Deposit",inputs:[{name:"sender",type:"address",indexed:!0,internalType:"address"},{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"assets",type:"uint256",indexed:!1,internalType:"uint256"},{name:"shares",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"EIP712DomainChanged",inputs:[],anonymous:!1},{type:"event",name:"ExitFeeBasisPointsSet",inputs:[{name:"previousFee",type:"uint256",indexed:!1,internalType:"uint256"},{name:"newFee",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Initialized",inputs:[{name:"version",type:"uint64",indexed:!1,internalType:"uint64"}],anonymous:!1},{type:"event",name:"LidoWithdrawal",inputs:[{name:"expectedWithdrawal",type:"uint256",indexed:!1,internalType:"uint256"},{name:"actualWithdrawal",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RequestedWithdrawals",inputs:[{name:"requestIds",type:"uint256[]",indexed:!1,internalType:"uint256[]"}],anonymous:!1},{type:"event",name:"Transfer",inputs:[{name:"from",type:"address",indexed:!0,internalType:"address"},{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"value",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"TransferredETH",inputs:[{name:"to",type:"address",indexed:!0,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Withdraw",inputs:[{name:"sender",type:"address",indexed:!0,internalType:"address"},{name:"receiver",type:"address",indexed:!0,internalType:"address"},{name:"owner",type:"address",indexed:!0,internalType:"address"},{name:"assets",type:"uint256",indexed:!1,internalType:"uint256"},{name:"shares",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"error",name:"AccessManagedInvalidAuthority",inputs:[{name:"authority",type:"address",internalType:"address"}]},{type:"error",name:"AccessManagedRequiredDelay",inputs:[{name:"caller",type:"address",internalType:"address"},{name:"delay",type:"uint32",internalType:"uint32"}]},{type:"error",name:"AccessManagedUnauthorized",inputs:[{name:"caller",type:"address",internalType:"address"}]},{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:"DepositAndWithdrawalForbidden",inputs:[]},{type:"error",name:"ECDSAInvalidSignature",inputs:[]},{type:"error",name:"ECDSAInvalidSignatureLength",inputs:[{name:"length",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ECDSAInvalidSignatureS",inputs:[{name:"s",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"ERC1967InvalidImplementation",inputs:[{name:"implementation",type:"address",internalType:"address"}]},{type:"error",name:"ERC1967NonPayable",inputs:[]},{type:"error",name:"ERC20InsufficientAllowance",inputs:[{name:"spender",type:"address",internalType:"address"},{name:"allowance",type:"uint256",internalType:"uint256"},{name:"needed",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC20InsufficientBalance",inputs:[{name:"sender",type:"address",internalType:"address"},{name:"balance",type:"uint256",internalType:"uint256"},{name:"needed",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC20InvalidApprover",inputs:[{name:"approver",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidReceiver",inputs:[{name:"receiver",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidSender",inputs:[{name:"sender",type:"address",internalType:"address"}]},{type:"error",name:"ERC20InvalidSpender",inputs:[{name:"spender",type:"address",internalType:"address"}]},{type:"error",name:"ERC2612ExpiredSignature",inputs:[{name:"deadline",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC2612InvalidSigner",inputs:[{name:"signer",type:"address",internalType:"address"},{name:"owner",type:"address",internalType:"address"}]},{type:"error",name:"ERC4626ExceededMaxDeposit",inputs:[{name:"receiver",type:"address",internalType:"address"},{name:"assets",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxMint",inputs:[{name:"receiver",type:"address",internalType:"address"},{name:"shares",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxRedeem",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"shares",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ERC4626ExceededMaxWithdraw",inputs:[{name:"owner",type:"address",internalType:"address"},{name:"assets",type:"uint256",internalType:"uint256"},{name:"max",type:"uint256",internalType:"uint256"}]},{type:"error",name:"ETHTransferFailed",inputs:[]},{type:"error",name:"EnumerableMapNonexistentKey",inputs:[{name:"key",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"FailedInnerCall",inputs:[]},{type:"error",name:"InvalidAccountNonce",inputs:[{name:"account",type:"address",internalType:"address"},{name:"currentNonce",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidExitFeeBasisPoints",inputs:[]},{type:"error",name:"InvalidInitialization",inputs:[]},{type:"error",name:"InvalidWithdrawal",inputs:[]},{type:"error",name:"MathOverflowedMulDiv",inputs:[]},{type:"error",name:"NotInitializing",inputs:[]},{type:"error",name:"SafeERC20FailedOperation",inputs:[{name:"token",type:"address",internalType:"address"}]},{type:"error",name:"UUPSUnauthorizedCallContext",inputs:[]},{type:"error",name:"UUPSUnsupportedProxiableUUID",inputs:[{name:"slot",type:"bytes32",internalType:"bytes32"}]},{type:"error",name:"WithdrawalsAreDisabled",inputs:[]}],pl={[we.Mainnet]:{PufferVaultV2:cl},[we.Holesky]:{PufferVaultV2:ll},[we.Anvil]:{PufferVaultV2:dl}},yl={[we.Mainnet]:{PufferVault:"0xD9A442856C234a39a81a089C06451EBAa4306a72"},[we.Holesky]:{PufferVault:"0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9"},[we.Anvil]:{PufferVault:"0xf770bF9384c5aaD8b8a6EFAb5951CF089656A371"}};class fl{constructor(t,n,r){nt(this,"viemChain");this.chain=t,this.walletClient=n,this.publicClient=r,this.viemChain=Et[t]}getContract(){return ou({address:yl[this.chain].PufferVault,abi:pl[this.chain].PufferVaultV2,client:{wallet:this.walletClient,public:this.publicClient}})}depositETH(t){return{transact:async a=>await this.getContract().write.depositETH([t],{account:t,chain:this.viemChain,value:a}),estimate:async()=>await this.getContract().estimateGas.depositETH([t],{account:t})}}depositStETH(t,n){return{transact:async()=>await this.getContract().write.depositStETH([n,t],{account:t,chain:this.viemChain}),estimate:async()=>await this.getContract().estimateGas.depositStETH([n,t],{account:t})}}async balanceOf(t){return await this.getContract().read.balanceOf([t])}async getPufETHRate(){const t=BigInt(1e18);return await this.getContract().read.previewDeposit([t])}async getAllowance(t,n){return await this.getContract().read.allowance([t,n])}}class ml{constructor(t,n,r){nt(this,"walletClient");nt(this,"publicClient");nt(this,"vault");const a=Et[t];this.walletClient=n??Ss({chain:a,transport:Un()}),this.publicClient=r??Ms({chain:a,transport:Un()}),this.vault=new fl(t,this.walletClient,this.publicClient)}async requestAddresses(){return await this.walletClient.requestAddresses()}}class _t{static createPublicClient(t){return Ms({chain:Et[t.chain],transport:_t.extractTransportConfig(t)})}static createWalletClient(t){return Ss({chain:Et[t.chain],transport:_t.extractTransportConfig(t)})}static extractTransportConfig(t){return"rpcUrls"in t?yu(t.rpcUrls.map(n=>Un(n))):pu(t.provider,t.config)}}exports.BaseError=v;exports.Chain=we;exports.HttpRequestError=De;exports.InvalidAddressError=Re;exports.PufferClient=ml;exports.PufferClientHelpers=_t;exports.VIEM_CHAINS=Et;exports.call=Mt;exports.concat=se;exports.decodeErrorResult=Ca;exports.encodeAbiParameters=Je;exports.getUrl=Wt;exports.isAddress=ae;exports.isHex=X;exports.stringify=D;
39
- //# sourceMappingURL=main-DY0whdxp.cjs.map