view

package
v0.0.0-...-2e58711 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCIPView

type CCIPView struct {
	ContractMetaData

	FeeQuoter          FeeQuoterView          `json:"feeQuoter"`
	RMNRemote          RMNRemoteView          `json:"rmnRemote"`
	TokenAdminRegistry TokenAdminRegistryView `json:"tokenAdminRegistry"`
	NonceManager       NonceManagerView       `json:"nonceManager"`
	ReceiverRegistry   ReceiverRegistryView   `json:"receiverRegistry"`
}

func GenerateCCIPView

func GenerateCCIPView(
	ctx context.Context,
	chain sui.Chain,
	ccipPackageID string,
	ccipObjectRef string,
	routerPackageID string,
	routerStateObjectID string,
) (CCIPView, error)

GenerateCCIPView generates a CCIP view by querying the on-chain state

type ContractMetaData

type ContractMetaData struct {
	Address        string `json:"address,omitempty"`
	Owner          string `json:"owner,omitempty"`
	TypeAndVersion string `json:"typeAndVersion,omitempty"`
	StateObjectID  string `json:"stateObjectID,omitempty"`
}

type DestChainSpecificData

type DestChainSpecificData struct {
	AllowedSendersList []string              `json:"allowedSendersList"`
	DestChainConfig    OnRampDestChainConfig `json:"destChainConfig"`
	ExpectedNextSeqNum uint64                `json:"expectedNextSeqNum"`
}

type FeeQuoterDestChainConfig

type FeeQuoterDestChainConfig 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               string `json:"chainFamilySelector"`
	EnforceOutOfOrder                 bool   `json:"enforceOutOfOrder"`
	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 FeeQuoterStaticConfig

type FeeQuoterStaticConfig struct {
	MaxFeeJuelsPerMsg            string `json:"maxFeeJuelsPerMsg"`
	LinkToken                    string `json:"linkToken"`
	TokenPriceStalenessThreshold uint64 `json:"tokenPriceStalenessThreshold"`
}

type FeeQuoterView

type FeeQuoterView struct {
	ContractMetaData

	FeeTokens               []string                            `json:"feeTokens"`
	StaticConfig            FeeQuoterStaticConfig               `json:"staticConfig"`
	DestinationChainConfigs map[uint64]FeeQuoterDestChainConfig `json:"destinationChainConfigs"`
}

type ITokenPoolDevInspect

type ITokenPoolDevInspect[T TokenBucketWrapper] interface {
	TypeAndVersion(ctx context.Context, opts *bind.CallOpts) (string, error)
	Owner(ctx context.Context, opts *bind.CallOpts, typeArgs []string, state bind.Object) (string, error)
	GetToken(ctx context.Context, opts *bind.CallOpts, typeArgs []string, state bind.Object) (string, error)
	GetAllowlistEnabled(ctx context.Context, opts *bind.CallOpts, typeArgs []string, state bind.Object) (bool, error)
	GetAllowlist(ctx context.Context, opts *bind.CallOpts, typeArgs []string, state bind.Object) ([]string, error)
	GetSupportedChains(ctx context.Context, opts *bind.CallOpts, typeArgs []string, state bind.Object) ([]uint64, error)
	GetRemotePools(ctx context.Context, opts *bind.CallOpts, typeArgs []string, state bind.Object, remoteChainSelector uint64) ([][]byte, error)
	GetRemoteToken(ctx context.Context, opts *bind.CallOpts, typeArgs []string, state bind.Object, remoteChainSelector uint64) ([]byte, error)
	GetCurrentInboundRateLimiterState(ctx context.Context, opts *bind.CallOpts, typeArgs []string, clock bind.Object, state bind.Object, remoteChainSelector uint64) (T, error)
	GetCurrentOutboundRateLimiterState(ctx context.Context, opts *bind.CallOpts, typeArgs []string, clock bind.Object, state bind.Object, remoteChainSelector uint64) (T, error)
}

ITokenPoolDevInspect defines the common DevInspect methods across pool types

type MCMSWithTimelockView

type MCMSWithTimelockView struct {
	ContractMetaData

	Bypasser  mcmstypes.Config `json:"bypasser"`
	Proposer  mcmstypes.Config `json:"proposer"`
	Canceller mcmstypes.Config `json:"canceller"`

	TimelockMinDelay         uint64                    `json:"timelockMinDelay"`
	TimelockBlockedFunctions []TimelockBlockedFunction `json:"timelockBlockedFunctions"`
}

func GenerateMCMSWithTimelockView

func GenerateMCMSWithTimelockView(
	ctx context.Context,
	chain sui.Chain,
	mcmsPackageID string,
	mcmsStateObjectID string,
	timelockObjectID string,
	accountStateObjectID string,
) (MCMSWithTimelockView, error)

GenerateMCMSWithTimelockView generates an MCMS with timelock view by querying the on-chain state

type NonceManagerView

type NonceManagerView struct {
	ContractMetaData
}

type OffRampDynamicConfig

type OffRampDynamicConfig struct {
	FeeQuoter                               string `json:"feeQuoter"`
	PermissionlessExecutionThresholdSeconds uint32 `json:"permissionlessExecutionThresholdSeconds"`
}

type OffRampSourceChainConfig

type OffRampSourceChainConfig struct {
	Router                    string `json:"router"`
	IsEnabled                 bool   `json:"isEnabled"`
	MinSeqNr                  uint64 `json:"minSeqNr"`
	IsRMNVerificationDisabled bool   `json:"isRMNVerificationDisabled"`
	OnRamp                    string `json:"onRamp"`
}

type OffRampStaticConfig

type OffRampStaticConfig struct {
	ChainSelector      uint64 `json:"chainSelector"`
	RMNRemote          string `json:"rmnRemote"`
	TokenAdminRegistry string `json:"tokenAdminRegistry"`
	NonceManager       string `json:"nonceManager"`
}

type OffRampView

type OffRampView struct {
	ContractMetaData

	StaticConfig       OffRampStaticConfig                 `json:"staticConfig"`
	DynamicConfig      OffRampDynamicConfig                `json:"dynamicConfig"`
	SourceChainConfigs map[uint64]OffRampSourceChainConfig `json:"sourceChainConfigs"`
}

func GenerateOffRampView

func GenerateOffRampView(
	ctx context.Context,
	chain sui.Chain,
	offRampPackageID string,
	offRampStateObjectID string,
	ccipObjectRef string,
) (OffRampView, error)

GenerateOffRampView generates an offramp view for a given offramp by querying the on-chain state

type OnRampDestChainConfig

type OnRampDestChainConfig struct {
	SequenceNumber   uint64 `json:"sequenceNumber"`
	AllowlistEnabled bool   `json:"allowlistEnabled"`
	Router           string `json:"router"`
}

type OnRampDynamicConfig

type OnRampDynamicConfig struct {
	FeeAggregator  string `json:"feeAggregator"`
	AllowlistAdmin string `json:"allowlistAdmin"`
}

type OnRampStaticConfig

type OnRampStaticConfig struct {
	ChainSelector uint64 `json:"chainSelector"`
}

type OnRampView

type OnRampView struct {
	ContractMetaData

	StaticConfig          OnRampStaticConfig               `json:"staticConfig"`
	DynamicConfig         OnRampDynamicConfig              `json:"dynamicConfig"`
	DestChainSpecificData map[uint64]DestChainSpecificData `json:"destChainSpecificData"`
}

func GenerateOnRampView

func GenerateOnRampView(
	ctx context.Context,
	chain sui.Chain,
	onRampPackageID string,
	onRampStateObjectID string,
	routerPackageID string,
	routerStateObjectID string,
) (OnRampView, error)

GenerateOnRampView generates an onramp view for a given onramp by querying the on-chain state

type RMNRemoteCurseEntry

type RMNRemoteCurseEntry struct {
	Subject  string `json:"subject"`
	Selector uint64 `json:"selector"`
}

type RMNRemoteSigner

type RMNRemoteSigner struct {
	OnchainPublicKey string `json:"onchain_public_key"` // Follow EVM snake_case
	NodeIndex        uint64 `json:"node_index"`
}

type RMNRemoteVersionedConfig

type RMNRemoteVersionedConfig struct {
	Version uint32            `json:"version"`
	Signers []RMNRemoteSigner `json:"signers"`
	Fsign   uint64            `json:"fSign"`
}

type RMNRemoteView

type RMNRemoteView struct {
	ContractMetaData
	IsCursed             bool                     `json:"isCursed"`
	Config               RMNRemoteVersionedConfig `json:"config"`
	CursedSubjectEntries []RMNRemoteCurseEntry    `json:"cursedSubjectEntries"`
}

type RateLimiterConfig

type RateLimiterConfig struct {
	IsEnabled bool   `json:"isEnabled"`
	Capacity  uint64 `json:"capacity"`
	Rate      uint64 `json:"rate"`
}

type ReceiverRegistryView

type ReceiverRegistryView struct {
	ContractMetaData
}

type RemoteChainConfig

type RemoteChainConfig struct {
	RemoteTokenAddress        string            `json:"remoteTokenAddress"`
	RemotePoolAddresses       []string          `json:"remotePoolAddresses"`
	InboundRateLimiterConfig  RateLimiterConfig `json:"inboundRateLimiterConfig"`
	OutboundRateLimiterConfig RateLimiterConfig `json:"outboundRateLimiterConfig"`
}

type RouterView

type RouterView struct {
	ContractMetaData

	IsTestRouter bool              `json:"isTestRouter"`
	OnRamps      map[uint64]string `json:"onRamps"`  // Map of DestinationChainSelector to OnRampAddress
	OffRamps     map[uint64]string `json:"offRamps"` // Map of DestinationChainSelector to OffRampAddress
}

func GenerateRouterView

func GenerateRouterView(
	ctx context.Context,
	chain sui.Chain,
	routerPackageID string,
	routerStateObjectID string,
) (RouterView, error)

GenerateRouterView generates a router view for a given router by querying the on-chain state

type TimelockBlockedFunction

type TimelockBlockedFunction struct {
	Target       string `json:"target"`
	ModuleName   string `json:"moduleName"`
	FunctionName string `json:"functionName"`
}

type TokenAdminRegistryView

type TokenAdminRegistryView struct {
	ContractMetaData
	TokenConfigs map[string]TokenConfigView `json:"tokenConfigs"` // Token address => config
}

type TokenConfigView

type TokenConfigView struct {
	TokenPoolPackageId  string   `json:"tokenPoolPackageId"`
	TokenPoolModule     string   `json:"tokenPoolModule"`
	TokenType           string   `json:"tokenType"`
	Administrator       string   `json:"administrator"`
	TokenPoolTypeProof  string   `json:"tokenPoolTypeProof"`
	LockOrBurnParams    []string `json:"lockOrBurnParams"`
	ReleaseOrMintParams []string `json:"releaseOrMintParams"`
}

type TokenPoolView

type TokenPoolView struct {
	ContractMetaData

	Token              string                       `json:"token"`
	RemoteChainConfigs map[uint64]RemoteChainConfig `json:"remoteChainConfigs"`
	AllowList          []string                     `json:"allowList"`
	AllowListEnabled   bool                         `json:"allowListEnabled"`
	RebalancerCapIds   []string                     `json:"rebalancerCapIds,omitempty"` // only applicable for LR TP
}

func GenerateTokenPoolView

func GenerateTokenPoolView[T TokenBucketWrapper](
	ctx context.Context,
	chain sui.Chain,
	poolPackageID string,
	poolStateObjectID string,
	tokenConfigs map[string]TokenConfigView,
	poolDevInspect ITokenPoolDevInspect[T],
	lggr logger.Logger,
) (TokenPoolView, error)

Jump to

Keyboard shortcuts

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