Concordium Web SDK Version Changes

Concordium Web SDK Version Changes

Hi Community,

We have just started using the updated concordium web sdk package i.e. “@concordium/web-sdk” to its LTS.

We noticed some changes in the methods and available types. Please find the screenshot attached.

Can anyone in the community let us know if there is any version change history and related documents so it’ll be easier to clear any version change errors.

I assume you are using version 7 now.

The list of changes is listed in the release on github Release web-sdk v7.0.0 · Concordium/concordium-node-sdk-js · GitHub

I expect this is the change that is affecting you in the screenshot

ContractAddresss is now a module with functions related to contract addresses:

    To refer to ContractAddress as a type use ContractAddress.Type.
    To construct the type use ContractAddress.create(index, subindex).

In the "parseContractAddress" function, earlier the parameter "outcome" was actually of type Record<string, TransactionSummary>, so the res.result.outcome gives the valid results. But in the LTS, the parameter type is Record<string, TransactionSummaryType>, so the res.result.outcome is not valid.

Let us know if there is a way to correct it.

Where are you getting this record

Record<string, TransactionSummaryType>

That does not have the information you need to extract contract addresses.

If you are querying block item status then you’d get out a list of BlockItemSummaryInBlock.

You can then iterate over that and use a predicate like isInitContractSummary to help extracting events.

Additionally I’d recommend to use a helper waitForTransactionFinalization to wait for transaction finalization if that is where you are attempting to parse events from.