Skip to content

Adapt serialization using the new buffers #47

@dgarcia360

Description

@dgarcia360

From Medium, transactions that are sent to the NEM2 REST gateway are serialized earlier in the SDK. Until now, the serialization was done by the flatbuffer library (Google). This library will be replaced by a custom library called catbuffer.

1. Generating the buffer classes

Install the catbuffer tool and compile the schema for javascript https://github.com/nemtech/catbuffer#parse-an-schema-and-generate-transaction-builders

Move the generated files to your model/transaction SDK folder.

2. Adapt the Schema class

This class is used to generate SDK schemas.

3. Adapt the transaction schemas

This folder contains the transaction schemas.

4. Using the schemas in the Transaction Models

Each Transaction has to implement build method using the buffers and the schemas.

ℹ️ This text was adapted from https://nemtech.github.io/sdk/development.html, where flatbuffers where used. Evaluate if this process has to be changed when working with catbuffers for the first time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions