Asset units

+2 votes
I have issued an asset like the following

Note : I am using "Savoir" python wrapper, and initialized the connection

assetname = 'asset2', assetquantity = 1000, assetunit = 1

asset = api.issue(assetaddress,assetname,assetquantity,assetunit)

 now the question is when i am doing the exchange operation, when i am doing preparelockunspent in the node1 like the following

api.preparelockunspent({"asset2":1})

i am getting an error  {u'id': 2, u'result': None, u'error': {u'message': u'Insufficient funds', u'code': -4}}

can you please tell me why the message insufficient funds, and how can i initialize the units ?
asked Dec 21, 2016 by Rajeev

1 Answer

+1 vote

Does an address belonging to the node actually have sufficient quantity of the assets to offer the exchange? Maybe the issuance transaction sent them to an address not belonging to the node. You can check using:

getmultibalances * asset2 0 false false

answered Dec 21, 2016 by MultiChain
->asset details in node 1
{
        "name" : "asset1",
        "assetref" : "5911-266-63711",
        "qty" : 10.00000000
    }
-> asset details in node2
 {
        "name" : "asset2",
        "assetref" : "5916-266-57818",
        "qty" : 100.00000000
    }
i want to just do the exchange of 1 unit of asset1 to 10 units of asset2. i have executed the command you have given like this
 "multichain-cli chainname getmultibalances * asset2 0 false false" but getting the JSON error.
You need to call preparelockunspent with the quantity of the asset which the node already has, not with the quantity it's looking for.
Just need one clarification, I have created asset1 in node1 and asset2 in node2,so  can i do the exchange for some units of asset1 in node1 to some units of asset2 in node 2 ?
It's not important where you created the asset - it's under which address the asset is currently owned. When you can create an asset on one node, you can send it to an address belonging to that node, or belonging to another node.
Thank you multichain Team, The mistake i was doing,while doing preparelockunspent instead of using my asset quantity i was giving another node's asset quantity(asset im looking for exchange). now i got to know.
...