IPC removed, replaced by WS
This commit is contained in:
1 parent
ba4217fb24
commit
656c193511
503 files changed
+28128
-34498
No files matched your search
+14
-13
@@ -3,7 +3,7 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const Exchange = require ('./base/Exchange');
|
||||
const { ExchangeError, BadRequest, AuthenticationError, InvalidOrder, InsufficientFunds, OrderNotFound, PermissionDenied } = require ('./base/errors');
|
||||
const { ExchangeError, BadRequest, AuthenticationError, InvalidOrder, InsufficientFunds, OrderNotFound, PermissionDenied, AddressPending } = require ('./base/errors');
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -16,6 +16,7 @@ module.exports = class upbit extends Exchange {
|
||||
'version': 'v1',
|
||||
'rateLimit': 1000,
|
||||
'certified': true,
|
||||
'pro': true,
|
||||
// new metainfo interface
|
||||
'has': {
|
||||
'CORS': true,
|
||||
@@ -50,7 +51,10 @@ module.exports = class upbit extends Exchange {
|
||||
'hostname': 'api.upbit.com',
|
||||
'urls': {
|
||||
'logo': 'https://user-images.githubusercontent.com/1294454/49245610-eeaabe00-f423-11e8-9cba-4b0aed794799.jpg',
|
||||
'api': 'https://{hostname}',
|
||||
'api': {
|
||||
'public': 'https://{hostname}',
|
||||
'private': 'https://{hostname}',
|
||||
},
|
||||
'www': 'https://upbit.com',
|
||||
'doc': 'https://docs.upbit.com/docs/%EC%9A%94%EC%B2%AD-%EC%88%98-%EC%A0%9C%ED%95%9C',
|
||||
'fees': 'https://upbit.com/service_center/guide',
|
||||
@@ -539,7 +543,7 @@ module.exports = class upbit extends Exchange {
|
||||
// timestamp: 1542883543813 }
|
||||
//
|
||||
const timestamp = this.safeInteger (ticker, 'trade_timestamp');
|
||||
const symbol = this.getSymbolFromMarketId (this.safeString (ticker, 'market'), market);
|
||||
const symbol = this.getSymbolFromMarketId (this.safeString2 (ticker, 'market', 'code'), market);
|
||||
const previous = this.safeFloat (ticker, 'prev_closing_price');
|
||||
const last = this.safeFloat (ticker, 'trade_price');
|
||||
const change = this.safeFloat (ticker, 'signed_change_price');
|
||||
@@ -680,8 +684,8 @@ module.exports = class upbit extends Exchange {
|
||||
}
|
||||
}
|
||||
}
|
||||
const marketId = this.safeString (trade, 'market');
|
||||
market = this.safeValue (this.markets_by_id, marketId);
|
||||
const marketId = this.safeString2 (trade, 'market', 'code');
|
||||
market = this.safeValue (this.markets_by_id, marketId, market);
|
||||
let fee = undefined;
|
||||
let feeCurrency = undefined;
|
||||
let symbol = undefined;
|
||||
@@ -1197,6 +1201,7 @@ module.exports = class upbit extends Exchange {
|
||||
const result = {
|
||||
'info': order,
|
||||
'id': id,
|
||||
'clientOrderId': undefined,
|
||||
'timestamp': timestamp,
|
||||
'datetime': this.iso8601 (timestamp),
|
||||
'lastTradeTimestamp': lastTradeTimestamp,
|
||||
@@ -1394,7 +1399,8 @@ module.exports = class upbit extends Exchange {
|
||||
const request = {
|
||||
'currency': currency['id'],
|
||||
};
|
||||
const response = await this.fetchDepositAddress (code, this.extend (request, params));
|
||||
// https://github.com/ccxt/ccxt/issues/6452
|
||||
const response = await this.privatePostDepositsGenerateCoinAddress (this.extend (request, params));
|
||||
//
|
||||
// https://docs.upbit.com/v1.0/reference#%EC%9E%85%EA%B8%88-%EC%A3%BC%EC%86%8C-%EC%83%9D%EC%84%B1-%EC%9A%94%EC%B2%AD
|
||||
// can be any of the two responses:
|
||||
@@ -1412,12 +1418,7 @@ module.exports = class upbit extends Exchange {
|
||||
//
|
||||
const message = this.safeString (response, 'message');
|
||||
if (message !== undefined) {
|
||||
return {
|
||||
'currency': code,
|
||||
'address': undefined,
|
||||
'tag': undefined,
|
||||
'info': response,
|
||||
};
|
||||
throw new AddressPending (this.id + ' is generating ' + code + ' deposit address, call fetchDepositAddress or createDepositAddress one more time later to retrieve the generated address');
|
||||
}
|
||||
return this.parseDepositAddress (response);
|
||||
}
|
||||
@@ -1463,7 +1464,7 @@ module.exports = class upbit extends Exchange {
|
||||
}
|
||||
|
||||
sign (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
||||
let url = this.implodeParams (this.urls['api'], {
|
||||
let url = this.implodeParams (this.urls['api'][api], {
|
||||
'hostname': this.hostname,
|
||||
});
|
||||
url += '/' + this.version + '/' + this.implodeParams (path, params);
|
||||
|
||||
Reference in new issue
Block a user