/sendBitcoinTransaction
- account_idintegerrequiredExampleDescriptionDefault1
- outputsstring[]requiredExample
[ "3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3", "6000" ]
DescriptionDefault3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3,6000 - feeintegerrequiredExampleDescriptionDefault20
- descriptionstringExampleDescriptionDefaultTest
- specificFromAddressstringExampleDescriptionDefault3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3
- bodysendBitcoinTransactionResponse
- FunctionDataobjectDescription
- ApprovalRequestStatusintegerExampleDescriptionDefault3
- CoinTypestringExampleDescriptionDefaultBTC
- Transactionsobject[]Description
- AmountToTransferstringExampleDescriptionDefault10000000
- DestinationAddressstringExampleDescriptionDefault3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3
- MetaMetaResponse
- AccessTokenstringExampleDescriptionDefaulta3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6
- DestinationstringExampleDescriptionDefault042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622
- SourcestringExampleDescriptionDefaultdf4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355
- TimestringExampleDescriptionDefault2021-02-14 09:58:52.320
- object
- FunctionDataobject
- ApprovalRequestStatusintegerDescriptionDefault0
- Transactionsobject[]Description
- AmountToTransferstringExampleDescriptionDefault6000
- DestinationAddressstringExampleDescriptionDefault0x2182Fe2b3Ca1DFD39CB9A4C8218aE3ea79748A4F
- MetasendBitcoinTransactionResponse
- FunctionDataobjectDescription
- ApprovalRequestStatusintegerExampleDescriptionDefault3
- CoinTypestringExampleDescriptionDefaultBTC
- Transactionsobject[]Description
- AmountToTransferstringExampleDescriptionDefault10000000
- DestinationAddressstringExampleDescriptionDefault3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3
- MetaMetaResponse
- AccessTokenstringExampleDescriptionDefaulta3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6
- DestinationstringExampleDescriptionDefault042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622
- SourcestringExampleDescriptionDefaultdf4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355
- TimestringExampleDescriptionDefault2021-02-14 09:58:52.320
curl --request POST \
--url 'http://1.1.1.1/sendBitcoinTransaction?account_id=1&outputs=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3%2C6000&fee=20&description=Test&specificFromAddress=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"FunctionData": {
"ApprovalRequestStatus": 3,
"CoinType": "BTC",
"Transactions": [
{
"AmountToTransfer": "10000000",
"DestinationAddress": "3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3"
}
]
},
"Meta": {
"AccessToken": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
"Destination": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
"Source": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
"Time": "2021-02-14 09:58:52.320"
}
}'var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"FunctionData": {
"ApprovalRequestStatus": 3,
"CoinType": "BTC",
"Transactions": [
{
"AmountToTransfer": "10000000",
"DestinationAddress": "3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3"
}
]
},
"Meta": {
"AccessToken": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
"Destination": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
"Source": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
"Time": "2021-02-14 09:58:52.320"
}
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("http://1.1.1.1/sendBitcoinTransaction?account_id=1&outputs=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3,6000&fee=20&description=Test&specificFromAddress=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));require "uri"
require "json"
require "net/http"
url = URI("http://1.1.1.1/sendBitcoinTransaction?account_id=1&outputs=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3,6000&fee=20&description=Test&specificFromAddress=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"FunctionData": {
"ApprovalRequestStatus": 3,
"CoinType": "BTC",
"Transactions": [
{
"AmountToTransfer": "10000000",
"DestinationAddress": "3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3"
}
]
},
"Meta": {
"AccessToken": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
"Destination": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
"Source": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
"Time": "2021-02-14 09:58:52.320"
}
})
response = http.request(request)
puts response.read_body
import requests
import json
url = "http://1.1.1.1/sendBitcoinTransaction?account_id=1&outputs=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3,6000&fee=20&description=Test&specificFromAddress=3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3"
payload = json.dumps({
"FunctionData": {
"ApprovalRequestStatus": 3,
"CoinType": "BTC",
"Transactions": [
{
"AmountToTransfer": "10000000",
"DestinationAddress": "3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3"
}
]
},
"Meta": {
"AccessToken": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
"Destination": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
"Source": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
"Time": "2021-02-14 09:58:52.320"
}
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
// success
{
"FunctionData": {
"ApprovalRequestStatus": 0,
"Transactions": [
{
"AmountToTransfer": "6000",
"DestinationAddress": "0x2182Fe2b3Ca1DFD39CB9A4C8218aE3ea79748A4F"
}
]
},
"Meta": {
"FunctionData": {
"ApprovalRequestStatus": 3,
"CoinType": "BTC",
"Transactions": [
{
"AmountToTransfer": "10000000",
"DestinationAddress": "3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3"
}
]
},
"Meta": {
"AccessToken": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
"Destination": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
"Source": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
"Time": "2021-02-14 09:58:52.320"
}
}
}- NOTE - this function can not be called from Swagger, please use sendBitcoinTransactionForSwagger instead.
- return - returns on success transactions array
[{'AmountToTransfer': '600','DestinationAddress': '3Qnv1fyqhSaptkxJrC9ruNfpSCB1Srmkg3'}]}
** NOTE: success or failure in this api call does not necessarily means success or failure in the transaction itself
** for example, the transaction may work by the response to the client can be lost in communication (if the internet is down for the client)
** another example is that the transaction was approved here but failed in the signing process
To know the status of the transaction you can access the function getTransactionByToken.
To get the token to send those functions you should call getCurrentToken one action BEFORE sendTransaction
myTokenToStoreInTheDb = user.getCurrentToken()
sendBitcoinTransaction(...)
....
user.getTransactionByToken(myTokenToStoreInTheDb,'BTC')