@flo-fi/sdk
v0.1.0
Published
TypeScript client for the Flo partner API. Authenticates with an sk_test_ or sk_live_ key.
Readme
@flo-fi/sdk
TypeScript client for the Flo partner gateway. Pass an sk_test_ or sk_live_ key. The gateway authenticates the key and does not forward the secret.
import { Flo, WebhookVerifier } from "@flo-fi/sdk";
const flo = new Flo({
apiKey: process.env.FLO_API_KEY!,
baseUrl: "https://api.dev.gm.markets",
});
const history = await flo.orders.history({ chainId: 421614 });
const accepted = new WebhookVerifier().verify({ secret, timestamp, body, signature });Flo is the entry point. Each console area is its own class:
| Class | Calls |
|---|---|
| flo.business | me, organizationId |
| flo.contracts | list, approved, submit, address |
| flo.orders | list, audit, status, statusBatch, mints, redemptions, history |
| flo.catalog | chains, symbols, quotes, snapshots, list, assetRequests, requestAsset |
| flo.webhooks | list, create, rotate, delete, test |
| flo.activity | balance, sandboxFaucet, events |
| flo.signing | sign |
| flo.feed | socket reads on /fed/ws: snapshots, candles, sparklines, tape, order flow, corporate actions |
RequestValidator checks addresses, URLs, tickers, order sides, and sign bodies before the request. HistoryMapper builds the buy, sell, deposit, and withdrawal rows. QuoteBook reads token prices. WebhookVerifier checks x-flo-signature.
Verification, team, logos, and API key management stay in the console.
signing.sign uses the key owner's wallet as owner and receiver. The GM partner fee-voucher route stays out of this client.
flo.feed opens a WebSocket to /fed/ws. The gateway checks the API key and passes each read through to the feed service. This client sends at most 100 messages a second; a faster loop fails locally with WS_RATE_LIMITED and does not put that cap on the feed service.
const snapshot = await flo.feed.snapshot("AAPL");
const candles = await flo.feed.candles({ symbol: "AAPL", interval: "1Min" });