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.mjs CHANGED
@@ -79,7 +79,7 @@ var UsersModule = class {
79
79
  * @returns A promise resolving to the created User object.
80
80
  * @throws {QuidaxError} If validation fails or email already exists.
81
81
  */
82
- async create(data) {
82
+ async createSubAccount(data) {
83
83
  return this.client.post("/users", data);
84
84
  }
85
85
  /**
@@ -87,7 +87,7 @@ var UsersModule = class {
87
87
  *
88
88
  * @returns A promise resolving to the Parent User object.
89
89
  */
90
- async getParentAccount() {
90
+ async getMe() {
91
91
  return this.client.get("/users/me");
92
92
  }
93
93
  /**
@@ -97,7 +97,7 @@ var UsersModule = class {
97
97
  * @param data - The data to update.
98
98
  * @returns A promise resolving to the updated User object.
99
99
  */
100
- async edit(userId, data) {
100
+ async updateSubAccount(userId, data) {
101
101
  return this.client.put(`/users/${userId}`, data);
102
102
  }
103
103
  /**
@@ -105,7 +105,7 @@ var UsersModule = class {
105
105
  *
106
106
  * @returns A promise resolving to a list of User objects.
107
107
  */
108
- async getAll() {
108
+ async listSubAccounts() {
109
109
  return this.client.get("/users");
110
110
  }
111
111
  /**
@@ -115,7 +115,7 @@ var UsersModule = class {
115
115
  * @returns A promise resolving to the User object.
116
116
  * @throws {QuidaxError} If the user is not found.
117
117
  */
118
- async getOne(userId) {
118
+ async getSubAccount(userId) {
119
119
  return this.client.get(`/users/${userId}`);
120
120
  }
121
121
  };
@@ -131,7 +131,7 @@ var WalletsModule = class {
131
131
  * @param userId - The unique ID of the user. 'me' can be used for the authenticated user.
132
132
  * @returns A promise resolving to an array of Wallet objects.
133
133
  */
134
- async getAll(userId) {
134
+ async listWallets(userId) {
135
135
  return this.client.get(`/users/${userId}/wallets`);
136
136
  }
137
137
  /**
@@ -141,7 +141,7 @@ var WalletsModule = class {
141
141
  * @param currency - The cryptocurrency ticker (e.g., 'btc', 'usdt').
142
142
  * @returns A promise resolving to a single Wallet object.
143
143
  */
144
- async getOne(userId, currency) {
144
+ async getWallet(userId, currency) {
145
145
  return this.client.get(`/users/${userId}/wallets/${currency}`);
146
146
  }
147
147
  /**
@@ -161,7 +161,7 @@ var WalletsModule = class {
161
161
  * @param currency - The cryptocurrency ticker.
162
162
  * @returns A promise resolving to an array of PaymentAddress objects.
163
163
  */
164
- async getAllPaymentAddresses(userId, currency) {
164
+ async listPaymentAddresses(userId, currency) {
165
165
  return this.client.get(`/users/${userId}/wallets/${currency}/addresses`);
166
166
  }
167
167
  /**
@@ -182,7 +182,7 @@ var WalletsModule = class {
182
182
  * @param userId - The unique ID of the user.
183
183
  * @param currency - The cryptocurrency ticker (e.g., 'btc', 'usdt').
184
184
  * @param network - The blockchain network (e.g., 'bitcoin', 'bep20', 'trc20').
185
- * Use `getOne`/`getAll` to see the networks a currency supports.
185
+ * Use `getWallet`/`listWallets` to see the networks a currency supports.
186
186
  * @returns A promise resolving to the newly generated PaymentAddress object.
187
187
  */
188
188
  async createPaymentAddress(userId, currency, network) {
@@ -201,7 +201,7 @@ var WithdrawalsModule = class {
201
201
  * @param userId - The unique ID of the user.
202
202
  * @returns A promise resolving to a paginated list of Withdrawal objects.
203
203
  */
204
- async getAll(userId) {
204
+ async listWithdrawals(userId) {
205
205
  return this.client.get(`/users/${userId}/withdraws`);
206
206
  }
207
207
  /**
@@ -211,7 +211,7 @@ var WithdrawalsModule = class {
211
211
  * @param withdrawalId - The ID of the withdrawal to retrieve.
212
212
  * @returns A promise resolving to a single Withdrawal object.
213
213
  */
214
- async getOne(userId, withdrawalId) {
214
+ async getWithdrawal(userId, withdrawalId) {
215
215
  return this.client.get(`/users/${userId}/withdraws/${withdrawalId}`);
216
216
  }
217
217
  /**
@@ -221,7 +221,7 @@ var WithdrawalsModule = class {
221
221
  * @param reference - The withdrawal reference string.
222
222
  * @returns A promise resolving to a single Withdrawal object.
223
223
  */
224
- async getByReference(userId, reference) {
224
+ async getWithdrawalByReference(userId, reference) {
225
225
  return this.client.get(`/users/${userId}/withdraws/reference/${reference}`);
226
226
  }
227
227
  /**
@@ -235,13 +235,13 @@ var WithdrawalsModule = class {
235
235
  * @param data.fund_uid2 - Destination tag/memo (e.g. for XRP, XLM).
236
236
  * @param data.transaction_note - Optional note for the transaction.
237
237
  * @param data.reference - Unique reference for the withdrawal (required in v3.0).
238
- * If this call fails, fetch the withdrawal with `getByReference` before retrying,
238
+ * If this call fails, fetch the withdrawal with `getWithdrawalByReference` before retrying,
239
239
  * as it may already have been processed.
240
240
  * @param data.narration - Optional narration for the transaction.
241
241
  * @param data.network - Blockchain network; required for on-chain withdrawals.
242
242
  * @returns A promise resolving to the created Withdrawal object.
243
243
  */
244
- async create(userId, data) {
244
+ async createWithdrawal(userId, data) {
245
245
  return this.client.post(`/users/${userId}/withdraws`, data);
246
246
  }
247
247
  /**
@@ -253,7 +253,7 @@ var WithdrawalsModule = class {
253
253
  * @param reference - The withdrawal reference string.
254
254
  * @returns A promise resolving to the created Withdrawal object.
255
255
  */
256
- async ngn_to_merchant(userId, amount, merchantId, reference) {
256
+ async createNgnMerchantWithdrawal(userId, amount, merchantId, reference) {
257
257
  const payload = {
258
258
  currency: "ngn",
259
259
  amount,
@@ -271,7 +271,7 @@ var WithdrawalsModule = class {
271
271
  * @param withdrawalId - The ID of the withdrawal to cancel.
272
272
  * @returns A promise resolving to the canceled Withdrawal object.
273
273
  */
274
- async cancel(userId, withdrawalId) {
274
+ async cancelWithdrawal(userId, withdrawalId) {
275
275
  return this.client.post(`/users/${userId}/withdraws/${withdrawalId}/cancel`);
276
276
  }
277
277
  };
@@ -286,7 +286,7 @@ var MarketsModule = class {
286
286
  *
287
287
  * @returns A promise resolving to an array of Market objects.
288
288
  */
289
- async getAll() {
289
+ async listMarkets() {
290
290
  return this.client.get("/markets");
291
291
  }
292
292
  /**
@@ -300,11 +300,11 @@ var MarketsModule = class {
300
300
  /**
301
301
  * Retrieves the current ticker data for a specific market.
302
302
  *
303
- * @param currency - The market pair (e.g., 'btcngn').
303
+ * @param market - The market pair (e.g., 'btcngn').
304
304
  * @returns A promise resolving to the Ticker data.
305
305
  */
306
- async getTicker(currency) {
307
- return this.client.get(`/markets/tickers/${currency}`);
306
+ async getTicker(market) {
307
+ return this.client.get(`/markets/tickers/${market}`);
308
308
  }
309
309
  /**
310
310
  * Retrieves candlestick (k-line) data for a specific market.
@@ -316,39 +316,39 @@ var MarketsModule = class {
316
316
  * @param params.timestamp - Starting timestamp.
317
317
  * @returns A promise resolving to an array of k-line data points.
318
318
  */
319
- async getKLine(market, params) {
319
+ async getCandles(market, params) {
320
320
  return this.client.get(`/markets/${market}/k`, { params });
321
321
  }
322
322
  /**
323
323
  * Retrieves candlestick data including pending trades for a market.
324
324
  *
325
- * @param currency - The market pair (e.g., 'btcngn').
325
+ * @param market - The market pair (e.g., 'btcngn').
326
326
  * @param tradeId - The ID of the pending trade reference.
327
327
  * @param params - Optional query parameters.
328
328
  * @returns A promise resolving to an array of k-line data points.
329
329
  */
330
- async getKLineWithPending(currency, tradeId, params) {
331
- return this.client.get(`/markets/${currency}/k_with_pending_trades/${tradeId}`, { params });
330
+ async getCandlesWithPendingTrades(market, tradeId, params) {
331
+ return this.client.get(`/markets/${market}/k_with_pending_trades/${tradeId}`, { params });
332
332
  }
333
333
  /**
334
334
  * Retrieves the order book (asks and bids) for a specific market.
335
335
  *
336
- * @param currency - The market pair (e.g., 'btcngn').
336
+ * @param market - The market pair (e.g., 'btcngn').
337
337
  * @param params - Optional query parameters to limit asks and bids.
338
338
  * @returns A promise resolving to the OrderBook object.
339
339
  */
340
- async getOrderBook(currency, params) {
341
- return this.client.get(`/markets/${currency}/order_book`, { params });
340
+ async getOrderBook(market, params) {
341
+ return this.client.get(`/markets/${market}/order_book`, { params });
342
342
  }
343
343
  /**
344
344
  * Retrieves market depth data.
345
345
  *
346
- * @param currency - The market pair (e.g., 'btcngn').
346
+ * @param market - The market pair (e.g., 'btcngn').
347
347
  * @param params - Optional limit parameter.
348
348
  * @returns A promise resolving to depth data.
349
349
  */
350
- async getDepth(currency, params) {
351
- return this.client.get(`/markets/${currency}/depth`, { params });
350
+ async getDepth(market, params) {
351
+ return this.client.get(`/markets/${market}/depth`, { params });
352
352
  }
353
353
  /**
354
354
  * Retrieves a high-level summary of all markets.
@@ -371,7 +371,7 @@ var TradesModule = class {
371
371
  * @param userId - The unique ID of the user.
372
372
  * @returns A promise resolving to a paginated list of Trade objects.
373
373
  */
374
- async getUserTrades(userId) {
374
+ async listUserTrades(userId) {
375
375
  return this.client.get(`/users/${userId}/trades`);
376
376
  }
377
377
  /**
@@ -380,7 +380,7 @@ var TradesModule = class {
380
380
  * @param marketPair - The market pair (e.g., 'btcngn').
381
381
  * @returns A promise resolving to an array of Trade objects.
382
382
  */
383
- async getMarketTrades(marketPair) {
383
+ async listMarketTrades(marketPair) {
384
384
  return this.client.get(`/trades/${marketPair}`);
385
385
  }
386
386
  };
@@ -397,7 +397,7 @@ var DepositsModule = class {
397
397
  * @param params - Optional filters (state, currency).
398
398
  * @returns A promise resolving to a paginated list of Deposit objects.
399
399
  */
400
- async getAll(userId, params) {
400
+ async listDeposits(userId, params) {
401
401
  return this.client.get(`/users/${userId}/deposits`, { params });
402
402
  }
403
403
  /**
@@ -407,7 +407,7 @@ var DepositsModule = class {
407
407
  * @param depositId - The unique ID of the deposit.
408
408
  * @returns A promise resolving to a single Deposit object.
409
409
  */
410
- async getOne(userId, depositId) {
410
+ async getDeposit(userId, depositId) {
411
411
  return this.client.get(`/users/${userId}/deposits/${depositId}`);
412
412
  }
413
413
  /**
@@ -416,7 +416,7 @@ var DepositsModule = class {
416
416
  * @param params - Optional filters (state, currency).
417
417
  * @returns A promise resolving to a paginated list of Deposit objects.
418
418
  */
419
- async getSubUsersDeposits(params) {
419
+ async listSubAccountDeposits(params) {
420
420
  return this.client.get("/users/deposits/all", { params });
421
421
  }
422
422
  };
@@ -433,7 +433,7 @@ var SwapModule = class {
433
433
  * @param data - The swap quotation parameters.
434
434
  * @returns A promise resolving to the temporary swap quotation details.
435
435
  */
436
- async getQuotation(userId, data) {
436
+ async previewQuotation(userId, data) {
437
437
  return this.client.post(`/users/${userId}/temporary_swap_quotation`, data);
438
438
  }
439
439
  /**
@@ -443,7 +443,7 @@ var SwapModule = class {
443
443
  * @param data - The swap creation payload.
444
444
  * @returns A promise resolving to a SwapTransaction object in an unconfirmed state.
445
445
  */
446
- async create(userId, data) {
446
+ async createQuotation(userId, data) {
447
447
  return this.client.post(`/users/${userId}/swap_quotation`, data);
448
448
  }
449
449
  /**
@@ -453,7 +453,7 @@ var SwapModule = class {
453
453
  * @param quotationId - The ID of the swap quotation to confirm.
454
454
  * @returns A promise resolving to the confirmed SwapTransaction.
455
455
  */
456
- async confirm(userId, quotationId) {
456
+ async confirmQuotation(userId, quotationId) {
457
457
  return this.client.post(`/users/${userId}/swap_quotation/${quotationId}/confirm`);
458
458
  }
459
459
  /**
@@ -465,7 +465,7 @@ var SwapModule = class {
465
465
  * @param data - Optional updated quotation values.
466
466
  * @returns A promise resolving to the refreshed SwapTransaction.
467
467
  */
468
- async refresh(userId, quotationId, data) {
468
+ async refreshQuotation(userId, quotationId, data) {
469
469
  return this.client.post(`/users/${userId}/swap_quotation/${quotationId}/refresh`, data);
470
470
  }
471
471
  /**
@@ -475,7 +475,7 @@ var SwapModule = class {
475
475
  * @param swapTransactionId - The ID of the swap transaction.
476
476
  * @returns A promise resolving to the SwapTransaction details.
477
477
  */
478
- async getOne(userId, swapTransactionId) {
478
+ async getSwapTransaction(userId, swapTransactionId) {
479
479
  return this.client.get(`/users/${userId}/swap_transactions/${swapTransactionId}`);
480
480
  }
481
481
  /**
@@ -484,7 +484,7 @@ var SwapModule = class {
484
484
  * @param userId - The unique ID of the user.
485
485
  * @returns A promise resolving to a paginated list of SwapTransactions.
486
486
  */
487
- async getAll(userId) {
487
+ async listSwapTransactions(userId) {
488
488
  return this.client.get(`/users/${userId}/swap_transactions`);
489
489
  }
490
490
  };
@@ -506,7 +506,7 @@ var OrdersModule = class {
506
506
  * @param data.volume - The amount of cryptocurrency to buy or sell.
507
507
  * @returns A promise resolving to the created Order object.
508
508
  */
509
- async create(userId, data) {
509
+ async createOrder(userId, data) {
510
510
  return this.client.post(`/users/${userId}/orders`, data);
511
511
  }
512
512
  /**
@@ -516,7 +516,7 @@ var OrdersModule = class {
516
516
  * @param params - Optional filters (market, state, order_by).
517
517
  * @returns A promise resolving to a paginated list of Order objects.
518
518
  */
519
- async getAll(userId, params) {
519
+ async listOrders(userId, params) {
520
520
  return this.client.get(`/users/${userId}/orders`, { params });
521
521
  }
522
522
  /**
@@ -526,7 +526,7 @@ var OrdersModule = class {
526
526
  * @param orderId - The unique ID of the order.
527
527
  * @returns A promise resolving to a single Order object.
528
528
  */
529
- async getOne(userId, orderId) {
529
+ async getOrder(userId, orderId) {
530
530
  return this.client.get(`/users/${userId}/orders/${orderId}`);
531
531
  }
532
532
  /**
@@ -536,7 +536,7 @@ var OrdersModule = class {
536
536
  * @param orderId - The unique ID of the order to cancel.
537
537
  * @returns A promise resolving to the canceled Order object.
538
538
  */
539
- async cancel(userId, orderId) {
539
+ async cancelOrder(userId, orderId) {
540
540
  return this.client.post(`/users/${userId}/orders/${orderId}/cancel`);
541
541
  }
542
542
  };
@@ -696,7 +696,7 @@ var RampModule = class {
696
696
  * import Quidax from 'quidax-node';
697
697
  *
698
698
  * const quidax = new Quidax({ apiKey: 'your_api_key' });
699
- * const me = await quidax.users.getParentAccount();
699
+ * const me = await quidax.users.getMe();
700
700
  * ```
701
701
  */
702
702
  var Quidax = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidax-node",
3
- "version": "3.3.3",
3
+ "version": "4.1.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "files": [