Core Types
Complex data structures used throughout the Metalayer SDK for transaction execution, order tracking, and cross-chain operations.Chain
Comprehensive blockchain network information including configuration and metadata.Property | Type | Description |
---|---|---|
identifier | ChainIdentifier | Unique identifier for the blockchain network |
name | string | Human-readable name of the blockchain (e.g., “Ethereum”, “Arbitrum One”) |
isTestnet | boolean | Whether this is a testnet chain used for development and testing |
imageUrl | string | URL to the chain’s logo or icon image |
parentChain | ChainIdentifier | Parent chain identifier with both ID and architecture |
stack | RollupStack | Stack used by this chain (Nitro, ZkSync, Optimism) |
nativeCurrency | NativeCurrency | Native currency information for this chain |
defaultRpc | ChainRpc | Default RPC for this chain |
alternativeRpcs | ChainRpc[] | Alternative RPCs for this chain |
blockExplorer | ChainBlockExplorer | Block explorer information for this chain |
contracts | Record<string, ChainContract> | Known deployed contracts on this chain |
lastUpdatedAt | Date | Timestamp for when this chain was last updated |
ChainIdentifier
Minimal chain identifier containing ID and architecture information.Property | Type | Description |
---|---|---|
id | number | Unique numerical identifier for the blockchain network |
architecture | ChainArchitecture | Blockchain architecture (Ethereum, Solana) |
ExecutionStep
A transaction execution step containing the specific action data for EVM transactions, EIP-712 signatures, or Solana transactions.Property | Type | Description |
---|---|---|
action | ExecutionStepAction | Union type containing the specific action to execute |
ExecutionStepAction
Theaction
property is a union type with case
and value
properties:
Property | Type | Description |
---|---|---|
case | "transactionRequest" | "eip712Data" | "solanaTransaction" | Discriminator indicating which type of action this is |
value | TransactionRequest | EIP712Data | SolanaTransaction | The actual action data based on the case |
Action Types
Case | Value Type | Description |
---|---|---|
"transactionRequest" | TransactionRequest | Standard EVM transactions |
"eip712Data" | EIP712Data | EIP-712 typed data for gasless transactions |
"solanaTransaction" | SolanaTransaction | Solana blockchain transactions |
TransactionRequest
Standard EVM transaction request for on-chain operations.Property | Type | Description |
---|---|---|
to | string | Target contract address |
data | string | Encoded function call data |
value | string | ETH value in wei |
chainId | number | Execution chain ID |
type | TransactionType | Transaction type (ERC20_APPROVAL , CONTRACT_WRITE , TRANSFER ) |
EIP712Data
EIP-712 typed data structure for gasless transactions and meta-transactions.Property | Type | Description |
---|---|---|
account | string | Account address that will sign this typed data |
domain | EIP712Domain | Domain separator information for signature verification |
types | Record<string, EIP712TypeDefinition> | Type definitions for structured data |
primaryType | string | Primary type name being signed |
message | object | The structured data to be signed |
SolanaTransaction
Solana blockchain transaction containing multiple instructions.Property | Type | Description |
---|---|---|
instructions | Instruction[] | List of instructions to execute atomically |
Instruction
Individual instruction within a Solana transaction.Property | Type | Description |
---|---|---|
accounts | AccountMeta[] | Accounts involved with their access permissions |
programId | string | Public key of the Solana program to invoke |
data | string | Encoded instruction data specific to the program |
AccountMeta
Account metadata specifying permissions for Solana transactions.Property | Type | Description |
---|---|---|
pubkey | string | Public key of the account |
isSigner | boolean | Whether this account must sign the transaction |
isWritable | boolean | Whether this account’s data may be modified |
Token
Token information including metadata and chain-specific details.Property | Type | Description |
---|---|---|
address | string | Contract address of the token |
symbol | string | Token symbol (e.g., “ETH”, “USDC”) |
name | string | Full token name (e.g., “Ethereum”, “USD Coin”) |
decimals | number | Number of decimal places for the token |
chainId | number | Chain ID where this token exists |
imageUrl | string | URL to the token’s logo or icon |
TokenList
Container for a list of tokens on a specific chain.Property | Type | Description |
---|---|---|
tokens | Token[] | Array of tokens available on the chain |
Quote
Bridge quote containing execution steps and fee information.Property | Type | Description |
---|---|---|
quoteId | string | Unique identifier for tracking |
steps | ExecutionStep[] | Transaction steps to execute |
amountOut | bigint | Expected output amount |
totalFees | bigint | Total fees in source token |
provider | QuoteProvider | Bridge provider |
estimatedFillTimeSecs | number | Completion time (seconds) |
deadline | Date | Quote expiration time |
fees | TokenFee[] | Detailed fee breakdown by token and chain |
Order
A cross-chain bridge order that tracks transaction status and details.Property | Type | Description |
---|---|---|
quoteId | string | Unique identifier linking this order to the original quote |
provider | QuoteProvider | Provider that processed this order |
status | OrderStatus | Current status of the cross-chain order |
sourceTransactionHash | string | Transaction hash on the source chain |
destinationTransactionHash | string | Transaction hash on the destination chain |
sourceChain | ChainIdentifier | Source chain with id and architecture |
destinationChain | ChainIdentifier | Destination chain with id and architecture |
senderAddress | string | Address that initiated the order |
receiverAddress | string | Address that will receive the tokens |
amountIn | string | Input amount sent in source token’s smallest unit |
amountOut | string | Output amount received in destination token’s smallest unit |
sourceTokenAddress | string | Contract address of the source token |
destinationTokenAddress | string | Contract address of the destination token |
timestamp | Date | Block timestamp of the source transaction |
lastUpdated | Date | Block timestamp of the last update to the order |
nextSteps | ExecutionStep[] | Required user actions to complete the order |
deadline | Date | undefined | Expiration time when the order becomes eligible for refund |
Enums
Enumeration types that define specific sets of values used across the SDK.ChainArchitecture
Blockchain architecture types supported by the Metalayer SDK.Architecture | Description |
---|---|
UNSPECIFIED | Unspecified architecture |
ETHEREUM | Ethereum and EVM-compatible chains |
SOLANA | Solana blockchain |
QuoteProvider
Bridge providers that can process cross-chain transactions.Provider | Description |
---|---|
UNSPECIFIED | Unspecified provider |
NITRO_BRIDGE | Arbitrum Nitro native bridge |
BEDROCK_BRIDGE | OP Stack native bridge |
ZKSYNC_BRIDGE | zkSync native bridge |
ACROSS | Across protocol bridge |
ECO | Eco protocol bridge |
RELAY | Relay protocol bridge |
METATOKEN | MetaToken bridge |
LAYER_ZERO_OFT | LayerZero OFT bridge |
HYPERLANE_WARP_ROUTES | Hyperlane Warp Routes bridge |
OrderStatus
Order status values indicating the current state of a cross-chain transaction.Status | Description |
---|---|
PENDING | Order is in progress, waiting for completion |
WAITING_TO_PROVE | Withdrawal is waiting for proof submission (native bridges) |
WITHDRAWAL_PROVEN | Withdrawal proof has been submitted |
FULFILLED | Order completed successfully |
REFUNDED | Order was refunded to the source address |
FAILED | Order failed and cannot be completed |
READY_TO_REFUND | Order deadline passed, eligible for refund |