SDK/Getting started

SDK overview

SDK 0.1.12, MCP 0.1.16. Install from the package.json block in Install, including the underscore override. An agent should start at Hand this to your agent.

The Essey on Sui SDK lets you run your own agent — on your laptop, your server, or inside an AI assistant — that lends and borrows on Essey on Sui with its own key, inside rules its owner sets on chain from another device. Essey runs nothing for it and never holds its key.

It is a TypeScript client: transaction builders, chain readers, the lending rule checks, sealed-room opening, owner transactions built unsigned, and the key-separation check. It runs on Sui testnet and on a localnet; Essey has no mainnet deployment.

Three layers#

LayerPackageWhat it is
SDK@esseyonsui/sui-sdkThe TypeScript library: EsseyAgent, readers, builders, rules, owner builders.
MCP server@esseyonsui/sui-mcpA Model Context Protocol server over the SDK, for an agent on its owner's own machine, over stdio.
The chainEssey on Sui Move packageWhere the owner's rules live and are enforced; the SDK only builds and signs transactions against it. See the on-chain reference.

EsseyOwner#

EsseyOwner is the owner's side with a plain Sui wallet key. No browser and no passkey. Construct it with the API base URL and a Signer (new EsseyOwner(api, ownerKey)). It signs in at POST /v1/auth/challenge and POST /v1/auth/session (signIn), reads a setup code without spending it (peek), spends it (claim), previews a lender form (preview), lists agents, and signs the service's owner transactions (sign). fundGas sends the agent one SUI coin from this wallet for coins-mode gas. The service pays the gas on sign. The walkthrough is Approve from a wallet key. The methods are Owner and service clients.

What it never does#

  • EsseyAgent never takes an owner key. Owner actions for a hosted flow are built as unsigned bytes for the owner's own device. EsseyOwner is the separate client that scripts that owner with a plain wallet key: the key stays on that machine and only signatures are sent. See EsseyOwner.
  • It never signs with keys held together. Before every signature, EsseyAgent.execute re-runs the key-separation check and refuses if the agent's own key owns its OwnerCap.
  • It never reaches mainnet unasked. Essey has no mainnet deployment. Mainnet must be asked for by name: a localnet or testnet connection refuses a node that answers with the mainnet chain id, and on testnet a key whose address holds a mainnet balance is refused.
  • It never hides a refusal. execute simulates the built transaction first and refuses, before signing, one the node says would abort (WOULD_ABORT, naming the Move abort). A transaction the chain refuses after signing still lands; the result says so and names the Move abort.

Status#

WhatStatus
SDK and MCP on localnetProven end to end: every digest of the run re-read from the chain. See Localnet e2e.
SDK on the live testnet package 0x6786d695be37759278a0769b311fd9381b44baaea86f6a969619a7df8c9a61b4The cutover market is 0x618b3e2946ff34462bf8af9ff2cafe444d7bb19b367e882ca67c9af59f1aad33 and the lending pool is 0xffdc7fa44be2368cafc94a7f6871088a94a0dcb90d14fbe476e586f765170667. A 2026-10-30 lender run on the earlier package 0xb994…9712 deposited 4 USDC (HB8BYu2u…), posted inside its mandate (7p5Tuxnj…), was refused at 1% under the floor (treasury abort 17, 3PNVQpRh…) and over the fill limit (abort 14, HaLm3Gd3…), and cancelled (3wz6n5EA…).
Borrow-rule aborts 23–28 on testnetVerified on the earlier testnet package 0x628b…6579, in one SDK run: each of the six refusals landed with a real digest, re-read from testnet.
Opening sealed bids with Seal through the SDK on testnetVerified on the earlier package 0x628b…6579: two bids sealed with the Mysten testnet key servers, opening refused before close, opened after close, settled at the cheapest bid.
Testnet event reads (GraphQL), key separation and the MCP on testnetVerified in the same run on the earlier package 0x628b…6579.
Borrowing allowance (abort 29)Seen through the SDK on localnet. The current testnet package publishes it (set_borrow_mandate ends with allowance: u64, borrow_allowance_of is public).
Sale rooms through the SDK on testnetHistorical run on the sale-room package that preceded the live 0x48db…79a1: a private bid from a fresh address, Seal key release, the winner's claim, the loser's refund and withdraw, 33/33 steps in Sui Dollar (test), USDC and SUI. See Sale rooms with the SDK.
Sealed settlement v2 (sale_room_v2, private_room_v2) on testnetBoth packages published immutable on 2026-11-08 with TEST-ONLY verifiers: 0xeeac…b714 and 0x5e2d…9050, carried by TESTNET_SALE_ROOM_V2 and TESTNET_PRIVATE_LOAN_V2. The SDK builds every step, from the open to the repay: openSaleV2Tx, attestSellerV2Tx, bidV2Tx, poolBidV2Tx, finishV2Tx, openPrivateLoanV2Tx, attestBorrowerV2Tx, offerV2Tx, settleV2Tx, settleRelayedV2Tx, repayV2Tx, repayCoinV2Tx; buildPoolBidV2 and buildOfferV2 compose the pool spend and the relayer body (bid_v2, loan_offer_v2) in one call; the finish or settle carries a proof, never the losing values. Every builder is documented with its signature in Sealed settlement v2 and walked through in Private flows with the SDK. The MCP adds five essey_private_*_v2 tools when ESSEY_PRIVATE carries the v2 sections; the hosted relayer takes bid_v2, loan_offer_v2 and settle_relayed_v2.
Private loan room and access stages on testnetA lender offer funded from the shielded pool, settled into a private note, then repaid: a public repay and a shielded repay, each in Sui Dollar and USDC. The access switch moved CLOSED → INVITE → PUBLIC, 37/37 passes and refusals as expected. See Private flows with the SDK.
npm@esseyonsui/sui-sdk 0.1.12 and @esseyonsui/sui-mcp 0.1.16 (the MCP package depends on the SDK 0.1.12). The root install sets "overrides": { "underscore": "1.13.8" } so snarkjs's bfj chain does not report GHSA-qpx9-hpmf-5gmw. The MCP package ships essey-sui-init as a command. The server accepts GET /v1/config and GET /v1/private/config as the two id files exactly as saved, including each loan market's oraclePkg, feed and reader. The SDK's fetchProofBundle downloads the TEST-ONLY membership and spend keys and fetchSettleKeys the Settle(16) key; each refuses any file whose hash is not the deployed verifier's. snarkjs 0.7.6 installs with the SDK.