The bridge protocol uses EVM wallet providers as source chains and supports both EVM and non-EVM destinations. Change the provider URL in the wallet account configuration:
Bridge Options
When calling the bridge method, you need to provide bridge options:
Target Chain
The targetChain option specifies which blockchain to bridge tokens to.
const bridgeOptions = {
targetChain: 'arbitrum', // Destination chain name
recipient: '0x...', // Recipient address
token: '0x...', // USDT contract address
amount: 1000000n, // Amount to bridge in base units
oftContractAddress: '0x...', // Optional custom OFT contract address
dstEid: 30110 // Optional LayerZero destination endpoint ID override
}
const result = await bridgeProtocol.bridge(bridgeOptions)
try {
const result = await bridgeProtocol.bridge({
targetChain: 'invalid-chain',
recipient: '0x...', // Recipient address
token: '0x...', // USDT contract address
amount: 1000000n
})
} catch (error) {
if (error.message.includes('not supported')) {
console.error('Chain or token not supported')
}
if (error.message.includes('Exceeded maximum fee')) {
console.error('Bridge fee too high')
}
if (error.message.includes('must be connected to a provider')) {
console.error('Wallet not connected to blockchain')
}
}