SendAssetFrom gives me error. Issue transaction with this name not found [closed]

+2 votes

Hi, I am in multichain interactive mode. in it i tried to send 100 units of asset3 from addressA to addressB as follows:

sendassetfrom addressA addressB asset3 100

However I get this message:

{"method":"sendassetfrom","params":["addressA","addressB","asset3",100],"id":1,"chain_name":"chain1"}

error code: -8
error message:
Issue transaction with this name not found: asset3

(addressA and addressB have been changed for readability, the original is some hex string)

When I try it with the issue transaction id, it works fine:

sendassetfrom addressA addressB 5203-267-4721 100

Returns me:

{"method":"sendassetfrom","params":["addressA","addressB","5203-267-4721",100],"id":1,"chain_name":"chain1"}

a24840702495dbb279690e690743ac43e163bd8f1c3d124767cec69409b6f85c

so is there any way I can send an asset using its name instead of needing to find out a transaction that has some of the asset left over?

closed with the note: Figured it out. Thanks
asked Jun 6, 2016 by M
closed Jun 9, 2016

1 Answer

0 votes

First, to clarify, in sendassetfrom you don't need to enter a transaction which has some of the asset left over. You just need to refer to the asset in one of three ways – its name, asset ref or issuance txid.

I'm not sure why it's not accepting the value asset3, and the most likely explanation is that the name is something else, perhaps using a surprising character. Do you want to post the output from listassets so we can check?

answered Jun 7, 2016 by MultiChain
I can reproduce the same behavior.

This is the result of listassets:

{"method":"listassets","params":[],"id":1,"chain_name":"otcxn"}

[
    {
        "name" : "{\"name\":\"testAsset\",\"open\":true}",
        "issuetxid" : "cdb0fa9ccc18d5f0280e82f58f1723710a368b4a3c3979b2789d2cefea798c99",
        "assetref" : "3609-266-45261",
        "multiple" : 1,
        "units" : 1.00000000,
        "open" : false,
        "details" : {
        },
        "issueqty" : 1000000.00000000,
        "issueraw" : 1000000
    },
    {
        "name" : "{\"name\":\"testAsset1\"}",
        "issuetxid" : "bc97eb6cec3e66de89203d36c84edc02387c82e3f9e85b4c9e30380851593cea",
        "assetref" : "3777-266-38844",
        "multiple" : 1,
        "units" : 1.00000000,
        "open" : false,
        "details" : {
        },
        "issueqty" : 1000000.00000000,
        "issueraw" : 1000000
    }
]


And if I try to use the sendassetfrom method the result is:

{"method":"sendassetfrom",
"params":[
"1Mbexmszf71suCjUkDQGwkXbYK62BRGVGSLKyo",
"1K4dpuSQrY3xV6WFxuWRSNc2j6bfXBUGUwYFd5",
"testAsset1",
10],
"id":1,
"chain_name":"otcxn"}

error code: -8
error message:
Issue transaction with this name not found: testAsset1
I saw you figured it out, but for the sake of others, the problem was how you provided the name and open parameter in the original issuance - as a JSON string inside JSON, instead of a JSON object.
...