@instadapp/transaction-builder
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.