Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V13 cookbook - new section: explicit decoding / encoding of values. #861

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

andreibancioiu
Copy link
Contributor

Description of the pull request (what is new / what has changed)

Did you test the changes locally ?

  • yes
  • no

Which category (categories) does this pull request belong to?

  • document new feature
  • update documentation that is not relevant anymore
  • add examples or more information about a component
  • fix grammar issues
  • other

@andreibancioiu andreibancioiu changed the base branch from main to development April 4, 2024 11:09
@andreibancioiu andreibancioiu marked this pull request as ready for review April 4, 2024 11:12
@andreibancioiu andreibancioiu self-assigned this Apr 4, 2024
@popenta popenta self-requested a review April 4, 2024 11:20
```
import { BinaryCodec } from "@multiversx/sdk-core";

const depositCustomType = abi.getCustomType("DepositEvent");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also instantiate the abi object here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Example of decoding a custom type (an enum) called `Action` (of [**multisig**](https://github.com/multiversx/mx-contracts-rs/tree/main/contracts/multisig) contract) from binary data:

```
const actionStructType = abiMultisig.getEnum("Action");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also instantiate abiMultisig here as well. can be instantiated here, as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@andreibancioiu andreibancioiu merged commit 1095aee into development Apr 4, 2024
2 checks passed
@andreibancioiu andreibancioiu deleted the v13-codec branch April 4, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants