Skip to main content
The Bridge SDK provides a full TypeScript interface for interacting with the Solayer Bridge Program. It enables cross-chain asset transfers between Solana and Solayer networks with built-in security features and proof verification.

Installation

Bridge Flow

Cross-chain transfers follow a secure five-step process:
  • Source Chain: User initiates bridge transaction on source chain (Solana/Solayer)
  • Proof Generation: Bridge proof is created with transaction details
  • Guardian Verification: Guardians verify and sign the bridge proof
  • Target Chain: Operator executes bridge on target chain using verified proof
  • Asset Transfer: Assets are transferred to recipient on target chain

Key Components

  • BridgeHandler: Manages bridge state and configuration
  • BridgeProof: Contains bridge transaction details and verification data
  • GuardianInfo: Stores guardian public keys and threshold information
  • TokenInfo: Maps tokens between chains

BridgeClient

The main client class for bridge operations.
Important Note: The BridgeClient class only provides transaction creation methods. You need to sign and send transactions yourself using sendAndConfirmTransaction or similar methods.

Query Methods

Bridge Handler Information

Bridge Proof Queries

Bridge Handler Vault PDA

Transaction Builders

createBridgeAssetSourceChainTransaction

Creates bridge transaction without sending it. The method automatically determines the target chain mint address using the get_target_mint utility function.

createBridgeAssetSourceChainSolTransaction

Creates SOL bridge transaction without sending it.

Utility Functions

PDA Helpers

Token Utilities

Bridge Status Tracking

Types and Interfaces

Core Configuration Types

Bridge Parameter Types

Program Account Types

Usage Examples

Complete Bridge Workflow

SOL Bridge Workflow

Working with Bridged Tokens

Error Handling

Common bridge errors and their meanings:
  • InsufficientAmount: User doesn’t have enough tokens
  • BridgePaused: Bridge is currently paused by admin
  • TokenPaused: Specific token is paused for bridging
  • TooMuchAdditionalSolGas: Additional SOL gas exceeds limit
  • TooLittleAdditionalSolGas: Additional SOL gas below minimum
  • InvalidChain: Invalid chain specified
  • InvalidOperator: Invalid operator for the operation

Best Practices

Pre-flight Checks

Transaction Management

Progress Monitoring

Parameter Validation