import{B as o}from"./page-DggIj5Ru.js";const E={gwei:9,wei:18},u={ether:-9,wei:9};function l(t,r){let e=t.toString();const a=e.startsWith("-");a&&(e=e.slice(1)),e=e.padStart(r,"0");let[c,n]=[e.slice(0,e.length-r),e.slice(e.length-r)];return n=n.replace(/(0+)$/,""),`${a?"-":""}${c||"0"}${n?`.${n}`:""}`}function s(t,r="wei"){return l(t,u[r])}class i extends o{constructor({cause:r,message:e}={}){const a=e?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${a?`with reason: ${a}`:"for an unknown reason"}.`,{cause:r,name:"ExecutionRevertedError"})}}Object.defineProperty(i,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class d extends o{constructor({cause:r,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${s(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:r,name:"FeeCapTooHighError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class h extends o{constructor({cause:r,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${s(e)}`:""} gwei) cannot be lower than the block base fee.`,{cause:r,name:"FeeCapTooLowError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class f extends o{constructor({cause:r,nonce:e}={}){super(`Nonce provided for the transaction ${e?`(${e}) `:""}is higher than the next one expected.`,{cause:r,name:"NonceTooHighError"})}}Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class g extends o{constructor({cause:r,nonce:e}={}){super([`Nonce provided for the transaction ${e?`(${e}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
`),{cause:r,name:"NonceTooLowError"})}}Object.defineProperty(g,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class p extends o{constructor({cause:r,nonce:e}={}){super(`Nonce provided for the transaction ${e?`(${e}) `:""}exceeds the maximum allowed nonce.`,{cause:r,name:"NonceMaxValueError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class b extends o{constructor({cause:r}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
`),{cause:r,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(b,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class w extends o{constructor({cause:r,gas:e}={}){super(`The amount of gas ${e?`(${e}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:r,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(w,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class m extends o{constructor({cause:r,gas:e}={}){super(`The amount of gas ${e?`(${e}) `:""}provided for the transaction is too low.`,{cause:r,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(m,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class x extends o{constructor({cause:r}){super("The transaction type is not supported for this chain.",{cause:r,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(x,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class v extends o{constructor({cause:r,maxPriorityFeePerGas:e,maxFeePerGas:a}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${s(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${a?` = ${s(a)} gwei`:""}).`].join(`
`),{cause:r,name:"TipAboveFeeCapError"})}}Object.defineProperty(v,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class $ extends o{constructor({cause:r}){super(`An error occurred while executing: ${r?.shortMessage}`,{cause:r,name:"UnknownNodeError"})}}export{i as E,d as F,b as I,f as N,x as T,$ as U,s as a,h as b,g as c,p as d,E as e,l as f,w as g,m as h,v as i};
