Withdraw
The Bridge API manages outbound transfers from your Openfish wallet. Provide a target chain, token, and recipient address, and the bridge handles the conversion and delivery.
How It Works
Section titled “How It Works”- Call
POST /withdrawwith your wallet address, target chain, token, and recipient. - Receive deposit addresses configured for the withdrawal route.
- Send USDC.e from your Openfish wallet to the correct deposit address.
- The bridge converts and delivers funds to the destination wallet.
Endpoint
Section titled “Endpoint”POST https://bridge.openfish.fun/withdrawRequest Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Your Openfish wallet address |
to_chain_id | string | Yes | Destination chain ID (e.g., "1" for Ethereum) |
to_token_address | string | Yes | Token contract address on the destination chain |
recipient_addr | string | Yes | Wallet address to receive funds |
amount | string | No | Amount in base units (optional pre-allocation) |
Response
Section titled “Response”{ "evm": "0xdef...456", "svm": "7Kz...abc", "btc": "bc1q...ghi"}Every withdrawal produces fresh addresses tied to the specific destination route. Do not reuse addresses from earlier withdrawal requests.
Rust SDK Example
Section titled “Rust SDK Example”use openfish_client_sdk::BridgeClient;
#[tokio::main]async fn main() -> anyhow::Result<()> { let bridge = BridgeClient::new("https://bridge.openfish.fun");
let addrs = bridge .withdraw( "0x56687bf447db6ffa42ffe2204a05edaa20f55839", "1", // Ethereum mainnet "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC on Ethereum "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", // recipient None, // no amount pre-allocation ) .await?;
println!("Send USDC.e to: {}", addrs.evm);
Ok(())}Supported Chains
Section titled “Supported Chains”Withdrawals cover the same chain families as deposits:
| Chain Family | Supported Destinations |
|---|---|
| EVM | Ethereum, Arbitrum, Base, Optimism, Polygon, BSC |
| Solana | Solana mainnet |
| Bitcoin | Bitcoin mainnet |
Withdrawal Flow
Section titled “Withdrawal Flow”- Check Supported Assets — Verify the destination chain and token via
GET /supported-assets. - Get a Quote — Preview estimated output and fees via
POST /quote. - Create Withdrawal Addresses — Call
POST /withdrawwith full routing details. - Send USDC.e — Transfer from your Openfish wallet to the returned deposit address.
- Track Status — Monitor via
GET /status/{address}untilCOMPLETED.
Important Notes
Section titled “Important Notes”- Only generate withdrawal addresses when you are ready to send. Each set of addresses is bound to a specific destination configuration.
- For withdrawals above $50,000, consider splitting into smaller transfers to reduce slippage.
- Openfish does not charge withdrawal fees. Gas and bridging costs are absorbed by the protocol.
Next Steps
Section titled “Next Steps”- Get a Quote — Preview fees and output before withdrawing.
- Check Status — Track withdrawal progress.
- Supported Assets — Verify destination chain support.