I run script in app script to get data from gate API by GET /spot/orders and work good but, if I change status open to finished return empty. you can see document from this URL: https://www.gate.io/docs/developers/apiv4/en/#list-orders.
this is code:
function orders() {
const key = "*****";
const secret = "*****";
const host = "https://api.gateio.ws";
const prefix = "/api/v4";
const url = "/spot/orders";
const method = "GET";
const query_param = "currency_pair=BTC_USDT&status=open";
const signature = gen_sign_(key, secret, method, prefix + url, query_param);
const headers = { "Accept": "application/json", "Content-Type": "application/json", "muteHttpExceptions": true, ...signature };
const res = UrlFetchApp.fetch(host + prefix + url + "?" + query_param , { method, headers });
console.log(res.getContentText());
}
This code is work good and give me return of my open orders.
Problem linked by this code:
const query_param = "currency_pair=BTC_USDT&status=open";
If I change status=open to status=finished.
give me return empty just []
note: I have orders buy and sell in this pair.