Documentation ¶
Index ¶
- Constants
- Variables
- func GetFrontierContext(c chain.Chain, addr types.Address) (*nom.Momentum, vm_context.AccountVmContext, error)
- func GetRange(index, count, listLen uint32) (uint32, uint32)
- type AccountBlock
- func (block *AccountBlock) ComputeHash() (*types.Hash, error)
- func (block *AccountBlock) MarshalJSON() ([]byte, error)
- func (block *AccountBlock) ToAccountBlockMarshal() *AccountBlockMarshal
- func (block *AccountBlock) ToLedgerBlock() (*nom.AccountBlock, error)
- func (block *AccountBlock) UnmarshalJSON(data []byte) error
- type AccountBlockConfirmationDetail
- type AccountBlockList
- type AccountBlockListMarshal
- type AccountBlockMarshal
- type AccountInfo
- type BalanceInfo
- type BalanceInfoMarshal
- type DetailedMomentum
- type DetailedMomentumList
- type LedgerApi
- func (l *LedgerApi) GetAccountBlockByHash(blockHash types.Hash) (*AccountBlock, error)
- func (l *LedgerApi) GetAccountBlocksByHeight(address types.Address, height, count uint64) (*AccountBlockList, error)
- func (l *LedgerApi) GetAccountBlocksByPage(address types.Address, pageIndex, pageSize uint32) (*AccountBlockList, error)
- func (l *LedgerApi) GetAccountInfoByAddress(address types.Address) (*AccountInfo, error)
- func (l *LedgerApi) GetDetailedMomentumsByHeight(height, count uint64) (*DetailedMomentumList, error)
- func (l *LedgerApi) GetFrontierAccountBlock(address types.Address) (*AccountBlock, error)
- func (l *LedgerApi) GetFrontierMomentum() (*Momentum, error)
- func (l *LedgerApi) GetMomentumBeforeTime(timestamp int64) (*Momentum, error)
- func (l *LedgerApi) GetMomentumByHash(hash types.Hash) (*Momentum, error)
- func (l *LedgerApi) GetMomentumsByHeight(height, count uint64) (*MomentumList, error)
- func (l *LedgerApi) GetMomentumsByPage(pageIndex, pageSize uint32) (*MomentumList, error)
- func (l *LedgerApi) GetUnconfirmedBlocksByAddress(address types.Address, pageIndex, pageSize uint32) (*AccountBlockList, error)
- func (l *LedgerApi) GetUnreceivedBlocksByAddress(address types.Address, pageIndex, pageSize uint32) (*AccountBlockList, error)
- func (l *LedgerApi) PublishRawTransaction(block *AccountBlock) error
- func (l LedgerApi) String() string
- type Momentum
- type MomentumHeader
- type MomentumList
- type NetworkInfoResponse
- type OsInfoResponse
- type Peer
- type ProcessInfoResponse
- type StatsApi
- type Token
- type TokenMarshal
Constants ¶
View Source
const ( RpcMaxPageSize = 1024 RpcMaxCountSize = 1024 )
Variables ¶
View Source
var ( ErrPageSizeParamTooBig = common.NewErrorWCode(-32000, "page-size parameter is too big") ErrPageIndexParamTooBig = common.NewErrorWCode(-32000, "page-index parameter is too big") ErrCountParamTooBig = common.NewErrorWCode(-32000, "count parameter is too big") ErrHeightParamIsZero = common.NewErrorWCode(-32000, "height parameter must be strictly greater than zero") ErrParamIsNull = common.NewErrorWCode(-32000, "parameter must not be null") )
Functions ¶
func GetFrontierContext ¶
func GetFrontierContext(c chain.Chain, addr types.Address) (*nom.Momentum, vm_context.AccountVmContext, error)
Types ¶
type AccountBlock ¶
type AccountBlock struct { nom.AccountBlock TokenInfo *Token `json:"token"` ConfirmationDetail *AccountBlockConfirmationDetail `json:"confirmationDetail"` PairedAccountBlock *AccountBlock `json:"pairedAccountBlock"` }
func (*AccountBlock) ComputeHash ¶
func (block *AccountBlock) ComputeHash() (*types.Hash, error)
func (*AccountBlock) MarshalJSON ¶
func (block *AccountBlock) MarshalJSON() ([]byte, error)
func (*AccountBlock) ToAccountBlockMarshal ¶
func (block *AccountBlock) ToAccountBlockMarshal() *AccountBlockMarshal
func (*AccountBlock) ToLedgerBlock ¶
func (block *AccountBlock) ToLedgerBlock() (*nom.AccountBlock, error)
func (*AccountBlock) UnmarshalJSON ¶
func (block *AccountBlock) UnmarshalJSON(data []byte) error
type AccountBlockList ¶
type AccountBlockList struct { List []*AccountBlock `json:"list"` Count int `json:"count"` More bool `json:"more"` }
func (*AccountBlockList) MarshalJSON ¶
func (abl *AccountBlockList) MarshalJSON() ([]byte, error)
func (*AccountBlockList) ToAccountBlockListMarshal ¶
func (abl *AccountBlockList) ToAccountBlockListMarshal() *AccountBlockListMarshal
func (*AccountBlockList) UnmarshalJSON ¶
func (abl *AccountBlockList) UnmarshalJSON(data []byte) error
type AccountBlockListMarshal ¶
type AccountBlockListMarshal struct { List []*AccountBlockMarshal `json:"list"` Count int `json:"count"` More bool `json:"more"` }
type AccountBlockMarshal ¶
type AccountBlockMarshal struct { nom.AccountBlockMarshal TokenInfo *TokenMarshal `json:"token"` ConfirmationDetail *AccountBlockConfirmationDetail `json:"confirmationDetail"` PairedAccountBlock *AccountBlockMarshal `json:"pairedAccountBlock"` }
func (*AccountBlockMarshal) FromApiMarshalJson ¶
func (a *AccountBlockMarshal) FromApiMarshalJson() *AccountBlock
type AccountInfo ¶
type AccountInfo struct { Address types.Address `json:"address"` AccountHeight uint64 `json:"accountHeight"` BalanceInfoMap map[types.ZenonTokenStandard]*BalanceInfo `json:"balanceInfoMap"` }
type BalanceInfo ¶
func (*BalanceInfo) MarshalJSON ¶
func (b *BalanceInfo) MarshalJSON() ([]byte, error)
func (*BalanceInfo) ToBalanceInfoMarshal ¶
func (b *BalanceInfo) ToBalanceInfoMarshal() BalanceInfoMarshal
func (*BalanceInfo) UnmarshalJSON ¶
func (b *BalanceInfo) UnmarshalJSON(data []byte) error
type BalanceInfoMarshal ¶
type BalanceInfoMarshal struct { TokenMarshal `json:"token"` Balance string `json:"balance"` }
type DetailedMomentum ¶
type DetailedMomentum struct { AccountBlocks []*AccountBlock `json:"blocks"` Momentum *Momentum `json:"momentum"` }
type DetailedMomentumList ¶
type DetailedMomentumList struct { List []*DetailedMomentum `json:"list"` Count int `json:"count"` }
type LedgerApi ¶
type LedgerApi struct {
// contains filtered or unexported fields
}
func NewLedgerApi ¶
func (*LedgerApi) GetAccountBlockByHash ¶
func (l *LedgerApi) GetAccountBlockByHash(blockHash types.Hash) (*AccountBlock, error)
func (*LedgerApi) GetAccountBlocksByHeight ¶
func (*LedgerApi) GetAccountBlocksByPage ¶
func (*LedgerApi) GetAccountInfoByAddress ¶
func (l *LedgerApi) GetAccountInfoByAddress(address types.Address) (*AccountInfo, error)
func (*LedgerApi) GetDetailedMomentumsByHeight ¶
func (l *LedgerApi) GetDetailedMomentumsByHeight(height, count uint64) (*DetailedMomentumList, error)
func (*LedgerApi) GetFrontierAccountBlock ¶
func (l *LedgerApi) GetFrontierAccountBlock(address types.Address) (*AccountBlock, error)
AccountBlocks
func (*LedgerApi) GetFrontierMomentum ¶
Momentum
func (*LedgerApi) GetMomentumBeforeTime ¶
func (*LedgerApi) GetMomentumByHash ¶
func (*LedgerApi) GetMomentumsByHeight ¶
func (l *LedgerApi) GetMomentumsByHeight(height, count uint64) (*MomentumList, error)
func (*LedgerApi) GetMomentumsByPage ¶
func (l *LedgerApi) GetMomentumsByPage(pageIndex, pageSize uint32) (*MomentumList, error)
func (*LedgerApi) GetUnconfirmedBlocksByAddress ¶
func (l *LedgerApi) GetUnconfirmedBlocksByAddress(address types.Address, pageIndex, pageSize uint32) (*AccountBlockList, error)
Unconfirmed AccountBlocks
func (*LedgerApi) GetUnreceivedBlocksByAddress ¶
func (*LedgerApi) PublishRawTransaction ¶
func (l *LedgerApi) PublishRawTransaction(block *AccountBlock) error
type MomentumHeader ¶
type MomentumList ¶
type NetworkInfoResponse ¶
type OsInfoResponse ¶
type OsInfoResponse struct { Os string `json:"os"` Platform string `json:"platform"` PlatformFamily string `json:"platformFamily"` PlatformVersion string `json:"platformVersion"` KernelVersion string `json:"kernelVersion"` MemoryTotal uint64 `json:"memoryTotal"` MemoryFree uint64 `json:"memoryFree"` NumCPU int `json:"numCPU"` NumGoroutine int `json:"numGoroutine"` }
type ProcessInfoResponse ¶
type StatsApi ¶
type StatsApi struct {
// contains filtered or unexported fields
}
func (*StatsApi) NetworkInfo ¶
func (api *StatsApi) NetworkInfo() (*NetworkInfoResponse, error)
func (*StatsApi) OsInfo ¶
func (api *StatsApi) OsInfo() (*OsInfoResponse, error)
func (*StatsApi) ProcessInfo ¶
func (api *StatsApi) ProcessInfo() (*ProcessInfoResponse, error)
type Token ¶
type Token struct { TokenName string `json:"name"` TokenSymbol string `json:"symbol"` TokenDomain string `json:"domain"` TotalSupply *big.Int `json:"totalSupply"` Decimals uint8 `json:"decimals"` Owner types.Address `json:"owner"` ZenonTokenStandard types.ZenonTokenStandard `json:"tokenStandard"` MaxSupply *big.Int `json:"maxSupply"` IsBurnable bool `json:"isBurnable"` IsMintable bool `json:"isMintable"` IsUtility bool `json:"isUtility"` }
func LedgerTokenInfoToRpc ¶
func LedgerTokenInfoToRpc(tokenInfo *definition.TokenInfo) *Token
func LedgerTokenInfosToRpc ¶
func LedgerTokenInfosToRpc(list []*definition.TokenInfo) []*Token
func (*Token) MarshalJSON ¶
func (*Token) ToTokenMarshal ¶
func (t *Token) ToTokenMarshal() *TokenMarshal
func (*Token) UnmarshalJSON ¶
type TokenMarshal ¶
type TokenMarshal struct { TokenName string `json:"name"` TokenSymbol string `json:"symbol"` TokenDomain string `json:"domain"` TotalSupply string `json:"totalSupply"` Decimals uint8 `json:"decimals"` Owner types.Address `json:"owner"` ZenonTokenStandard types.ZenonTokenStandard `json:"tokenStandard"` MaxSupply string `json:"maxSupply"` IsBurnable bool `json:"isBurnable"` IsMintable bool `json:"isMintable"` IsUtility bool `json:"isUtility"` }
func (*TokenMarshal) FromTokenMarshal ¶
func (t *TokenMarshal) FromTokenMarshal() *Token
Click to show internal directories.
Click to hide internal directories.