baking-bad/tzkt

Function call args types

Closed this issue · 1 comments

jpic commented

Hi!

Can tzkt use convert args types?

Currently:

{
    "parameter": {
        "entrypoint": "mint",
        "value": {
            "_to": "tz1Yigc57GHQixFwDEVzj5N1znSCU3aq15td",
            "value": "11"
        }
    },
}

But with parameters of:

    "parameters": {
        "entrypoint": "mint",
        "value": {
            "prim": "Pair",
            "args": [
                {
                    "string": "tz1Yigc57GHQixFwDEVzj5N1znSCU3aq15td"
                },
                {
                    "int": "22"
                }
            ]
        }
    },

Shouldn't it has value as a JSON int like this?

{
    "parameter": {
        "entrypoint": "mint",
        "value": {
            "_to": "tz1Yigc57GHQixFwDEVzj5N1znSCU3aq15td",
            "value": 11
        }
    },
}

Hi! Michelson's int (as well as nat) is actually arbitrary-precision, so it's better to serialize it as a string, because otherwise it will break most JSON (de)serializers, in case of values above 2^64.