quidax-node 3.1.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -27
- package/dist/index.cjs +64 -55
- package/dist/index.d.cts +100 -56
- package/dist/index.d.mts +100 -56
- package/dist/index.mjs +64 -55
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -3,9 +3,15 @@ import { AxiosInstance, AxiosRequestConfig } from "axios";
|
|
|
3
3
|
//#region src/client.d.ts
|
|
4
4
|
interface QuidaxClientConfig {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Your Quidax 3.0 API key, generated under "My Account" > "API Management" in the
|
|
7
|
+
* Quidax 3.0 web app. IP whitelisting is mandatory for these keys.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Since Quidax 3.0 you must pass the API key, not the secret key. Use `apiKey` instead.
|
|
12
|
+
* Still accepted for backwards compatibility and sent the same way as `apiKey`.
|
|
13
|
+
*/
|
|
14
|
+
secretKey?: string;
|
|
9
15
|
/**
|
|
10
16
|
* Base URL for the primary Exchange APIs (default: https://openapi.quidax.io/exchange-open-api/api/v1)
|
|
11
17
|
*/
|
|
@@ -54,7 +60,19 @@ interface PaginationMeta {
|
|
|
54
60
|
interface PaginatedResponse<T> extends QuidaxResponse<T[]> {
|
|
55
61
|
meta: PaginationMeta;
|
|
56
62
|
}
|
|
57
|
-
type Currency = 'btc' | 'ltc' | 'eth' | 'usdt' | 'xrp' | 'dash' | 'trx' | 'doge' | 'usdc' | 'ngn' | 'usd' | string;
|
|
63
|
+
type Currency = 'btc' | 'ltc' | 'eth' | 'usdt' | 'xrp' | 'dash' | 'trx' | 'doge' | 'usdc' | 'sol' | 'bnb' | 'ton' | 'xlm' | 'cngn' | 'ngn' | 'usd' | string;
|
|
64
|
+
/**
|
|
65
|
+
* Blockchain network identifier (e.g. 'bitcoin', 'bep20', 'erc20', 'trc20').
|
|
66
|
+
* Use `wallets.getOne` / `wallets.getAll` to see the networks each asset supports.
|
|
67
|
+
*/
|
|
68
|
+
type Network = string;
|
|
69
|
+
interface WalletNetwork {
|
|
70
|
+
id: Network;
|
|
71
|
+
name: string;
|
|
72
|
+
deposits_enabled: boolean;
|
|
73
|
+
withdraws_enabled: boolean;
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}
|
|
58
76
|
interface User {
|
|
59
77
|
id: string;
|
|
60
78
|
sn: string;
|
|
@@ -72,6 +90,9 @@ interface Wallet {
|
|
|
72
90
|
balance: string;
|
|
73
91
|
locked: string;
|
|
74
92
|
staked: string;
|
|
93
|
+
blockchain_enabled?: boolean;
|
|
94
|
+
default_network?: Network | null;
|
|
95
|
+
networks?: WalletNetwork[];
|
|
75
96
|
user: {
|
|
76
97
|
id: string;
|
|
77
98
|
sn: string;
|
|
@@ -84,6 +105,7 @@ interface PaymentAddress {
|
|
|
84
105
|
reference: string;
|
|
85
106
|
currency: Currency;
|
|
86
107
|
address: string;
|
|
108
|
+
network?: Network | null;
|
|
87
109
|
destination_tag: string | null;
|
|
88
110
|
total_payments: number;
|
|
89
111
|
created_at: string;
|
|
@@ -105,7 +127,7 @@ declare class UsersModule {
|
|
|
105
127
|
* @returns A promise resolving to the created User object.
|
|
106
128
|
* @throws {QuidaxError} If validation fails or email already exists.
|
|
107
129
|
*/
|
|
108
|
-
|
|
130
|
+
createSubAccount(data: {
|
|
109
131
|
email: string;
|
|
110
132
|
first_name: string;
|
|
111
133
|
last_name: string;
|
|
@@ -116,7 +138,7 @@ declare class UsersModule {
|
|
|
116
138
|
*
|
|
117
139
|
* @returns A promise resolving to the Parent User object.
|
|
118
140
|
*/
|
|
119
|
-
|
|
141
|
+
getMe(): Promise<QuidaxResponse<User>>;
|
|
120
142
|
/**
|
|
121
143
|
* Edits the details of an existing sub-account.
|
|
122
144
|
*
|
|
@@ -124,7 +146,7 @@ declare class UsersModule {
|
|
|
124
146
|
* @param data - The data to update.
|
|
125
147
|
* @returns A promise resolving to the updated User object.
|
|
126
148
|
*/
|
|
127
|
-
|
|
149
|
+
updateSubAccount(userId: string, data: {
|
|
128
150
|
first_name?: string;
|
|
129
151
|
last_name?: string;
|
|
130
152
|
phone_number?: string;
|
|
@@ -134,7 +156,7 @@ declare class UsersModule {
|
|
|
134
156
|
*
|
|
135
157
|
* @returns A promise resolving to a list of User objects.
|
|
136
158
|
*/
|
|
137
|
-
|
|
159
|
+
listSubAccounts(): Promise<QuidaxResponse<User[]>>;
|
|
138
160
|
/**
|
|
139
161
|
* Fetches the detailed profile of a specific sub-account.
|
|
140
162
|
*
|
|
@@ -142,7 +164,7 @@ declare class UsersModule {
|
|
|
142
164
|
* @returns A promise resolving to the User object.
|
|
143
165
|
* @throws {QuidaxError} If the user is not found.
|
|
144
166
|
*/
|
|
145
|
-
|
|
167
|
+
getSubAccount(userId: string): Promise<QuidaxResponse<User>>;
|
|
146
168
|
}
|
|
147
169
|
//#endregion
|
|
148
170
|
//#region src/modules/wallets.d.ts
|
|
@@ -155,7 +177,7 @@ declare class WalletsModule {
|
|
|
155
177
|
* @param userId - The unique ID of the user. 'me' can be used for the authenticated user.
|
|
156
178
|
* @returns A promise resolving to an array of Wallet objects.
|
|
157
179
|
*/
|
|
158
|
-
|
|
180
|
+
listWallets(userId: string): Promise<QuidaxResponse<Wallet[]>>;
|
|
159
181
|
/**
|
|
160
182
|
* Fetches a specific cryptocurrency wallet for a user.
|
|
161
183
|
*
|
|
@@ -163,7 +185,7 @@ declare class WalletsModule {
|
|
|
163
185
|
* @param currency - The cryptocurrency ticker (e.g., 'btc', 'usdt').
|
|
164
186
|
* @returns A promise resolving to a single Wallet object.
|
|
165
187
|
*/
|
|
166
|
-
|
|
188
|
+
getWallet(userId: string, currency: Currency): Promise<QuidaxResponse<Wallet>>;
|
|
167
189
|
/**
|
|
168
190
|
* Fetches the default Payment Address for a specific user's wallet.
|
|
169
191
|
*
|
|
@@ -179,7 +201,7 @@ declare class WalletsModule {
|
|
|
179
201
|
* @param currency - The cryptocurrency ticker.
|
|
180
202
|
* @returns A promise resolving to an array of PaymentAddress objects.
|
|
181
203
|
*/
|
|
182
|
-
|
|
204
|
+
listPaymentAddresses(userId: string, currency: Currency): Promise<QuidaxResponse<PaymentAddress[]>>;
|
|
183
205
|
/**
|
|
184
206
|
* Fetches a specific Payment Address by its ID.
|
|
185
207
|
*
|
|
@@ -191,12 +213,15 @@ declare class WalletsModule {
|
|
|
191
213
|
getPaymentAddressById(userId: string, currency: Currency, addressId: string): Promise<QuidaxResponse<PaymentAddress>>;
|
|
192
214
|
/**
|
|
193
215
|
* Generates a new Payment Address for a cryptocurrency wallet.
|
|
216
|
+
* In Quidax 3.0 the network is mandatory and the address is generated immediately.
|
|
194
217
|
*
|
|
195
218
|
* @param userId - The unique ID of the user.
|
|
196
|
-
* @param currency - The cryptocurrency ticker (e.g., 'btc', '
|
|
219
|
+
* @param currency - The cryptocurrency ticker (e.g., 'btc', 'usdt').
|
|
220
|
+
* @param network - The blockchain network (e.g., 'bitcoin', 'bep20', 'trc20').
|
|
221
|
+
* Use `getWallet`/`listWallets` to see the networks a currency supports.
|
|
197
222
|
* @returns A promise resolving to the newly generated PaymentAddress object.
|
|
198
223
|
*/
|
|
199
|
-
createPaymentAddress(userId: string, currency: Currency, network:
|
|
224
|
+
createPaymentAddress(userId: string, currency: Currency, network: Network): Promise<QuidaxResponse<PaymentAddress>>;
|
|
200
225
|
}
|
|
201
226
|
//#endregion
|
|
202
227
|
//#region src/modules/withdrawals.d.ts
|
|
@@ -222,7 +247,7 @@ declare class WithdrawalsModule {
|
|
|
222
247
|
* @param userId - The unique ID of the user.
|
|
223
248
|
* @returns A promise resolving to a paginated list of Withdrawal objects.
|
|
224
249
|
*/
|
|
225
|
-
|
|
250
|
+
listWithdrawals(userId: string): Promise<PaginatedResponse<Withdrawal>>;
|
|
226
251
|
/**
|
|
227
252
|
* Fetches the details of a specific withdrawal.
|
|
228
253
|
*
|
|
@@ -230,7 +255,7 @@ declare class WithdrawalsModule {
|
|
|
230
255
|
* @param withdrawalId - The ID of the withdrawal to retrieve.
|
|
231
256
|
* @returns A promise resolving to a single Withdrawal object.
|
|
232
257
|
*/
|
|
233
|
-
|
|
258
|
+
getWithdrawal(userId: string, withdrawalId: string): Promise<QuidaxResponse<Withdrawal>>;
|
|
234
259
|
/**
|
|
235
260
|
* Fetches a withdrawal by its unique reference string.
|
|
236
261
|
*
|
|
@@ -238,7 +263,7 @@ declare class WithdrawalsModule {
|
|
|
238
263
|
* @param reference - The withdrawal reference string.
|
|
239
264
|
* @returns A promise resolving to a single Withdrawal object.
|
|
240
265
|
*/
|
|
241
|
-
|
|
266
|
+
getWithdrawalByReference(userId: string, reference: string): Promise<QuidaxResponse<Withdrawal>>;
|
|
242
267
|
/**
|
|
243
268
|
* Initiates a new cryptocurrency withdrawal.
|
|
244
269
|
*
|
|
@@ -246,21 +271,25 @@ declare class WithdrawalsModule {
|
|
|
246
271
|
* @param data - The withdrawal details.
|
|
247
272
|
* @param data.currency - The cryptocurrency ticker (e.g., 'btc').
|
|
248
273
|
* @param data.amount - The amount to withdraw.
|
|
249
|
-
* @param data.fund_uid - The ID of
|
|
274
|
+
* @param data.fund_uid - The ID of a sub-user or a crypto address.
|
|
275
|
+
* @param data.fund_uid2 - Destination tag/memo (e.g. for XRP, XLM).
|
|
250
276
|
* @param data.transaction_note - Optional note for the transaction.
|
|
251
|
-
* @param data.reference -
|
|
277
|
+
* @param data.reference - Unique reference for the withdrawal (required in v3.0).
|
|
278
|
+
* If this call fails, fetch the withdrawal with `getWithdrawalByReference` before retrying,
|
|
279
|
+
* as it may already have been processed.
|
|
252
280
|
* @param data.narration - Optional narration for the transaction.
|
|
253
|
-
* @param data.network -
|
|
281
|
+
* @param data.network - Blockchain network; required for on-chain withdrawals.
|
|
254
282
|
* @returns A promise resolving to the created Withdrawal object.
|
|
255
283
|
*/
|
|
256
|
-
|
|
284
|
+
createWithdrawal(userId: string, data: {
|
|
257
285
|
currency: Currency;
|
|
258
286
|
amount: string;
|
|
259
287
|
fund_uid: string;
|
|
288
|
+
fund_uid2?: string;
|
|
260
289
|
transaction_note?: string;
|
|
261
|
-
reference
|
|
290
|
+
reference: string;
|
|
262
291
|
narration?: string;
|
|
263
|
-
network?:
|
|
292
|
+
network?: Network;
|
|
264
293
|
}): Promise<QuidaxResponse<Withdrawal>>;
|
|
265
294
|
/**
|
|
266
295
|
* Initiates a new ngn withdrawal to merchant.
|
|
@@ -271,7 +300,7 @@ declare class WithdrawalsModule {
|
|
|
271
300
|
* @param reference - The withdrawal reference string.
|
|
272
301
|
* @returns A promise resolving to the created Withdrawal object.
|
|
273
302
|
*/
|
|
274
|
-
|
|
303
|
+
createNgnMerchantWithdrawal(userId: string, amount: string, merchantId: string, reference: string): Promise<QuidaxResponse<Withdrawal>>;
|
|
275
304
|
/**
|
|
276
305
|
* Cancels a pending withdrawal.
|
|
277
306
|
*
|
|
@@ -279,7 +308,7 @@ declare class WithdrawalsModule {
|
|
|
279
308
|
* @param withdrawalId - The ID of the withdrawal to cancel.
|
|
280
309
|
* @returns A promise resolving to the canceled Withdrawal object.
|
|
281
310
|
*/
|
|
282
|
-
|
|
311
|
+
cancelWithdrawal(userId: string, withdrawalId: string): Promise<QuidaxResponse<Withdrawal>>;
|
|
283
312
|
}
|
|
284
313
|
//#endregion
|
|
285
314
|
//#region src/modules/markets.d.ts
|
|
@@ -311,7 +340,7 @@ declare class MarketsModule {
|
|
|
311
340
|
*
|
|
312
341
|
* @returns A promise resolving to an array of Market objects.
|
|
313
342
|
*/
|
|
314
|
-
|
|
343
|
+
listMarkets(): Promise<QuidaxResponse<Market[]>>;
|
|
315
344
|
/**
|
|
316
345
|
* Retrieves tickers for all available markets.
|
|
317
346
|
*
|
|
@@ -324,10 +353,10 @@ declare class MarketsModule {
|
|
|
324
353
|
/**
|
|
325
354
|
* Retrieves the current ticker data for a specific market.
|
|
326
355
|
*
|
|
327
|
-
* @param
|
|
356
|
+
* @param market - The market pair (e.g., 'btcngn').
|
|
328
357
|
* @returns A promise resolving to the Ticker data.
|
|
329
358
|
*/
|
|
330
|
-
getTicker(
|
|
359
|
+
getTicker(market: string): Promise<QuidaxResponse<{
|
|
331
360
|
ticker: Ticker;
|
|
332
361
|
at: number;
|
|
333
362
|
}>>;
|
|
@@ -341,7 +370,7 @@ declare class MarketsModule {
|
|
|
341
370
|
* @param params.timestamp - Starting timestamp.
|
|
342
371
|
* @returns A promise resolving to an array of k-line data points.
|
|
343
372
|
*/
|
|
344
|
-
|
|
373
|
+
getCandles(market: string, params?: {
|
|
345
374
|
limit?: number;
|
|
346
375
|
period?: number;
|
|
347
376
|
timestamp?: number;
|
|
@@ -349,12 +378,12 @@ declare class MarketsModule {
|
|
|
349
378
|
/**
|
|
350
379
|
* Retrieves candlestick data including pending trades for a market.
|
|
351
380
|
*
|
|
352
|
-
* @param
|
|
381
|
+
* @param market - The market pair (e.g., 'btcngn').
|
|
353
382
|
* @param tradeId - The ID of the pending trade reference.
|
|
354
383
|
* @param params - Optional query parameters.
|
|
355
384
|
* @returns A promise resolving to an array of k-line data points.
|
|
356
385
|
*/
|
|
357
|
-
|
|
386
|
+
getCandlesWithPendingTrades(market: string, tradeId: number, params?: {
|
|
358
387
|
limit?: number;
|
|
359
388
|
period?: number;
|
|
360
389
|
timestamp?: number;
|
|
@@ -362,22 +391,22 @@ declare class MarketsModule {
|
|
|
362
391
|
/**
|
|
363
392
|
* Retrieves the order book (asks and bids) for a specific market.
|
|
364
393
|
*
|
|
365
|
-
* @param
|
|
394
|
+
* @param market - The market pair (e.g., 'btcngn').
|
|
366
395
|
* @param params - Optional query parameters to limit asks and bids.
|
|
367
396
|
* @returns A promise resolving to the OrderBook object.
|
|
368
397
|
*/
|
|
369
|
-
getOrderBook(
|
|
398
|
+
getOrderBook(market: string, params?: {
|
|
370
399
|
asks_limit?: number;
|
|
371
400
|
bids_limit?: number;
|
|
372
401
|
}): Promise<QuidaxResponse<OrderBook>>;
|
|
373
402
|
/**
|
|
374
403
|
* Retrieves market depth data.
|
|
375
404
|
*
|
|
376
|
-
* @param
|
|
405
|
+
* @param market - The market pair (e.g., 'btcngn').
|
|
377
406
|
* @param params - Optional limit parameter.
|
|
378
407
|
* @returns A promise resolving to depth data.
|
|
379
408
|
*/
|
|
380
|
-
getDepth(
|
|
409
|
+
getDepth(market: string, params?: {
|
|
381
410
|
limit?: number;
|
|
382
411
|
}): Promise<QuidaxResponse<OrderBook>>;
|
|
383
412
|
/**
|
|
@@ -407,14 +436,14 @@ declare class TradesModule {
|
|
|
407
436
|
* @param userId - The unique ID of the user.
|
|
408
437
|
* @returns A promise resolving to a paginated list of Trade objects.
|
|
409
438
|
*/
|
|
410
|
-
|
|
439
|
+
listUserTrades(userId: string): Promise<PaginatedResponse<Trade>>;
|
|
411
440
|
/**
|
|
412
441
|
* Fetches recent trades for a given market pair.
|
|
413
442
|
*
|
|
414
443
|
* @param marketPair - The market pair (e.g., 'btcngn').
|
|
415
444
|
* @returns A promise resolving to an array of Trade objects.
|
|
416
445
|
*/
|
|
417
|
-
|
|
446
|
+
listMarketTrades(marketPair: string): Promise<QuidaxResponse<Trade[]>>;
|
|
418
447
|
}
|
|
419
448
|
//#endregion
|
|
420
449
|
//#region src/modules/deposits.d.ts
|
|
@@ -442,7 +471,7 @@ declare class DepositsModule {
|
|
|
442
471
|
* @param params - Optional filters (state, currency).
|
|
443
472
|
* @returns A promise resolving to a paginated list of Deposit objects.
|
|
444
473
|
*/
|
|
445
|
-
|
|
474
|
+
listDeposits(userId: string, params?: {
|
|
446
475
|
state?: string;
|
|
447
476
|
currency?: string;
|
|
448
477
|
}): Promise<PaginatedResponse<Deposit>>;
|
|
@@ -453,14 +482,14 @@ declare class DepositsModule {
|
|
|
453
482
|
* @param depositId - The unique ID of the deposit.
|
|
454
483
|
* @returns A promise resolving to a single Deposit object.
|
|
455
484
|
*/
|
|
456
|
-
|
|
485
|
+
getDeposit(userId: string, depositId: string): Promise<QuidaxResponse<Deposit>>;
|
|
457
486
|
/**
|
|
458
487
|
* Fetches deposits made by all sub-users across the platform.
|
|
459
488
|
*
|
|
460
489
|
* @param params - Optional filters (state, currency).
|
|
461
490
|
* @returns A promise resolving to a paginated list of Deposit objects.
|
|
462
491
|
*/
|
|
463
|
-
|
|
492
|
+
listSubAccountDeposits(params?: {
|
|
464
493
|
state?: string;
|
|
465
494
|
currency?: string;
|
|
466
495
|
}): Promise<PaginatedResponse<Deposit>>;
|
|
@@ -475,10 +504,23 @@ interface SwapTransaction {
|
|
|
475
504
|
destination_amount: string;
|
|
476
505
|
exchange_rate: string;
|
|
477
506
|
fee: string;
|
|
478
|
-
status:
|
|
507
|
+
status: SwapStatus;
|
|
479
508
|
created_at: string;
|
|
480
509
|
updated_at: string;
|
|
481
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* Swap transaction status. `failed` was added in Quidax 3.0
|
|
513
|
+
* (webhook event: `swap_transaction.failed`).
|
|
514
|
+
*/
|
|
515
|
+
type SwapStatus = "initiated" | "completed" | "failed" | (string & {});
|
|
516
|
+
interface SwapRefreshParams {
|
|
517
|
+
from_currency?: Currency;
|
|
518
|
+
to_currency?: Currency;
|
|
519
|
+
/** Provide either `from_amount` or `to_amount`, not both. */
|
|
520
|
+
from_amount?: string;
|
|
521
|
+
/** Provide either `from_amount` or `to_amount`, not both. */
|
|
522
|
+
to_amount?: string;
|
|
523
|
+
}
|
|
482
524
|
declare class SwapModule {
|
|
483
525
|
private client;
|
|
484
526
|
constructor(client: BaseClient);
|
|
@@ -489,11 +531,11 @@ declare class SwapModule {
|
|
|
489
531
|
* @param data - The swap quotation parameters.
|
|
490
532
|
* @returns A promise resolving to the temporary swap quotation details.
|
|
491
533
|
*/
|
|
492
|
-
|
|
534
|
+
previewQuotation(userId: string, data: {
|
|
493
535
|
from_currency: Currency;
|
|
494
536
|
to_currency: Currency;
|
|
495
537
|
from_amount: string;
|
|
496
|
-
to_amount
|
|
538
|
+
to_amount?: string;
|
|
497
539
|
}): Promise<QuidaxResponse<any>>;
|
|
498
540
|
/**
|
|
499
541
|
* Creates an Instant Swap quotation linked to the user account.
|
|
@@ -502,7 +544,7 @@ declare class SwapModule {
|
|
|
502
544
|
* @param data - The swap creation payload.
|
|
503
545
|
* @returns A promise resolving to a SwapTransaction object in an unconfirmed state.
|
|
504
546
|
*/
|
|
505
|
-
|
|
547
|
+
createQuotation(userId: string, data: {
|
|
506
548
|
from_currency: Currency;
|
|
507
549
|
to_currency: Currency;
|
|
508
550
|
from_amount?: string;
|
|
@@ -515,15 +557,17 @@ declare class SwapModule {
|
|
|
515
557
|
* @param quotationId - The ID of the swap quotation to confirm.
|
|
516
558
|
* @returns A promise resolving to the confirmed SwapTransaction.
|
|
517
559
|
*/
|
|
518
|
-
|
|
560
|
+
confirmQuotation(userId: string, quotationId: string): Promise<QuidaxResponse<SwapTransaction>>;
|
|
519
561
|
/**
|
|
520
|
-
* Refreshes an
|
|
562
|
+
* Refreshes an Instant Swap quotation to get updated market rates.
|
|
563
|
+
* In Quidax 3.0 a quotation can only be refreshed if it has expired or the value changes.
|
|
521
564
|
*
|
|
522
565
|
* @param userId - The unique ID of the user.
|
|
523
|
-
* @param quotationId - The ID of the
|
|
566
|
+
* @param quotationId - The ID of the swap quotation.
|
|
567
|
+
* @param data - Optional updated quotation values.
|
|
524
568
|
* @returns A promise resolving to the refreshed SwapTransaction.
|
|
525
569
|
*/
|
|
526
|
-
|
|
570
|
+
refreshQuotation(userId: string, quotationId: string, data?: SwapRefreshParams): Promise<QuidaxResponse<SwapTransaction>>;
|
|
527
571
|
/**
|
|
528
572
|
* Fetches the details of a specific Swap Transaction.
|
|
529
573
|
*
|
|
@@ -531,14 +575,14 @@ declare class SwapModule {
|
|
|
531
575
|
* @param swapTransactionId - The ID of the swap transaction.
|
|
532
576
|
* @returns A promise resolving to the SwapTransaction details.
|
|
533
577
|
*/
|
|
534
|
-
|
|
578
|
+
getSwapTransaction(userId: string, swapTransactionId: string): Promise<QuidaxResponse<SwapTransaction>>;
|
|
535
579
|
/**
|
|
536
580
|
* Retrieves a paginated list of all swap transactions for a user.
|
|
537
581
|
*
|
|
538
582
|
* @param userId - The unique ID of the user.
|
|
539
583
|
* @returns A promise resolving to a paginated list of SwapTransactions.
|
|
540
584
|
*/
|
|
541
|
-
|
|
585
|
+
listSwapTransactions(userId: string): Promise<PaginatedResponse<SwapTransaction>>;
|
|
542
586
|
}
|
|
543
587
|
//#endregion
|
|
544
588
|
//#region src/modules/orders.d.ts
|
|
@@ -572,7 +616,7 @@ declare class OrdersModule {
|
|
|
572
616
|
* @param data.volume - The amount of cryptocurrency to buy or sell.
|
|
573
617
|
* @returns A promise resolving to the created Order object.
|
|
574
618
|
*/
|
|
575
|
-
|
|
619
|
+
createOrder(userId: string, data: {
|
|
576
620
|
market: string;
|
|
577
621
|
side: 'buy' | 'sell';
|
|
578
622
|
ord_type: 'limit' | 'market';
|
|
@@ -586,7 +630,7 @@ declare class OrdersModule {
|
|
|
586
630
|
* @param params - Optional filters (market, state, order_by).
|
|
587
631
|
* @returns A promise resolving to a paginated list of Order objects.
|
|
588
632
|
*/
|
|
589
|
-
|
|
633
|
+
listOrders(userId: string, params?: {
|
|
590
634
|
market?: string;
|
|
591
635
|
state?: string;
|
|
592
636
|
order_by?: string;
|
|
@@ -598,7 +642,7 @@ declare class OrdersModule {
|
|
|
598
642
|
* @param orderId - The unique ID of the order.
|
|
599
643
|
* @returns A promise resolving to a single Order object.
|
|
600
644
|
*/
|
|
601
|
-
|
|
645
|
+
getOrder(userId: string, orderId: string): Promise<QuidaxResponse<Order>>;
|
|
602
646
|
/**
|
|
603
647
|
* Cancels a pending or open order.
|
|
604
648
|
*
|
|
@@ -606,7 +650,7 @@ declare class OrdersModule {
|
|
|
606
650
|
* @param orderId - The unique ID of the order to cancel.
|
|
607
651
|
* @returns A promise resolving to the canceled Order object.
|
|
608
652
|
*/
|
|
609
|
-
|
|
653
|
+
cancelOrder(userId: string, orderId: string): Promise<QuidaxResponse<Order>>;
|
|
610
654
|
}
|
|
611
655
|
//#endregion
|
|
612
656
|
//#region src/modules/fees.d.ts
|
|
@@ -736,8 +780,8 @@ declare class QuidaxError extends Error {
|
|
|
736
780
|
* ```typescript
|
|
737
781
|
* import Quidax from 'quidax-node';
|
|
738
782
|
*
|
|
739
|
-
* const quidax = new Quidax({
|
|
740
|
-
* const me = await quidax.users.
|
|
783
|
+
* const quidax = new Quidax({ apiKey: 'your_api_key' });
|
|
784
|
+
* const me = await quidax.users.getMe();
|
|
741
785
|
* ```
|
|
742
786
|
*/
|
|
743
787
|
declare class Quidax {
|
|
@@ -785,4 +829,4 @@ declare class Quidax {
|
|
|
785
829
|
constructor(config: QuidaxClientConfig);
|
|
786
830
|
}
|
|
787
831
|
//#endregion
|
|
788
|
-
export { BaseClient, Currency, Deposit, DepositsModule, FeesModule, Market, MarketsModule, Order, OrderBook, OrdersModule, PaginatedResponse, PaginationMeta, PaymentAddress, Quidax, Quidax as default, QuidaxClientConfig, QuidaxError, QuidaxResponse, RampModule, SwapModule, SwapTransaction, Ticker, Trade, TradesModule, User, UsersModule, Wallet, WalletsModule, Withdrawal, WithdrawalsModule };
|
|
832
|
+
export { BaseClient, Currency, Deposit, DepositsModule, FeesModule, Market, MarketsModule, Network, Order, OrderBook, OrdersModule, PaginatedResponse, PaginationMeta, PaymentAddress, Quidax, Quidax as default, QuidaxClientConfig, QuidaxError, QuidaxResponse, RampModule, SwapModule, SwapRefreshParams, SwapStatus, SwapTransaction, Ticker, Trade, TradesModule, User, UsersModule, Wallet, WalletNetwork, WalletsModule, Withdrawal, WithdrawalsModule };
|