Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

@dexon-foundation/truffle-decoder

1.0.11 • Public • Published

Truffle Contract Decoder

This module provides interfaces for decoding contract state and events.

Usage

import decoder from 'truffle-contract-decoder';

const contractDecoder = await decoder.for(instance: TruffleContract);

Types

BlockNumber

number | "latest"

ContractDecoder

An instance of this class represents a decoder for a TruffleContract deployed instance.

Methods

state

contractDecoder.state(block: BlockNumber = "latest"): Promise<Interface ContractState>

variable

contractDecoder.variable(variable: string, block: BlockNumber = "latest"): Promise<Interface DecodedVariable>

events

contractDecoder.events(name: string | null = null, block: BlockNumber = "latest"): Promise<Interface ContractEvent[]>

onEvent

contractDecoder.onEvent(name: string, callback: Function(event: ContractEvent, callback: Function(err: Error | falsy = null)))

ContractState

DecodedVariable

ContractEvent

install

npm i @dexon-foundation/truffle-decoder

Downloadsweekly downloads

2

version

1.0.11

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability