common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: GPL-3.0 Imports: 21 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 name ,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 GetBlockAndResult added in v0.0.7

func GetBlockAndResult(blockNr rpc.BlockNumber) (*types.BlockAndResult, error)

func GetBlockByNumber

func GetBlockByNumber(number 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 name and block number.

func GetObjectFeeByName added in v0.0.8

func GetObjectFeeByName(objectName common.Name, objectType uint64) (*feemanager.ObjectFee, error)

func GetObjectFeeResult added in v0.0.8

func GetObjectFeeResult(startObjectFeeID uint64, count uint64, time uint64) (*feemanager.ObjectFeeResult, error)

func GetTransBatch added in v0.0.27

func GetTransBatch(hashes []common.Hash) ([]*types.RPCTransaction, error)

GetTransBatch returns the transactions for the given hashes

func GetTransactionByHash

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

GetTransactionByHash returns the transaction for the given hash

func GetTxsByAccount added in v0.0.27

func GetTxsByAccount(acctName common.Name, blockNr, lookforwardNum uint64) (*types.AccountTxs, error)

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) 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) RegCandidate added in v0.0.8

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

RegCandidate

func (*Account) Transfer

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

Transfer

func (*Account) UnRegCandidate added in v0.0.8

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

UnRegCandidate

func (*Account) UpdateCandidate added in v0.0.8

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

UpdateCandidate

func (*Account) VoteCandidate added in v0.0.8

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

VoteCandidate

Jump to

Keyboard shortcuts

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