Documentation ¶
Index ¶
- Constants
- func NormalizeDelegation(account Account, validators blockatlas.ValidatorMap) (blockatlas.DelegationsPage, error)
- func NormalizeRpcTransaction(tx RpcTransaction, header RpcBlockHeader, balance string) (types.Tx, error)
- func NormalizeStakeValidator(baker Baker, assetValidator assets.AssetValidator) blockatlas.StakeValidator
- func NormalizeTx(srcTx Transaction, address string) (types.Tx, bool)
- func NormalizeTxs(srcTxs []Transaction, address string) (txs types.Txs)
- func ProcessRpcBlock(block RpcBlock, rpcClient IRpcClient) (*types.Block, error)
- type Account
- type AccountBalance
- type ActivityValidatorInfo
- type Baker
- type BakerClient
- type Client
- type Error
- type ExplorerAccount
- type IRpcClient
- type OperationResult
- type PeriodType
- type Platform
- func (p *Platform) Coin() coin.Coin
- func (p *Platform) CurrentBlockNumber() (int64, error)
- func (p *Platform) GetActiveValidators() (blockatlas.StakeValidators, error)
- func (p *Platform) GetBlockByNumber(num int64) (*types.Block, error)
- func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, error)
- func (p *Platform) GetDetails() blockatlas.StakingDetails
- func (p *Platform) GetTxsByAddress(address string) (types.Txs, error)
- func (p *Platform) GetValidators() (blockatlas.ValidatorPage, error)
- func (p *Platform) UndelegatedBalance(address string) (string, error)
- type RpcBlock
- type RpcBlockHeader
- type RpcClient
- func (c *RpcClient) GetAccount(address string) (account Account, err error)
- func (c *RpcClient) GetAccountBalanceAtBlock(address string, block int64) (account AccountBalance, err error)
- func (c *RpcClient) GetBlockByNumber(num int64) (block RpcBlock, err error)
- func (c *RpcClient) GetBlockHead() (int64, error)
- func (c *RpcClient) GetPeriodType() (periodType PeriodType, err error)
- func (c *RpcClient) GetValidators(blockID string) (validators []Validator, err error)
- type RpcClientMock
- type RpcMetadata
- type RpcOperationContent
- type RpcOperationContents
- type RpcTransaction
- type Transaction
- func (t *Transaction) BlockTimestamp() int64
- func (t *Transaction) Direction(address string) types.Direction
- func (t *Transaction) ErrorMsg() string
- func (t *Transaction) GetReceiver() string
- func (t *Transaction) Status() types.Status
- func (t *Transaction) Title(address string) (types.KeyTitle, bool)
- func (t *Transaction) TransferType() (types.TransactionType, bool)
- type Validator
Constants ¶
View Source
const ( TxTypeTransaction string = "transaction" TxTypeDelegation string = "delegation" TxStatusApplied string = "applied" )
View Source
const ( Annual = 6.09 LockTime = 0 MinimumStakeAmount = "0" )
Variables ¶
This section is empty.
Functions ¶
func NormalizeDelegation ¶
func NormalizeDelegation(account Account, validators blockatlas.ValidatorMap) (blockatlas.DelegationsPage, error)
func NormalizeRpcTransaction ¶
func NormalizeRpcTransaction(tx RpcTransaction, header RpcBlockHeader, balance string) (types.Tx, error)
func NormalizeStakeValidator ¶
func NormalizeStakeValidator(baker Baker, assetValidator assets.AssetValidator) blockatlas.StakeValidator
func NormalizeTx ¶
func NormalizeTx(srcTx Transaction, address string) (types.Tx, bool)
NormalizeTx converts a Tezos transaction into the generic model
func NormalizeTxs ¶
func NormalizeTxs(srcTxs []Transaction, address string) (txs types.Txs)
func ProcessRpcBlock ¶
func ProcessRpcBlock(block RpcBlock, rpcClient IRpcClient) (*types.Block, error)
Types ¶
type AccountBalance ¶
type AccountBalance struct {
Balance string `json:"balance"`
}
type ActivityValidatorInfo ¶
type ActivityValidatorInfo struct {
Deactivated bool `json:"deactivated"`
}
type Baker ¶
type Baker struct { Address string `json:"address"` Name string `json:"name"` Logo string `json:"logo"` FreeSpace float64 `json:"freeSpace"` Fee float64 `json:"fee"` MinDelegation float64 `json:"minDelegation"` OpenForDelegation bool `json:"openForDelegation"` EstimatedRoi float64 `json:"estimatedRoi"` ServiceHealth string `json:"serviceHealth"` }
type BakerClient ¶
func (*BakerClient) GetBakers ¶
func (c *BakerClient) GetBakers() (validators blockatlas.StakeValidators, err error)
type Client ¶
func (*Client) GetTxsOfAddress ¶
func (c *Client) GetTxsOfAddress(address string, txType []string) (txs ExplorerAccount, err error)
type ExplorerAccount ¶
type ExplorerAccount struct {
Transactions []Transaction `json:"ops"`
}
type IRpcClient ¶
type IRpcClient interface {
GetAccountBalanceAtBlock(address string, block int64) (account AccountBalance, err error)
}
type OperationResult ¶
type OperationResult struct {
Status string `json:"status"`
}
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
func (*Platform) CurrentBlockNumber ¶
func (*Platform) GetActiveValidators ¶
func (p *Platform) GetActiveValidators() (blockatlas.StakeValidators, error)
func (*Platform) GetBlockByNumber ¶
func (*Platform) GetDelegations ¶
func (p *Platform) GetDelegations(address string) (blockatlas.DelegationsPage, error)
func (*Platform) GetDetails ¶
func (p *Platform) GetDetails() blockatlas.StakingDetails
func (*Platform) GetTxsByAddress ¶
func (*Platform) GetValidators ¶
func (p *Platform) GetValidators() (blockatlas.ValidatorPage, error)
type RpcBlock ¶
type RpcBlock struct { Header RpcBlockHeader `json:"header"` Operations []RpcOperationContents `json:"operations"` }
type RpcBlockHeader ¶
type RpcClient ¶
func (*RpcClient) GetAccount ¶
func (*RpcClient) GetAccountBalanceAtBlock ¶
func (c *RpcClient) GetAccountBalanceAtBlock(address string, block int64) (account AccountBalance, err error)
func (*RpcClient) GetBlockByNumber ¶
func (*RpcClient) GetBlockHead ¶
func (*RpcClient) GetPeriodType ¶
func (c *RpcClient) GetPeriodType() (periodType PeriodType, err error)
type RpcClientMock ¶
type RpcClientMock struct {
Balance string
}
func (*RpcClientMock) GetAccountBalanceAtBlock ¶
func (r *RpcClientMock) GetAccountBalanceAtBlock(address string, block int64) (account AccountBalance, err error)
type RpcMetadata ¶
type RpcMetadata struct {
OperationResult OperationResult `json:"operation_result"`
}
type RpcOperationContent ¶
type RpcOperationContent struct { Hash string `json:"hash"` Contents []interface{} `json:"contents"` }
type RpcOperationContents ¶
type RpcOperationContents []RpcOperationContent
type RpcTransaction ¶
type RpcTransaction struct { Kind string `json:"kind"` Source string `json:"source"` Fee string `json:"fee"` Counter string `json:"counter"` GasLimit string `json:"gas_limit"` StorageLimit string `json:"storage_limit"` Amount string `json:"amount,omitempty"` Destination string `json:"destination,omitempty"` Delegate string `json:"delegate,omitempty"` Metadata RpcMetadata `json:"metadata"` }
type Transaction ¶
type Transaction struct { Delegate string `json:"delegate"` // Current delegate (may be self when registered as delegate). Errors []Error `json:"errors"` // Operation status applied, failed, backtracked, skipped. Fee float64 `json:"fee"` // Total fee paid (and frozen) by all operations. Hash string `json:"hash"` // Operation hash. Height uint64 `json:"height"` IsSuccess bool `json:"is_success"` // Flag indicating operation was successfully applied. Receiver string `json:"receiver"` Sender string `json:"sender"` Stat string `json:"status"` // Operation status applied, failed, backtracked, skipped. Time string `json:"time"` // Block time at which the operation was included on-chain e.g: 2019-09-28T13:10:51Z Type string `json:"type"` // Operation type, one of activate_account, double_baking_evidence, double_endorsement_evidence, seed_nonce_revelation, transaction, origination, delegation, reveal, endorsement, proposals, ballot. Volume float64 `json:"volume"` }
func (*Transaction) BlockTimestamp ¶
func (t *Transaction) BlockTimestamp() int64
func (*Transaction) ErrorMsg ¶
func (t *Transaction) ErrorMsg() string
func (*Transaction) GetReceiver ¶
func (t *Transaction) GetReceiver() string
func (*Transaction) Status ¶
func (t *Transaction) Status() types.Status
func (*Transaction) TransferType ¶
func (t *Transaction) TransferType() (types.TransactionType, bool)
Click to show internal directories.
Click to hide internal directories.