common

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: GPL-3.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAccountIsExist

func CheckAccountIsExist(name common.Name) (bool, error)

CheckAccountIsExist check Account is exist.

func ClientCall

func ClientCall(method string, result interface{}, args ...interface{}) error

ClientCall Wrapper rpc call api.

func DefultURL

func DefultURL() string

DefultURL default rpc url

func GasPrice

func GasPrice() (*big.Int, error)

GasPrice suggest gas price

func GetAccountBalanceByID

func GetAccountBalanceByID(accountName common.Name, assetID uint64) (*big.Int, error)

GetAccountBalanceByID get balance by address ,assetID and number.

func GetAccountByName

func GetAccountByName(name common.Name) (*accountmanager.Account, error)

func GetAssetInfoByName

func GetAssetInfoByName(assetName string) (*asset.AssetObject, error)

GetAssetInfoByName get assetINfo by accountName

func GetBlockByNumber

func GetBlockByNumber(height uint64, fullTx bool) (map[string]interface{}, error)

GetBlockByNumber returns the requested block.

func GetCurrentBlock

func GetCurrentBlock(fullTx bool) (map[string]interface{}, error)

GetCurrentBlock returns cureent block.

func GetDposAccount

func GetDposAccount(name common.Name) (map[string]interface{}, error)

func GetNonce

func GetNonce(accountname common.Name) (uint64, error)

GetNonce get nonce by address and block number.

func GetTransactionByHash

func GetTransactionByHash(hash common.Hash) (*types.RPCTransaction, error)

GetTransactionByHash returns the transaction for the given hash

func MustRPCClient

func MustRPCClient() *rpc.Client

MustRPCClient Wraper rpc's client

func SendRawTx

func SendRawTx(rawTx []byte) (common.Hash, error)

SendRawTx send raw transaction

func SetDefultURL

func SetDefultURL(rpchost string)

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

Account

func NewAccount

func NewAccount(name common.Name, priv *ecdsa.PrivateKey, feeid uint64, nonce uint64, getnonce func(common.Name) uint64) *Account

func (*Account) ChangeProducer

func (acc *Account) ChangeProducer(to common.Name, value *big.Int, id uint64, gas uint64, producer string) []byte

ChangeProducer

func (*Account) CreateAccount

func (acc *Account) CreateAccount(to common.Name, value *big.Int, id uint64, gas uint64, pubkey common.PubKey) []byte

CreateAccount

func (*Account) PubKey

func (acc *Account) PubKey() common.PubKey

func (*Account) RegProducer

func (acc *Account) RegProducer(to common.Name, value *big.Int, id uint64, gas uint64, url string, state *big.Int) []byte

RegProducer

func (*Account) Transfer

func (acc *Account) Transfer(to common.Name, value *big.Int, id uint64, gas uint64) []byte

Transfer

func (*Account) UnRegProducer

func (acc *Account) UnRegProducer(to common.Name, value *big.Int, id uint64, gas uint64) []byte

UnRegProducer

func (*Account) UnvoteProducer

func (acc *Account) UnvoteProducer(to common.Name, value *big.Int, id uint64, gas uint64) []byte

func (*Account) UnvoteVoter

func (acc *Account) UnvoteVoter(to common.Name, value *big.Int, id uint64, gas uint64, voter string) []byte

UnvoteVoter

func (*Account) UpdateProducer

func (acc *Account) UpdateProducer(to common.Name, value *big.Int, id uint64, gas uint64, url string, state *big.Int) []byte

UpdateProducer

func (*Account) VoteProducer

func (acc *Account) VoteProducer(to common.Name, value *big.Int, id uint64, gas uint64, producer string, state *big.Int) []byte

VoteProducer

Jump to

Keyboard shortcuts

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