@instadapp/transaction-builder
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

@instadapp/transaction-builder

npm version npm downloads bundle Codecov License JSDocs

This is my package description.

Usage

Install package:

# npm
npm install @instadapp/transaction-builder

# yarn
yarn add @instadapp/transaction-builder

# pnpm
pnpm install @instadapp/transaction-builder

Import:

// ESM
import { TransactionBuilder } from "@instadapp/transaction-builder";

// CommonJS
const { TransactionBuilder } = require("@instadapp/transaction-builder");

Usage:

const builder = TransactionBuilder.create([
    "function baz() external pure returns (uint256)",
    "function execute(address _target, bytes _data) external payable returns (bytes32)",
]);

builder.getReadMethods(); // ["baz()"]
builder.getWriteMethods(); // ["execute(address,bytes)"]
builder.getMethodInputs("execute(address,bytes)"); // [{ name: "_target", type: "address" }, { name: "_data", type: "bytes" },]
builder.validateMethodInput("execute(address,bytes)", "_target", "0x420");
builder.build("execute(address,bytes)", ["0x420", "0x69"]);

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛

Published under MIT License.

Dependents (0)

Package Sidebar

Install

npm i @instadapp/transaction-builder

Weekly Downloads

33

Version

0.0.12

License

MIT

Unpacked Size

10.1 kB

Total Files

8

Last publish

Collaborators

  • kabbouchi
  • ishan_instadapp
  • sowmayjn
  • thrilokkumar