0

I have some problems trying to transfer EOS in push_transaction. I followed the instructions from https://steemit.com/eos/@noprom/using-eos-rpc-api-to-transfer-eos and other references because the documentation was outdated.

Here is the detail for my push_transaction :

http://127.0.0.1:8888/v1/chain/push_transaction

{  
   "compression":"none",
   "signatures":[  
      "SIG_K1_Ki1Q8SAiZnBWhjkMQM5gmaBhigGrFdVvgrKfpSue75NbR6Er2hinxWapbbE94YCnyPRcqUZizjjFao1oNyHGJUYFR4MeEF"
   ],
   "transaction":{  
      "actions":{  
         "account":"idxtester121",
         "name":"transfer",
         "authorization":{  
            "actor":"idxtester121",
            "permission":"active"
         },
         "data":"1044b82a63957b729015d266a9c8a67ef04902000000000004454f5300000000087465737473656e64"
      },
      "delay_sec":0,
      "expiration":"2019-01-16T07:31:47",
      "max_kcpu_usage":0,
      "max_net_usage_words":0,
      "ref_block_num":21690,
      "ref_block_prefix":2522481250,
      "region":0
   }
}

Below is the response :

object(stdClass)#31 (3) {
  ["code"]=>
  int(500)
  ["message"]=>
  string(22) "Internal Service Error"
  ["error"]=>
  object(stdClass)#32 (4) {
    ["code"]=>
    int(3010010)
    ["name"]=>
    string(33) "packed_transaction_type_exception"
    ["what"]=>
    string(26) "Invalid packed transaction"
    ["details"]=>
    array(3) {
      [0]=>
      object(stdClass)#33 (4) {
        ["message"]=>
        string(26) "Invalid packed transaction"
        ["file"]=>
        string(16) "chain_plugin.cpp"
        ["line_number"]=>
        int(1560)
        ["method"]=>
        string(16) "push_transaction"
      }
      [1]=>
      object(stdClass)#34 (4) {
        ["message"]=>
        string(38) "Invalid cast from object_type to Array"
        ["file"]=>
        string(11) "variant.cpp"
        ["line_number"]=>
        int(545)
        ["method"]=>
        string(9) "get_array"
      }
      [2]=>
      object(stdClass)#35 (4) {
        ["message"]=>
        string(29) "Failed to deserialize variant"
        ["file"]=>
        string(18) "abi_serializer.hpp"
        ["line_number"]=>
        int(689)
        ["method"]=>
        string(12) "from_variant"
      }
    }
  }
}

From the error response, I think I missed some parameters. What are the updated parameters for push_transaction?

1 Answer 1

0

I think the data format is incorrect to unserialize.

You can use cleos --return-packed or -j to get the packed or jason result.

eg:

$ cleos -u http://jungle2.cryptolions.io:80 transfer -d -j eostemptest1 eostest11111 "1.0 EOS"

{
  "expiration": "2019-01-16T11:21:13",
  "ref_block_num": 47231,
  "ref_block_prefix": 1376288694,
  "max_net_usage_words": 0,
  "max_cpu_usage_ms": 0,
  "delay_sec": 0,
  "context_free_actions": [],
  "actions": [{
      "account": "eosio.token",
      "name": "transfer",
      "authorization": [{
          "actor": "eostemptest1",
          "permission": "active"
        }
      ],
      "data": "103256b94a9531551042082163953155102700000000000004454f530000000000"
    }
  ],
  "transaction_extensions": [],
  "signatures": [
    "SIG_K1_KhjtLbSsQoVHBXG4BM7MWEkXtDvKmjVZqH5EBszcKdWZmMVkXDpbST2CSds5BQJtKk7orLfapFU5rwED4F3RCah8s1jjML"
  ],
  "context_free_data": []
}

$ cleos -u http://jungle2.cryptolions.io:80 transfer -d --return-packed eostemptest1 eostest11111 "1.0 EOS"

{
  "signatures": [
    "SIG_K1_KdUUch7YDKeF37Gpioi5ZBQEECmcaBzUvDv7TNCDV5xmqHZte9UYZnF5hbyMA7UjobNcN5zdC8EQ1yZXrybsGfx3JN9zsz"
  ],
  "compression": "none",
  "packed_context_free_data": "",
  "packed_trx": "b8133f5c97b8ef8d42ab000000000100a6823403ea3055000000572d3ccdcd01103256b94a95315500000000a8ed323221103256b94a9531551042082163953155102700000000000004454f53000000000000"
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.