Overview
TheEvmCrossChainOrder class represents a cross-chain swap order originating from an EVM-compatible blockchain. It extends the BaseOrder class and encapsulates all order details including assets, amounts, escrow parameters, and auction configuration.
Creating an Order
EvmCrossChainOrder.new()
Create a new EVM cross-chain order.Address of the escrow factory contract
Order information containing assets, amounts, and addresses
Escrow configuration parameters
Auction and fee details
Optional configuration
EvmCrossChainOrder.fromNative()
Create an order from a native asset (ETH, MATIC, etc.).Native orders must be submitted on-chain through
NativeOrderFactory.create AND off-chain through the relayer.Source chain ID
Native order factory instance
Escrow factory address
Order info without makerAsset (automatically set to wrapped native token)
Auction and fee details
Escrow parameters
Optional configuration
EvmCrossChainOrder.fromDataAndExtension()
Reconstitute an order from its on-chain representation.On-chain order structure
Order extension data
Order Properties
Basic Information
Order creator’s address
Source chain token address
Destination chain token address
Amount being swapped from source chain
Minimum amount expected on destination chain
Recipient address on destination chain (defaults to maker if not set)
Timing
Auction start timestamp in seconds
Auction end timestamp in seconds
Order expiration timestamp in seconds
Security
Hash lock for atomic swap
Time lock configuration
Safety deposit on source chain
Safety deposit on destination chain
Configuration
Destination chain ID
Random salt value
Order nonce
Whether partial fills are allowed
Whether multiple fills are allowed
Methods
build()
Build the order into its on-chain struct format.LimitOrderV4Struct - On-chain order structure
getOrderHash()
Calculate the order hash.Source chain ID
string - Order hash as hex string
getTypedData()
Get EIP-712 typed data for signing.Source chain ID
EIP712TypedData - Typed data for signing
getCalculator()
Get the auction calculator for this order.AuctionCalculator - Auction calculator instance
isExclusiveResolver()
Check if a wallet is an exclusive resolver.Wallet address to check
boolean - True if wallet has exclusive rights
isExclusivityPeriod()
Check if currently in the exclusivity period.Timestamp to check (in seconds)
boolean - True if in exclusivity period
canExecuteAt()
Check if an executor can fill the order at a given time.Executor address
Execution timestamp in seconds
boolean - True if executor is allowed
getResolverFee()
Calculate the resolver fee.Resolver address
Execution timestamp in seconds
Block base fee in wei
Amount to fill (defaults to full order)
bigint - Resolver fee amount
getIntegratorFee()
Calculate the integrator fee.Resolver address
Execution timestamp in seconds
Block base fee in wei
Amount to fill (defaults to full order)
bigint - Integrator fee amount
isNative()
Check if order is a native token order.Chain ID
Native order factory instance
Order signature
boolean - True if native order
nativeSignature()
Get the signature for submitting native order on-chain.Maker address
string - Signature for on-chain submission
Example Usage
See Also
- SvmCrossChainOrder - Solana cross-chain orders
- HashLock - Hash lock documentation
- TimeLocks - Time locks documentation
- Order Lifecycle Guide - Understanding order flow