Withdraw - Self-Custody MPC (Simple)
Build, sign, and send withdrawals in one SDK call. See the Guide.
-
Build and sign the transaction and send it to BitGo, all in one call using the JavaScript SDK. The simple flow also supports sending to many recipients in 1 transaction.
If your withdrawal doesn't require approval, BitGo applies the final signature using the BitGo key and broadcasts the transaction. If you have policy rules requiring approvals, the transaction remains pending until approved.
-
If your withdrawal requires approval, another admin must approve it — you cannot approve your own transactions. Once approved, BitGo rebuilds the transaction with current fees, applies the final signature, and broadcasts to the blockchain.
// 1. Build, Sign, and Send Transaction
// Use the JavaScript SDK for this step (see JavaScript tab)
// 2. Approve Transaction (Optional)
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="<ASSET_ID>"
export APPROVAL_ID="<APPROVAL_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>"
curl -X PUT \
http://$BITGO_EXPRESS_HOST/api/v2/$COIN/pendingApprovals/$APPROVAL_ID \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"state": "approved",
"walletPassphrase": "'"$WALLET_PASSPHRASE"'"
}'
// 1. Build, Sign, and Send Transaction
import { BitGoAPI } from "@bitgo/sdk-api";
import { Hteth } from "@bitgo/sdk-coin-eth";
const bitgo = new BitGoAPI({ env: 'test' });
bitgo.register("hteth", Hteth.createInstance);
const coin = bitgo.coin("hteth");
const wallet = await coin.wallets().get({ id: walletId });
const res = await wallet.sendMany({
walletPassphrase: walletPassphrase,
recipients: [{ address: destinationAddress, amount: sendAmount }],
type: "transfer",
});
console.log(res);
// 2. Approve Transaction (Optional)
const baseCoin = bitgo.coin(initialPendingApproval.coin);
const pendingApproval = await baseCoin.pendingApprovals().get({ id: initialPendingApproval.id });
const result = await pendingApproval.approve(params);
// 1. Build, Sign, and Send Transaction Response
{
"transfer": {
"id": "665e352e29c225381225e8f5f74f429d",
"coin": "hteth",
"wallet": "665e33f768f9b4b1cc2ca87a6b87cdfb",
"walletType": "hot",
"txid": "0x43f7bef95dd02eea33d447afc625908a429902fbd35a35f0da6b7befddc69d9b",
"type": "send",
"state": "signed"
},
"txid": "0x43f7bef95dd02eea33d447afc625908a429902fbd35a35f0da6b7befddc69d9b",
"status": "signed"
}
// 2. Approve Transaction Response
{
"id": "66b66201c45ab3125fc2d8a77b541d12",
"coin": "tsol",
"state": "approved",
"approvalsRequired": 1
}