Skip to main content

Errors

Something failed? Find its code on this page. The SDK throws a LaunchSdkError with a stable code, in four kinds: config, refused, execution and api. Each kind has a table below, with what causes the code and what to do.

Words these pages use defines the terms in the tables, such as launchpad, quote token, first buy and fee recipient.

Read an error​

MemberWhat it holds
codeA stable code, one of LAUNCH_SDK_ERROR_CODES. Branch on it
kind"config", "refused", "execution" or "api"
messageA fixed sentence per code. Never branch on it
detailThe SDK's own sentence naming the field or bound that failed, when it can. Safe to show
chainThe chain the error is about, when there is one
transactionHashThe mined transaction the error is about, when there is one
causeThe upstream error: a viem contract revert, an RPC error or a BankrApiResponseError
toJSON()The error without cause or stack. Safe to log or return over HTTP
import {
BankrApiResponseError,
isLaunchSdkError,
launchRevertName,
type LaunchClient,
type LaunchInput,
} from "@bankr/launch-sdk";

export async function launchAndReport(
client: LaunchClient<"base">,
input: LaunchInput<"base">,
) {
try {
return await client.launch(input);
} catch (err) {
if (isLaunchSdkError(err, "FEE_OUT_OF_BOUNDS")) {
console.log(err.detail); // "The trading fee must be between 1% and 2% on this launchpad."
} else if (isLaunchSdkError(err, "SIMULATION_REVERTED")) {
console.log(launchRevertName(err.cause)); // e.g. "DevBuyTooLittle"
} else if (
isLaunchSdkError(err, "API_ERROR") &&
err.cause instanceof BankrApiResponseError
) {
console.log(err.cause.status, err.cause.code); // e.g. 409 "NOT_CONFIRMED"
} else if (isLaunchSdkError(err)) {
console.log(err.code, err.kind, err.transactionHash);
}
throw err;
}
}
  • isLaunchSdkError(err, code?) is true for any SDK error, or only for one with that code. It also recognises an error from a second installed copy of the SDK.
  • launchRevertName(err.cause) returns the name of the contract error behind an SDK error, such as "StartTickOutOfBounds", or null when the cause is not a contract revert.
  • Each kind has a class: LaunchConfigError, LaunchRefusedError, LaunchExecutionError and LaunchApiError. launchSdkError(code, options?) builds the right one.
  • An RPC failure or a rejected signature is not a LaunchSdkError. It reaches you as viem's own error.
  • A setup call made the wrong way throws a plain TypeError or RangeError: createAuthorizeHandler without authorize, or mineVanitySalt with a maxTries under 1.

Client setup (config)​

CodeCauseWhat to do
PROVIDER_NOT_DEPLOYEDAn addresses override that is incomplete or names another chain id, a provider other than bankr_v4, or a launch on addresses the SDK does not ship without fork: trueLeave addresses out on a live chain. On a local fork of your own deployment, pass its whole record as addresses and set fork: true
UNSUPPORTED_CHAINA chain outside LAUNCH_CHAINS, a publicClient or walletClient on another chain, or a plan made for another chainCreate the client and its viem clients for the same chain
RPC_REQUIREDA chain with no public RPC, such as Arc, with no rpcUrl and no publicClientPass an rpcUrl or a publicClient
WALLET_REQUIREDlaunch() on a client with no walletClientPass a walletClient, or use plan() and buildLaunchTx() and send the launch yourself
API_KEY_IN_BROWSERpadAuthorizer or createAuthorizeHandler running in a browserKeep keys on your server. Use remoteAuthorizer in the browser
INDEX_NOT_ON_FORKclient.fees.getOwed or client.fees.buildClaimAll on a client created with fork: true. Both read Bankr's API, which indexes live chains onlyOn a fork, read and claim one launch at a time with client.fees.get and client.fees.buildClaim

Refused before signing (refused)​

The SDK refuses these before anything is signed. Where a row says so, err.detail names the field or the bound.

CodeCauseWhat to do
PAUSEDNew launches are paused at the chain's factoryWait. client.status() reports paused: false when they resume
LAUNCHPAD_GATEDThe chain takes launches on Bankr's own launchpad only, and the launch names another launchpadLaunch on a chain where client.status() reports gated: false
UNKNOWN_LAUNCHPADNo launchpad with this id is registered on the chainCheck the id and the chain. launchpadIdFromReceipt reads a new launchpad's id
LAUNCHPAD_PAUSEDThe launchpad's operator paused its new launchesWait, or use another launchpad. The operator resumes with launchpads.setPaused(id, false)
AUTHORIZATION_REQUIREDThe launch is on launchpad 0, Bankr's own, which is where a launch goes when you leave launchpadId out. Or the launchpad has a signer and the client has no authorizerSet launchpadId to the launchpad you launch on. For a launchpad with a signer, pass its authorizer
PRICE_ATTESTATION_REQUIREDThe quote token's price needs a signature from Bankr, which a launch from the SDK does not carryUse a quote token priced by a feed. settings.quotes() lists each token's pricing
QUOTE_NOT_ALLOWEDquote is neither a named quote token nor an address, the launchpad does not accept it, Bankr lists it and cannot price it, or the launchpad's unlistedQuotes switch is off and Bankr does not list itRead err.detail when it is set. settings.padQuote(id, quote) says whether a launch may pair with a token
CURVE_NOT_ALLOWEDThe launchpad does not allow the launch's curve: a built-in its operator switched off, or your own bands it neither lists nor leaves openUse a curve the launchpad allows. Its operator opens one with launchpads.setCurveAllowed
EXTENSION_NOT_ALLOWEDThe launch's extension cannot launch here: the extension allowlist does not hold its key, the launchpad's switches do not allow its kind, the launchpad has switched that built-in extension off, or its declared maximum is above the launchpad's extMaxPips. err.detail says whichUse an extension the launchpad allows, or have its operator allow the kind with launchpads.setSwitches. client.previewExtension reads the answers first
EXTENSION_OUT_OF_BOUNDSA parameter of the launch's extension is outside its bound: the extension's own, or the launchpad's limit for it. err.detail names the boundUse a value inside the bound. settings.pad(id).presets holds the launchpad's limits
DEV_BUY_UNAVAILABLEThe factory refuses the first buy (devBuy) in simulation: ETH sent on a quote token other than WETH, an ETH and an ERC-20 amount together, or a launch with a scheduled start whose launcher is on the token's wallet-cap exclusion listDrop the first buy, or change the quote token or the launcher
INVALID_PARAMSAn input the SDK refuses. A launch field of the wrong shape or length. An address that is malformed, zero, or mixed-case with a wrong EIP-55 checksum. A used salt, or one whose token misses the launchpad's suffix. A startTime in the past or too far ahead. Your own bands that break a pool rule. A plan another client made. A gas limit a claim cannot fit inRead err.detail. Check the input against Configuration
INVALID_PERCENTA unit helper got a value that is negative, not a number, above 100%, or more precise than its unit: 4 decimal places for pips, 2 for bpsRead err.detail. Pass percentages as strings, such as "1.75"
FEE_OUT_OF_BOUNDSA fee schedule outside the launchpad's range. Or a buyback or auto-LP share on a coin whose buy fee plus sell fee is too low to carry itRead err.detail. Read the launchpad's range from settings.pad(id).atLaunch.knobs
SPLIT_OUT_OF_BOUNDSHolder, auto-LP and buyback shares above 100% of the creator side together, or one of them, or the referrer's rate, outside the launchpad's rangeRead err.detail. Read the launchpad's range from settings.pad(id).atLaunch.knobs
VESTING_OUT_OF_BOUNDSA vesting share or schedule outside the launchpad's range, a vest to holders the launchpad does not allow, or everything vested above the launchpad's ceilingRead err.detail. See Vesting and allocations
OUTSIDE_LAUNCHPAD_RANGEA launch term is outside the launchpad's range. err.detail names the term and the range in force, such as "The wallet cap's length is fixed at 1 day on this launchpad."Use a value inside the range. The launchpad's operator widens it with launchpads.setKnobs
NOT_ALLOWED_BY_LAUNCHPADThe launch uses a feature the launchpad has switched off: a first buy, allocations, wallet-cap exemptions, a metadata admin, a quote token Bankr does not list, an extension kind, or its own auto-LP amounts. err.detail names itDrop the option. The launchpad's operator switches the feature on with launchpads.setSwitches
HARD_BOUNDOne of the launch's numbers is outside what a pool can run on: one of the few bounds no setting moves. err.detail says which where the SDK canRead err.detail. See What stays fixed for everyone
OPTION_FOR_FEATURE_OFFThe launch names an option for a feature it leaves off: a buyback interval with no buyback share, an auto-LP band with no auto-LP, a fee ceiling with no extension, wallet-cap exemptions with no capDrop the option, or turn the feature on for this launch
CLAIM_OPERATOR_REQUIREDOn a coin that can be taken over, a fee recipient is a contract with restricted claims and the launch names no claimOperatorPass claimOperator: the claim operator that contract named on the fee ledger
LAUNCH_REFUSEDThe contracts' launch check refuses the launch for a reason with no code of its own. err.detail gives the reasonRead err.detail
CREATOR_CAP_EXCEEDEDThe first buy would take more of the supply than the launchpad's devBuyMaxBps or the coin's wallet cap allows, or the launch vests its whole supplyLower devBuy.amount or the vested share. The launchpad's operator raises the ceiling with launchpads.setKnobs
LAUNCHER_IS_FORWARDERThe launcher is Multicall3, Multicall2 or Multicall. Anyone can call through them, so anyone could take the launch's first buy and feesLaunch from an account you control
LAUNCHER_MISMATCHlaunch(): the wallet's account is not the input's launcherSend from the launcher, or set launcher to the wallet's account
FEE_RECIPIENT_CANNOT_CLAIMA fee recipient that could never claim: a Bankr launch contract, the launch's own token, escrow or distributor, its quote token, or a reserved address. Or a contract that is not a Safe or an EIP-7702 wallet, or one that has not restricted its claims on the fee ledgerUse a wallet address. For a contract, see allowContractFeeRecipient and allowOpenCodeFeeRecipients in Configuration
NOT_A_LAUNCHThe token is not a launch of this chain's factoryCheck the token's address and the chain
NOT_A_BENEFICIARYclient.fees.buildClaim or buildSetFeeRecipient for an account that holds no share of the launch's feesPass a fee recipient or a launchpad payee. client.launchInfo(token) lists them
CLAIM_NOT_ALLOWEDclient.fees.buildClaimAll with a sender: the account restricts who may claim for it and the sender is not one of its claim operators, or the account is a Bankr contract that collects its own shareSend the claim from the account itself, or have it name the sender with client.fees.buildSetClaimOperator
NO_VESTINGclient.vesting.buildRelease for an account with no schedule on the launch, or buildReleaseToHolders on a launch with no holders' vestRead the launch's schedules with client.vesting.get(token)
NOT_METADATA_ADMINA client.metadataAdmin builder for an account the token would refuse: the token has no metadata admin, another account holds the role, or the role was not offered to this accountRead err.detail. client.metadataAdmin.get(token) shows admin and pendingAdmin
INVALID_LAUNCHPAD_CONFIGA launchpads builder breaks a rule: a value outside the contracts' limits, a range whose three numbers do not fit together, too many payees, a switch that is not allowed, an address suffix, a link, or an operatorRead err.detail, which names the rule. See Set up a launchpad
INVALID_SETTINGSA builder of client.contracts().owner breaks a rule of the contracts. Only the contracts' owner sends thoseRead err.detail

Simulation and chain (execution)​

CodeCauseWhat to do
SIMULATION_REVERTEDThe launch reverts in simulation with a contract error that has no code of its own. Or its gas estimate is above the chain's per-transaction ceiling, and err.cause holds gasEstimate and maxTxGasName the revert with launchRevertName(err.cause), fix it, then plan again
POOL_ALREADY_INITIALIZEDThe predicted token address already holds a contractPlan again with a fresh salt. launch() does it when you passed no salt
START_TICK_CHANGEDThe quote's price moved the start tick out of the factory's bounds after planning, or no start tick fits the bounds right nowPlan again. launch() does it
PREDICTION_MISMATCHThe SDK's predicted token address is not the factory's, or the token's address breaks a launchpad's suffix ruleDo not send the launch. Upgrade the SDK, and tell Bankr if it persists
VANITY_UNAVAILABLEThe launchpad requires an address suffix, and plan()'s bounded search found no salt for it. err.detail names the suffixMine a salt with mineVanitySalt and a larger maxTries, then pass it as salt
AUTHORIZATION_INVALIDThe launchpad's signature is invalid, expired or already used, or the client's authorizer did not return { nonce, deadline, signature }Plan again. launch() does it
LAUNCHPAD_TERMS_CHANGEDThe launchpad's payees or shares changed after planningRead the new payees with settings.pad(id), then plan again
TERMS_CHANGEDThe terms the coin would get, or its token address, changed after planning: the launchpad's settings or the contracts' movedPlan again and review the new terms. launch() plans again by itself
RECEIPT_MISSING_LAUNCHThe receipt holds no launch from this chain's factory, or several and you passed no expectedTokenCheck the transaction and the chain
RECEIPT_MISSING_LAUNCHPADlaunchpadIdFromReceipt got a receipt that does not hold exactly one registration from the launchpad registry. The error carries transactionHashPass the registration's receipt, from the client's own chain
TRANSACTION_REVERTEDlaunch(): a mined approval reverted, or the mined launch reverted for a reason with no code of its own. The error carries transactionHashPlan again before you retry. The salt is spent

A mined launch whose revert has a code of its own throws that code, with transactionHash. launch() plans again at most twice, on TERMS_CHANGED, START_TICK_CHANGED, AUTHORIZATION_INVALID and POOL_ALREADY_INITIALIZED. It never reuses a salt that was broadcast, and never replaces a salt you passed.

Bankr API (api)​

These come from client.index, createBankrApi, client.fees.getOwed and remoteAuthorizer.

CodeCauseWhat to do
RATE_LIMITEDA 429 from Bankr's APIRetry after err.cause.retryAfterSeconds when it is set
INDEX_UNAVAILABLEBankr's index for the chain is behind, so the answer would be missing launches. Thrown by client.fees.getOwed, client.fees.buildClaimAll, client.index.launchpadStats, a client.index.launches read that only that chain's Bankr Hook launches can answer, and client.index.all when a page leaves a chain outRetry shortly. With client.index.all, pass onIncomplete to take the list without those launches
API_ERRORAny other failure: Bankr refused the request, no reply came, the reply had an unexpected shape, or a remoteAuthorizer call failedRead err.cause, as below

client.index.launch() and client.index.builder() return null for a 404. They do not throw. On a client with api, launch() never throws for registration: a launch Bankr has not registered within 120 seconds comes back with registration: null.

BankrApiResponseError​

When a server answers with an error, err.cause is a BankrApiResponseError. Check it with instanceof first: API_ERROR can carry another cause.

FieldWhat it holds
statusThe HTTP status
codeThe server's own code, such as NOT_CONFIRMED. null when the reply carries none
messageThe server's message, cut to 500 characters, or HTTP <status> when the reply has none
retryAfterSecondsThe reply's Retry-After header in seconds, or null

Contract reverts with no SDK code​

You send swaps and claims from your own wallet, so their failures reach you as contract reverts, not SDK codes. A launch that reverts with one of these throws SIMULATION_REVERTED or TRANSACTION_REVERTED, and launchRevertName(err.cause) returns the name.

RevertRaised byMeaningWhat to do
ExpiredThe factory, at launchThe launch landed after its deadlinePlan again. Raise deadlineSeconds for a Safe or an ERC-4337 launcher
DevBuyTooLittleThe factory, at launchThe first buy returned fewer tokens than the plan's minimumPlan again, or raise devBuy.slippageBps
StartPriceUnavailableThe factory, at launchThe quote is unpriced, its price feed is stale or broken, or the chain's sequencer is down or just backWait, or use another quote
LaunchpadPayeeRejectedThe factory, at launchOne of the launchpad's payees is a reserved address, a Bankr launch contract, the token or the escrowThe launchpad's operator replaces the payee with launchpads.setPayees
TradingNotStartedThe hook and the tokenA swap, or a transfer out of a wallet, before the launch's scheduled trading startWait for the start. client.tradingStatus(token) reads it: see Scheduled start
BalanceLimitExceeded(to, wouldHold, limit)The tokenA transfer would leave to holding more than the token's wallet cap, while the cap runsBuy or send less, or wait for the cap to end
ExtensionRefusedBuyThe hook, on a swapThe pool's extension refused this buy. An extension can refuse a buy, never a sellCheck the extension's rule for the coin
ExtensionGasThe hook, on a swapNot enough gas was left to hand the extension its whole gas budget. The swap reverts instead of skipping the extensionAdd swapGasHeadroom(pool) to the swap's gas limit
CompoundGasThe hook, on a swapAn auto-LP compound came due and got less gas than it needs. The swap reverts instead of skipping itAdd SWAP_GAS_HEADROOM (960,000) to the gas limit for each Bankr pool on the route
MalformedHookDataThe hook, on a swapThe swap's hook data is cut short, pins more than 16 route currencies, or carries more than 2,048 bytes of extension dataBuild the hook data with encodeHookData
InvalidAuthorization, AuthorizationExpired, NonceUsedThe launchpad registry, at launchThe launchpad's signature does not match the launch, has expired, or was already used. A launch through the SDK throws AUTHORIZATION_INVALID for themPlan again
InsufficientGasThe fee ledger and the holder rewards distributorA claim ran with too little gas to hand a payout its whole gas allowance. The whole call reverts and nothing is paidSend the transaction with the gas the SDK built it with
NotPushableThe fee ledgerwithdrawFor for an account the sender may not pay out: a Bankr contract, or a restricted account that has not named the sender its operatorSend the claim from the account itself, or have it name the sender its claim operator
ClaimerNotAllowedThe holder rewards distributorclaimFor or claimPastBnkr for an account whose claim policy refuses the senderSend the claim from the account itself
PayoutRefusedThe holder rewards distributorEvery asset the claim owed refused its payout. The rewards stay claimableClaim again later

A currency that refuses its payment in a fee claim is not an error. The transaction succeeds, the fee ledger logs Withheld, and that currency stays in your balance while the others pay.

Bankr API codes​

Bankr's API answers an error as JSON: { "error": "<message>", "code": "<CODE>" }. Messages are written for users and can change. Codes are stable. Some errors carry no code, and their status tells them apart. See the Launch API for each endpoint.

Index and fee reads​

GET /launches, GET /builders/{slug}/launches, GET /launchpads/{chain}/{id}/stats, GET /bankr-v4/accounts/{account}/fees and POST /bankr-v4/accounts/{account}/fees/build-claim-all.

StatuscodeMeaning
503INDEX_UNAVAILABLEThe index for that chain is behind, so the answer would be missing launches. Retry shortly.

A list that can still answer in part does so, and names the chains it left out in incomplete. See When the index for a chain is behind.

In the SDK this 503 is the INDEX_UNAVAILABLE code above, and err.cause is a BankrApiResponseError with status 503.

Register​

POST /launches/register, which client.index.register and launch() call.

StatuscodeMeaning
400LAUNCH_PROVIDER_UNAVAILABLEBankr does not index launches on this chain
404TX_NOT_FOUNDNo mined transaction with that hash on the chain. launch() retries
409NOT_CONFIRMEDToo few confirmations. The body carries confirmations and requiredConfirmations (5). launch() retries
409LAUNCH_CONFLICTThe launch's block changed since Bankr first recorded it. Bankr's indexer indexes it again once the block is final
422TX_REVERTEDThe transaction reverted, so it launched nothing
422NOT_A_LAUNCHThe transaction holds no launch from the chain's factory
422INVALID_TOKEN_METADATAThe launched token has a blank name or symbol