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

feat: export methods for encoding/decoding dataSourceWithHash and valueContent #416

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

CJ42
Copy link
Collaborator

@CJ42 CJ42 commented Apr 17, 2024

What kind of change does this PR introduce (bug fix, feature, docs update, ...)?

What is the current behaviour (you can also link to an open issue here)?

Currently, there are no methods available in the ERC725 class for:

  • encoding / decoding value Content
  • encoding / decoding JSONURL or VerifiableURI

This is useful for tools like ERC725-inspect, lsp-utils, or services like indexers to easily decode data from logs / fetched from contracts, or prepare data easily without requiring a full schema.

What is the new behaviour (if this is a feature change)?

Add the following methods:

  • encodeDataSourceWithHash(...)
  • decodeDataSourceWithHash(...)
  • encodeValueContent(...)
  • decodeValueContent(...)

available to be imported individually like this:

import { encodeDataSourceWithHash } from "@erc725/erc725.js"

or from the ERC725 class (as static methods or accessible in an instance).

Other information:

@CJ42 CJ42 merged commit eed12b6 into develop Apr 18, 2024
2 checks passed
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.

2 participants