You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[REST Endpoint Function List](./docs/endpointFunctionList.md)
129
135
-[TSDoc Documentation (autogenerated using typedoc)](https://tsdocs.dev/docs/gateio-api)
@@ -145,7 +151,7 @@ Create API credentials on Gate.com's website:
145
151
146
152
## REST API
147
153
148
-
The SDK provides a unified `RestClient` for all Gate.com trading products including Spot, Margin, Perpetual Futures, Delivery Futures, and Options. This single client handles all REST API operations across all trading markets.
154
+
The SDK provides a unified `RestClient` for all Gate.com trading products including Spot, Margin, Perpetual Futures, Delivery Futures, Options, CrossEx, Alpha, and OTC Trading. This single client handles all REST API operations across all trading markets.
149
155
150
156
To use any of Gate.com's REST APIs in JavaScript/TypeScript/Node.js, import (or require) the `RestClient`:
151
157
@@ -160,6 +166,7 @@ const client = new RestClient({
160
166
apiSecret:PRIVATE_KEY,
161
167
});
162
168
169
+
// Spot Trading Example
163
170
client
164
171
.getSpotTicker()
165
172
.then((result) => {
@@ -171,15 +178,51 @@ client
171
178
172
179
client
173
180
.getSpotOrders({
174
-
currency_pair:'BTC_USDT',// Specify the currency pair
175
-
status:'open',// Specify the status of the orders to fetch
181
+
currency_pair:'BTC_USDT',
182
+
status:'open',
176
183
})
177
184
.then((result) => {
178
185
console.log('getSpotOrders result: ', result);
179
186
})
180
187
.catch((err) => {
181
188
console.error('getSpotOrders error: ', err);
182
189
});
190
+
191
+
// CrossEx Trading Example - Trade across multiple exchanges
192
+
client
193
+
.getCrossExSymbols()
194
+
.then((result) => {
195
+
console.log('CrossEx symbols: ', result);
196
+
})
197
+
.catch((err) => {
198
+
console.error('CrossEx error: ', err);
199
+
});
200
+
201
+
// Alpha Trading Example - Trade meme tokens and new listings
202
+
client
203
+
.getAlphaCurrencies()
204
+
.then((result) => {
205
+
console.log('Alpha currencies: ', result);
206
+
})
207
+
.catch((err) => {
208
+
console.error('Alpha error: ', err);
209
+
});
210
+
211
+
// OTC Trading Example - Fiat and stablecoin trading
212
+
client
213
+
.createOTCQuote({
214
+
side:'BUY',
215
+
pay_coin:'USDT',
216
+
get_coin:'USD',
217
+
pay_amount:'1000',
218
+
create_quote_token:'1',
219
+
})
220
+
.then((result) => {
221
+
console.log('OTC quote: ', result);
222
+
})
223
+
.catch((err) => {
224
+
console.error('OTC error: ', err);
225
+
});
183
226
```
184
227
185
228
See [RestClient](./src/RestClient.ts) for further information, or the [examples](./examples/) for lots of usage examples.
0 commit comments