Documentation ¶
Index ¶
- type Client
- func (c Client) AccountExists(accountID hedera.AccountID) bool
- func (c Client) GetAccountCreditTransactionsAfterTimestamp(accountId hedera.AccountID, from int64) (*Response, error)
- func (c Client) GetAccountCreditTransactionsBetween(accountId hedera.AccountID, from, to int64) ([]Transaction, error)
- func (c Client) GetMessagesAfterTimestamp(topicId hedera.TopicID, from int64) ([]Message, error)
- func (c Client) GetMessagesForTopicBetween(topicId hedera.TopicID, from, to int64) ([]Message, error)
- func (c Client) GetStateProof(transactionID string) ([]byte, error)
- func (c Client) GetTransaction(transactionID string) (*Response, error)
- func (c Client) TopicExists(topicID hedera.TopicID) bool
- func (c Client) WaitForTransaction(txId string, onSuccess, onFailure func())
- type ErrorMessage
- type Message
- type Messages
- type Response
- type Status
- type Transaction
- type Transfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) AccountExists ¶
func (Client) GetAccountCreditTransactionsAfterTimestamp ¶
func (Client) GetAccountCreditTransactionsBetween ¶
func (c Client) GetAccountCreditTransactionsBetween(accountId hedera.AccountID, from, to int64) ([]Transaction, error)
GetAccountCreditTransactionsBetween returns all incoming Transfers for the specified account between timestamp `from` and `to` excluded
func (Client) GetMessagesAfterTimestamp ¶
GetMessagesAfterTimestamp returns all Topic messages after the given timestamp
func (Client) GetMessagesForTopicBetween ¶
func (c Client) GetMessagesForTopicBetween(topicId hedera.TopicID, from, to int64) ([]Message, error)
GetMessagesForTopicBetween returns all Topic messages for the specified topic between timestamp `from` and `to` excluded
func (Client) GetTransaction ¶
func (Client) TopicExists ¶
func (Client) WaitForTransaction ¶
WaitForTransaction Polls the transaction at intervals. Depending on the result, the corresponding `onSuccess` and `onFailure` functions are called
type ErrorMessage ¶
type ErrorMessage struct {
Message string `json:"message"`
}
func (*ErrorMessage) IsNotFound ¶
func (m *ErrorMessage) IsNotFound() bool
IsNotFound returns true/false whether the message is equal to "not found" or not
func (*ErrorMessage) String ¶
func (m *ErrorMessage) String() string
String converts ErrorMessage struct to human readable string
type Message ¶
type Message struct { ConsensusTimestamp string `json:"consensus_timestamp"` TopicId string `json:"topic_id"` Contents string `json:"message"` RunningHash string `json:"running_hash"` SequenceNumber int `json:"sequence_number"` }
Message struct used by the Hedera Mirror node REST API to represent Topic Message
type Messages ¶
type Messages struct {
Messages []Message
}
Messages struct used by the Hedera Mirror node REST API and returned once Topic Messages are queried
type Response ¶
type Response struct { Transactions []Transaction Status `json:"_status"` }
Response struct used by the Hedera Mirror node REST API and returned once account transactions are queried
func (Response) GetLatestTxnConsensusTime ¶
GetLatestTxnConsensusTime iterates all transactions and returns the consensus timestamp of the latest one
type Status ¶
type Status struct {
Messages []ErrorMessage
}
type Transaction ¶
type Transaction struct { ConsensusTimestamp string `json:"consensus_timestamp"` TransactionHash string `json:"transaction_hash"` ValidStartTimestamp string `json:"valid_start_timestamp"` ChargedTxFee int `json:"charged_tx_fee"` MemoBase64 string `json:"memo_base64"` Result string `json:"result"` Name string `json:"name"` MaxFee string `json:"max_fee"` ValidDurationSeconds string `json:"valid_duration_seconds"` Node string `json:"node"` TransactionID string `json:"transaction_id"` Transfers []Transfer `json:"transfers"` TokenTransfers []Transfer `json:"token_transfers"` }
Transaction struct used by the Hedera Mirror node REST API
func (Transaction) GetIncomingTransfer ¶
func (t Transaction) GetIncomingTransfer(account string) (string, string, error)
GetIncomingTransfer returns the token amount OR the hbar amount that is credited to the specified account for the given transaction. It depends on getIncomingAmountFor() and getIncomingTokenAmountFor()