Create Transfer (beta)
Create transfer to withdraw from wallet.
HTTP Request
POST /v1/transfers/create
Returns
A successful response returns an unconfirmed Transfer
object with source_amount
, dest_amount
(the total the recipient will get), and total_fees
(estimated maximum blockchain network fees charged by the blockchain for performing the transfer).
Body
-
Token currency to send to the destination from the specified wallet. We will first check to make sure the wallet contains the amount you intend to send. However, since these are actual wallets, there could be a delay from the blockchain network that claims the balance is higher if multiple requests are being sent in a short window. This could result in the system thinking that it has enough balance but when the user confirms it, it will fail due to insufficient balance. Same issues can apply if a deposit is made to the wallet recently and not reflected in the blockchain yet. Possible values: BTC, ETH, SOL, AVAX, MATIC, DOT, XLM (more coming soon).
- Wallet type
ETH
is compatible with the following currencies: ETH, MATIC, AVAX. - Wallet type
SOL
is compatible with the following currencies: SOL. - Wallet type
BTC
is compatible with the following currencies: BTC. - Wallet type
DOT
is compatible with the following currencies: DOT. - Wallet type
XLM
is compatible with the following currencies: XLM.
- Wallet type
-
Unique wallet ID of the wallet to retrieve balance for.
-
Any wallet address of the same wallet type as the source. For example, wallet_type of
ETH
will only be compatible with a dest that is an ethereum address.Blockchain specific transfer behaviors:
- XLM (Stellar)
Different from other protocol/chains, when transferring from Streambird wallet to an external address, user is required to include a memo attached to the end of the address separated by
:
. For example:GDQP2KPQGKIHYJGXNUIYOMHARUARCA7DJT5FO2FFOOKY3B2WSQHG4W37:3652667947
where the destination address isGDQP2KPQGKIHYJGXNUIYOMHARUARCA7DJT5FO2FFOOKY3B2WSQHG4W37
and stellar memo is3652667947
. -
decimal in string
The total amount to transfer to the destination. Ifamount_includes_fees
is set to true, we will auto calculate the fees to ensure the maximum amount withdrawn from the source is same as the specified amount. However, ifamount_includes_fees
is set to false, we will calculate the fees and auto increment the source_amount that gets returned in the response. We recommend that you show both the returned source_amount, dest_amount (how much recipient will receive), and also the total_fees to your user. Source amount stored with a transfer object will always be an all inclusive amount containing any fees calculated by the platform. -
notes string
Optional notes you want to store with this transaction.
-
amount_includes_fees boolean
Determines of the source_amount includes fees. If set to false, we will increment the source_amount automatically.
-
user_id string
Optional user ID to send in with the transfer, which will trigger a platform validation to ensure the source wallet is owned by the specified user to avoid usage error.
curl \
-X POST https://api.streambird.io/v1/transfers/create \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"dest_currency":"SOL","source":"wallet_2DJJmE5IhB1M7I8jJ7JuyCiOtiC","dest":"3eiTLfEg8koaNgNMcmygm2nQ3APNNNWAyHGiooGwAziK","source_amount":"0.005","notes":"test","amount_includes_fees":true,"user_id":"user_2DJJeF75Jd2NIj6NyJMxEw0pXiA"}'
{
"dest_currency": "SOL",
"source": "wallet_2DJJmE5IhB1M7I8jJ7JuyCiOtiC",
"dest": "3eiTLfEg8koaNgNMcmygm2nQ3APNNNWAyHGiooGwAziK",
"source_amount": "0.005",
"notes": "test",
"amount_includes_fees": true,
"user_id": "user_2DJJeF75Jd2NIj6NyJMxEw0pXiA"
}
{
"id": "transfer_2DJMdUNmkPDIFNVWiTNHTiBL0NB",
"app_id": "app_25ldv51seNohTaYRsxdfoxMlAa2",
"user_id": "user_2DJJeF75Jd2NIj6NyJMxEw0pXiA",
"status": "unconfirmed",
"source": "wallet_2DJJmE5IhB1M7I8jJ7JuyCiOtiC",
"source_amount": "0.005",
"dest": "3eiTLfEg8koaNgNMcmygm2nQ3APNNNWAyHGiooGwAziK",
"dest_amount": "0.004995",
"dest_currency": "SOL",
"source_currency": "SOL",
"custom_id": null,
"total_fees": "0.000005",
"notes": "test",
"blockchain_tx_hash": "",
"completed_at": 0,
"cancelled_at": 0,
"expires_at": 1660412941,
"created_at": 1660412821,
"updated_at": 1660412821
}