Golang-kraken - Golang client for Kraken API

golang-kraken

Golang client for the Kraken API.

Getting Started

Installing

go get github.com/astaluego/golang-kraken

Quick start

package main

import (
    "fmt"
    kraken "github.com/astaluego/golang-kraken"
)

func main() {
    client := kraken.New()

    // Public calls
    time, err := client.ServerTime()
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(time)
    }

    assets, err := client.Assets(kraken.AssetsConfig{
        AssetClass: kraken.Currency,
        Assets:     []kraken.Asset{kraken.XBT},
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(assets)
    }

    // Private calls
    client.WithAuthentification("YOUR_API_KEY", "YOUR_PRIVATE_KEY") // To generate a new one --> https://www.kraken.com/u/security/api

    accountBalance, err := client.AccountBalance()
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(accountBalance)
    }
}

Supported calls

Public market data

  • Get server time
  • Get system status
  • Get asset info
  • Get tradable asset pairs
  • Get ticker information
  • Get OHLC data
  • Get order book
  • Get recent trades
  • Get recent spread data

Private user data

  • Get account balance
  • Get trade balance
  • Get open orders
  • Get closed orders
  • Query orders info
  • Get trades history
  • Query trades info
  • Get open positions
  • Get ledgers info
  • Query ledgers
  • Get trade volume
  • Request export report
  • Get export statuses
  • Get export report
  • Remove export report

Private user trading

  • Add order
  • Cancel order
  • Cancel all orders
  • Cancel all orders after X

Private user funding

  • Get deposit methods
  • Get deposit addresses
  • Get status of recent deposits
  • Get withdrawal information
  • Withdraw funds
  • Get status of recent withdrawals
  • Request withdrawal cancelation
  • Request wallet transfer

Private user staking

  • Stake asset
  • Unstake asset
  • List of stakeable assets
  • Get pending staking transactions
  • List of staking transactions

Generated code

In the generate/ folder, you will find the source code to update assets.go and asset_pairs.go. Two calls on the Kraken API are made in order to get the list of the assets and asset pairs available on the plateform. Then the code is generated through the text/template feature of Golang.

The aim is to have a list of assets and asset pairs in Golang constants to simplify the usage of the library.

NB: assets.go and asset_pairs.go should not be manually edited. To update these files, run the make generate command.

References

Similar Resources

Golang telegram bot API wrapper, session-based router and middleware

go-tgbot Pure Golang telegram bot API wrapper generated from swagger definition, session-based routing and middlewares. Usage benefits No need to lear

Nov 16, 2022

Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

Jan 6, 2023

A bot based on Telegram Bot API written in Golang allows users to download public Instagram photos, videos, and albums without receiving the user's credentials.

InstagramRobot InstagramRobot is a bot based on Telegram Bot API written in Golang that allows users to download public Instagram photos, videos, and

Dec 16, 2021

Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

Nov 18, 2021

A modular Golang Discord API Wrapper

DisGo DisGo is a Discord API wrapper written in GoLang aimed to be consistent, modular, customizable and higher level than other Discord API wrappers.

Jan 3, 2023

Go library for Telegram Bot API

Go library for Telegram Bot API

tbot - Telegram Bot Server Features Full Telegram Bot API 4.7 support Zero dependency Type-safe API client with functional options Capture messages by

Nov 30, 2022

Full-native go implementation of Telegram API

Full-native go implementation of Telegram API

MTProto Full-native implementation of MTProto protocol on Golang! english русский 简体中文 Features Full native implementation All code, from sending requ

Jan 1, 2023

Bot that polls activity API for Github organisation and pushes updates to Telegram.

git-telegram-bot Telegram bot for notifying org events Requirements (for building) Go version 1.16.x Setup If you don't have a telegram bot token yet,

Apr 8, 2022

Harmony is a peaceful Go module for interacting with Discord's API

Harmony Harmony is a peaceful Go module for interacting with Discord's API. Although this package is usable, it still is under active development so p

Sep 18, 2022
Client lib for Telegram bot api

Micha Client lib for Telegram bot api. Supports Bot API v2.3.1 (of 4th Dec 2016). Simple echo bot example: package main import ( "log" "git

Nov 10, 2022
DiscordGo: a Go package that provides low level bindings to the Discord chat client API
DiscordGo: a Go package that provides low level bindings to the Discord chat client API

DiscordGo DiscordGo is a Go package that provides low level bindings to the Discord chat client API. DiscordGo has nearly complete support for all of

Dec 14, 2021
Telego is Telegram Bot API library for Golang with full API implementation (one-to-one)
Telego is Telegram Bot API library for Golang with full API implementation (one-to-one)

Telego • Go Telegram Bot API Telego is Telegram Bot API library for Golang with full API implementation (one-to-one) The goal of this library was to c

Jan 5, 2023
Feishu/Lark Open API Go Sdk, Support ALL Open API and Event Callback.

lark 中文版 README Feishu/Lark Open API Go Sdk, Support ALL Open API and Event Callback. Created By Code Generation. Install go get github.com/chyroc/lar

Jan 5, 2023
Tg-channel-api - A JSON API for latest messages of public Telegram channels

Telegram Channel API A JSON API for latest messages of public Telegram channels.

Oct 27, 2022
Library for working with golang telegram client + bot based on tdlib. This library was taken from the user Arman92 and changed for the current version of tdlib.

go-tdlib Golang Telegram TdLib JSON bindings Install To install, you need to run inside a docker container (it is given below) go get -u github.com/ka

Dec 2, 2022
go irc client for twitch.tv

go-twitch-irc This is an irc client for connecting to twitch. It handles the annoying stuff like irc tag parsing. I highly recommend reading the docum

Dec 27, 2022
Discordo is a lightweight, secure, and feature-rich Discord terminal client.
Discordo is a lightweight, secure, and feature-rich Discord terminal client.

discordo · [WIP] Discordo is a lightweight, secure, and feature-rich Discord terminal client. It is highly configurable and has a minimalistic user in

Jan 5, 2023
Gotgproto - A helper package for Go Telegram Client, i.e. gotd/td

GoTGProto GoTGProto is a helper package for gotd library, It aims to make td's r

Dec 16, 2022
Client to send messages to channels in Slack.

Slack Client A simple client to send messages to channels in Slack. Example package main import { "fmt" slack "github.com/tommzn/go-slack" }

Mar 13, 2022