Getting Started




Development Guides


Version Guides


Implement Transaction Builder

Builder class handles versioning, serde process, milestones, dynamic-fee logic and all cryptography related items (sign, multisign, second-sign, sign with and without WIF, sequential nonce logic). The following code-snippet shows the actual implementation of the Builder class for the BusinessRegistration Transaction.

Builder is something you will reuse in your client applications for creating new transaction payloads.

import { Interfaces, Transactions, Utils } from "@arkecosystem/crypto";
import { BusinessRegistrationTransaction } from "../transactions";

export class BusinessRegistrationBuilder extends Transactions.TransactionBuilder<BusinessRegistrationBuilder> {
    constructor() {
        super(); = BusinessRegistrationTransaction.type; = BusinessRegistrationTransaction.typeGroup; = 2; = Utils.BigNumber.make("5000000000"); = Utils.BigNumber.ZERO; = { businessData: {} };

    public businessData(name: string, website: string): BusinessRegistrationBuilder { = {

        return this;

    public getStruct(): Interfaces.ITransactionData {
        const struct: Interfaces.ITransactionData = super.getStruct();
        struct.amount =;
        struct.asset =;
        return struct;

    protected instance(): BusinessRegistrationBuilder {
        return this;

Now that we have implemented our builder class, we can use it to build new custom transaction payloads. The code snippet below shows us how to use the TransactionBuilder to create signed and serialized transaction payloads.

When using Transaction Builder on the client side (your mobile/web app) make sure to register your TransactionType inside the @arkecosystem/crypto package with the following code:


Check the code-snippet below, line 8.

import { Transactions } from "@arkecosystem/crypto";
import { BusinessRegistrationBuilder } from "../src/builders"; // adapt to your directory structure
import { BusinessRegistrationTransaction } from "../src/transactions"; // adapt to your directory structure

// Register your custom transaction (do it only once) to the crypto library,
// This is important when using builder on the client side.


const builder = new BusinessRegistrationBuilder();
const actual = builder
    .sign("clay harbor enemy utility margin pretty hub comic piece aerobic umbrella acquire");

Next step is to implement transaction handlers that enforce blockchain protocol validation and verification steps.

2021 © | All rights reserved An Product