Documentation ¶
Index ¶
- func GenerateAccountName(namePrefix string, addStrLen int) string
- func GenerateKey() *ecdsa.PrivateKey
- type API
- func (api *API) AccountCode(name string) ([]byte, error)
- func (api *API) AccountInfo(name string) (*rpcapi.RPCAccount, error)
- func (api *API) AccountInfoByID(id uint64) (*rpcapi.RPCAccount, error)
- func (api *API) AccountIsExist(name string) (bool, error)
- func (api *API) AccountNonce(name string) (uint64, error)
- func (api *API) AssetInfoByID(id uint64) (*asset.AssetObject, error)
- func (api *API) AssetInfoByName(name string) (*asset.AssetObject, error)
- func (api *API) BalanceByAssetID(name string, id uint64, typeID uint64) (*big.Int, error)
- func (api *API) DposAvailableStake(epoch uint64, name string) (*big.Int, error)
- func (api *API) DposCandidate(epoch uint64, name string) (map[string]interface{}, error)
- func (api *API) DposCandidates(epoch uint64, detail bool) ([]map[string]interface{}, error)
- func (api *API) DposCandidatesSize(epoch uint64) (uint64, error)
- func (api *API) DposEpoch(height uint64) (uint64, error)
- func (api *API) DposInfo() (map[string]interface{}, error)
- func (api *API) DposIrreversible() (map[string]interface{}, error)
- func (api *API) DposNextEpoch(epoch uint64) (uint64, error)
- func (api *API) DposNextValidCandidates() (map[string]interface{}, error)
- func (api *API) DposPrevEpoch(epoch uint64) (uint64, error)
- func (api *API) DposSnapShotTime(epoch uint64) (map[string]interface{}, error)
- func (api *API) DposValidCandidates(epoch uint64) (map[string]interface{}, error)
- func (api *API) DposVotersByCandidate(epoch uint64, candidate string, detail bool) (map[string]interface{}, error)
- func (api *API) DposVotersByVoter(epoch uint64, voter string, detail bool) (interface{}, error)
- func (api *API) FeeInfo(name string, objectType uint64) (map[string]interface{}, error)
- func (api *API) FeeInfoByID(startFeeID uint64, count uint64, time uint64) (*feemanager.ObjectFeeResult, error)
- func (api *API) GasPrice() (*big.Int, error)
- func (api *API) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error)
- func (api *API) GetBlockByNumber(number int64, fullTx bool) (map[string]interface{}, error)
- func (api *API) GetChainConfig() (*params.ChainConfig, error)
- func (api *API) GetCurrentBlock(fullTx bool) (map[string]interface{}, error)
- func (api *API) GetTransBatch(hashes []common.Hash) ([]*types.RPCTransaction, error)
- func (api *API) GetTransactionByHash(hash common.Hash) (*types.RPCTransaction, error)
- func (api *API) GetTransactionReceiptByHash(hash common.Hash) (*types.RPCReceipt, error)
- func (api *API) GetTxsByAccount(acctName common.Name, blockNr, lookforwardNum uint64) (*types.AccountTxs, error)
- func (api *API) SendRawTransaction(rawTx []byte) (common.Hash, error)
- type Account
- func (acc *Account) CallContract(id uint64, gas uint64, input []byte) (hash common.Hash, err error)
- func (acc *Account) CreateAccount(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) CreateContract(id uint64, gas uint64, input []byte) (hash common.Hash, err error)
- func (acc *Account) DestroyAsset(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
- func (acc *Account) ExitTakeOver(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
- func (acc *Account) IncreaseAsset(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) IssueAsset(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) KickedCandidate(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) Pubkey() common.PubKey
- func (acc *Account) RefundCandidate(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
- func (acc *Account) RegCandidate(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) SetAssetOwner(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) Transfer(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
- func (acc *Account) UnRegCandidate(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
- func (acc *Account) UpdateAccount(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) UpdateAccountAuthor(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) UpdateAsset(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) UpdateCandidate(to common.Name, value *big.Int, id uint64, gas uint64, ...) (hash common.Hash, err error)
- func (acc *Account) VoteCandidate(to common.Name, value *big.Int, id uint64, gas uint64, arg *dpos.VoteCandidate) (hash common.Hash, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAccountName ¶
GenerateAccountName generate account name
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API rpc api
func (*API) AccountCode ¶
AccountCode get account code
func (*API) AccountInfo ¶
func (api *API) AccountInfo(name string) (*rpcapi.RPCAccount, error)
AccountInfo get account by name
func (*API) AccountInfoByID ¶
func (api *API) AccountInfoByID(id uint64) (*rpcapi.RPCAccount, error)
AccountInfoByID get account by id
func (*API) AccountIsExist ¶
AccountIsExist account exist
func (*API) AccountNonce ¶
AccountNonce get account nonce
func (*API) AssetInfoByID ¶
func (api *API) AssetInfoByID(id uint64) (*asset.AssetObject, error)
AssetInfoByID get asset info
func (*API) AssetInfoByName ¶
func (api *API) AssetInfoByName(name string) (*asset.AssetObject, error)
AssetInfoByName get asset info
func (*API) BalanceByAssetID ¶
BalanceByAssetID get asset balance
func (*API) DposAvailableStake ¶
DposAvailableStake state info
func (*API) DposCandidate ¶
DposCandidate candidate info by name
func (*API) DposCandidates ¶
DposCandidates candidate info by name
func (*API) DposCandidatesSize ¶
DposCandidatesSize candidates size
func (*API) DposIrreversible ¶
DposIrreversible dpos irreversible info
func (*API) DposNextEpoch ¶
DposNextEpoch dpos epoch info
func (*API) DposNextValidCandidates ¶
DposNextValidCandidates dpos candidate info
func (*API) DposPrevEpoch ¶
DposPrevEpoch dpos epoch info
func (*API) DposSnapShotTime ¶
DposSnapShotTime dpos snapshot time info
func (*API) DposValidCandidates ¶
DposValidCandidates dpos candidate info
func (*API) DposVotersByCandidate ¶
func (api *API) DposVotersByCandidate(epoch uint64, candidate string, detail bool) (map[string]interface{}, error)
DposVotersByCandidate get voters info of candidate
func (*API) DposVotersByVoter ¶
DposVotersByVoter get voters info of voter
func (*API) FeeInfoByID ¶
func (api *API) FeeInfoByID(startFeeID uint64, count uint64, time uint64) (*feemanager.ObjectFeeResult, error)
FeeInfoByID get object fee by id
func (*API) GetBlockByHash ¶
GetBlockByHash get block info
func (*API) GetBlockByNumber ¶
GetBlockByNumber get block info
func (*API) GetChainConfig ¶
func (api *API) GetChainConfig() (*params.ChainConfig, error)
GetChainConfig get chain config
func (*API) GetCurrentBlock ¶
GetCurrentBlock get current block info
func (*API) GetTransBatch ¶
add by liulaocai GetTransBatch returns the transactions for the given hashes
func (*API) GetTransactionByHash ¶
GetTransactionByHash get tx info by hash
func (*API) GetTransactionReceiptByHash ¶
GetTransactionReceiptByHash get tx info by hash
func (*API) GetTxsByAccount ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account account object
func NewAccount ¶
func NewAccount(api *API, name common.Name, priv *ecdsa.PrivateKey, feeid uint64, nonce uint64, checked bool, chainID *big.Int) *Account
NewAccount new account object
func (*Account) CallContract ¶
CallContract call contract transaction
func (*Account) CreateAccount ¶
func (acc *Account) CreateAccount(to common.Name, value *big.Int, id uint64, gas uint64, newacct *accountmanager.CreateAccountAction) (hash common.Hash, err error)
CreateAccount new account
func (*Account) CreateContract ¶
func (acc *Account) CreateContract(id uint64, gas uint64, input []byte) (hash common.Hash, err error)
CreateContract create and send contract transaction
func (*Account) DestroyAsset ¶
func (acc *Account) DestroyAsset(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
DestroyAsset destory asset
func (*Account) ExitTakeOver ¶
func (acc *Account) ExitTakeOver(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
ExitTakeOver exit take over
func (*Account) IncreaseAsset ¶
func (acc *Account) IncreaseAsset(to common.Name, value *big.Int, id uint64, gas uint64, asset *accountmanager.IncAsset) (hash common.Hash, err error)
IncreaseAsset update asset
func (*Account) IssueAsset ¶
func (acc *Account) IssueAsset(to common.Name, value *big.Int, id uint64, gas uint64, asset *accountmanager.IssueAsset) (hash common.Hash, err error)
IssueAsset new asset
func (*Account) KickedCandidate ¶
func (acc *Account) KickedCandidate(to common.Name, value *big.Int, id uint64, gas uint64, arg *dpos.KickedCandidate) (hash common.Hash, err error)
KickedCandidate kicked candidates
func (*Account) RefundCandidate ¶
func (acc *Account) RefundCandidate(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
RefundCandidate refund cadiate
func (*Account) RegCandidate ¶
func (acc *Account) RegCandidate(to common.Name, value *big.Int, id uint64, gas uint64, arg *dpos.RegisterCandidate) (hash common.Hash, err error)
RegCandidate new candidate
func (*Account) SetAssetOwner ¶
func (acc *Account) SetAssetOwner(to common.Name, value *big.Int, id uint64, gas uint64, asset *accountmanager.UpdateAssetOwner) (hash common.Hash, err error)
SetAssetOwner update asset owner
func (*Account) Transfer ¶
func (acc *Account) Transfer(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
Transfer transfer tokens
func (*Account) UnRegCandidate ¶
func (acc *Account) UnRegCandidate(to common.Name, value *big.Int, id uint64, gas uint64) (hash common.Hash, err error)
UnRegCandidate remove cadiate
func (*Account) UpdateAccount ¶
func (acc *Account) UpdateAccount(to common.Name, value *big.Int, id uint64, gas uint64, newacct *accountmanager.UpdateAccountAction) (hash common.Hash, err error)
UpdateAccount update accout
func (*Account) UpdateAccountAuthor ¶
func (acc *Account) UpdateAccountAuthor(to common.Name, value *big.Int, id uint64, gas uint64, newacct *accountmanager.AccountAuthorAction) (hash common.Hash, err error)
UpdateAccountAuthor update accout
func (*Account) UpdateAsset ¶
func (acc *Account) UpdateAsset(to common.Name, value *big.Int, id uint64, gas uint64, asset *accountmanager.UpdateAsset) (hash common.Hash, err error)
UpdateAsset update asset