https://github.com/scorum/scorum-go
Go RPC library for Scorum blockchain
https://github.com/scorum/scorum-go
blockchain rpc
Last synced: 3 months ago
JSON representation
Go RPC library for Scorum blockchain
- Host: GitHub
- URL: https://github.com/scorum/scorum-go
- Owner: scorum
- License: mit
- Created: 2018-03-16T14:11:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T19:37:53.000Z (over 1 year ago)
- Last Synced: 2024-11-17T12:40:58.254Z (7 months ago)
- Topics: blockchain, rpc
- Language: Go
- Size: 7.4 MB
- Stars: 3
- Watchers: 7
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scorum/scorum-go
[](https://goreportcard.com/report/github.com/scorum/scorum-go)
[](https://godoc.org/github.com/scorum/scorum-go)
[](https://travis-ci.org/scorum/scorum-go)Golang RPC client library for [Scorum](https://scorumcoins.com). Both http and websocket transports are supported.
The websocket one allows to set callbacks.## Usage
```go
import "github.com/scorum/scorum-go"
```## Example
```go
import (
scorum "github.com/scorum/scorum-go"
"github.com/scorum/scorum-go/rpc"
)const testNet = "https://testnet.scorum.com"
// create client
transport := rpc.NewHTTPTransport(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
}
}
}```