Createtransaction Using Trongrid Api
I Am Trying to Create a Tron Transaction Using Trongrid Api. but When I Do So, I Get the Following Error: { "Error": "Class Org. Tron. Core. Exception...
I am trying to create a tron transaction using trongrid APi. But when I do so, I get the following error:
{ "Error": "class org.tron.core.exception.ContractValidateException : Validate TransferContract error, no OwnerAccount." }
There is the api:
There is the curl command:
curl --request POST \
--url \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"to_address": "41e9d79cc47518930bc322d9bf7cddd260a0260a8d",
"owner_address": "415c543dca23f94f3e3db585368cb070204efeca0f",
"amount": 100000
}
'
1 Answer
You are missing the TRON-PRO-API-KEY header.
Here is a an example:
curl -X POST \
\
-H 'Content-Type: application/json' \
-H 'TRON-PRO-API-KEY: 25f66928-0b70-48cd-9ac6-da6f8247c663' \
-d '{
"to_address": "41e9d79cc47518930bc322d9bf7cddd260a0260a8d",
"owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292",
"amount": 1000
}'
You can create your api key here.
Notice that this will only create the transaction string, you still need to sign it and broadcast to the network:
Create -> Sign -> Broadcast -> (wait) -> Lookup and get receipt