quidax-node 3.3.3 → 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/dist/index.d.mts CHANGED
@@ -127,7 +127,7 @@ declare class UsersModule {
127
127
  * @returns A promise resolving to the created User object.
128
128
  * @throws {QuidaxError} If validation fails or email already exists.
129
129
  */
130
- create(data: {
130
+ createSubAccount(data: {
131
131
  email: string;
132
132
  first_name: string;
133
133
  last_name: string;
@@ -138,7 +138,7 @@ declare class UsersModule {
138
138
  *
139
139
  * @returns A promise resolving to the Parent User object.
140
140
  */
141
- getParentAccount(): Promise<QuidaxResponse<User>>;
141
+ getMe(): Promise<QuidaxResponse<User>>;
142
142
  /**
143
143
  * Edits the details of an existing sub-account.
144
144
  *
@@ -146,7 +146,7 @@ declare class UsersModule {
146
146
  * @param data - The data to update.
147
147
  * @returns A promise resolving to the updated User object.
148
148
  */
149
- edit(userId: string, data: {
149
+ updateSubAccount(userId: string, data: {
150
150
  first_name?: string;
151
151
  last_name?: string;
152
152
  phone_number?: string;
@@ -156,7 +156,7 @@ declare class UsersModule {
156
156
  *
157
157
  * @returns A promise resolving to a list of User objects.
158
158
  */
159
- getAll(): Promise<QuidaxResponse<User[]>>;
159
+ listSubAccounts(): Promise<QuidaxResponse<User[]>>;
160
160
  /**
161
161
  * Fetches the detailed profile of a specific sub-account.
162
162
  *
@@ -164,7 +164,7 @@ declare class UsersModule {
164
164
  * @returns A promise resolving to the User object.
165
165
  * @throws {QuidaxError} If the user is not found.
166
166
  */
167
- getOne(userId: string): Promise<QuidaxResponse<User>>;
167
+ getSubAccount(userId: string): Promise<QuidaxResponse<User>>;
168
168
  }
169
169
  //#endregion
170
170
  //#region src/modules/wallets.d.ts
@@ -177,7 +177,7 @@ declare class WalletsModule {
177
177
  * @param userId - The unique ID of the user. 'me' can be used for the authenticated user.
178
178
  * @returns A promise resolving to an array of Wallet objects.
179
179
  */
180
- getAll(userId: string): Promise<QuidaxResponse<Wallet[]>>;
180
+ listWallets(userId: string): Promise<QuidaxResponse<Wallet[]>>;
181
181
  /**
182
182
  * Fetches a specific cryptocurrency wallet for a user.
183
183
  *
@@ -185,7 +185,7 @@ declare class WalletsModule {
185
185
  * @param currency - The cryptocurrency ticker (e.g., 'btc', 'usdt').
186
186
  * @returns A promise resolving to a single Wallet object.
187
187
  */
188
- getOne(userId: string, currency: Currency): Promise<QuidaxResponse<Wallet>>;
188
+ getWallet(userId: string, currency: Currency): Promise<QuidaxResponse<Wallet>>;
189
189
  /**
190
190
  * Fetches the default Payment Address for a specific user's wallet.
191
191
  *
@@ -201,7 +201,7 @@ declare class WalletsModule {
201
201
  * @param currency - The cryptocurrency ticker.
202
202
  * @returns A promise resolving to an array of PaymentAddress objects.
203
203
  */
204
- getAllPaymentAddresses(userId: string, currency: Currency): Promise<QuidaxResponse<PaymentAddress[]>>;
204
+ listPaymentAddresses(userId: string, currency: Currency): Promise<QuidaxResponse<PaymentAddress[]>>;
205
205
  /**
206
206
  * Fetches a specific Payment Address by its ID.
207
207
  *
@@ -218,7 +218,7 @@ declare class WalletsModule {
218
218
  * @param userId - The unique ID of the user.
219
219
  * @param currency - The cryptocurrency ticker (e.g., 'btc', 'usdt').
220
220
  * @param network - The blockchain network (e.g., 'bitcoin', 'bep20', 'trc20').
221
- * Use `getOne`/`getAll` to see the networks a currency supports.
221
+ * Use `getWallet`/`listWallets` to see the networks a currency supports.
222
222
  * @returns A promise resolving to the newly generated PaymentAddress object.
223
223
  */
224
224
  createPaymentAddress(userId: string, currency: Currency, network: Network): Promise<QuidaxResponse<PaymentAddress>>;
@@ -247,7 +247,7 @@ declare class WithdrawalsModule {
247
247
  * @param userId - The unique ID of the user.
248
248
  * @returns A promise resolving to a paginated list of Withdrawal objects.
249
249
  */
250
- getAll(userId: string): Promise<PaginatedResponse<Withdrawal>>;
250
+ listWithdrawals(userId: string): Promise<PaginatedResponse<Withdrawal>>;
251
251
  /**
252
252
  * Fetches the details of a specific withdrawal.
253
253
  *
@@ -255,7 +255,7 @@ declare class WithdrawalsModule {
255
255
  * @param withdrawalId - The ID of the withdrawal to retrieve.
256
256
  * @returns A promise resolving to a single Withdrawal object.
257
257
  */
258
- getOne(userId: string, withdrawalId: string): Promise<QuidaxResponse<Withdrawal>>;
258
+ getWithdrawal(userId: string, withdrawalId: string): Promise<QuidaxResponse<Withdrawal>>;
259
259
  /**
260
260
  * Fetches a withdrawal by its unique reference string.
261
261
  *
@@ -263,7 +263,7 @@ declare class WithdrawalsModule {
263
263
  * @param reference - The withdrawal reference string.
264
264
  * @returns A promise resolving to a single Withdrawal object.
265
265
  */
266
- getByReference(userId: string, reference: string): Promise<QuidaxResponse<Withdrawal>>;
266
+ getWithdrawalByReference(userId: string, reference: string): Promise<QuidaxResponse<Withdrawal>>;
267
267
  /**
268
268
  * Initiates a new cryptocurrency withdrawal.
269
269
  *
@@ -275,13 +275,13 @@ declare class WithdrawalsModule {
275
275
  * @param data.fund_uid2 - Destination tag/memo (e.g. for XRP, XLM).
276
276
  * @param data.transaction_note - Optional note for the transaction.
277
277
  * @param data.reference - Unique reference for the withdrawal (required in v3.0).
278
- * If this call fails, fetch the withdrawal with `getByReference` before retrying,
278
+ * If this call fails, fetch the withdrawal with `getWithdrawalByReference` before retrying,
279
279
  * as it may already have been processed.
280
280
  * @param data.narration - Optional narration for the transaction.
281
281
  * @param data.network - Blockchain network; required for on-chain withdrawals.
282
282
  * @returns A promise resolving to the created Withdrawal object.
283
283
  */
284
- create(userId: string, data: {
284
+ createWithdrawal(userId: string, data: {
285
285
  currency: Currency;
286
286
  amount: string;
287
287
  fund_uid: string;
@@ -300,7 +300,7 @@ declare class WithdrawalsModule {
300
300
  * @param reference - The withdrawal reference string.
301
301
  * @returns A promise resolving to the created Withdrawal object.
302
302
  */
303
- ngn_to_merchant(userId: string, amount: string, merchantId: string, reference: string): Promise<QuidaxResponse<Withdrawal>>;
303
+ createNgnMerchantWithdrawal(userId: string, amount: string, merchantId: string, reference: string): Promise<QuidaxResponse<Withdrawal>>;
304
304
  /**
305
305
  * Cancels a pending withdrawal.
306
306
  *
@@ -308,7 +308,7 @@ declare class WithdrawalsModule {
308
308
  * @param withdrawalId - The ID of the withdrawal to cancel.
309
309
  * @returns A promise resolving to the canceled Withdrawal object.
310
310
  */
311
- cancel(userId: string, withdrawalId: string): Promise<QuidaxResponse<Withdrawal>>;
311
+ cancelWithdrawal(userId: string, withdrawalId: string): Promise<QuidaxResponse<Withdrawal>>;
312
312
  }
313
313
  //#endregion
314
314
  //#region src/modules/markets.d.ts
@@ -340,7 +340,7 @@ declare class MarketsModule {
340
340
  *
341
341
  * @returns A promise resolving to an array of Market objects.
342
342
  */
343
- getAll(): Promise<QuidaxResponse<Market[]>>;
343
+ listMarkets(): Promise<QuidaxResponse<Market[]>>;
344
344
  /**
345
345
  * Retrieves tickers for all available markets.
346
346
  *
@@ -353,10 +353,10 @@ declare class MarketsModule {
353
353
  /**
354
354
  * Retrieves the current ticker data for a specific market.
355
355
  *
356
- * @param currency - The market pair (e.g., 'btcngn').
356
+ * @param market - The market pair (e.g., 'btcngn').
357
357
  * @returns A promise resolving to the Ticker data.
358
358
  */
359
- getTicker(currency: string): Promise<QuidaxResponse<{
359
+ getTicker(market: string): Promise<QuidaxResponse<{
360
360
  ticker: Ticker;
361
361
  at: number;
362
362
  }>>;
@@ -370,7 +370,7 @@ declare class MarketsModule {
370
370
  * @param params.timestamp - Starting timestamp.
371
371
  * @returns A promise resolving to an array of k-line data points.
372
372
  */
373
- getKLine(market: string, params?: {
373
+ getCandles(market: string, params?: {
374
374
  limit?: number;
375
375
  period?: number;
376
376
  timestamp?: number;
@@ -378,12 +378,12 @@ declare class MarketsModule {
378
378
  /**
379
379
  * Retrieves candlestick data including pending trades for a market.
380
380
  *
381
- * @param currency - The market pair (e.g., 'btcngn').
381
+ * @param market - The market pair (e.g., 'btcngn').
382
382
  * @param tradeId - The ID of the pending trade reference.
383
383
  * @param params - Optional query parameters.
384
384
  * @returns A promise resolving to an array of k-line data points.
385
385
  */
386
- getKLineWithPending(currency: string, tradeId: number, params?: {
386
+ getCandlesWithPendingTrades(market: string, tradeId: number, params?: {
387
387
  limit?: number;
388
388
  period?: number;
389
389
  timestamp?: number;
@@ -391,22 +391,22 @@ declare class MarketsModule {
391
391
  /**
392
392
  * Retrieves the order book (asks and bids) for a specific market.
393
393
  *
394
- * @param currency - The market pair (e.g., 'btcngn').
394
+ * @param market - The market pair (e.g., 'btcngn').
395
395
  * @param params - Optional query parameters to limit asks and bids.
396
396
  * @returns A promise resolving to the OrderBook object.
397
397
  */
398
- getOrderBook(currency: string, params?: {
398
+ getOrderBook(market: string, params?: {
399
399
  asks_limit?: number;
400
400
  bids_limit?: number;
401
401
  }): Promise<QuidaxResponse<OrderBook>>;
402
402
  /**
403
403
  * Retrieves market depth data.
404
404
  *
405
- * @param currency - The market pair (e.g., 'btcngn').
405
+ * @param market - The market pair (e.g., 'btcngn').
406
406
  * @param params - Optional limit parameter.
407
407
  * @returns A promise resolving to depth data.
408
408
  */
409
- getDepth(currency: string, params?: {
409
+ getDepth(market: string, params?: {
410
410
  limit?: number;
411
411
  }): Promise<QuidaxResponse<OrderBook>>;
412
412
  /**
@@ -436,14 +436,14 @@ declare class TradesModule {
436
436
  * @param userId - The unique ID of the user.
437
437
  * @returns A promise resolving to a paginated list of Trade objects.
438
438
  */
439
- getUserTrades(userId: string): Promise<PaginatedResponse<Trade>>;
439
+ listUserTrades(userId: string): Promise<PaginatedResponse<Trade>>;
440
440
  /**
441
441
  * Fetches recent trades for a given market pair.
442
442
  *
443
443
  * @param marketPair - The market pair (e.g., 'btcngn').
444
444
  * @returns A promise resolving to an array of Trade objects.
445
445
  */
446
- getMarketTrades(marketPair: string): Promise<QuidaxResponse<Trade[]>>;
446
+ listMarketTrades(marketPair: string): Promise<QuidaxResponse<Trade[]>>;
447
447
  }
448
448
  //#endregion
449
449
  //#region src/modules/deposits.d.ts
@@ -471,7 +471,7 @@ declare class DepositsModule {
471
471
  * @param params - Optional filters (state, currency).
472
472
  * @returns A promise resolving to a paginated list of Deposit objects.
473
473
  */
474
- getAll(userId: string, params?: {
474
+ listDeposits(userId: string, params?: {
475
475
  state?: string;
476
476
  currency?: string;
477
477
  }): Promise<PaginatedResponse<Deposit>>;
@@ -482,14 +482,14 @@ declare class DepositsModule {
482
482
  * @param depositId - The unique ID of the deposit.
483
483
  * @returns A promise resolving to a single Deposit object.
484
484
  */
485
- getOne(userId: string, depositId: string): Promise<QuidaxResponse<Deposit>>;
485
+ getDeposit(userId: string, depositId: string): Promise<QuidaxResponse<Deposit>>;
486
486
  /**
487
487
  * Fetches deposits made by all sub-users across the platform.
488
488
  *
489
489
  * @param params - Optional filters (state, currency).
490
490
  * @returns A promise resolving to a paginated list of Deposit objects.
491
491
  */
492
- getSubUsersDeposits(params?: {
492
+ listSubAccountDeposits(params?: {
493
493
  state?: string;
494
494
  currency?: string;
495
495
  }): Promise<PaginatedResponse<Deposit>>;
@@ -531,7 +531,7 @@ declare class SwapModule {
531
531
  * @param data - The swap quotation parameters.
532
532
  * @returns A promise resolving to the temporary swap quotation details.
533
533
  */
534
- getQuotation(userId: string, data: {
534
+ previewQuotation(userId: string, data: {
535
535
  from_currency: Currency;
536
536
  to_currency: Currency;
537
537
  from_amount: string;
@@ -544,7 +544,7 @@ declare class SwapModule {
544
544
  * @param data - The swap creation payload.
545
545
  * @returns A promise resolving to a SwapTransaction object in an unconfirmed state.
546
546
  */
547
- create(userId: string, data: {
547
+ createQuotation(userId: string, data: {
548
548
  from_currency: Currency;
549
549
  to_currency: Currency;
550
550
  from_amount?: string;
@@ -557,7 +557,7 @@ declare class SwapModule {
557
557
  * @param quotationId - The ID of the swap quotation to confirm.
558
558
  * @returns A promise resolving to the confirmed SwapTransaction.
559
559
  */
560
- confirm(userId: string, quotationId: string): Promise<QuidaxResponse<SwapTransaction>>;
560
+ confirmQuotation(userId: string, quotationId: string): Promise<QuidaxResponse<SwapTransaction>>;
561
561
  /**
562
562
  * Refreshes an Instant Swap quotation to get updated market rates.
563
563
  * In Quidax 3.0 a quotation can only be refreshed if it has expired or the value changes.
@@ -567,7 +567,7 @@ declare class SwapModule {
567
567
  * @param data - Optional updated quotation values.
568
568
  * @returns A promise resolving to the refreshed SwapTransaction.
569
569
  */
570
- refresh(userId: string, quotationId: string, data?: SwapRefreshParams): Promise<QuidaxResponse<SwapTransaction>>;
570
+ refreshQuotation(userId: string, quotationId: string, data?: SwapRefreshParams): Promise<QuidaxResponse<SwapTransaction>>;
571
571
  /**
572
572
  * Fetches the details of a specific Swap Transaction.
573
573
  *
@@ -575,14 +575,14 @@ declare class SwapModule {
575
575
  * @param swapTransactionId - The ID of the swap transaction.
576
576
  * @returns A promise resolving to the SwapTransaction details.
577
577
  */
578
- getOne(userId: string, swapTransactionId: string): Promise<QuidaxResponse<SwapTransaction>>;
578
+ getSwapTransaction(userId: string, swapTransactionId: string): Promise<QuidaxResponse<SwapTransaction>>;
579
579
  /**
580
580
  * Retrieves a paginated list of all swap transactions for a user.
581
581
  *
582
582
  * @param userId - The unique ID of the user.
583
583
  * @returns A promise resolving to a paginated list of SwapTransactions.
584
584
  */
585
- getAll(userId: string): Promise<PaginatedResponse<SwapTransaction>>;
585
+ listSwapTransactions(userId: string): Promise<PaginatedResponse<SwapTransaction>>;
586
586
  }
587
587
  //#endregion
588
588
  //#region src/modules/orders.d.ts
@@ -616,7 +616,7 @@ declare class OrdersModule {
616
616
  * @param data.volume - The amount of cryptocurrency to buy or sell.
617
617
  * @returns A promise resolving to the created Order object.
618
618
  */
619
- create(userId: string, data: {
619
+ createOrder(userId: string, data: {
620
620
  market: string;
621
621
  side: 'buy' | 'sell';
622
622
  ord_type: 'limit' | 'market';
@@ -630,7 +630,7 @@ declare class OrdersModule {
630
630
  * @param params - Optional filters (market, state, order_by).
631
631
  * @returns A promise resolving to a paginated list of Order objects.
632
632
  */
633
- getAll(userId: string, params?: {
633
+ listOrders(userId: string, params?: {
634
634
  market?: string;
635
635
  state?: string;
636
636
  order_by?: string;
@@ -642,7 +642,7 @@ declare class OrdersModule {
642
642
  * @param orderId - The unique ID of the order.
643
643
  * @returns A promise resolving to a single Order object.
644
644
  */
645
- getOne(userId: string, orderId: string): Promise<QuidaxResponse<Order>>;
645
+ getOrder(userId: string, orderId: string): Promise<QuidaxResponse<Order>>;
646
646
  /**
647
647
  * Cancels a pending or open order.
648
648
  *
@@ -650,7 +650,7 @@ declare class OrdersModule {
650
650
  * @param orderId - The unique ID of the order to cancel.
651
651
  * @returns A promise resolving to the canceled Order object.
652
652
  */
653
- cancel(userId: string, orderId: string): Promise<QuidaxResponse<Order>>;
653
+ cancelOrder(userId: string, orderId: string): Promise<QuidaxResponse<Order>>;
654
654
  }
655
655
  //#endregion
656
656
  //#region src/modules/fees.d.ts
@@ -781,7 +781,7 @@ declare class QuidaxError extends Error {
781
781
  * import Quidax from 'quidax-node';
782
782
  *
783
783
  * const quidax = new Quidax({ apiKey: 'your_api_key' });
784
- * const me = await quidax.users.getParentAccount();
784
+ * const me = await quidax.users.getMe();
785
785
  * ```
786
786
  */
787
787
  declare class Quidax {