Package zerox is a wrapped 0x Swap API.
This package has a respresentation of:
- Quote (swap/v1/quote) - Get an easy-to-consume quote for buying or selling any ERC20 token. Returns a transaction that can be submitted to an Ethereum node.
- Price (swap/v1/price) - /price is nearly identical to /quote, but with a few key differences. /price does not return a transaction that can be submitted on-chain; it simply provides us the same information. Think of it as the "read-only" version of /quote.
- Source (swap/v1/source) - Returns the liquidity sources enabled for the chain.
go get github.com/fioletxyz/0x-go
Note Check out the examples!
Connect your API Auth key and choose an endpoint.
// Create a new client for interacting with the 0x API
client := zerox.NewClient(
"YOUR_AUTH_KEY",
zerox.BinanceSmartChain) //Choose an endpoint from config.go