Constructor
new RESTv2(opts)
Instantiate a new REST v2 transport.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object | options Properties
|
Methods
accountFees(cbopt) → {Promise}
- Source:
- Deprecated:
- Yes
- See:
Request account withdrawl fees
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
accountInfo(cbopt) → {Promise}
- Source:
- Deprecated:
- Yes
- See:
Request information about your account
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
accountSummary(cbopt) → {Promise}
Returns a 30-day summary of your trading volume and return on margin funding.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
accountTrades(symbolopt, startopt, endopt, limitopt, sortopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<optional> |
optional, omit/leave empty for all |
|
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
null
|
query end |
limit |
number |
<optional> |
null
|
query limit |
sort |
number |
<optional> |
null
|
if 1, sorts results oldest first |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
activeOrders(cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
activeOrdersWithIds(idsopt, cb) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ids |
Array |
<optional> |
order ids |
cb |
function | callback |
Returns:
p
- Type
- Promise
alertDelete(symbol, price, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
tBTCUSD
|
symbol |
|
price |
number |
0
|
price |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
alertList(type, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
string |
price
|
type |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
alertSet(type, symbol, price, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
string |
price
|
type |
|
symbol |
string |
tBTCUSD
|
symbol |
|
price |
number |
0
|
price |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
balances(cbopt) → {Promise}
- Source:
- Deprecated:
- Yes
- See:
Request your wallet balances
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
calcAvailableBalance(symbol, dir, rate, type, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
tBTCUSD
|
symbol |
|
dir |
string | dir |
||
rate |
number | rate |
||
type |
string | type |
||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
cancelAllFundingOffers(params, cbopt) → {Promise}
Cancel all existing funding offers
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object | parameters Properties
|
|||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
cancelFundingOffer(id, cbopt) → {Promise}
Cancel existing funding offer
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
number | offer id |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
cancelOrder(id, cbopt) → {Promise}
Cancel existing order
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
number | order id |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
cancelOrderWithCid(cid, date, cb) → {Promise}
Cancel existing order using the cID
Parameters:
Name | Type | Description |
---|---|---|
cid |
number | cid |
date |
string | Date of order YYYY-MM-DD |
cb |
Method | callback |
Returns:
p
- Type
- Promise
candles(opts, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object | options Properties
|
|||||||||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
changeLogs(startopt, endopt, limitopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
start |
number |
<optional> |
0
|
query start |
end |
number |
<optional> |
query end |
|
limit |
number |
<optional> |
null
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
claimPosition(id, cbopt) → {Promise}
Claim existing open position
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
number | position id |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
closeFunding(params, cbopt) → {Promise}
Close funding
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | parameters Properties
|
||||||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
closePosition(params, cbopt) → {Promise}
- Source:
- Deprecated:
- Yes
- See:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
object | parameters Properties
|
|||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
conf(keys, cbopt) → {Promise}
Query configuration information
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
keys |
Array.<string> | keys |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
currencies(cbopt, nullable) → {Promise}
Get a list of valid currencies ids, full names, pool and explorer
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> <nullable> |
legacy callback |
Returns:
p
- Type
- Promise
deleteSettings(keys, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
keys |
Array.<string> | keys |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
derivsPositionCollateralSet(symbol, collateral, cbopt) → {Promise}
- Source:
- See:
Changes the collateral value of an active derivatives position for a certain pair.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
symbol |
string | symbol |
|
collateral |
number | collateral |
|
cb |
function |
<optional> |
legacy callback |
Returns:
p
- Type
- Promise
exchangeRate(ccy1, ccy2) → {Promise}
Parameters:
Name | Type | Description |
---|---|---|
ccy1 |
string | i.e. BTC |
ccy2 |
string | i.e. USD |
Returns:
p - resolves to currenct exchange rate
- Type
- Promise
fundingCreditHistory(symbolopt, startopt, endopt, limitopt, cbopt) → {Promise}
- Source:
- See:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<optional> |
omit/leave empty for all |
|
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
null
|
query end |
limit |
number |
<optional> |
null
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
fundingCredits(symbolopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<optional> |
fUSD
|
symbol |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
fundingInfo(key, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string |
fUSD
|
key |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
fundingLoanHistory(symbolopt, startopt, endopt, limitopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<optional> |
omit/leave empty for all |
|
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
null
|
query end |
limit |
number |
<optional> |
null
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
fundingLoans(symbolopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<optional> |
fUSD
|
symbol |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
fundingOfferHistory(symbolopt, startopt, endopt, limitopt, cbopt) → {Promise}
- Source:
- See:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<optional> |
omit/leave empty for all |
|
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
null
|
query end |
limit |
number |
<optional> |
null
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
fundingOffers(symbol, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
fUSD
|
symbol |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
fundingTrades(symbolopt, startopt, endopt, limitopt, cbopt) → {Promise}
- Source:
- See:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<optional> |
fBTC
|
optional, omit/leave empty for all |
start |
number |
<optional> |
0
|
query start |
end |
number |
<optional> |
query end |
|
limit |
number |
<optional> |
null
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
futures(cbopt, nullable) → {Promise}
Get a list of valid symbol names
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> <nullable> |
legacy callback |
Returns:
p
- Type
- Promise
generateToken(opts, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object | options Properties
|
|||||||||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
getDepositAddress(params, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | parameters Properties
|
|||||||||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
getSettings(keys, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
keys |
Array.<string> | keys |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
getURL() → {boolean}
Returns:
url
- Type
- boolean
keyPermissions(cbopt) → {Promise}
- Source:
- Deprecated:
- Yes
- See:
Fetch the permissions of the key being used to generate this request
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
ledgers(filters, startopt, endopt, limitopt, cbopt) → {Promise}
- Source:
- See:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
filters |
object | string | filters |
||
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
query end |
|
limit |
number |
<optional> |
25
|
default 25 |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
liquidations(startopt, endopt, limitopt, sortopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
null
|
query end |
limit |
number |
<optional> |
null
|
query limit |
sort |
number |
<optional> |
null
|
if 1, sorts results oldest first |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
logins(startopt, endopt, limitopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
start |
number |
<optional> |
0
|
query start |
end |
number |
<optional> |
query end |
|
limit |
number |
<optional> |
25
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
marginInfo(key, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string |
base
|
key |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
movements(ccyopt, startopt, endopt, limitopt, cbopt) → {Promise}
- Source:
- See:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
ccy |
string |
<optional> |
i.e. ETH |
|
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
query end |
|
limit |
number |
<optional> |
25
|
query limit, default 25 |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
orderBook(symbol, prec, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
tBTCUSD
|
i.e. tBTCUSD |
|
prec |
string |
P0
|
i.e. P0 |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
orderHistory(symbolnullable, startopt, endopt, limitopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<nullable> |
optional, omit/leave empty for all |
|
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
null
|
query end |
limit |
number |
<optional> |
null
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
orderHistoryWithIds(idsopt, cb) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ids |
Array |
<optional> |
order ids |
cb |
function | callback |
Returns:
p
- Type
- Promise
orderTrades(symbolopt, startopt, endopt, limitopt, orderIDopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
<optional> |
tBTCUSD
|
symbol |
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
null
|
query end |
limit |
number |
<optional> |
null
|
query limit |
orderID |
number |
<optional> |
order ID |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
performance(cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
positions(cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
positionsAudit(idopt, startopt, endopt, limitopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
Array.<Array> |
<optional> |
ids of positions to audit |
|
start |
number |
<optional> |
0
|
query start |
end |
number |
<optional> |
query end |
|
limit |
number |
<optional> |
250
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
positionsHistory(startopt, endopt, limitopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
start |
number |
<optional> |
0
|
query start |
end |
number |
<optional> |
query end |
|
limit |
number |
<optional> |
50
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
stats(key, context, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string |
pos.size:1m:tBTCUSD:long
|
key |
|
context |
string |
hist
|
context |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
status(cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
statusMessages(typeopt, keysopt, cbopt) → {Promise}
- Source:
- See:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
string |
<optional> |
deriv
|
type |
keys |
Array.<string> |
<optional> |
keys |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
submitAutoFunding(params, cbopt) → {Promise}
Submit automatic funding
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | parameters Properties
|
|||||||||||||||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
submitFundingOffer(offer, cbopt) → {Promise}
Submit new funding offer
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
offer |
object | offer model instance |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
submitOrder(order, cbopt) → {Promise}
Submit new order
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
order |
Order | order model instance |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
symbolDetails(cbopt) → {Promise}
- Source:
- Deprecated:
- Yes
- See:
Get a list of valid symbol names and details
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callbak |
Returns:
p
- Type
- Promise
symbols(cbopt, nullable) → {Promise}
Get a list of valid symbol names
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> <nullable> |
legacy callback |
Returns:
p
- Type
- Promise
ticker(symbol, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
tBTCUSD
|
symbol |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
tickers(symbols, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
symbols |
Array.<string> | symbols |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
tickersHistory(symbols, startopt, endopt, limitopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbols |
Array.<string> | symbols |
||
start |
number |
<optional> |
query start timestamp |
|
end |
number |
<optional> |
query end timestamp |
|
limit |
number |
<optional> |
250
|
query limit |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
trades(symbol, startopt, endopt, limitopt, sortopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
symbol |
string |
tBTCUSD
|
symbol |
|
start |
number |
<optional> |
null
|
query start |
end |
number |
<optional> |
null
|
query end |
limit |
number |
<optional> |
null
|
query limit |
sort |
number |
<optional> |
null
|
if 1, sorts results oldest first |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
transfer(params, cbopt) → {Promise}
Execute a balance transfer between wallets
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | parameters Properties
|
|||||||||||||||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
updateOrder(changes, cbopt) → {Promise}
Update existing order
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
changes |
object | updates to order |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
updateSettings(settings, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
settings |
object | key:value map |
|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
userInfo(cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
usesAgent() → {boolean}
Returns:
usesAgent
- Type
- boolean
wallets(cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
walletsHistory(endopt, currencyopt, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
end |
number |
<optional> |
query end |
|
currency |
string |
<optional> |
null
|
currency |
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise
withdraw(params, cbopt) → {Promise}
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | parameters Properties
|
||||||||||||||||
cb |
function |
<optional> |
callback |
Returns:
p
- Type
- Promise