Giter Site home page Giter Site logo

golang-sdk's Introduction

Casper Golang SDK

Rpc client usage

import "github.com/casper-ecosystem/casper-golang-sdk/sdk"

client := sdk.NewRpcClient("http://157.245.67.232:7777/rpc")

// Getting info about last block
resp, err := client.GetLatestBlock()

// Getting info about last block by hash
resp, err := client.GetBlockByHash(hash)

// Getting info about last block by height
resp, err := client.GetBlockByHeight(height)

// Getting info about a single deploy by hash
resp, err := client.GetDeploy(hash)

// Getting global state item
resp, err := client.GetStateItem(stateRootHash, key, path)

// Geting info about status 
resp, err := client.GetStatus()

// Getting info about auction
resp, err := client.GetValidator()

// Getting info about peers 
resp, err := client.GetPeers()

// Getting info abot latest block transfers
resp, err := client.GetLatestBlockTransfers()

// Getting info about block transfers by hash
resp, err := client.GetBlockTransfersByHash(blockHash)

// Getting info about block transfers by height
resp, err := client.GetBlockTransfersByHeight(blockHeight)

// Getting info about account balance
resp, err := client.GetAccountBalance(stateRootHash, balanceUref)

KeyPair package usage

import "github.com/casper-ecosystem/casper-golang-sdk/keypair"

// Creating a random Ed25519 keypair
edKeyPair := keypair.ed25519.Ed25519Random()

// Getting Ed25519 public key
edPubKey := keypair.ed22519.PublicKey()

golang-sdk's People

Contributors

n-shaburoff avatar volendi avatar darthsiroftardis avatar piotr-dziubecki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.