Skip to main content
Create and execute withdrawal requests. Supports both Bitcoin (multi-address) and Ethereum (single-address) networks.

Methods

createWithdraw()

Create a withdrawal request. Signature:
createWithdraw(
  request: CreateWithdrawRequest,
  requestOptions?: RequestOptions
): Promise<WithdrawResponse>
Parameters:
ParameterTypeRequiredDescription
request.networkIdstringYesNetwork ID (from getNetworks())
request.fromstring[]YesArray of source addresses
request.tostringYesRecipient address
request.amountstringYesAmount to withdraw
request.clientSharestringYesClient share for signing
Example - Bitcoin (Multi-address):
const withdrawal = await client.withdraw.createWithdraw({
  networkId: 'your-btc-network-id',
  from: [
    'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
    'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4'
  ],
  to: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
  amount: '0.001',
  clientShare: 'your-client-share'
});

console.log('Withdrawal ID:', withdrawal.data.id);
console.log('Status:', withdrawal.data.status);
Example - Ethereum (Single-address):
const withdrawal = await client.withdraw.createWithdraw({
  networkId: 'your-eth-network-id',
  from: [
    '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
  ],
  to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
  amount: '0.1',
  clientShare: 'your-client-share'
});

console.log('Transaction Hash:', withdrawal.data.hash);
Network Differences: Bitcoin supports multi-address withdrawals (withdraw from multiple addresses in one transaction), while Ethereum only supports single-address withdrawals.