Gregory Popovitch f7d5b45c1a Merge pull request #50 from AntelopeIO/gh_45
Add support for fixed sized arrays
2025-07-29 11:46:17 -04:00
2025-06-27 12:32:13 -04:00
2018-06-08 13:50:05 -04:00
2018-06-08 18:10:20 -04:00
2022-01-03 12:53:13 -05:00
2021-04-08 08:21:58 -05:00
2025-06-27 12:32:13 -04:00

abieos

Binary <> JSON conversion using ABIs. Compatible with languages which can interface to C; see src/abieos.h.

abieos utilizes a rolling release model: the main branch contains the latest fully supported version.

Packing transactions

  1. Create a context: abieos_create
  2. Use abieos_set_abi to load eosjs2/src/transaction.abi into contract 0.
  3. Use abieos_set_abi to load the contract's ABI.
  4. Use abieos_json_to_bin and abieos_get_bin_hex to convert action data to hex. Use abieos_get_type_for_action to get the action's type.
  5. Use abieos_json_to_bin and abieos_get_bin_hex to convert transaction to hex. Use contract = 0 and type = abieos_string_to_name(context, "transaction").
  6. Destroy the context: abieos_destroy

Usage note

abieos expects object attributes to be in order. It will complain about missing attributes if they are out of order.

Example data

Example action data for abieos_json_to_bin:

{
    "from": "useraaaaaaaa",
    "to": "useraaaaaaab",
    "quantity": "0.0001 SYS",
    "memo": ""
}

Example transaction data for abieos_json_to_bin:

{
    "expiration": "2018-06-27T20:33:54.000",
    "ref_block_num": 45323,
    "ref_block_prefix": 2628749070,
    "max_net_usage_words": 0,
    "max_cpu_usage_ms": 0,
    "delay_sec": 0,
    "context_free_actions": [],
    "actions": [{
        "account": "eosio.token",
        "name": "transfer",
        "authorization":[{
            "actor":"useraaaaaaaa",
            "permission":"active"
        }],
        "data":"608C31C6187315D6708C31C6187315D60100000000000000045359530000000000"
    }],
    "transaction_extensions":[]
}

Building & Testing

mkdir build
cd build
cmake ..
make
ctest

License

MIT

S
Description
No description provided
Readme MIT 1.1 MiB
Languages
C++ 90.1%
TypeScript 6.4%
C 1.4%
CMake 1.3%
Shell 0.7%
Other 0.1%