Skip to main content

Monaco Protocol SDK v1.0.39

This release retires two long-dead response fields, adds a delegated-owner startup mode to the MCP server, and clarifies the React session-lifecycle hook’s vocabulary. The one breaking change is narrow: getPaginatedOrders and getPaginatedUserMovements no longer carry the latest_orders / latest_movements fields — a live-engine hot-cache shadow the backend stopped populating in v0.8.7, so every caller has received undefined for them since. The one thing to act on before upgrading: if any code reads latest_orders / latest_movements off those paginated responses, switch to the orders / movements arrays.

Breaking

latest_orders / latest_movements removed from paginated responses

GetPaginatedOrdersResponse no longer declares the optional latest_orders field and GetPaginatedUserMovementsResponse no longer declares the optional latest_movements field (@0xmonaco/types, surfaced through sdk.trading.getPaginatedOrders and sdk.profile.getPaginatedUserMovements in @0xmonaco/core). These were a live-engine (Redis) hot-cache shadow, only ever populated on page 1, that the backend stopped writing in v0.8.7 — so every caller has received undefined for both fields since then, and neither was part of the wire schema. @0xmonaco/react’s useUserOrders and useUserMovements hooks previously seeded their initial state from those fields and now build it from the paginated orders / movements arrays alone; both hooks’ return shapes are unchanged. Migration. Read the paginated orders / movements arrays directly. On a reconnect or resync, refetch a fresh snapshot rather than relying on a live-cache field for the newest rows.

Added

Delegated-owner mode for the MCP server

The MCP server (@0xmonaco/mcp-server) gains MONACO_DELEGATED_OWNER_USER_ID, a startup option that runs the server on behalf of a delegated owner account instead of the configured wallet’s own account. The MONACO_PRIVATE_KEY wallet acts as the agent: on startup it authenticates as itself, then adopts an owner-scoped session (loginAsDelegatedOwner), so every subsequent tool call — reads and trades — acts on the owner account, with the agent wallet preserved as the audit actor. The owner must have registered the agent wallet with an active delegation policy; the server cannot self-assert ownership. It is fail-closed: MONACO_DELEGATED_OWNER_USER_ID requires MONACO_PRIVATE_KEY and MONACO_CLIENT_ID (the agent must authenticate as itself first), a present-but-blank value is rejected, and a failed adoption never falls back to trading as the agent’s own account. Fund-movement tools still require the full capability, and delegated sessions cannot withdraw owner collateral. Raw delegated-session creation is intentionally not exposed as a tool — owner adoption is a startup option, not an autonomous agent action. See Delegated owner mode.

Fixed

useTokenLifecycle documentation clarified to session-key vocabulary

@0xmonaco/react’s useTokenLifecycle hook has its JSDoc, inline comments, and log strings rewritten to describe the authenticated session — the wallet-authorized ed25519 keypair returned by login(), persisted and refreshed via sdk.refreshAuth() — instead of implying JWT/bearer tokens. Monaco is a tokenless session-key exchange; there are no separate access or refresh tokens. The exported members and config fields (initializeTokens, clearTokens, refreshTokens, isTokenExpired, persistTokens) keep their existing “token” spelling as retained legacy compatibility names, so the public API is unchanged. The hook’s reference page is now linked from the docs navigation.

Upgrade

The MCP server ships at 1.0.39 too; it runs via npx -y @0xmonaco/mcp-server, so restarting your assistant picks up the new version and the delegated-owner startup option. The only breaking part of this release is the removed cache fields. One thing to act on:
  1. Stop reading latest_orders / latest_movements. If any code reads those fields off getPaginatedOrders / getPaginatedUserMovements (or off the raw responses behind useUserOrders / useUserMovements), switch to the paginated orders / movements arrays; on a reconnect or resync, refetch a fresh snapshot.