Initiate a Withdrawal
Endpoint
Section titled “Endpoint”POST /withdraw/preview
POST /withdraw
Server: https://bridge.openfish.me (port 3004)
Tags: Bridge
The FISH bridge withdraws only the FISH BEP-20 on BSC. Call /withdraw/preview first to show the user the amount, fee, total debit, hot-wallet liquidity, and canWithdraw result. Call /withdraw only after explicit user confirmation; it debits the user’s Openfish balance and sends the same token from the hot wallet to recipientAddr.
Request Body
Section titled “Request Body”| Property | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Your Openfish wallet address |
toChainId | string | Yes | Must be "56" for BSC |
toTokenAddress | string | Yes | Must match the FISH token address |
recipientAddr | string | Yes | Destination BSC wallet address |
amount | string | No | Amount in base units. Omit or set "all" to withdraw full available balance minus configured fee. |
{ "address": "0xabc0000000000000000000000000000000000000", "toChainId": "56", "toTokenAddress": "0xdcc3990630eB5Ffd8914d639198cCa593e59465A", "recipientAddr": "0xdef0000000000000000000000000000000000000", "amount": "1000000000000000000"}Preview Response
Section titled “Preview Response”200 — Withdrawal preview generated. No balance is debited.
{ "address": "0xabc0000000000000000000000000000000000000", "toChainId": "56", "chainName": "BSC", "token": { "name": "FISH", "symbol": "FISH", "address": "0xdcc3990630eB5Ffd8914d639198cCa593e59465A", "decimals": 18 }, "recipientAddr": "0xdef0000000000000000000000000000000000000", "clobBalance": "1.500000000000000000", "clobBalanceBaseUnit": "1500000000000000000", "amountBaseUnit": "1000000000000000000", "feeBaseUnit": "1000000000000000", "totalDebitBaseUnit": "1001000000000000000", "hotWalletBalanceBaseUnit": "100000000000000000000", "gasBnbWei": "1000000000000000", "feeSource": "configured fixed FISH fee", "canWithdraw": true}Submit Response
Section titled “Submit Response”200 — Withdrawal submitted.
{ "address": { "evm": "0x23566f8b2E82aDfCf01846E54899d110e97AC053" }, "note": "Withdrawal submitted successfully."}curl -X POST "https://bridge.openfish.me/withdraw/preview" \ -H "Content-Type: application/json" \ -d '{"address":"0xabc0000000000000000000000000000000000000","toChainId":"56","toTokenAddress":"0xdcc3990630eB5Ffd8914d639198cCa593e59465A","recipientAddr":"0xdef0000000000000000000000000000000000000","amount":"1000000000000000000"}'
curl -X POST "https://bridge.openfish.me/withdraw" \ -H "Content-Type: application/json" \ -d '{"address":"0xabc0000000000000000000000000000000000000","toChainId":"56","toTokenAddress":"0xdcc3990630eB5Ffd8914d639198cCa593e59465A","recipientAddr":"0xdef0000000000000000000000000000000000000","amount":"1000000000000000000"}'