Errors
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#
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.
| Code | When it is thrown |
|---|---|
NETWORK_REFUSED | A 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_REFUSED | The 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_SEPARATE | The agent's own key owns its OwnerCap. Nothing was signed. |
OWNER_CAP_PUBLIC | The OwnerCap is shared or frozen. Nothing was signed. |
OWNER_CAP_UNVERIFIABLE | The OwnerCap cannot be found or its owner cannot be resolved. Nothing was signed. |
AGENT_CAP_MISMATCH | A configured AgentCap is not this key's, or not for that treasury. Nothing was signed. |
NOT_SET_UP | A signing method on an agent started with account: null. |
NOT_AGENT_CALL | execute 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_POOL | A pool action on a deployment without a pool. |
NO_ACCESS | A deposit, post, fill, pool borrow or loan-room settle whose deployment has no access id. |
NO_CASH_TREASURY | A desk action on an agent with no cash treasury (a lender). |
NO_COINS | gas: "coins" and no SUI coin large enough for the gas budget; or no loan-coin coins for an action that spends them. |
NOT_FOUND | An offer, loan or room id the chain does not know; or not exactly one created object of a type. |
READ_FAILED | A read-only Move call or a GraphQL query failed. |
INVALID_ARGUMENT | A missing or bad builder input, a malformed deployment record, a bad salt, or an owner transaction that does not build. |
PROOF_BUNDLE_REFUSED | fetchProofBundle or settleProvingKeys: a proving-key manifest or file that is not the expected shape, label or hash. |
NOT_INDEXED | Testnet: 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_REFUSED | An EsseyService call the Essey service answered without ok: true, or a service with no self-run agent lane. |
INDEX_LOADING | The market's shared index has not caught up yet; a later call answers. |
NOT_OWNER_TX | assertOwnerTx: owner bytes that do not pay and address the owner themselves. Nothing was signed. |
SETUP_MISMATCH | EsseyOwner.claim: the setup code is for another agent address than the one shown. |
SELLER_CANNOT_BID | A sale-room bid by the room's own seller, refused before signing. |
OVER_GAS_CAP | A sale-room finish whose dry run would not fit one transaction's computation cap (5,000,000 units). Nothing was signed. |
WOULD_ABORT | execute: the simulation before signing says the transaction would abort; err.abort is the Move abort, named. Nothing was signed. |
OVER_MANDATE_CAP | postOffer: an offer larger than what the mandate's cap has left. |
LENDER_SHORT | postOffer: 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.
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)#
| Code | Name | Fires when | Seen through the SDK |
|---|---|---|---|
| 17 | ERateBelowFloor | A lender's offer or fill is under its mandate's rate floor. | Localnet run. |
| 23 | ENoBorrowMandate | A desk borrow on a cap with no borrow rules. | Testnet run, earlier package 0x628b…6579. |
| 24 | ERateAboveCeiling | A desk loan that would open above the rules' maximum rate (checked at opening only). | Localnet run; testnet run, earlier package 0x628b…6579. |
| 25 | ETermTooShort | A desk offer loan with a term under the rules' minimum. | Testnet run, earlier package 0x628b…6579. |
| 26 | EPastRepayBy | A desk borrow at or after the rules' latest maturity, or an offer loan that would mature after it. | Testnet run, earlier package 0x628b…6579. |
| 27 | EPoolNotAllowed | A desk borrow from, or refinance out of, a pool the rules do not pin. | Localnet run; testnet run, earlier package 0x628b…6579. |
| 28 | ECashNotAllowed | A desk borrow whose proceeds would land in a cash treasury the rules do not name. | Localnet run; testnet run, earlier package 0x628b…6579. |
| 29 | EOverAllowance | A 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#
| Code | Name | Fires when |
|---|---|---|
| 8 | EOfferWindowClosed | An offer after the offer window closed. |
A repeat repay: borrower::release#
| Code | Name | Fires when |
|---|---|---|
| 2 | ENoDeed | The 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#
| Code | Name | Fires when |
|---|---|---|
| 0 | none (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.