Documentation ¶
Index ¶
- func GenerateAccountName(namePrefix string, addStrLen int) string
- func GenerateKey() (*ecdsa.PrivateKey, common.PubKey)
- type API
- func (api *API) AccountCode(name string) ([]byte, error)
- func (api *API) AccountInfo(name string) (map[string]interface{}, 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) BlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error)
- func (api *API) BlockByNumber(number int64, fullTx bool) (map[string]interface{}, error)
- func (api *API) ChainConfig() (*params.ChainConfig, error)
- func (api *API) CurrentBlock(fullTx bool) (map[string]interface{}, error)
- func (api *API) DposAvailableStake(name string) (map[string]interface{}, error)
- func (api *API) DposAvailableStakeByHeight(height uint64, name string) (map[string]interface{}, error)
- func (api *API) DposCandidate(name string) (map[string]interface{}, error)
- func (api *API) DposCandidates(detail bool) ([]map[string]interface{}, error)
- func (api *API) DposInfo() (map[string]interface{}, error)
- func (api *API) DposIrreversible() (map[string]interface{}, error)
- func (api *API) DposNextValidCandidates() (map[string]interface{}, error)
- func (api *API) DposNextValidCandidatesByHeight(height uint64) (map[string]interface{}, error)
- func (api *API) DposSnapShotTime() (map[string]interface{}, error)
- func (api *API) DposSnapShotTimeByHeight(height uint64) (map[string]interface{}, error)
- func (api *API) DposValidCandidates() (map[string]interface{}, error)
- func (api *API) DposValidCandidatesByHeight(height uint64) (map[string]interface{}, error)
- func (api *API) DposVotersByCandidate(candidate string, detail bool) (map[string]interface{}, error)
- func (api *API) DposVotersByCandidateByHeight(height uint64, candidate string, detail bool) (map[string]interface{}, error)
- func (api *API) DposVotersByVoter(voter string, detail bool) (interface{}, error)
- func (api *API) DposVotersByVoterByHeight(height 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) (*feemanager.ObjectFeeResult, error)
- func (api *API) FeeInfoByTime(time uint64, startFeeID uint64, count uint64) (*feemanager.ObjectFeeResult, error)
- func (api *API) GasPrice() (*big.Int, error)
- func (api *API) MinerMining() (bool, error)
- func (api *API) MinerSetCoinbase(name string, privKeys []string) (bool, error)
- func (api *API) MinerSetExtra(extra []byte) (bool, error)
- func (api *API) MinerStart() (bool, error)
- func (api *API) MinerStop() (bool, error)
- func (api *API) SendRawTransaction(rawTx []byte) (common.Hash, error)
- func (api *API) TransactionByHash(hash common.Hash) (*types.RPCTransaction, error)
- func (api *API) TransactionReceiptByHash(hash common.Hash) (*types.RPCReceipt, error)
- type Account
- func (acc *Account) CreateAccount(to common.Name, value *big.Int, id uint64, gas uint64, ...) (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) 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) 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
func GenerateKey ¶
func GenerateKey() (*ecdsa.PrivateKey, common.PubKey)
GenerateKey generate pubkey and privkey
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API rpc api
func (*API) AccountCode ¶
AccountCode get account code
func (*API) AccountInfo ¶
AccountInfo get account by name
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) BlockByHash ¶
BlockByHash block info
func (*API) BlockByNumber ¶
BlockByNumber block info
func (*API) ChainConfig ¶ added in v0.0.8
func (api *API) ChainConfig() (*params.ChainConfig, error)
ChainConfig chain config
func (*API) CurrentBlock ¶
CurrentBlock current block info
func (*API) DposAvailableStake ¶ added in v0.0.8
DposAvailableStake state info
func (*API) DposAvailableStakeByHeight ¶ added in v0.0.9
func (api *API) DposAvailableStakeByHeight(height uint64, name string) (map[string]interface{}, error)
DposAvailableStakeByHeight state info
func (*API) DposCandidate ¶ added in v0.0.8
DposCandidate candidate info by name
func (*API) DposCandidates ¶ added in v0.0.8
DposCandidates candidate info by name
func (*API) DposIrreversible ¶
DposIrreversible dpos irreversible info
func (*API) DposNextValidCandidates ¶ added in v0.0.9
DposNextValidCandidates dpos candidate info
func (*API) DposNextValidCandidatesByHeight ¶ added in v0.0.9
DposNextValidCandidatesByHeight dpos candidate info
func (*API) DposSnapShotTime ¶ added in v0.0.9
DposSnapShotTime dpos snapshot time info
func (*API) DposSnapShotTimeByHeight ¶ added in v0.0.9
DposSnapShotTimeByHeight dpos snapshot time info
func (*API) DposValidCandidates ¶ added in v0.0.8
DposValidCandidates dpos candidate info
func (*API) DposValidCandidatesByHeight ¶ added in v0.0.9
DposValidCandidatesByHeight dpos candidate info
func (*API) DposVotersByCandidate ¶ added in v0.0.8
func (api *API) DposVotersByCandidate(candidate string, detail bool) (map[string]interface{}, error)
DposVotersByCandidate get voters info of candidate
func (*API) DposVotersByCandidateByHeight ¶ added in v0.0.9
func (api *API) DposVotersByCandidateByHeight(height uint64, candidate string, detail bool) (map[string]interface{}, error)
DposVotersByCandidateByHeight get voters info of candidate
func (*API) DposVotersByVoter ¶ added in v0.0.8
DposVotersByVoter get voters info of voter
func (*API) DposVotersByVoterByHeight ¶ added in v0.0.9
func (api *API) DposVotersByVoterByHeight(height uint64, voter string, detail bool) (interface{}, error)
DposVotersByVoterByHeight get voters info of voter
func (*API) FeeInfoByID ¶ added in v0.0.8
func (api *API) FeeInfoByID(startFeeID uint64, count uint64) (*feemanager.ObjectFeeResult, error)
func (*API) FeeInfoByTime ¶ added in v0.0.8
func (api *API) FeeInfoByTime(time uint64, startFeeID uint64, count uint64) (*feemanager.ObjectFeeResult, error)
func (*API) MinerSetCoinbase ¶
MinerSetCoinbase coinbase
func (*API) MinerSetExtra ¶
MinerSetExtra extra
func (*API) SendRawTransaction ¶
SendRawTransaction send tx
func (*API) TransactionByHash ¶
TransactionByHash tx info
func (*API) TransactionReceiptByHash ¶
TransactionReceiptByHash tx info
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) 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) 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 ¶ added in v0.0.8
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) RegCandidate ¶ added in v0.0.8
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 *asset.AssetObject) (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 ¶ added in v0.0.8
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.UpdataAccountAction) (hash common.Hash, err error)
UpdateAccount 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