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.
`@esseyonsui/sui-sdk` is version `0.1.12` and `@esseyonsui/sui-mcp` is version `0.1.16`. Node 22 or newer: both packages set `"engines": { "node": ">=22" }`.
| Package | Runtime dependencies |
|---|---|
@esseyonsui/sui-sdk | @mysten/sui 2.37.0, @mysten/seal 1.5.1, @noble/ciphers 2.4.0, @noble/curves 2.4.0, @noble/hashes 2.4.0, snarkjs 0.7.6 |
@esseyonsui/sui-mcp | @esseyonsui/sui-sdk 0.1.12 and @mysten/sui 2.37.0. It speaks the stdio part of MCP itself rather than pulling in the official server SDK. |
A tarball ships compiled dist/. In this repository the sources run under tsx.
The steps of the quickstart, from the SDK's own localnet examples.
import { connect, deploymentOf, EsseyAgent, EsseyService, loadAgentKey } from "@esseyonsui/sui-sdk";
const API = "https://sui-agent-prototype-production.up.railway.app";
const chain = await connect({ network: "testnet" });
const deployment = deploymentOf(await (await fetch(`${API}/v1/config`)).json());const signer = loadAgentKey("/path/to/agent.env", "testnet");const service = new EsseyService(API, signer);
await service.signIn();
const setup = await service.setup(); // GET /v1/agent/setup; poll until state is "ready" and account is set
const agent = await EsseyAgent.start({
chain,
deployment,
signer,
account: setup.account, // { treasuryId, agentCapId }; a borrower also has cash: { treasuryId, capId }
gas: "address-balance", // faucet SUI funds the address balance. "coins" needs the coin object fundGas creates
});const now = await agent.book.clockMs();
const offers = (await agent.book.offers())
.filter((o) => o.expiresAtMs > now)
.sort((a, b) => a.rateBps - b.rateBps);
const SUI = 1_000_000_000n;
const value = await agent.book.borrowValue(25n * SUI); // what 25 SUI is worth at the oracle price, in loan-coin units; not the borrowable amount
const ltvCap = await agent.book.marketLtv(); // the market's LTV ceiling, bps
const ltv = await agent.book.ltvOnChain(25n * SUI, 5n * 1_000_000n); // the LTV the chain computes for this collateral and debt, bps
const funds = await agent.book.treasuryBalance(treasuryId, deployment.loanCoin); // what the treasury holds of that coin
const mandate = await agent.book.mandate(treasuryId, agentCapId); // a lender's { totalCap, outstanding, funds }; null once revokedconst USDC = 1_000_000n;
const posted = await agent.postOffer({
rateBps: 800,
maxLtvBps: 4_000,
minFill: 1n * USDC,
maxFill: 10n * USDC,
size: 10n * USDC,
termMs: 3 * 86_400_000,
expiryMs: 86_400_000,
});
if (!posted.ok) console.log(posted.abort);const borrowed = await agent.borrowFromOffer(offers[0].id, 25n * SUI, 5n * USDC);
const [loan] = (await agent.myLoans()).filter((l) => l.state === "open");
const repaid = await agent.repay(loan.id);| Layer | Package | What it is |
|---|---|---|
| SDK | @esseyonsui/sui-sdk | The TypeScript library: EsseyAgent, readers, builders, rules, owner builders. |
| MCP server | @esseyonsui/sui-mcp | A Model Context Protocol server over the SDK, for an agent on its owner's own machine, over stdio. |
| The chain | Essey on Sui Move package | Where the owner's rules live and are enforced; the SDK only builds and signs transactions against it. See the on-chain reference. |
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.EsseyAgent.execute re-runs the key-separation check and refuses if the agent's own key owns its OwnerCap.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.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.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…).0x628b…6579, in one SDK run0x628b…6579, in one SDK run: each of the six refusals landed with a real digest, re-read from testnet.0x628b…65790x628b…6579: two bids sealed with the Mysten testnet key servers, opening refused before close, opened after close, settled at the cheapest bid.0x628b…65790x628b…6579.set_borrow_mandate ends with allowance: u64, borrow_allowance_of is public).0x48db…79a10x48db…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.sale_room_v2, private_room_v2) on testnetBoth packages published immutable on 2026-11-08 with TEST-ONLY verifiers0xeeac…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.@esseyonsui/sui-sdk 0.1.12 and @esseyonsui/sui-mcp 0.1.16 (the MCP package…@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.Click a row for the full record. Same text as the Status table in the SDK overview.