client

package
v0.0.1-alpha-11 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ethereum

type Ethereum interface {
	ChainID() *big.Int
	GetClient() *ethclient.Client
	ValidateContractDeployedAt(contractAddress string) (*common.Address, error)
	// WaitForTransaction waits for transaction receipt and depending on receipt status calls one of the provided functions
	// onSuccess is called once the TX is successfully mined
	// onRevert is called once the TX is mined but it reverted
	// onError is called if an error occurs while waiting for TX to go into one of the other 2 states
	WaitForTransaction(hex string, onSuccess, onRevert func(), onError func(err error))
	// WaitForConfirmations starts a loop which ends either when we reach the target block number or an error occurs with block number retrieval
	WaitForConfirmations(raw types.Log) error
}

type HederaNode

type HederaNode interface {
	// GetClient returns the underlying Hedera SDK client
	GetClient() *hedera.Client
	// SubmitTopicConsensusMessage submits the provided message bytes to the
	// specified HCS `topicId`
	SubmitTopicConsensusMessage(topicId hedera.TopicID, message []byte) (*hedera.TransactionID, error)
	// SubmitScheduledTokenTransferTransaction creates a token transfer transaction and submits it as a scheduled transaction
	SubmitScheduledTokenTransferTransaction(tokenID hedera.TokenID, transfers []transfer.Hedera, payerAccountID hedera.AccountID, memo string) (*hedera.TransactionResponse, error)
	// SubmitScheduledHbarTransferTransaction creates an hbar transfer transaction and submits it as a scheduled transfer transaction
	SubmitScheduledHbarTransferTransaction(transfers []transfer.Hedera, payerAccountID hedera.AccountID, memo string) (*hedera.TransactionResponse, error)
	// SubmitScheduleSign submits a ScheduleSign transaction for a given ScheduleID
	SubmitScheduleSign(scheduleID hedera.ScheduleID) (*hedera.TransactionResponse, error)
}

type MirrorNode

type MirrorNode interface {
	GetAccountCreditTransactionsAfterTimestamp(accountId hedera.AccountID, from int64) (*mirror_node.Response, error)
	// GetAccountCreditTransactionsBetween returns all incoming Transfers for the specified account between timestamp `from` and `to` excluded
	GetAccountCreditTransactionsBetween(accountId hedera.AccountID, from, to int64) ([]mirror_node.Transaction, error)
	// GetMessagesAfterTimestamp returns all topic messages after the given timestamp
	GetMessagesAfterTimestamp(topicId hedera.TopicID, from int64) ([]mirror_node.Message, error)
	// GetMessagesForTopicBetween returns all topic messages for a given topic between timestamp `from` included and `to` excluded
	GetMessagesForTopicBetween(topicId hedera.TopicID, from, to int64) ([]mirror_node.Message, error)
	// GetTransaction gets all data related to a specific transaction id or returns an error
	GetTransaction(transactionID string) (*mirror_node.Response, error)
	// GetStateProof sends a query to get the state proof. If the query is successful, the function returns the state.
	// If the query returns a status != 200, the function returns an error.
	GetStateProof(transactionID string) ([]byte, error)
	// AccountExists sends a query to check whether a specific account exists. If the query returns a status != 200, the function returns a false value
	AccountExists(accountID hedera.AccountID) bool
	// TopicExists sends a query to check whether a specific topic exists. If the query returns a status != 200, the function returns a false value
	TopicExists(topicID hedera.TopicID) bool
	// WaitForTransaction Polls the transaction at intervals. Depending on the
	// result, the corresponding `onSuccess` and `onFailure` functions are called
	WaitForTransaction(txId string, onSuccess, onFailure func())
	// WaitForScheduledTransferTransaction Polls the transaction at intervals. Depending on the
	// result, the corresponding `onSuccess` and `onFailure` functions are called
	WaitForScheduledTransferTransaction(txId string, onSuccess, onFailure func())
}

Jump to

Keyboard shortcuts

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