Asset Unit Issue

+1 vote
I tried to issue an asset with 0.001 smallest unit and when I tried to transfer part of it to another address, the sender lost all of it and the receiver also didn't receive any amount as per below:

>>> client.issue(sender, {"name":'coin',"open":True}, 100, 0.001)
'b1c750b01e07b2830857ca0869609172a3c2af5d210c9203bbccbe9793524851'
>>> client.listassets()
[{'multiple': 1, 'name': 'usd', 'subscribed': True, 'issueraw': 100, 'transactions': 2, 'open': True, 'assetref': '49-266-4701', 'units': Decimal('1.00000000'), 'issuetxid': '5d1288bd2cd81f2e922dac0ad43cd596c36958a040802a0562a00baeb1b99cbd', 'confirmed': 2, 'details': {}, 'issueqty': Decimal('100.00000000'), 'synchronized': True}, {'multiple': 1000, 'name': 'coin', 'subscribed': False, 'issueraw': 100000, 'issueqty': Decimal('100.00000000'), 'details': {}, 'open': True, 'assetref': None, 'units': Decimal('0.00100000'), 'issuetxid': 'b1c750b01e07b2830857ca0869609172a3c2af5d210c9203bbccbe9793524851'}]
>>> client.subscribe('coin')
>>> client.listassets()
[{'multiple': 1, 'name': 'usd', 'subscribed': True, 'issueraw': 100, 'transactions': 2, 'open': True, 'assetref': '49-266-4701', 'units': Decimal('1.00000000'), 'issuetxid': '5d1288bd2cd81f2e922dac0ad43cd596c36958a040802a0562a00baeb1b99cbd', 'confirmed': 2, 'details': {}, 'issueqty': Decimal('100.00000000'), 'synchronized': True}, {'multiple': 1000, 'name': 'coin', 'subscribed': True, 'issueraw': 100000, 'transactions': 1, 'open': True, 'assetref': '82-265-51121', 'units': Decimal('0.00100000'), 'issuetxid': 'b1c750b01e07b2830857ca0869609172a3c2af5d210c9203bbccbe9793524851', 'confirmed': 1, 'details': {}, 'issueqty': Decimal('100.00000000'), 'synchronized': True}]
>>> client.getaddressbalances(recv)
[]
>>> client.getaddressbalances(sender)
[{'qty': Decimal('99.00000000'), 'name': 'usd', 'assetref': '49-266-4701'}, {'qty': Decimal('100.00000000'), 'name': 'coin', 'assetref': '82-265-51121'}]

>>> unsigned_tx = client.createrawsendfrom(sender, {recv: {'coin': 1}})
>>> signed_tx = client.signrawtransaction(unsigned_tx, [], [privKey])

>>> client.sendrawtransaction(signed_tx['hex'])
'ccff914658d22df42e0670efefd7c060f503eb25950fb7a6ba3a0aac3df61699'
>>> client.getaddressbalances(sender)
[{'qty': Decimal('99.00000000'), 'name': 'usd', 'assetref': '49-266-4701'}]
>>> client.getaddressbalances(recv)
[]
>>> client.getaddresstransaction(sender, 'ccff914658d22df42e0670efefd7c060f503eb25950fb7a6ba3a0aac3df61699')
{'txid': 'ccff914658d22df42e0670efefd7c060f503eb25950fb7a6ba3a0aac3df61699', 'data': [], 'blockhash': '00f2dc469d724df30d2d6ccae0f985c597afd5ec6d6b9e281c016e5f605e700e', 'permissions': [], 'blocktime': 1585239994, 'myaddresses': ['1JQhqDyovkEz4DNe7W23dy2otpJFcxFJof'], 'time': 1585239978, 'valid': True, 'items': [], 'blockindex': 1, 'addresses': ['1FpVFMAnkWeEFwRtCQTaXZ4ewymJEH1peR'], 'timereceived': 1585239978, 'balance': {'assets': [{'qty': Decimal('-1.00000000'), 'name': 'coin', 'assetref': '82-265-51121'}], 'amount': Decimal('0E-8')}, 'confirmations': 11}
asked Mar 26, 2020 by mina

1 Answer

0 votes

The most likely issue is that the receiving address is not being tracked by this node's wallet. Try using importaddress to change that. Note also that you should pass a value of 0 in the minconf parameter of the getaddressbalances API if you want to see the incoming funds immediately, before the transaction is confirmed on the blockchain.

answered Mar 26, 2020 by MultiChain
...