Skip to main content
The SDK uses a unified address format called OmniAddress. It’s simple: a chain prefix, a colon, and the native address.
<chain>:<address>

Examples

ChainOmniAddress
Ethereumeth:0x1234567890123456789012345678901234567890
Basebase:0x1234567890123456789012345678901234567890
Arbitrumarb:0x1234567890123456789012345678901234567890
Polygonpol:0x1234567890123456789012345678901234567890
BNB Chainbnb:0x1234567890123456789012345678901234567890
NEARnear:alice.near
Solanasol:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Bitcoinbtc:bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh
Zcashzec:t1Rv4exT7bqhZqi2j7xz8bUHDMxwosrjADU

Chain Prefixes

PrefixChainChain ID (mainnet)
ethEthereum1
baseBase8453
arbArbitrum One42161
polPolygon PoS137
bnbBNB Smart Chain56
nearNEAR Protocol
solSolana
btcBitcoin
zecZcash

Tokens Use The Same Format

Token addresses are also OmniAddresses:
// USDC on Ethereum
"eth:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

// USDC on Solana
"sol:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

// wNEAR on NEAR
"near:wrap.near"

Native Tokens

For native tokens (ETH, SOL, etc.), use the zero address or default representation:
ChainNative Token Address
EVM chainseth:0x0000000000000000000000000000000000000000
Solanasol:11111111111111111111111111111111

Utility Functions

The SDK provides helpers for working with OmniAddresses:
import { getChain, getAddress, omniAddress, ChainKind } from "@omni-bridge/core"

// Parse an OmniAddress
const addr = "eth:0x1234567890123456789012345678901234567890"
const chain = getChain(addr)    // ChainKind.Eth
const raw = getAddress(addr)    // "0x1234567890123456789012345678901234567890"

// Create an OmniAddress
const omni = omniAddress(ChainKind.Eth, "0x1234...")  // "eth:0x1234..."

// Check chain type
import { isEvmChain } from "@omni-bridge/core"

isEvmChain(ChainKind.Eth)   // true
isEvmChain(ChainKind.Base)  // true
isEvmChain(ChainKind.Near)  // false

ChainKind Enum

For programmatic use, the SDK provides a ChainKind enum:
enum ChainKind {
  Eth = 0,
  Near = 1,
  Sol = 2,
  Arb = 3,
  Base = 4,
  Bnb = 5,
  Btc = 6,
  Zcash = 7,
  Pol = 8
}

Validation

validateTransfer() automatically validates addresses. Invalid addresses throw a ValidationError:
try {
  await bridge.validateTransfer({
    token: "eth:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    sender: "eth:not-a-valid-address",  // Invalid!
    recipient: "near:alice.near",
    amount: 1_000_000n,
    fee: 0n,
    nativeFee: 0n,
  })
} catch (error) {
  // ValidationError with code "INVALID_ADDRESS"
}