Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/web3-eth-abi/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,3 +40,9 @@ export class AbiCoder {
topics: string[]
): { [key: string]: string };
}

export type { AbiCoder }

declare const abiCoder: AbiCoder

export default abiCoder
4 changes: 1 addition & 3 deletions packages/web3-eth-abi/types/tests/abi-coder-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
* @date 2018
*/

import { AbiCoder } from 'web3-eth-abi';

const abiCoder = new AbiCoder();
import abiCoder from 'web3-eth-abi';

// $ExpectType string
abiCoder.encodeFunctionSignature('myMethod(uint256,string)');
Expand Down