consenlabs / token-core-ios

a blockchain private key management library on iOS
Apache License 2.0
879 stars 229 forks source link

What is the data(Hex tx data) of EOSTransaction? #76

Closed Shinolr closed 2 years ago

Shinolr commented 5 years ago

I'v tried to create an instance of EOSTransaction, and used init(data: String, publicKeys: [String], chainID: String), i used abi_json_to_bin to get a packaged_trx and as param data. with it and signed, i push_transaction but got an error like following:

{
    "code": 500,
    "message": "Internal Service Error",
    "error": {
        "code": 3010010,
        "name": "packed_transaction_type_exception",
        "what": "Invalid packed transaction",
        "details": [
            {
                "message": "Invalid packed transaction",
                "file": "chain_plugin.cpp",
                "line_number": 1560,
                "method": "push_transaction"
            },
            {
                "message": "read datastream of length 41 over by -5",
                "file": "datastream.cpp",
                "line_number": 6,
                "method": "throw_datastream_range_error"
            },
            {
                "message": "error unpacking uint64_t",
                "file": "raw.hpp",
                "line_number": 648,
                "method": "unpack"
            },
            {
                "message": "Error unpacking field value",
                "file": "raw.hpp",
                "line_number": 368,
                "method": "operator()"
            },
            {
                "message": "error unpacking eosio::chain::name",
                "file": "raw.hpp",
                "line_number": 648,
                "method": "unpack"
            },
            {
                "message": "Error unpacking field actor",
                "file": "raw.hpp",
                "line_number": 368,
                "method": "operator()"
            },
            {
                "message": "error unpacking eosio::chain::permission_level",
                "file": "raw.hpp",
                "line_number": 648,
                "method": "unpack"
            },
            {
                "message": "Error unpacking field authorization",
                "file": "raw.hpp",
                "line_number": 368,
                "method": "operator()"
            },
            {
                "message": "error unpacking eosio::chain::action",
                "file": "raw.hpp",
                "line_number": 648,
                "method": "unpack"
            },
            {
                "message": "Error unpacking field context_free_actions",
                "file": "raw.hpp",
                "line_number": 368,
                "method": "operator()"
            }
        ]
    }
}

what should i do to fix my problem