/sendEvmTransaction
1 min
POST
http://1.1.1.1/sendEvmTransaction
account_idintegerThe account ID we want to use in this operation
tostringThe address sent to in this operation
amountstringThe amount sent in this operation
coin_typestringcoin type used in this operation
feeintegerthe gas price we want to transfer
gas_limitintegerthe gas limit we want to transfer
max_priority_feeinteger<p>the max priority fee we want to tip the miner. Should be sent in EVM / ERC20 transactions that are EIP1559 type, otherwise should be None. (for more info, read <a href="https://metamask.io/1559/" target="_blank">https://metamask.io/1559/</a>)</p>
descriptionstring<p>free text for describing the transaction (will not be sent to the blockchain)</p>
data_for_contractstring<p>More details can be found in the Cold Vault UI -> New Smart Contract -> Add -> Click on "How to add parameters correctly?"</p>
specificFromAddressstring<p>Deposit address to send from - can be used if the account is defined as an Endpoint account</p>
bodyobjectRequest data for transferring funds.
200success
curl --request POST \
--url 'http://1.1.1.1/sendEvmTransaction?account_id=1&to=f7DA48a6400a2A89a1901C58c5FA3546574B2CC2&amount=6000&coin_type=CELO&fee=10000000000&gas_limit=21000&max_priority_fee=100000000&description=Test&specificFromAddress=0xf43416421efa9e9530D9F9be0b1b1d5226D25D00' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"AccountId": 1,
"CoinType": "CELO",
"Fee": {
"GasLimit": 21000,
"GasPrice": "10000000000"
},
"IsMetaMaskTransaction": "false",
"SpecificFromAddress": 1.3941553258014453e+48,
"Transactions": [
{
"AmountToTransfer": 6000,
"DestinationAddress": "f7DA48a6400a2A89a1901C58c5FA3546574B2CC2"
}
],
"UserDescription": "Test",
"Meta": {
"FunctionName": "sendEvmTransaction",
"RandomData": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229",
"Destination": "b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea",
"Time": "2021-02-07T18:37:46.948Z",
"Source": "048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99",
"AccessToken": "51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087"
}
}'- return - returns on success transactions array
** 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()
sendEvmTransaction(...)
....
user.getTransactionByToken(myTokenToStoreInTheDb,'{CELO/ MATIC}')
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.