SDK/API Compatibility
Known differences between the TypeScript SDK and the current API service.
Compare your installed SDK version with the production API before assuming a typed SDK method is a working service call:
SDK reference:
aftermath-ts-sdkv3.3.1.Production OpenAPI snapshot (August 19, 2026): 260 operations across 257 paths;
/api/poolsintentionally has both GET (deprecated) and POST (current).
Current service changes that affect SDK callers
Reusable terms authentication
The service verifies that the base64-decoded bytes are exactly:
Aftermath Terms and ConditionsThe wallet signs the decoded UTF-8 bytes; send the base64 representation in bytes and the wallet signature in signature. Sign once per wallet connection and reuse the pair. Route-specific values are plain request fields, not part of the signed message.
This affects service routes for DCA cancellation, limit-order active/cancel requests, gas-pool sponsorship, referral ref-code/linked-ref-code/link/create actions, rewards history/points, optional perpetuals order/collateral history authentication, perpetuals account/vault TWAP and stop-order reads, and authenticated user WebSocket stop-order subscriptions. UserData.save-public-key and the auth access-token endpoints retain their own message protocols; do not apply the terms message to them.
The v3.3.1 SDK still exposes deprecated action-message builders such as Dca.closeDcaOrdersMessageToSign, LimitOrders.cancelLimitOrdersMessageToSign, Referrals.createReferralLinkMessageToSign, Referrals.setReferrerMessageToSign, and UserData.createSignTermsAndConditionsMessageToSign; gas-pool comments also mention the obsolete SPONSOR_GAS JSON/date payload. Do not pass those action objects to the current service. Use UserData.createTermsAndConditionsMessage() or sign the exact reusable terms bytes directly.
For DCA and limit-order cancellation, send the IDs as plain fields:
{
"walletAddress": "0x...",
"bytes": "<base64 of Aftermath Terms and Conditions>",
"signature": "<signature over decoded bytes>",
"orderObjectIds": ["0x...", "0x..."]
}Current API additions and SDK status
GET /api/addresses
Aftermath.getAddresses() uses it during bootstrap.
GET /api/perpetuals/config
No high-level SDK accessor in v3.3.1; call the API directly when network defaults/official vault IDs are needed.
POST /api/perpetuals/vaults/config
Perpetuals.getVaultsConfig(abortSignal?); sends {} and returns dynamic PerpetualsVaultsConfig with bigint integer fields.
POST /api/perpetuals/vault/transactions/owner/grant-agent-wallet
Perpetuals.getGrantVaultAgentWalletTx({ vaultId, recipientAddress, sponsor?, tx? }) or PerpetualsVault.getGrantAgentWalletTx({ recipientAddress, sponsor?, tx? }); submit from the vault owner's ADMIN capability.
POST /api/perpetuals/vault/transactions/owner/revoke-agent-wallet
Perpetuals.getRevokeVaultAgentWalletTx({ vaultId, accountCapId, sponsor?, tx? }) or PerpetualsVault.getRevokeAgentWalletTx({ accountCapId, sponsor?, tx? }).
POST /api/pools/summary
Pools.getPoolSummaries(inputs?, signal?); response entries are { pool, stats }.
POST /api/farms/summary
Farms.getFarmSummaries(inputs?, signal?); response entries are { farmId, tvl, rewardsTvl }.
POST /api/rewards/expected-rewards
Rewards.getExpectedRewards was fixed in 2.2.1 to use the kebab-case path.
POST /api/perpetuals/rebates/create-referral-csv-rebates
Perpetuals.getReferralCsvRebates is present.
/api/ccxt/build/* address-balance options
Raw API supports metadata.gasFromAddressBalance, deposit fromAddressBalance, and withdraw toAddressBalance; verify SDK types before relying on them.
Gas-pool/perps gasBudget
Current service accepts optional MIST gasBudget; v3.3.1 ApiGasPoolSponsorBody and PerpetualsSponsorConfig types still do not expose it. Extend the raw request type when using an exact budget.
POST /api/zklogin/create
Current service is a plain TS-helper proxy: use jwt, maxEpoch, base64 ephemeralPublicKey, and randomness. Do not send an ephemeral private keypair.
Known stale SDK calls
These methods exist in the SDK source but do not correspond to current production operations or current request shapes:
Dca.getAllDcaOrderscallsdca/orders; current service exposesactive,past,cancel,transactions/create-order, plus deprecateduser/addanduser/get.GasPools.getSponsoredTransactionstill carries stale action/dateSPONSOR_GAScomments and its type omits optionalgasBudget;PerpetualsSponsorConfiguses the terms message but still omits that field. Send the reusable terms bytes and extend the body when an exact MIST budget is needed.Perpetuals.getCreateBuilderCodeIntegratorVaultTx,getClaimBuilderCodeIntegratorVaultFeesTx, andgetBuilderCodeIntegratorVaultscall removed integrator-vault routes. The current service uses one-time global integrator registration and integrator-config routes.Several
Routerhelpers (getVolume24hrs,searchSupportedCoins,getInteractionEvents) call legacy router paths; verify a different backend before using them.Router.getSupportedCoinsis not one of them: its path,GET /api/router/supported-coins, is live in production even though it is absent from the OpenAPI declaration.Perpetuals.openMarketCandlesWebsocketStreamhas stale JSDoc describing the removed dedicated candles path, but its implementation correctly subscribes tows/updateswithmarketCandles. Use the implementation/current API contract, not that comment.
Correctly aligned SDK additions
Pools.getPoolSummariesandFarms.getFarmSummariesare typed batch reads; both accept a finalAbortSignaland map to the new summary routes.Rewards.getExpectedRewardsusesexpected-rewards, not camelCase.Perpetuals SDK order, scale-order, TWAP, vault, and general-WebSocket paths use the current kebab-case route names. Still apply the terms-auth caveat to stop-order/TWAP reads and optional authenticated histories.
Aftermath.createand the v3.3.1 transport changes are additive and belong to the SDK; they do not change raw API wire formats.Perpetuals.getVaultsConfig(abortSignal?)posts an empty JSON object to/api/perpetuals/vaults/configand returns deployment-driven limits; integer fields decode tobigint. The removedPerpetualsVault.constantsis not a valid source of current limits.
Reconciliation workflow
Inspect the SDK method's
fetchApipath and input type.Check the matching route in the service source/OpenAPI operation.
Compare camelCase names,
"...n"BigInt fields, signed-auth requirements, and whether the response is bare, wrapped, or atxKindobject.If the method calls an absent/removed route, use the current raw endpoint or mark the SDK method unsupported; do not send the old payload to the service.
Last updated