Documentation ¶
Index ¶
- Variables
- func TryMakeConcernedError(err error) (newerr error, concerned bool)
- type AccountBlock
- type CommonApi
- 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 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 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 Height string Quota string Amount string Fee string ConfirmedTimes string TokenInfo *RpcTokenInfo }
func (*AccountBlock) LedgerAccountBlock ¶
func (ab *AccountBlock) LedgerAccountBlock() (*ledger.AccountBlock, error)
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 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 TotalNumber string // uint64 TokenBalanceInfoMap map[types.TokenTypeId]*RpcTokenBalanceInfo `json:",omitempty"` }
type RpcTokenBalanceInfo ¶
type RpcTokenBalanceInfo struct { TokenInfo *RpcTokenInfo `json:",omitempty"` TotalAmount string // big int Number *string // uint64 }
type RpcTokenInfo ¶
type RpcTokenInfo struct { TokenName string TokenSymbol string TotalSupply *string `json:",omitempty"` // *big.Int Decimals uint8 Owner types.Address PledgeAmount *string `json:",omitempty"` // *big.Int WithdrawHeight string // 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.