UNPKG

neverrekt-kucoin

Version:
1,034 lines (1,033 loc) 36.3 kB
import { AxiosRequestConfig, AxiosError, AxiosResponse } from "axios"; import { KucoinSDK } from "./types"; declare class Kucoin { private SECRET; private KEY; private PASSPHRASE?; private axios; prefix: string; constructor({ SECRET, KEY, PASSPHRASE, isTest }: KucoinSDK.Params); /** * @docs https://github.com/axios/axios * @description You can intercept requests or responses before they are handled by then or catch. */ addRequestInterceptor(onBeforeCallback: (value: AxiosRequestConfig) => AxiosRequestConfig | Promise<AxiosRequestConfig>, onErrorCallback: (error: AxiosError) => AxiosError | Promise<AxiosError>): any; /** * @docs https://github.com/axios/axios * @description If you need to remove an interceptor later you can. */ removeRequestInterceptor(interceptor: any): void; /** * @docs https://github.com/axios/axios * @description You can intercept requests or responses before they are handled by then or catch. */ addResponseInterceptor(onSuccessCallback: (response: AxiosResponse) => AxiosResponse | Promise<AxiosResponse>, onErrorCallback: (error: AxiosError) => AxiosError | Promise<AxiosError>): any; /** * @docs https://github.com/axios/axios * @description If you need to remove an interceptor later you can. */ removeResponseInterceptor(interceptor: any): void; private makeRequest; /** * @docs https://docs.kucoin.com/#get-symbols-list * @description Request via this endpoint to get a list of available currency pairs for trading. If you want to get the market information of the trading symbol, please use Get All Tickers. */ getSymbolsList(params?: KucoinSDK.Http.Params<{ market?: string; }>): Promise<{ symbol: string; name: string; baseCurrency: string; quoteCurrency: string; baseMinSize: number; quoteMinSize: number; baseMaxSize: number; quoteMaxSize: number; baseIncrement: number; quoteIncrement: number; priceIncrement: number; feeCurrency: string; enableTrading: boolean; isMarginEnabled: boolean; priceLimitRate: number; }[]>; /** * @docs https://docs.kucoin.com/#get-ticker * @description Request via this endpoint to get Level 1 Market Data. The returned value includes the best bid price and size, the best ask price and size as well as the last traded price and the last traded size. */ getTicker(params: KucoinSDK.Http.Params<{ symbol: string; }>): Promise<{ sequence: number; bestAsk: number; size: number; price: number; bestBidSize: number; bestBid: number; bestAskSize: number; time: number; }>; /** * @docs https://docs.kucoin.com/#get-all-tickers * @description Request market tickers for all the trading pairs in the market (including 24h volume). On the rare occasion that we will change the currency name, if you still want the changed symbol name, you can use the symbolName field instead of the symbol field via “Get all tickers” endpoint. */ getAllTickers(): Promise<{ time: number; ticker: { symbol: string; symbolName: string; buy: number; sell: number; changeRate: number; changePrice: number; high: number; low: number; vol: number; volValue: number; last: number; }[]; }>; /** * @docs https://docs.kucoin.com/#get-24hr-stats * @description Request via this endpoint to get the statistics of the specified ticker in the last 24 hours. */ get24HourStats(params: KucoinSDK.Http.Params<{ symbol: string; }>): Promise<{ symbol: string; high: number; vol: number; volValue: number; last: number; low: number; buy: number; sell: number; changePrice: number; averagePrice: number; time: number; changeRate: number; }>; /** * @docs https://docs.kucoin.com/#get-market-list * @description Request via this endpoint to get the transaction currency for the entire trading market. */ getMarketList(): Promise<{ data: string[]; }>; /** * @docs https://docs.kucoin.com/#get-currencies * @description Request via this endpoint to get the currency list. */ getCurrencies(): Promise<{ currency: string; name: string; fullName: string; precision: number; withdrawalMinSize: number; withdrawalMinFee: number; isWithdrawEnabled: boolean; isDepositEnabled: boolean; isMarginEnabled: boolean; isDebitEnabled: boolean; }[]>; /** * @docs https://docs.kucoin.com/#get-currency-detail * @description Request via this endpoint to get the currency details of a specified currency. */ getCurrencyDetail(currency: string, params?: KucoinSDK.Http.Params<{ chain?: string[]; }>): Promise<{ currency: string; name: string; fullName: string; precision: number; withdrawalMinSize: number; withdrawalMinFee: number; isWithdrawEnabled: boolean; isDepositEnabled: boolean; isMarginEnabled: boolean; isDebitEnabled: boolean; }>; /** * @docs https://docs.kucoin.com/#get-fiat-price * @description Request via this endpoint to get the fiat price of the currencies for the available trading pairs. */ getFiatPrice(params: KucoinSDK.Http.Params<{ base?: string; currencies?: string[]; }>): Promise<{ code: number; data: { [currency: string]: number; }; }>; /** * @docs https://docs.kucoin.com/#get-part-order-book-aggregated * @description Request via this endpoint to get a list of open orders for a symbol. Level-2 order book includes all bids and asks (aggregated by price), this level returns only one size for each active price (as if there was only a single order for that price). Query via this endpoint and the system will return only part of the order book to you. If you request level2_20, the system will return you 20 pieces of data (ask and bid data) on the order book. If you request level_100, the system will return 100 pieces of data (ask and bid data) on the order book to you. You are recommended to request via this endpoint as the system reponse would be faster and cosume less traffic. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the Level 2 snapshot. */ getPartOrderBook(level: 20 | 100, params: KucoinSDK.Http.Params<{ symbol: string; }>): Promise<{ sequence: number; time: number; bids: number[][]; asks: number[][]; }>; /** * @docs https://docs.kucoin.com/#get-full-order-book-aggregated * @description Request via this endpoint to get the order book of the specified symbol. Level 2 order book includes all bids and asks (aggregated by price). This level returns only one aggregated size for each price (as if there was only one single order for that price). This API will return data with full depth. It is generally used by professional traders because it uses more server resources and traffic, and we have strict access frequency control. To maintain up-to-date Order Book, please use Websocket incremental feed after retrieving the Level 2 snapshot. */ getFullOrderBookAggregated(params: KucoinSDK.Http.Params<{ symbol: string; }>): Promise<{ sequence: number; time: number; bids: number[][]; asks: number[][]; }>; /** * @docs https://docs.kucoin.com/#get-full-order-book-atomic * @description Request via this endpoint to get the Level 3 order book of the specified trading pari. Level 3 order book includes all bids and asks (the data is non-aggregated, and each item means a single order). This API is generally used by professional traders because it uses more server resources and traffic, and we have strict access frequency control. To maintain up-to-date order book, please use Websocket incremental feed after retrieving the Level 3 snapshot. In the orderbook, the selling data is sorted low to high by price and orders with the same price are sorted in time sequence. The buying data is sorted high to low by price and orders with the same price are sorted in time sequence. The matching engine will match the orders according to the price and time sequence. */ getFullOrderBookAtomic(params: KucoinSDK.Http.Params<{ symbol: string; }>): Promise<{ sequence: number; time: number; bids: number[][]; asks: number[][]; }>; /** * @docs https://docs.kucoin.com/#get-trade-histories * @description Request via this endpoint to get the trade history of the specified symbol. */ getTradeHistories(params: KucoinSDK.Http.Params<{ symbol: string; }>): Promise<{ sequence: number; price: number; size: number; side: string; time: number; }[]>; /** * @docs https://docs.kucoin.com/#get-klines * @description Request via this endpoint to get the kline of the specified symbol. Data are returned in grouped buckets based on requested type. */ getKlines(params: KucoinSDK.Http.Params<{ symbol: string; startAt?: string; endAt?: string; type: "1min" | "3min" | "5min" | "15min" | "30min" | "1hour" | "2hour" | "4hour" | "6hour" | "8hour" | "12hour" | "1day" | "1week"; }>): Promise<number[][]>; /** * @docs https://docs.kucoin.com/#get-user-info-of-all-sub-accounts * @description You can get the user info of all sub-users via this interface. */ getUserSubInfo(): Promise<{ userId: string; subName: string; remarks: string; }[]>; /** * @docs https://docs.kucoin.com/#create-an-account * @description Create account. */ createAnAccount(params: KucoinSDK.Http.Params<{ currency: string; type: "main" | "trade" | "margin"; }>): Promise<{ id: string; }>; /** * @docs https://docs.kucoin.com/#list-accounts * @description Get a list of accounts. Please deposit funds to the main account firstly, then transfer the funds to the trade account via Inner Transfer before transaction */ listAccounts(params?: KucoinSDK.Http.Params<{ currency?: string; type?: "main" | "trade" | "margin" | "pool"; }>): Promise<{ code: number; data: { id: string; currency: string; type: string; balance: number; available: number; holds: number; }[]; }>; /** * @docs https://docs.kucoin.com/#get-an-account * @description Information for a single account. Use this endpoint when you know the accountId. */ getAnAccount(params: KucoinSDK.Http.Params<{ accountId: string; }>): Promise<{ currency: string; balance: number; available: number; holds: number; }>; /** * @docs https://docs.kucoin.com/#get-account-ledgers * @description Request via this endpoint to get the account ledgers. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. */ getAccountLedgers(params: KucoinSDK.Http.Params<{ accountId: string; startAt?: string; endAt?: string; direction?: "in" | "out"; bizType?: "DEPOSIT" | "WITHDRAW" | "TRANSFER" | "SUB_TRANSFER" | "TRADE_EXCHANGE" | "MARGIN_EXCHANGE" | "KUCOIN_BONUS"; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { id: string; currency: string; amount: number; fee: number; balance: number; bizType: string; direction: string; createdAt: number; context: { orderId: string; txId: string; }; }[]; }>; /** * @docs https://docs.kucoin.com/#get-holds * @description Holds are placed on an account for any active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For a withdraw, once it is completed, the hold is removed. */ getHolds(params: KucoinSDK.Http.Params<{ accountId: string; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { currency: string; holdAmount: number; bizType: string; orderId: string; createdAt: number; updatedAt: number; }[]; }>; /** * @docs https://docs.kucoin.com/#get-account-balance-of-a-sub-account * @description This endpoint returns the account info of a sub-user specified by the subUserId. */ getSubAccountBalance(params: KucoinSDK.Http.Params<{ subUserId: string; }>): Promise<{ subUserId: string; subName: string; mainAccounts: { currency: string; balance: number; available: number; holds: number; baseCurrency: string; baseCurrencyPrice: number; baseAmount: number; }[]; tradeAccounts?: { currency: string; balance: number; available: number; holds: number; baseCurrency: string; baseCurrencyPrice: number; baseAmount: number; }[] | undefined; marginAccounts?: { currency: string; balance: number; available: number; holds: number; baseCurrency: string; baseCurrencyPrice: number; baseAmount: number; }[] | undefined; }>; /** * @docs https://docs.kucoin.com/#get-the-aggregated-balance-of-all-sub-accounts * @description This endpoint returns the account info of all sub-users. */ getAggregatedSubAccountBalance(): Promise<{ subUserId: string; subName: string; mainAccounts: { currency: string; balance: number; available: number; holds: number; baseCurrency: string; baseCurrencyPrice: number; baseAmount: number; }[]; tradeAccounts?: { currency: string; balance: number; available: number; holds: number; baseCurrency: string; baseCurrencyPrice: number; baseAmount: number; }[] | undefined; marginAccounts?: { currency: string; balance: number; available: number; holds: number; baseCurrency: string; baseCurrencyPrice: number; baseAmount: number; }[] | undefined; }[]>; /** * @docs https://docs.kucoin.com/#get-the-transferable * @description This endpoint returns the transferable balance of a specified account. */ getTheTransferable(params: KucoinSDK.Http.Params<{ currency: string; type: "MAIN" | "TRADE" | "MARGIN" | "POOL"; }>): Promise<{ currency: string; balance: number; available: number; holds: number; transferable: number; }>; /** * @docs https://docs.kucoin.com/#transfer-between-master-user-and-sub-user * @description This endpoint is used for transferring the assets between the master user and the sub-user. The main account of the master user supports the transfer to the main account or trade account of the sub-user. */ transferBetweenMasterAndSubUser(params: KucoinSDK.Http.Params<{ clientOid: string; currency: string; amount: string | number; direction: "OUT" | "IN"; accountType?: "MAIN"; subAccountType?: "MAIN" | "TRADE" | "MARGIN"; subUserId: string; }>): Promise<{ orderId: string; }>; /** * @docs https://docs.kucoin.com/#inner-transfer * @description The inner transfer interface is used for transferring assets between the accounts of a user and is free of charges. For example, a user could transfer assets from their main account to their trading account on the platform. Support transfer between main account and pool account. */ innerTransfer(params: KucoinSDK.Http.Params<{ clientOid: string; currency: string; from: "main" | "trade" | "margin" | "pool"; to: "main" | "trade" | "margin" | "pool"; amount: string | number; }>): Promise<{ orderId: string; }>; /** * @docs https://docs.kucoin.com/#create-deposit-address * @description Request via this endpoint to create a deposit address for a currency you intend to deposit. */ createDepositAddress(params: KucoinSDK.Http.Params<{ currency: string; chain?: string; }>): Promise<{ address: string; memo: string; chain: string; }>; /** * @docs https://docs.kucoin.com/#get-deposit-address * @description Get a deposit address for the currency you intend to deposit. If the returned data is null, you may need to create a deposit address first. */ getDepositAddress(params: KucoinSDK.Http.Params<{ currency: string; chain?: string; }>): Promise<{ address: string; memo: string; chain: string; }>; /** * @docs https://docs.kucoin.com/#get-deposit-list * @description Request via this endpoint to get deposit list Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. */ getDepositList(params: KucoinSDK.Http.Params<{ currency?: string; startAt?: string; endAt?: string; status?: string; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { address: string; memo: string; amount: number; fee: number; currency: string; isInner: boolean; walletTxId: string; status: string; remark: string; createdAt: number; updatedAt: number; }[]; }>; /** * @docs https://docs.kucoin.com/#get-v1-historical-deposits-list * @description Request via this endpoint to get the V1 historical deposits list on KuCoin. */ getHistoricalDepositsList(params: KucoinSDK.Http.Params<{ currency?: string; startAt?: string; endAt?: string; status?: string; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { currency: string; createAt: number; amount: number; walletTxId: string; isInner: boolean; status: string; }[]; }>; /** * @docs https://docs.kucoin.com/#get-withdrawals-list * @description Get withdrawals list */ getWithdrawalsList(params: KucoinSDK.Http.Params<{ currency?: string; startAt?: string; endAt?: string; status?: string; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { id: string; address: string; memo: string; currency: string; amount: number; fee: number; walletTxId: string; isInner: boolean; status: string; remark: string; createdAt: number; updatedAt: number; }[]; }>; /** * @docs https://docs.kucoin.com/#get-v1-historical-withdrawals-list * @description List of KuCoin V1 historical withdrawals. */ getHistoricalWithdrawalsList(params: KucoinSDK.Http.Params<{ currency?: string; startAt?: string; endAt?: string; status?: "PROCESSING" | "SUCCESS" | "FAILURE"; currentPage?: number; pageSize?: number; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { currency: string; createAt: number; amount: number; address: string; walletTxId: string; isInner: boolean; status: string; }[]; }>; /** * @docs https://docs.kucoin.com/#get-withdrawal-quotas * @description Get withdrawal quotas */ getWithdrawalQuotas(params: KucoinSDK.Http.Params<{ currency: string; chain?: string; }>): Promise<{ currency: string; limitBTCAmount: number; usedBTCAmount: number; limitAmount: number; remainAmount: number; availableAmount: number; withdrawMinFee: number; innerWithdrawMinFee: number; withdrawMinSize: number; isWithdrawEnabled: boolean; precision: number; chain: string; }>; /** * @docs https://docs.kucoin.com/#apply-withdraw-2 * @description Apply withdraw */ applyWithdrawal(params: KucoinSDK.Http.Params<{ currency: string; address: string; amount: number; memo?: string; isInner?: boolean; remark?: string; chain?: string; }>): Promise<{ withdrawalId: string; }>; /** * @docs https://docs.kucoin.com/#cancel-withdrawal * @description Only withdrawals requests of PROCESSING status could be canceled. */ cancelWithdrawal(params: KucoinSDK.Http.Params<{ withdrawalId: string; }>): Promise<{}>; /** * @docs https://docs.kucoin.com/#place-a-new-order * @description You can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your account funds will be put on hold for the duration of the order. How much and which funds are put on hold depends on the order type and parameters specified. See the Holds details below. */ placeANewOrder(params: KucoinSDK.Http.Params<{ clientOId: string; side: "buy" | "sell"; symbol: string; type?: "limit" | "market"; remark?: string; stop?: "loss" | "entry"; stopPrice?: string; stp?: "CN" | "CO" | "CB" | "DC"; tradeType?: "TRADE" | "MARGIN_TRADE"; price?: string; size?: string; timeInForce?: string; cancelAfter?: string; postOnly?: boolean; hidden?: boolean; iceberg?: boolean; visibleSize?: string; funds?: string; }>): Promise<{ orderId: string; }>; /** * @docs https://docs.kucoin.com/#cancel-an-order * @description Request via this endpoint to cancel a single order previously placed. You will receive cancelledOrderIds field once the system has received the cancellation request. The cancellation request will be processed by the matching engine in sequence. To know if the request is processed (successfully or not), you may check the order status or the update message from the pushes. */ cancelAnOrder(params: KucoinSDK.Http.Params<{ orderId: string; }>): Promise<{ cancelledOrderIds: string[]; }>; /** * @docs https://docs.kucoin.com/#cancel-all-orders * @description Request via this endpoint to cancel all open orders. The response is a list of ids of the canceled orders. */ cancelAllOrders(params: KucoinSDK.Http.Params<{ symbol?: string; tradeType?: "TRADE" | "MARGIN_TRADE" | string; }>): Promise<{ cancelledOrderIds: string[]; }>; /** * @docs https://docs.kucoin.com/#list-orders * @description Request via this endpoint to get your current order list. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. */ listOrders(params: KucoinSDK.Http.Params<{ status?: "active" | "done"; symbol?: string; side?: "buy" | "sell"; type?: "limit" | "market" | "limit_stop" | "market_stop"; tradeType: "TRADE" | "MARGIN_TRADE"; startAt?: string; endAt?: string; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { id: string; symbol: string; opType: string; type: string; side: string; price: number; size: number; funds: number; dealFunds: number; dealSize: number; fee: number; feeCurrency: string; stp: string; stop: string; stopTriggered: boolean; stopPrice: number; timeInForce: string; postOnly: boolean; hidden: boolean; iceberg: boolean; visibleSize: number; cancelAfter: number; channel: string; clientOid: string; remark: string; tags: string; isActive: boolean; cancelExist: boolean; createdAt: number; tradeType: string; }[]; }>; /** * @docs https://docs.kucoin.com/#get-v1-historical-orders-list * @description Request via this endpoint to get your historical orders list of the KuCoin V1. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. */ getHistoricalOrdersList(params: KucoinSDK.Http.Params<{ currentPage?: number; pageSize?: number; symbol?: string; side?: "buy" | "sell"; startAt?: string; endAt?: string; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { symbol: string; dealPrice: number; dealValue: number; amount: number; fee: number; side: string; createdAt: number; }[]; }>; /** * @docs https://docs.kucoin.com/#recent-orders * @description Request via this endpoint to get 1000 orders in the last 24 hours. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. */ recentOrders(): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { id: string; symbol: string; opType: string; type: string; side: string; price: number; size: number; funds: number; dealFunds: number; dealSize: number; fee: number; feeCurrency: string; stp: string; stop: string; stopTriggered: boolean; stopPrice: number; timeInForce: string; postOnly: boolean; hidden: boolean; iceberg: boolean; visibleSize: number; cancelAfter: number; channel: string; clientOid: string; remark: string; tags: string; isActive: boolean; cancelExist: boolean; createdAt: number; tradeType: string; }[]; }>; /** * @docs https://docs.kucoin.com/#get-an-order * @description Request via this endpoint to get a single order info by order ID. */ getAnOrder(params: KucoinSDK.Http.Params<{ orderId: string; }>): Promise<{ id: string; symbol: string; opType: string; type: string; side: string; price: number; size: number; funds: number; dealFunds: number; dealSize: number; fee: number; feeCurrency: string; stp: string; stop: string; stopTriggered: boolean; stopPrice: number; timeInForce: string; postOnly: boolean; hidden: boolean; iceberg: boolean; visibleSize: number; cancelAfter: number; channel: string; clientOid: string; remark: string; tags: string; isActive: boolean; cancelExist: boolean; createdAt: number; tradeType: string; }>; /** * @docs https://docs.kucoin.com/#list-fills * @description Request via this endpoint to get the recent fills. Items are paginated and sorted to show the latest first. See the Pagination section for retrieving additional entries after the first page. */ listFills(params: KucoinSDK.Http.Params<{ orderId?: string; symbol?: string; side?: "buy" | "sell"; type?: "limit" | "market" | "limit_stop" | "market_stop"; startAt?: string; endAt?: string; tradeType: "TRADE" | "MARGIN_TRADE"; }>): Promise<{ currentPage: number; pageSize: number; totalNum: number; totalPage: number; items: { symbol: string; tradeId: string; orderId: string; counterOrderId: string; side: string; liquidity: string; forceTaker: boolean; price: number; size: number; funds: number; fee: number; feeRate: number; feeCurrency: string; stop: string; type: string; createdAt: number; tradeType: string; }[]; }>; /** * @docs https://docs.kucoin.com/#recent-fills * @description Request via this endpoint to get a list of 1000 fills in the last 24 hours. */ recentFills(): Promise<{ code: number; data: { counterOrderId: string; createdAt: number; fee: number; feeCurrency: string; feeRate: number; forceTaker: boolean; funds: number; liquidity: string; orderId: string; price: number; side: string; size: number; stop: string; symbol: string; tradeId: string; tradeType: string; type: string; }[]; }>; /** * @docs https://docs.kucoin.com/#get-mark-price * @description Request via this endpoint to get the index price of the specified symbol. */ getMarkPrice(params: KucoinSDK.Http.Params<{ symbol: string; }>): Promise<{ symbol: string; granularity: number; timePoint: number; value: number; }>; /** * @docs https://docs.kucoin.com/#get-margin-configuration-info * @description Request via this endpoint to get the configure info of the margin. */ getMarginConfigurationInfo(): Promise<{ currencyList: string[]; warningDebtRatio: number; liqDebtRatio: number; maxLeverage: number; }>; /** * @docs https://docs.kucoin.com/#get-margin-account * @description Request via this endpoint to get the info of the margin account. */ getMarginAccount(): Promise<{ accounts: { availableBalance: number; currency: string; holdBalance: number; liability: number; maxBorrowSize: number; totalBalance: number; }[]; debtRatio: number; }>; /** * @docs https://docs.kucoin.com/#post-borrow-order * @description Post borrow order */ postBorrowOrder(params: KucoinSDK.Http.Params<{ currency: string; type: string; size: number; maxRate?: number; term?: string; }>): Promise<{ orderId: string; currency: string; }>; /** * @docs https://docs.kucoin.com/#get-borrow-order * @description Request via this endpoint to get the info of the borrow order through the orderId retrieved from Post Borrow Order . */ getBorrowOrder(params: KucoinSDK.Http.Params<{ orderId: string; }>): Promise<{ currency: string; filled: number; matchList: { currency: string; dailyIntRate: number; size: number; term: number; timestamp: number; tradeId: number; }[]; orderId: string; size: number; status: string; }>; /** * @docs https://docs.kucoin.com/#get-repay-record * @description Get repay record */ getRepayRecord(params: KucoinSDK.Http.Params<{ currency?: string; }>): Promise<{ currentPage: number; items: { accruedInterest: number; createdAt: number; currency: string; dailyIntRate: number; liability: number; maturityTime: number; principal: number; repaidSize: number; term: number; tradeId: number; }[]; pageSize: number; totalNum: number; totalPage: number; }>; /** * @docs https://docs.kucoin.com/#get-repayment-record * @description Get repayment record */ getRepaymentRecord(params: KucoinSDK.Http.Params<{ currency?: string; }>): Promise<{ currentPage: number; items: { currency: string; dailyIntRate: number; interest: number; principal: number; repaidSize: number; repayTime: number; term: number; tradeId: number; }[]; pageSize: number; totalNum: number; totalPage: number; }>; /** * @docs https://docs.kucoin.com/#one-click-repayment * @description One-click repayment */ oneClickRepayment(params: KucoinSDK.Http.Params<{ currency: string; sequence: "RECENTLY_EXPIRE_FIRST" | "HIGHEST_RATE_FIRST"; size: number; }>): Promise<{}>; /** * @docs https://docs.kucoin.com/#repay-a-single-order * @description Request via this endpoint to repay a single order. */ repayASingleOrder(params: KucoinSDK.Http.Params<{ currency: string; tradeId: string; size: number; }>): Promise<{}>; /** * @docs https://docs.kucoin.com/#margin-trade-data * @description Request via this endpoint to get the last 300 fills in the lending and borrowing market. The returned value is sorted based on the descending sequence of the order execution time. */ marginTradeData(params: KucoinSDK.Http.Params<{ currency: string; }>): Promise<{ tradeId: string; currency: string; size: number; dailyIntRate: number; term: number; timestamp: number; }[]>; /** * @docs https://docs.kucoin.com/#server-time * @description Get the server time. */ serverTime(): Promise<{ code: number; msg: string; data: number; }>; } export default Kucoin;