Back to Web3 Js

web3.eth.abi Migration Guide

docs/docs/guides/15_web3_upgrade_guide/abi_migration_guide.md

4.16.0766 B
Original Source

web3.eth.abi Migration Guide

Breaking Changes

  • AbiInput has moved from web3-eth-utils to web3-eth-abi

  • type AbiInput attribute was renamed to baseType from internalType.

In 1.x:

export interface AbiInput {
    name: string;
    type: string;
    indexed?: boolean;
	components?: AbiInput[];
    internalType?: string;
}

In 4.x:


export type AbiInput = string | AbiParameter | { readonly [key: string]: unknown };
// where AbiParameter is ...

export type AbiParameter = {
	readonly name: string;
	readonly type: string;
	readonly baseType?: string;
	readonly indexed?: boolean;
	readonly components?: ReadonlyArray<AbiParameter>;
	readonly arrayLength?: number;
	readonly arrayChildren?: ReadonlyArray<AbiParameter>;
};