SDK/Guides

Errors

PREVIEW

The SDK reports problems in two ways: an EsseyError thrown before anything is signed, or a Landed result whose ok is false when the chain refused a transaction that was signed and landed.

EsseyError#

TypeScript
import { isEsseyError } from "@esseyonsui/sui-sdk";

try {
  await EsseyAgent.start(options);
} catch (err) {
  if (isEsseyError(err, "KEYS_NOT_SEPARATE")) console.error(err.message);
}

Codes are stable: new codes may be added, existing ones are never renamed.

CodeWhen it is thrown
NETWORK_REFUSEDA network other than localnet/testnet/mainnet; a host that is not that network's; a node answering with the wrong chain, or with the mainnet chain id when localnet or testnet was asked for (Essey has no mainnet deployment); a chain id that changed since connect; a deployment for another chain.
KEY_FILE_REFUSEDThe key file is missing, not mode 600, tagged for another network, holds no Ed25519 key, or its address does not match; on testnet, its address holds a balance on mainnet (or that balance cannot be read); or createAgentKeyFile would overwrite a file.
KEYS_NOT_SEPARATEThe agent's own key owns its OwnerCap. Nothing was signed.
OWNER_CAP_PUBLICThe OwnerCap is shared or frozen. Nothing was signed.
OWNER_CAP_UNVERIFIABLEThe OwnerCap cannot be found or its owner cannot be resolved. Nothing was signed.
AGENT_CAP_MISMATCHA configured AgentCap is not this key's, or not for that treasury. Nothing was signed.
NOT_SET_UPA signing method on an agent started with account: null.
NOT_AGENT_CALLexecute was given a transaction outside the agent lane: a command kind other than MoveCall, SplitCoins, MergeCoins, TransferObjects, or a Move call outside lendingFunctions (for example loan_room::open, loan_room::settle, loan::fill) — plus, when the agent was started with saleRoom, membership::from_proof and room::bid of that package (saleRoomFunctions). Nothing was signed.
NO_POOLA pool action on a deployment without a pool.
NO_ACCESSA deposit, post, fill, pool borrow or loan-room settle whose deployment has no access id.
NO_CASH_TREASURYA desk action on an agent with no cash treasury (a lender).
NO_COINSgas: "coins" and no SUI coin large enough for the gas budget; or no loan-coin coins for an action that spends them.
NOT_FOUNDAn offer, loan or room id the chain does not know; or not exactly one created object of a type.
READ_FAILEDA read-only Move call or a GraphQL query failed.
INVALID_ARGUMENTA missing or bad builder input, a malformed deployment record, a bad salt, or an owner transaction that does not build.
PROOF_BUNDLE_REFUSEDfetchProofBundle or settleProvingKeys: a proving-key manifest or file that is not the expected shape, label or hash.
NOT_INDEXEDTestnet: GraphQL did not index a transaction within 60 seconds. executeAsAgent and executeAsWallet never raise it: the transaction has already landed by then, so they return the Landed with indexed: false and indexError set. It is still raised by the shielded wallet, which needs the read-back before it can price its next spend.
SERVICE_REFUSEDAn EsseyService call the Essey service answered without ok: true, or a service with no self-run agent lane.
INDEX_LOADINGThe market's shared index has not caught up yet; a later call answers.
NOT_OWNER_TXassertOwnerTx: owner bytes that do not pay and address the owner themselves. Nothing was signed.
SETUP_MISMATCHEsseyOwner.claim: the setup code is for another agent address than the one shown.
SELLER_CANNOT_BIDA sale-room bid by the room's own seller, refused before signing.
OVER_GAS_CAPA sale-room finish whose dry run would not fit one transaction's computation cap (5,000,000 units). Nothing was signed.
WOULD_ABORTexecute: the simulation before signing says the transaction would abort; err.abort is the Move abort, named. Nothing was signed.
OVER_MANDATE_CAPpostOffer: an offer larger than what the mandate's cap has left.
LENDER_SHORTpostOffer: the treasury holds less than the offer's smallest fill.

Refused on chain: Landed#

execute simulates the built transaction first: an abort the node foresees is thrown as WOULD_ABORT before signing, so no gas is spent on it. What is signed lands, success or abort, so a Landed always has a real digest.

TypeScript
const landed = await agent.postOffer(terms);
if (!landed.ok && landed.abort?.kind === "move-abort")
  console.log(`${landed.abort.module}::${landed.abort.fn} abort ${landed.abort.code} (${landed.abort.name})`);
// treasury::assert_offer_terms abort 17 (ERateBelowFloor)

abort is { kind: "move-abort", module, fn, code, name }, with name from the SDK's table of every Essey abort constant (null if unknown), or { kind: "other", message }. The table is held equal to the Move sources by a test.

The borrow-rule aborts (treasury)#

CodeNameFires whenSeen through the SDK
17ERateBelowFloorA lender's offer or fill is under its mandate's rate floor.Localnet run.
23ENoBorrowMandateA desk borrow on a cap with no borrow rules.Testnet run, earlier package 0x628b…6579.
24ERateAboveCeilingA desk loan that would open above the rules' maximum rate (checked at opening only).Localnet run; testnet run, earlier package 0x628b…6579.
25ETermTooShortA desk offer loan with a term under the rules' minimum.Testnet run, earlier package 0x628b…6579.
26EPastRepayByA desk borrow at or after the rules' latest maturity, or an offer loan that would mature after it.Testnet run, earlier package 0x628b…6579.
27EPoolNotAllowedA desk borrow from, or refinance out of, a pool the rules do not pin.Localnet run; testnet run, earlier package 0x628b…6579.
28ECashNotAllowedA desk borrow whose proceeds would land in a cash treasury the rules do not name.Localnet run; testnet run, earlier package 0x628b…6579.
29EOverAllowanceA desk loan, or a refinance's change, over what the borrowing allowance has left.Localnet run.

Codes 23–28 were each triggered through the SDK on testnet in one run against the earlier package 0x628b…6579, every digest re-read from testnet. The live testnet package 0x6786…61b4 carries codes 23–29.

private_room_v2 room::admit_offer#

CodeNameFires when
8EOfferWindowClosedAn offer after the offer window closed.

A repeat repay: borrower::release#

CodeNameFires when
2ENoDeedThe treasury holds no deed for the loan: a second EsseyAgent.repay or essey_repay of a loan already repaid. The hosted owner route's repay answers 404 NO_SUCH_LOAN for the same loan.

Sale room room::collect#

CodeNameFires when
0none (name is null)A collect with nothing pending: every losing or expired deposit of the room has already been collected.

All abort constants#

The full per-module list (borrower, loan, loan_room, private_room, market, offer, pool, price, treasury 1–29) is MOVE_ABORTS; codes 1–29 are described module by module in the on-chain reference.