Published operations
The operation set the SDK ships, per kind. Most integrations never write a query.
The published operations are the API's integration surface: typed documents the SDK ships and registers for you, each selecting what an integration needs and nothing a partner should not see. Write your own only when one of these does not fit, and register it (see Registered documents).
Dealer
| Operation | Scope | What it answers |
|---|---|---|
DealerContext | any | The organization the token belongs to: its id and name. Run once, cache. |
Catalog | any | What Athanor sells: IRA-eligible bullion by definition, with the BSI and BSI+ codes. |
PricingAtDepository(depository, alternatives) | any | What Athanor sells at right now, per product, at a depository, with the same at the alternatives and which metals' markets are closed. Indicative, never a lock. |
ClientsPage(first, after) | dealer:clients:read | The holders in the dealer's book, a page at a time. |
OrdersFeed(first, after) | dealer:orders:read | The organization's orders, newest first, a page at a time, each as the full record. |
OrderStatus(id) | dealer:orders:read | One order's record by its global id: what a webhook names. |
DraftOrder(input) | dealer:orders:write | A client, an account and a depository make an order. |
AdvanceOrder(input) | dealer:orders:write | One step of the order's machine, named by the record's nextSteps. See The order's machine. |
Webhooks / RegisterWebhook / VerifyWebhook / RemoveWebhook | dealer:webhooks:manage | The endpoints the organization registered, and their lifecycle. See Webhooks. |
Workload / RegisterDocument / SetDocumentMode | any | The client's registered documents and mode. See Registered documents. |
Custodian
| Operation | Scope | What it answers |
|---|---|---|
CustodianOrdersFeed(first, after) | custodian:orders:read | The orders the custodian holds the account for, newest first, as the custodian may read them: standing, funding instructions, delivery evidence, the authorization and its lock snapshot. |
CustodianOrder(id) | custodian:orders:read | One such order by its global id. |
A custodian's record is a different type from the dealer's, CustodianOrder, with the custodian's facts (what to pay, to where, by when; what evidence of delivery exists) and none of the dealer's economics beyond the all-in and its split.
The order record
Every dealer operation that returns an order returns the same fragment, OrderRecord: identity and reference, status and settlementStep, nextDeadlineAt, the depository and budget, the lines with their indicative and locked unit prices, and one object per stage of the life it has reached, direction, lock, funding, release, delivery, cancellation, each null until it has. nextSteps names the steps that are legal right now.
query OrderStatus($id: ID!) {
node(id: $id) {
... on Order {
...OrderRecord
}
}
}Pagination
Every list of nodes is a Relay connection: first and after forward, last and before back, pageInfo { hasNextPage endCursor }, totalCount. Pass first explicitly; the default budget assumes 50 where you do not say (see Budgets).
Reading the schema
The full SDL is on the Schema page, and __schema introspection works on sandbox for an explorer. Types are nullable where a read can be refused at that field, so a scope the token lacks nulls the field and names itself in errors while the rest of the document answers.
SDK
@athanor-trade/sdk: the published operations typed from the schema, and a client that authenticates, sends documents by hash, and reads refusals as typed errors.
The order's machine
Draft an order, then advance it one step at a time. The record names the steps that are legal right now, and a refusal names what it was waiting for.