Skip to content

Commit

Permalink
chore(): update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosiebler committed Jun 13, 2024
1 parent 2ac976c commit 2df3d92
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
5 changes: 3 additions & 2 deletions examples/futures/getBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ async function getFuturesBalances() {
console.log('Using API keys:', account);

// Fetch the futures account balance for USDT settlement
const ticker = await gateRestClient.getFuturesAccount({ settle: 'usdt' });
console.log('Response: ', ticker); // Log the response to the console
const result = await gateRestClient.getFuturesAccount({ settle: 'usdt' });

console.log('Response: ', result); // Log the response to the console
} catch (e) {
console.error(`Error in execution: `, e); // Log any errors that occur
}
Expand Down
8 changes: 4 additions & 4 deletions examples/futures/getOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ async function getFuturesOrders() {
console.log('Using API keys:', account);

// Fetch open futures orders with USDT settlement
const orders = await gateRestClient.getFuturesOrders({
const openOrders = await gateRestClient.getFuturesOrders({
settle: 'usdt', // Specify the settlement currency
status: 'open', // Specify the status of the orders to fetch
});
console.log('Response: ', orders); // Log the response to the console
console.log('openOrders: ', openOrders); // Log the response to the console

// Fetch finished futures orders with USDT settlement
const orders1 = await gateRestClient.getFuturesOrders({
const finishedOrders = await gateRestClient.getFuturesOrders({
settle: 'usdt', // Specify the settlement currency
status: 'finished', // Specify the status of the orders to fetch
});
console.log('Response: ', orders1); // Log the response to the console
console.log('finishedOrders: ', finishedOrders); // Log the response to the console
} catch (e) {
console.error(`Error in execution: `, e); // Log any errors that occur
}
Expand Down
4 changes: 2 additions & 2 deletions examples/futures/getTickers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ async function getFuturesTicker() {
const allTickers = await gateRestClient.getFuturesTickers({
settle: 'usdt', // Specify the settlement currency
});
console.log('Response: ', allTickers); // Log the response to the console
console.log('allTickers: ', allTickers); // Log the response to the console

// Fetch a specific futures ticker with USDT settlement
const ticker = await gateRestClient.getFuturesTickers({
settle: 'usdt', // Specify the settlement currency
contract: 'BTC_USDT', // Specify the contract
});
console.log('Response: ', ticker); // Log the response to the console
console.log('ticker: ', ticker); // Log the response to the console
} catch (e) {
console.error(`Error in execution: `, e); // Log any errors that occur
}
Expand Down
8 changes: 4 additions & 4 deletions examples/spot/getOrders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ async function getSpotOrders() {
console.log('Using API keys:', account);

// Fetch open spot orders for the BTC_USDT currency pair
const orders = await gateRestClient.getSpotOrders({
const openOrders = await gateRestClient.getSpotOrders({
currency_pair: 'BTC_USDT', // Specify the currency pair
status: 'open', // Specify the status of the orders to fetch
});
console.log('Response: ', orders); // Log the response to the console
console.log('openOrders: ', openOrders); // Log the response to the console

// Fetch finished spot orders for the BTC_USDT currency pair
const orders1 = await gateRestClient.getSpotOrders({
const finishedOrders = await gateRestClient.getSpotOrders({
currency_pair: 'BTC_USDT', // Specify the currency pair
status: 'finished', // Specify the status of the orders to fetch
});
console.log('Response: ', orders1); // Log the response to the console
console.log('finishedOrders: ', finishedOrders); // Log the response to the console
} catch (e) {
console.error(`Error in execution: `, e); // Log any errors that occur
}
Expand Down

0 comments on commit 2df3d92

Please sign in to comment.