Easy way to consume the public api informations from MercadoBitcoin
- Authorization
- Accounts
- - Get Accounts
- - Balance List
- - Position List
- Trading
- - Get Order
- - Order Place
- - Order Cancel
- - Order List
- - Order Cancel All
- Wallet
- Wallet Deposit
- Wallet Withdraw
- Wallet GetDraw
- Public data
- - Get Ticker
- - Get Orderbook
- - Get Trades
- - Get Candles
- - Get Symbol
The external cache system is not mandatory, but if you want to use a functions worked with cache for a delayed cli command, you needed use the cache system.
key := os.Getenv("MB_KEY")
secret := os.Getenv("MB_SECRET")
opts := []api.Options{
api.OptKey(key),
api.OptSecret(secret),
api.OptDebug(true),
}
a, err := api.New(opts...)
if err != nil {
fmt.Println(err)
}
auth, acc, err := a.Login()
if err != nil {
fmt.Println(err)
return
}
// not mandatory
optsc := []options.Options{
options.OptFolder("./settings"),
options.OptFileName("cache.db"),
options.OptTTL(3000),
options.OptLogDebug(true),
options.OptLogDisable(false),
}
// not mandatory
c, err := cache.NewCache(kind.BUNTDB, optsc...)
if err != nil {
log.Fatal(err)
}
opts := []api.Options{
api.OptKey(key),
api.OptSecret(secret),
api.OptDebug(true),
api.OptCache(c), // not mandatory
}
a, err := api.New(opts...)
if err != nil {
fmt.Println(err)
return
}
Our version numbers follow the semantic versioning specification. You can see the available versions by checking the tags on this repository. For more details about our license model, please take a look at the LICENSE file.
2022, thiagozs