client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAccountAPI

func GenerateAccountAPI() (privKey string, address string)

GenerateAccountAPI - randomly generate account

Types

type Balance

type Balance struct {
	SHR  string // amount of SHR coins
	SHRP string // amount of SHRP coins
}

func CheckBalanceAPI

func CheckBalanceAPI(
	client string,
	privKey string,
	address string,
) (balance Balance, err error)

CheckBalanceAPI - return balance of an address

type CoreContext

type CoreContext struct {
	Client  rpcclient.Client
	PrivKey types.PrivKeySecp256k1
	Codec   *wire.Codec
}

func NewCoreContextFromConfig

func NewCoreContextFromConfig(config *cfg.Config) CoreContext

func NewCoreContextFromConfigWithClient

func NewCoreContextFromConfigWithClient(config *cfg.Config, client string) CoreContext

func NewCoreContextWithClient

func NewCoreContextWithClient(privKey string, client string) CoreContext

func (CoreContext) BeginUnbonding

func (c CoreContext) BeginUnbonding(amount int64) error

func (CoreContext) CheckBalance

func (c CoreContext) CheckBalance(address sdk.Address) (coins types.Coins, err error)

func (CoreContext) CheckValidatorDistInfo

func (c CoreContext) CheckValidatorDistInfo() error

func (CoreContext) CompleteUnbonding

func (c CoreContext) CompleteUnbonding() error

func (CoreContext) ConstructTendermintTransaction

func (c CoreContext) ConstructTendermintTransaction(tx auth.AuthTx) (tdmtx tdmtypes.Tx, err error)

ConstructTendermintTransaction - encode a ShareLedger authTx in Amino and form a Tendermint tx before sending to ShareLedger

func (CoreContext) ConstructTransaction

func (c CoreContext) ConstructTransaction(msg sdk.Msg) (auth.AuthTx, error)

func (CoreContext) GetNonce

func (c CoreContext) GetNonce() (int64, error)

func (CoreContext) LoadBalance

func (c CoreContext) LoadBalance(to sdk.Address, amount types.Coin) (res Response, err error)

func (CoreContext) RegisterValidator

func (c CoreContext) RegisterValidator(
	amount int64,
	moniker string,
	identity string,
	website string,
	details string,
) (res Response, err error)

func (CoreContext) SendCoins

func (c CoreContext) SendCoins(to sdk.Address, amt types.Coin) (res Response, err error)

func (CoreContext) WithdrawBlockReward

func (c CoreContext) WithdrawBlockReward() (res Response, err error)

type Response

type Response struct {
	Code uint32 `json:"code"`
	Data []byte `json:"data"`
	Log  string `json:"log"`
	Hash []byte `json:"hash"`
}

Response - response from any transaction to Shareledger

func LoadBalanceAPI

func LoadBalanceAPI(
	client string,
	privKey string,
	toAddress string,
	amount string,
	denom string,
) (res Response, err error)

LoadBalanceAPI - load coin

func SendCoinAPI

func SendCoinAPI(
	client string,
	privKey string,
	toAddress string,
	amount string,
	denom string,
) (res Response, err error)

func (Response) String

func (r Response) String() string

type SHRAccount1

type SHRAccount1 struct {
	Address sdk.Address `json:"address"`
	Coins   types.Coins `json:"coins"`
	PubKey  []byte      `json:"pub_key"`
	Nonce   int64       `json:"nonce"`
}

Jump to

Keyboard shortcuts

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