Categorygithub.com/scorum/scorum-go
repositorypackage
0.5.1
Repository: https://github.com/scorum/scorum-go.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

scorum/scorum-go

Go Report Card GoDoc Build Status

Golang RPC client library for Scorum. Both http and websocket transports are supported. The websocket one allows to set callbacks.

Usage

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

Example

import (
 scorum "github.com/scorum/scorum-go"
 "github.com/scorum/scorum-go/transport/http"
)

const testNet = "https://testnet.scorum.com"

// create client
transport := http.NewTransport(testNet)
client := NewClient(transport)

// get last 100 transactions of the particular account
history, _ := client.AccountHistory.GetAccountHistory("acc1", -1, 100)

for seq, trx := range history {
    for _, op := range trx.Operations {
        switch body := op.(type) {
        case *types.TransferOperation:
            // do something with the incoming transaction
        }
    }
}