@berachain/berajs 0.1.0-alpha.0 → 0.1.0-alpha.1
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/BeraError-CfcNTfpH.d.cts +69 -0
- package/dist/BexStatusProvider-nS3NcdxI.d.cts +70 -0
- package/dist/RequestError-BPxCeq0x.d.cts +57 -0
- package/dist/abi/index.cjs +1 -0
- package/dist/abi/index.d.cts +26765 -0
- package/dist/actions/index.cjs +1 -0
- package/dist/actions/index.d.cts +1649 -0
- package/dist/actions/index.d.ts +7 -7
- package/dist/aggregatorsRouter-Cny4B_MB.d.cts +593 -0
- package/dist/chunk-33CW5NUN.cjs +1 -0
- package/dist/chunk-6PL44I45.cjs +1 -0
- package/dist/chunk-IKAE7CQU.cjs +1 -0
- package/dist/chunk-ILYYJYGV.cjs +3 -0
- package/dist/chunk-KIA6GUIN.cjs +1 -0
- package/dist/chunk-LHFVY26H.cjs +2 -0
- package/dist/chunk-LX5CM4Y6.cjs +1 -0
- package/dist/chunk-MDA4YT6J.cjs +1 -0
- package/dist/chunk-NOV7UCGA.cjs +1 -0
- package/dist/chunk-SW47CI6T.cjs +1 -0
- package/dist/chunk-YKKMWJX5.cjs +1 -0
- package/dist/contexts/index.cjs +1 -0
- package/dist/contexts/index.d.cts +81 -0
- package/dist/contexts/index.d.ts +3 -3
- package/dist/defaultFlags-V-tJs2K8.d.cts +10 -0
- package/dist/{dex-DreiokgL.d.ts → dex-D9U93Ib-.d.cts} +3 -3
- package/dist/enum/index.cjs +1 -0
- package/dist/enum/index.d.cts +31 -0
- package/dist/enum/index.d.ts +1 -1
- package/dist/errors/index.cjs +1 -0
- package/dist/errors/index.d.cts +204 -0
- package/dist/errors/index.d.ts +1 -1
- package/dist/{getValidatorQueuedOperatorAddress-DK2Xv19c.d.ts → getValidatorQueuedOperatorAddress-BbyH7asf.d.cts} +2 -2
- package/dist/hooks/index.cjs +3 -0
- package/dist/hooks/index.d.cts +1703 -0
- package/dist/hooks/index.d.ts +7 -7
- package/dist/polling-BKnyavLI.d.cts +8 -0
- package/dist/pythWrapper-CBjsmmsK.d.cts +1958 -0
- package/dist/{staking-Cggi38So.d.ts → staking-DHCsSRru.d.cts} +1 -1
- package/dist/{txnEnum-BQKDfaeH.d.ts → txnEnum-Diichv9Z.d.cts} +0 -1
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +56 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/{useHoneySwapState-Ci8_c2bT.d.ts → useHoneySwapState-A9cyIoOS.d.cts} +1 -1
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.cts +349 -0
- package/dist/utils/index.d.ts +3 -3
- package/package.json +3 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;var d="Something went wrong. Please try again later.",p= exports.a ={ERC20:{NOT_ENOUGH_BALANCE:{reasons:["NotEnoughBalance"],errorMSG:"You do not have enough balance to perform this action."},InsufficientBalance:{reasons:["InsufficientBalance"],errorMSG:"Insufficient token balance"},INSUFFICIENT_ALLOWANCE:{reasons:["0x13be252b","InsufficientAllowance","ERC20InsufficientAllowance"],errorMSG:"You do not have enough allowance to perform this action."},SIGNATURE_EXPIRED:{reasons:["SignatureExpired"],errorMSG:"Transaction took too long to complete. Please try again."}},HTTP:{RATE_LIMITED_429:{reasons:["429"],errorMSG:"Too many requests. Please try again later."}},ENSO:{COULD_NOT_BUILD_SHORTCUT:{keywords:["Could not build shortcuts for route","Could not quote shortcuts for route"],errorMSG:"There was an error building the zap route. Try with lower amounts."},NOT_ENOUGH_LIQUIDITY:{keywords:["Swap not found for a required underlying of defi route, please make sure your amountIn is within an acceptable range"],errorMSG:"The amount you\u2019re trying to swap might be too high. Please make sure that your amount is within an acceptable range."},NO_ROUTE_FOUND:{keywords:["No route found from"],errorMSG:"No swap route found for the given tokens."}},RPC:{INSUFFICIENT_FUNDS:{reasons:["InsufficientFundsError"],keywords:["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."],errorMSG:"Insufficient BERA balance to perform this action."},GAS_PRICE:{keywords:["gasLimit"],errorMSG:"It seems an RPC error has occurred while estimating gas. Please try your request later."},JSON_RPC:{keywords:["JSON-RPC"],errorMSG:"It seems an RPC error has occurred. Please try your request one more later."},HASH:{keywords:["hash"],errorMSG:"It seems an RPC error has occurred. Please check if your transaction was finalized. If not, please try again."},USER_REJECTION:{reasons:["UserRejectedRequestError"],keywords:["User denied transaction signature"],errorMSG:"You rejected the transaction."},SMART_UPGRADE_REJECTION:{reasons:["AtomicReadyWalletRejectedUpgradeError"],errorMSG:"You've declined to upgrade to batch transactions for now, try again for the traditional method."},CHAIN_MISMATCH:{reasons:["ChainMismatchError"],errorMSG:"Wallet seems to be on the wrong chain, please refresh the page and try again."}},HONEY:{BLACKLISTED_WALLET:{reasons:["BlacklistedWallet","0x265693b4"],errorMSG:"Your wallet is blacklisted from minting or redeeming HONEY."},LIQUIDITY_ERROR:{reasons:["0x4656425a"],errorMSG:"You are trying to redeem more than the liquidity available in the vault."}},BEX:{SLIPPAGE_EXCEEDED:{reasons:["SlippageExceeded"],errorMSG:"Price changed while executing the transaction and exceeded the allowed slippage."},BAL000:{reasons:["BAL#000"],errorMSG:"Addition overflow occurred during calculation. (BEX#000)"},BAL001:{reasons:["BAL#001"],errorMSG:"Subtraction overflow occurred during calculation. (BEX#001)"},BAL002:{reasons:["BAL#002"],errorMSG:"Subtraction underflow occurred during calculation. (BEX#002)"},BAL003:{reasons:["BAL#003"],errorMSG:"Multiplication overflow occurred during calculation. (BEX#003)"},BAL004:{reasons:["BAL#004"],errorMSG:"Attempted division by zero. (BEX#004)"},BAL005:{reasons:["BAL#005"],errorMSG:"Multiplication overflow during FixedPoint Division. (BEX#005)"},BAL006:{reasons:["BAL#006"],errorMSG:"Invalid x in ExpMath.pow(x, y). (BEX#006)"},BAL007:{reasons:["BAL#007"],errorMSG:"Invalid y in ExpMath.pow(x, y). (BEX#007)"},BAL008:{reasons:["BAL#008"],errorMSG:"In LogExpMath.pow(x, y), error computing x^y as exp(y * ln(x)). (BEX#008)"},BAL009:{reasons:["BAL#009"],errorMSG:"In LogExpMath.exp(x) = e^x; x out of bounds. (BEX#009)"},BAL100:{reasons:["BAL#100"],errorMSG:"Value is out of acceptable bounds. (BEX#100)"},BAL101:{reasons:["BAL#101"],errorMSG:"Tokens must be sorted in address order on pool registration. (BEX#101)"},BAL102:{reasons:["BAL#102"],errorMSG:"Tokens must be sorted in address order on pool registration. (BEX#102)"},BAL103:{reasons:["BAL#103"],errorMSG:"Parallel array inputs must have the same length. (BEX#103)"},BAL104:{reasons:["BAL#104"],errorMSG:"Address to be interpreted as a token cannot be 0. (BEX#104)"},BAL105:{reasons:["BAL#105"],errorMSG:"Insufficient byte length. (BEX#105)"},BAL200:{reasons:["BAL#200"],errorMSG:"All pools must contain at least two tokens. (BEX#200)"},BAL201:{reasons:["BAL#201"],errorMSG:"Token count exceeds the maximum for a given pool type. (BEX#201)"},BAL202:{reasons:["BAL#202"],errorMSG:"Swap fee percentage exceeds the maximum allowed. (BEX#202)"},BAL203:{reasons:["BAL#203"],errorMSG:"Swap fee percentage is below the minimum allowed. (BEX#203)"},BAL204:{reasons:["BAL#204"],errorMSG:"Pool initialization failed: a small amount of BPT is minted to the zero address to maintain mathematical consistency. If initial balances are too low, the initialization process may fail. (BEX#204)"},BAL205:{reasons:["BAL#205"],errorMSG:"User attempted to execute a callback intended for the vault contract. (BEX#205)"},BAL206:{reasons:["BAL#206"],errorMSG:"Pools must be initialized with a special 'Init' join, before they can be joined by LPs. (BEX#206)"},BAL207:{reasons:["BAL#207"],errorMSG:"Slippage/front-running protection check failed on a pool exit. (BEX#207)"},BAL208:{reasons:["BAL#208"],errorMSG:"Minimum BPT output amount not met. (BEX#208)"},BAL209:{reasons:["BAL#209"],errorMSG:"Slippage/front-running protection check failed on a pool join. (BEX#209)"},BAL210:{reasons:["BAL#210"],errorMSG:"Pools with oracles are limited to two tokens. A pool with the TWO_TOKEN specialization must have exactly two tokens. (BEX#210)"},BAL211:{reasons:["BAL#211"],errorMSG:"The pool factory is disabled and new pools cannot be created at this time. (BEX#211)"},BAL300:{reasons:["BAL#300"],errorMSG:"The amplification parameter is below the minimum allowed. (BEX#300)"},BAL301:{reasons:["BAL#301"],errorMSG:"The amplification parameter exceeds the maximum allowed. (BEX#301)"},BAL302:{reasons:["BAL#302"],errorMSG:"The weight parameter is below the minimum allowed. (BEX#302)"},BAL303:{reasons:["BAL#303"],errorMSG:"The number of stable tokens exceeds the maximum allowed. (BEX#303)"},BAL304:{reasons:["BAL#304"],errorMSG:"The amount of tokens in would unbalance the pool. (BEX#304)"},BAL305:{reasons:["BAL#305"],errorMSG:"The amount of tokens out would unbalance the pool. (BEX#305)"},BAL306:{reasons:["BAL#306"],errorMSG:"Disproportionate pool exit would unbalance the pool. (BEX#306)"},BAL307:{reasons:["BAL#307"],errorMSG:"Disproportionate pool join would unbalance the pool. (BEX#307)"},BAL308:{reasons:["BAL#308"],errorMSG:"Normalized weights do not add to 1.0 exactly. (BEX#308)"},BAL309:{reasons:["BAL#309"],errorMSG:"Invalid token provided for operation. (BEX#309)"},BAL310:{reasons:["BAL#310"],errorMSG:"Unhandled pool join operation for this pool type. (BEX#310)"},BAL311:{reasons:["BAL#311"],errorMSG:"Pool balances must be > 0. (BEX#311)"},BAL312:{reasons:["BAL#312"],errorMSG:"Invalid query for oracle data ('ago' timestamp was not in the past). (BEX#312)"},BAL313:{reasons:["BAL#313"],errorMSG:"Oracle has no data to query. (BEX#313)"},BAL314:{reasons:["BAL#314"],errorMSG:"Oracle query data is before its earliest data sample. (BEX#314)"},BAL315:{reasons:["BAL#315"],errorMSG:"Cannot query an oracle sample outside the buffer of 1024. (BEX#315)"},BAL316:{reasons:["BAL#316"],errorMSG:"Oracle query window must have non-zero duration. (BEX#316)"},BAL317:{reasons:["BAL#317"],errorMSG:"Amplification parameter change has less than the minimum duration. (BEX#317)"},BAL318:{reasons:["BAL#318"],errorMSG:"Cannot start an amplification parameter update if one is already ongoing. (BEX#318)"},BAL319:{reasons:["BAL#319"],errorMSG:"The requested amplification parameter change is too fast (cannot halve or double over less than a day). (BEX#319)"},BAL320:{reasons:["BAL#320"],errorMSG:"Cannot cancel an update if there isn't one already ongoing. (BEX#320)"},BAL321:{reasons:["BAL#321"],errorMSG:"Stable pool invariant calculation did not converge. (BEX#321)"},BAL322:{reasons:["BAL#322"],errorMSG:"Stable pool balance calculation did not converge. (BEX#322)"},BAL323:{reasons:["BAL#323"],errorMSG:"Relayer must be a valid contract. (BEX#323)"},BAL324:{reasons:["BAL#324"],errorMSG:"Base pool relayer was not called correctly. (BEX#324)"},BAL325:{reasons:["BAL#325"],errorMSG:"Rebalancing relayer operation re-entered unexpectedly. (BEX#325)"},BAL326:{reasons:["BAL#326"],errorMSG:"Detected time travel in gradual updates (start > end time in a gradual weights update). (BEX#326)"},BAL327:{reasons:["BAL#327"],errorMSG:"Swaps are disabled for this pool. (BEX#327)"},BAL328:{reasons:["BAL#328"],errorMSG:"Caller is not the owner of the LBP. (BEX#328)"},BAL329:{reasons:["BAL#329"],errorMSG:"Rate returned from a rateProvider must fit within 128 bits. (BEX#329)"},BAL330:{reasons:["BAL#330"],errorMSG:"Investment pools only allow proportional joins and exits when swaps are disabled (to prevent unbalancing the pool). (BEX#330)"},BAL331:{reasons:["BAL#331"],errorMSG:"Gradual weight update duration too short (minimum 1 day). (BEX#331)"},BAL332:{reasons:["BAL#332"],errorMSG:"Invalid Linear Pool operating range. (BEX#332)"},BAL333:{reasons:["BAL#333"],errorMSG:"Linear Pool max balance must fit in 112 bits. (BEX#333)"},BAL334:{reasons:["BAL#334"],errorMSG:"Unhandled pool join/exit operation for linear pool type. (BEX#334)"},BAL335:{reasons:["BAL#335"],errorMSG:"Cannot reset Linear Pool targets if pool is unbalanced. (BEX#335)"},BAL336:{reasons:["BAL#336"],errorMSG:"Unhandled pool exit operation for this pool type. (BEX#336)"},BAL337:{reasons:["BAL#337"],errorMSG:"Management fees can only be collected by the pool owner. (BEX#337)"},BAL338:{reasons:["BAL#338"],errorMSG:"Management swap fee percentage exceeded the maximum. (BEX#338)"},BAL339:{reasons:["BAL#339"],errorMSG:"Unhandled pool join/exit operation for managed pool type. (BEX#339)"},BAL340:{reasons:["BAL#340"],errorMSG:"Unhandled pool join/exit operation for phantom pool type. (BEX#340)"},BAL341:{reasons:["BAL#341"],errorMSG:"Token does not have a valid rate provider. (BEX#341)"},BAL342:{reasons:["BAL#342"],errorMSG:"Invalid pool initialization parameters provided. (BEX#342)"},BAL343:{reasons:["BAL#343"],errorMSG:"Value is out of the new target range for the operation. (BEX#343)"},BAL344:{reasons:["BAL#344"],errorMSG:"This feature is currently disabled. (BEX#344)"},BAL345:{reasons:["BAL#345"],errorMSG:"The pool controller is uninitialized. (BEX#345)"},BAL346:{reasons:["BAL#346"],errorMSG:"Cannot set swap fee during an ongoing fee change. (BEX#346)"},BAL347:{reasons:["BAL#347"],errorMSG:"Cannot set swap fee during pending fee changes. (BEX#347)"},BAL348:{reasons:["BAL#348"],errorMSG:"Cannot change tokens during a weight change. (BEX#348)"},BAL349:{reasons:["BAL#349"],errorMSG:"Cannot change tokens during pending weight changes. (BEX#349)"},BAL350:{reasons:["BAL#350"],errorMSG:"Weight parameter exceeds the maximum allowed. (BEX#350)"},BAL351:{reasons:["BAL#351"],errorMSG:"Unauthorized join operation. (BEX#351)"},BAL352:{reasons:["BAL#352"],errorMSG:"Management AUM fee percentage exceeded the maximum allowed. (BEX#352)"},BAL353:{reasons:["BAL#353"],errorMSG:"Fractional target values are not supported. (BEX#353)"},BAL354:{reasons:["BAL#354"],errorMSG:"Adding or removing BPT is not allowed in this context. (BEX#354)"},BAL355:{reasons:["BAL#355"],errorMSG:"Invalid circuit breaker bounds configuration. (BEX#355)"},BAL356:{reasons:["BAL#356"],errorMSG:"The circuit breaker has been triggered. (BEX#356)"},BAL357:{reasons:["BAL#357"],errorMSG:"Malicious query detected and reverted. (BEX#357)"},BAL358:{reasons:["BAL#358"],errorMSG:"Joins and exits are currently disabled for this pool. (BEX#358)"},BAL400:{reasons:["BAL#400"],errorMSG:"Reentrancy detected. (BEX#400)"},BAL401:{reasons:["BAL#401"],errorMSG:"The sender is not allowed to perform this action. (BEX#401)"},BAL402:{reasons:["BAL#402"],errorMSG:"The contract is currently paused. (BEX#402)"},BAL403:{reasons:["BAL#403"],errorMSG:"The pause window has expired. (BEX#403)"},BAL404:{reasons:["BAL#404"],errorMSG:"The maximum pause window duration has been exceeded. (BEX#404)"},BAL405:{reasons:["BAL#405"],errorMSG:"The maximum buffer period duration has been exceeded. (BEX#405)"},BAL406:{reasons:["BAL#406"],errorMSG:"The account has insufficient balance. (BEX#406)"},BAL407:{reasons:["BAL#407"],errorMSG:"The account has insufficient allowance. (BEX#407)"},BAL408:{reasons:["BAL#408"],errorMSG:"ERC20: Transfer from zero address. (BEX#408)"},BAL409:{reasons:["BAL#409"],errorMSG:"ERC20: Transfer to zero address. (BEX#409)"},BAL410:{reasons:["BAL#410"],errorMSG:"ERC20: Mint to zero address. (BEX#410)"},BAL411:{reasons:["BAL#411"],errorMSG:"ERC20: Burn from zero address. (BEX#411)"},BAL412:{reasons:["BAL#412"],errorMSG:"ERC20: Approve from zero address. (BEX#412)"},BAL413:{reasons:["BAL#413"],errorMSG:"ERC20: Approve to zero address. (BEX#413)"},BAL414:{reasons:["BAL#414"],errorMSG:"ERC20: Transfer exceeds allowance. (BEX#414)"},BAL415:{reasons:["BAL#415"],errorMSG:"ERC20: Decreased allowance below zero. (BEX#415)"},BAL416:{reasons:["BAL#416"],errorMSG:"ERC20: Transfer exceeds balance. (BEX#416)"},BAL417:{reasons:["BAL#417"],errorMSG:"ERC20: Burn exceeds allowance. (BEX#417)"},BAL418:{reasons:["BAL#418"],errorMSG:"SafeERC20: Call failed. (BEX#418)"},BAL419:{reasons:["BAL#419"],errorMSG:"Address has insufficient balance. (BEX#419)"},BAL420:{reasons:["BAL#420"],errorMSG:"Address cannot send value. (BEX#420)"},BAL421:{reasons:["BAL#421"],errorMSG:"SafeCast: Value cannot fit into int256. (BEX#421)"},BAL422:{reasons:["BAL#422"],errorMSG:"AccessControl: Grant sender is not an admin. (BEX#422)"},BAL423:{reasons:["BAL#423"],errorMSG:"AccessControl: Revoke sender is not an admin. (BEX#423)"},BAL424:{reasons:["BAL#424"],errorMSG:"AccessControl: Renounce sender not allowed for accounts other than self. (BEX#424)"},BAL425:{reasons:["BAL#425"],errorMSG:"Buffer period has expired. (BEX#425)"},BAL426:{reasons:["BAL#426"],errorMSG:"Caller is not the owner. (BEX#426)"},BAL427:{reasons:["BAL#427"],errorMSG:"New owner cannot be zero address. (BEX#427)"},BAL428:{reasons:["BAL#428"],errorMSG:"Code deployment failed. (BEX#428)"},BAL429:{reasons:["BAL#429"],errorMSG:"Call to non-contract address. (BEX#429)"},BAL430:{reasons:["BAL#430"],errorMSG:"Low-level call failed. (BEX#430)"},BAL431:{reasons:["BAL#431"],errorMSG:"The contract is not paused. (BEX#431)"},BAL432:{reasons:["BAL#432"],errorMSG:"Address is already allowlisted. (BEX#432)"},BAL433:{reasons:["BAL#433"],errorMSG:"Address is not allowlisted. (BEX#433)"},BAL434:{reasons:["BAL#434"],errorMSG:"ERC20: Burn exceeds balance. (BEX#434)"},BAL435:{reasons:["BAL#435"],errorMSG:"Invalid operation. (BEX#435)"},BAL436:{reasons:["BAL#436"],errorMSG:"Codec overflow detected. (BEX#436)"},BAL437:{reasons:["BAL#437"],errorMSG:"The system is in recovery mode. (BEX#437)"},BAL438:{reasons:["BAL#438"],errorMSG:"The system is not in recovery mode. (BEX#438)"},BAL439:{reasons:["BAL#439"],errorMSG:"Induced failure. (BEX#439)"},BAL440:{reasons:["BAL#440"],errorMSG:"Expired signature. (BEX#440)"},BAL441:{reasons:["BAL#441"],errorMSG:"Malformed signature. (BEX#441)"},BAL442:{reasons:["BAL#442"],errorMSG:"SafeCast: Value cannot fit into uint64. (BEX#442)"},BAL443:{reasons:["BAL#443"],errorMSG:"Unhandled fee type. (BEX#443)"},BAL444:{reasons:["BAL#444"],errorMSG:"ERC20: Burn from zero address. (BEX#444)"},BAL500:{reasons:["BAL#500"],errorMSG:"Invalid pool ID. (BEX#500)"},BAL501:{reasons:["BAL#501"],errorMSG:"Caller is not the pool. (BEX#501)"},BAL502:{reasons:["BAL#502"],errorMSG:"Sender is not the asset manager. (BEX#502)"},BAL503:{reasons:["BAL#503"],errorMSG:"User does not allow the relayer. (BEX#503)"},BAL504:{reasons:["BAL#504"],errorMSG:"Invalid signature. (BEX#504)"},BAL505:{reasons:["BAL#505"],errorMSG:"Exit would yield fewer than the minimum tokens out. (BEX#505)"},BAL506:{reasons:["BAL#506"],errorMSG:"Join would cost more than the maximum tokens in. (BEX#506)"},BAL507:{reasons:["BAL#507"],errorMSG:"Swap violates user-supplied limits. (BEX#507)"},BAL508:{reasons:["BAL#508"],errorMSG:"Swap transaction not mined within the deadline. (BEX#508)"},BAL509:{reasons:["BAL#509"],errorMSG:"Cannot swap the same token. (BEX#509)"},BAL510:{reasons:["BAL#510"],errorMSG:"Unknown amount in the first swap of a batch. (BEX#510)"},BAL511:{reasons:["BAL#511"],errorMSG:"Malconstructed multihop swap. (BEX#511)"},BAL512:{reasons:["BAL#512"],errorMSG:"Internal balance overflow. (BEX#512)"},BAL513:{reasons:["BAL#513"],errorMSG:"Insufficient internal balance. (BEX#513)"},BAL514:{reasons:["BAL#514"],errorMSG:"Invalid BERA internal balance. (BEX#514)"},BAL515:{reasons:["BAL#515"],errorMSG:"Flashloan must repay the loan in the same transaction. (BEX#515)"},BAL516:{reasons:["BAL#516"],errorMSG:"Insufficient BERA balance. (BEX#516)"},BAL517:{reasons:["BAL#517"],errorMSG:"Unallocated BERA. (BEX#517)"},BAL518:{reasons:["BAL#518"],errorMSG:"Relayers cannot receive BERA directly (only through the Vault). (BEX#518)"},BAL519:{reasons:["BAL#519"],errorMSG:"Cannot use BERA sentinel for internal balance. (BEX#519)"},BAL520:{reasons:["BAL#520"],errorMSG:"Tokens mismatch. (BEX#520)"},BAL521:{reasons:["BAL#521"],errorMSG:"Token is not registered. (BEX#521)"},BAL522:{reasons:["BAL#522"],errorMSG:"Token is already registered. (BEX#522)"},BAL523:{reasons:["BAL#523"],errorMSG:"Tokens are already set. (BEX#523)"},BAL524:{reasons:["BAL#524"],errorMSG:"Tokens length must be 2. (BEX#524)"},BAL525:{reasons:["BAL#525"],errorMSG:"Nonzero token balance detected. (BEX#525)"},BAL526:{reasons:["BAL#526"],errorMSG:"Balance total overflow detected. (BEX#526)"},BAL527:{reasons:["BAL#527"],errorMSG:"Pool has no tokens. (BEX#527)"},BAL528:{reasons:["BAL#528"],errorMSG:"Insufficient flash loan balance. (BEX#528)"},BAL600:{reasons:["BAL#600"],errorMSG:"Swap fee percentage is too high. (BEX#600)"},BAL601:{reasons:["BAL#601"],errorMSG:"Flash loan fee percentage is too high. (BEX#601)"},BAL602:{reasons:["BAL#602"],errorMSG:"Insufficient flash loan fee amount. (BEX#602)"},BAL700:{reasons:["BAL#700"],errorMSG:"Splitter fee percentage is too high. (BEX#700)"},BAL998:{reasons:["BAL#998"],errorMSG:"Unimplemented functionality. (BEX#998)"},BAL999:{reasons:["BAL#999"],errorMSG:"An unexpected error occurred. (BEX#999)"},NO_SWAP_PATHS:{keywords:["No swap paths returned"],errorMSG:"No swap paths were found."}},AGGREGATOR:{NOT_ENOUGH_LIQUIDITY:{keywords:["Not enough liquidity"],errorMSG:"Not enough liquidity. Try a lower amount."}},POL:{REWARD_VAULT_FACTORY:{reasons:["VaultAlreadyExists"],errorMSG:"Failed to create action. An action already exists with this staking token."},NOT_REWARD_VAULT_MANAGER:{reasons:["NotRewardVaultManager"],errorMSG:"You are not the manager of this action."},NOT_INCENTIVE_MANAGER:{reasons:["NotIncentiveManager"],errorMSG:"You are not the incentive manager of this token."},DURATION_CHANGE_NOT_ALLOWED:{reasons:["DurationChangeNotAllowed"],errorMSG:"You cannot change the duration of this action."},INVALID_PROOF:{reasons:["InvalidProof"],errorMSG:"Tokens already claimed or invalid proof."},CONTRACT_PAUSED:{reasons:["EnforcedPause"],errorMSG:"The contract you're interacting with is temporarily paused."},DISTRIBUTION_PAUSED:{reasons:["DistributionEnforcedPause"],errorMSG:"Distribution is temporarily paused."},INVALID_VALIDATOR_COMMISSION:{reasons:["InvalidCommissionValue"],errorMSG:"Invalid commission percentage."},NOT_REWARD_ALLOCATOR:{reasons:["NotRewardAllocator"],errorMSG:"You are not the reward allocator of this validator."},NOT_OPERATOR:{reasons:["NotOperator"],errorMSG:"You are not the operator of this validator."},INVALID_REWARD_ALLOCATION:{reasons:["InvalidRewardAllocationWeights"],errorMSG:"Invalid reward allocation weights."},NOT_REWARD_DURATION_MANAGER:{reasons:["NotRewardDurationManager"],errorMSG:"You are not the reward duration manager of this validator."}},BEND:{INSUFFICIENT_POSITION:{keywords:["insufficient position"],errorMSG:"Insufficient position"},INSUFFICIENT_LIQUIDITY:{keywords:["insufficient liquidity on market"],errorMSG:"Insufficient liquidity on market."},ALL_CAPS_REACHED:{reasons:["AllCapsReached"],errorMSG:"All caps reached on vault."},AboveMaxTimelock:{reasons:["AboveMaxTimelock"],errorMSG:"Above max timelock"},AddressEmptyCode:{reasons:["AddressEmptyCode"],errorMSG:"Address empty code"},AddressInsufficientBalance:{reasons:["AddressInsufficientBalance"],errorMSG:"Address insufficient balance"},AllCapsReached:{reasons:["AllCapsReached"],errorMSG:"All caps reached"},AlreadyPending:{reasons:["AlreadyPending"],errorMSG:"Already pending"},AlreadySet:{reasons:["AlreadySet"],errorMSG:"Already set"},BelowMinTimelock:{reasons:["BelowMinTimelock"],errorMSG:"Below min timelock"},DuplicateMarket:{reasons:["DuplicateMarket"],errorMSG:"Duplicate market"},ECDSAInvalidSignature:{reasons:["ECDSAInvalidSignature"],errorMSG:"Invalid ECDSA signature"},ECDSAInvalidSignatureLength:{reasons:["ECDSAInvalidSignatureLength"],errorMSG:"Invalid ECDSA signature length"},ECDSAInvalidSignatureS:{reasons:["ECDSAInvalidSignatureS"],errorMSG:"Invalid ECDSA signature S value"},ERC20InsufficientBalance:{reasons:["ERC20InsufficientBalance"],errorMSG:"ERC20 insufficient balance"},ERC20InvalidApprover:{reasons:["ERC20InvalidApprover"],errorMSG:"ERC20 invalid approver"},ERC20InvalidReceiver:{reasons:["ERC20InvalidReceiver"],errorMSG:"ERC20 invalid receiver"},ERC20InvalidSender:{reasons:["ERC20InvalidSender"],errorMSG:"ERC20 invalid sender"},ERC20InvalidSpender:{reasons:["ERC20InvalidSpender"],errorMSG:"ERC20 invalid spender"},ERC2612ExpiredSignature:{reasons:["ERC2612ExpiredSignature"],errorMSG:"ERC2612 expired signature"},ERC2612InvalidSigner:{reasons:["ERC2612InvalidSigner"],errorMSG:"ERC2612 invalid signer"},ERC4626ExceededMaxDeposit:{reasons:["ERC4626ExceededMaxDeposit"],errorMSG:"ERC4626 exceeded max deposit"},ERC4626ExceededMaxMint:{reasons:["ERC4626ExceededMaxMint"],errorMSG:"ERC4626 exceeded max mint"},ERC4626ExceededMaxRedeem:{reasons:["ERC4626ExceededMaxRedeem"],errorMSG:"ERC4626 exceeded max redeem"},ERC4626ExceededMaxWithdraw:{reasons:["ERC4626ExceededMaxWithdraw"],errorMSG:"ERC4626 exceeded max withdraw"},FailedInnerCall:{reasons:["FailedInnerCall"],errorMSG:"Failed inner call"},InconsistentAsset:{reasons:["InconsistentAsset"],errorMSG:"Inconsistent asset"},InconsistentReallocation:{reasons:["InconsistentReallocation"],errorMSG:"Inconsistent reallocation"},InvalidAccountNonce:{reasons:["InvalidAccountNonce"],errorMSG:"Invalid account nonce"},InvalidMarketRemovalNonZeroCap:{reasons:["InvalidMarketRemovalNonZeroCap"],errorMSG:"Invalid market removal (non-zero cap)"},InvalidMarketRemovalNonZeroSupply:{reasons:["InvalidMarketRemovalNonZeroSupply"],errorMSG:"Invalid market removal (non-zero supply)"},InvalidMarketRemovalTimelockNotElapsed:{reasons:["InvalidMarketRemovalTimelockNotElapsed"],errorMSG:"Invalid market removal (timelock not elapsed)"},InvalidShortString:{reasons:["InvalidShortString"],errorMSG:"Invalid short string"},MarketNotCreated:{reasons:["MarketNotCreated"],errorMSG:"Market not created"},MarketNotEnabled:{reasons:["MarketNotEnabled"],errorMSG:"Market not enabled"},MathOverflowedMulDiv:{reasons:["MathOverflowedMulDiv"],errorMSG:"Math overflow"},MaxFeeExceeded:{reasons:["MaxFeeExceeded"],errorMSG:"Max fee exceeded"},MaxQueueLengthExceeded:{reasons:["MaxQueueLengthExceeded"],errorMSG:"Max queue length exceeded"},NoPendingValue:{reasons:["NoPendingValue"],errorMSG:"No pending value"},NonZeroCap:{reasons:["NonZeroCap"],errorMSG:"Non-zero cap"},NotAllocatorRole:{reasons:["NotAllocatorRole"],errorMSG:"Not allocator role"},NotCuratorNorGuardianRole:{reasons:["NotCuratorNorGuardianRole"],errorMSG:"Not curator or guardian role"},NotCuratorRole:{reasons:["NotCuratorRole"],errorMSG:"Not curator role"},NotEnoughLiquidity:{reasons:["NotEnoughLiquidity"],errorMSG:"Not enough liquidity"},NotGuardianRole:{reasons:["NotGuardianRole"],errorMSG:"Not guardian role"},OwnableInvalidOwner:{reasons:["OwnableInvalidOwner"],errorMSG:"Invalid owner"},OwnableUnauthorizedAccount:{reasons:["OwnableUnauthorizedAccount"],errorMSG:"Unauthorized account"},PendingCap:{reasons:["PendingCap"],errorMSG:"Pending cap"},PendingRemoval:{reasons:["PendingRemoval"],errorMSG:"Pending removal"},SafeCastOverflowedUintDowncast:{reasons:["SafeCastOverflowedUintDowncast"],errorMSG:"SafeCast overflow"},SafeERC20FailedOperation:{reasons:["SafeERC20FailedOperation"],errorMSG:"SafeERC20 failed operation"},StringTooLong:{reasons:["StringTooLong"],errorMSG:"String too long"},SupplyCapExceeded:{reasons:["SupplyCapExceeded"],errorMSG:"Supply cap exceeded"},TimelockNotElapsed:{reasons:["TimelockNotElapsed"],errorMSG:"Timelock not elapsed"},UnauthorizedMarket:{reasons:["UnauthorizedMarket"],errorMSG:"Unauthorized market"},ZeroAddress:{reasons:["ZeroAddress"],errorMSG:"Zero address"},ZeroFeeRecipient:{reasons:["ZeroFeeRecipient"],errorMSG:"Zero fee recipient"}}};function A({reason:r,message:o}){for(let n in p){let a=p[n];for(let u in a){let s=a[u];if(r&&_optionalChain([s, 'optionalAccess', _ => _.reasons, 'optionalAccess', _2 => _2.some, 'call', _3 => _3(i=>i===r)])||_optionalChain([s, 'optionalAccess', _4 => _4.keywords, 'optionalAccess', _5 => _5.some, 'call', _6 => _6(i=>_optionalChain([o, 'optionalAccess', _7 => _7.includes, 'call', _8 => _8(i.toLowerCase().trim())]))]))return s.errorMSG}}return d}var _viem = require('viem');var _internal = require('@berachain/config/internal');var E=[{inputs:[],name:"AlreadyInitiated",type:"error"},{inputs:[],name:"EmptyBundle",type:"error"},{inputs:[],name:"IncorrectReenterHash",type:"error"},{inputs:[],name:"MissingExpectedReenter",type:"error"}];var L=[{inputs:[],name:"AllowanceOverflow",type:"error"},{inputs:[],name:"AllowanceUnderflow",type:"error"},{inputs:[],name:"ETHTransferFailed",type:"error"},{inputs:[],name:"InsufficientAllowance",type:"error"},{inputs:[],name:"InsufficientBalance",type:"error"},{inputs:[],name:"InvalidPermit",type:"error"},{inputs:[],name:"Permit2AllowanceIsFixedAtInfinity",type:"error"},{inputs:[],name:"PermitExpired",type:"error"},{inputs:[],name:"TotalSupplyOverflow",type:"error"},{name:"AllowanceOverflow",type:"error",inputs:[]},{name:"AllowanceUnderflow",type:"error",inputs:[]},{name:"InsufficientAllowance",type:"error",inputs:[]},{name:"InsufficientBalance",type:"error",inputs:[]},{name:"InvalidPermit",type:"error",inputs:[]},{name:"Permit2AllowanceIsFixedAtInfinity",type:"error",inputs:[]},{name:"PermitExpired",type:"error",inputs:[]},{name:"TotalSupplyOverflow",type:"error",inputs:[]},{name:"ECDSAInvalidSignature",type:"error",inputs:[]},{name:"ECDSAInvalidSignatureLength",type:"error",inputs:[{type:"uint256"}]},{name:"ECDSAInvalidSignatureS",type:"error",inputs:[{type:"bytes32"}]},{name:"ERC20InsufficientAllowance",type:"error",inputs:[{type:"address"},{type:"uint256"},{type:"uint256"}]},{name:"ERC20InsufficientBalance",type:"error",inputs:[{type:"address"},{type:"uint256"},{type:"uint256"}]},{name:"ERC20InvalidApprover",type:"error",inputs:[{type:"address"}]},{name:"ERC20InvalidReceiver",type:"error",inputs:[{type:"address"}]},{name:"ERC20InvalidSender",type:"error",inputs:[{type:"address"}]},{name:"ERC20InvalidSpender",type:"error",inputs:[{type:"address"}]},{name:"ERC2612ExpiredSignature",type:"error",inputs:[{type:"uint256"}]},{name:"ERC2612InvalidSigner",type:"error",inputs:[{type:"address"},{type:"address"}]},{name:"InvalidAccountNonce",type:"error",inputs:[{type:"address"},{type:"uint256"}]},{name:"InvalidShortString",type:"error",inputs:[]},{name:"StringTooLong",type:"error",inputs:[{type:"string"}]}];var S=[{name:"StalePrice",type:"error",inputs:[]},{name:"InsufficientAmountOut",type:"error",inputs:[]},{name:"ERC721NonexistentToken",type:"error",inputs:[{type:"uint256"}]},{name:"ERC20InsufficientAllowance",type:"error",inputs:[{type:"address"},{type:"uint256"},{type:"uint256"}]},{name:"AllowanceExpired",type:"error",inputs:[{type:"uint256"}]},{name:"ERC4626ExceededMaxWithdraw",type:"error",inputs:[{type:"address"},{type:"uint256"},{type:"uint256"}]},{name:"SlippageExceeded",type:"error",inputs:[]},{name:"NotPegged",type:"error",inputs:[{type:"address"}]},{name:"TransferFromFailed",type:"error",inputs:[]},{name:"RedeemMoreThanMax",type:"error",inputs:[]},{name:"ExecutionFailed",type:"error",inputs:[{type:"uint256"},{type:"address"},{type:"string"}]},{name:"SlippageExceeded",type:"error",inputs:[{type:"uint256"},{type:"uint256"}]},{name:"SignatureExpired",type:"error",inputs:[{type:"uint256"}]},{name:"zeroAmountRequired",type:"error",inputs:[]},{name:"ExpiredTransaction",type:"error",inputs:[]},{name:"FailedToCallFunction",type:"error",inputs:[{type:"bytes"}]}];var m=[...L,...E,...S];function M(r){return r instanceof _viem.BaseError||r instanceof Error&&"shortMessage"in r&&"message"in r&&"details"in r}function t(r,o,n){return r instanceof n||r.name===o}function N(r){return r.errorName==="Error"&&Array.isArray(r.args)&&_optionalChain([r, 'access', _9 => _9.args, 'optionalAccess', _10 => _10.at, 'call', _11 => _11(0)])?_optionalChain([r, 'access', _12 => _12.args, 'optionalAccess', _13 => _13.at, 'call', _14 => _14(0)]):r.errorName}function f({error:r,abi:o,revertIfUnknown:n=!0}){if(!M(r)){if(n)throw r;return r instanceof _viem.BaseError?{reason:r.shortMessage,rootCause:r}:{reason:r.message,rootCause:r}}let e=r;for(;M(e);){if(t(e,"ContractFunctionExecutionError",_viem.ContractFunctionExecutionError)){e=e.cause;continue}if(t(e,"TransactionExecutionError",_viem.TransactionExecutionError)&&e.cause instanceof _viem.AtomicReadyWalletRejectedUpgradeError)return{reason:"AtomicReadyWalletRejectedUpgradeError",rootCause:e.cause};if(t(e,"RpcRequestError",_viem.RpcRequestError)){if(!e.data){if(typeof e.cause=="object"&&e.cause&&"message"in e.cause&&typeof e.cause.message=="string")return{reason:e.cause.message,rootCause:e.cause};throw new Error("No data",{cause:e})}let a=_viem.decodeErrorResult.call(void 0, {data:e.data,abi:[...m,..._nullishCoalesce(o, () => ([]))]});return{reason:_nullishCoalesce(N(a), () => (e.shortMessage)),rootCause:e}}if(t(e,"ContractFunctionRevertedError",_viem.ContractFunctionRevertedError))return{reason:_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(e.reason, () => (e.signature)), () => (_optionalChain([e, 'access', _15 => _15.data, 'optionalAccess', _16 => _16.errorName]))), () => (e.shortMessage)),rootCause:e};if(t(e,"UserRejectedRequestError",_viem.UserRejectedRequestError))return{reason:"UserRejectedRequestError",rootCause:e};if(t(e,"HttpRequestError",_viem.HttpRequestError))return{reason:`HttpRequestError(status:${e.status})`,rootCause:e,isRequestError:!0};if(!e.cause)return{reason:e.name,rootCause:e};e=e.cause}if(!n)return{reason:void 0,rootCause:e};throw new Error("UnknownErrorInGetRevertReason",{cause:e})}function h(r){switch(r){case"UserRejectedRequestError":case 4001:return"UserRejectedRequestError";default:return`RPC_ERROR_${r}`}}var B= (_class =class r extends Error{__init() {this.reason=null}__init2() {this._tags={}}set tags(o){this._tags=o}get tags(){return{...this._tags,"error.displayMessage":this.displayMessage,"error.reason":this.reason,"error.level":this.level}}__init3() {this.extra={}}constructor({message:o,displayMessage:n,cause:e,reason:a,level:u,abi:s,tags:i,chainId:G}){let l=o;if(l||(e instanceof _viem.BaseError?l=e.shortMessage:(e instanceof Error||typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string")&&(l=e.message)),super(l,{cause:e});_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);,this.name="BeraError",this.cause=e,this.chainId=G,a)this.reason=a;else if(e instanceof Error)try{let R=f({error:e,revertIfUnknown:!0,abi:s});this.reason=_nullishCoalesce(_optionalChain([R, 'optionalAccess', _17 => _17.reason]), () => (null))}catch (e2){}u?this.level=u:this.reason===h("UserRejectedRequestError")?this.level="info":this.level="error";let c=n;this.cause instanceof r&&this.cause.displayMessage!==d&&(c=this.cause.displayMessage),c||(c=A(this)),this.displayMessage=_nullishCoalesce(c, () => (d)),this.tags={...this.tags,...i},!_internal.appConfig.env.isProduction&&process.env.NODE_ENV!=="test"&&(console.group("BeraError thrown"),console.debug("Level",this.level),console.debug("Reason",this.reason),console.debug("Message",this.message),console.debug("Display Message",this.displayMessage),console.debug("Cause",this.cause),console.groupEnd())}}, _class);var y=class extends B{constructor(o){super(o),this.level=_nullishCoalesce(o.level, () => ("warning")),this.name="InvalidArgumentError",this.property=o.property,this.value=o.value,this.expected=o.expected,this.message=`Invalid argument: ${this.property} ${this.isMissing?"is missing":`is invalid, expected ${this.expected}`}`,o.reason||(this.reason=`${this.name}.${this.property}.${this.isInvalid?"invalid":"missing"}`)}get isMissing(){return this.value===void 0}get isInvalid(){return this.value!==void 0}};exports.a = p; exports.b = A; exports.c = m; exports.d = N; exports.e = f; exports.f = B; exports.g = y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;var _chunkMDA4YT6Jcjs = require('./chunk-MDA4YT6J.cjs');var _chunk33CW5NUNcjs = require('./chunk-33CW5NUN.cjs');var _viem = require('viem');function c(t){return t!=null}function b({value:t,property:e,fn:r}){let n=r(t);if(!n.isValid)throw new (0, _chunk33CW5NUNcjs.g)({property:e,value:t,expected:n.expectedType})}function i({value:t,property:e,fn:r}){b({value:t,property:e,fn:n=>{let l=c(n),{isValid:m,expectedType:h}=r(n);return{expectedType:h,isValid:l&&m}}})}function g(t,e){i({value:t,property:e,fn:r=>({expectedType:"defined",isValid:c(r)})})}function A(t,e="publicClient"){g(t,e)}function N(t,e){i({value:t,property:e,fn:r=>({expectedType:"Address",isValid:typeof r=="string"&&_viem.isAddress.call(void 0, r)})})}function E(t,e){i({value:t,property:e,fn:r=>({expectedType:"number",isValid:(typeof r=="string"||typeof r=="number")&&Number(r)>0})})}function I({cause:t}){if(t instanceof _viem.BaseError){let r=_chunk33CW5NUNcjs.e.call(void 0, {error:t,revertIfUnknown:!1});if(r.isRequestError&&r.rootCause instanceof _viem.BaseError&&"url"in r.rootCause&&typeof r.rootCause.url=="string")return new (0, _chunkMDA4YT6Jcjs.a)({cause:r.rootCause,response:void 0,endpoint:{url:r.rootCause.url,type:"rpc"}})}return t instanceof _chunk33CW5NUNcjs.f?t:new (0, _chunk33CW5NUNcjs.f)({cause:t})}var f=class extends _chunk33CW5NUNcjs.f{constructor(e){super(e),this.name="NotFoundError",this.level=_nullishCoalesce(e.level, () => ("info")),this.message=`Resource ${e.resource} with id ${e.id} not found`,this.resource=e.resource,this.id=e.id}};var d= (_class =class extends _chunk33CW5NUNcjs.f{__init() {this.blockNumber=null}constructor(e){super(e);_class.prototype.__init.call(this);,this.name="TransactionFailedError",this.txHash=e.txHash||null,this.receipt=e.receipt||null,this.to=e.to,this.functionName=e.functionName,this.blockNumber=_nullishCoalesce(e.blockNumber, () => (null)),this.input=e.input,this.receipt?this.message=`Transaction reverted on chain for reason: ${this.reason}`:this.txHash?this.message=`Transaction reverted after being broadcasted for reason: ${this.reason}`:this.message=`${this.reason}: ${this.message}`,this.tags={...this.tags,"operation.txn.status":e.txHash?"execution":"simulation",...e.tags},this.to&&(this.tags["operation.txn.to"]=this.to),this.functionName&&(this.tags["operation.txn.functionName"]=this.functionName)}}, _class);exports.a = I; exports.b = g; exports.c = A; exports.d = N; exports.e = E; exports.f = f; exports.g = d;
|