ccxt 4.2.46 → 4.2.48

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/js/src/upbit.js CHANGED
@@ -46,6 +46,7 @@ export default class upbit extends Exchange {
46
46
  'fetchClosedOrders': true,
47
47
  'fetchDepositAddress': true,
48
48
  'fetchDepositAddresses': true,
49
+ 'fetchDeposit': true,
49
50
  'fetchDeposits': true,
50
51
  'fetchFundingHistory': false,
51
52
  'fetchFundingRate': false,
@@ -71,6 +72,7 @@ export default class upbit extends Exchange {
71
72
  'fetchTradingFee': true,
72
73
  'fetchTradingFees': false,
73
74
  'fetchTransactions': false,
75
+ 'fetchWithdrawal': true,
74
76
  'fetchWithdrawals': true,
75
77
  'transfer': false,
76
78
  'withdraw': true,
@@ -1196,6 +1198,45 @@ export default class upbit extends Exchange {
1196
1198
  //
1197
1199
  return this.parseTransactions(response, currency, since, limit);
1198
1200
  }
1201
+ async fetchDeposit(id, code = undefined, params = {}) {
1202
+ /**
1203
+ * @method
1204
+ * @name upbit#fetchDeposit
1205
+ * @description fetch information on a deposit
1206
+ * @see https://global-docs.upbit.com/reference/individual-deposit-inquiry
1207
+ * @param {string} id the unique id for the deposit
1208
+ * @param {string} [code] unified currency code of the currency deposited
1209
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1210
+ * @param {string} [params.txid] withdrawal transaction id, the id argument is reserved for uuid
1211
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1212
+ */
1213
+ await this.loadMarkets();
1214
+ const request = {
1215
+ 'uuid': id,
1216
+ };
1217
+ let currency = undefined;
1218
+ if (code !== undefined) {
1219
+ currency = this.currency(code);
1220
+ request['currency'] = currency['id'];
1221
+ }
1222
+ const response = await this.privateGetDeposit(this.extend(request, params));
1223
+ //
1224
+ // {
1225
+ // "type": "deposit",
1226
+ // "uuid": "7f54527e-2eee-4268-860e-fd8b9d7fe3c7",
1227
+ // "currency": "ADA",
1228
+ // "net_type": "ADA",
1229
+ // "txid": "99795bbfeca91eaa071068bb659b33eeb65d8aaff2551fdf7c78f345d188952b",
1230
+ // "state": "ACCEPTED",
1231
+ // "created_at": "2023-12-12T04:58:41Z",
1232
+ // "done_at": "2023-12-12T05:31:50Z",
1233
+ // "amount": "35.72344",
1234
+ // "fee": "0.0",
1235
+ // "transaction_type": "default"
1236
+ // }
1237
+ //
1238
+ return this.parseTransaction(response, currency);
1239
+ }
1199
1240
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
1200
1241
  /**
1201
1242
  * @method
@@ -1240,13 +1281,52 @@ export default class upbit extends Exchange {
1240
1281
  //
1241
1282
  return this.parseTransactions(response, currency, since, limit);
1242
1283
  }
1284
+ async fetchWithdrawal(id, code = undefined, params = {}) {
1285
+ /**
1286
+ * @method
1287
+ * @name upbit#fetchWithdrawal
1288
+ * @description fetch data on a currency withdrawal via the withdrawal id
1289
+ * @see https://global-docs.upbit.com/reference/individual-withdrawal-inquiry
1290
+ * @param {string} id the unique id for the withdrawal
1291
+ * @param {string} [code] unified currency code of the currency withdrawn
1292
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1293
+ * @param {string} [params.txid] withdrawal transaction id, the id argument is reserved for uuid
1294
+ * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
1295
+ */
1296
+ await this.loadMarkets();
1297
+ const request = {
1298
+ 'uuid': id,
1299
+ };
1300
+ let currency = undefined;
1301
+ if (code !== undefined) {
1302
+ currency = this.currency(code);
1303
+ request['currency'] = currency['id'];
1304
+ }
1305
+ const response = await this.privateGetWithdraw(this.extend(request, params));
1306
+ //
1307
+ // {
1308
+ // "type": "withdraw",
1309
+ // "uuid": "95ef274b-23a6-4de4-95b0-5cbef4ca658f",
1310
+ // "currency": "ADA",
1311
+ // "net_type": "ADA",
1312
+ // "txid": "b1528f149297a71671b86636f731f8fdb0ff53da0f1d8c19093d59df96f34583",
1313
+ // "state": "DONE",
1314
+ // "created_at": "2023-12-14T02:46:52Z",
1315
+ // "done_at": "2023-12-14T03:10:11Z",
1316
+ // "amount": "35.22344",
1317
+ // "fee": "0.5",
1318
+ // "transaction_type": "default"
1319
+ // }
1320
+ //
1321
+ return this.parseTransaction(response, currency);
1322
+ }
1243
1323
  parseTransactionStatus(status) {
1244
1324
  const statuses = {
1245
1325
  'submitting': 'pending',
1246
1326
  'submitted': 'pending',
1247
1327
  'almost_accepted': 'pending',
1248
1328
  'rejected': 'failed',
1249
- 'accepted': 'pending',
1329
+ 'accepted': 'ok',
1250
1330
  'processing': 'pending',
1251
1331
  'done': 'ok',
1252
1332
  'canceled': 'canceled', // 취소됨
@@ -1255,7 +1335,7 @@ export default class upbit extends Exchange {
1255
1335
  }
1256
1336
  parseTransaction(transaction, currency = undefined) {
1257
1337
  //
1258
- // fetchDeposits
1338
+ // fetchDeposits, fetchDeposit
1259
1339
  //
1260
1340
  // {
1261
1341
  // "type": "deposit",
@@ -1269,7 +1349,7 @@ export default class upbit extends Exchange {
1269
1349
  // "fee": "0.0"
1270
1350
  // }
1271
1351
  //
1272
- // fetchWithdrawals
1352
+ // fetchWithdrawals, fetchWithdrawal
1273
1353
  //
1274
1354
  // {
1275
1355
  // "type": "withdraw",
@@ -1284,27 +1364,21 @@ export default class upbit extends Exchange {
1284
1364
  // "krw_amount": "80420.0"
1285
1365
  // }
1286
1366
  //
1287
- const id = this.safeString(transaction, 'uuid');
1288
- const amount = this.safeNumber(transaction, 'amount');
1289
1367
  const address = undefined; // not present in the data structure received from the exchange
1290
1368
  const tag = undefined; // not present in the data structure received from the exchange
1291
- const txid = this.safeString(transaction, 'txid');
1292
1369
  const updatedRaw = this.safeString(transaction, 'done_at');
1293
- const updated = this.parse8601(updatedRaw);
1294
1370
  const timestamp = this.parse8601(this.safeString(transaction, 'created_at', updatedRaw));
1295
1371
  let type = this.safeString(transaction, 'type');
1296
1372
  if (type === 'withdraw') {
1297
1373
  type = 'withdrawal';
1298
1374
  }
1299
1375
  const currencyId = this.safeString(transaction, 'currency');
1300
- const code = this.safeCurrencyCode(currencyId);
1301
- const status = this.parseTransactionStatus(this.safeStringLower(transaction, 'state'));
1302
- const feeCost = this.safeNumber(transaction, 'fee');
1376
+ const code = this.safeCurrencyCode(currencyId, currency);
1303
1377
  return {
1304
1378
  'info': transaction,
1305
- 'id': id,
1379
+ 'id': this.safeString(transaction, 'uuid'),
1306
1380
  'currency': code,
1307
- 'amount': amount,
1381
+ 'amount': this.safeNumber(transaction, 'amount'),
1308
1382
  'network': undefined,
1309
1383
  'address': address,
1310
1384
  'addressTo': undefined,
@@ -1312,17 +1386,17 @@ export default class upbit extends Exchange {
1312
1386
  'tag': tag,
1313
1387
  'tagTo': undefined,
1314
1388
  'tagFrom': undefined,
1315
- 'status': status,
1389
+ 'status': this.parseTransactionStatus(this.safeStringLower(transaction, 'state')),
1316
1390
  'type': type,
1317
- 'updated': updated,
1318
- 'txid': txid,
1391
+ 'updated': this.parse8601(updatedRaw),
1392
+ 'txid': this.safeString(transaction, 'txid'),
1319
1393
  'timestamp': timestamp,
1320
1394
  'datetime': this.iso8601(timestamp),
1321
1395
  'internal': undefined,
1322
1396
  'comment': undefined,
1323
1397
  'fee': {
1324
1398
  'currency': code,
1325
- 'cost': feeCost,
1399
+ 'cost': this.safeNumber(transaction, 'fee'),
1326
1400
  },
1327
1401
  };
1328
1402
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.46",
3
+ "version": "4.2.48",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",
package/skip-tests.json CHANGED
@@ -357,7 +357,7 @@
357
357
  },
358
358
  "onetrading": {
359
359
  "skip": true,
360
- "until": "2024-02-18",
360
+ "until": "2024-02-28",
361
361
  "skipWs": true,
362
362
  "skipMethods": {
363
363
  "fetchOrderBook": "some bid might be lower than next bid",