SDK/Guides

Localnet e2e

PREVIEW

every digest on this page is from a local network, started fresh for the run. None of them exists on testnet.

Run logs/sdk/e2e-1792939239, Sui 1.82.2, committed with SDK commit 04be833. After the run, each of the 34 printed digests was read back from the chain and matched its line in the log.

What it proves#

  • The package is published immutable. The run publishes with the UpgradeCap destroyed in the same transaction and stops if any UpgradeCap is left; it reported none.
  • The owner signs on its own device. Every owner action was built by the SDK as unsigned bytes and signed by a separate owner key; the agents' keys never held an OwnerCap.
  • The chain enforces the owner's rules on the agent. A lender's offer under its mandate floor aborted ERateBelowFloor (17); a borrower's desk fill over its borrow rule aborted ERateAboveCeiling (24); a desk fill with proceeds sent to a cash treasury the rules do not name aborted ECashNotAllowed (28); a desk borrow from a pool other than the pinned one aborted EPoolNotAllowed (27).
  • The borrowing allowance holds, and only the owner restores it. After 5 + 2 USDC borrowed and repaid, 3 USDC of the 10 USDC allowance was left; a 2 USDC borrow landed, a second one aborted EOverAllowance (29), and after the owner re-set the rules the same borrow landed.
  • Borrowing never touches the agent's address. The borrower borrowed from an offer and from its pinned pool, and repaid both, through the treasury desk; after the offer loan its SUI treasury held its full 60 SUI again.
  • A sealed room settles at the cheapest bid (localnet, without Seal key servers).
  • Keys held together are refused by the SDK and by the MCP server.
  • The MCP server works with a standard MCP client: 24 tools listed, a borrow and a repay signed by the agent key, an owner renewal returned unsigned and signed by the owner.

Steps and digests (localnet)#

#StepResultDigest
1Publish Essey immutably with a market (no UpgradeCap left)success9AsNqtejCrKBcNJw9LUuiAUdYb5nXjJCkEz7WmApwKoW
2Seed one pool with 30 USDC; a second pool stays emptysuccess2VhJaNTk3LVswq5hA5vuiU7aj934giYccW4LVU1LDMQ3
3Owner: create lender-1's treasury and capsuccessFARa5kQ4ayJ1XnrQEpeNwjhCuTAgynCJonEdof9WDoWz
4Owner: lender-1's mandate, 20 USDC depositsuccessASEmTxQx3BqQfTMm87qfTKrn7Q19oJY8Ed52Q4FDcMTq
5Owner: create lender-2's treasury and capsuccess9XfHWYwxWo7g3YRkGsTzVhv5A1heXmvbGyxniY9QTiCQ
6Owner: lender-2's mandate, 20 USDC depositsuccess3ENHjQNg79zS6JJ3EPUxFkr4TspuiYkDLqnNU895u72M
7Owner: create borrower-1's two treasuries and capssuccessoxLKv5a6MhCP8TzEWxk2JrqhiUsGkdUwUzRSCDwgi52
8Owner: 60 SUI, 2 USDC float, borrow rules ≤ 700 bps, term ≥ 1 h, pool pinned, cash pinned, allowance 10 USDCsuccess4RDfEYhb6sNL3nnAxC3xHewr5xNN8jDQGGued1qX8R3c
9Owner: a second cash treasury with a cap for borrower-1, not the one its rules namesuccess9VENgSSxYuihuc5UweyzhJHiMhbwkPgVRzqGmP8BrmL3
10lender-1 posts 10 USDC at 800 bpssuccesss8P4bVTnnrpPguqUwTWfa8ZdLdq1oNkUUgDBuFLKNVz
11lender-1 posts at 100 bps, under its 300 bps flooraborted ERateBelowFloor (17)6H4sbLtLdTLaK9zsjCNbA2mxab23btMnA3ZHf3gvTAJm
12lender-2 posts 10 USDC at 600 bpssuccess6LHDDo4XmUs17A42qhPMwwNd9hZ4QC2MfYnk1Na5nDct
13borrower-1 desk fill at 800 bps, over its 700 bps ruleaborted ERateAboveCeiling (24)6mXzTxEpdEx2MCaLEbUt1UB5PxkAo4JEjm35esjBY1aZ
14borrower-1 desk fill with proceeds into the second cash treasuryaborted ECashNotAllowed (28)A2KQaSKY9NKoeSRpz833tEXM48sZpHvnkq79nMDcwoYb
15borrower-1 borrows 5 USDC on 25 SUI from an offer through the desksuccess3i5hNXqYANYhB54FFPh7JbxyHnpku27NqTurUZBW3Gh6
16borrower-1 repays from its cash treasurysuccess4chLhxtZLLznFDEoVeoG9JFgp3SEBYjfBfx7Uw9d5GPy
17borrower-1 desk borrow from the second, unpinned poolaborted EPoolNotAllowed (27)AUZq1jibXhb5fz4EUZoc7urX5DbiN3Uvxzge6uHAmxhQ
18borrower-1 borrows 2 USDC on 25 SUI from the pinned pool through the desksuccessDtmHStJbeYvBCQBm1VrgD82yAqV1vtVg3p1iAnz2py8Y
19borrower-1 repays the pool loan from its cash treasurysuccess88ZbPSMU4bUyTkcEphhaEAsrXXnYW7QJHbwpkLBAcGjB
20borrower-1 borrows 2 USDC on 10 SUIsuccess98Esg1rnb6woN1YCNq8RooS848hpTLd9LAyahTKo1hzD
21borrower-1 asks for a second 2 USDC, past what the allowance has leftaborted EOverAllowance (29)6PwCEonYhsWctUa854JuLZzoddHeNzAdPRurL1xKX2iB
22Owner re-sets borrower-1's rules: allowance back to 10 USDCsuccess4uRcj9qfgJXgLayyGhCe2YVLaoNKNJdTXA4gZYvNyt9o
23borrower-1 borrows the 2 USDC againsuccessFgGnw5FoGptQHGfraPQRbZJncZsbBK3GLtToLtTMMRyK
24borrower-1 repays one open loansuccess6biqBNtuqp5megMMxQbeSsU5982iv2QpHc7WEFJR1n7p
25borrower-1 repays the othersuccesshUmLF6NCjusgPKHiat5piACfsDuhhsBZ3AY9MEo44rK
26borrower-1 opens a sealed room, 4 USDC on 20 SUIsuccessE6aPNy8FLVKEPsXDqPzS4Z29D7GRSpJWsuwJ7m1f43WV
27lender-1 consents and bids 700 bpssuccessHSxqgcz7V8rmQkNH3UWEFaQM4NeYJJ3RbMYacAikmURx
28lender-2 consents and bids 500 bpssuccess8rMbAUqDyDKjTKduwLuppsy6p25yxB55QiAEEE4eiFyC
29borrower-1 settles at 500 bpssuccessHJqwsJx4Npu5AccVDJv3kizBN2Y6dMSU7T7DySaKQREh
30borrower-1 repays the room loansuccess4Q4smDGQSKDHdvGkGFuDShbNndZVWJrvYHrsC9fHdDRx
31One key creates a treasury and keeps both caps (the refused setup)success6m4CxdPtu5BFiyZ9Ck5xFiYKZ5gChxUK6RZp9yP18hUX
32MCP essey_borrow: 3 USDC on 25 SUIsuccessHQnv1iwrJHM2FSinSQJXaQr7nQ2AsfyUMnT76LZqKccu
33MCP essey_repaysuccess2hDFBvuFWfaLjuwiW8eihKij9u1jTn21TYaPF5h3ygfX
34Owner signs the MCP's unsigned renewalsuccessFe1Q73QKPeNzrk65EY54iZRb7sPD5AtiMicGqraEhV9U

The SDK-alone run#

scripts/sdk-alone-local.sh starts its own localnet and a local self-serve API, then plays a bot and its owner with nothing but the SDK: EsseyService for the agent's setup, EsseyOwner for the owner's wallet sign-in, claim, create with a 4 USDC deposit and the agent's gas, EsseyAgent to lend. The chain refuses the two out-of-mandate offers (treasury aborts 17 and 14), one offer goes through the sponsored lane, and every digest is re-read at the end.

StepResultDigest
Owner create with amount: "4" (operator pays gas)successDcBRiePJMBUuhZddRWnfXPSr2dAhyiCUuYXQRMjBz4hp
Owner fundGas, 0.5 SUI as one coinsuccessRSUDWpQicBmbXAPPxKL9Wc2QAcKxJTtU7jXJE7DTbyr
Agent postOffer inside the mandatesuccess1q6LE7T3XgsJsjfE7bzkvYRFgyjfTp8meUjfi1SEWk2
Offer at 1%, under the 8% floortreasury abort 17mKyhqEkqUwbWsMSs28mTE1KgvaJmczodLzoJqTFztBJ
Offer with a 3 USDC fill, over the 2 USDC limittreasury abort 14JDsv7vDSo9pphhJj9F1W4azjkVhksnfuyQ4MazfiTBoo
EsseyService.sponsored offer, operator as gas ownersuccess26vquvmnWqWBQ2PvkweKi952RuxrCxESJtX2yfweEREK
Agent cancelOffersuccessAKVETgfQhKcT4bKRSRh8j26xbreanjHbCcFFC6Mxta8h

The sale-room bid is not in it, as localnet has no Seal key servers; it ran on testnet (see Sale rooms with the SDK).

What it does not prove#

  • Anything on testnet: no step ran there.
  • Opening sealed bids with Seal: localnet has no key servers.
  • Testnet event reads: on localnet the SDK reads events over the fullnode's gRPC, on testnet over GraphQL.
  • The borrow-rule aborts 23, 25 and 26. Only 24, 27, 28 and 29 fired in this run.

A separate SDK run on testnet, against the earlier package 0x628b…6579, covered Seal, GraphQL event reads and aborts 23–28; see the SDK overview. It did not cover the allowance.