Class: SpotClient
REST client for Kraken Spot market data, trading and account operations.
Extends
BaseRestClient
Constructors
Constructor
new SpotClient(restClientOptions?: RestClientOptions, networkOptions?: AxiosRequestConfig): SpotClient;Create an instance of the REST client. Pass API credentials in the object in the first parameter.
Parameters
| Parameter | Type | Description |
|---|---|---|
restClientOptions? | RestClientOptions | options to configure REST API connectivity |
networkOptions? | AxiosRequestConfig | HTTP networking options for axios |
Returns
SpotClient
Inherited from
BaseRestClient.constructor
Methods
allocateEarnFunds()
allocateEarnFunds(params: object): Promise<SpotAPISuccessResponse<boolean>>;Allocate funds to an Earn strategy. The operation is asynchronous; poll getEarnAllocationStatus() with the same strategy_id to check completion.
Parameters
| Parameter | Type |
|---|---|
params | { amount: string; strategy_id: string; } |
params.amount | string |
params.strategy_id | string |
Returns
Promise<SpotAPISuccessResponse<boolean>>
amendOrder()
amendOrder(params: SpotAmendOrderParams): Promise<SpotAPISuccessResponse<{
amend_id: string;
}>>;Amend Order
Amend an existing order. The order identifiers assigned by Kraken and/or client will stay the same. Queue priority in the order book will be maintained where possible.
Parameters
| Parameter | Type |
|---|---|
params | SpotAmendOrderParams |
Returns
Promise<SpotAPISuccessResponse<{ amend_id: string; }>>
cancelAllOrders()
cancelAllOrders(): Promise<SpotAPISuccessResponse<{
count: number;
pending: boolean;
}>>;Cancel All Orders
Cancel all open orders.
Returns
Promise<SpotAPISuccessResponse<{ count: number; pending: boolean; }>>
cancelAllOrdersAfter()
cancelAllOrdersAfter(params: object): Promise<SpotAPISuccessResponse<{
currentTime: string;
triggerTime: string;
}>>;Cancel All Orders After X
CancelAllOrdersAfter provides a "Dead Man's Switch" mechanism to protect the client from network malfunction, extreme latency or unexpected matching engine downtime. The client can send a request with a timeout (in seconds), that will start a countdown timer which will cancel all client orders when the timer expires.
Parameters
| Parameter | Type |
|---|---|
params | { timeout: number; } |
params.timeout | number |
Returns
Promise<SpotAPISuccessResponse<{ currentTime: string; triggerTime: string; }>>
cancelBatchOrders()
cancelBatchOrders(params: object): Promise<SpotAPISuccessResponse<{
count: number;
}>>;Cancel Order Batch
Cancel multiple open orders by txid, userref or cl_ord_id (maximum 50 total unique IDs/references).
Parameters
| Parameter | Type |
|---|---|
params | { cl_ord_ids?: string[]; orders?: (string | number)[]; } |
params.cl_ord_ids? | string[] |
params.orders? | (string | number)[] |
Returns
Promise<SpotAPISuccessResponse<{ count: number; }>>
cancelOrder()
cancelOrder(params: object): Promise<SpotAPISuccessResponse<{
count: number;
pending?: boolean;
}>>;Cancel Order
Cancel a particular open order (or set of open orders) by txid, userref or cl_ord_id.
Parameters
| Parameter | Type |
|---|---|
params | { cl_ord_id?: string; txid?: string | number; } |
params.cl_ord_id? | string |
params.txid? | string | number |
Returns
Promise<SpotAPISuccessResponse<{ count: number; pending?: boolean; }>>
cancelStrategy()
cancelStrategy(params: object): Promise<SpotAPISuccessResponse<{
strategy_id: string;
}>>;Cancel Strategy
Cancel a pending or open strategy. Use queryStrategies() for the final status and fills.
Parameters
| Parameter | Type |
|---|---|
params | { strategy_id: string; } |
params.strategy_id | string |
Returns
Promise<SpotAPISuccessResponse<{ strategy_id: string; }>>
cancelWithdrawal()
cancelWithdrawal(params: object): Promise<SpotAPISuccessResponse<boolean>>;Request Withdrawal Cancellation
Cancel a recently requested withdrawal, if it has not already been successfully processed.
Parameters
| Parameter | Type |
|---|---|
params | { asset: string; refid: string; } |
params.asset | string |
params.refid | string |
Returns
Promise<SpotAPISuccessResponse<boolean>>
createOAuthFastApiKey()
createOAuthFastApiKey(params: OauthCreateFastApiKeyParams): Promise<OauthCreateFastApiKeyResponse>;Create a Fast API key. The archived OAuth contract requires an OAuth2 Bearer token with the account.fast-api-key:write scope.
Parameters
| Parameter | Type |
|---|---|
params | OauthCreateFastApiKeyParams |
Returns
Promise<OauthCreateFastApiKeyResponse>
createSubaccount()
createSubaccount(params: object): Promise<SpotAPISuccessResponse<boolean>>;Create Subaccount
Create a trading subaccount. Note: CreateSubaccount must be called using an API key from the master account.
Parameters
| Parameter | Type |
|---|---|
params | { email: string; username: string; } |
params.email | string |
params.username | string |
Returns
Promise<SpotAPISuccessResponse<boolean>>
deallocateEarnFunds()
deallocateEarnFunds(params: object): Promise<SpotAPISuccessResponse<boolean>>;Deallocate funds from an Earn strategy. The operation is asynchronous; poll getEarnDeallocationStatus() with the same strategy_id to check completion.
Parameters
| Parameter | Type |
|---|---|
params | { amount: string; strategy_id: string; } |
params.amount | string |
params.strategy_id | string |
Returns
Promise<SpotAPISuccessResponse<boolean>>
deleteLedgersExport()
deleteLedgersExport(params: object): Promise<SpotAPISuccessResponse<SpotDeleteExportReportResponse>>;Delete Export Report
Delete or cancel exported trades/ledgers report.
Parameters
| Parameter | Type |
|---|---|
params | { id: string; type: "delete" | "cancel"; } |
params.id | string |
params.type | "delete" | "cancel" |
Returns
Promise<SpotAPISuccessResponse<SpotDeleteExportReportResponse>>
deleteOAuthFastApiKey()
deleteOAuthFastApiKey(params: object): Promise<{
result: boolean;
}>;Delete a Fast API key. The archived OAuth contract requires an OAuth2 Bearer token with the account.fast-api-key:write scope.
Parameters
| Parameter | Type |
|---|---|
params | { api_key_name: string; } |
params.api_key_name | string |
Returns
Promise<{ result: boolean; }>
generateNewOrderID()
generateNewOrderID(): string;Misc Utility Methods
Returns
string
getAccountBalance()
getAccountBalance(params?: SpotGetAccountBalanceParams): Promise<SpotAPISuccessResponse<SpotAccountBalance>>;Get Account Balance
Retrieve all cash balances, net of pending withdrawals. Pass account_id to retrieve balances for a specific wallet.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetAccountBalanceParams |
Returns
Promise<SpotAPISuccessResponse<SpotAccountBalance>>
Example
import { SpotClient } from '@siebly/kraken-api';
async function main() {
const apiKey = process.env.KRAKEN_API_KEY;
const apiSecret = process.env.KRAKEN_API_SECRET;
if (!apiKey || !apiSecret) {
throw new Error('Set KRAKEN_API_KEY and KRAKEN_API_SECRET.');
}
const client = new SpotClient({ apiKey, apiSecret });
const response = await client.getAccountBalance();
console.log('Account access verified.');
console.log('Returned asset balances:', Object.keys(response.result).length);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});See
getApiKeyInfo()
getApiKeyInfo(params?: SpotGetApiKeyInfoParams): Promise<SpotAPISuccessResponse<SpotApiKeyInfo>>;Get API Key Info
Retrieve configuration and usage details for the API key used in the request.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetApiKeyInfoParams |
Returns
Promise<SpotAPISuccessResponse<SpotApiKeyInfo>>
getAssetInfo()
getAssetInfo(params?: object): Promise<SpotAPISuccessResponse<Record<string, SpotAssetInfo>>>;Get Asset Info
Get information about the assets that are available for deposit, withdrawal, trading and earn.
Parameters
| Parameter | Type |
|---|---|
params? | { aclass?: "currency" | "tokenized_asset"; asset?: string; } |
params.aclass? | "currency" | "tokenized_asset" |
params.asset? | string |
Returns
Promise<SpotAPISuccessResponse<Record<string, SpotAssetInfo>>>
getAssetPairs()
getAssetPairs(params?: SpotGetAssetPairsParams): Promise<SpotAPISuccessResponse<Record<string, SpotAssetPair>>>;Get Tradable Asset Pairs
Get tradable asset pairs
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetAssetPairsParams |
Returns
Promise<SpotAPISuccessResponse<Record<string, SpotAssetPair>>>
getCandles()
getCandles(params: SpotGetOHLCParams): Promise<SpotAPISuccessResponse<SpotOHLCResponse>>;Get OHLC Data
Retrieve OHLC market data. The last entry in the OHLC array is for the current, not-yet-committed timeframe, and will always be present, regardless of the value of since. Returns up to 720 of the most recent entries (older data cannot be retrieved, regardless of the value of since).
Parameters
| Parameter | Type |
|---|---|
params | SpotGetOHLCParams |
Returns
Promise<SpotAPISuccessResponse<SpotOHLCResponse>>
getClientType()
getClientType(): RestClientType;Defines the client type (affecting how requests & signatures behave)
Returns
RestClientType
Overrides
BaseRestClient.getClientType
getClosedOrders()
getClosedOrders(params?: SpotGetClosedOrdersParams): Promise<SpotAPISuccessResponse<SpotClosedOrdersResponse>>;Get Closed Orders
Retrieve information about orders that have been closed (filled or cancelled). 50 results are returned at a time, the most recent by default.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetClosedOrdersParams |
Returns
Promise<SpotAPISuccessResponse<SpotClosedOrdersResponse>>
getClosedStrategies()
getClosedStrategies(params?: SpotGetClosedStrategiesParams): Promise<SpotAPISuccessResponse<SpotClosedStrategiesResponse>>;Get Closed Strategies
Get terminal strategies with cursor pagination (limit 1-100, default 100). Repeat the original filters with next_cursor as cursor. No ofs or count is supported.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetClosedStrategiesParams |
Returns
Promise<SpotAPISuccessResponse<SpotClosedStrategiesResponse>>
getCreditLines()
getCreditLines(params?: object): Promise<SpotAPISuccessResponse<SpotCreditLines | null>>;Get Credit Lines
Retrieve all credit line details for VIPs with this functionality.
Parameters
| Parameter | Type |
|---|---|
params? | { account_id?: string; rebase_multiplier?: "base" | "rebased"; } |
params.account_id? | string |
params.rebase_multiplier? | "base" | "rebased" |
Returns
Promise<SpotAPISuccessResponse<SpotCreditLines | null>>
getDepositAddresses()
getDepositAddresses(params: SpotGetDepositAddressesParams): Promise<SpotAPISuccessResponse<SpotDepositAddress[]>>;Retrieve deposit addresses for an asset and funding method, or generate a new address.
Parameters
| Parameter | Type |
|---|---|
params | SpotGetDepositAddressesParams |
Returns
Promise<SpotAPISuccessResponse<SpotDepositAddress[]>>
getDepositMethods()
getDepositMethods(params: SpotGetDepositMethodsParams): Promise<SpotAPISuccessResponse<SpotDepositMethod[]>>;Get Deposit Methods
Retrieve methods available for depositing a particular asset.
Parameters
| Parameter | Type |
|---|---|
params | SpotGetDepositMethodsParams |
Returns
Promise<SpotAPISuccessResponse<SpotDepositMethod[]>>
getDepositsStatus()
getDepositsStatus(params?: SpotGetDepositStatusParams): Promise<SpotAPISuccessResponse<SpotDepositStatusResponse>>;Get Status of Recent Deposits
Retrieve information about recent deposits. Results are sorted by recency.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetDepositStatusParams |
Returns
Promise<SpotAPISuccessResponse<SpotDepositStatusResponse>>
getEarnAllocations()
getEarnAllocations(params?: SpotListEarnAllocationsParams): Promise<SpotAPISuccessResponse<SpotListEarnAllocationsResponse>>;List Earn Allocations
List all allocations for the user. By default all allocations are returned, even for strategies that have been used in the past and have zero balance now.
Parameters
| Parameter | Type |
|---|---|
params? | SpotListEarnAllocationsParams |
Returns
Promise<SpotAPISuccessResponse<SpotListEarnAllocationsResponse>>
getEarnAllocationStatus()
getEarnAllocationStatus(params: object): Promise<SpotAPISuccessResponse<{
pending: boolean;
}>>;Get Allocation Status
Get the status of the last allocation request.
Parameters
| Parameter | Type |
|---|---|
params | { strategy_id: string; } |
params.strategy_id | string |
Returns
Promise<SpotAPISuccessResponse<{ pending: boolean; }>>
getEarnDeallocationStatus()
getEarnDeallocationStatus(params: object): Promise<SpotAPISuccessResponse<{
pending: boolean;
}>>;Get Deallocation Status
Get the status of the last deallocation request.
Parameters
| Parameter | Type |
|---|---|
params | { strategy_id: string; } |
params.strategy_id | string |
Returns
Promise<SpotAPISuccessResponse<{ pending: boolean; }>>
getEarnStrategies()
getEarnStrategies(params?: SpotListEarnStrategiesParams): Promise<SpotAPISuccessResponse<{
items: SpotEarnStrategy[];
next_cursor?: string;
}>>;List Earn Strategies
List earn strategies along with their parameters. Returns only strategies that are available to the user based on geographic region.
Parameters
| Parameter | Type |
|---|---|
params? | SpotListEarnStrategiesParams |
Returns
Promise<SpotAPISuccessResponse<{ items: SpotEarnStrategy[]; next_cursor?: string; }>>
getExtendedBalance()
getExtendedBalance(params?: object): Promise<SpotAPISuccessResponse<SpotExtendedBalance>>;Get Extended Balance
Retrieve all extended account balances, including credits and held amounts. Balance available for trading is calculated as: available balance = balance + credit - credit_used - hold_trade
Parameters
| Parameter | Type |
|---|---|
params? | { account_id?: string; rebase_multiplier?: "base" | "rebased"; } |
params.account_id? | string |
params.rebase_multiplier? | "base" | "rebased" |
Returns
Promise<SpotAPISuccessResponse<SpotExtendedBalance>>
getGroupedBook()
getGroupedBook(params: SpotGetGroupedBookParams): Promise<SpotAPISuccessResponse<SpotGroupedBookResponse>>;Get Grouped Order Book
Aggregates order book volume over a configurable tick grouping.
Parameters
| Parameter | Type |
|---|---|
params | SpotGetGroupedBookParams |
Returns
Promise<SpotAPISuccessResponse<SpotGroupedBookResponse>>
getLedgers()
getLedgers(params: SpotQueryLedgersParams): Promise<SpotAPISuccessResponse<SpotQueryLedgersResponse>>;Query Ledgers
Retrieve information about specific ledger entries.
Parameters
| Parameter | Type |
|---|---|
params | SpotQueryLedgersParams |
Returns
Promise<SpotAPISuccessResponse<SpotQueryLedgersResponse>>
getLedgersExport()
getLedgersExport(params: object): Promise<any>;Retrieve a processed data export as a ZIP archive. Configure the REST client’s Axios network options with a binary responseType to preserve the original archive bytes.
Parameters
| Parameter | Type |
|---|---|
params | { id: string; } |
params.id | string |
Returns
Promise<any>
getLedgersExportStatus()
getLedgersExportStatus(params: object): Promise<SpotAPISuccessResponse<SpotExportReportStatus[]>>;Get Export Report Status
Get status of requested data exports.
Parameters
| Parameter | Type |
|---|---|
params | { report: "trades" | "ledgers"; } |
params.report | "trades" | "ledgers" |
Returns
Promise<SpotAPISuccessResponse<SpotExportReportStatus[]>>
getLedgersInfo()
getLedgersInfo(params?: SpotGetLedgersInfoParams): Promise<SpotAPISuccessResponse<SpotLedgersInfoResponse>>;Get Ledgers Info
Retrieve information about ledger entries. 50 results are returned at a time, the most recent by default. Pass account_id to retrieve ledger entries for a specific wallet.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetLedgersInfoParams |
Returns
Promise<SpotAPISuccessResponse<SpotLedgersInfoResponse>>
getLevel3OrderBook()
getLevel3OrderBook(params: SpotGetLevel3Params): Promise<SpotAPISuccessResponse<SpotLevel3OrderBookResponse>>;Get Level 3 Order Book
Individual order-level book data. Requires authentication.
Parameters
| Parameter | Type |
|---|---|
params | SpotGetLevel3Params |
Returns
Promise<SpotAPISuccessResponse<SpotLevel3OrderBookResponse>>
getMaintenanceSchedule()
getMaintenanceSchedule(): Promise<SpotAPISuccessResponse<SpotMaintenanceSchedule>>;Get Maintenance Schedule
Get all scheduled maintenance events in the next 7-day window.
Returns
Promise<SpotAPISuccessResponse<SpotMaintenanceSchedule>>
getOAuthAccessToken()
getOAuthAccessToken(params: OauthGetAccessTokenParams): Promise<OauthGetAccessTokenResponse>;Request an OAuth access token through POST /oauth/token.
Parameters
| Parameter | Type |
|---|---|
params | OauthGetAccessTokenParams |
Returns
Promise<OauthGetAccessTokenResponse>
getOAuthUserInfo()
getOAuthUserInfo(): Promise<OauthGetUserInfoResponse>;Retrieve the user’s email address and IIBAN. The archived OAuth contract requires an OAuth2 Bearer token with the account.info:basic scope.
Returns
Promise<OauthGetUserInfoResponse>
getOpenOrders()
getOpenOrders(params?: SpotGetOpenOrdersParams): Promise<SpotAPISuccessResponse<SpotOpenOrdersResponse>>;Get Open Orders
Retrieve information about currently open orders.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetOpenOrdersParams |
Returns
Promise<SpotAPISuccessResponse<SpotOpenOrdersResponse>>
getOpenPositions()
getOpenPositions(params?: SpotGetOpenPositionsParams): Promise<SpotAPISuccessResponse<SpotOpenPositionsResult>>;Get Open Positions
Get information about open margin positions.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetOpenPositionsParams |
Returns
Promise<SpotAPISuccessResponse<SpotOpenPositionsResult>>
getOpenStrategies()
getOpenStrategies(params?: object): Promise<SpotAPISuccessResponse<{
open: Record<string, SpotAlgoStrategy>;
}>>;Get Open Strategies
Get pending and open strategies keyed by strategy ID.
Parameters
| Parameter | Type |
|---|---|
params? | { strategy_type?: "twap"; } |
params.strategy_type? | "twap" |
Returns
Promise<SpotAPISuccessResponse<{ open: Record<string, SpotAlgoStrategy>; }>>
getOrderAmends()
getOrderAmends(params: object): Promise<SpotAPISuccessResponse<SpotOrderAmendsResponse>>;Get Order Amends
Retrieves an audit trail of amend transactions on the specified order. The list is ordered by ascending amend timestamp.
Parameters
| Parameter | Type |
|---|---|
params | { account_id?: string; order_id: string; rebase_multiplier?: "base" | "rebased"; } |
params.account_id? | string |
params.order_id | string |
params.rebase_multiplier? | "base" | "rebased" |
Returns
Promise<SpotAPISuccessResponse<SpotOrderAmendsResponse>>
getOrderBook()
getOrderBook(params: SpotGetOrderBookParams): Promise<SpotAPISuccessResponse<SpotOrderBookResponse>>;Get Order Book
Returns level 2 (L2) order book, which describes the individual price levels in the book with aggregated order quantities at each level.
Parameters
| Parameter | Type |
|---|---|
params | SpotGetOrderBookParams |
Returns
Promise<SpotAPISuccessResponse<SpotOrderBookResponse>>
Example
import { SpotClient } from '@siebly/kraken-api';
async function main() {
const client = new SpotClient();
const response = await client.getOrderBook({ pair: 'XBTUSD', count: 10 });
for (const [pair, book] of Object.entries(response.result)) {
console.log(pair, { bids: book.bids, asks: book.asks });
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});See
getOrders()
getOrders(params: SpotQueryOrdersParams): Promise<SpotAPISuccessResponse<SpotQueryOrdersResponse>>;Query Orders Info
Retrieve information about specific orders.
Parameters
| Parameter | Type |
|---|---|
params | SpotQueryOrdersParams |
Returns
Promise<SpotAPISuccessResponse<SpotQueryOrdersResponse>>
getPostTradeData()
getPostTradeData(params?: SpotGetPostTradeDataParams): Promise<SpotAPISuccessResponse<SpotPostTradeDataResponse>>;Post-Trade Data
Returns a list of trades on the spot exchange. If no filter parameters are specified, the last 1000 trades for all pairs are received.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetPostTradeDataParams |
Returns
Promise<SpotAPISuccessResponse<SpotPostTradeDataResponse>>
getPreTradeData()
getPreTradeData(params: object): Promise<SpotAPISuccessResponse<SpotPreTradeData>>;Pre-Trade Data
Returns the price levels in the order book with aggregated order quantities at each price level. The top 10 levels are returned for each trading pair.
Parameters
| Parameter | Type |
|---|---|
params | { symbol: string; } |
params.symbol | string |
Returns
Promise<SpotAPISuccessResponse<SpotPreTradeData>>
getRecentSpreads()
getRecentSpreads(params: SpotGetRecentSpreadsParams): Promise<SpotAPISuccessResponse<SpotRecentSpreadsResponse>>;Get Recent Spreads
Returns the last ~200 top-of-book spreads for a given pair
Parameters
| Parameter | Type |
|---|---|
params | SpotGetRecentSpreadsParams |
Returns
Promise<SpotAPISuccessResponse<SpotRecentSpreadsResponse>>
getRecentTrades()
getRecentTrades(params: SpotGetRecentTradesParams): Promise<SpotAPISuccessResponse<SpotRecentTradesResponse>>;Get Recent Trades
Returns the last 1000 trades by default
Parameters
| Parameter | Type |
|---|---|
params | SpotGetRecentTradesParams |
Returns
Promise<SpotAPISuccessResponse<SpotRecentTradesResponse>>
getServerTime()
getServerTime(): Promise<SpotAPISuccessResponse<{
rfc1123: string;
unixtime: number;
}>>;Get Server Time
Get the server's time.
Returns
Promise<SpotAPISuccessResponse<{ rfc1123: string; unixtime: number; }>>
getSystemStatus()
getSystemStatus(): Promise<SpotAPISuccessResponse<SpotSystemStatus>>;Get System Status
Get the current system status or trading mode.
Returns
Promise<SpotAPISuccessResponse<SpotSystemStatus>>
getTicker()
getTicker(params?: object): Promise<SpotAPISuccessResponse<Record<string, SpotAssetTickerInfo>>>;Get Ticker Information
Get ticker information for all or requested markets. Note: Today's prices start at midnight UTC. Leaving the pair parameter blank will return tickers for all tradeable assets on Kraken.
Parameters
| Parameter | Type |
|---|---|
params? | { asset_class?: "forex" | "tokenized_asset"; pair?: string; } |
params.asset_class? | "forex" | "tokenized_asset" |
params.pair? | string |
Returns
Promise<SpotAPISuccessResponse<Record<string, SpotAssetTickerInfo>>>
Example
import { SpotClient } from '@siebly/kraken-api';
async function main() {
const client = new SpotClient();
const response = await client.getTicker({ pair: 'XBTUSD' });
for (const [pair, ticker] of Object.entries(response.result)) {
console.log(`${pair} last price: ${ticker.c[0]}`);
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});See
getTradeBalance()
getTradeBalance(params?: object): Promise<SpotAPISuccessResponse<SpotTradeBalance>>;Get Trade Balance
Retrieve a summary of collateral balances, margin position valuations, equity and margin level.
Parameters
| Parameter | Type |
|---|---|
params? | { account_id?: string; rebase_multiplier?: "base" | "rebased"; } |
params.account_id? | string |
params.rebase_multiplier? | "base" | "rebased" |
Returns
Promise<SpotAPISuccessResponse<SpotTradeBalance>>
getTrades()
getTrades(params: SpotQueryTradesParams): Promise<SpotAPISuccessResponse<SpotQueryTradesResponse>>;Query Trades Info
Retrieve information about specific trades/fills.
Parameters
| Parameter | Type |
|---|---|
params | SpotQueryTradesParams |
Returns
Promise<SpotAPISuccessResponse<SpotQueryTradesResponse>>
getTradesHistory()
getTradesHistory(params?: SpotGetTradesHistoryParams): Promise<SpotAPISuccessResponse<SpotTradesHistoryResponse>>;Retrieve trade and fill history, most recent first by default. The default page size is 50; use limit to request 1–100 trades per page. Set with_cursor to true and pass the returned cursor.next as cursor for subsequent pages.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetTradesHistoryParams |
Returns
Promise<SpotAPISuccessResponse<SpotTradesHistoryResponse>>
getTradingVolume()
getTradingVolume(params?: SpotGetTradingVolumeParams): Promise<SpotAPISuccessResponse<SpotTradeVolume>>;Get Trade Volume
Returns 30 day USD trading volume and resulting fee schedule for any asset pair(s) provided. Also use this endpoint (with a Spot API key) to determine Futures fee rates as of 2026-06-22.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetTradingVolumeParams |
Returns
Promise<SpotAPISuccessResponse<SpotTradeVolume>>
getWalletAccounts()
getWalletAccounts(): Promise<SpotAPISuccessResponse<SpotListWalletAccountsResponse>>;List Wallet Accounts
Retrieve the wallet accounts associated with the authenticated user.
Returns
Promise<SpotAPISuccessResponse<SpotListWalletAccountsResponse>>
getWebSocketsToken()
getWebSocketsToken(): Promise<SpotAPISuccessResponse<SpotWebSocketsTokenResponse>>;Get Websockets Token
An authentication token must be requested via this REST API endpoint in order to connect to and authenticate with the Websockets API. The token should be used within 15 minutes of creation.
Returns
Promise<SpotAPISuccessResponse<SpotWebSocketsTokenResponse>>
getWithdrawalAddresses()
getWithdrawalAddresses(params?: SpotGetWithdrawalAddressesParams): Promise<SpotAPISuccessResponse<SpotWithdrawalAddress[]>>;Get Withdrawal Addresses
Retrieve a list of withdrawal addresses available for the user.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetWithdrawalAddressesParams |
Returns
Promise<SpotAPISuccessResponse<SpotWithdrawalAddress[]>>
getWithdrawalInfo()
getWithdrawalInfo(params: SpotGetWithdrawalInfoParams): Promise<SpotAPISuccessResponse<SpotWithdrawalInfo>>;Get Withdrawal Information
Retrieve fee information about potential withdrawals for a particular asset, key and amount.
Parameters
| Parameter | Type |
|---|---|
params | SpotGetWithdrawalInfoParams |
Returns
Promise<SpotAPISuccessResponse<SpotWithdrawalInfo>>
getWithdrawalMethods()
getWithdrawalMethods(params?: SpotGetWithdrawalMethodsParams): Promise<SpotAPISuccessResponse<SpotWithdrawalMethod[]>>;Get Withdrawal Methods
Retrieve a list of withdrawal methods available for the user.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetWithdrawalMethodsParams |
Returns
Promise<SpotAPISuccessResponse<SpotWithdrawalMethod[]>>
getWithdrawalsStatus()
getWithdrawalsStatus(params?: SpotGetWithdrawalsStatusParams): Promise<SpotAPISuccessResponse<SpotWithdrawalStatus[]>>;Get Status of Recent Withdrawals
Retrieve information about recent withdrawals. Results are sorted by recency.
Parameters
| Parameter | Type |
|---|---|
params? | SpotGetWithdrawalsStatusParams |
Returns
Promise<SpotAPISuccessResponse<SpotWithdrawalStatus[]>>
hasAccessToken()
hasAccessToken(): boolean;Returns
boolean
Inherited from
BaseRestClient.hasAccessToken
listOAuthFastApiKeys()
listOAuthFastApiKeys(): Promise<{
result: OauthFastApiKey[];
}>;List the user’s Fast API keys. The archived OAuth contract requires an OAuth2 Bearer token with the account.fast-api-key:read scope.
Returns
Promise<{ result: OauthFastApiKey[]; }>
queryStrategies()
queryStrategies(params: object): Promise<SpotAPISuccessResponse<{
strategies: Record<string, SpotAlgoStrategy>;
}>>;Query Strategies
Query up to 20 comma-delimited strategy IDs. Unmatched IDs are omitted.
Parameters
| Parameter | Type |
|---|---|
params | { strategy_ids: string; } |
params.strategy_ids | string |
Returns
Promise<SpotAPISuccessResponse<{ strategies: Record<string, SpotAlgoStrategy>; }>>
requestLedgersExport()
requestLedgersExport(params: SpotRequestExportReportParams): Promise<SpotAPISuccessResponse<SpotRequestExportReportResponse>>;Request Export Report
Request export of trades or ledgers.
Parameters
| Parameter | Type |
|---|---|
params | SpotRequestExportReportParams |
Returns
Promise<SpotAPISuccessResponse<SpotRequestExportReportResponse>>
setAccessToken()
setAccessToken(newAccessToken: string): void;Parameters
| Parameter | Type |
|---|---|
newAccessToken | string |
Returns
void
Inherited from
BaseRestClient.setAccessToken
submitBatchOrders()
submitBatchOrders(params: SpotSubmitOrderBatchParams): Promise<SpotAPISuccessResponse<{
orders: SpotBatchOrderResult[];
}>>;Add Order Batch
Sends a collection of orders (minimum of 2 and maximum 15). All orders in batch are limited to a single pair. Validation is performed on the whole batch prior to submission. If an order fails validation, the whole batch will be rejected.
Parameters
| Parameter | Type |
|---|---|
params | SpotSubmitOrderBatchParams |
Returns
Promise<SpotAPISuccessResponse<{ orders: SpotBatchOrderResult[]; }>>
submitOrder()
submitOrder(params: SpotSubmitOrderParams): Promise<SpotAPISuccessResponse<SpotSubmitOrderResponse>>;Add Order
Place a new order. Note: See the getAssetPairs() endpoint for details on the available trading pairs, their price and quantity precisions, order minimums, available leverage, etc.
Parameters
| Parameter | Type |
|---|---|
params | SpotSubmitOrderParams |
Returns
Promise<SpotAPISuccessResponse<SpotSubmitOrderResponse>>
See
submitStrategy()
submitStrategy(params: SpotSubmitStrategyParams): Promise<SpotAPISuccessResponse<{
strategy_id: string;
}>>;Add Strategy
Submit a TWAP strategy with a time horizon of at least 60 seconds. Returns an AS-prefixed strategy ID, or an empty string when validate is true.
Parameters
| Parameter | Type |
|---|---|
params | SpotSubmitStrategyParams |
Returns
Promise<SpotAPISuccessResponse<{ strategy_id: string; }>>
submitSubaccountTransfer()
submitSubaccountTransfer(params: SpotAccountTransferParams): Promise<SpotAPISuccessResponse<SpotAccountTransferResponse>>;Account Transfer
Transfer funds to and from master and subaccounts. Note: AccountTransfer must be called using an API key from the master account.
Parameters
| Parameter | Type |
|---|---|
params | SpotAccountTransferParams |
Returns
Promise<SpotAPISuccessResponse<SpotAccountTransferResponse>>
submitTransferToFutures()
submitTransferToFutures(params: SpotWalletTransferParams): Promise<SpotAPISuccessResponse<{
refid: string;
}>>;Request Wallet Transfer
Transfer from a Kraken spot wallet to a Kraken Futures wallet. Note: Transfer in the other direction must be requested via the Kraken Futures API.
Parameters
| Parameter | Type |
|---|---|
params | SpotWalletTransferParams |
Returns
Promise<SpotAPISuccessResponse<{ refid: string; }>>
submitWithdrawal()
submitWithdrawal(params: SpotWithdrawFundsParams): Promise<SpotAPISuccessResponse<{
refid: string;
}>>;Withdraw Funds
Make a withdrawal request.
Parameters
| Parameter | Type |
|---|---|
params | SpotWithdrawFundsParams |
Returns
Promise<SpotAPISuccessResponse<{ refid: string; }>>
updateOAuthFastApiKey()
updateOAuthFastApiKey(params: OauthUpdateFastApiKeyParams): Promise<{
result: boolean;
}>;Update a Fast API key. The archived OAuth contract requires an OAuth2 Bearer token with the account.fast-api-key:write scope.
Parameters
| Parameter | Type |
|---|---|
params | OauthUpdateFastApiKeyParams |
Returns
Promise<{ result: boolean; }>