bitshares

package module
v0.0.0-...-bbfc9be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 12 Imported by: 0

README

scorum/bitshares-go

Go Report Card GoDoc Build Status

Golang RPC (via websockets) client library for Bitshares and OpenLedger in particular

Usage

import "github.com/scorum/bitshares-go"

Example

client, err := NewClient("wss://bitshares.openledger.info/ws")

// retrieve the current global_property_object
props, err := client.Database.GetDynamicGlobalProperties()

// lookup symbols ids
symbols, err := client.Database.LookupAssetSymbols("OPEN.SCR", "USD")
require.NoError(t, err)

openSCR := symbols[0].ID
USD := symbols[1].ID

// retrieve 5 last filled orders
orders, err := client.History.GetFillOrderHistory(openSCR, USD, 5)

// set a block applied callback
client.Database.SetBlockAppliedCallback(func(blockID string, err error) {
    log.Println(blockID)
})

// cancel all callbacks
client.Database.CancelAllSubscriptions()

Status

The project is in active development but should not be used in production yet.

Supported operations

  • Transfer
  • LimitOrderCreate
  • LimitOrderCancel

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Database represents database_api
	Database *database.API

	// NetworkBroadcast represents network_broadcast_api
	NetworkBroadcast *networkbroadcast.API

	// History represents history_api
	History *history.API

	// Login represents login_api
	Login *login.API
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string) (*Client, error)

NewClient creates a new RPC client

func (*Client) Close

func (client *Client) Close() error

Close should be used to close the client when no longer needed. It simply calls Close() on the underlying CallCloser.

func (*Client) LimitOrderCancel

func (client *Client) LimitOrderCancel(key string, feePayingAccount, order types.ObjectID, fee types.AssetAmount) error

func (*Client) LimitOrderCreate

func (client *Client) LimitOrderCreate(key string, seller types.ObjectID, fee, amToSell, minToRecive types.AssetAmount, expiration time.Duration, fillOrKill bool) (string, error)

func (*Client) Transfer

func (client *Client) Transfer(key string, from, to types.ObjectID, amount, fee types.AssetAmount) error

Transfer a certain amount of the given asset

Directories

Path Synopsis
apis
encoding
wif
rfc6979
Package rfc6979 is an implementation of RFC 6979's deterministic DSA.
Package rfc6979 is an implementation of RFC 6979's deterministic DSA.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL