BitShares Forum

Main => Technical Support => Topic started by: monsterer on March 31, 2015, 06:51:46 pm

Title: wallet_asset_issue_to_addresses - anyone know the json it expects?
Post by: monsterer on March 31, 2015, 06:51:46 pm
I'm trying to use the wallet_asset_issue_to_addresses RPC call, but passing the follow parameters leads to an assert:

Code: [Select]
{\"jsonrpc\":\"2\",\"id\":1,\"method\":\"wallet_asset_issue_to_addresses\",\"params\":[\"ABCDEF\",[{\"BTSD4ZtTqHcoYDFvaAL5QwXvfN2mTkMMVbA1\":\"0.997\"}]]}

Code: [Select]
message = "Bad Cast (7)\nInvalid cast from object_type to Array\n"
Code: [Select]
detail = "7 bad_cast_exception: Bad Cast\nInvalid cast from object_type to Array\n    {\"type\":\"object_type\"}\n    th_a  variant.cpp:530 fc::variant::get_array"
Anyone know the correct form?
Title: Re: wallet_asset_issue_to_addresses - anyone know the json it expects?
Post by: vikram on March 31, 2015, 07:44:45 pm
Ask Toast--I think he made this command for NOTE distribution. It's possible that current version does not work and needs custom patch.
Title: Re: wallet_asset_issue_to_addresses - anyone know the json it expects?
Post by: monsterer on March 31, 2015, 08:04:11 pm
Ask Toast--I think he made this command for NOTE distribution. It's possible that current version does not work and needs custom patch.

Oh dear. Does that mean there may be no current way to issue an asset to an address?
Title: Re: wallet_asset_issue_to_addresses - anyone know the json it expects?
Post by: toast on April 01, 2015, 01:09:49 am
Try a list of pairs (as lists) instead of a json object. I think it should work on the latest bitshares
Title: Re: wallet_asset_issue_to_addresses - anyone know the json it expects?
Post by: monsterer on April 01, 2015, 06:59:06 am
Try a list of pairs (as lists) instead of a json object. I think it should work on the latest bitshares

That's what I was trying above:

Code: [Select]
[{\"BTSD4ZtTqHcoYDFvaAL5QwXvfN2mTkMMVbA1\":\"0.997\"}]
This is a list of pairs as an array.
Title: Re: wallet_asset_issue_to_addresses - anyone know the json it expects?
Post by: xeroc on April 01, 2015, 07:10:15 am
Try a list of pairs (as lists) instead of a json object. I think it should work on the latest bitshares

That's what I was trying above:

Code: [Select]
[{\"BTSD4ZtTqHcoYDFvaAL5QwXvfN2mTkMMVbA1\":\"0.997\"}]
This is a list of pairs as an array.
have you tried:
Code: [Select]
[
 ["BTSD4ZtTqHcoYDFvaAL5QwXvfN2mTkMMVbA1", 0.997],
 ["BTSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 100],
 ["BTSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 100]
]
Not sure if this should be called "list of tuples" :)
Title: Re: wallet_asset_issue_to_addresses - anyone know the json it expects?
Post by: monsterer on April 01, 2015, 07:32:17 am
Ahhh, you are correct xeroc, its an array of arrays this call requires, rather than an array of objects :)

Ok, this is working now, thanks!