Package Reference
Current SDK accessors, packages, and important compatibility notes.
The lists below describe the public high-level classes in v3.3.1. Methods that return transactions generally return a Sui Transaction; methods that fetch a service txKind object may return { tx, ...metadata }.
Pools
sdk.Pools() exposes:
getPool, getPools, getAllPools, getOwnedLpCoins,
getPublishLpCoinTransaction, getCreatePoolTransaction,
getPoolObjectIdForLpCoinType, getPoolObjectIdsForLpCoinTypes,
isLpCoinType, getTotalVolume24hrs, getTVL, getPoolsStats,
getPoolSummaries, getOwnedDaoFeePoolOwnerCaps, getInteractionEventsgetAllPools(signal?), getPoolsStats(inputs, signal?), and getPoolSummaries(inputs?, signal?) support the final abort signal. The summary route returns { pool, stats } entries and is the typed wrapper for POST /api/pools/summary. A Pool object additionally provides deposit, withdraw, all-coin-withdraw, trade, DAO fee update/recipient, stats, time-series data, interaction events, and local AMM calculation helpers.
Farms
sdk.Farms() exposes:
getStakingPool, getStakingPools, getAllStakingPools,
getOwnedStakedPositions, getOwnedStakingPoolOwnerCaps,
getOwnedStakingPoolOneTimeAdminCaps, getTVL, getRewardsTVL,
getFarmSummaries, getCreateStakingPoolTransactionV1,
getCreateStakingPoolTransactionV2, getInteractionEventsgetAllStakingPools(signal?), getTVL(inputs?, signal?), getRewardsTVL(inputs?, signal?), and getFarmSummaries(inputs?, signal?) support abort signals. getFarmSummaries maps to POST /api/farms/summary and returns { farmId, tvl, rewardsTvl }. FarmsStakingPool and FarmsStakedPosition wrappers contain V1/V2 local state helpers plus stake, deposit-principal, withdraw, lock, unlock, renew, harvest, reward-emission, min-stake, and admin transaction builders.
Staking
sdk.Staking() exposes:
It also exposes Staking.calcAtomicUnstakeFee. Validator and staking transaction routes are documented in ../../api/rest-api/staking.md.
Perpetuals
sdk.Perpetuals() exposes the market, account, vault, builder-code, rebate, and WebSocket surface summarized in Perpetuals, including:
getVaultsConfig(abortSignal?) posts {} to POST /api/perpetuals/vaults/config and returns dynamic protocol limits. Integer fields decode to bigint; the removed hardcoded PerpetualsVault.constants are not current configuration.
DCA and limit orders
sdk.Dca() exposes:
sdk.LimitOrders() exposes:
Read SDK/API Compatibility and ../../api/rest-api/dca-and-limit-orders.md before calling signed methods. The current service requires a fixed reusable terms signature and plain orderObjectIds. v3.3.1 types carry the current cancellation IDs; use UserData.createTermsAndConditionsMessage() for the reusable terms bytes. Deprecated *MessageToSign helpers still describe old action-specific messages.
Rewards and referrals
sdk.Rewards() exposes:
getExpectedRewards calls the current kebab-case expected-rewards route. getPoints and getHistory require the service's current terms auth when called against the current API; claim and expected-rewards have their own request shapes.
sdk.Referrals() exposes:
The last two message builders are deprecated action helpers, not the current service signature payload. v3.3.1 sends refCode as a plain field; use the fixed terms bytes and UserData.createTermsAndConditionsMessage(). The service may default the custom code when createReferralLink omits it. sdk.ReferralVault() is deprecated and only exposes getReferrer; use Referrals for the current HTTP referral program.
Gas and dynamic gas
sdk.GasPools() exposes:
getSponsoredTransaction returns { transaction, sponsorSignature, digest } and its current service body also accepts optional MIST gasBudget. The SDK v3.3.1 GasPools still omits that field in its sponsor type and its comments describe the old SPONSOR_GAS JSON/date message; use the compatibility reference.
sdk.DynamicGas() exposes getUseDynamicGasForTx, for POST /api/dynamic-gas non-SUI gas sponsorship.
Router
sdk.Router() exposes:
The current production API exposes POST /api/router/trade-route, POST /api/router/transactions/add-trade, and GET /api/router/supported-coins; getSupportedCoins calls the last of these and works against the current service. POST /api/router/transactions/trade also responds in production but has no documented schema and no SDK method. getVolume24hrs, searchSupportedCoins, and getInteractionEvents require an API deployment that still serves the legacy router routes.
Coin, prices, wallet, and Sui
sdk.Coin(coinType?) exposes:
getCoinsToDecimals, getCoinMetadata, and getCoinMetadatas support a final abort signal where declared. Static helpers cover coin type parsing, normalization, filtering, and decimal/price balance calculations.
sdk.Prices() exposes getCoinPriceInfo, getCoinsToPriceInfo, getCoinPrice, and getCoinsToPrice; each current read accepts an optional final AbortSignal.
sdk.Wallet(address) exposes getBalance, getBalances, getAllBalances, and getPastTransactions. The low-level AftermathApi.Wallet() exposes fetchCoinBalance, fetchAllCoinBalances, and fetchPastTransactions.
getBalances and getAllBalances read the service routes (coin-balances, all-coin-balances), and those totals include a SIP-58 address balance, not only owned Coin objects. Treat any guidance that says they sum owned coins alone as stale.
Coin sourcing and address balances
AftermathApi.Coin().fetchCoinWithAmountTx takes two different paths, and the difference is load-bearing when a wallet holds funds in a SIP-58 address balance:
Unsponsored: the amount is sourced with
coinWithBalance, which can draw from the address balance as well as owned coin objects. Spendability is checked against the wallet's total balance.Sponsored (
isSponsoredTx: true): the amount is built from owned coin objects only, merged and split with raw commands sotx.gas(the sponsor's coin) is untouched. A wallet whose funds sit entirely in its address balance therefore cannot fund a sponsored transaction this way.
That sponsored coin-selector limitation is not a Router restriction. An integrator may first materialize a SIP-58 address balance with a wallet-authored withdrawal and coin::redeem_funds, merge it with owned coin objects when needed, and pass the resulting Coin<T> as coinInId to Router transactions/add-trade. Router composition and legacy Dynamic Gas reimbursement discovery are separate boundaries.
fetchCoinsWithAtLeastAmount stops paginating as soon as the selected coins cover the requested amount, and gives up after 50 pages with wallet balance is spread across too many coin objects. Dust-heavy wallets that previously spent minutes in transaction building now fail fast or succeed early.
sdk.Sui() exposes getSystemState. AftermathApi.Sui() is the lower-level provider and also exposes fetchSystemState; the latter is one of the legacy JSON-RPC helpers. Current API utility routes include /api/sui/epoch and /api/sui/system-state, but the high-level SDK Sui provider reads the fullnode surface rather than those service routes.
Auth and user data
sdk.Auth() exposes init and adminCreateAuthAccount. init signs the auth service's serialized GetAccessToken payload and refreshes the bearer token until the returned stop function is called. This is distinct from the reusable terms signature used by service endpoints.
sdk.UserData() exposes:
UserData.termsAndConditionsMessage is the same canonical string returned by createTermsAndConditionsMessage().
The service's save-public-key endpoint has its own bytes/signature protocol. Use createTermsAndConditionsMessage() for the canonical reusable terms string/bytes for service routes. The deprecated createSignTermsAndConditionsMessageToSign helper returns an action object and is not the production API's reusable terms payload.
Faucet, multisig, NFT AMM, and SuiFrens
An NftAmmMarket provides getNfts, buy/sell/deposit/withdraw transaction builders, and local amount/spot-price calculations.
sdk.SuiFrens() exposes getSuiFren, getSuiFrens, getOwnedSuiFrens, getOwnedStakedSuiFrens, getAllStakedSuiFrens, getStakedSuiFrens, getCapyLabsApp, getOwnedAccessories, event readers (getHarvestFeesEvents, getMixEvents, getStakeEvents, getUnstakeEvents), getMixTransaction, getHarvestFeesTransaction, and getStats. Its SuiFren/StakedSuiFren wrappers provide accessory, stake/unstake, mix, harvest, and accessory transaction helpers.
Low-level AftermathApi helpers
AftermathApi creates DynamicFields, Events, Inspections, Objects, Transactions, Wallet, Nfts, Coin, Sui, Pools, Faucet, SuiFrens, Staking, NftAmm, ReferralVault, Perpetuals, Farms, Dca, Multisig, LimitOrders, and Router providers. It also exposes translateMoveErrorMessage and requireJsonRpcClient.
The general helpers include object existence/ownership/typed-object reads, BCS reads, dynamic-field pagination, event pagination/casting, transaction parsing/building, inspection bytes, wallet reads, and NFT/Kiosk reads. Read the corresponding src/general/apiHelpers/* file when working below the high-level provider boundary; do not infer gRPC object shapes from old JSON-RPC content.fields examples.
Last updated