2

What is token hex API and transaction abi in the abieos repo? Can ABI be generated for any transaction on the EOS block chain? If yes, then how?

0

Assuming you're referring to this file, the two are as follows:

tokenHexApi: an array of characters representing the hexadecimal representation of a contract ABI.

const char tokenHexApi[] = "0e656f73696f3a3a6162692f312e30010c6163636f756e745f6e616d65046e61"
                           "6d6505087472616e7366657200040466726f6d0c6163636f756e745f6e616d65"
                           "02746f0c6163636f756e745f6e616d65087175616e7469747905617373657404"
                           "6d656d6f06737472696e67066372656174650002066973737565720c6163636f"
                           "756e745f6e616d650e6d6178696d756d5f737570706c79056173736574056973"
                           "737565000302746f0c6163636f756e745f6e616d65087175616e746974790561"
                           "73736574046d656d6f06737472696e67076163636f756e7400010762616c616e"
                           "63650561737365740e63757272656e63795f7374617473000306737570706c79"
                           "0561737365740a6d61785f737570706c79056173736574066973737565720c61"
                           "63636f756e745f6e616d6503000000572d3ccdcd087472616e73666572000000"
                           "000000a531760569737375650000000000a86cd4450663726561746500020000"
                           "00384f4d113203693634010863757272656e6379010675696e74363407616363"
                           "6f756e740000000000904dc603693634010863757272656e6379010675696e74"
                           "36340e63757272656e63795f7374617473000000";

If we do some conversion from hex to ASCII, we get something like this:

eosio::abi/1.0??account_name?name??transfer???from?account_name?to?account_name?quantity?asset?memo?string?create???issuer?account_name?maximum_supply?asset?issue???to?account_name?quantity?asset?memo?string?account???balance?asset?currency_stats???supply?asset?max_supply?asset?issuer?account_name????W-<???transfer???????1v?issue??????l?E?create?????8OM?2?i64??currency??uint64?account??????M??i64??currency??uint64?currency_stats????

So this is just a typical contract ABI in hex encoding.

Similarly, transactionAbi is an ABI is JSON.

They are used in abieos_set_abi_hex() and abieos_set_abi() functions in order to upload the ABI to the blockchain (similar to cleos set abi).

Can ABI be generated for any transaction on the EOS block chain?

These are set abi transactions that push an ABI to the chain. ABIs are generated for contracts, and transactions deliver them to the blockchain.

  • thanks but how was ABI converted to JSON? and by contract ABI do you mean the contract.abi file which is generated using eosiocpp -g contract.abi contract.cpp? – kstnew Aug 11 '18 at 10:46
  • "how was ABI converted to JSON?" <- you mean hex to JSON to interface with the ABI? hex doesn't need to be converted to JSON; JSON needs to be converted to binary. hex is converted to binary as well here and yes, I mean contract.abi-type of abi – confused00 Aug 11 '18 at 10:48
  • are the contents of contract.abi file in json format? – kstnew Aug 11 '18 at 10:57
  • all the ones i've seen have been json, yes – confused00 Aug 11 '18 at 10:59
  • does that mean tokenHexApi[] is hexadecimal representation of transactionAbi[] ? – kstnew Aug 11 '18 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.