@pufferfinance/puffer-sdk 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/puffer-client-helpers.cjs +1 -1
- package/dist/api/puffer-client-helpers.cjs.map +1 -1
- package/dist/api/puffer-client-helpers.js +82 -81
- package/dist/api/puffer-client-helpers.js.map +1 -1
- package/dist/api/puffer-client.cjs +1 -1
- package/dist/api/puffer-client.cjs.map +1 -1
- package/dist/api/puffer-client.js +2 -2
- package/dist/api/puffer-client.js.map +1 -1
- package/dist/ccip-BO_b9tFc.cjs +2 -0
- package/dist/ccip-BO_b9tFc.cjs.map +1 -0
- package/dist/ccip-DLDO0_x2.js +148 -0
- package/dist/ccip-DLDO0_x2.js.map +1 -0
- package/dist/chains/constants.cjs +1 -1
- package/dist/chains/constants.js +1 -1
- package/dist/constants-BjRNQpT2.js +1997 -0
- package/dist/constants-BjRNQpT2.js.map +1 -0
- package/dist/constants-DA2xUb9r.cjs +9 -0
- package/dist/constants-DA2xUb9r.cjs.map +1 -0
- package/dist/contracts/abis/holesky/PufferDepositor.cjs.map +1 -1
- package/dist/contracts/abis/holesky/PufferDepositor.js.map +1 -1
- package/dist/contracts/abis/holesky/PufferVaultV2.cjs.map +1 -1
- package/dist/contracts/abis/holesky/PufferVaultV2.js.map +1 -1
- package/dist/contracts/abis/l1-reward-manager-abis.cjs +1 -1
- package/dist/contracts/abis/l1-reward-manager-abis.cjs.map +1 -1
- package/dist/contracts/abis/l1-reward-manager-abis.js +1 -1
- package/dist/contracts/abis/l2-reward-manager-abis.cjs +1 -1
- package/dist/contracts/abis/l2-reward-manager-abis.cjs.map +1 -1
- package/dist/contracts/abis/l2-reward-manager-abis.js +1 -1
- package/dist/contracts/abis/mainnet/Accountant.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/Accountant.js.map +1 -1
- package/dist/contracts/abis/mainnet/AtomicQueue.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/AtomicQueue.js.map +1 -1
- package/dist/contracts/abis/mainnet/BoringVault.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/BoringVault.js.map +1 -1
- package/dist/contracts/abis/mainnet/ERC20Permit.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/ERC20Permit.js.map +1 -1
- package/dist/contracts/abis/mainnet/L1RewardManager.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/L1RewardManager.js.map +1 -1
- package/dist/contracts/abis/mainnet/L2RewardManager.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/L2RewardManager.js.map +1 -1
- package/dist/contracts/abis/mainnet/PufLocker.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/PufLocker.js.map +1 -1
- package/dist/contracts/abis/mainnet/PufferDepositor.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/PufferDepositor.js.map +1 -1
- package/dist/contracts/abis/mainnet/PufferL2Depositor.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/PufferL2Depositor.js.map +1 -1
- package/dist/contracts/abis/mainnet/PufferVaultV2.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/PufferVaultV2.js.map +1 -1
- package/dist/contracts/abis/mainnet/PufferWithdrawalManager.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/PufferWithdrawalManager.js.map +1 -1
- package/dist/contracts/abis/mainnet/Teller.cjs.map +1 -1
- package/dist/contracts/abis/mainnet/Teller.js.map +1 -1
- package/dist/contracts/abis/nucleus-accountant-abis.cjs +1 -1
- package/dist/contracts/abis/nucleus-accountant-abis.cjs.map +1 -1
- package/dist/contracts/abis/nucleus-accountant-abis.js +1 -1
- package/dist/contracts/abis/nucleus-atomic-queue-abis.cjs +1 -1
- package/dist/contracts/abis/nucleus-atomic-queue-abis.cjs.map +1 -1
- package/dist/contracts/abis/nucleus-atomic-queue-abis.js +1 -1
- package/dist/contracts/abis/nucleus-boring-vault-abis.cjs +1 -1
- package/dist/contracts/abis/nucleus-boring-vault-abis.cjs.map +1 -1
- package/dist/contracts/abis/nucleus-boring-vault-abis.js +1 -1
- package/dist/contracts/abis/nucleus-teller-abis.cjs +1 -1
- package/dist/contracts/abis/nucleus-teller-abis.cjs.map +1 -1
- package/dist/contracts/abis/nucleus-teller-abis.js +1 -1
- package/dist/contracts/abis/puf-locker-abis.cjs +1 -1
- package/dist/contracts/abis/puf-locker-abis.cjs.map +1 -1
- package/dist/contracts/abis/puf-locker-abis.js +1 -1
- package/dist/contracts/abis/puffer-depositor-abis.cjs +1 -1
- package/dist/contracts/abis/puffer-depositor-abis.cjs.map +1 -1
- package/dist/contracts/abis/puffer-depositor-abis.js +1 -1
- package/dist/contracts/abis/puffer-depositor-abis.js.map +1 -1
- package/dist/contracts/abis/puffer-vault-abis.cjs +1 -1
- package/dist/contracts/abis/puffer-vault-abis.cjs.map +1 -1
- package/dist/contracts/abis/puffer-vault-abis.js +1 -1
- package/dist/contracts/abis/puffer-vault-abis.js.map +1 -1
- package/dist/contracts/abis/puffer-withdrawal-manager-abis.cjs +1 -1
- package/dist/contracts/abis/puffer-withdrawal-manager-abis.cjs.map +1 -1
- package/dist/contracts/abis/puffer-withdrawal-manager-abis.js +1 -1
- package/dist/contracts/addresses.cjs +1 -1
- package/dist/contracts/addresses.cjs.map +1 -1
- package/dist/contracts/addresses.d.ts +26 -12
- package/dist/contracts/addresses.js +29 -12
- package/dist/contracts/addresses.js.map +1 -1
- package/dist/contracts/handlers/erc20-permit-handler.cjs +1 -1
- package/dist/contracts/handlers/erc20-permit-handler.cjs.map +1 -1
- package/dist/contracts/handlers/erc20-permit-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/erc20-permit-handler.js +3 -3
- package/dist/contracts/handlers/erc20-permit-handler.js.map +1 -1
- package/dist/contracts/handlers/l1-reward-manager-handler.cjs +1 -1
- package/dist/contracts/handlers/l1-reward-manager-handler.cjs.map +1 -1
- package/dist/contracts/handlers/l1-reward-manager-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/l1-reward-manager-handler.js +2 -2
- package/dist/contracts/handlers/l1-reward-manager-handler.js.map +1 -1
- package/dist/contracts/handlers/l2-reward-manager-handler.cjs +1 -1
- package/dist/contracts/handlers/l2-reward-manager-handler.cjs.map +1 -1
- package/dist/contracts/handlers/l2-reward-manager-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/l2-reward-manager-handler.js +2 -2
- package/dist/contracts/handlers/l2-reward-manager-handler.js.map +1 -1
- package/dist/contracts/handlers/nucleus-accountant-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-accountant-handler.cjs.map +1 -1
- package/dist/contracts/handlers/nucleus-accountant-handler.d.ts +11173 -2749
- package/dist/contracts/handlers/nucleus-accountant-handler.js +26 -11
- package/dist/contracts/handlers/nucleus-accountant-handler.js.map +1 -1
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs.map +1 -1
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.js +5 -5
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.js.map +1 -1
- package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs.map +1 -1
- package/dist/contracts/handlers/nucleus-boring-vault-handler.d.ts +11187 -2769
- package/dist/contracts/handlers/nucleus-boring-vault-handler.js +39 -35
- package/dist/contracts/handlers/nucleus-boring-vault-handler.js.map +1 -1
- package/dist/contracts/handlers/nucleus-teller-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-teller-handler.cjs.map +1 -1
- package/dist/contracts/handlers/nucleus-teller-handler.d.ts +11172 -2749
- package/dist/contracts/handlers/nucleus-teller-handler.js +30 -19
- package/dist/contracts/handlers/nucleus-teller-handler.js.map +1 -1
- package/dist/contracts/handlers/puf-locker-handler.cjs +1 -1
- package/dist/contracts/handlers/puf-locker-handler.cjs.map +1 -1
- package/dist/contracts/handlers/puf-locker-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/puf-locker-handler.js +2 -2
- package/dist/contracts/handlers/puf-locker-handler.js.map +1 -1
- package/dist/contracts/handlers/puffer-depositor-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-depositor-handler.cjs.map +1 -1
- package/dist/contracts/handlers/puffer-depositor-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/puffer-depositor-handler.js +2 -2
- package/dist/contracts/handlers/puffer-depositor-handler.js.map +1 -1
- package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs.map +1 -1
- package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/puffer-l2-depositor-handler.js +2 -2
- package/dist/contracts/handlers/puffer-l2-depositor-handler.js.map +1 -1
- package/dist/contracts/handlers/puffer-vault-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-vault-handler.cjs.map +1 -1
- package/dist/contracts/handlers/puffer-vault-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/puffer-vault-handler.js +2 -2
- package/dist/contracts/handlers/puffer-vault-handler.js.map +1 -1
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs +1 -1
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs.map +1 -1
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.d.ts +11128 -2714
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js +2 -2
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js.map +1 -1
- package/dist/contracts/tokens.cjs +1 -1
- package/dist/contracts/tokens.cjs.map +1 -1
- package/dist/contracts/tokens.d.ts +8 -2
- package/dist/contracts/tokens.js +40 -10
- package/dist/contracts/tokens.js.map +1 -1
- package/dist/createWalletClient-BuLYysrp.cjs +4 -0
- package/dist/createWalletClient-BuLYysrp.cjs.map +1 -0
- package/dist/createWalletClient-DNcW-ENe.js +2028 -0
- package/dist/createWalletClient-DNcW-ENe.js.map +1 -0
- package/dist/errors/base-error.cjs.map +1 -1
- package/dist/errors/base-error.js.map +1 -1
- package/dist/{getContract-MrPLx6gp.cjs → getContract-3QbyfZBF.cjs} +2 -2
- package/dist/getContract-3QbyfZBF.cjs.map +1 -0
- package/dist/{getContract-B3Spz0SO.js → getContract-CezEyDf-.js} +2 -2
- package/dist/{getContract-MrPLx6gp.cjs.map → getContract-CezEyDf-.js.map} +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +24 -23
- package/dist/secp256k1-3OC5y4qp.js +1579 -0
- package/dist/secp256k1-3OC5y4qp.js.map +1 -0
- package/dist/secp256k1-bcahnPX9.cjs +2 -0
- package/dist/secp256k1-bcahnPX9.cjs.map +1 -0
- package/dist/utils/version.cjs +1 -1
- package/dist/utils/version.js +1 -1
- package/dist/writeContract-ChuHpJLC.js +3799 -0
- package/dist/writeContract-ChuHpJLC.js.map +1 -0
- package/dist/writeContract-D97dSJQe.cjs +32 -0
- package/dist/writeContract-D97dSJQe.cjs.map +1 -0
- package/package.json +13 -13
- package/dist/ccip-D4klNwCt.js +0 -159
- package/dist/ccip-D4klNwCt.js.map +0 -1
- package/dist/ccip-DLDqFodf.cjs +0 -2
- package/dist/ccip-DLDqFodf.cjs.map +0 -1
- package/dist/constants-BvU-JhfL.cjs +0 -9
- package/dist/constants-BvU-JhfL.cjs.map +0 -1
- package/dist/constants-rWWWhxR_.js +0 -2099
- package/dist/constants-rWWWhxR_.js.map +0 -1
- package/dist/createWalletClient-Bmopj8MM.cjs +0 -4
- package/dist/createWalletClient-Bmopj8MM.cjs.map +0 -1
- package/dist/createWalletClient-DKcpswHR.js +0 -2007
- package/dist/createWalletClient-DKcpswHR.js.map +0 -1
- package/dist/getContract-B3Spz0SO.js.map +0 -1
- package/dist/secp256k1-BLbXMlpX.js +0 -1172
- package/dist/secp256k1-BLbXMlpX.js.map +0 -1
- package/dist/secp256k1-CFnFaJ0H.cjs +0 -2
- package/dist/secp256k1-CFnFaJ0H.cjs.map +0 -1
- package/dist/writeContract-BBHpAss8.cjs +0 -32
- package/dist/writeContract-BBHpAss8.cjs.map +0 -1
- package/dist/writeContract-RluxM31W.js +0 -3833
- package/dist/writeContract-RluxM31W.js.map +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("./constants-BvU-JhfL.cjs"),lr="1.0.5";class j extends Error{constructor(t,r={}){var a;const n=r.cause instanceof j?r.cause.details:(a=r.cause)!=null&&a.message?r.cause.message:r.details,o=r.cause instanceof j&&r.cause.docsPath||r.docsPath,s=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${lr}`].join(`
|
|
2
|
-
`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.shortMessage=t}}function z(e,t){const r=e.exec(t);return r==null?void 0:r.groups}const Et=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Pt=/^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)?$/,xt=/^\(.+?\).*?$/,ut=/^tuple(?<array>(\[(\d*)\])*)$/;function Ne(e){let t=e.type;if(ut.test(e.type)&&"components"in e){t="(";const r=e.components.length;for(let o=0;o<r;o++){const s=e.components[o];t+=Ne(s),o<r-1&&(t+=", ")}const n=z(ut,e.type);return t+=`)${(n==null?void 0:n.array)??""}`,Ne({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function W(e){let t="";const r=e.length;for(let n=0;n<r;n++){const o=e[n];t+=Ne(o),n!==r-1&&(t+=", ")}return t}function fr(e){return e.type==="function"?`function ${e.name}(${W(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${W(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${W(e.inputs)})`:e.type==="error"?`error ${e.name}(${W(e.inputs)})`:e.type==="constructor"?`constructor(${W(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?"fallback()":"receive() external payable"}const At=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function br(e){return At.test(e)}function pr(e){return z(At,e)}const $t=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function yr(e){return $t.test(e)}function mr(e){return z($t,e)}const Tt=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function hr(e){return Tt.test(e)}function gr(e){return z(Tt,e)}const jt=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Bt(e){return jt.test(e)}function wr(e){return z(jt,e)}const Ft=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function vr(e){return Ft.test(e)}function Er(e){return z(Ft,e)}const Pr=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function xr(e){return Pr.test(e)}const Ar=/^receive\(\) external payable$/;function $r(e){return Ar.test(e)}const Tr=new Set(["indexed"]),ze=new Set(["calldata","memory","storage"]);class jr extends j{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Br extends j{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Fr extends j{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Cr extends j{constructor({param:t,name:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Or extends j{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Mr extends j{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Rr extends j{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class J extends j{constructor({signature:t,type:r}){super(`Invalid ${r} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Sr extends j{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class kr extends j{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Ir extends j{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Nr extends j{constructor({current:t,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function zr(e,t){return t?`${t}:${e}`:e}const Me=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Gr(e,t={}){if(hr(e)){const r=gr(e);if(!r)throw new J({signature:e,type:"function"});const n=O(r.parameters),o=[],s=n.length;for(let c=0;c<s;c++)o.push(D(n[c],{modifiers:ze,structs:t,type:"function"}));const a=[];if(r.returns){const c=O(r.returns),u=c.length;for(let d=0;d<u;d++)a.push(D(c[d],{modifiers:ze,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:o,outputs:a}}if(yr(e)){const r=mr(e);if(!r)throw new J({signature:e,type:"event"});const n=O(r.parameters),o=[],s=n.length;for(let a=0;a<s;a++)o.push(D(n[a],{modifiers:Tr,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:o}}if(br(e)){const r=pr(e);if(!r)throw new J({signature:e,type:"error"});const n=O(r.parameters),o=[],s=n.length;for(let a=0;a<s;a++)o.push(D(n[a],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:o}}if(vr(e)){const r=Er(e);if(!r)throw new J({signature:e,type:"constructor"});const n=O(r.parameters),o=[],s=n.length;for(let a=0;a<s;a++)o.push(D(n[a],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:o}}if(xr(e))return{type:"fallback"};if($r(e))return{type:"receive",stateMutability:"payable"};throw new Sr({signature:e})}const Dr=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Hr=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Lr=/^u?int$/;function D(e,t){var f,b;const r=zr(e,t==null?void 0:t.type);if(Me.has(r))return Me.get(r);const n=xt.test(e),o=z(n?Hr:Dr,e);if(!o)throw new Fr({param:e});if(o.name&&qr(o.name))throw new Cr({param:e,name:o.name});const s=o.name?{name:o.name}:{},a=o.modifier==="indexed"?{indexed:!0}:{},c=(t==null?void 0:t.structs)??{};let u,d={};if(n){u="tuple";const m=O(o.type),p=[],y=m.length;for(let h=0;h<y;h++)p.push(D(m[h],{structs:c}));d={components:p}}else if(o.type in c)u="tuple",d={components:c[o.type]};else if(Lr.test(o.type))u=`${o.type}256`;else if(u=o.type,(t==null?void 0:t.type)!=="struct"&&!Ct(u))throw new Br({type:u});if(o.modifier){if(!((b=(f=t==null?void 0:t.modifiers)==null?void 0:f.has)!=null&&b.call(f,o.modifier)))throw new Or({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(ze.has(o.modifier)&&!Ur(u,!!o.array))throw new Mr({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const l={type:`${u}${o.array??""}`,...s,...a,...d};return Me.set(r,l),l}function O(e,t=[],r="",n=0){const o=e.trim().length;for(let s=0;s<o;s++){const a=e[s],c=e.slice(s+1);switch(a){case",":return n===0?O(c,[...t,r.trim()]):O(c,t,`${r}${a}`,n);case"(":return O(c,t,`${r}${a}`,n+1);case")":return O(c,t,`${r}${a}`,n-1);default:return O(c,t,`${r}${a}`,n)}}if(r==="")return t;if(n!==0)throw new Nr({current:r,depth:n});return t.push(r.trim()),t}function Ct(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Et.test(e)||Pt.test(e)}const _r=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function qr(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Et.test(e)||Pt.test(e)||_r.test(e)}function Ur(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Vr(e){const t={},r=e.length;for(let a=0;a<r;a++){const c=e[a];if(!Bt(c))continue;const u=wr(c);if(!u)throw new J({signature:c,type:"struct"});const d=u.properties.split(";"),l=[],f=d.length;for(let b=0;b<f;b++){const p=d[b].trim();if(!p)continue;const y=D(p,{type:"struct"});l.push(y)}if(!l.length)throw new kr({signature:c});t[u.name]=l}const n={},o=Object.entries(t),s=o.length;for(let a=0;a<s;a++){const[c,u]=o[a];n[c]=Ot(u,t)}return n}const Zr=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Ot(e,t,r=new Set){const n=[],o=e.length;for(let s=0;s<o;s++){const a=e[s];if(xt.test(a.type))n.push(a);else{const u=z(Zr,a.type);if(!(u!=null&&u.type))throw new Rr({abiParameter:a});const{array:d,type:l}=u;if(l in t){if(r.has(l))throw new Ir({type:l});n.push({...a,type:`tuple${d??""}`,components:Ot(t[l]??[],t,new Set([...r,l]))})}else if(Ct(l))n.push(a);else throw new jr({type:l})}}return n}function Mt(e){const t=Vr(e),r=[],n=e.length;for(let o=0;o<n;o++){const s=e[o];Bt(s)||r.push(Gr(s,t))}return r}function E(e,t,r){const n=e[t.name];if(typeof n=="function")return n;const o=e[r];return typeof o=="function"?o:s=>t(e,s)}function I(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new sn(e.type);return`${e.name}(${se(e.inputs,{includeName:t})})`}function se(e,{includeName:t=!1}={}){return e?e.map(r=>Wr(r,{includeName:t})).join(t?", ":","):""}function Wr(e,{includeName:t}){return e.type.startsWith("tuple")?`(${se(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class Jr extends i.BaseError{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 dt extends i.BaseError{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 Rt extends i.BaseError{constructor({data:t,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(`
|
|
5
|
-
`),{metaMessages:[`Params: (${se(r,{includeName:!0})})`,`Data: ${t} (${n} 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=r,this.size=n}}class ie extends i.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Kr extends i.BaseError{constructor({expectedLength:t,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${t}`,`Given length: ${r}`].join(`
|
|
6
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Yr extends i.BaseError{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${i.size(r)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Xr extends i.BaseError{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${r}`].join(`
|
|
7
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class St extends i.BaseError{constructor(t,{docsPath:r}){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:r}),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 Qr extends i.BaseError{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 kt extends i.BaseError{constructor(t,{docsPath:r}){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:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class lt extends i.BaseError{constructor(t,{docsPath:r}={}){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:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class ae extends i.BaseError{constructor(t,{docsPath:r}={}){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:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class en extends i.BaseError{constructor(t,{docsPath:r}){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:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class tn extends i.BaseError{constructor(t,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${I(t.abiItem)}\`, and`,`\`${r.type}\` in \`${I(r.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 rn extends i.BaseError{constructor({expectedSize:t,givenSize:r}){super(`Expected bytes${t}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class K extends i.BaseError{constructor({abiItem:t,data:r,params:n,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
|
|
13
|
-
`),{metaMessages:[`Params: (${se(n,{includeName:!0})})`,`Data: ${r} (${o} 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=r,this.params=n,this.size=o}}class ce extends i.BaseError{constructor({abiItem:t,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${I(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 nn extends i.BaseError{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
15
|
-
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class on extends i.BaseError{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
16
|
-
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class an extends i.BaseError{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 sn extends i.BaseError{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 cn extends i.BaseError{constructor(t){super(`Filter type "${t}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const un=e=>i.keccak256(i.toBytes$1(e));function dn(e){return un(e)}function ln(e){let t=!0,r="",n=0,o="",s=!1;for(let a=0;a<e.length;a++){const c=e[a];if(["(",")",","].includes(c)&&(t=!0),c==="("&&n++,c===")"&&n--,!!t){if(n===0){if(c===" "&&["event","function",""].includes(o))o="";else if(o+=c,c===")"){s=!0;break}continue}if(c===" "){e[a-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}o+=c,r+=c}}if(!s)throw new i.BaseError("Unable to normalize signature.");return o}const fn=e=>{const t=typeof e=="string"?e:fr(e);return ln(t)};function It(e){return dn(fn(e))}const Ue=It;function ue(e,t){if(e.length!==t.length)throw new Xr({expectedLength:e.length,givenLength:t.length});const r=bn({params:e,values:t}),n=Ze(r);return n.length===0?"0x":n}function bn({params:e,values:t}){const r=[];for(let n=0;n<e.length;n++)r.push(Ve({param:e[n],value:t[n]}));return r}function Ve({param:e,value:t}){const r=We(e.type);if(r){const[n,o]=r;return yn(t,{length:n,param:{...e,type:o}})}if(e.type==="tuple")return vn(t,{param:e});if(e.type==="address")return pn(t);if(e.type==="bool")return hn(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int");return gn(t,{signed:n})}if(e.type.startsWith("bytes"))return mn(t,{param:e});if(e.type==="string")return wn(t);throw new nn(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Ze(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:a,encoded:c}=e[s];a?t+=32:t+=i.size(c)}const r=[],n=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:a,encoded:c}=e[s];a?(r.push(i.numberToHex(t+o,{size:32})),n.push(c),o+=i.size(c)):r.push(c)}return i.concat([...r,...n])}function pn(e){if(!i.isAddress(e))throw new i.InvalidAddressError({address:e});return{dynamic:!1,encoded:i.padHex(e.toLowerCase())}}function yn(e,{length:t,param:r}){const n=t===null;if(!Array.isArray(e))throw new an(e);if(!n&&e.length!==t)throw new Kr({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let o=!1;const s=[];for(let a=0;a<e.length;a++){const c=Ve({param:r,value:e[a]});c.dynamic&&(o=!0),s.push(c)}if(n||o){const a=Ze(s);if(n){const c=i.numberToHex(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?i.concat([c,a]):c}}if(o)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:i.concat(s.map(({encoded:a})=>a))}}function mn(e,{param:t}){const[,r]=t.type.split("bytes"),n=i.size(e);if(!r){let o=e;return n%32!==0&&(o=i.padHex(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:i.concat([i.padHex(i.numberToHex(n,{size:32})),o])}}if(n!==Number.parseInt(r))throw new Yr({expectedSize:Number.parseInt(r),value:e});return{dynamic:!1,encoded:i.padHex(e,{dir:"right"})}}function hn(e){if(typeof e!="boolean")throw new i.BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:i.padHex(i.boolToHex(e))}}function gn(e,{signed:t}){return{dynamic:!1,encoded:i.numberToHex(e,{size:32,signed:t})}}function wn(e){const t=i.stringToHex(e),r=Math.ceil(i.size(t)/32),n=[];for(let o=0;o<r;o++)n.push(i.padHex(i.slice(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:i.concat([i.padHex(i.numberToHex(i.size(t),{size:32})),...n])}}function vn(e,{param:t}){let r=!1;const n=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],a=Array.isArray(e)?o:s.name,c=Ve({param:s,value:e[a]});n.push(c),c.dynamic&&(r=!0)}return{dynamic:r,encoded:r?Ze(n):i.concat(n.map(({encoded:o})=>o))}}function We(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Je=e=>i.slice(It(e),0,4);function q(e){const{abi:t,args:r=[],name:n}=e,o=i.isHex(n,{strict:!1}),s=t.filter(c=>o?c.type==="function"?Je(c)===n:c.type==="event"?Ue(c)===n:!1:"name"in c&&c.name===n);if(s.length===0)return;if(s.length===1)return s[0];let a;for(const c of s){if(!("inputs"in c))continue;if(!r||r.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==r.length)continue;if(r.every((d,l)=>{const f="inputs"in c&&c.inputs[l];return f?Ge(d,f):!1})){if(a&&"inputs"in a&&a.inputs){const d=Nt(c.inputs,a.inputs,r);if(d)throw new tn({abiItem:c,type:d[0]},{abiItem:a,type:d[1]})}a=c}}return a||s[0]}function Ge(e,t){const r=typeof e,n=t.type;switch(n){case"address":return i.isAddress(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>Ge(Object.values(e)[s],o)):/^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(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(o=>Ge(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Nt(e,t,r){for(const n in e){const o=e[n],s=t[n];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return Nt(o.components,s.components,r[n]);const a=[o.type,s.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?i.isAddress(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?i.isAddress(r[n],{strict:!1}):!1)return a}}const ft="/docs/contract/encodeEventTopics";function de(e){var u;const{abi:t,eventName:r,args:n}=e;let o=t[0];if(r){const d=q({abi:t,name:r});if(!d)throw new lt(r,{docsPath:ft});o=d}if(o.type!=="event")throw new lt(void 0,{docsPath:ft});const s=I(o),a=Ue(s);let c=[];if(n&&"inputs"in o){const d=(u=o.inputs)==null?void 0:u.filter(f=>"indexed"in f&&f.indexed),l=Array.isArray(n)?n:Object.values(n).length>0?(d==null?void 0:d.map(f=>n[f.name]))??[]:[];l.length>0&&(c=(d==null?void 0:d.map((f,b)=>Array.isArray(l[b])?l[b].map((m,p)=>bt({param:f,value:l[b][p]})):l[b]?bt({param:f,value:l[b]}):null))??[])}return[a,...c]}function bt({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return i.keccak256(i.toBytes$1(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new cn(e.type);return ue([e],[t])}function zt(e,{method:t}){var n,o;const r={};return e.transport.type==="fallback"&&((o=(n=e.transport).onResponse)==null||o.call(n,({method:s,response:a,status:c,transport:u})=>{c==="success"&&t===s&&(r[a]=u.request)})),s=>r[s]||e.request}async function Gt(e,t){const{address:r,abi:n,args:o,eventName:s,fromBlock:a,strict:c,toBlock:u}=t,d=zt(e,{method:"eth_newFilter"}),l=s?de({abi:n,args:o,eventName:s}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof a=="bigint"?i.numberToHex(a):a,toBlock:typeof u=="bigint"?i.numberToHex(u):u,topics:l}]});return{abi:n,args:o,eventName:s,id:f,request:d(f),strict:!!c,type:"event"}}function N(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const pt="/docs/contract/encodeFunctionData";function En(e){const{abi:t,args:r,functionName:n}=e;let o=t[0];if(n){const s=q({abi:t,args:r,name:n});if(!s)throw new ae(n,{docsPath:pt});o=s}if(o.type!=="function")throw new ae(void 0,{docsPath:pt});return{abi:[o],functionName:Je(I(o))}}function U(e){const{args:t}=e,{abi:r,functionName:n}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:En(e)})(),o=r[0],s=n,a="inputs"in o&&o.inputs?ue(o.inputs,t??[]):void 0;return i.concatHex([s,a??"0x"])}const Dt={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."},Pn={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},xn={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function An(e,t={}){typeof t.size<"u"&&i.assertSize(e,{size:t.size});const r=i.bytesToHex(e,t);return i.hexToBigInt(r,t)}function $n(e,t={}){let r=e;if(typeof t.size<"u"&&(i.assertSize(r,{size:t.size}),r=i.trim(r)),r.length>1||r[0]>1)throw new i.InvalidBytesBooleanError(r);return!!r[0]}function k(e,t={}){typeof t.size<"u"&&i.assertSize(e,{size:t.size});const r=i.bytesToHex(e,t);return i.hexToNumber(r,t)}function Tn(e,t={}){let r=e;return typeof t.size<"u"&&(i.assertSize(r,{size:t.size}),r=i.trim(r,{dir:"right"})),new TextDecoder().decode(r)}function le(e,t){const r=typeof t=="string"?i.hexToBytes(t):t,n=i.createCursor(r);if(i.size(r)===0&&e.length>0)throw new ie;if(i.size(t)&&i.size(t)<32)throw new Rt({data:typeof t=="string"?t:i.bytesToHex(t),params:e,size:i.size(t)});let o=0;const s=[];for(let a=0;a<e.length;++a){const c=e[a];n.setPosition(o);const[u,d]=_(n,c,{staticPosition:0});o+=d,s.push(u)}return s}function _(e,t,{staticPosition:r}){const n=We(t.type);if(n){const[o,s]=n;return Bn(e,{...t,type:s},{length:o,staticPosition:r})}if(t.type==="tuple")return Mn(e,t,{staticPosition:r});if(t.type==="address")return jn(e);if(t.type==="bool")return Fn(e);if(t.type.startsWith("bytes"))return Cn(e,t,{staticPosition:r});if(t.type.startsWith("uint")||t.type.startsWith("int"))return On(e,t);if(t.type==="string")return Rn(e,{staticPosition:r});throw new on(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const yt=32,De=32;function jn(e){const t=e.readBytes(32);return[i.checksumAddress(i.bytesToHex(i.sliceBytes(t,-20))),32]}function Bn(e,t,{length:r,staticPosition:n}){if(!r){const a=k(e.readBytes(De)),c=n+a,u=c+yt;e.setPosition(c);const d=k(e.readBytes(yt)),l=Y(t);let f=0;const b=[];for(let m=0;m<d;++m){e.setPosition(u+(l?m*32:f));const[p,y]=_(e,t,{staticPosition:u});f+=y,b.push(p)}return e.setPosition(n+32),[b,32]}if(Y(t)){const a=k(e.readBytes(De)),c=n+a,u=[];for(let d=0;d<r;++d){e.setPosition(c+d*32);const[l]=_(e,t,{staticPosition:c});u.push(l)}return e.setPosition(n+32),[u,32]}let o=0;const s=[];for(let a=0;a<r;++a){const[c,u]=_(e,t,{staticPosition:n+o});o+=u,s.push(c)}return[s,o]}function Fn(e){return[$n(e.readBytes(32),{size:32}),32]}function Cn(e,t,{staticPosition:r}){const[n,o]=t.type.split("bytes");if(!o){const a=k(e.readBytes(32));e.setPosition(r+a);const c=k(e.readBytes(32));if(c===0)return e.setPosition(r+32),["0x",32];const u=e.readBytes(c);return e.setPosition(r+32),[i.bytesToHex(u),32]}return[i.bytesToHex(e.readBytes(Number.parseInt(o),32)),32]}function On(e,t){const r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256"),o=e.readBytes(32);return[n>48?An(o,{signed:r}):k(o,{signed:r}),32]}function Mn(e,t,{staticPosition:r}){const n=t.components.length===0||t.components.some(({name:a})=>!a),o=n?[]:{};let s=0;if(Y(t)){const a=k(e.readBytes(De)),c=r+a;for(let u=0;u<t.components.length;++u){const d=t.components[u];e.setPosition(c+s);const[l,f]=_(e,d,{staticPosition:c});s+=f,o[n?u:d==null?void 0:d.name]=l}return e.setPosition(r+32),[o,32]}for(let a=0;a<t.components.length;++a){const c=t.components[a],[u,d]=_(e,c,{staticPosition:r});o[n?a:c==null?void 0:c.name]=u,s+=d}return[o,s]}function Rn(e,{staticPosition:t}){const r=k(e.readBytes(32)),n=t+r;e.setPosition(n);const o=k(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),a=Tn(i.trim(s));return e.setPosition(t+32),[a,32]}function Y(e){var n;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(n=e.components)==null?void 0:n.some(Y);const r=We(e.type);return!!(r&&Y({...e,type:r[1]}))}function Ht(e){const{abi:t,data:r}=e,n=i.slice(r,0,4);if(n==="0x")throw new ie;const s=[...t||[],Pn,xn].find(a=>a.type==="error"&&n===Je(I(a)));if(!s)throw new St(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?le(s.inputs,i.slice(r,4)):void 0,errorName:s.name}}const H=(e,t,r)=>JSON.stringify(e,(n,o)=>typeof o=="bigint"?o.toString():o,r);function Lt({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((o,s)=>`${n&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?H(t[s]):t[s]}`).join(", ")})`}class Sn extends i.BaseError{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 kn extends i.BaseError{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function mt(e){return e.reduce((t,{slot:r,value:n})=>`${t} ${r}: ${n}
|
|
19
|
-
`,"")}function In(e){return e.reduce((t,{address:r,...n})=>{let o=`${t} ${r}:
|
|
20
|
-
`;return n.nonce&&(o+=` nonce: ${n.nonce}
|
|
21
|
-
`),n.balance&&(o+=` balance: ${n.balance}
|
|
22
|
-
`),n.code&&(o+=` code: ${n.code}
|
|
23
|
-
`),n.state&&(o+=` state:
|
|
24
|
-
`,o+=mt(n.state)),n.stateDiff&&(o+=` stateDiff:
|
|
25
|
-
`,o+=mt(n.stateDiff)),o},` State Override:
|
|
26
|
-
`).slice(0,-1)}class _t extends i.BaseError{constructor(t,{account:r,docsPath:n,chain:o,data:s,gas:a,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:l,to:f,value:b,stateOverride:m}){var h;const p=r?N(r):void 0;let y=i.prettyPrint({from:p==null?void 0:p.address,to:f,value:typeof b<"u"&&`${i.formatEther(b)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof c<"u"&&`${i.formatGwei(c)} gwei`,maxFeePerGas:typeof u<"u"&&`${i.formatGwei(u)} gwei`,maxPriorityFeePerGas:typeof d<"u"&&`${i.formatGwei(d)} gwei`,nonce:l});m&&(y+=`
|
|
27
|
-
${In(m)}`),super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",y].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 Nn extends i.BaseError{constructor(t,{abi:r,args:n,contractAddress:o,docsPath:s,functionName:a,sender:c}){const u=q({abi:r,args:n,name:a}),d=u?Lt({abiItem:u,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=u?I(u,{includeName:!0}):void 0,f=i.prettyPrint({address:o&&i.getContractAddress(o),function:l,args:d&&d!=="()"&&`${[...Array((a==null?void 0:a.length)??0).keys()].map(()=>" ").join("")}${d}`,sender:c});super(t.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],f&&"Contract Call:",f].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=r,this.args=n,this.cause=t,this.contractAddress=o,this.functionName=a,this.sender=c}}class qt extends i.BaseError{constructor({abi:t,data:r,functionName:n,message:o}){let s,a,c,u;if(r&&r!=="0x")try{a=Ht({abi:t,data:r});const{abiItem:l,errorName:f,args:b}=a;if(f==="Error")u=b[0];else if(f==="Panic"){const[m]=b;u=Dt[m]}else{const m=l?I(l,{includeName:!0}):void 0,p=l&&b?Lt({abiItem:l,args:b,includeFunctionName:!1,includeName:!1}):void 0;c=[m?`Error: ${m}`:"",p&&p!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${p}`:""]}}catch(l){s=l}else o&&(u=o);let d;s instanceof St&&(d=s.signature,c=[`Unable to decode signature "${d}" 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=${d}.`]),super(u&&u!=="execution reverted"||d?[`The contract function "${n}" reverted with the following ${d?"signature":"reason"}:`,u||d].join(`
|
|
28
|
-
`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:c}),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=a,this.reason=u,this.signature=d}}class zn extends i.BaseError{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 Gn extends i.BaseError{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CounterfactualDeploymentFailedError"})}}class Ke extends i.BaseError{constructor({data:t,message:r}){super(r||""),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 Dn extends i.BaseError{constructor({body:t,cause:r,details:n,headers:o,status:s,url:a}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${i.getUrl(a)}`,t&&`Request body: ${H(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=o,this.status=s,this.url=a}}class Ut extends i.BaseError{constructor({body:t,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${i.getUrl(n)}`,`Request body: ${H(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=r.code}}class Hn extends i.BaseError{constructor({body:t,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${i.getUrl(r)}`,`Request body: ${H(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const Ln=-1;class B extends i.BaseError{constructor(t,{code:r,docsPath:n,metaMessages:o,shortMessage:s}){super(s,{cause:t,docsPath:n,metaMessages:o||(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 Ut?t.code:r??Ln}}class V extends B{constructor(t,r){super(t,r),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=r.data}}class fe extends B{constructor(t){super(t,{code:fe.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(fe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class be extends B{constructor(t){super(t,{code:be.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(be,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class pe extends B{constructor(t,{method:r}={}){super(t,{code:pe.code,shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class ye extends B{constructor(t){super(t,{code:ye.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
29
|
-
`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(ye,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Q extends B{constructor(t){super(t,{code:Q.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(Q,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class ee extends B{constructor(t){super(t,{code:ee.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
30
|
-
`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(ee,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class me extends B{constructor(t){super(t,{code:me.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(me,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class he extends B{constructor(t){super(t,{code:he.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(he,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class ge extends B{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 we extends B{constructor(t,{method:r}={}){super(t,{code:we.code,shortMessage:`Method${r?` "${r}"`:""} is not implemented.`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(we,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class ve extends B{constructor(t){super(t,{code:ve.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(ve,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Ee extends B{constructor(t){super(t,{code:Ee.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(Ee,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Pe extends V{constructor(t){super(t,{code:Pe.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class xe extends V{constructor(t){super(t,{code:xe.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(xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Ae extends V{constructor(t,{method:r}={}){super(t,{code:Ae.code,shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(Ae,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class $e extends V{constructor(t){super(t,{code:$e.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty($e,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Te extends V{constructor(t){super(t,{code:Te.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(Te,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class je extends V{constructor(t){super(t,{code:je.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(je,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class _n extends B{constructor(t){super(t,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const qn=3;function Be(e,{abi:t,address:r,args:n,docsPath:o,functionName:s,sender:a}){const{code:c,data:u,message:d,shortMessage:l}=e instanceof Ke?e:e instanceof i.BaseError?e.walk(b=>"data"in b)||e.walk():{},f=e instanceof ie?new zn({functionName:s}):[qn,Q.code].includes(c)&&(u||d||l)?new qt({abi:t,data:typeof u=="object"?u.data:u,functionName:s,message:l??d}):e;return new Nn(f,{abi:t,args:n,contractAddress:r,docsPath:o,functionName:s,sender:a})}class Un extends i.BaseError{constructor(t,{account:r,docsPath:n,chain:o,data:s,gas:a,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:l,to:f,value:b}){var p;const m=i.prettyPrint({from:r==null?void 0:r.address,to:f,value:typeof b<"u"&&`${i.formatEther(b)} ${((p=o==null?void 0:o.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof c<"u"&&`${i.formatGwei(c)} gwei`,maxFeePerGas:typeof u<"u"&&`${i.formatGwei(u)} gwei`,maxPriorityFeePerGas:typeof d<"u"&&`${i.formatGwei(d)} gwei`,nonce:l});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",m].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}}function Ye(e,t){const r=(e.details||"").toLowerCase(),n=e instanceof i.BaseError?e.walk(o=>o.code===i.ExecutionRevertedError.code):e;return n instanceof i.BaseError?new i.ExecutionRevertedError({cause:e,message:n.details}):i.ExecutionRevertedError.nodeMessage.test(r)?new i.ExecutionRevertedError({cause:e,message:e.details}):i.FeeCapTooHighError.nodeMessage.test(r)?new i.FeeCapTooHighError({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):i.FeeCapTooLowError.nodeMessage.test(r)?new i.FeeCapTooLowError({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):i.NonceTooHighError.nodeMessage.test(r)?new i.NonceTooHighError({cause:e,nonce:t==null?void 0:t.nonce}):i.NonceTooLowError.nodeMessage.test(r)?new i.NonceTooLowError({cause:e,nonce:t==null?void 0:t.nonce}):i.NonceMaxValueError.nodeMessage.test(r)?new i.NonceMaxValueError({cause:e,nonce:t==null?void 0:t.nonce}):i.InsufficientFundsError.nodeMessage.test(r)?new i.InsufficientFundsError({cause:e}):i.IntrinsicGasTooHighError.nodeMessage.test(r)?new i.IntrinsicGasTooHighError({cause:e,gas:t==null?void 0:t.gas}):i.IntrinsicGasTooLowError.nodeMessage.test(r)?new i.IntrinsicGasTooLowError({cause:e,gas:t==null?void 0:t.gas}):i.TransactionTypeNotSupportedError.nodeMessage.test(r)?new i.TransactionTypeNotSupportedError({cause:e}):i.TipAboveFeeCapError.nodeMessage.test(r)?new i.TipAboveFeeCapError({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new i.UnknownNodeError({cause:e})}function Vn(e,{docsPath:t,...r}){const n=(()=>{const o=Ye(e,r);return o instanceof i.UnknownNodeError?e:o})();return new Un(n,{docsPath:t,...r})}function Xe(e,{format:t}){if(!t)return{};const r={};function n(s){const a=Object.keys(s);for(const c of a)c in e&&(r[c]=e[c]),s[c]&&typeof s[c]=="object"&&!Array.isArray(s[c])&&n(s[c])}const o=t(e||{});return n(o),r}const Zn={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Fe(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(r=>i.bytesToHex(r)):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=i.numberToHex(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=i.numberToHex(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=i.numberToHex(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=i.numberToHex(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=i.numberToHex(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=i.numberToHex(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Zn[e.type]),typeof e.value<"u"&&(t.value=i.numberToHex(e.value)),t}function ht(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new i.InvalidBytesLengthError({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new i.InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function Wn(e){const{balance:t,nonce:r,state:n,stateDiff:o,code:s}=e,a={};if(s!==void 0&&(a.code=s),t!==void 0&&(a.balance=i.numberToHex(t)),r!==void 0&&(a.nonce=i.numberToHex(r)),n!==void 0&&(a.state=ht(n)),o!==void 0){if(a.state)throw new kn;a.stateDiff=ht(o)}return a}function Vt(e){if(!e)return;const t={};for(const{address:r,...n}of e){if(!i.isAddress(r,{strict:!1}))throw new i.InvalidAddressError({address:r});if(t[r])throw new Sn({address:r});t[r]=Wn(n)}return t}function te(e){const{account:t,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:o,to:s}=e,a=t?N(t):void 0;if(a&&!i.isAddress(a.address))throw new i.InvalidAddressError({address:a.address});if(s&&!i.isAddress(s))throw new i.InvalidAddressError({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof o<"u"))throw new i.FeeConflictError;if(n&&n>2n**256n-1n)throw new i.FeeCapTooHighError({maxFeePerGas:n});if(o&&n&&o>n)throw new i.TipAboveFeeCapError({maxFeePerGas:n,maxPriorityFeePerGas:o})}class Jn extends i.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Qe extends i.BaseError{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Kn extends i.BaseError{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${i.formatGwei(t)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Zt extends i.BaseError{constructor({blockHash:t,blockNumber:r}){let n="Block";t&&(n=`Block at hash "${t}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function X(e,{blockHash:t,blockNumber:r,blockTag:n,includeTransactions:o}={}){var l,f,b;const s=n??"latest",a=o??!1,c=r!==void 0?i.numberToHex(r):void 0;let u=null;if(t?u=await e.request({method:"eth_getBlockByHash",params:[t,a]},{dedupe:!0}):u=await e.request({method:"eth_getBlockByNumber",params:[c||s,a]},{dedupe:!!c}),!u)throw new Zt({blockHash:t,blockNumber:r});return(((b=(f=(l=e.chain)==null?void 0:l.formatters)==null?void 0:f.block)==null?void 0:b.format)||i.formatBlock)(u)}async function et(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Yn(e,t){return Wt(e,t)}async function Wt(e,t){var s,a,c;const{block:r,chain:n=e.chain,request:o}=t||{};if(typeof((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee)=="function"){const u=r||await E(e,X,"getBlock")({});return n.fees.defaultPriorityFee({block:u,client:e,request:o})}if(typeof((a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee)<"u")return(c=n==null?void 0:n.fees)==null?void 0:c.defaultPriorityFee;try{const u=await e.request({method:"eth_maxPriorityFeePerGas"});return i.hexToBigInt(u)}catch{const[u,d]=await Promise.all([r?Promise.resolve(r):E(e,X,"getBlock")({}),E(e,et,"getGasPrice")({})]);if(typeof u.baseFeePerGas!="bigint")throw new Qe;const l=d-u.baseFeePerGas;return l<0n?0n:l}}async function Xn(e,t){return He(e,t)}async function He(e,t){var b,m;const{block:r,chain:n=e.chain,request:o,type:s="eip1559"}=t||{},a=await(async()=>{var p,y;return typeof((p=n==null?void 0:n.fees)==null?void 0:p.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:o}):((y=n==null?void 0:n.fees)==null?void 0:y.baseFeeMultiplier)??1.2})();if(a<1)throw new Jn;const u=10**(((b=a.toString().split(".")[1])==null?void 0:b.length)??0),d=p=>p*BigInt(Math.ceil(a*u))/BigInt(u),l=r||await E(e,X,"getBlock")({});if(typeof((m=n==null?void 0:n.fees)==null?void 0:m.estimateFeesPerGas)=="function"){const p=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:d,request:o,type:s});if(p!==null)return p}if(s==="eip1559"){if(typeof l.baseFeePerGas!="bigint")throw new Qe;const p=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await Wt(e,{block:l,chain:n,request:o}),y=d(l.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??y+p,maxPriorityFeePerGas:p}}return{gasPrice:(o==null?void 0:o.gasPrice)??d(await E(e,et,"getGasPrice")({}))}}async function Jt(e,{address:t,blockTag:r="latest",blockNumber:n}){const o=await e.request({method:"eth_getTransactionCount",params:[t,n?i.numberToHex(n):r]},{dedupe:!!n});return i.hexToNumber(o)}async function tt(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return i.hexToNumber(t)}const Kt=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function rt(e,t){const{account:r=e.account,blobs:n,chain:o,gas:s,kzg:a,nonce:c,parameters:u=Kt,type:d}=t,l=r?N(r):void 0,f={...t,...l?{from:l==null?void 0:l.address}:{}};let b;async function m(){return b||(b=await E(e,X,"getBlock")({blockTag:"latest"}),b)}let p;async function y(){return p||(o?o.id:typeof t.chainId<"u"?t.chainId:(p=await E(e,tt,"getChainId")({}),p))}if((u.includes("blobVersionedHashes")||u.includes("sidecars"))&&n&&a){const h=i.blobsToCommitments({blobs:n,kzg:a});if(u.includes("blobVersionedHashes")){const v=i.commitmentsToVersionedHashes({commitments:h,to:"hex"});f.blobVersionedHashes=v}if(u.includes("sidecars")){const v=i.blobsToProofs({blobs:n,commitments:h,kzg:a}),g=i.toBlobSidecars({blobs:n,commitments:h,proofs:v,to:"hex"});f.sidecars=g}}if(u.includes("chainId")&&(f.chainId=await y()),u.includes("nonce")&&typeof c>"u"&&l)if(l.nonceManager){const h=await y();f.nonce=await l.nonceManager.consume({address:l.address,chainId:h,client:e})}else f.nonce=await E(e,Jt,"getTransactionCount")({address:l.address,blockTag:"pending"});if((u.includes("fees")||u.includes("type"))&&typeof d>"u")try{f.type=i.getTransactionType(f)}catch{const h=await m();f.type=typeof(h==null?void 0:h.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(u.includes("fees"))if(f.type!=="legacy"&&f.type!=="eip2930"){if(typeof f.maxFeePerGas>"u"||typeof f.maxPriorityFeePerGas>"u"){const h=await m(),{maxFeePerGas:v,maxPriorityFeePerGas:g}=await He(e,{block:h,chain:o,request:f});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<g)throw new Kn({maxPriorityFeePerGas:g});f.maxPriorityFeePerGas=g,f.maxFeePerGas=v}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new Qe;const h=await m(),{gasPrice:v}=await He(e,{block:h,chain:o,request:f,type:"legacy"});f.gasPrice=v}return u.includes("gas")&&typeof s>"u"&&(f.gas=await E(e,nt,"estimateGas")({...f,account:l?{address:l.address,type:"json-rpc"}:void 0})),te(f),delete f.parameters,f}async function nt(e,t){var o,s,a;const r=t.account??e.account,n=r?N(r):void 0;try{const{accessList:c,blobs:u,blobVersionedHashes:d,blockNumber:l,blockTag:f,data:b,gas:m,gasPrice:p,maxFeePerBlobGas:y,maxFeePerGas:h,maxPriorityFeePerGas:v,nonce:g,to:A,value:P,stateOverride:$,...T}=await rt(e,{...t,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),w=(l?i.numberToHex(l):void 0)||f,x=Vt($);te(t);const G=(a=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionRequest)==null?void 0:a.format,C=(G||Fe)({...Xe(T,{format:G}),from:n==null?void 0:n.address,accessList:c,blobs:u,blobVersionedHashes:d,data:b,gas:m,gasPrice:p,maxFeePerBlobGas:y,maxFeePerGas:h,maxPriorityFeePerGas:v,nonce:g,to:A,value:P}),S=await e.request({method:"eth_estimateGas",params:x?[C,w??"latest",x]:w?[C,w]:[C]});return BigInt(S)}catch(c){throw Vn(c,{...t,account:n,chain:e.chain})}}async function Qn(e,t){const{abi:r,address:n,args:o,functionName:s,...a}=t,c=U({abi:r,args:o,functionName:s});try{return await E(e,nt,"estimateGas")({data:c,to:n,...a})}catch(u){const d=a.account?N(a.account):void 0;throw Be(u,{abi:r,address:n,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:d==null?void 0:d.address})}}function Yt(e,t){if(!i.isAddress(e,{strict:!1}))throw new i.InvalidAddressError({address:e});if(!i.isAddress(t,{strict:!1}))throw new i.InvalidAddressError({address:t});return e.toLowerCase()===t.toLowerCase()}const gt="/docs/contract/decodeEventLog";function ot(e){const{abi:t,data:r,strict:n,topics:o}=e,s=n??!0,[a,...c]=o;if(!a)throw new Qr({docsPath:gt});const u=t.find(y=>y.type==="event"&&a===Ue(I(y)));if(!(u&&"name"in u)||u.type!=="event")throw new kt(a,{docsPath:gt});const{name:d,inputs:l}=u,f=l==null?void 0:l.some(y=>!("name"in y&&y.name));let b=f?[]:{};const m=l.filter(y=>"indexed"in y&&y.indexed);for(let y=0;y<m.length;y++){const h=m[y],v=c[y];if(!v)throw new ce({abiItem:u,param:h});b[f?y:h.name||y]=eo({param:h,value:v})}const p=l.filter(y=>!("indexed"in y&&y.indexed));if(p.length>0){if(r&&r!=="0x")try{const y=le(p,r);if(y)if(f)b=[...b,...y];else for(let h=0;h<p.length;h++)b[p[h].name]=y[h]}catch(y){if(s)throw y instanceof Rt||y instanceof i.PositionOutOfBoundsError?new K({abiItem:u,data:r,params:p,size:i.size(r)}):y}else if(s)throw new K({abiItem:u,data:"0x",params:p,size:0})}return{eventName:d,args:Object.values(b).length>0?b:void 0}}function eo({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(le([e],t)||[])[0]}function at(e){const{abi:t,args:r,logs:n,strict:o=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return n.map(a=>{var c;try{const u=q({abi:t,name:a.topics[0]});if(!u)return null;const d=ot({...a,abi:[u],strict:o});return s&&!s.includes(d.eventName)||!to({args:d.args,inputs:u.inputs,matchArgs:r})?null:{...d,...a}}catch(u){let d,l;if(u instanceof kt)return null;if(u instanceof K||u instanceof ce){if(o)return null;d=u.abiItem.name,l=(c=u.abiItem.inputs)==null?void 0:c.some(f=>!("name"in f&&f.name))}return{...a,args:l?[]:{},eventName:d}}}).filter(Boolean)}function to(e){const{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function o(s,a,c){try{return s.type==="address"?Yt(a,c):s.type==="string"||s.type==="bytes"?i.keccak256(i.toBytes$1(a))===c:a===c}catch{return!1}}return Array.isArray(t)&&Array.isArray(n)?n.every((s,a)=>{if(!s)return!0;const c=r[a];return c?(Array.isArray(s)?s:[s]).some(d=>o(c,d,t[a])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([s,a])=>{if(!a)return!0;const c=r.find(d=>d.name===s);return c?(Array.isArray(a)?a:[a]).some(d=>o(c,d,t[s])):!1}):!1}async function Xt(e,{address:t,blockHash:r,fromBlock:n,toBlock:o,event:s,events:a,args:c,strict:u}={}){const d=u??!1,l=a??(s?[s]:void 0);let f=[];l&&(f=[l.flatMap(y=>de({abi:[y],eventName:y.name,args:a?void 0:c}))],s&&(f=f[0]));let b;r?b=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:r}]}):b=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof n=="bigint"?i.numberToHex(n):n,toBlock:typeof o=="bigint"?i.numberToHex(o):o}]});const m=b.map(p=>i.formatLog(p));return l?at({abi:l,args:c,logs:m,strict:d}):m}async function Qt(e,t){const{abi:r,address:n,args:o,blockHash:s,eventName:a,fromBlock:c,toBlock:u,strict:d}=t,l=a?q({abi:r,name:a}):void 0,f=l?void 0:r.filter(b=>b.type==="event");return E(e,Xt,"getLogs")({address:n,args:o,blockHash:s,event:l,events:f,fromBlock:c,toBlock:u,strict:d})}const Re="/docs/contract/decodeFunctionResult";function Ce(e){const{abi:t,args:r,functionName:n,data:o}=e;let s=t[0];if(n){const c=q({abi:t,args:r,name:n});if(!c)throw new ae(n,{docsPath:Re});s=c}if(s.type!=="function")throw new ae(void 0,{docsPath:Re});if(!s.outputs)throw new en(s.name,{docsPath:Re});const a=le(s.outputs,o);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}const Le=[{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"}],er=[{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"}],ro=[...er,{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"}]}],no=[...er,{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"}]}],oo=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ao=[{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"}]}],so=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],io="0x82ad56cb",co="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",uo="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",lo="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Se="/docs/contract/encodeDeployData";function st(e){const{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;const o=t.find(a=>"type"in a&&a.type==="constructor");if(!o)throw new Jr({docsPath:Se});if(!("inputs"in o))throw new dt({docsPath:Se});if(!o.inputs||o.inputs.length===0)throw new dt({docsPath:Se});const s=ue(o.inputs,r);return i.concatHex([n,s])}function tr({blockNumber:e,chain:t,contract:r}){var o;const n=(o=t==null?void 0:t.contracts)==null?void 0:o[r];if(!n)throw new i.ChainDoesNotSupportContract({chain:t,contract:{name:r}});if(e&&n.blockCreated&&n.blockCreated>e)throw new i.ChainDoesNotSupportContract({blockNumber:e,chain:t,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function fo(e,{docsPath:t,...r}){const n=(()=>{const o=Ye(e,r);return o instanceof i.UnknownNodeError?e:o})();return new _t(n,{docsPath:t,...r})}const ke=new Map;function rr({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:o}){const s=async()=>{const l=u();a();const f=l.map(({args:b})=>b);f.length!==0&&e(f).then(b=>{var m;o&&Array.isArray(b)&&b.sort(o);for(let p=0;p<l.length;p++){const{pendingPromise:y}=l[p];(m=y.resolve)==null||m.call(y,[b[p],b])}}).catch(b=>{var m;for(let p=0;p<l.length;p++){const{pendingPromise:y}=l[p];(m=y.reject)==null||m.call(y,b)}})},a=()=>ke.delete(t),c=()=>u().map(({args:l})=>l),u=()=>ke.get(t)||[],d=l=>ke.set(t,[...u(),l]);return{flush:a,async schedule(l){const f={},b=new Promise((y,h)=>{f.resolve=y,f.reject=h});return(r==null?void 0:r([...c(),l]))&&s(),u().length>0?(d({args:l,pendingPromise:f}),b):(d({args:l,pendingPromise:f}),setTimeout(s,n),b)}}}async function it(e,t){var M,C,S,re;const{account:r=e.account,batch:n=!!((M=e.batch)!=null&&M.multicall),blockNumber:o,blockTag:s="latest",accessList:a,blobs:c,code:u,data:d,factory:l,factoryData:f,gas:b,gasPrice:m,maxFeePerBlobGas:p,maxFeePerGas:y,maxPriorityFeePerGas:h,nonce:v,to:g,value:A,stateOverride:P,...$}=t,T=r?N(r):void 0;if(u&&(l||f))throw new i.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&g)throw new i.BaseError("Cannot provide both `code` & `to` as parameters.");const F=u&&d,w=l&&f&&g&&d,x=F||w,G=F?yo({code:u,data:d}):w?mo({data:d,factory:l,factoryData:f,to:g}):d;try{te(t);const R=(o?i.numberToHex(o):void 0)||s,Z=Vt(P),ne=(re=(S=(C=e.chain)==null?void 0:C.formatters)==null?void 0:S.transactionRequest)==null?void 0:re.format,oe=(ne||Fe)({...Xe($,{format:ne}),from:T==null?void 0:T.address,accessList:a,blobs:c,data:G,gas:b,gasPrice:m,maxFeePerBlobGas:p,maxFeePerGas:y,maxPriorityFeePerGas:h,nonce:v,to:x?void 0:g,value:A});if(n&&bo({request:oe})&&!Z)try{return await po(e,{...oe,blockNumber:o,blockTag:s})}catch(Oe){if(!(Oe instanceof i.ClientChainNotConfiguredError)&&!(Oe instanceof i.ChainDoesNotSupportContract))throw Oe}const ct=await e.request({method:"eth_call",params:Z?[oe,R,Z]:[oe,R]});return ct==="0x"?{data:void 0}:{data:ct}}catch(L){const R=ho(L),{offchainLookup:Z,offchainLookupSignature:ne}=await Promise.resolve().then(()=>require("./ccip-DLDqFodf.cjs"));if(e.ccipRead!==!1&&(R==null?void 0:R.slice(0,10))===ne&&g)return{data:await Z(e,{data:R,to:g})};throw x&&(R==null?void 0:R.slice(0,10))==="0x101bb98d"?new Gn({factory:l}):fo(L,{...t,account:T,chain:e.chain})}}function bo({request:e}){const{data:t,to:r,...n}=e;return!(!t||t.startsWith(io)||!r||Object.values(n).filter(o=>typeof o<"u").length>0)}async function po(e,t){var y;const{batchSize:r=1024,wait:n=0}=typeof((y=e.batch)==null?void 0:y.multicall)=="object"?e.batch.multicall:{},{blockNumber:o,blockTag:s="latest",data:a,multicallAddress:c,to:u}=t;let d=c;if(!d){if(!e.chain)throw new i.ClientChainNotConfiguredError;d=tr({blockNumber:o,chain:e.chain,contract:"multicall3"})}const f=(o?i.numberToHex(o):void 0)||s,{schedule:b}=rr({id:`${e.uid}.${f}`,wait:n,shouldSplitBatch(h){return h.reduce((g,{data:A})=>g+(A.length-2),0)>r*2},fn:async h=>{const v=h.map(P=>({allowFailure:!0,callData:P.data,target:P.to})),g=U({abi:Le,args:[v],functionName:"aggregate3"}),A=await e.request({method:"eth_call",params:[{data:g,to:d},f]});return Ce({abi:Le,args:[v],functionName:"aggregate3",data:A||"0x"})}}),[{returnData:m,success:p}]=await b({data:a,to:u});if(!p)throw new Ke({data:m});return m==="0x"?{data:void 0}:{data:m}}function yo(e){const{code:t,data:r}=e;return st({abi:Mt(["constructor(bytes, bytes)"]),bytecode:co,args:[t,r]})}function mo(e){const{data:t,factory:r,factoryData:n,to:o}=e;return st({abi:Mt(["constructor(address, bytes, address, bytes)"]),bytecode:uo,args:[o,t,r,n]})}function ho(e){var r;if(!(e instanceof i.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(r=t.data)==null?void 0:r.data:t.data}async function go(e,t){const{abi:r,address:n,args:o,functionName:s,...a}=t,c=U({abi:r,args:o,functionName:s});try{const{data:u}=await E(e,it,"call")({...a,data:c,to:n});return Ce({abi:r,args:o,functionName:s,data:u||"0x"})}catch(u){throw Be(u,{abi:r,address:n,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function wo(e,t){const{abi:r,address:n,args:o,dataSuffix:s,functionName:a,...c}=t,u=c.account?N(c.account):e.account,d=U({abi:r,args:o,functionName:a});try{const{data:l}=await E(e,it,"call")({batch:!1,data:`${d}${s?s.replace("0x",""):""}`,to:n,...c,account:u}),f=Ce({abi:r,args:o,functionName:a,data:l||"0x"}),b=r.filter(m=>"name"in m&&m.name===t.functionName);return{result:f,request:{abi:b,address:n,args:o,dataSuffix:s,functionName:a,...c,account:u}}}catch(l){throw Be(l,{abi:r,address:n,args:o,docsPath:"/docs/contract/simulateContract",functionName:a,sender:u==null?void 0:u.address})}}const Ie=new Map,wt=new Map;let vo=0;function _e(e,t,r){const n=++vo,o=()=>Ie.get(e)||[],s=()=>{const l=o();Ie.set(e,l.filter(f=>f.id!==n))},a=()=>{const l=wt.get(e);o().length===1&&l&&l(),s()},c=o();if(Ie.set(e,[...c,{id:n,fns:t}]),c&&c.length>0)return a;const u={};for(const l in t)u[l]=(...f)=>{var m,p;const b=o();if(b.length!==0)for(const y of b)(p=(m=y.fns)[l])==null||p.call(m,...f)};const d=r(u);return typeof d=="function"&&wt.set(e,d),a}async function qe(e){return new Promise(t=>setTimeout(t,e))}function nr(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let o=!0;const s=()=>o=!1;return(async()=>{let c;t&&(c=await e({unpoll:s}));const u=await(r==null?void 0:r(c))??n;await qe(u);const d=async()=>{o&&(await e({unpoll:s}),await qe(n),d())};d()})(),s}const Eo=new Map,Po=new Map;function xo(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:a=>s.set(o,a)}),r=t(e,Eo),n=t(e,Po);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function Ao(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){const n=xo(t),o=n.response.get();if(o&&r>0&&new Date().getTime()-o.created.getTime()<r)return o.data;let s=n.promise.get();s||(s=e(),n.promise.set(s));try{const a=await s;return n.response.set({created:new Date,data:a}),a}finally{n.promise.clear()}}const $o=e=>`blockNumber.${e}`;async function or(e,{cacheTime:t=e.cacheTime}={}){const r=await Ao(()=>e.request({method:"eth_blockNumber"}),{cacheKey:$o(e.uid),cacheTime:t});return BigInt(r)}async function ar(e,{filter:t}){const r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof n[0]=="string")return n;const o=n.map(s=>i.formatLog(s));return!("abi"in t)||!t.abi?o:at({abi:t.abi,logs:o,strict:r})}async function sr(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function To(e,t){const{abi:r,address:n,args:o,batch:s=!0,eventName:a,fromBlock:c,onError:u,onLogs:d,poll:l,pollingInterval:f=e.pollingInterval,strict:b}=t;return(typeof l<"u"?l:typeof c=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const h=b??!1,v=H(["watchContractEvent",n,o,s,e.uid,a,f,h,c]);return _e(v,{onLogs:d,onError:u},g=>{let A;c!==void 0&&(A=c-1n);let P,$=!1;const T=nr(async()=>{var F;if(!$){try{P=await E(e,Gt,"createContractEventFilter")({abi:r,address:n,args:o,eventName:a,strict:h,fromBlock:c})}catch{}$=!0;return}try{let w;if(P)w=await E(e,ar,"getFilterChanges")({filter:P});else{const x=await E(e,or,"getBlockNumber")({});A&&A<x?w=await E(e,Qt,"getContractEvents")({abi:r,address:n,args:o,eventName:a,fromBlock:A+1n,toBlock:x,strict:h}):w=[],A=x}if(w.length===0)return;if(s)g.onLogs(w);else for(const x of w)g.onLogs([x])}catch(w){P&&w instanceof ee&&($=!1),(F=g.onError)==null||F.call(g,w)}},{emitOnBegin:!0,interval:f});return async()=>{P&&await E(e,sr,"uninstallFilter")({filter:P}),T()}})})():(()=>{const h=b??!1,v=H(["watchContractEvent",n,o,s,e.uid,a,f,h]);let g=!0,A=()=>g=!1;return _e(v,{onLogs:d,onError:u},P=>((async()=>{try{const $=(()=>{if(e.transport.type==="fallback"){const w=e.transport.transports.find(x=>x.config.type==="webSocket");return w?w.value:e.transport}return e.transport})(),T=a?de({abi:r,eventName:a,args:o}):[],{unsubscribe:F}=await $.subscribe({params:["logs",{address:n,topics:T}],onData(w){var G;if(!g)return;const x=w.result;try{const{eventName:M,args:C}=ot({abi:r,data:x.data,topics:x.topics,strict:b}),S=i.formatLog(x,{args:C,eventName:M});P.onLogs([S])}catch(M){let C,S;if(M instanceof K||M instanceof ce){if(b)return;C=M.abiItem.name,S=(G=M.abiItem.inputs)==null?void 0:G.some(L=>!("name"in L&&L.name))}const re=i.formatLog(x,{args:S?[]:{},eventName:C});P.onLogs([re])}},onError(w){var x;(x=P.onError)==null||x.call(P,w)}});A=F,g||A()}catch($){u==null||u($)}})(),()=>A()))})()}class ir extends i.BaseError{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 Client."].join(`
|
|
31
|
-
`),{docsPath:t,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class vt extends i.BaseError{constructor({docsPath:t,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:t,metaMessages:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountTypeNotSupportedError"})}}function cr({chain:e,currentChainId:t}){if(!e)throw new i.ChainNotFoundError;if(t!==e.id)throw new i.ChainMismatchError({chain:e,currentChainId:t})}function jo(e,{docsPath:t,...r}){const n=(()=>{const o=Ye(e,r);return o instanceof i.UnknownNodeError?e:o})();return new i.TransactionExecutionError(n,{docsPath:t,...r})}async function ur(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}async function dr(e,t){var v,g,A,P;const{account:r=e.account,chain:n=e.chain,accessList:o,blobs:s,data:a,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:f,nonce:b,to:m,value:p,...y}=t;if(!r)throw new ir({docsPath:"/docs/actions/wallet/sendTransaction"});const h=N(r);try{te(t);let $;if(n!==null&&($=await E(e,tt,"getChainId")({}),cr({currentChainId:$,chain:n})),h.type==="json-rpc"){const T=(A=(g=(v=e.chain)==null?void 0:v.formatters)==null?void 0:g.transactionRequest)==null?void 0:A.format,w=(T||Fe)({...Xe(y,{format:T}),accessList:o,blobs:s,chainId:$,data:a,from:h.address,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:f,nonce:b,to:m,value:p});return await e.request({method:"eth_sendTransaction",params:[w]},{retryCount:0})}if(h.type==="local"){const T=await E(e,rt,"prepareTransactionRequest")({account:h,accessList:o,blobs:s,chain:n,chainId:$,data:a,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:f,nonce:b,parameters:[...Kt,"sidecars"],to:m,value:p,...y}),F=(P=n==null?void 0:n.serializers)==null?void 0:P.transaction,w=await h.signTransaction(T,{serializer:F});return await E(e,ur,"sendRawTransaction")({serializedTransaction:w})}throw h.type==="smart"?new vt({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Error("incompatible account type.")}catch($){throw $ instanceof vt?$:jo($,{...t,account:h,chain:t.chain||void 0})}}async function Bo(e,t){const{abi:r,address:n,args:o,dataSuffix:s,functionName:a,...c}=t,u=U({abi:r,args:o,functionName:a});return E(e,dr,"sendTransaction")({data:`${u}${s?s.replace("0x",""):""}`,to:n,...c})}exports.AbiDecodingZeroDataError=ie;exports.AccountNotFoundError=ir;exports.BlockNotFoundError=Zt;exports.BytesSizeMismatchError=rn;exports.CallExecutionError=_t;exports.ChainDisconnectedError=Te;exports.ContractFunctionRevertedError=qt;exports.DecodeLogDataMismatch=K;exports.DecodeLogTopicsMismatch=ce;exports.HttpRequestError=Dn;exports.InternalRpcError=Q;exports.InvalidInputRpcError=ee;exports.InvalidParamsRpcError=ye;exports.InvalidRequestRpcError=be;exports.JsonRpcVersionUnsupportedError=Ee;exports.LimitExceededRpcError=ve;exports.MethodNotFoundRpcError=pe;exports.MethodNotSupportedRpcError=we;exports.ParseRpcError=fe;exports.ProviderDisconnectedError=$e;exports.RawContractError=Ke;exports.ResourceNotFoundRpcError=me;exports.ResourceUnavailableRpcError=he;exports.RpcRequestError=Ut;exports.SwitchChainError=je;exports.TimeoutError=Hn;exports.TransactionRejectedRpcError=ge;exports.UnauthorizedProviderError=xe;exports.UnknownRpcError=_n;exports.UnsupportedProviderMethodError=Ae;exports.UserRejectedRequestError=Pe;exports.addressResolverAbi=ao;exports.assertCurrentChain=cr;exports.assertRequest=te;exports.call=it;exports.createBatchScheduler=rr;exports.createContractEventFilter=Gt;exports.createFilterRequestScope=zt;exports.decodeErrorResult=Ht;exports.decodeEventLog=ot;exports.decodeFunctionResult=Ce;exports.encodeAbiParameters=ue;exports.encodeDeployData=st;exports.encodeEventTopics=de;exports.encodeFunctionData=U;exports.estimateContractGas=Qn;exports.estimateFeesPerGas=Xn;exports.estimateGas=nt;exports.estimateMaxPriorityFeePerGas=Yn;exports.formatTransactionRequest=Fe;exports.getAction=E;exports.getBlock=X;exports.getBlockNumber=or;exports.getChainContractAddress=tr;exports.getChainId=tt;exports.getContractError=Be;exports.getContractEvents=Qt;exports.getFilterChanges=ar;exports.getGasPrice=et;exports.getLogs=Xt;exports.getTransactionCount=Jt;exports.isAddressEqual=Yt;exports.multicall3Abi=Le;exports.observe=_e;exports.panicReasons=Dt;exports.parseAccount=N;exports.parseEventLogs=at;exports.poll=nr;exports.prepareTransactionRequest=rt;exports.readContract=go;exports.sendRawTransaction=ur;exports.sendTransaction=dr;exports.simulateContract=wo;exports.stringify=H;exports.textResolverAbi=oo;exports.uninstallFilter=sr;exports.universalResolverResolveAbi=ro;exports.universalResolverReverseAbi=no;exports.universalSignatureValidatorAbi=so;exports.universalSignatureValidatorByteCode=lo;exports.wait=qe;exports.watchContractEvent=To;exports.writeContract=Bo;
|
|
32
|
-
//# sourceMappingURL=writeContract-BBHpAss8.cjs.map
|