This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CU-864dtwgww - Add a way to give hints when parsing #1
CU-864dtwgww - Add a way to give hints when parsing #1
Changes from all commits
cf55b3c
e087320
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
Neo3-parser - A declarative SmartContract Parsing Spec.
Made with ❤ by COZ.IO
Neo3-parser
Neo3-parser is a specification of how SmartContract client SDKs can interact with different parsing libraries such as Neon-JS.
Visit the main page of the project.
How to parse responses
After invoking a contract you'll get the results on a stack. Use the
parseRpcResponse(field: RpcResponse, parseConfig?: ParseConfig)
function on each result of the stack to get the results parsed.How to use parseConfig
The
parseConfig
object has the following properties:type
is"Array"
type
is"Map"
type
is"Map"
type
is"Any"
and you expect to get multiple typesExample
Using neo3-boa to get the parseConfig
If you compiled your smart contract with Neo3-boa you can use the ABI inside the
.manifest.json
file as theparseConfig
.For example, compiling this smart contract will generate the following file:
Then, you can copy the properties of the method you want to parse that have the
return
prefix, in this example it should bereturntype
andreturnhint
. Remove thereturn
prefix and attribute it to aParseConfig
variable in your TypeScript file.