From 910e8b6a18ca7b34122d3dbd729e950ae1134f06 Mon Sep 17 00:00:00 2001 From: "Marc J. Schmidt" Date: Thu, 3 Jun 2021 20:46:06 +0200 Subject: [PATCH] Fixed web3-eth-abi typing The actual code exports as default a AbiCoder instance. In the previous version the class itself was exported via its name, breaks runtime code. Correctly used it looks like that: ```typescript import abiCoder from 'web3-eth-abi'; const data = abiCoder.encodeParameters(...); ``` The new typings reflects that now correctly. --- packages/web3-eth-abi/types/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/web3-eth-abi/types/index.d.ts b/packages/web3-eth-abi/types/index.d.ts index 4343b578967..2f2c0992a54 100644 --- a/packages/web3-eth-abi/types/index.d.ts +++ b/packages/web3-eth-abi/types/index.d.ts @@ -19,7 +19,7 @@ import { AbiInput, AbiItem } from 'web3-utils'; -export class AbiCoder { +declare class AbiCoder { encodeFunctionSignature(functionName: string | AbiItem): string; encodeEventSignature(functionName: string | AbiItem): string; @@ -40,3 +40,6 @@ export class AbiCoder { topics: string[] ): { [key: string]: string }; } + +declare var coder: AbiCoder; +export default coder;