Skip to content

Commit 3eff315

Browse files
committed
refactor: websocket method links, fix: rest order list link
1 parent b4e6ee2 commit 3eff315

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

lib/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ export class Client {
593593
* - For an OTOCO order list, the secondary orders have the same restrictions as an OCO order
594594
* - Default is ORDER_TYPE.Limit
595595
*
596-
* https://api.exchange.cryptomkt.com/#create-new-spot-order-list-2
596+
* https://api.exchange.cryptomkt.com/#create-new-spot-order-list
597597
*
598598
* @param {string} params.order_list_id Order list identifier. If omitted, it will be generated by the system upon order list creation. Must be equal to client_order_id of the first order in the request.
599599
* @param {string} params.contingency_type Order list type.

lib/websocket/marketDataClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ export class MarketDataClient extends WSClientBase {
548548
*
549549
* batch subscriptions have a joined update for all currencies
550550
*
551-
* https://api.exchange.cryptomkt.com/#subscribe-to-price-rates
551+
* https://api.exchange.cryptomkt.com/#subscribe-to-price-rates-in-batches
552552
*
553553
* @param {function} callback recieves a feed of price rates as a map of them, indexed by currency id, and the type of notification, only DATA
554554
* @param {PRICE_RATE_SPEED} speed The speed of the feed. '1s' or '3s'

lib/websocket/tradingClient.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,32 +218,32 @@ export class TradingClient extends AuthClient {
218218
* @param {string} params.currency The currency code to query the balance
219219
* @return A promise that resolves with the spot trading balance of a currency
220220
*/
221-
async getSpotTradingBalanceOfCurrency(params: {
221+
async getSpotTradingBalance(params: {
222222
currency: string;
223223
}): Promise<Balance> {
224224
return this.makeRequest<Balance>({ method: "spot_balance", params });
225225
}
226226

227227
/**
228-
* Get the personal trading commission rates for all symbols
228+
* Get the personal trading fee rates for all symbols
229229
*
230230
* https://api.exchange.cryptomkt.com/#get-spot-fees
231231
*
232232
* @return A promise that resolves with a list of commission rates
233233
*/
234-
async getSpotCommissions(): Promise<Commission[]> {
234+
async getSpotFees(): Promise<Commission[]> {
235235
return this.makeRequest<Commission[]>({ method: "spot_fees" });
236236
}
237237

238238
/**
239-
* Get the personal trading commission rate of a symbol
239+
* Get the personal trading fee rate of a symbol
240240
*
241241
* https://api.exchange.cryptomkt.com/#get-spot-fee
242242
*
243243
* @param {string} params.symbol The symbol of the commission rate
244244
* @return A promise that resolves with the commission rate of a symbol
245245
*/
246-
async getSpotCommissionOfSymbol(params: {
246+
async getSpotFee(params: {
247247
symbol: string;
248248
}): Promise<Commission> {
249249
return this.makeRequest<Commission>({ method: "spot_fee", params });

lib/websocket/walletClient.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class WalletClient extends AuthClient {
4242
*
4343
* Requires the "Payment information" API key Access Right
4444
*
45-
* https://api.exchange.cryptomkt.com/#wallet-balance
45+
* https://api.exchange.cryptomkt.com/#request-wallet-balance
4646
*
4747
* @return A promise that resolves with a list of wallet balances
4848
*/
@@ -55,12 +55,12 @@ export class WalletClient extends AuthClient {
5555
*
5656
* Requires the "Payment information" API key Access Right
5757
*
58-
* https://api.exchange.cryptomkt.com/#wallet-balance
58+
* https://api.exchange.cryptomkt.com/#request-wallet-balance
5959
*
6060
* @param {string} currency The currency code to query the balance
6161
* @return A promise that resolves with the wallet balance of the currency
6262
*/
63-
async getWalletBalanceOfCurrency(currency: string): Promise<Balance> {
63+
async getWalletBalance(currency: string): Promise<Balance> {
6464
const response = await this.makeRequest<Balance>({ method: "wallet_balance", params: { currency } });
6565
return { available: response.available, reserved: response.reserved, currency: currency };
6666
}
@@ -78,7 +78,7 @@ export class WalletClient extends AuthClient {
7878
*
7979
* Requires the "Payment information" API key Access Right
8080
*
81-
* https://api.exchange.cryptomkt.com/#get-transactions-history
81+
* https://api.exchange.cryptomkt.com/#get-transactions
8282
*
8383
* @param {string[]} [params.tx_ids] Optional. List of transaction identifiers to query
8484
* @param {TRANSACTION_TYPE[]} [params.transaction_types] Optional. List of types to query. valid types are: 'DEPOSIT', 'WITHDRAW', 'TRANSFER' and 'SWAP'
@@ -92,6 +92,7 @@ export class WalletClient extends AuthClient {
9292
* @param {SORT} [params.sort] Optional. Sort direction. 'ASC' or 'DESC'. Default is 'DESC'
9393
* @param {number} [params.limit] Optional. Transactions per query. Defaul is 100. Max is 1000
9494
* @param {number} [params.offset] Optional. Default is 0. Max is 100000
95+
* @param {Boolean} [params.group_transactions] Flag indicating whether the returned transactions will be parts of a single operation. Default is false
9596
* @return A promise that resolves with a list of transactions
9697
*/
9798
getTransactions(params: {
@@ -108,6 +109,7 @@ export class WalletClient extends AuthClient {
108109
sort?: SORT;
109110
limit?: number;
110111
offset?: number;
112+
group_transactions?: Boolean;
111113
}): Promise<Transaction[]> {
112114
const clean_params: any = { ...params }
113115
clean_params.currencies = params.currencies?.join(", ")
@@ -142,7 +144,7 @@ export class WalletClient extends AuthClient {
142144
/**
143145
* unsubscribe to the transaction feed.
144146
*
145-
* https://api.exchange.cryptomkt.com/#subscription-to-the-transactions
147+
* https://api.exchange.cryptomkt.com/#subscribe-to-transactions
146148
*
147149
* @return {Promise<Boolean>} A Promise of the unsubscription result. True if unsubscribed
148150
*/
@@ -158,7 +160,7 @@ export class WalletClient extends AuthClient {
158160
* the first notification has a snapshot of the wallet. further notifications
159161
* are updates of the wallet
160162
*
161-
* https://api.exchange.cryptomkt.com/#subscription-to-the-balance
163+
* https://api.exchange.cryptomkt.com/#subscribe-to-wallet-balances
162164
*
163165
* @param {function} callback A function that recieves notifications with a list of balances, and the type of notification (either SNAPSHOT or UPDATE)
164166
* @return {Promise<Boolean>} A Promise of the subscription result. True if subscribed
@@ -185,7 +187,7 @@ export class WalletClient extends AuthClient {
185187
/**
186188
* unsubscribe to the balance feed.
187189
*
188-
* https://api.exchange.cryptomkt.com/#subscription-to-the-balance
190+
* https://api.exchange.cryptomkt.com/#subscribe-to-wallet-balances
189191
*
190192
* @return {Promise<Boolean>} A Promise of the unsubscription result. True if unsubscribed
191193
*/

0 commit comments

Comments
 (0)