Skip to content

Commit a4bd8fd

Browse files
authored
Merge pull request #66 from JJ-Cro/tableofcontents
chore(v1.2.5): update Readme to match modern structure
2 parents 284b446 + 970b254 commit a4bd8fd

File tree

4 files changed

+217
-98
lines changed

4 files changed

+217
-98
lines changed

README.md

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,66 @@
2020

2121
Updated & performant JavaScript & Node.js SDK for the Gate.com (gate.io) REST APIs and WebSockets:
2222

23+
- Professional, robust & performant Gate.com SDK with extensive production use in live trading environments.
2324
- Extensive integration with Gate.com (Gate.io) REST APIs and WebSockets.
24-
- TypeScript support (with type declarations for most API requests & responses).
25+
- Complete TypeScript support (with type declarations for most API requests & responses).
26+
- Strongly typed requests and responses.
27+
- Automated end-to-end tests ensuring reliability.
28+
- Actively maintained with a modern, promise-driven interface.
2529
- Gate.com REST APIs for Gate.com Spot, Margin, Perpetual Futures, Delivery Futures, Options & Announcements APIs.
30+
- Unified RestClient for all Gate.com trading products.
2631
- Strongly typed on most requests and responses.
27-
- Extremely robust & performant JavaScript/Node.js Gate.com SDK.
28-
- Actively maintained with a modern, promise-driven interface.
2932
- Support for seamless API authentication for private Gate.com REST API and WebSocket calls.
30-
- Gate.com Spot, Margin, Perpetual Futures, Delivery Futures & Options.
33+
- Robust WebSocket integration with configurable connection heartbeats & automatic reconnect then resubscribe workflows.
3134
- Event driven messaging.
32-
- Smart websocket persistence
35+
- Smart websocket persistence with automatic reconnection handling.
3336
- Automatically handle silent websocket disconnections through timed heartbeats, including the scheduled 24hr disconnect.
3437
- Automatically handle listenKey persistence and expiration/refresh.
3538
- Emit `reconnected` event when dropped connection is restored.
36-
- Websocket API for Gate.com Spot, Margin, Perpetual Futures & Delivery Futures.
39+
- Support for Gate.com Spot, Margin, Perpetual Futures, Delivery Futures & Options.
40+
- WebSocket API for Gate.com Spot, Margin, Perpetual Futures & Delivery Futures.
3741
- Automatic connectivity via existing WebsocketClient, just call sendWSAPIRequest to trigger a request.
3842
- Automatic authentication, just call sendWSAPIRequest with channel & parameters.
3943
- Choose between two interfaces for WS API communication:
4044
- Event-driven interface, fire & forget via sendWSAPIRequest and receive async replies via wsClient's event emitter.
4145
- Promise-driven interface, simply use the WebsocketAPIClient for a REST-like experience. Use the WebSocket API like a REST API! See [examples/ws-api-client.ts](./examples/ws-api-client.ts) for a demonstration.
46+
- Heavy automated end-to-end testing with real API calls.
4247
- Proxy support via axios integration.
4348
- Active community support & collaboration in telegram: [Node.js Algo Traders](https://t.me/nodetraders).
4449

50+
## Table of Contents
51+
52+
- [Installation](#installation)
53+
- [Examples](#examples)
54+
- [Issues & Discussion](#issues--discussion)
55+
- [Related Projects](#related-projects)
56+
- [Documentation](#documentation)
57+
- [Structure](#structure)
58+
- [Usage](#usage)
59+
- [REST API Client](#rest-api)
60+
- [WebSocket Client](#websockets)
61+
- [WebSocket Data Streams](#websocket-data-streams)
62+
- [WebSocket API](#websocket-api)
63+
- [Event Driven API](#event-driven-api)
64+
- [REST-like API](#rest-like-api)
65+
- [Customise Logging](#customise-logging)
66+
- [LLMs & AI](#use-with-llms--ai)
67+
- [Contributions & Thanks](#contributions--thanks)
68+
4569
## Installation
4670

4771
`npm install --save gateio-api`
4872

73+
## Examples
74+
75+
Refer to the [examples](./examples) folder for implementation demos, including:
76+
77+
- **REST API Examples**: spot trading, futures trading, account management
78+
- **WebSocket Examples**: public market data streams, private account data, WebSocket API usage
79+
- **Spot Trading**: comprehensive spot market examples
80+
- **Futures Trading**: perpetual and delivery futures examples
81+
- **WebSocket API**: both event-driven and promise-driven approaches
82+
4983
## Issues & Discussion
5084

5185
- Issues? Check the [issues tab](https://github.com/tiagosiebler/gateio-api/issues).
@@ -76,9 +110,16 @@ Check out my related JavaScript/TypeScript/Node.js projects:
76110

77111
## Documentation
78112

79-
Most methods accept JS objects. These can be populated using parameters specified by gateio's API documentation.
113+
Most methods accept JS objects. These can be populated using parameters specified by Gate.com's API documentation, or check the type definition in each class within this repository.
114+
115+
### API Documentation Links
80116

81117
- [Gate.com/gate.io API Documentation](https://www.gate.com/docs/developers/apiv4/en/)
118+
- [Spot Trading API](https://www.gate.com/docs/developers/apiv4/en/#spot-new)
119+
- [Margin Trading API](https://www.gate.com/docs/developers/apiv4/en/#margin-new)
120+
- [Futures Trading API](https://www.gate.com/docs/developers/apiv4/en/#futures-new)
121+
- [Options Trading API](https://www.gate.com/docs/developers/apiv4/en/#options-new)
122+
- [WebSocket API](https://www.gate.com/docs/developers/apiv4/en/#websocket-api)
82123
- [REST Endpoint Function List](./docs/endpointFunctionList.md)
83124
- [TSDoc Documentation (autogenerated using typedoc)](https://tsdocs.dev/docs/gateio-api)
84125

@@ -93,11 +134,13 @@ This project uses typescript. Resources are stored in 2 key structures:
93134

94135
# Usage
95136

96-
Create API credentials
137+
Create API credentials on Gate.com's website:
97138

98139
- [Gate.com API Key Management](https://www.gate.com/myaccount/api_key_manage)
99140

100-
### REST API
141+
## REST API
142+
143+
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.
101144

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

@@ -138,6 +181,19 @@ See [RestClient](./src/RestClient.ts) for further information, or the [examples]
138181

139182
## WebSockets
140183

184+
All WebSocket functionality is supported via the unified `WebsocketClient`. This client handles all Gate.com WebSocket streams with automatic connection management and reconnection.
185+
186+
Key WebSocket features:
187+
188+
- Event driven messaging
189+
- Smart WebSocket persistence with automatic reconnection
190+
- Heartbeat mechanisms to detect disconnections
191+
- Automatic resubscription after reconnection
192+
- Support for all Gate.com trading products (Spot, Margin, Futures, Options)
193+
- WebSocket API support for real-time trading operations
194+
195+
### WebSocket Data Streams
196+
141197
All available WebSockets can be used via a shared `WebsocketClient`. The WebSocket client will automatically open/track/manage connections as needed. Each unique connection (one per server URL) is tracked using a WsKey (each WsKey is a string - see [WS_KEY_MAP](src/lib/websocket/websocket-util.ts) for a list of supported values).
142198

143199
Any subscribe/unsubscribe events will need to include a WsKey, so the WebSocket client understands which connection the event should be routed to. See examples below or in the [examples](./examples/) folder on GitHub.

0 commit comments

Comments
 (0)