Documentation ¶
Index ¶
- Variables
- func TryMakeConcernedError(err error) (newerr error, concerned bool)
- type AccountBlock
- type CommonApi
- type ContractsApi
- func (c *ContractsApi) GetCancelConsensusGroupData(gid types.Gid) (string, error)
- func (c *ContractsApi) GetCancelPledgeData(beneficialAddr types.Address, amount *big.Int) (string, error)
- func (c *ContractsApi) GetCancelRegisterData(gid types.Gid, name string) (string, error)
- func (c *ContractsApi) GetCancelVoteData(gid types.Gid) (string, error)
- func (c *ContractsApi) GetConditionRegisterOfPledge(amount *big.Int, tokenId types.TokenTypeId, height uint64) (string, error)
- func (c *ContractsApi) GetConditionVoteOfDefault() (string, error)
- func (c *ContractsApi) GetConditionVoteOfKeepToken(amount *big.Int, tokenId types.TokenTypeId) (string, error)
- func (c *ContractsApi) GetCreateConsensusGroupData(param CreateConsensusGroupParam) (string, error)
- func (c *ContractsApi) GetCreateContractToAddress(selfAddr types.Address, height uint64, prevHash types.Hash, ...) types.Address
- func (c *ContractsApi) GetMintageCancelPledgeData(tokenId types.TokenTypeId) (string, error)
- func (c *ContractsApi) GetMintageData(param MintageParams) (string, error)
- func (c *ContractsApi) GetPledgeData(beneficialAddr types.Address) (string, error)
- func (c *ContractsApi) GetReCreateConsensusGroupData(gid types.Gid) (string, error)
- func (c *ContractsApi) GetRegisterData(gid types.Gid, name string, nodeAddr types.Address, ...) (string, error)
- func (c *ContractsApi) GetRewardData(gid types.Gid, name string, endHeight uint64, startHeight uint64, ...) (string, error)
- func (c *ContractsApi) GetUpdateRegistrationData(gid types.Gid, name string, nodeAddr types.Address, ...) (string, error)
- func (c *ContractsApi) GetVoteData(gid types.Gid, name string) (string, error)
- func (c ContractsApi) String() string
- type CreateConsensusGroupParam
- type CreateTransferTxParms
- type HexSignedTuple
- type IsMayValidKeystoreFileResponse
- type JsonRpc2Error
- type LedgerApi
- func (l *LedgerApi) GetAccountByAccAddr(addr types.Address) (*RpcAccountInfo, error)
- func (l *LedgerApi) GetBlocksByAccAddr(addr types.Address, index int, count int, needTokenInfo *bool) ([]*AccountBlock, error)
- func (l *LedgerApi) GetBlocksByHash(addr types.Address, originBlockHash *types.Hash, count uint64) ([]*AccountBlock, error)
- func (l *LedgerApi) GetLatestBlock(addr types.Address) (*AccountBlock, error)
- func (l *LedgerApi) GetLatestSnapshotChainHash() *types.Hash
- func (l *LedgerApi) GetSnapshotChainHeight() string
- func (l *LedgerApi) GetTokenMintage(tti types.TokenTypeId) (*RpcTokenInfo, error)
- func (l LedgerApi) String() string
- type MintageParams
- type NetApi
- type P2PApi
- type PrivateOnroadApi
- func (o PrivateOnroadApi) GetAccountOnroadInfo(address types.Address) (*RpcAccountInfo, error)
- func (o PrivateOnroadApi) GetOnroadBlocksByAddress(address types.Address, index int, count int) ([]*AccountBlock, error)
- func (o PrivateOnroadApi) ListWorkingAutoReceiveWorker() []types.Address
- func (o PrivateOnroadApi) StartAutoReceive(addr types.Address, filter map[types.TokenTypeId]string) error
- func (o PrivateOnroadApi) StopAutoReceive(addr types.Address) error
- func (o PrivateOnroadApi) String() string
- type PublicOnroadApi
- type RpcAccountInfo
- type RpcTokenBalanceInfo
- type RpcTokenInfo
- type SyncInfo
- type TypesApi
- type WalletApi
- func (m *WalletApi) CreateTxWithPassphrase(params CreateTransferTxParms) error
- func (m *WalletApi) ExportPriv(address types.Address, password string) (string, error)
- func (m WalletApi) GetDataDir() string
- func (m *WalletApi) ImportPriv(privkey string, newpassword string) (types.Address, error)
- func (m *WalletApi) IsMayValidKeystoreFile(path string) IsMayValidKeystoreFileResponse
- func (m WalletApi) ListAddress() []types.Address
- func (m *WalletApi) LockAddress(addr types.Address) error
- func (m *WalletApi) NewAddress(passphrase string) (types.Address, error)
- func (m *WalletApi) ReloadAndFixAddressFile() error
- func (m *WalletApi) SignData(addr types.Address, hexMsg string) (HexSignedTuple, error)
- func (m *WalletApi) SignDataWithPassphrase(addr types.Address, hexMsg string, password string) (HexSignedTuple, error)
- func (m WalletApi) Status() map[types.Address]string
- func (m WalletApi) String() string
- func (m *WalletApi) UnlockAddress(addr types.Address, password string, duration *uint64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotSupport = errors.New("not support this method") ErrBalanceNotEnough = JsonRpc2Error{ Message: vm.ErrInsufficientBalance.Error(), Code: -35001, } ErrDecryptKey = JsonRpc2Error{ Message: walleterrors.ErrDecryptKey.Error(), Code: -34001, } AddressAlreadyUnLocked = JsonRpc2Error{ Message: walleterrors.ErrAlreadyLocked.Error(), Code: -34002, } )
View Source
var (
ErrStrToBigInt = errors.New("convert to big.Int failed")
)
Functions ¶
func TryMakeConcernedError ¶
Types ¶
type AccountBlock ¶
type AccountBlock struct { *ledger.AccountBlock FromAddress types.Address `json:"fromAddress"` Height string `json:"height"` Quota string `json:"quota"` Amount string `json:"amount"` Fee string `json:"fee"` ConfirmedTimes string `json:"confirmedTimes"` TokenInfo *RpcTokenInfo `json:"tokenInfo"` }
func (*AccountBlock) LedgerAccountBlock ¶
func (ab *AccountBlock) LedgerAccountBlock() (*ledger.AccountBlock, error)
type ContractsApi ¶
type ContractsApi struct {
// contains filtered or unexported fields
}
func NewContractsApi ¶
func NewContractsApi(vite *vite.Vite) *ContractsApi
func (*ContractsApi) GetCancelConsensusGroupData ¶
func (c *ContractsApi) GetCancelConsensusGroupData(gid types.Gid) (string, error)
func (*ContractsApi) GetCancelPledgeData ¶
func (*ContractsApi) GetCancelRegisterData ¶
func (*ContractsApi) GetCancelVoteData ¶
func (c *ContractsApi) GetCancelVoteData(gid types.Gid) (string, error)
func (*ContractsApi) GetConditionRegisterOfPledge ¶
func (c *ContractsApi) GetConditionRegisterOfPledge(amount *big.Int, tokenId types.TokenTypeId, height uint64) (string, error)
func (*ContractsApi) GetConditionVoteOfDefault ¶
func (c *ContractsApi) GetConditionVoteOfDefault() (string, error)
func (*ContractsApi) GetConditionVoteOfKeepToken ¶
func (c *ContractsApi) GetConditionVoteOfKeepToken(amount *big.Int, tokenId types.TokenTypeId) (string, error)
func (*ContractsApi) GetCreateConsensusGroupData ¶
func (c *ContractsApi) GetCreateConsensusGroupData(param CreateConsensusGroupParam) (string, error)
func (*ContractsApi) GetCreateContractToAddress ¶
func (*ContractsApi) GetMintageCancelPledgeData ¶
func (c *ContractsApi) GetMintageCancelPledgeData(tokenId types.TokenTypeId) (string, error)
func (*ContractsApi) GetMintageData ¶
func (c *ContractsApi) GetMintageData(param MintageParams) (string, error)
func (*ContractsApi) GetPledgeData ¶
func (c *ContractsApi) GetPledgeData(beneficialAddr types.Address) (string, error)
func (*ContractsApi) GetReCreateConsensusGroupData ¶
func (c *ContractsApi) GetReCreateConsensusGroupData(gid types.Gid) (string, error)
func (*ContractsApi) GetRegisterData ¶
func (*ContractsApi) GetRewardData ¶
func (*ContractsApi) GetUpdateRegistrationData ¶
func (*ContractsApi) GetVoteData ¶
func (ContractsApi) String ¶
func (c ContractsApi) String() string
type CreateConsensusGroupParam ¶
type CreateConsensusGroupParam struct { SelfAddr types.Address Height uint64 PrevHash types.Hash SnapshotHash types.Hash NodeCount uint8 Interval int64 PerCount int64 RandCount uint8 RandRank uint8 CountingTokenId types.TokenTypeId RegisterConditionId uint8 RegisterConditionParam []byte VoteConditionId uint8 VoteConditionParam []byte }
type CreateTransferTxParms ¶
type HexSignedTuple ¶
type JsonRpc2Error ¶
func (JsonRpc2Error) Error ¶
func (e JsonRpc2Error) Error() string
func (JsonRpc2Error) ErrorCode ¶
func (e JsonRpc2Error) ErrorCode() int
type LedgerApi ¶
type LedgerApi struct {
// contains filtered or unexported fields
}
func NewLedgerApi ¶
func (*LedgerApi) GetAccountByAccAddr ¶
func (l *LedgerApi) GetAccountByAccAddr(addr types.Address) (*RpcAccountInfo, error)
func (*LedgerApi) GetBlocksByAccAddr ¶
func (*LedgerApi) GetBlocksByHash ¶
func (*LedgerApi) GetLatestBlock ¶
func (l *LedgerApi) GetLatestBlock(addr types.Address) (*AccountBlock, error)
func (*LedgerApi) GetLatestSnapshotChainHash ¶
func (*LedgerApi) GetSnapshotChainHeight ¶
func (*LedgerApi) GetTokenMintage ¶
func (l *LedgerApi) GetTokenMintage(tti types.TokenTypeId) (*RpcTokenInfo, error)
type MintageParams ¶
type P2PApi ¶
type P2PApi struct {
// contains filtered or unexported fields
}
func (P2PApi) NetworkAvailable ¶
func (P2PApi) PeersCount ¶
type PrivateOnroadApi ¶
type PrivateOnroadApi struct {
// contains filtered or unexported fields
}
func NewPrivateOnroadApi ¶
func NewPrivateOnroadApi(manager *onroad.Manager) *PrivateOnroadApi
func (PrivateOnroadApi) GetAccountOnroadInfo ¶
func (o PrivateOnroadApi) GetAccountOnroadInfo(address types.Address) (*RpcAccountInfo, error)
func (PrivateOnroadApi) GetOnroadBlocksByAddress ¶
func (o PrivateOnroadApi) GetOnroadBlocksByAddress(address types.Address, index int, count int) ([]*AccountBlock, error)
func (PrivateOnroadApi) ListWorkingAutoReceiveWorker ¶
func (o PrivateOnroadApi) ListWorkingAutoReceiveWorker() []types.Address
func (PrivateOnroadApi) StartAutoReceive ¶
func (o PrivateOnroadApi) StartAutoReceive(addr types.Address, filter map[types.TokenTypeId]string) error
func (PrivateOnroadApi) StopAutoReceive ¶
func (o PrivateOnroadApi) StopAutoReceive(addr types.Address) error
func (PrivateOnroadApi) String ¶
func (o PrivateOnroadApi) String() string
type PublicOnroadApi ¶
type PublicOnroadApi struct {
// contains filtered or unexported fields
}
func NewPublicOnroadApi ¶
func NewPublicOnroadApi(manager *onroad.Manager) *PublicOnroadApi
func (PublicOnroadApi) GetAccountOnroadInfo ¶
func (o PublicOnroadApi) GetAccountOnroadInfo(address types.Address) (*RpcAccountInfo, error)
func (PublicOnroadApi) GetOnroadBlocksByAddress ¶
func (o PublicOnroadApi) GetOnroadBlocksByAddress(address types.Address, index int, count int) ([]*AccountBlock, error)
func (PublicOnroadApi) String ¶
func (o PublicOnroadApi) String() string
type RpcAccountInfo ¶
type RpcAccountInfo struct { AccountAddress types.Address `json:"accountAddress"` TotalNumber string `json:"totalNumber"` // uint64 TokenBalanceInfoMap map[types.TokenTypeId]*RpcTokenBalanceInfo `json:"tokenBalanceInfoMap,omitempty"` }
type RpcTokenBalanceInfo ¶
type RpcTokenBalanceInfo struct { TokenInfo *RpcTokenInfo `json:"tokenInfo,omitempty"` TotalAmount string `json:"totalAmount"` // big int Number *string `json:"number,omitempty"` // uint64 }
type RpcTokenInfo ¶
type RpcTokenInfo struct { TokenName string `json:"tokenName"` TokenSymbol string `json:"tokenSymbol"` TotalSupply *string `json:"totalSupply,omitempty"` // *big.Int Decimals uint8 `json:"decimals"` Owner types.Address `json:"owner"` PledgeAmount *string `json:"pledgeAmount,omitempty"` // *big.Int WithdrawHeight string `json:"withdrawHeight"` // uint64 }
func RawTokenInfoToRpc ¶
func RawTokenInfoToRpc(tinfo *contracts.TokenInfo) *RpcTokenInfo
type TypesApi ¶
type TypesApi struct { }
func (TypesApi) IsValidHexAddress ¶
func (TypesApi) IsValidHexTokenTypeId ¶
type WalletApi ¶
type WalletApi struct {
// contains filtered or unexported fields
}
func NewWalletApi ¶
func (*WalletApi) CreateTxWithPassphrase ¶
func (m *WalletApi) CreateTxWithPassphrase(params CreateTransferTxParms) error
func (*WalletApi) ExportPriv ¶
func (WalletApi) GetDataDir ¶
func (*WalletApi) ImportPriv ¶
func (*WalletApi) IsMayValidKeystoreFile ¶
func (m *WalletApi) IsMayValidKeystoreFile(path string) IsMayValidKeystoreFileResponse
func (WalletApi) ListAddress ¶
func (*WalletApi) NewAddress ¶
func (*WalletApi) ReloadAndFixAddressFile ¶
func (*WalletApi) SignDataWithPassphrase ¶
Click to show internal directories.
Click to hide internal directories.