Skip to content

Commit c26b58d

Browse files
authored
Merge pull request #142 from JJ-Cro/update11082026
feat(v1.6.2): add stock API support
2 parents 495f028 + a5ae4e0 commit c26b58d

47 files changed

Lines changed: 11384 additions & 6879 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/endpointFunctionList.md

Lines changed: 470 additions & 445 deletions
Large diffs are not rendered by default.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /stock/orders
8+
// METHOD: DELETE
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.cancelAllStockOrders(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /crossex/batch_cancel_orders
8+
// METHOD: POST
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.cancelBatchCrossExOrders(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /spot/pov_orders/{order_id}/cancel
8+
// METHOD: POST
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.cancelSpotPovOrder(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /spot/pov_orders/cancel
8+
// METHOD: POST
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.cancelSpotPovOrders(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /stock/orders/{orderId}
8+
// METHOD: DELETE
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.cancelStockOrder(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /stock/positions/close
8+
// METHOD: POST
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.closeStockPosition(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /spot/pov_orders
8+
// METHOD: POST
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.createSpotPovOrder(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /stock/orders
8+
// METHOD: POST
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.createStockOrder(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { RestClient } from 'gateio-api';
2+
// or, if require is preferred:
3+
// const { RestClient } = require('gateio-api');
4+
5+
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
6+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
7+
// ENDPOINT: /stock/transactions
8+
// METHOD: POST
9+
// PUBLIC: NO
10+
11+
const client = new RestClient({
12+
apiKey: 'insert_api_key_here',
13+
apiSecret: 'insert_api_secret_here',
14+
});
15+
16+
client.createStockTransaction(params)
17+
.then((response) => {
18+
console.log(response);
19+
})
20+
.catch((error) => {
21+
console.error(error);
22+
});

0 commit comments

Comments
 (0)