@cawabunga_aurora/bridge-sdk
The Bridge SDK for Defuse Protocol provides a comprehensive set of tools for interacting with various bridge implementations. It simplifies the process of transferring assets between different blockchains.
Features
- Support for multiple bridge implementations (Direct, Hot, POA)
- Withdrawal functionality (single and batch)
- Intent-based operations with customizable signers and relayers
- Fee estimation and validation
- TypeScript support with comprehensive type definitions
Installation
npm install @cawabunga_aurora/bridge-sdk
yarn add @cawabunga_aurora/bridge-sdk
pnpm add @cawabunga_aurora/bridge-sdk
bun add @cawabunga_aurora/bridge-sdk
Quick Start
import { BridgeSDK } from '@cawabunga_aurora/bridge-sdk';
const sdk = new BridgeSDK({
bridges: [...],
intentRelayer: {...},
intentSigner: {...}
});
const withdrawal = sdk.createWithdrawal({
withdrawalParams: {
}
});
const result = await withdrawal.execute();
Development
Prerequisites
Setup
bun install
Build
bun run build
Development Mode
bun run dev
Lint
bun run lint
Format
bun run format
Advanced Usage
Working with Different Bridge Types
The SDK supports multiple bridge implementations:
import {
DirectBridge,
HotBridge,
PoaBridge
} from '@cawabunga_aurora/bridge-sdk';
const directBridge = new DirectBridge({...});
const hotBridge = new HotBridge({...});
const poaBridge = new PoaBridge({...});
const sdk = new BridgeSDK({
bridges: [directBridge, hotBridge, poaBridge],
});
Batch Withdrawals
const batchWithdrawal = sdk.createBatchWithdrawals({
withdrawalParams: [
]
});
const results = await batchWithdrawal.execute();
Custom Intent Handling
The SDK allows for custom intent payload and relay parameter factories:
const withdrawal = sdk.createWithdrawal({
withdrawalParams: {...},
intent: {
payload: (params) => { },
relayParams: (params) => { }
}
});
License
MIT