Error to send transaction

When I send transaction I got error related to Serialize BigInt

I am creating dApp connected to browser wallet.
this is the function

export async function createChallenge(session, sender, client, challenge) {
    const method = methods.addChallenge;
    const amount = ccdToMicroCcd(challenge.amount);
    const payload = {
        "challenge_id": challenge._id,
        "challenge": {
            "opponents": {
                "None": []
            "challenger": sender,
            "expiration": ISODateString(new Date(challenge.startDate)),
            "is_public": true,
            "max_opponents": {
                "Some": [Number(challenge.maxPlayersInPublicChallenge)]
    const txHash = await client.sendTransaction(
            amount: new CcdAmount(amount),
            address: { index: CONTRACT_INDEX, subindex: BigInt(0) },
            receiveName: method,
            maxContractExecutionEnergy: MAX_CONTRACT_EXECUTION_ENERGY
        RAW_SCHEMA_BASE64, // SCHEMA_JSON.entrypoints.add_challenge.parameter,
    return txHash;

Hello osmany

We will get back to you soon as possible.

Concordium Tech Support

Hi osmany,
Is the content_script.js line 190 from the code example you posted above? Can you please point out where the 190 line is.

The “payload” variable aka. the message to the contract instance should not contain bigints.
It should follow the JSON representation.
And I assume that the amount you get out of ccdToMicroCcd is a bigint.

1 Like