Skip to content

Commit b55fb1f

Browse files
authored
Merge pull request #98 from JJ-Cro/update22012026
feat(v1.4.0): Added otc, crossex and alpha endpoints
2 parents d2a5067 + b559173 commit b55fb1f

Some content is hidden

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

61 files changed

+11134
-6018
lines changed

README.md

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,21 @@ Updated & performant JavaScript & Node.js SDK for the Gate.com (gate.io) REST AP
2626
- Strongly typed requests and responses.
2727
- Automated end-to-end tests ensuring reliability.
2828
- Actively maintained with a modern, promise-driven interface.
29-
- Gate.com REST APIs for Gate.com Spot, Margin, Perpetual Futures, Delivery Futures, Options & Announcements APIs.
29+
- Gate.com REST APIs for Gate.com Spot, Margin, Perpetual Futures, Delivery Futures, Options, CrossEx, Alpha & OTC Trading APIs.
3030
- Unified RestClient for all Gate.com trading products.
3131
- Strongly typed on most requests and responses.
32+
- Support for Cross-Exchange (CrossEx) trading across multiple exchanges
33+
- Support for Alpha account trading (meme tokens and new listings)
34+
- Support for OTC (fiat and stablecoin) trading
3235
- Support for seamless API authentication for private Gate.com REST API and WebSocket calls.
3336
- Robust WebSocket integration with configurable connection heartbeats & automatic reconnect then resubscribe workflows.
3437
- Event driven messaging.
3538
- Smart websocket persistence with automatic reconnection handling.
3639
- Automatically handle silent websocket disconnections through timed heartbeats, including the scheduled 24hr disconnect.
3740
- Automatically handle listenKey persistence and expiration/refresh.
3841
- Emit `reconnected` event when dropped connection is restored.
39-
- Support for Gate.com Spot, Margin, Perpetual Futures, Delivery Futures & Options.
40-
- WebSocket API for Gate.com Spot, Margin, Perpetual Futures & Delivery Futures.
42+
- Support for Gate.com Spot, Margin, Perpetual Futures, Delivery Futures, Options, CrossEx, Alpha & OTC.
43+
- WebSocket API for Gate.com Spot, Margin, Perpetual Futures, Delivery Futures & CrossEx.
4144
- Automatic connectivity via existing WebsocketClient, just call sendWSAPIRequest to trigger a request.
4245
- Automatic authentication, just call sendWSAPIRequest with channel & parameters.
4346
- Choose between two interfaces for WS API communication:
@@ -124,6 +127,9 @@ Most methods accept JS objects. These can be populated using parameters specifie
124127
- [Margin Trading API](https://www.gate.com/docs/developers/apiv4/en/#margin-new)
125128
- [Futures Trading API](https://www.gate.com/docs/developers/apiv4/en/#futures-new)
126129
- [Options Trading API](https://www.gate.com/docs/developers/apiv4/en/#options-new)
130+
- [CrossEx Trading API](https://www.gate.com/docs/developers/apiv4/en/#crossex)
131+
- [Alpha Trading API](https://www.gate.com/docs/developers/apiv4/en/#alpha)
132+
- [OTC Trading API](https://www.gate.com/docs/developers/apiv4/en/#otc)
127133
- [WebSocket API](https://www.gate.com/docs/developers/apiv4/en/#websocket-api)
128134
- [REST Endpoint Function List](./docs/endpointFunctionList.md)
129135
- [TSDoc Documentation (autogenerated using typedoc)](https://tsdocs.dev/docs/gateio-api)
@@ -145,7 +151,7 @@ Create API credentials on Gate.com's website:
145151

146152
## REST API
147153

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.
149155

150156
To use any of Gate.com's REST APIs in JavaScript/TypeScript/Node.js, import (or require) the `RestClient`:
151157

@@ -160,6 +166,7 @@ const client = new RestClient({
160166
apiSecret: PRIVATE_KEY,
161167
});
162168

169+
// Spot Trading Example
163170
client
164171
.getSpotTicker()
165172
.then((result) => {
@@ -171,15 +178,51 @@ client
171178

172179
client
173180
.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',
176183
})
177184
.then((result) => {
178185
console.log('getSpotOrders result: ', result);
179186
})
180187
.catch((err) => {
181188
console.error('getSpotOrders error: ', err);
182189
});
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+
});
183226
```
184227

185228
See [RestClient](./src/RestClient.ts) for further information, or the [examples](./examples/) for lots of usage examples.

0 commit comments

Comments
 (0)