Skip to content

Transaction file format (JSON)

Aaron Cox edited this page Jul 18, 2018 · 3 revisions

Below is the JSON format which eos-voter will export/import transactions in.

  • These are generated when an unsigned transaction is created by a watch wallet.
  • These can be loaded and signed with either a hot or cold wallet.
  • These can be loaded and broadcast with either a hot or watch wallet.

Object Structure

The object itself contains two elements:

  • contract: The ABI and account_name, both which are returned as the results of the EOSJS eos.getAbi(account_name) method.
  • transaction: The transaction response from EOSJS after issuing a transaction with { sign: false }.
{
  "contract": {
    "account_name": "contract_account",
    "abi": {
      "version": "eosio::abi/1.0",
      "types": [ ... ],
      "structs": [ ... ],
      "actions": [ ... ],
      "tables": [ ... ],
      "ricardian_clauses": [],
      "error_messages": [],
      "abi_extensions": []
    }
  },
  "transaction": {
    "transaction_id": "0123456789ABCDEF",
    "broadcast": false,
    "transaction": {
      "compression": "none",
      "transaction": {
        "expiration": "2018-01-01T23:59:59",
        "ref_block_num": 58702,
        "ref_block_prefix": 1127469905,
        "net_usage_words": 0,
        "max_cpu_usage_ms": 0,
        "delay_sec": 0,
        "context_free_actions": [],
        "actions": [
          {
            "account": "contract_account",
            "name": "transfer",
            "authorization": [
              {
                "actor": "user_account",
                "permission": "active"
              }
            ],
            "data": {
              "from": "user_account",
              "to": "another_account",
              "quantity": "0.001 TOKEN",
              "memo": ""
            }
          }
        ],
        "transaction_extensions": []
      },
      "signatures": [ ... ]
    }
  }
}
Clone this wiki locally