This is a Go library for the OKX OS API (v6).
go get -u github.com/imzhongqi/okxosclient := client.NewClient("key", "secret", "passphrase", "projectID")
walletapi := wallet.NewWalletAPI(client)
_, err := walletapi.ListSupportedChains(context.Background())
if err != nil {
panic(err)
}- Wallet API
- Wallet Account Management API
- Transaction Broadcasting API
- Dex API
- Swap API
- Cross Chain API
- Limit Order API
- Marketplace API
- DeFi API
This library targets the OKX OS API v6 for DEX endpoints and v5 for Wallet endpoints.
Key changes from v5 to v6:
- Base URL:
https://web3.okx.com - DEX endpoints use
/api/v6/dex/...paths chainId→chainIndexslippage→slippagePercentpriceImpactProtectionPercentage→priceImpactProtectionPercentmaxAutoSlippage→maxAutoSlippagePercent
Contributions are welcome! Please feel free to submit a PR.