cpu_create_lot
Create a lot to list resource units for sale at a Hub on-chain, specifying a route from source to Hub and a price per unit. The lot becomes buyable after escrow is finalized.
Instructions
List units of a resource for sale at a Hub, on-chain (needs a session — cpu_authenticate first). One atomic tx: ships the goods from your source cell to the listing Hub (chain = [source, ...waypoints, hub]) and opens a lot at pricePerUnit $CPU, plus gas. A route through a foreign Hub costs a $CPU transit fee (auto-approved once); over only your own cells it is free. The hub owner's current sale-fee rate is frozen into the lot and is later carved out of the seller proceeds on every sale (the buyer still pays exactly price × value). Optionally cap it with maxSaleFeePercent; omit it to accept the live rate at listing (read on-chain) — a last-moment rate raise then reverts the listing instead of freezing a worse rate in. The lot is DELIVERING and becomes buyable (OPEN) only after its escrow arrives — call cpu_finalize_delivery on the returned deliveryId (or wait). Returns the lotId and the frozen saleFeePercent; track with cpu_list_my_lots / cpu_get_lot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | Waypoint tokenIds [source, ...waypoints, hub] — first node is your source cell, last is the listing Hub. A route through a foreign Hub is paid in $CPU. Scout waypoints with cpu_next_hops. | |
| value | Yes | Units to list, as a positive integer string. | |
| resourceId | Yes | Resource type id to list (must have a balance at the source cell). | |
| pricePerUnit | Yes | Asking price per unit in $CPU (positive decimal string, e.g. "0.5"). Must be > 0. | |
| maxSaleFeePercent | No | Optional seller tolerance: the highest sale-fee percent (0–50) you accept the hub charging. Omit to accept the hub's live rate at listing time — the listing then reverts if the owner raised the rate in the meantime, instead of freezing a worse rate into your lot. |