1

I'm trying to get the bin data for a multi action transaction similar to account creation but the RPC abi_json_to_bin doesn't seem to accept a list of json payloads. Is there a keyword/struct I should be passing to avoid the error?

The below code gives me the following error

{'code': 500, 'message': 'Internal Service Error', 'error': {'code': 7, 'name': 'bad_cast_exception', 'what': 'Bad Cast', 'details': [{'message': "Invalid cast from type 'array_type' to Object", 'file': 'variant.cpp', 'line_number': 573, 'method': 'get_object'}]}}

payload = [
        {
            "args": {
                "payer": creator,
                "receiver": new_acc_name,
                "bytes": 4096
            },
            "code": "eosio",
            "action": "buyrambytes",
            "authorization": [
                {
                    "actor": creator,
                    "permission": "active"
                }
            ],
        },
        {
            "args": {
                "from": creator,
                "receiver": new_acc_name,
                "stake_net_quantity": "0.1000 EOS",
                "stake_cpu_quantity": "0.1000 EOS",
                "transfer": 1
            },
            "code": "eosio",
            "action": "delegatebw",
            "authorization": [
                {
                    "actor": creator,
                    "permission": "active"
                }
            ],
        }
    ]
1

Answering my own question,

The bin data should be generated for each individual json in payload and appended in the actions field as a list.

The transaction will then be signed, packed and pushed.

| improve this answer | |

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.