Skip to content

darhelm/go-tabdeal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Tabdeal

Go Reference Go Report Card License: MIT Go Version

A clean, strongly typed, and fully documented Go SDK for interacting with the Tabdeal exchange API.

This SDK provides strict typed models, request signing, public/private endpoints, and predictable behavior with minimal abstraction.

Disclaimer

This SDK is unofficial. Use at your own risk.

Features

  • Full support for Tabdeal public & authenticated endpoints
  • Strongly typed request/response structs
  • Simple API key + secret authentication
  • Request signing (HMAC-SHA256)
  • Order placement, cancellation, bulk cancellation
  • Wallets, trades, order history
  • Order book & recent trades
  • Fully structured error handling (APIError, RequestError)

Installation

go get github.com/darhelm/go-tabdeal

Quick Start

package main

import (
    "fmt"
    "time"
    tabdeal "github.com/darhelm/go-tabdeal"
)

func main() {
    client, err := tabdeal.NewClient(tabdeal.ClientOptions{
        ApiKey:    "YOUR_KEY",
        ApiSecret: "YOUR_SECRET",
        Timeout:   5 * time.Second,
    })
    if err != nil {
        panic(err)
    }

    info, err := client.GetMarketInformation()
    if err != nil {
        panic(err)
    }

    fmt.Println((*info)[0].Symbol)
}

Documentation


Examples

Create Client

client, err := tabdeal.NewClient(tabdeal.ClientOptions{
    ApiKey:    "KEY",
    ApiSecret: "SECRET",
    Timeout:   5 * time.Second,
})

Market Information

info, err := client.GetMarketInformation()
fmt.Println((*info)[0].Symbol)

Order Book

ob, err := client.GetOrderBook(types.GetOrderBookParams{
    Symbol: "BTCIRT",
})
fmt.Println(ob.Asks[0], ob.Bids[0])

Recent Trades

trades, err := client.GetRecentTrades(types.GetRecentTradesParams{
    Symbol: "BTCIRT",
})

Wallets

wallets, err := client.GetWallets(types.GetWalletParams{
    Asset: "USDT",
})

Create Order

resp, err := client.CreateOrder(types.CreateOrderParams{
    Symbol:   "BTCIRT",
    Side:     "BUY",
    Type:     "LIMIT",
    Quantity: 0.01,
    Price:    1500000000,
})

Cancel Order

cancel, err := client.CancelOrder(types.CancelOrderParams{
    Symbol:  "BTCIRT",
    OrderId: 1234,
})

Bulk Cancel

bulk, err := client.CancelOrderBulk(types.CancelOrderBulkParams{
    Symbol: "BTCIRT",
})

Order History

history, err := client.GetOrdersHistory(types.GetUserOrdersHistoryParams{
    Symbol: "BTCIRT",
})

Open Orders

open, err := client.GetOpenOrders(types.GetOpenOrdersParams{
    Symbol: "BTCIRT",
})

Order Status

st, err := client.GetOrderStatus(types.GetOrderStatusParams{
    OrderId: 1234,
})

User Trades

trades, err := client.GetUserTrades(types.GetUserTradesParams{
    Symbol: "BTCIRT",
})

Error Handling

if err != nil {
    if apiErr, ok := err.(*tabdeal.APIError); ok {
        fmt.Println(apiErr.Code, apiErr.Message, apiErr.Detail)
    }
}

License

MIT License.

About

Tabdeal Exchange Go SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages