A go client library for wazirx REST APIs
wazirx-go is a go library for Wazirx Rest API integration.
-
Common API
- General API ----------------- docs , code
- Server Time ------------ docs , code
- System Status ---------- docs , code
- Exchange Info ---------- docs , code
- Market Data API ------------- docs
- Tickers ------------------ docs, code
- Ticker ------------------- docs, code
- OrderBookDepth ------- docs, code
- Recent Trades ----------- docs, code
- Historical Trades -------- docs, code
-
Trading Endpoints ---------------- docs
-
Account API ----------------------- docs
-
Websocket Auth Token API ------ docs
-
Websocket Market Streams ------ docs
It is prerequisite to have Go installed on your machine. Steps to install Go
- Some API requires an API key to verify the client request. For API Key creation,check here.
- Sign in to the wazirx account and go to the settings and then click API KEY MANAGER at the bottom.
- Here, you can create your api key 😃
git clone https://github.com/yuvan11/wazirx-go.git
cd wazirx-go/cmd
go run main.go
Don't forget to add API_KEY and SECRET_KEY in the code here, as these are expected by some APIs for code & test execution. Otherwise, error will be thrown
// Initializing client for accessing all API endpoints
client := wazirx.Client{}
// Initializing context
ctx := context.TODO()
-
-
Server Time
// Server service initiates fmt.Println(client.NewServerTimeService().FetchServerTime(ctx))
-
System Status
// System status service initiates fmt.Println(client.NewSystemStatusService().FetchSystemStatus(ctx))
-
Exchange Info
// Exchange status service initiates fmt.Println(client.NewExchangeInfoService().FetchExchangeInfo(ctx))
-
-
-
Tickers
// Tickers service initiates fmt.Println(client.NewTickersService().DisplayTickersData(ctx))
-
Ticker
// Ticker service initiates fmt.Println(client.NewTickerService().SetSymbol("manausdt").TickerData(ctx))
-
OrderBook Depth
// Market depth service initiates fmt.Println(client.NewOrderBookDepthService().SetLimit(10).SetSymbol("manausdt").DisplayOrdersBookDepth(ctx))
-
Recent Trades
// Market trade service initiates fmt.Println(client.NewRecentTradesService().SetLimit(10).SetSymbol("manausdt").DisplayRecentMarketTrade(ctx))
-
Historical Trades
// Historical trade service initiates fmt.Println(client.NewHistoricalTradesService().SetSymbol("manausdt").DisplayHistoricalTrade(ctx))
-
-
-
Create Auth Token
// Generate auth token service initiates fmt.Println(client.NewAuthInfoService().CreateAuthToken(ctx))
-
-
-
Account Info
// Account display service initiates fmt.Println(client.NewAccountInfoService().FetchAccountInfo(ctx))
-
Funds
// Account funds service initiates fmt.Println(client.NewFundInfoService().FetchFundsInfo(ctx))
-
Example to fetch asset price greater than "0.0" and its asset name
for _, a := range *client.NewFundInfoService().FetchFundsInfo(ctx) { if a.Free > "0.00" { fmt.Println("asset", a.Asset, "free", a.Free) } }
-
-
For running unit tests,
cd wazrix-client go test -v or go test
For contribution, have a look at contributing.md
This project is licensed under the MIT License - see the LICENSE file for details
Yuvaraj @yuvan11