hedera_helper

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuyerCounterSignSchedule

func BuyerCounterSignSchedule(scheduleID hedera.ScheduleID) error

func BuyerPrepareServiceRequest

func BuyerPrepareServiceRequest(
	fromP2pPublicAddresses []multiaddr.Multiaddr,
	fromEthAddress string,
	toEthAddress string,
	arbiterEthAddress string,
	amount int64,
) (*types.TopicPostalEnvelope, error)

func CreateAccountFromParent

func CreateAccountFromParent()

dead function, not used.

func CreateTopic

func CreateTopic() (string, error)

func DepositToSharedAccount

func DepositToSharedAccount(sharedAccountID hedera.AccountID, amount float64) error

func EnsureTopicsAndNotifyContract

func EnsureTopicsAndNotifyContract(p2pHost host.Host) (hedera.TopicID, hedera.TopicID, hedera.TopicID, error)

func GetAccountInfoFromMirror

func GetAccountInfoFromMirror(accountID hedera.AccountID) (struct {
	Balance    float64 `json:"balance"`
	EvmAddress string  `json:"evm_address"`
	PublicKey  string  `json:"public_key"`
}, error)

func GetAccountInfoFromNetwork

func GetAccountInfoFromNetwork(accountID hedera.AccountID) (hedera.AccountInfo, error)

func GetAllDevicesFromExplorer

func GetAllDevicesFromExplorer() ([]map[string]interface{}, error)

func GetAllPeers

func GetAllPeers() ([]string, error)

func GetDeviceParent

func GetDeviceParent(accountEvnID string) (hedera.AccountID, error)

func GetHederaClientUsingEnv

func GetHederaClientUsingEnv() *hedera.Client

func GetPeerArraySize

func GetPeerArraySize() (*big.Int, error)

func ListenToTopicAndCallBack

func ListenToTopicAndCallBack(stdInTopic hedera.TopicID, callback func(message hedera.TopicMessage)) error

is used as a subroutine

func PeerSendErrorMessage

func PeerSendErrorMessage(otherSideStdIn hedera.TopicID, errorType types.ErrorType, errorMessage string, recoverAction types.RecoverAction)

func SellerSendScheduledTransferRequest

func SellerSendScheduledTransferRequest(
	sharedAccID hedera.AccountID,
	toHederaParentID hedera.AccountID,
	toHederaDeviceID hedera.AccountID,
	buyerStdIn hedera.TopicID,
) error

func SendSelfErrorMessage

func SendSelfErrorMessage(errorType types.ErrorType, errorMessage string, recoverAction types.RecoverAction) error

func SendToTopic

func SendToTopic(topicID hedera.TopicID, content string) error

func SendTransactionEnvelope

func SendTransactionEnvelope(tx types.TopicPostalEnvelope) error

func SignSchedule

func SignSchedule(scheduleId hedera.ScheduleID, privateKey string) error

Types

type AccountResponse

type AccountResponse struct {
	CreatedTimestamp string `json:"created_timestamp"`
}

type HCSMessage

type HCSMessage struct {
	Message   string    `json:"message"`
	Timestamp time.Time `json:"time"`
}

func GetLastMessageFromTopic

func GetLastMessageFromTopic(topicID hedera.TopicID) (HCSMessage, error)

type PeerInfo

type PeerInfo struct {
	Available   bool
	PeerID      string
	StdOutTopic uint64
	StdInTopic  uint64
	StdErrTopic uint64
}

func GetPeerInfo

func GetPeerInfo(hederaAccEvmAddress string) (PeerInfo, error)

TODO: retry on failure. This one likes to return 502 bad gateway and eth rate limit exceeded. however, currently we stop the world on failure but should keep retrying.

type Transaction

type Transaction struct {
	TransactionID string `json:"transaction_id"`
}

type TransactionsResponse

type TransactionsResponse struct {
	Transactions []Transaction `json:"transactions"`
}

Jump to

Keyboard shortcuts

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