Skip to content

Commit 52b2e03

Browse files
authored
Merge pull request #8 from Kucoin/release/2024.12.31
Release/2024.12.31
2 parents b986b81 + 8790e7c commit 52b2e03

File tree

338 files changed

+25003
-1051
lines changed

Some content is hidden

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

338 files changed

+25003
-1051
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ define generate-code
7474
@echo "$(GREEN)lang: $(lang), done!$(NC)"
7575
endef
7676

77+
define generate-postman
78+
@make -f generate.mk generate-postman
79+
endef
80+
7781

7882
SUBDIRS := $(shell find ./sdk -mindepth 1 -maxdepth 1 -type d)
7983
.PHONY: test $(SUBDIRS)
@@ -86,9 +90,14 @@ $(SUBDIRS):
8690

8791
.PHONY: generate
8892
generate: setup-logs
93+
$(call generate-postman)
8994
$(call generate-code,golang,/pkg/generate)
9095
$(call generate-code,python,/kucoin_universal_sdk/generate)
9196

97+
.PHONY: gen-postman
98+
gen-postman: preprocessor
99+
$(call generate-postman)
100+
92101
.PHONY: fastgen
93102
fastgen: build-tools preprocessor
94103
@make generate

README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,24 @@ The **KuCoin Universal SDK** is the official SDK provided by KuCoin, offering a
3232

3333
## 🛠️ Installation
3434

35-
### Latest Version: `0.1.1-alpha`
36-
**Note:** This SDK is currently in the **Alpha phase**. We are actively iterating and improving its features, stability, and documentation. Feedback and contributions are highly encouraged to help us refine the SDK.
35+
### Latest Version: `1.0.0`
3736

3837
### Python Installation
3938

4039
```bash
41-
pip install kucoin-universal-sdk==0.1.1a1
40+
pip install kucoin-universal-sdk
4241
```
4342

4443
### Golang Installation
4544

4645
```bash
47-
go get github.com/Kucoin/kucoin-universal-sdk/sdk/golang@v0.1.1-alpha
46+
go get github.com/Kucoin/kucoin-universal-sdk/sdk/golang
4847
go mod tidy
4948
```
5049

50+
### Postman Installation
51+
Visit the [KuCoin API Collection on Postman](https://www.postman.com/kucoin-api/kucoin-api/overview)
52+
5153
## 📖 Getting Started
5254

5355
Here's a quick example to get you started with the SDK in **Python**.
@@ -122,6 +124,7 @@ For other languages, refer to the [Examples](#-examples) section.
122124
- Official Documentation: [KuCoin API Docs](https://www.kucoin.com/docs-new)
123125
- **[Python Documentation](sdk/python/README.md)**
124126
- **[Go Documentation](sdk/golang/README.md)**
127+
- **[Postman Documentation](sdk/postman/README.md)**
125128

126129
## 📂 Examples
127130
Find usage examples for your desired language by selecting the corresponding link below:
@@ -131,6 +134,7 @@ Find usage examples for your desired language by selecting the corresponding lin
131134
| Python | [sdk/python/examples/](sdk/python/example/)|
132135
| Go | [sdk/go/examples/](sdk/golang/example/) |
133136

137+
134138
## 🏗️ Technical Design
135139

136140
The KuCoin Universal SDK is built with a code-generation-first approach to ensure consistency, scalability, and rapid updates across all supported languages. By leveraging the OpenAPI Specification and a custom code generator, the SDK achieves the following advantages:
@@ -181,18 +185,8 @@ The following table describes the key components of the project directory:
181185
| `README.md` | Main documentation file. |
182186
| `generate.mk` | Additional Makefile specifically for code generation tasks. |
183187
| `generator/` | Directory containing the code generation logic. |
184-
| `generator/plugin/` | Custom plugins for generating SDKs. |
185-
| `generator/preprocessor/`| Scripts or tools for preprocessing API specifications. |
186188
| `sdk/` | Directory for generated SDKs organized by language. |
187-
| `sdk/golang/` | Generated SDK for Golang. |
188-
| `sdk/python/` | Generated SDK for Python. |
189189
| `spec/` | Directory containing API specification files. |
190-
| `spec/apis.csv` | List of all APIs. |
191-
| `spec/original/` | Original unprocessed API specifications. |
192-
| `spec/rest/` | REST API specifications. |
193-
| `spec/ws/` | WebSocket API specifications. |
194-
| `spec/ws.csv` | List of WebSocket-specific APIs.
195-
196190

197191
## ⚙️ Build and Test Guide
198192

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.1.1-alpha
1+
v1.0.0

generate.mk

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ RED=\033[0;31m
77
GREEN=\033[0;32m
88
NC=\033[0m
99

10+
define generate-postman-func
11+
docker run --rm -v "${PWD}:/local" -w /local/generator/postman -e SDK_VERSION=$(VERSION) python:3.9.20-alpine3.20 \
12+
python main.py
13+
14+
@echo "$(GREEN)lang: postman, done!$(NC)"
15+
endef
1016

1117
define generate-api
1218
@echo "$(GREEN)lang: $(2). generate api for $(service)...$(NC)"
@@ -79,7 +85,10 @@ REST_FILES := $(wildcard ./spec/rest/api/*.json)
7985
ENTRY_FILES := $(wildcard ./spec/rest/entry/*.json)
8086
WS_FILES := $(wildcard ./spec/ws/*.json)
8187

82-
.PHONY: generate $(REST_FILES) $(ENTRY_FILES) $(WS_FILES) force
88+
.PHONY: generate $(REST_FILES) $(ENTRY_FILES) $(WS_FILES) generate-postman force
89+
90+
generate-postman:
91+
$(call generate-postman-func)
8392

8493
generate: $(patsubst ./spec/rest/api/%.json,generate-rest-%, $(REST_FILES)) $(patsubst ./spec/rest/entry/%.json,generate-entry-%, $(ENTRY_FILES)) $(patsubst ./spec/ws/%.json,generate-ws-%, $(WS_FILES))
8594

generator/plugin/src/main/resources/golang-sdk/api.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type {{classname}} interface {
1313

1414
// {{vendorExtensions.x-meta.method}} {{summary}}
1515
// Description: {{notes}}
16+
// Documentation: {{vendorExtensions.x-api-doc}}
1617
{{#vendorExtensions.x-extra-comment}}
1718
// {{.}}
1819
{{/vendorExtensions.x-extra-comment}}{{#isDeprecated}} // Deprecated

generator/plugin/src/main/resources/python-sdk/api.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class {{classname}}(ABC):
1616
"""
1717
summary: {{summary}}
1818
description: {{notes}}
19+
documentation: {{vendorExtensions.x-api-doc}}
1920
{{#vendorExtensions.x-extra-comment}}
2021
{{.}}
2122
{{/vendorExtensions.x-extra-comment}}

generator/plugin/src/test/java/com/kucoin/universal/sdk/plugin/SdkGeneratorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public class SdkGeneratorTest {
99

10-
private static final String SDK_NAME = "golang-sdk";
10+
private static final String SDK_NAME = "python-sdk";
1111
private static final String SPEC_NAME = "../../spec/rest/api/openapi-account-fee.json";
1212
private static final String SPEC_ENTRY_NAME = "../../spec/rest/entry/openapi-account.json";
1313
private static final String WS_SPEC_NAME = "../../spec/ws/openapi-futures-private.json";

0 commit comments

Comments
 (0)