Public JavaScript and TypeScript client for DAY discovery and prepare plans.
This package is intentionally limited to:
- public protocol discovery and read-only market data;
- public wallet-balance reads; and
- a short allowlist of prepare-plan endpoints.
It does not expose credentials, transaction signing, broadcasts, execution controls, wallet administration, automation controls, strategy management, custody, contracts, or protocol-internal adapter details. A prepare plan is data for an owner-controlled integration; this SDK never submits it.
npm install @dayprotocol/sdkimport { DayClient, toMicrosString } from "@dayprotocol/sdk";
const day = new DayClient({ baseUrl: "https://dayprotocol.com" });
const venues = await day.listVenuesByChain({ chain: "sui" });
const plan = await day.prepareStrategyDeposit({
strategyId: "suilend",
amountMicros: toMicrosString(1_000_000),
owner: "0xowner_wallet",
});
console.log({ venues, plan });| Category | Methods |
|---|---|
| Discovery | readiness, network, whatPossible, packages, venue/form/strategy listing, opportunities, market statistics, map venues, network profiles |
| Public balances | suiWalletBalance, solanaWalletBalance, baseWalletBalance, arbitrumWalletBalance |
| Prepare only | prepareStrategyDeposit, prepareStrategyWithdraw, solanaStakePlan, bridgePlan |
| Version | checkForUpdate, checkApiVersion |
Prepare methods reject execute, broadcast, signature, credential, and private-key fields before issuing a request. They do not provide a fallback route that can submit or execute a plan.
Amounts are integer micros. Use toMicrosString rather than floating point values.
toMicrosString("1000000"); // "1000000"Use an origin base URL (https://dayprotocol.com) or an API-v1 base URL (https://dayprotocol.com/api/v1). The client prevents a duplicate API prefix.
npm test
npm pack --dry-run