Documentation
¶
Overview ¶
Package flow_helpers provides convience functions for Flow blockchain interaction.
Index ¶
- func FormatAddress(address flow.Address) string
- func HexString(str string) string
- func LatestBlockId(ctx context.Context, flowClient FlowClient) (*flow.Identifier, error)
- func SendAndWait(ctx context.Context, flowClient FlowClient, tx flow.Transaction, ...) (*flow.TransactionResult, error)
- func ValidateAddress(address string, chainId flow.ChainID) (string, error)
- func ValidateTransactionId(id string) error
- func WaitForSeal(ctx context.Context, flowClient FlowClient, id flow.Identifier, ...) (*flow.TransactionResult, error)
- type FlowClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAddress ¶
func FormatAddress(address flow.Address) string
func LatestBlockId ¶
func LatestBlockId(ctx context.Context, flowClient FlowClient) (*flow.Identifier, error)
LatestBlockId retuns the flow.Identifier for the latest block in the chain.
func SendAndWait ¶ added in v0.6.0
func SendAndWait(ctx context.Context, flowClient FlowClient, tx flow.Transaction, timeout time.Duration) (*flow.TransactionResult, error)
SendAndWait sends the transaction and waits for the transaction to be sealed
func ValidateAddress ¶
func ValidateTransactionId ¶
func WaitForSeal ¶
func WaitForSeal(ctx context.Context, flowClient FlowClient, id flow.Identifier, timeout time.Duration) (*flow.TransactionResult, error)
WaitForSeal blocks until - an error occurs while fetching the transaction result - the transaction gets an error status - the transaction gets a "TransactionStatusSealed" or "TransactionStatusExpired" status - timeout is reached
Types ¶
type FlowClient ¶ added in v0.10.0
type FlowClient interface { ExecuteScriptAtLatestBlock(ctx context.Context, script []byte, arguments []cadence.Value) (cadence.Value, error) GetAccount(ctx context.Context, address flow.Address) (*flow.Account, error) GetAccountAtLatestBlock(ctx context.Context, address flow.Address) (*flow.Account, error) GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.Transaction, error) GetTransactionResult(ctx context.Context, txID flow.Identifier) (*flow.TransactionResult, error) GetLatestBlockHeader(ctx context.Context, isSealed bool) (*flow.BlockHeader, error) GetEventsForHeightRange(ctx context.Context, eventType string, startHeight uint64, endHeight uint64) ([]flow.BlockEvents, error) SendTransaction(ctx context.Context, tx flow.Transaction) error }
Click to show internal directories.
Click to hide internal directories.