@haechi-labs/henesis-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

henesis-sdk

SDK to build handler of Henesis

TypeScript License: MIT

import { Ethereum } from "@haechi-labs/henesis-sdk";

exports.handler = (web3, event: Ethereum.Event, blockMeta: Ethereum.BlockMeta, userMeta: Ethereum.UserMeta) => {
    // do something awesome !
    return result;
}

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 8.12 or higher is required. Also you need to install ts-node package >= v7.0.1 is required

Installation is done using the npm install command:

$ npm install --save @haechi-labs/henesis-sdk

Features

  • provide henesis user-defined function event interface

Quick Start

Create your package and initialize npm.

$ mkdir awesome-function && cd awesome-function && npm init

Install the henesis-sdk package:

$ npm i --save @haechi-labs/henesis-sdk

Write your own function code:

import { Ethereum } from "@haechi-labs/henesis-sdk"

exports.handler = (web3, event: Ethereum.Event, blockMeta: Ethereum.BlockMeta, userMeta: Ethereum.UserMeta) => {
    const { index, payload } = event;
    const { name, data, transaction } = payload;
    
    if (transaction.gasUsed >= 10000) {
     	return {
            index: index,
            msg: "gas used over 10000"
     	};   
    }
}

License

MIT

Package Sidebar

Install

npm i @haechi-labs/henesis-sdk

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

7.92 kB

Total Files

9

Last publish

Collaborators

  • beingbook2
  • haechi_labs
  • borre.facewallet