utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package utils contains utility functions for the relayer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(request []byte) (bridgeTransaction *bindings.IFastBridgeBridgeTransaction, err error)

Decode decodes a request into a bridge transaction.

func Encode

func Encode(bridgeTransaction *bindings.IFastBridgeBridgeTransaction) (request []byte, err error)

Encode encodes a bridge transaction into a request.

func GenerateQuoteID

func GenerateQuoteID(originChainID uint32, originToken common.Address, destChainID uint32, destToken common.Address) string

GenerateQuoteID generates a quote ID from the origin chain ID, origin token address, destination chain ID, and destination token address.

func GenerateTokenID

func GenerateTokenID(chainID uint32, tokenAddress common.Address) string

GenerateTokenID generates a token ID from the token address and chain ID.

func IsBridgeRelayed

func IsBridgeRelayed(topic common.Hash, abi abi.ABI) bool

IsBridgeRelayed checks if the topic is the BridgeRelayed event.

func IsBridgeRequested

func IsBridgeRequested(topic common.Hash, abi abi.ABI) bool

IsBridgeRequested checks if the topic is the BridgeRequested event.

func ParseBridgeRelayed

func ParseBridgeRelayed(log types.Log, abi abi.ABI) (*bindings.FastBridgeBridgeRelayed, error)

ParseBridgeRelayed parses the BridgeRelayed event.

func ParseBridgeRequested

func ParseBridgeRequested(log types.Log, abi abi.ABI) (*bindings.FastBridgeBridgeRequested, error)

ParseBridgeRequested parses the BridgeRequested event.

func TransactionID

func TransactionID(request []byte) common.Hash

TransactionID returns the transaction id for a given request.

Types

type WrappedLog

type WrappedLog struct {
	OriginChainID uint32
	Log           types.Log
}

WrappedLog is a struct containing the origin chain ID and a log.

Jump to

Keyboard shortcuts

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