Documentation ¶
Overview ¶
Package relayer is the CCTPRelayer responsible for relaying messages related cross-chain USDC transfers.
Index ¶
- Constants
- func AddressToBytes32(addr common.Address) [32]byte
- func Bytes32ToAddress(bytes32 [32]byte) common.Address
- func ChainIDToCircleDomain(chainID uint32, isTestnet bool) (domain uint32, err error)
- func CircleDomainToChainID(domain uint32, isTestnet bool) (chainID uint32, err error)
- func GetCircleRequestID(sourceDomain uint32, nonce uint64) string
- func GetMessageTransmitterAddress(ctx context.Context, tokenMessengerAddr common.Address, ethClient client.EVM) (transmitterAddr common.Address, err error)
- func IsTestnetChainID(chainID uint32) bool
- func ParseDestDomain(message []byte) (uint32, error)
- type CCTPHandler
- type CCTPRelayer
Constants ¶
const MessageHash = "message_hash"
MessageHash is the hash of the message used for metrics tracking.
Variables ¶
This section is empty.
Functions ¶
func AddressToBytes32 ¶ added in v0.2.0
AddressToBytes32 converts an Ethereum address to a bytes32 value.
func Bytes32ToAddress ¶ added in v0.2.0
Bytes32ToAddress converts a bytes32 value to an Ethereum address.
func ChainIDToCircleDomain ¶ added in v0.2.0
ChainIDToCircleDomain converts a chain ID to a Circle domain.
func CircleDomainToChainID ¶ added in v0.2.0
CircleDomainToChainID converts a Circle domain to a chain ID.
func GetCircleRequestID ¶ added in v0.2.0
GetCircleRequestID returns a request ID from a source domain and nonce.
func GetMessageTransmitterAddress ¶ added in v0.2.0
func GetMessageTransmitterAddress(ctx context.Context, tokenMessengerAddr common.Address, ethClient client.EVM) (transmitterAddr common.Address, err error)
GetMessageTransmitterAddress gets the message transmitter address from a token messenger contract.
func IsTestnetChainID ¶ added in v0.2.0
IsTestnetChainID returns true if the chain ID is a testnet chain ID.
func ParseDestDomain ¶ added in v0.2.0
ParseDestDomain parses the destination domain from a CCTP message.
Types ¶
type CCTPHandler ¶ added in v0.2.0
type CCTPHandler interface { HandleLog(ctx context.Context, log *types.Log, chainID uint32) (processQueue bool, err error) FetchAndProcessSentEvent(ctx context.Context, txHash common.Hash, chainID uint32) (*relayTypes.Message, error) SubmitReceiveMessage(ctx context.Context, msg *relayTypes.Message) error }
CCTPHandler is an interface for interacting with CCTP contracts.
func NewCircleCCTPHandler ¶ added in v0.2.0
func NewCircleCCTPHandler(ctx context.Context, cfg config.Config, db db2.CCTPRelayerDB, omniRPCClient omniClient.RPCClient, txSubmitter submitter.TransactionSubmitter, handler metrics.Handler) (CCTPHandler, error)
NewCircleCCTPHandler creates a new CircleCCTPHandler.
func NewSynapseCCTPHandler ¶ added in v0.2.0
func NewSynapseCCTPHandler(ctx context.Context, cfg config.Config, db db2.CCTPRelayerDB, omniRPCClient omniClient.RPCClient, txSubmitter submitter.TransactionSubmitter, handler metrics.Handler) (CCTPHandler, error)
NewSynapseCCTPHandler creates a new SynapseCCTPHandler.
type CCTPRelayer ¶
type CCTPRelayer struct {
// contains filtered or unexported fields
}
CCTPRelayer listens for USDC burn events on origin chains, fetches attestations from Circle's API, and posts the necessary data on the destination chain to complete the USDC bridging process.
func NewCCTPRelayer ¶
func NewCCTPRelayer(ctx context.Context, cfg config.Config, store db2.CCTPRelayerDB, scribeClient client.ScribeClient, omniRPCClient omniClient.RPCClient, handler metrics.Handler, attestationAPI attestation.CCTPAPI) (*CCTPRelayer, error)
NewCCTPRelayer creates a new CCTPRelayer.