contracts

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFloatToUint added in v0.2.0

func ConvertFloatToUint(amount string, decimals uint8) uint64

ConvertFloatToUint convert mayan float amount to the nomalized uint64 amount

func DenormalizeAmount added in v0.2.0

func DenormalizeAmount(amount *big.Int, decimals uint8) *big.Int

DenormalizeAmount converts a normalized amount back to its original precision

Types

type AccountCreation added in v0.3.0

type AccountCreation struct {
	Account  common.Address `abi:"account"`
	InitCode []byte         `abi:"initCode"`
}

type FillInput added in v0.3.0

type FillInput struct {
	Payload            IntentFillPayload `abi:"payload"`
	ExclusiveRelayer   common.Address    `abi:"exclusiveRelayer"`
	RepaymentAddresses []common.Address  `abi:"repaymentAddresses"`
	RepaymentChainIds  []*big.Int        `abi:"repaymentChainIds"`
	AccountCreation    AccountCreation   `abi:"accountCreation"`
}

type HubPoolContract

type HubPoolContract struct {
	contracts.Contract
	// contains filtered or unexported fields
}

func NewHubPoolContract

func NewHubPoolContract(
	client client.Client,
	address common.Address,
	l1Tokens map[string]config.TokenConfig,
) *HubPoolContract

func (*HubPoolContract) DestinationToken

func (c *HubPoolContract) DestinationToken(destinationChainId *big.Int, symbol string) (common.Address, error)

type IntentFillPayload added in v0.3.0

type IntentFillPayload struct {
	Segments        []SegmentData `abi:"segments"`
	Message         []byte        `abi:"message"`
	OrchestratorSig []byte        `abi:"orchestratorSig"`
}

type MayanFulfillMsg added in v0.2.0

type MayanFulfillMsg struct {
	Action         uint8
	OrderHash      [32]byte
	DestChainId    uint16
	DestAddr       [32]byte
	Driver         [32]byte
	TokenOut       [32]byte
	PromisedAmount uint64
	GasDrop        uint64
	Deadline       uint64
	ReferrerAddr   [32]byte
	ReferrerBps    uint8
	ProtocolBps    uint8
	SrcChainId     uint16
	TokenIn        [32]byte
}

type MayanFulfillParams added in v0.2.0

type MayanFulfillParams struct {
	FulfillAmount *big.Int
	EncodedVm     []byte
	Recipient     [32]byte
	Batch         bool
}

type MayanKey added in v0.2.0

type MayanKey struct {
	Trader       common.Hash
	SrcChainId   uint16
	TokenIn      common.Hash
	DestAddr     common.Hash
	DestChainId  uint16
	TokenOut     common.Hash
	MinAmountOut uint64
	GasDrop      uint64
	CancelFee    uint64
	RefundFee    uint64
	Deadline     uint64
	ReferrerAddr common.Hash
	ReferrerBps  uint8
	ProtocolBps  uint8
	AuctionMode  uint8
	Random       common.Hash
}

type MayanOrder added in v0.2.0

type MayanOrder struct {
	Status      OrderStatus
	AmountIn    uint64
	DestChainId uint16
}

type MayanSwiftContract added in v0.2.0

type MayanSwiftContract struct {
	contracts.Contract
	// contains filtered or unexported fields
}

func NewMayanSwiftContract added in v0.2.0

func NewMayanSwiftContract(
	client client.Client,
	address common.Address,
) *MayanSwiftContract

func (*MayanSwiftContract) DecodeFulfillCall added in v0.2.0

func (c *MayanSwiftContract) DecodeFulfillCall(calldata []byte) (*MayanFulfillParams, *MayanFulfillMsg, error)

func (*MayanSwiftContract) GetOrder added in v0.2.0

func (c *MayanSwiftContract) GetOrder(
	msg *MayanFulfillMsg,
	swap *mayan.MayanSwap,
	srcTokenDecimals uint8) (*MayanOrder, error)

func (*MayanSwiftContract) ParseFulfillPayload added in v0.2.0

func (c *MayanSwiftContract) ParseFulfillPayload(calldata []byte) (*MayanFulfillMsg, error)

type OrderStatus added in v0.2.0

type OrderStatus uint8
const (
	WORMHOLE_DECIMALS = 8

	OrderCreated OrderStatus = 0
)

type RhinestoneContract added in v0.3.0

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

func NewRhinestoneContract added in v0.3.0

func NewRhinestoneContract() *RhinestoneContract

func (*RhinestoneContract) DecodeFillCall added in v0.3.0

func (c *RhinestoneContract) DecodeFillCall(calldata []byte) (*FillInput, error)

type SegmentData added in v0.3.0

type SegmentData struct {
	TokenIn           [][2]*big.Int  `abi:"tokenIn"`
	TokenOut          [][2]*big.Int  `abi:"tokenOut"`
	OriginModule      common.Address `abi:"originModule"`
	OriginWETHAddress common.Address `abi:"originWETHAddress"`
	OriginChainId     *big.Int       `abi:"originChainId"`
	CompactNonce      *big.Int       `abi:"compactNonce"`
}

Jump to

Keyboard shortcuts

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