I'm getting below error when executing push transaction:
{
"code": 500,
"message": "Internal Service Error",
"error": {
"code": 3050003,
"name": "eosio_assert_message_exception",
"what": "eosio_assert_message assertion failure",
"details": [
{
"message": "assertion failure with message: read",
"file": "wasm_interface.cpp",
"line_number": 928,
"method": "eosio_assert"
},
{
"message": "",
"file": "apply_context.cpp",
"line_number": 53,
"method": "exec_one"
}
]
}
}
This is my request payload to sign transaction:
[
{
"expiration": "2018-06-10T11:30:00",
"ref_block_num": 10580,
"ref_block_prefix": 3966243334,
"max_net_usage_words": 200,
"max_cpu_usage_ms": 100,
"delay_sec": 0,
"compression": "none",
"context_free_actions": [],
"actions": [
{
"code": "currency",
"account": "eosio.token",
"name": "transfer",
"authorization": [
{
"actor": "eosio",
"permission": "active"
}
],
"data": "227b2266726f6d223a22656f73696f2e746f6b656e222c22746f223a22616e696b6574222c227175616e74697479223a2232302e3030303020454f53222c226d656d6f223a22454f53616e696b6574227d22"
}
],
"transaction_extensions": [],
"signatures": [],
"context_free_data": []
},
[
"EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
],
"706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477"
]
This is my request payload for push transaction:
{
"signatures": [
"SIG_K1_K62FwQovHpRM3grkAreHxkFDBXoUy9pi2FELC4EwCJLwVEjJLY6QtyTcrfintATbMVxXmXQUqaA7wrRMXdSZ6MiwGhPLNw"
],
"compression": "none",
"context_free_data": [],
"transaction": {
"expiration": "2018-06-10T11:30:00",
"ref_block_num": 10580,
"ref_block_prefix": 3966243334,
"max_net_usage_words": 200,
"max_cpu_usage_ms": 100,
"delay_sec": 0,
"context_free_actions": [],
"actions": [
{
"account": "eosio.token",
"name": "transfer",
"authorization": [
{
"actor": "eosio",
"permission": "active"
}
],
"data": "227b2266726f6d223a22656f73696f2e746f6b656e222c22746f223a22616e696b6574222c227175616e74697479223a2232302e3030303020454f53222c226d656d6f223a22454f53616e696b6574227d22"
}
]
}
}
Can someone please tell me what am I missing here?
I have one more question. Can I not send json as data in transaction? for example, I need to send this below json
{
"from": "sender_account",
"to": "receiver_account",
"quantity": "100.0000 EOS",
"memo": "123456"
}
When I try to sign transaction using above json, it gives me cast error(something like can not cast object type to string).
How do I send this json as data in transaction?
Sorted
@aniketdivekar - Curious as to how you fixed this? Having the same issue.
Same error, how do you solve it ? please help?
cri cri
I believe is the decimals, you have to add them
@cindyssun5 @fundurian This is the flow which worked for me.
{ "from": "sender_account", "to": "receiver_account", "quantity": "100.0000 EOS", "memo": "123456"} to binary using /v1/chain/abi_json_to_bin/v1/wallet/sign_transaction. For this you might need latest chain_info(for chain_id) and block(for ref_block and ref_block_prefix) post_body = [
{
expiration: expiration,
ref_block_num: ref_block_num,
ref_block_prefix: ref_block_prefix,
max_net_usage_words: 200,
max_cpu_usage_ms: 100,
delay_sec: 0,
compression: 'none',
context_free_actions: [],
actions: [
{
code: 'eosio.token',
account: 'eosio.token',
name: 'transfer',
authorization: [
{
actor: "account_name",
permission: 'active'
}
],
data: data
}
],
signatures: []
},
[
public_key
], chain['chain_id']
].to_json
/v1/chain/push_transactionsigned_tx is response of step 3 then,
post_body = post_body = {
signatures: signed_tx['signatures'],
compression: 'none',
context_free_data: [],
transaction: signed_tx
}.to_json
Hope this helps!
Most helpful comment
@cindyssun5 @fundurian This is the flow which worked for me.
{ "from": "sender_account", "to": "receiver_account", "quantity": "100.0000 EOS", "memo": "123456"}to binary using/v1/chain/abi_json_to_bin/v1/wallet/sign_transaction. For this you might need latest chain_info(for chain_id) and block(for ref_block and ref_block_prefix)/v1/chain/push_transactionIf
signed_txis response of step 3 then,post_body = post_body = { signatures: signed_tx['signatures'], compression: 'none', context_free_data: [], transaction: signed_tx }.to_jsonYou should receive transaction id in the response if everything goes well
Hope this helps!