Documentation
¶
Index ¶
- Constants
- type Account
- type AccountResp
- type AttestationResponse
- type Attribute
- type BlockResponse
- type BlockResultsResponse
- type BurnMessage
- type Chain
- type ChainConfig
- type CircleSettings
- type Config
- type ConfigWrapper
- type Domain
- type Event
- type Message
- type MessageState
- type MetadataMessage
- type SequenceMap
- type StateMap
- type Tx
- type TxState
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountResp ¶
type AccountResp struct {
Account `json:"account"`
}
type AttestationResponse ¶
type AttestationResponse struct { Attestation string `json:"attestation"` Status string `json:"status"` }
AttestationResponse is the response received from Circle's iris api Example: https://iris-api-sandbox.circle.com/attestations/0x85bbf7e65a5992e6317a61f005e06d9972a033d71b514be183b179e1b47723fe
type BlockResponse ¶
type BlockResponse struct { Result struct { Block struct { Header struct { Height string `json:"height"` } `json:"header"` } `json:"block"` } `json:"result"` }
type BlockResultsResponse ¶
type BlockResultsResponse struct { Result struct { Txs []Tx `json:"txs"` } `json:"result"` }
type BurnMessage ¶
type BurnMessage struct { Version uint32 BurnToken []byte MintRecipient []byte Amount *big.Int MessageSender []byte }
BurnMessage defines ... https://github.com/circlefin/evm-cctp-contracts/blob/d53f0e1937a0a5c5158d356b6767b77dc32dcc90/src/messages/BurnMessage.sol#L24-L29
func (*BurnMessage) Parse ¶
func (c *BurnMessage) Parse(bz []byte) (*BurnMessage, error)
type Chain ¶ added in v0.1.1
type Chain interface { // Name returns the name of the chain. Name() string // Domain returns the domain ID of the chain. Domain() Domain // LatestBlockain returns the last queired height of the chain LatestBlock() uint64 // SetLatestBlock sets the latest block SetLatestBlock(block uint64) // LastFlushedBlock returns the last block included in a flush. In the rare situation of a crash, // this block is a good block to start at to catch up on any missed transactions. LastFlushedBlock() uint64 // IsDestinationCaller returns true if the specified destination caller is the minter for the specified domain OR // if destination caller is a zero byte array(left empty in deposit for burn message). It also returns a human readable // version of the destination caller address provided in the message. IsDestinationCaller(destinationCaller []byte) (isCaller bool, readableAddress string) // InitializeClients initializes the rpc and or websocket clients. InitializeClients( ctx context.Context, logger log.Logger, ) error // CloseClients is a cleanup function to close any open clients CloseClients() error // InitializeBroadcaster initializes the minter account info for the chain. InitializeBroadcaster( ctx context.Context, logger log.Logger, sequenceMap *SequenceMap, ) error // StartListener starts a listener for observing new CCTP burn messages. StartListener( ctx context.Context, logger log.Logger, processingQueue chan *TxState, flushInterval time.Duration, ) // Broadcast broadcasts CCTP mint messages to the chain. Broadcast( ctx context.Context, logger log.Logger, msgs []*MessageState, sequenceMap *SequenceMap, metrics *relayer.PromMetrics, ) error TrackLatestBlockHeight( ctx context.Context, logger log.Logger, metrics *relayer.PromMetrics, ) WalletBalanceMetric( ctx context.Context, logger log.Logger, metrics *relayer.PromMetrics, ) }
Chain is an interface for common CCTP source and destination chain operations.
type ChainConfig ¶ added in v0.1.1
type CircleSettings ¶ added in v0.1.2
type Config ¶ added in v0.1.1
type Config struct { Chains map[string]ChainConfig `yaml:"chains"` EnabledRoutes map[Domain][]Domain `yaml:"enabled-routes"` Circle CircleSettings `yaml:"circle"` ProcessorWorkerCount uint32 `yaml:"processor-worker-count"` API struct { TrustedProxies []string `yaml:"trusted-proxies"` } `yaml:"api"` }
type ConfigWrapper ¶ added in v0.1.1
type ConfigWrapper struct { Chains map[string]map[string]any `yaml:"chains"` EnabledRoutes map[Domain][]Domain `yaml:"enabled-routes"` Circle CircleSettings `yaml:"circle"` ProcessorWorkerCount uint32 `yaml:"processor-worker-count"` API struct { TrustedProxies []string `yaml:"trusted-proxies"` } `yaml:"api"` }
type Message ¶
type Message struct { Version uint32 SourceDomain uint32 DestinationDomain uint32 Nonce uint64 Sender []byte Recipient []byte DestinationCaller []byte MessageBody []byte }
Message defines ... https://github.com/circlefin/evm-cctp-contracts/blob/d53f0e1937a0a5c5158d356b6767b77dc32dcc90/src/messages/Message.sol#L29-L37
type MessageState ¶
type MessageState struct { IrisLookupID string // hex encoded MessageSent bytes Status string // created, pending, attested, complete, failed, filtered Attestation string // hex encoded attestation SourceDomain Domain // uint32 source domain id DestDomain Domain // uint32 destination domain id SourceTxHash string DestTxHash string MsgSentBytes []byte // bytes of the MessageSent message transmitter event MsgBody []byte // bytes of the MessageBody DestinationCaller []byte // address authorized to call transaction Channel string // "channel-%d" if a forward, empty if not a forward Created time.Time Updated time.Time Nonce uint64 }
func EvmLogToMessageState ¶
func EvmLogToMessageState(abi abi.ABI, messageSent abi.Event, log *ethtypes.Log) (messageState *MessageState, err error)
EvmLogToMessageState transforms an evm log into a messageState given an ABI
func (*MessageState) Equal ¶ added in v0.1.1
func (m *MessageState) Equal(other *MessageState) bool
Equal checks if two MessageState instances are equal
type MetadataMessage ¶
type MetadataMessage struct { Nonce uint64 Sender []byte Channel uint64 Prefix string Recipient []byte Memo string }
MetadataMessage defines ...
func (*MetadataMessage) Parse ¶
func (c *MetadataMessage) Parse(bz []byte) (*MetadataMessage, error)
type SequenceMap ¶
type SequenceMap struct {
// contains filtered or unexported fields
}
SequenceMap holds a minter account's txn count to avoid account sequence mismatch errors
func NewSequenceMap ¶
func NewSequenceMap() *SequenceMap
func (*SequenceMap) Next ¶
func (m *SequenceMap) Next(destDomain Domain) uint64
func (*SequenceMap) Put ¶
func (m *SequenceMap) Put(destDomain Domain, val uint64)
type StateMap ¶
StateMap wraps sync.Map with type safety maps source tx hash -> TxState
func NewStateMap ¶
func NewStateMap() *StateMap
type TxState ¶ added in v0.1.1
type TxState struct { TxHash string Msgs []*MessageState RetryAttempt int }