You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@truffle/decoder

Package Overview
Dependencies
Maintainers
6
Versions
262
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@truffle/decoder

A library that provides both high and low level decoding of Ethereum contract variables

Source
npmnpm
Version
3.0.13
Version published
Weekly downloads
1.1K
-66.37%
Maintainers
6
Weekly downloads
 
Created
Source

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

Keywords

contract

FAQs

Package last updated on 12 Sep 2019

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