1

I'm trying to pass a map into action, but there is serialization error:

Error: expected object containing data: undefined

There is a function signature:

void init(uint64_t id, const map<uint8_t, asset>& balances);

There is tx data I pass:

data: {
    id: id,
    balances: {0: "1.0000 EOS", 1: "1.0000 TOKEN"}
}

I also tried this tx data:

data: {
    id: id,
    balances: [{0: "1.0000 EOS"}, {1: "1.0000 TOKEN"}]
}

2 Answers 2

0

balances field should look like [{'key': 1, 'value': '1.0000 EOS'}]

0

They changed the map property names (since v4.0.0 I believe).

The balances field should now look like this: [{"first": 1, "second": "1.0000 EOS"}]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.