model

package
v0.0.1-alpha-16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

func (r Response) GetLatestTxnConsensusTime() (int64, error)

GetLatestTxnConsensusTime iterates all transactions and returns the consensus timestamp of the latest one

func (Response) IsNotFound

func (r Response) IsNotFound() bool

IsNotFound traverses all Error messages and searches for Not Found message

type Schedule

type Schedule struct {
	ConsensusTimestamp string `json:"consensus_timestamp"`
	CreatorAccountId   string `json:"creator_account_id"`
	ExecutedTimestamp  string `json:"executed_timestamp"`
	Memo               string `json:"memo"`
	PayerAccountId     string `json:"payer_account_id"`
	ScheduleId         string `json:"schedule_id"`
}

Schedule struct used by the Hedera Mirror node REST API to return information regarding a given Schedule entity

type Status

type Status struct {
	Messages []ErrorMessage
}

func (*Status) String

func (s *Status) String() string

String converts the Status struct to human readable string

type Transaction

type Transaction struct {
	ConsensusTimestamp   string     `json:"consensus_timestamp"`
	EntityId             string     `json:"entity_id"`
	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"`
	Scheduled            bool       `json:"scheduled"`
	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()

type Transfer

type Transfer struct {
	Account string `json:"account"`
	Amount  int64  `json:"amount"`
	// When retrieving ordinary hbar transfers, this field does not get populated
	Token string `json:"token_id"`
}

Transfer struct used by the Hedera Mirror node REST API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL