New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@twetch/bsvabi

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twetch/bsvabi

bsvabi helpers

latest
Source
npmnpm
Version
0.0.9
Version published
Weekly downloads
35
-10.26%
Maintainers
1
Weekly downloads
 
Created
Source

BSVABI Helpers

Install

npm i @twetch/bsvabi

Usage

const BSVABI = require('@twetch/bsvabi');

const abiSchema = ...;
const twetchAbi = new BSVABI(abiSchema);

// build from either arguments or tx
twetchABI.action('post').fromArgs([...]);
twetchABI.action('post').fromTX(rawtx);

// Get the data array for a twetch Post
twetchABI.action('post').fromArgs(['hello world', ...]).toArray(); // returns ['19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut', 'hello world', ...]

// Get the object for a twetch Post
twetchABI.action('post').fromArgs(['hello world', ...]).toObject(); // returns { bNamespace: '19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut', bContent: 'hello world', ... }

Methods

action(type)

Params:

  • type (string) - name of the abi action

Response:

  • the BSVABI instance w/ the action selected

fromArgs(args)

Params:

  • args (array) - array of arguments for the abi

Response:

  • this BSVABI instance, but now validated. Errors thrown if validation fails

fromTX(rawtx)

Params:

  • rawtx (string) - a raw transaction

Response:

  • this BSVABI instance, but now validated. Errors thrown if validation fails

toArray()

Response:

  • array of the data

toObject()

Response:

  • object of the data

FAQs

Package last updated on 16 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts