Warning
This codebase is a work in progress and has not been audited. This is not yet recommended for production use. Use at your own risk.
Composable cross-chain bridge SDK for Base Markets integrations.
bun install # type-check & unit tests bun run typecheck bun test# bundle to dist/ bun run build- Chain-agnostic API: One
BridgeCliententrypoint for any route via{sourceChain, destinationChain }. - Composable primitives:
transfer,call,request, plusprove,execute,status, andmonitor. - Canonical message identity: a single
MessageRefmodel with stable source identity and optional derived destination ids. - Capability-driven UX:
capabilities(route)tells you which steps apply for a route. - Runtime-agnostic: Compatible with standard Node.js environments (no Bun-only APIs).
src/ core/ // BridgeClient orchestration + shared types/errors/monitor adapters/ // Chain adapters + Base Markets bridge implementation (route adapters) clients/ // Generated clients (Solana/Base) interfaces/ // ABIs and IDLs utils/ // Helper functions examples/ // Usage examples tests/ // bun:test specs import{createBridgeClient}from"@base-markets/bridge-sdk";import{base,solanaMainnet}from"@base-markets/bridge-sdk/chains";import{makeSolanaAdapter}from"./your-adapters/solana";import{makeEvmAdapter}from"./your-adapters/evm";asyncfunctionmain(){constclient=createBridgeClient({chains: {solana: awaitmakeSolanaAdapter({rpcUrl: "https://api.mainnet-beta.solana.com",payer: {type: "keypairPath",path: "~/.config/solana/id.json"},chain: solanaMainnet,}),base: makeEvmAdapter({chain: base,rpcUrl: "https://mainnet.base.org",wallet: {type: "none"},}),},});constop=awaitclient.transfer({route: {sourceChain: solanaMainnet.id,destinationChain: base.id,},asset: {kind: "native"},// SOLamount: 1_000_000n,recipient: "0x644e3DedB0e4F83Bfcf8F9992964d240224B74dc",relay: {mode: "auto"},});forawait(constsofclient.monitor(op.messageRef)){if(s.type==="Executed")break;}}main().catch(console.error);If you need to target additional networks (e.g. Base Sepolia / Solana devnet) or use custom deployments, pass deployments overrides to: createBridgeClient({bridgeConfig:{deployments: ... } }).
See examples/ for working scripts against the v1 BridgeClient API:
examples/transfer.ts: Solana → EVM transferexamples/call.ts: Solana → EVM callexamples/evmToSolanaTokenTransfer.ts: EVM → Solana token transfer (prove + execute)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.