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
{{ message }}
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
We appreciate your understanding and encourage you to migrate to the new SDK for a better development experience. Should you have any questions or require assistance, feel free to reach out to us.
Go SDK for KuCoin API
The detailed document https://docs.kucoin.com, in order to receive the latest API change notifications, please Watch this repository.
To reinforce the security of the APIS, KuCoin upgraded the API key to version 2.0, the validation logic has also been changed. It is recommended to create(https://www.kucoin.com/account/api) and update your API key to version 2.0.
The API key of version 1.0 will be still valid until May 1, 2021.
// API key version 2.0s:=kucoin.NewApiService(
// kucoin.ApiBaseURIOption("https://api.kucoin.com"), kucoin.ApiKeyOption("key"),
kucoin.ApiSecretOption("secret"),
kucoin.ApiPassPhraseOption("passphrase"),
kucoin.ApiKeyVersionOption(ApiKeyVersionV2)
)
// API key version 1.0s:=kucoin.NewApiService(
// kucoin.ApiBaseURIOption("https://api.kucoin.com"), kucoin.ApiKeyOption("key"),
kucoin.ApiSecretOption("secret"),
kucoin.ApiPassPhraseOption("passphrase"),
)
// Or add these options into the environmental variable// Bash: // export API_BASE_URI=https://api.kucoin.com// export API_KEY=key// export API_SECRET=secret// export API_PASSPHRASE=passphrase// export API_KEY_VERSION=2// s := NewApiServiceFromEnv()
Debug mode & logging
// Require package github.com/sirupsen/logrus// Debug mode will record the logs of API and WebSocket to files.// Default values: LogLevel=logrus.DebugLevel, LogDirectory="/tmp"kucoin.DebugMode=true// Or export API_DEBUG_MODE=1// Logging in your code// kucoin.SetLoggerDirectory("/tmp")// logrus.SetLevel(logrus.DebugLevel)logrus.Debugln("I'm a debug message")
# Add your API configuration items into the environmental variable firstexport API_BASE_URI=https://api.kucoin.com
export API_KEY=key
export API_SECRET=secret
export API_PASSPHRASE=passphrase
export API_KEY_VERSION=2
# Run tests
go test -v