@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / native / SomniaMempoolStatus

Variable: SomniaMempoolStatus

const SomniaMempoolStatus: object

Defined in: packages/sdk/src/native/errors.ts:52

The node's mempool verdict, as the data byte of a -32000 error carries it.

Worth branching on rather than matching error strings: nonceTooSmall is retryable with a bumped nonce, insufficientBalance needs funding, and accountDoesNotExist means the sender has never been seen — a different fix from either.

Example (Branching on mempool status)

ts
import { SomniaMempoolStatus, getSomniaRpcError } from "@somnia-chain/markets-sdk/native";

const rpc = getSomniaRpcError(error);
if (rpc?.mempoolStatus === SomniaMempoolStatus.nonceTooSmall) {
  // stale nonce count — re-read it and retry
}

Type Declaration

success

readonly success: 0 = 0

Accepted. Never seen on an error.

hasInFlightTransactions

readonly hasInFlightTransactions: 1 = 1

The sender already has transactions in flight.

accountDoesNotExist

readonly accountDoesNotExist: 2 = 2

The SENDER has never existed on chain — fund it before it can transact.

insufficientBalance

readonly insufficientBalance: 3 = 3

The sender cannot cover value plus the gas ceiling.

nonceTooSmall

readonly nonceTooSmall: 4 = 4

Nonce below the account's next — including when eth_getTransactionCount lags.

nonceTooLarge

readonly nonceTooLarge: 5 = 5

Nonce beyond what the mempool will queue.

nonceNotCloseEnough

readonly nonceNotCloseEnough: 6 = 6

Nonce too far ahead of the account's next to hold.

accountAlreadyLinked

readonly accountAlreadyLinked: 7 = 7

The account is already linked.

invalidTransaction

readonly invalidTransaction: 8 = 8

Malformed, or below the intrinsic gas cost.

invalidSignature

readonly invalidSignature: 9 = 9

Signature did not recover to the sender.

accountNotLinked

readonly accountNotLinked: 10 = 10

The account is not linked.

mempoolFull

readonly mempoolFull: 11 = 11

No room; retry later.

gasPriceBelowBaseFee

readonly gasPriceBelowBaseFee: 12 = 12

maxFeePerGas under the block's base fee.

gasPriceBelowDynamicFee

readonly gasPriceBelowDynamicFee: 13 = 13

maxFeePerGas under the dynamic fee the node currently requires.

tooMuchValueInFlight

readonly tooMuchValueInFlight: 14 = 14

The sender's in-flight value exceeds what the mempool allows at once.