The given transaction is not valid due to: unable to serialize parameters: Parse error

Following is my code, I’ve cloned piggy bank frontend repo and unable to send ccd from frontend but its working from concordium-clint cli

    console.log(new CcdAmount(BigInt('1')), contract.name);
    return {
        amount: new CcdAmount(BigInt(1)),
        address: {
            index: BigInt('4836'),
            subindex: BigInt('0'),
        },
        receiveName: `ves-contract.vest`,
        maxContractExecutionEnergy: MAX_CONTRACT_EXECUTION_ENERGY,
    };
}

export async function submitDeposit(connection: WalletConnection, amount: CcdAmount, account: string, contract: Info) {
    return connection.signAndSendTransaction(
        account,
        AccountTransactionType.Update,
        contractUpdatePayload(amount, contract, 'insert'),
        {},
        ''
    );
}
function contractUpdatePayload(amount: CcdAmount, contract: Info, method: string) {
    console.log(new CcdAmount(BigInt('1')), contract.name);
    return {
        amount: new CcdAmount(BigInt(1)),
        address: {
            index: BigInt('4836'),
            subindex: BigInt('0'),
        },
        receiveName: `ves-contract.vest`,
        maxContractExecutionEnergy: MAX_CONTRACT_EXECUTION_ENERGY,
    };
}

export async function submitDeposit(connection: WalletConnection, amount: CcdAmount, account: string, contract: Info) {
    return connection.signAndSendTransaction(
        account,
        AccountTransactionType.Update,
        contractUpdatePayload(amount, contract, 'insert'),
        {},
        ''
    );
}```

There is a bug fixed in this PR Stop sending incorrect parameters for deposit/smash updates by shjortConcordium · Pull Request #8 · Concordium/concordium-dapp-piggybank · GitHub

There was a bug in one of the component libraries which sent incorrect parameters when no parameters were needed.

I’ve installed new version of web-sdk and still same error

When I provide RAW_SCHEMA it says JSON string required when I remove RAW_SCHEMA it says parsing error.

function contractUpdatePayload(amount: CcdAmount, contract: Info, method: string) {
    return {
        amount,
        address: {
            index: contract.index,
            subindex: BigInt(0),
        },
        receiveName: `${contract.name}.${method}`,
        maxContractExecutionEnergy: MAX_CONTRACT_EXECUTION_ENERGY,
    };
}

export async function submitDeposit(connection: WalletConnection, amount: CcdAmount, account: string, contract: Info) {
    const buff = toBuffer(RAW_SCHEMA_W, 'base64');
    // const seerial = serializeTypeValue(params, buff);
    // console.log(JSON.stringify(RAW_SCHEMA));
    // const sch = JSON.stringify(RAW_SCHEMA);
    // const param = JSON.stringify(account);
    const param = { User: '3v6SAaexxQ4zwi5AwAncD4yTLtMSXuB9PC7v4dEwu5arMuRRsW' };
    return connection.signAndSendTransaction(
        account,
        AccountTransactionType.Update,
        contractUpdatePayload(amount, contract, 'vest'),
        { params },
        RAW_SCHEMA_W
    );
}```

Would you mind providing a complete example?

You can also give me access to a github repository if you want. I can have a look there.

That’ll be more efficient to debug.