model

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBindingDataHex

func FromBindingDataHex[B any, M Mapper[B]](m M, dataHex string) error

FromBindingDataHex loads a TL-B binding from hex and then populates the model.

func ToBindingDataHex

func ToBindingDataHex[B any, M Mapper[B]](m M) (string, error)

ToBindingDataHex converts the model to its binding and encodes it as TL-B hex.

Types

type Deployables

type Deployables struct {
	RMNRouter           *address.Address `json:"rmnRouter"`
	Deployer            string           `json:"deployerHex"`
	MerkleRootCode      string           `json:"MerkleRootCodeHex"`
	ReceiveExecutorCode string           `json:"ReceiveExecutorCodeHex"`
}

type DestChainConfig

type DestChainConfig struct {
	IsEnabled                         bool   `json:"isEnabled"`
	MaxNumberOfTokensPerMsg           uint16 `json:"maxNumberOfTokensPerMsg"`
	MaxDataBytes                      uint32 `json:"maxDataBytes"`
	MaxPerMsgGasLimit                 uint32 `json:"maxPerMsgGasLimit"`
	DestGasOverhead                   uint32 `json:"destGasOverhead"`
	DestGasPerPayloadByteBase         uint8  `json:"destGasPerPayloadByteBase"`
	DestGasPerPayloadByteHigh         uint8  `json:"destGasPerPayloadByteHigh"`
	DestGasPerPayloadByteThreshold    uint16 `json:"destGasPerPayloadByteThreshold"`
	DestDataAvailabilityOverheadGas   uint32 `json:"destDataAvailabilityOverheadGas"`
	DestGasPerDataAvailabilityByte    uint16 `json:"destGasPerDataAvailabilityByte"`
	DestDataAvailabilityMultiplierBps uint16 `json:"destDataAvailabilityMultiplierBps"`
	ChainFamilySelector               uint32 `json:"chainFamilySelector"`
	DefaultTokenFeeUsdCents           uint16 `json:"defaultTokenFeeUsdCents"`
	DefaultTokenDestGasOverhead       uint32 `json:"defaultTokenDestGasOverhead"`
	DefaultTxGasLimit                 uint32 `json:"defaultTxGasLimit"`
	GasMultiplierWeiPerEth            uint64 `json:"gasMultiplierWeiPerEth"`
	GasPriceStalenessThreshold        uint32 `json:"gasPriceStalenessThreshold"`
	NetworkFeeUsdCents                uint32 `json:"networkFeeUsdCents"`
}

type DestChainConfigs

type DestChainConfigs struct {
	Config        DestChainConfig `json:"config"`
	USDPerUnitGas USDPerUnitGas   `json:"usdPerUnitGas"`
}

type ExecutionState

type ExecutionState int
const (
	Untouched  ExecutionState = iota // 0
	InProgress                       // 1
	Success                          // 2
	Failure                          // 3
)

type FeeQuoterStorage

type FeeQuoterStorage struct {
	ID                                uint32                      `json:"id"`
	Ownable                           Ownable2Step                `json:"ownable"`
	AllowedPriceUpdaters              []*address.Address          `json:"allowedPriceUpdaters"`
	MaxFeeJuelsPerMsg                 *big.Int                    `json:"maxFeeJuelsPerMsg"`
	LinkToken                         *address.Address            `json:"linkToken"`
	TokenPriceStalenessThreshold      uint32                      `json:"tokenPriceStalenessThreshold"`
	USDPerToken                       map[string]TimestampedPrice `json:"usdPerToken"`
	PremiumMultiplierWeiPerEthByToken map[string]uint64           `json:"premiumMultiplierWeiPerEthByToken"`
	DestChainConfigsByChainSelector   map[uint64]DestChainConfigs `json:"destChainConfigsByChainSelector"`
}

func (*FeeQuoterStorage) FromBinding

func (s *FeeQuoterStorage) FromBinding(raw *feequoter.Storage) error

func (*FeeQuoterStorage) ToBinding

func (s *FeeQuoterStorage) ToBinding() (*feequoter.Storage, error)

type FeeQuoterStorageBuilder

type FeeQuoterStorageBuilder struct {
	// contains filtered or unexported fields
}

func NewFeeQuoterStorageBuilder

func NewFeeQuoterStorageBuilder() *FeeQuoterStorageBuilder

NewFeeQuoterStorageBuilder creates a new builder with zero-value storage and initialized maps.

func (*FeeQuoterStorageBuilder) Build

Build returns the constructed FeeQuoterStorage or an error if any step failed.

func (*FeeQuoterStorageBuilder) WithAllowedPriceUpdater

func (b *FeeQuoterStorageBuilder) WithAllowedPriceUpdater(priceUpdater *address.Address) *FeeQuoterStorageBuilder

func (*FeeQuoterStorageBuilder) WithDestChainConfig

func (b *FeeQuoterStorageBuilder) WithDestChainConfig(selector uint64, cfg DestChainConfigs) *FeeQuoterStorageBuilder

func (*FeeQuoterStorageBuilder) WithID

func (*FeeQuoterStorageBuilder) WithLinkToken

func (b *FeeQuoterStorageBuilder) WithLinkToken(linkToken *address.Address) *FeeQuoterStorageBuilder

func (*FeeQuoterStorageBuilder) WithMaxFeeJuelsPerMsg

func (b *FeeQuoterStorageBuilder) WithMaxFeeJuelsPerMsg(maxFeeJuelsPerMsg *big.Int) *FeeQuoterStorageBuilder

func (*FeeQuoterStorageBuilder) WithOwnable

func (b *FeeQuoterStorageBuilder) WithOwnable(owner, pending *address.Address) *FeeQuoterStorageBuilder

func (*FeeQuoterStorageBuilder) WithPremiumMultiplier

func (b *FeeQuoterStorageBuilder) WithPremiumMultiplier(token *address.Address, multiplier uint64) *FeeQuoterStorageBuilder

func (*FeeQuoterStorageBuilder) WithTokenPriceStalenessThreshold

func (b *FeeQuoterStorageBuilder) WithTokenPriceStalenessThreshold(tokenPriceStalenessThreshold uint32) *FeeQuoterStorageBuilder

func (*FeeQuoterStorageBuilder) WithUSDPerToken

func (b *FeeQuoterStorageBuilder) WithUSDPerToken(token *address.Address, value *big.Int, timestamp time.Time) *FeeQuoterStorageBuilder

type Mapper

type Mapper[B any] interface {
	FromBinding(*B) error
	ToBinding() (*B, error)
}

type MerkleRootStorage

type MerkleRootStorage struct {
	Root                  string           `json:"root"`
	Owner                 *address.Address `json:"owner"`
	Timestamp             time.Time        `json:"timestamp"`
	MinMsgNr              uint64           `json:"minMsgNr"`
	MaxMsgNr              uint64           `json:"maxMsgNr"`
	MessageStates         []ExecutionState `json:"messageStates"`
	DeliveredMessageCount uint16           `json:"deliveredMessageCount"`
}

func (*MerkleRootStorage) FromBinding

func (s *MerkleRootStorage) FromBinding(raw *merkleroot.Storage) error

func (*MerkleRootStorage) ToBinding

func (s *MerkleRootStorage) ToBinding() (*merkleroot.Storage, error)

type MerkleRootStorageBuilder

type MerkleRootStorageBuilder struct {
	// contains filtered or unexported fields
}

func NewMerkleRootStorageBuilder

func NewMerkleRootStorageBuilder() *MerkleRootStorageBuilder

NewMerkleRootStorageBuilder creates a new builder with zero-value storage and initialized maps.

func (*MerkleRootStorageBuilder) Build

Build returns the constructed MerkleRootStorage or an error if any step failed.

func (*MerkleRootStorageBuilder) WithDeliveredMessageCount

func (b *MerkleRootStorageBuilder) WithDeliveredMessageCount(count uint16) *MerkleRootStorageBuilder

func (*MerkleRootStorageBuilder) WithMaxMsgNr

func (*MerkleRootStorageBuilder) WithMessageStates

func (b *MerkleRootStorageBuilder) WithMessageStates(states []ExecutionState) *MerkleRootStorageBuilder

func (*MerkleRootStorageBuilder) WithMinMsgNr

func (*MerkleRootStorageBuilder) WithOwner

func (*MerkleRootStorageBuilder) WithRoot

func (*MerkleRootStorageBuilder) WithTimestamp

type OCR3Base

type OCR3Base struct {
	ChainID int         `json:"chainID"`
	Commit  *OCR3Config `json:"commit"`
	Execute *OCR3Config `json:"execute"`
}

type OCR3Config

type OCR3Config struct {
	Signers                        []string           `json:"signers"`
	Transmitters                   []*address.Address `json:"transmitters"`
	ConfigDigest                   string             `json:"configDigestHex"`
	F                              int                `json:"F"`
	N                              int                `json:"N"`
	IsSignatureVerificationEnabled bool               `json:"IsSignatureVerificationEnabled"`
}

type OffRampStorage

type OffRampStorage struct {
	ID                                      uint32                       `json:"id"`
	Ownable                                 Ownable2Step                 `json:"ownable"`
	Deployables                             Deployables                  `json:"deployables"`
	FeeQuoter                               *address.Address             `json:"feeQuoter"`
	OCR3Base                                OCR3Base                     `json:"ocr3Base"`
	CursedSubjects                          []*big.Int                   `json:"cursedSubjects"`
	ChainSelector                           uint64                       `json:"chainSelector"`
	PermissionlessExecutionThresholdSeconds uint32                       `json:"PermissionlessExecutionThresholdSeconds"`
	SourceChainConfigs                      map[uint64]SourceChainConfig `json:"SourceChainConfigs"`
	LatestPriceSequenceNumber               uint64                       `json:"LatestPriceSequenceNumber"`
}

func (*OffRampStorage) FromBinding

func (s *OffRampStorage) FromBinding(raw *offramp.Storage) error

func (*OffRampStorage) ToBinding

func (s *OffRampStorage) ToBinding() (*offramp.Storage, error)

type OffRampStorageBuilder

type OffRampStorageBuilder struct {
	// contains filtered or unexported fields
}

func NewOffRampStorageBuilder

func NewOffRampStorageBuilder() *OffRampStorageBuilder

NewOffRampStorageBuilder creates a new builder with zero-value storage and initialized maps.

func (*OffRampStorageBuilder) Build

Build returns the constructed OffRampStorage or an error if any step failed.

func (*OffRampStorageBuilder) WithChainSelector

func (b *OffRampStorageBuilder) WithChainSelector(selector uint64) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithCursedSubject

func (b *OffRampStorageBuilder) WithCursedSubject(cursedSubject *big.Int) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithDeployerCode

func (b *OffRampStorageBuilder) WithDeployerCode(deployerCodeHex string) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithFeeQuoter

func (*OffRampStorageBuilder) WithID

func (*OffRampStorageBuilder) WithLatestPriceSequenceNumber

func (b *OffRampStorageBuilder) WithLatestPriceSequenceNumber(v uint64) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithMerkleRootCode

func (b *OffRampStorageBuilder) WithMerkleRootCode(merkleRootCode string) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithOCR3BaseChainID

func (b *OffRampStorageBuilder) WithOCR3BaseChainID(chainID int) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithOCR3CommitConfig

func (b *OffRampStorageBuilder) WithOCR3CommitConfig(commit *OCR3Config) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithOCR3ExecuteConfig

func (b *OffRampStorageBuilder) WithOCR3ExecuteConfig(execute *OCR3Config) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithOwnable

func (b *OffRampStorageBuilder) WithOwnable(owner, pending *address.Address) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithPermissionlessExecutionThresholdSeconds

func (b *OffRampStorageBuilder) WithPermissionlessExecutionThresholdSeconds(v uint32) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithRMNRouter

func (b *OffRampStorageBuilder) WithRMNRouter(router *address.Address) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithReceiveExecutorCode

func (b *OffRampStorageBuilder) WithReceiveExecutorCode(receiveExecutorCode string) *OffRampStorageBuilder

func (*OffRampStorageBuilder) WithSourceChainConfig

func (b *OffRampStorageBuilder) WithSourceChainConfig(selector uint64, cfg SourceChainConfig) *OffRampStorageBuilder

type OnRampStorage

type OnRampStorage struct {
	ID      uint32       `json:"id"`
	Ownable Ownable2Step `json:"ownable"`
}

func (*OnRampStorage) FromBinding

func (s *OnRampStorage) FromBinding(raw *onramp.Storage) error

func (*OnRampStorage) ToBinding

func (s *OnRampStorage) ToBinding() (*onramp.Storage, error)

type OnRampStorageBuilder

type OnRampStorageBuilder struct {
	// contains filtered or unexported fields
}

func NewOnRampStorageBuilder

func NewOnRampStorageBuilder() *OnRampStorageBuilder

NewOnRampStorageBuilder creates a new builder with zero-value storage and initialized maps.

func (*OnRampStorageBuilder) Build

func (b *OnRampStorageBuilder) Build() (*OnRampStorage, error)

Build returns the constructed OnRampStorage or an error if any step failed.

func (*OnRampStorageBuilder) WithID

func (*OnRampStorageBuilder) WithOwnable

func (b *OnRampStorageBuilder) WithOwnable(owner, pending *address.Address) *OnRampStorageBuilder

type Ownable2Step

type Ownable2Step struct {
	Owner        *address.Address `json:"owner"`
	PendingOwner *address.Address `json:"pendingOwner,omitempty"`
}

type RMNRemote

type RMNRemote struct {
	Admin          Ownable2Step       `json:"admin"`
	CursedSubjects []*big.Int         `json:"cursedSubjects"`
	ForwardUpdates []*address.Address `json:"forwardUpdates"`
}

type RouterStorage

type RouterStorage struct {
	ID            uint32                      `json:"id"`
	Ownable       Ownable2Step                `json:"ownable"`
	WrappedNative *address.Address            `json:"wrappedNative"`
	OnRamps       map[uint64]*address.Address `json:"onRamps"`
	OffRamps      map[uint64]*address.Address `json:"offRamps"`
	RMNRemote     RMNRemote                   `json:"rmnRemote"`
}

func (*RouterStorage) FromBinding

func (s *RouterStorage) FromBinding(raw *router.Storage) error

func (*RouterStorage) ToBinding

func (s *RouterStorage) ToBinding() (*router.Storage, error)

type RouterStorageBuilder

type RouterStorageBuilder struct {
	// contains filtered or unexported fields
}

func NewRouterStorageBuilder

func NewRouterStorageBuilder() *RouterStorageBuilder

NewRouterStorageBuilder creates a new builder with zero-value storage and initialized maps.

func (*RouterStorageBuilder) Build

func (b *RouterStorageBuilder) Build() (*RouterStorage, error)

Build returns the constructed RouterStorage or an error if any step failed.

func (*RouterStorageBuilder) WithID

func (*RouterStorageBuilder) WithOffRamp

func (b *RouterStorageBuilder) WithOffRamp(chainSelector uint64, offRamp *address.Address) *RouterStorageBuilder

func (*RouterStorageBuilder) WithOnRamp

func (b *RouterStorageBuilder) WithOnRamp(chainSelector uint64, onRamp *address.Address) *RouterStorageBuilder

func (*RouterStorageBuilder) WithOwnable

func (b *RouterStorageBuilder) WithOwnable(owner, pending *address.Address) *RouterStorageBuilder

func (*RouterStorageBuilder) WithRMNRemote

func (b *RouterStorageBuilder) WithRMNRemote(owner, pending *address.Address) *RouterStorageBuilder

func (*RouterStorageBuilder) WithRMNRemoteCursedSubject

func (b *RouterStorageBuilder) WithRMNRemoteCursedSubject(cursedSubject *big.Int) *RouterStorageBuilder

func (*RouterStorageBuilder) WithRMNRemoteForwardUpdates

func (b *RouterStorageBuilder) WithRMNRemoteForwardUpdates(forwardUpdate *address.Address) *RouterStorageBuilder

func (*RouterStorageBuilder) WithWrapperNative

func (b *RouterStorageBuilder) WithWrapperNative(wrappedNative *address.Address) *RouterStorageBuilder

type SourceChainConfig

type SourceChainConfig struct {
	Router                    *address.Address `json:"Router"`
	IsEnabled                 bool             `json:"IsEnabled"`
	MinSeqNr                  uint64           `json:"MinSeqNr"`
	IsRMNVerificationDisabled bool             `json:"IsRMNVerificationDisabled"`
	OnRamp                    string           `json:"OnRamp"`
}

type TimestampedPrice

type TimestampedPrice struct {
	Value     *big.Int  `json:"value"`
	Timestamp time.Time `json:"timestamp"`
}

type USDPerUnitGas

type USDPerUnitGas struct {
	ExecutionGasPrice        *big.Int  `json:"executionGasPrice"`
	DataAvailabilityGasPrice *big.Int  `json:"dataAvailabilityGasPrice"`
	Timestamp                time.Time `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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