common

package
v0.0.0-...-9ac19d9 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: GPL-3.0 Imports: 21 Imported by: 0

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

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

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

func GetObjectFeeResult

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

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) 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

func (acc *Account) RegCandidate(to common.Name, value *big.Int, id uint64, gas uint64, url 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

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

UnRegCandidate

func (*Account) UpdateCandidate

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

UpdateCandidate

func (*Account) VoteCandidate

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