ccxt 4.4.67 → 4.4.68

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/luno.js CHANGED
@@ -29,6 +29,7 @@ export default class luno extends Exchange {
29
29
  'cancelOrder': true,
30
30
  'closeAllPositions': false,
31
31
  'closePosition': false,
32
+ 'createDepositAddress': true,
32
33
  'createOrder': true,
33
34
  'createReduceOnlyOrder': false,
34
35
  'fetchAccounts': true,
@@ -37,6 +38,7 @@ export default class luno extends Exchange {
37
38
  'fetchClosedOrders': true,
38
39
  'fetchCrossBorrowRate': false,
39
40
  'fetchCrossBorrowRates': false,
41
+ 'fetchDepositAddress': true,
40
42
  'fetchFundingHistory': false,
41
43
  'fetchFundingRate': false,
42
44
  'fetchFundingRateHistory': false,
@@ -1205,6 +1207,116 @@ export default class luno extends Exchange {
1205
1207
  'fee': undefined,
1206
1208
  }, currency);
1207
1209
  }
1210
+ /**
1211
+ * @method
1212
+ * @name luno#createDepositAddress
1213
+ * @description create a currency deposit address
1214
+ * @see https://www.luno.com/en/developers/api#tag/Receive/operation/createFundingAddress
1215
+ * @param {string} code unified currency code of the currency for the deposit address
1216
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1217
+ * @param {string} [params.name] an optional name for the new address
1218
+ * @param {int} [params.account_id] an optional account id for the new address
1219
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1220
+ */
1221
+ async createDepositAddress(code, params = {}) {
1222
+ await this.loadMarkets();
1223
+ const currency = this.currency(code);
1224
+ const request = {
1225
+ 'asset': currency['id'],
1226
+ };
1227
+ const response = await this.privatePostFundingAddress(this.extend(request, params));
1228
+ //
1229
+ // {
1230
+ // "account_id": "string",
1231
+ // "address": "string",
1232
+ // "address_meta": [
1233
+ // {
1234
+ // "label": "string",
1235
+ // "value": "string"
1236
+ // }
1237
+ // ],
1238
+ // "asset": "string",
1239
+ // "assigned_at": 0,
1240
+ // "name": "string",
1241
+ // "network": 0,
1242
+ // "qr_code_uri": "string",
1243
+ // "receive_fee": "string",
1244
+ // "total_received": "string",
1245
+ // "total_unconfirmed": "string"
1246
+ // }
1247
+ //
1248
+ return this.parseDepositAddress(response, currency);
1249
+ }
1250
+ /**
1251
+ * @method
1252
+ * @name luno#fetchDepositAddress
1253
+ * @description fetch the deposit address for a currency associated with this account
1254
+ * @see https://www.luno.com/en/developers/api#tag/Receive/operation/getFundingAddress
1255
+ * @param {string} code unified currency code
1256
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1257
+ * @param {string} [params.address] a specific cryptocurrency address to retrieve
1258
+ * @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
1259
+ */
1260
+ async fetchDepositAddress(code, params = {}) {
1261
+ await this.loadMarkets();
1262
+ const currency = this.currency(code);
1263
+ const request = {
1264
+ 'asset': currency['id'],
1265
+ };
1266
+ const response = await this.privateGetFundingAddress(this.extend(request, params));
1267
+ //
1268
+ // {
1269
+ // "account_id": "string",
1270
+ // "address": "string",
1271
+ // "address_meta": [
1272
+ // {
1273
+ // "label": "string",
1274
+ // "value": "string"
1275
+ // }
1276
+ // ],
1277
+ // "asset": "string",
1278
+ // "assigned_at": 0,
1279
+ // "name": "string",
1280
+ // "network": 0,
1281
+ // "qr_code_uri": "string",
1282
+ // "receive_fee": "string",
1283
+ // "total_received": "string",
1284
+ // "total_unconfirmed": "string"
1285
+ // }
1286
+ //
1287
+ return this.parseDepositAddress(response, currency);
1288
+ }
1289
+ parseDepositAddress(depositAddress, currency = undefined) {
1290
+ //
1291
+ // {
1292
+ // "account_id": "string",
1293
+ // "address": "string",
1294
+ // "address_meta": [
1295
+ // {
1296
+ // "label": "string",
1297
+ // "value": "string"
1298
+ // }
1299
+ // ],
1300
+ // "asset": "string",
1301
+ // "assigned_at": 0,
1302
+ // "name": "string",
1303
+ // "network": 0,
1304
+ // "qr_code_uri": "string",
1305
+ // "receive_fee": "string",
1306
+ // "total_received": "string",
1307
+ // "total_unconfirmed": "string"
1308
+ // }
1309
+ //
1310
+ const currencyId = this.safeStringUpper(depositAddress, 'currency');
1311
+ const code = this.safeCurrencyCode(currencyId, currency);
1312
+ return {
1313
+ 'info': depositAddress,
1314
+ 'currency': code,
1315
+ 'network': undefined,
1316
+ 'address': this.safeString(depositAddress, 'address'),
1317
+ 'tag': this.safeString(depositAddress, 'name'),
1318
+ };
1319
+ }
1208
1320
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
1209
1321
  let url = this.urls['api'][api] + '/' + this.version + '/' + this.implodeParams(path, params);
1210
1322
  const query = this.omit(params, this.extractParams(path));
@@ -44,6 +44,7 @@ export default class tradeogre extends Exchange {
44
44
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
45
45
  * @param {int} [limit] the maximum amount of candles to fetch
46
46
  * @param {object} [params] extra parameters specific to the exchange API endpoint
47
+ * @param {int} [params.until] timestamp of the latest candle in ms
47
48
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
48
49
  */
49
50
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
@@ -125,7 +125,7 @@ export default class tradeogre extends Exchange {
125
125
  'orders/{market}': 1,
126
126
  'ticker/{market}': 1,
127
127
  'history/{market}': 1,
128
- 'chart/{interval}/{market}/{timestamp}': 1,
128
+ 'chart/{interval}/{market}': 1,
129
129
  },
130
130
  },
131
131
  'private': {
@@ -438,6 +438,7 @@ export default class tradeogre extends Exchange {
438
438
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
439
439
  * @param {int} [limit] the maximum amount of candles to fetch
440
440
  * @param {object} [params] extra parameters specific to the exchange API endpoint
441
+ * @param {int} [params.until] timestamp of the latest candle in ms
441
442
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
442
443
  */
443
444
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
@@ -447,13 +448,12 @@ export default class tradeogre extends Exchange {
447
448
  'market': market['id'],
448
449
  'interval': this.safeString(this.timeframes, timeframe, timeframe),
449
450
  };
450
- if (since === undefined) {
451
- throw new BadRequest(this.id + ' fetchOHLCV requires a since argument');
451
+ const until = this.safeInteger(params, 'until');
452
+ if (until !== undefined) {
453
+ params = this.omit(params, 'until');
454
+ request['timestamp'] = until;
452
455
  }
453
- else {
454
- request['timestamp'] = since;
455
- }
456
- const response = await this.publicGetChartIntervalMarketTimestamp(this.extend(request, params));
456
+ const response = await this.publicGetChartIntervalMarket(this.extend(request, params));
457
457
  //
458
458
  // [
459
459
  // [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.4.67",
3
+ "version": "4.4.68",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",
@@ -195,8 +195,8 @@
195
195
  "@types/node": "^18.15.11",
196
196
  "@typescript-eslint/eslint-plugin": "^5.30.5",
197
197
  "@typescript-eslint/parser": "^5.30.5",
198
- "ansicolor": "1.1.81",
199
- "as-table": "1.0.37",
198
+ "ansicolor": "^2.0.0",
199
+ "as-table": "^1.0.55",
200
200
  "asciichart": "^1.5.25",
201
201
  "assert": "^2.0.0",
202
202
  "ast-transpiler": "^0.0.65",
@@ -208,7 +208,7 @@
208
208
  "esmify": "^2.1.1",
209
209
  "https-proxy-agent": "^5.0.1",
210
210
  "jsdoc-to-markdown": "^8.0.0",
211
- "ololog": "1.1.155",
211
+ "ololog": "^1.1.175",
212
212
  "piscina": "^3.2.0",
213
213
  "replace-in-file": "^6.3.5",
214
214
  "rollup": "^2.70.1",