Multiple contract with different types error

Hello everyone, I am trying to build a multicontract in web and it gives me an error "Gt: Multiple contracts of different types are not supported yet”, but it works on kleverscan, hence I’m assuming I am doing something wrong. Can someone pinpoint me to what can be a problem?

My payload is identical as I did in kleverscan, tried on sdk versions 1.2.2 and 1.4.1

1 Like

const arrMultipleTransaction = assetsPayload.map(asset => ({
    payload: {
      currencyId: asset.currencyId,
      amount: asset.amount,
      kda,
      depositType: 0
    },
    type: 23
  }));

  arrMultipleTransaction.push({
    payload: {
      amount: 10000000,
      kda: "KLV",
      receiver: "****"
    },
    type: 0,
  }) // for example I’ve added transfer transaction, it gives me an error, but same payload would work on kleverscan

// …
    const unsignedTx = await web.buildTransaction(arrMultipleTransaction, [metadata], {kdaFee});

    const signedTx = await web.signTransaction(unsignedTx);

    response = await web.broadcastTransactions([signedTx]);

the @Blockchain team will come back to you soon

2 Likes

Hello @Sovkosov_Ignat !

Thank you for reaching out and sharing your issue with us — we truly appreciate your feedback and the detailed explanation of your implementation.

After reviewing your situation internally, we identified the cause of the error. Currently, the Klever SDK doesn’t support multiple contracts of different types in a single transaction. The error message you’re seeing comes directly from the SDK, which verifies the contract types and prevents combining different ones.

If you need to handle multiple contracts, the current workaround would be to split them into separate transactions, each containing only one type of contract, and broadcast them individually. However, we understand that this may not be the most convenient approach for your use case.

The good news is that we’ve already decided to address this limitation! Our team is working on implementing support for multiple contract types in a single transaction by SDK, and we’ll notify you as soon as this feature is released.

We appreciate your patience and your contribution to improving the Klever ecosystem. Let us know if you have any questions or if there’s anything else we can do to help in the meantime!

1 Like

Yo @Sovkosov_Ignat sorry for delay on reply.

So, we’ve implemented the multicontract build feature on web. Could u test again and circle back to us?

TY

4 Likes