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
| Member | What it holds |
|---|---|
code | A stable code, one of LAUNCH_SDK_ERROR_CODES. Branch on it |
kind | "config", "refused", "execution" or "api" |
message | A fixed sentence per code. Never branch on it |
detail | The SDK's own sentence naming the field or bound that failed, when it can. Safe to show |
chain | The chain the error is about, when there is one |
transactionHash | The mined transaction the error is about, when there is one |
cause | The 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?)istruefor 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", ornullwhen the cause is not a contract revert.- Each kind has a class:
LaunchConfigError,LaunchRefusedError,LaunchExecutionErrorandLaunchApiError.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
TypeErrororRangeError:createAuthorizeHandlerwithoutauthorize, ormineVanitySaltwith amaxTriesunder 1.
Client setup (config)
| Code | Cause | What to do |
|---|---|---|
PROVIDER_NOT_DEPLOYED | An 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: true | Leave 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_CHAIN | A chain outside LAUNCH_CHAINS, a publicClient or walletClient on another chain, or a plan made for another chain | Create the client and its viem clients for the same chain |
RPC_REQUIRED | A chain with no public RPC, such as Arc, with no rpcUrl and no publicClient | Pass an rpcUrl or a publicClient |
WALLET_REQUIRED | launch() on a client with no walletClient | Pass a walletClient, or use plan() and buildLaunchTx() and send the launch yourself |
API_KEY_IN_BROWSER | padAuthorizer or createAuthorizeHandler running in a browser | Keep keys on your server. Use remoteAuthorizer in the browser |
INDEX_NOT_ON_FORK | client.fees.getOwed or client.fees.buildClaimAll on a client created with fork: true. Both read Bankr's API, which indexes live chains only | On 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.
| Code | Cause | What to do |
|---|---|---|
PAUSED | New launches are paused at the chain's factory | Wait. client.status() reports paused: false when they resume |
LAUNCHPAD_GATED | The chain takes launches on Bankr's own launchpad only, and the launch names another launchpad | Launch on a chain where client.status() reports gated: false |
UNKNOWN_LAUNCHPAD | No launchpad with this id is registered on the chain | Check the id and the chain. launchpadIdFromReceipt reads a new launchpad's id |
LAUNCHPAD_PAUSED | The launchpad's operator paused its new launches | Wait, or use another launchpad. The operator resumes with launchpads.setPaused(id, false) |
AUTHORIZATION_REQUIRED | The 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 authorizer | Set launchpadId to the launchpad you launch on. For a launchpad with a signer, pass its authorizer |
PRICE_ATTESTATION_REQUIRED | The quote token's price needs a signature from Bankr, which a launch from the SDK does not carry | Use a quote token priced by a feed. settings.quotes() lists each token's pricing |
QUOTE_NOT_ALLOWED | quote 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 it | Read err.detail when it is set. settings.padQuote(id, quote) says whether a launch may pair with a token |
CURVE_NOT_ALLOWED | The launchpad does not allow the launch's curve: a built-in its operator switched off, or your own bands it neither lists nor leaves open | Use a curve the launchpad allows. Its operator opens one with launchpads.setCurveAllowed |
EXTENSION_NOT_ALLOWED | The 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 which | Use an extension the launchpad allows, or have its operator allow the kind with launchpads.setSwitches. client.previewExtension reads the answers first |
EXTENSION_OUT_OF_BOUNDS | A 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 bound | Use a value inside the bound. settings.pad(id).presets holds the launchpad's limits |
DEV_BUY_UNAVAILABLE | The 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 list | Drop the first buy, or change the quote token or the launcher |
INVALID_PARAMS | An 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 in | Read err.detail. Check the input against Configuration |
INVALID_PERCENT | A 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 bps | Read err.detail. Pass percentages as strings, such as "1.75" |
FEE_OUT_OF_BOUNDS | A 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 it | Read err.detail. Read the launchpad's range from settings.pad(id).atLaunch.knobs |
SPLIT_OUT_OF_BOUNDS | Holder, 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 range | Read err.detail. Read the launchpad's range from settings.pad(id).atLaunch.knobs |
VESTING_OUT_OF_BOUNDS | A 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 ceiling | Read err.detail. See Vesting and allocations |
OUTSIDE_LAUNCHPAD_RANGE | A 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_LAUNCHPAD | The 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 it | Drop the option. The launchpad's operator switches the feature on with launchpads.setSwitches |
HARD_BOUND | One 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 can | Read err.detail. See What stays fixed for everyone |
OPTION_FOR_FEATURE_OFF | The 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 cap | Drop the option, or turn the feature on for this launch |
CLAIM_OPERATOR_REQUIRED | On a coin that can be taken over, a fee recipient is a contract with restricted claims and the launch names no claimOperator | Pass claimOperator: the claim operator that contract named on the fee ledger |
LAUNCH_REFUSED | The contracts' launch check refuses the launch for a reason with no code of its own. err.detail gives the reason | Read err.detail |
CREATOR_CAP_EXCEEDED | The 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 supply | Lower devBuy.amount or the vested share. The launchpad's operator raises the ceiling with launchpads.setKnobs |
LAUNCHER_IS_FORWARDER | The launcher is Multicall3, Multicall2 or Multicall. Anyone can call through them, so anyone could take the launch's first buy and fees | Launch from an account you control |
LAUNCHER_MISMATCH | launch(): the wallet's account is not the input's launcher | Send from the launcher, or set launcher to the wallet's account |
FEE_RECIPIENT_CANNOT_CLAIM | A 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 ledger | Use a wallet address. For a contract, see allowContractFeeRecipient and allowOpenCodeFeeRecipients in Configuration |
NOT_A_LAUNCH | The token is not a launch of this chain's factory | Check the token's address and the chain |
NOT_A_BENEFICIARY | client.fees.buildClaim or buildSetFeeRecipient for an account that holds no share of the launch's fees | Pass a fee recipient or a launchpad payee. client.launchInfo(token) lists them |
CLAIM_NOT_ALLOWED | client.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 share | Send the claim from the account itself, or have it name the sender with client.fees.buildSetClaimOperator |
NO_VESTING | client.vesting.buildRelease for an account with no schedule on the launch, or buildReleaseToHolders on a launch with no holders' vest | Read the launch's schedules with client.vesting.get(token) |
NOT_METADATA_ADMIN | A 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 account | Read err.detail. client.metadataAdmin.get(token) shows admin and pendingAdmin |
INVALID_LAUNCHPAD_CONFIG | A 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 operator | Read err.detail, which names the rule. See Set up a launchpad |
INVALID_SETTINGS | A builder of client.contracts().owner breaks a rule of the contracts. Only the contracts' owner sends those | Read err.detail |
Simulation and chain (execution)
| Code | Cause | What to do |
|---|---|---|
SIMULATION_REVERTED | The 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 maxTxGas | Name the revert with launchRevertName(err.cause), fix it, then plan again |
POOL_ALREADY_INITIALIZED | The predicted token address already holds a contract | Plan again with a fresh salt. launch() does it when you passed no salt |
START_TICK_CHANGED | The quote's price moved the start tick out of the factory's bounds after planning, or no start tick fits the bounds right now | Plan again. launch() does it |
PREDICTION_MISMATCH | The SDK's predicted token address is not the factory's, or the token's address breaks a launchpad's suffix rule | Do not send the launch. Upgrade the SDK, and tell Bankr if it persists |
VANITY_UNAVAILABLE | The launchpad requires an address suffix, and plan()'s bounded search found no salt for it. err.detail names the suffix | Mine a salt with mineVanitySalt and a larger maxTries, then pass it as salt |
AUTHORIZATION_INVALID | The 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_CHANGED | The launchpad's payees or shares changed after planning | Read the new payees with settings.pad(id), then plan again |
TERMS_CHANGED | The terms the coin would get, or its token address, changed after planning: the launchpad's settings or the contracts' moved | Plan again and review the new terms. launch() plans again by itself |
RECEIPT_MISSING_LAUNCH | The receipt holds no launch from this chain's factory, or several and you passed no expectedToken | Check the transaction and the chain |
RECEIPT_MISSING_LAUNCHPAD | launchpadIdFromReceipt got a receipt that does not hold exactly one registration from the launchpad registry. The error carries transactionHash | Pass the registration's receipt, from the client's own chain |
TRANSACTION_REVERTED | launch(): a mined approval reverted, or the mined launch reverted for a reason with no code of its own. The error carries transactionHash | Plan 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.
| Code | Cause | What to do |
|---|---|---|
RATE_LIMITED | A 429 from Bankr's API | Retry after err.cause.retryAfterSeconds when it is set |
INDEX_UNAVAILABLE | Bankr'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 out | Retry shortly. With client.index.all, pass onIncomplete to take the list without those launches |
API_ERROR | Any other failure: Bankr refused the request, no reply came, the reply had an unexpected shape, or a remoteAuthorizer call failed | Read 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.
| Field | What it holds |
|---|---|
status | The HTTP status |
code | The server's own code, such as NOT_CONFIRMED. null when the reply carries none |
message | The server's message, cut to 500 characters, or HTTP <status> when the reply has none |
retryAfterSeconds | The 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.
| Revert | Raised by | Meaning | What to do |
|---|---|---|---|
Expired | The factory, at launch | The launch landed after its deadline | Plan again. Raise deadlineSeconds for a Safe or an ERC-4337 launcher |
DevBuyTooLittle | The factory, at launch | The first buy returned fewer tokens than the plan's minimum | Plan again, or raise devBuy.slippageBps |
StartPriceUnavailable | The factory, at launch | The quote is unpriced, its price feed is stale or broken, or the chain's sequencer is down or just back | Wait, or use another quote |
LaunchpadPayeeRejected | The factory, at launch | One of the launchpad's payees is a reserved address, a Bankr launch contract, the token or the escrow | The launchpad's operator replaces the payee with launchpads.setPayees |
TradingNotStarted | The hook and the token | A swap, or a transfer out of a wallet, before the launch's scheduled trading start | Wait for the start. client.tradingStatus(token) reads it: see Scheduled start |
BalanceLimitExceeded(to, wouldHold, limit) | The token | A transfer would leave to holding more than the token's wallet cap, while the cap runs | Buy or send less, or wait for the cap to end |
ExtensionRefusedBuy | The hook, on a swap | The pool's extension refused this buy. An extension can refuse a buy, never a sell | Check the extension's rule for the coin |
ExtensionGas | The hook, on a swap | Not enough gas was left to hand the extension its whole gas budget. The swap reverts instead of skipping the extension | Add swapGasHeadroom(pool) to the swap's gas limit |
CompoundGas | The hook, on a swap | An auto-LP compound came due and got less gas than it needs. The swap reverts instead of skipping it | Add SWAP_GAS_HEADROOM (960,000) to the gas limit for each Bankr pool on the route |
MalformedHookData | The hook, on a swap | The swap's hook data is cut short, pins more than 16 route currencies, or carries more than 2,048 bytes of extension data | Build the hook data with encodeHookData |
InvalidAuthorization, AuthorizationExpired, NonceUsed | The launchpad registry, at launch | The launchpad's signature does not match the launch, has expired, or was already used. A launch through the SDK throws AUTHORIZATION_INVALID for them | Plan again |
InsufficientGas | The fee ledger and the holder rewards distributor | A claim ran with too little gas to hand a payout its whole gas allowance. The whole call reverts and nothing is paid | Send the transaction with the gas the SDK built it with |
NotPushable | The fee ledger | withdrawFor for an account the sender may not pay out: a Bankr contract, or a restricted account that has not named the sender its operator | Send the claim from the account itself, or have it name the sender its claim operator |
ClaimerNotAllowed | The holder rewards distributor | claimFor or claimPastBnkr for an account whose claim policy refuses the sender | Send the claim from the account itself |
PayoutRefused | The holder rewards distributor | Every asset the claim owed refused its payout. The rewards stay claimable | Claim 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.
| Status | code | Meaning |
|---|---|---|
| 503 | INDEX_UNAVAILABLE | The 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.
| Status | code | Meaning |
|---|---|---|
| 400 | LAUNCH_PROVIDER_UNAVAILABLE | Bankr does not index launches on this chain |
| 404 | TX_NOT_FOUND | No mined transaction with that hash on the chain. launch() retries |
| 409 | NOT_CONFIRMED | Too few confirmations. The body carries confirmations and requiredConfirmations (5). launch() retries |
| 409 | LAUNCH_CONFLICT | The launch's block changed since Bankr first recorded it. Bankr's indexer indexes it again once the block is final |
| 422 | TX_REVERTED | The transaction reverted, so it launched nothing |
| 422 | NOT_A_LAUNCH | The transaction holds no launch from the chain's factory |
| 422 | INVALID_TOKEN_METADATA | The launched token has a blank name or symbol |