Golang RPC (via websockets) client library for Bitshares and OpenLedger in particular
import "github.com/scorum/bitshares-go"
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()
The project is in active development but should not be used in production yet.
- Transfer
- LimitOrderCreate
- LimitOrderCancel