@filip
@ivan
API-Overview
Gemini offers both public and private REST APIs.
Public REST APIs provide market data such as:
- current order book
- recent trading activity
- trade history
Private REST APIs allow you to manage both orders and funds:
- place and cancel orders
- see your active orders
- see your trading history and trade volume
- get your available balances
In order to access the public API, you don’t even need an API key, because this information is for everyone. When it comes to your account and your funds, you will require an API key and an API secret to use the private REST API. Please note that the API secret will only be shown to you when you create your API key. You have to save the secret on a secure place. If you lose your API secret you simply should delete the corresponding API key and create a new one.
For accessing the Gemini sandbox API with JavaScript you will have to define a few things:
- The Node module you use, in this case gemini-api
- Your API key
- Your API secret
- Your Rest Client
const GeminiAPI = require("gemini-api").default;
const key="account-vR2hcSQbs2EIYA1Kvw3e";
const secret="3zuoXDdFUvbLyHoQRB1Ds5Cqm7Y6";
const restClient = new GeminiAPI({key, secret, sandbox:true});
Please note that the key and secret provided above no longer work since I have deleted this API key.
With this preparation you can use the sandbox API commands of the Gemini exchange using the wrapper “gemini-api”:
GetAllSymbols()
This API call will return all symbols or trading pairs available at the Gemini exchange in an array.
Call:
restClient.getAllSymbols()
.then(response => console.log(response))
.catch(error => console.log(error));
You could write the code above in a line as well.
Reply
[
'btcusd', 'ethbtc',
'ethusd', 'bchusd',
'bchbtc', 'bcheth',
'ltcusd', 'ltcbtc',
'ltceth', 'ltcbch',
'zecusd', 'zecbtc',
'zeceth', 'zecbch',
'zecltc'
]
getTicker(symbol)
For this API call you will need a valid parameter, for example the BTC/USD trading pair “btcusd”. You will get information about the current bid, the current ask the volume denominated in both currencies of the trading pair, a timestamp and the last price traded.
Call:
restClient.getTicker("btcusd")
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{
bid: '7192.25',
ask: '7192.84',
volume: {
BTC: '63.4010402',
USD: '455658.977693172',
timestamp: 1587333600000
},
last: '7192.25'
}
getOrderBook(symbol,params={})
This will return the current order book of the market defined in symbol as two arrays (bids / asks).
Since this is a public API command you can also see the result of this request in your browser.
Try https://api.gemini.com/v1/book/btcusd or https://api.sandbox.gemini.com/v1/book/btcusd to view it in your browser and you will see that it works!
Call:
restClient.getOrderBook("btcusd")
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{
bids: [
{ price: '7171.64', amount: '3.2', timestamp: '1587334797' },
...
{ price: '79.97', amount: '7', timestamp: '1587334797' }
],
asks: [
{ price: '7174.64', amount: '0.129688', timestamp: '1587334797' },
...
{ price: '150000.00', amount: '1', timestamp: '1587334797' }
]
}
Please note that I omitted most of the orders in between ( … ).
getTradeHistory(symbol,params={})
This will return the trades that have executed since the specified timestamp. Timestamps are either seconds or milliseconds since the epoch (1970-01-01).
Access via HTTP request in your browser:
https://api.gemini.com/v1/trades/btcusd or https://api.sandbox.gemini.com/v1/trades/btcusd
Call:
restClient.getTradeHistory("btcusd")
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
[
{
timestamp: 1587335536,
timestampms: 1587335536731,
tid: 570522542,
price: '7195.78',
amount: '0.002',
exchange: 'gemini',
type: 'buy'
},
...
{
timestamp: 1587335070,
timestampms: 1587335070613,
tid: 570521335,
price: '7191.00',
amount: '0.002',
exchange: 'gemini',
type: 'buy'
}
]
getCurrentAuction(symbol)
For more details please refer to https://docs.gemini.com/rest-api/#current-auction.
HTTP REQUEST (example for symbol “btcusd”)
GET https://api.gemini.com/v1/auction/btcusd
SANDBOX (example for symbol “btcusd”)
Base URL can be changed to https://api.sandbox.gemini.com/v1/auction/btcusd for test purposes.
Call:
restClient.getCurrentAuction("btcusd")
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{ next_auction_ms: 1574542800000 }
Please note that the reply from Gemini exchange is different:
{"closed_until_ms":1587351600000,"next_auction_ms":1587380400000}
getAuctionHistory(symbol, params={})
HTTP REQUEST (example for symbol “btcusd”)
https://api.sandbox.gemini.com/v1/auction/btcusd/history
SANDBOX (example for symbol “btcusd”)
Base URL can be changed to https://api.sandbox.gemini.com/v1/auction/btcusd/history for test purposes.
Call:
restClient.getAuctionHistory("btcusd")
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
[
{
timestamp: 1574370000,
timestampms: 1574370000000,
eid: 325908450,
auction_id: 3740,
event_type: 'auction',
auction_result: 'failure',
highest_bid_price: '7576.00',
lowest_ask_price: '7582.14',
unmatched_collar_quantity: '0',
collar_price: '7579.07'
},
...
{
timestamp: 1574110560,
timestampms: 1574110560000,
eid: 322543297,
auction_id: 3725,
event_type: 'indicative',
auction_result: 'failure',
highest_bid_price: '8180.37',
lowest_ask_price: '8180.38',
unmatched_collar_quantity: '0',
collar_price: '8180.375'
}
]
newOrder(params={})
For more details please refer to https://docs.gemini.com/rest-api/#new-order.
For this API call a few parameters have to be provided:
- symbol : The trading pair, for example “btcusd”
- amount : Amount of BTC
- price : Price in USD / BTC.
- side : “buy” or “sell”
More complex orders may require additional paramaters, for example “stop_price” for stop limit orders.
In the following example we will set a limit order to buy 10 BTC for a price of 100 USD for each BTC.
Call:
restClient.newOrder({amount:10,price:100,side:"buy",symbol:"btcusd"})
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{
order_id: '570535948',
id: '570535948',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587340365',
timestampms: 1587340365352,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: '_MDxhjxig',
options: [],
price: '100.00',
original_amount: '10',
remaining_amount: '10'
}
cancelOrder({order_id})
This API call is used for cancelling an existing order. In order to specify which order is to be cancelled the unique order id has to be provided.
The API key you use to access this endpoint must have the Trader role assigned. API keys without the Trader role assigned lack the authorization to execute this API call.
In this example we will cancel the order created in the newOrder API call:
restClient.cancelOrder({order_id:570535948})
.then(response => console.log(response))
.catch(error => console.log(error));
Upon a successful call, the response will be as follows:
{
order_id: '570535948',
id: '570535948',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587340365',
timestampms: 1587340365352,
is_live: false,
is_cancelled: true,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: '_MDxhjxig',
reason: 'Requested',
options: [],
price: '100.00',
original_amount: '10',
remaining_amount: '10'
}
Note the is_cancelled node will have a value of ‘true’.
cancelAllSessionOrders()
This will cancel all orders opened by this session.
Call:
restClient.cancelAllSessionOrders()
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{
result: 'ok',
details: { cancelledOrders: [ 570506375, 570506767 ], cancelRejects: [] }
}
cancelAllActiveOrders()
This will cancel all outstanding orders created by all sessions owned by this account, including interactive orders placed through the UI.
Note that this cancels orders that were not placed using this API key.
Typically Cancel All Session Orders is preferable, so that only orders related to the current connected session are cancelled.
Call:
restClient.cancelAllActiveOrders()
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{
result: 'ok',
details: {
cancelledOrders: [ 570542063, 570542068, 570542071 ],
cancelRejects: []
}
}
getMyOrderStatus({order_id})
This API call will return all status information of the order provided in order_id.
Call:
restClient.getMyOrderStatus({order_id:'570643084'})
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{
order_id: '570643085',
id: '570643085',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587378577',
timestampms: 1587378577073,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: '5OKP-y8tJ',
options: [],
price: '100.00',
original_amount: '10',
remaining_amount: '10'
}
Providing a wrong order id you will try to access information of a non-existing order and this will result in the following reply:
{
result: 'error',
reason: 'OrderNotFound',
message: 'Order 570643084 not found'
}
getMyPastTrades(params={})
The field symbol must be provided as a parameter.
Calling the API without providing the field symbol:
restClient.getMyPastTrades({})
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{
result: 'error',
reason: 'MissingSymbol',
message: "Order was missing required field 'symbol' with supported values ['BTCUSD', 'ETHBTC', 'ETHUSD', 'BCHUSD', 'BCHBTC', 'BCHETH', 'LTCUSD', 'LTCBTC', 'LTCETH', 'LTCBCH', 'ZECUSD', 'ZECBTC', 'ZECETH', 'ZECBCH', 'ZECLTC']"
}
Call (without any trades):
restClient.getMyPastTrades({symbol:"btcusd"})
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
[]
If there had been trades in the past the reply will look like this:
[ {
"price": "3648.09",
"amount": "0.0027343246",
"timestamp": 1547232911,
"timestampms": 1547232911021,
"type": "Buy",
"aggressor": True,
"fee_currency": "USD",
"fee_amount": "0.024937655575035",
"tid": 107317526,
"order_id": "107317524",
"exchange": "gemini",
"is_auction_fill": False
}, {
"price": "3633.00",
"amount": "0.00423677",
"timestamp": 1547220640,
"timestampms": 1547220640195,
"type": "Buy",
"aggressor": False,
"fee_currency": "USD",
"fee_amount": "0.038480463525",
"tid": 106921823,
"order_id": "106817811",
"exchange": "gemini",
"is_auction_fill": False
} ]
getMyTradeVolume()
This API call lists the trading volume for the different markets traded by a trader.
For further information please refer to https://docs.gemini.com/rest-api/#get-trade-volume.
Call:
restClient.getMyTradeVolume()
.then(response => console.log(response))
.catch(error => console.log(error));
Reply for account without any trading volume:
[ [] ]
Reply for account with some trading volume:
[
[
{
"symbol": "btcusd",
"base_currency": "BTC",
"notional_currency": "USD",
"data_date": "2019-01-10",
"total_volume_base": 8.06021756,
"maker_buy_sell_ratio": 1,
"buy_maker_base": 6.06021756,
"buy_maker_notional": 23461.3515203844,
"buy_maker_count": 34,
"sell_maker_base": 0,
"sell_maker_notional": 0,
"sell_maker_count": 0,
"buy_taker_base": 0,
"buy_taker_notional": 0,
"buy_taker_count": 0,
"sell_taker_base": 2,
"sell_taker_notional": 7935.66,
"sell_taker_count": 2
},
{
"symbol": "ltcusd",
"base_currency": "LTC",
"notional_currency": "USD",
"data_date": "2019-01-11",
"total_volume_base": 3,
"maker_buy_sell_ratio": 0,
"buy_maker_base": 0,
"buy_maker_notional": 0,
"buy_maker_count": 0,
"sell_maker_base": 0,
"sell_maker_notional": 0,
"sell_maker_count": 0,
"buy_taker_base": 3,
"buy_taker_notional": 98.22,
"buy_taker_count": 3,
"sell_taker_base": 0,
"sell_taker_notional": 0,
"sell_taker_count": 0
}
]
]
In the following steps the tasks of the assignment will be shown:
- Use getMyAvailableBalances to see your current balances.
This API call will return the current balances of an account.
Call:
restClient.getMyAvailableBalances()
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
[
{
type: 'exchange',
currency: 'ZEC',
amount: '20000',
available: '20000',
availableForWithdrawal: '20000'
},
{
type: 'exchange',
currency: 'ETH',
amount: '20000',
available: '20000',
availableForWithdrawal: '20000'
},
{
type: 'exchange',
currency: 'BCH',
amount: '20000',
available: '20000',
availableForWithdrawal: '20000'
},
{
type: 'exchange',
currency: 'LTC',
amount: '20000',
available: '20000',
availableForWithdrawal: '20000'
},
{
type: 'exchange',
currency: 'BTC',
amount: '1000',
available: '1000',
availableForWithdrawal: '1000'
},
{
type: 'exchange',
currency: 'USD',
amount: '100000.00',
available: '98999.00',
availableForWithdrawal: '98999.00'
}
]
- Create a few (3-5) different buy limit orders using newOrder function. Make sure that the price is too low for Gemini to fulfil your buy order.
This code will create 5 different buy limit orders using the newOrder function. In order to keep the code small I used a for loop to get different prices for my buy orders:
for (var buyPrice = 100; buyPrice <= 500; buyPrice += 100){
restClient.newOrder({amount:10,price:buyPrice.toString(),side:"buy",symbol:"btcusd"})
.then(response => console.log(response))
.catch(error => console.log(error));
}
The first two API calls worked well but for the last three calls the following error occured in the reply:
{
result: 'error',
reason: 'InvalidNonce',
message: "Nonce '1587385329129' has not increased since your last call to the Gemini API."
}
{
result: 'error',
reason: 'InvalidNonce',
message: "Nonce '1587385329129' has not increased since your last call to the Gemini API."
}
{
result: 'error',
reason: 'InvalidNonce',
message: "Nonce '1587385329129' has not increased since your last call to the Gemini API."
}
The Nonce parameter is handled by the wrapper and we don’t have to take care of it. However this parameter is the number of milliseconds passed since the 1th of January 1970. As you can see in the reply above the Nonce parameter is exactly the same for all three API calls which means that these API calls were performed in the same millisecond. This resulted in an error.
In order to prevent this problem I used an empty while loop. The condition of this while loop will turn from true to false after 1000 milliseconds have passed, since Date.now() is the number of milliseconds passed since the 1st January of 1970.
Call:
for (var buyPrice = 100; buyPrice <= 500; buyPrice += 100){
restClient.newOrder({amount:10, price:buyPrice, side:"buy", symbol:"btcusd"})
.then(response => console.log(response))
.catch(error => console.log(error));
//Wait for 1000 milliseconds
var enteredLoop = Date.now();
while (Date.now() - enteredLoop < 1000) {};
}
Reply:
{
order_id: '570682079',
id: '570682079',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587392420',
timestampms: 1587392420410,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'seXsTybNo',
options: [],
price: '100.00',
original_amount: '10',
remaining_amount: '10'
}
{
order_id: '570682082',
id: '570682082',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587392420',
timestampms: 1587392420513,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'CJ16UcoPj',
options: [],
price: '300.00',
original_amount: '10',
remaining_amount: '10'
}
{
order_id: '570682085',
id: '570682085',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587392420',
timestampms: 1587392420610,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'KK4F_UJ2S',
options: [],
price: '400.00',
original_amount: '10',
remaining_amount: '10'
}
{
order_id: '570682088',
id: '570682088',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587392420',
timestampms: 1587392420710,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'jQsioezNd',
options: [],
price: '200.00',
original_amount: '10',
remaining_amount: '10'
}
{
order_id: '570682094',
id: '570682094',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587392420',
timestampms: 1587392420811,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'a5MYKBe91',
options: [],
price: '500.00',
original_amount: '10',
remaining_amount: '10'
}
But looking closely at the reply one can see that the time between the API calls is roughly only about 100 milliseconds. Furthermore the sequence of the orders seems strange:
- 100USD
- 300USD
- 400USD
- 200USD
- 500USD
If you truly want to halt the execution of Javascript things are getting more complicated. First you will need a
Sleep function. The
Sleep function will return a
promise object whose status will be set to
resolved after the given time in milliseconds:
function Sleep(milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
}
To use this functionality you will have to call your function using the keyword async. Without the async keyword you are not allowed to use the await statement:
async function callAPI() {
for (var buyPrice = 100; buyPrice <= 500; buyPrice += 100){
restClient.newOrder({amount:10, price:buyPrice, side:"buy", symbol:"btcusd"})
.then(response => console.log(response))
.catch(error => console.log(error));
//Wait for 1000 milliseconds
await Sleep(1000);
}
}
callAPI();
The asynchronous function callAPI calls the function Sleep. With the await statement the execution is halted for the given time, which is 1000 milliseconds in our example. Without await statement the execution of the function will simply go on because it would not wait for the return of the promise object to get the status resolved.
Reply:
{
order_id: '570693582',
id: '570693582',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396549',
timestampms: 1587396549267,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'lMX_fkJcL',
options: [],
price: '100.00',
original_amount: '10',
remaining_amount: '10'
}
{
order_id: '570693690',
id: '570693690',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396550',
timestampms: 1587396550141,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'qs3UEZgBP',
options: [],
price: '200.00',
original_amount: '10',
remaining_amount: '10'
}
{
order_id: '570693696',
id: '570693696',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396551',
timestampms: 1587396551142,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'nZ8ViwbQa',
options: [],
price: '300.00',
original_amount: '10',
remaining_amount: '10'
}
{
order_id: '570693699',
id: '570693699',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396552',
timestampms: 1587396552142,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'BUZklEFFu',
options: [],
price: '400.00',
original_amount: '10',
remaining_amount: '10'
}
{
order_id: '570693702',
id: '570693702',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396553',
timestampms: 1587396553149,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'SeOACkrjQ',
options: [],
price: '500.00',
original_amount: '10',
remaining_amount: '10'
}
During the execution of the code every API reply appeared with a true delay of at least 1000 milliseconds. This can be confirmed by looking at the field timestamp. And this time the sequence of the orders is correct:
- 100USD
- 200USD
- 300USD
- 400USD
- 500USD
- Using getMyActiveOrders get a list of all your active orders. Do you recognise the orders you created in the last step?
getMyActiveOrders()
This API call will return all active orders of an account. The result is array of the results of getMyOrderStatus({order_id})
of all your live orders.
Call:
restClient.getMyActiveOrders()
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
[
{
order_id: '570693702',
id: '570693702',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396553',
timestampms: 1587396553149,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'SeOACkrjQ',
options: [],
price: '500.00',
original_amount: '10',
remaining_amount: '10'
},
{
order_id: '570693699',
id: '570693699',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396552',
timestampms: 1587396552142,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'BUZklEFFu',
options: [],
price: '400.00',
original_amount: '10',
remaining_amount: '10'
},
{
order_id: '570693696',
id: '570693696',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396551',
timestampms: 1587396551142,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'nZ8ViwbQa',
options: [],
price: '300.00',
original_amount: '10',
remaining_amount: '10'
},
{
order_id: '570693690',
id: '570693690',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396550',
timestampms: 1587396550141,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'qs3UEZgBP',
options: [],
price: '200.00',
original_amount: '10',
remaining_amount: '10'
},
{
order_id: '570693582',
id: '570693582',
symbol: 'btcusd',
exchange: 'gemini',
avg_execution_price: '0.00',
side: 'buy',
type: 'exchange limit',
timestamp: '1587396549',
timestampms: 1587396549267,
is_live: true,
is_cancelled: false,
is_hidden: false,
was_forced: false,
executed_amount: '0',
client_order_id: 'lMX_fkJcL',
options: [],
price: '100.00',
original_amount: '10',
remaining_amount: '10'
}
]
- Cancel your orders using cancelAllActiveOrders .
cancelAllActiveOrders()
This API call will cancel all your active orders.
Call:
restClient.cancelAllActiveOrders()
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
{
result: 'ok',
details: {
cancelledOrders: [ 570693702, 570693699, 570693696, 570693690, 570693582 ],
cancelRejects: []
}
}
After execution of
cancelAllActiveOrders no orders will be shown in your browser.
- Using getMyActiveOrders get a list of all your active orders. Have they been cancelled?
Calling getMyActiveOrders again you can confirm if all your orders had been cancelled.
Call:
restClient.getMyActiveOrders()
.then(response => console.log(response))
.catch(error => console.log(error));
Reply:
[]
The reply shows an empty array. The absence of any order in this array shows us that all orders had been cancelled successfully.