UNPKG

viem

Version:

TypeScript Interface for Ethereum

25 lines 2.27 kB
import type { AbiParameter, AbiParametersToPrimitiveTypes } from 'abitype'; import type { ByteArray, Hex } from '../../types/misc.js'; import { type InvalidAbiDecodingTypeErrorType } from '../../errors/abi.js'; import type { ErrorType } from '../../errors/utils.js'; import { type ChecksumAddressErrorType } from '../address/getAddress.js'; import { type CreateCursorErrorType } from '../cursor.js'; import { type SizeErrorType } from '../data/size.js'; import { type SliceBytesErrorType } from '../data/slice.js'; import { type TrimErrorType } from '../data/trim.js'; import { type BytesToBigIntErrorType, type BytesToBoolErrorType, type BytesToNumberErrorType, type BytesToStringErrorType } from '../encoding/fromBytes.js'; import { type HexToBytesErrorType } from '../encoding/toBytes.js'; import { type BytesToHexErrorType } from '../encoding/toHex.js'; export type DecodeAbiParametersReturnType<params extends readonly AbiParameter[] = readonly AbiParameter[]> = AbiParametersToPrimitiveTypes<params extends readonly AbiParameter[] ? params : AbiParameter[]>; export type DecodeAbiParametersErrorType = HexToBytesErrorType | BytesToHexErrorType | DecodeParameterErrorType | SizeErrorType | CreateCursorErrorType | ErrorType; export declare function decodeAbiParameters<const params extends readonly AbiParameter[]>(params: params, data: ByteArray | Hex): DecodeAbiParametersReturnType<params>; type DecodeParameterErrorType = DecodeArrayErrorType | DecodeTupleErrorType | DecodeAddressErrorType | DecodeBoolErrorType | DecodeBytesErrorType | DecodeNumberErrorType | DecodeStringErrorType | InvalidAbiDecodingTypeErrorType; type DecodeAddressErrorType = ChecksumAddressErrorType | BytesToHexErrorType | SliceBytesErrorType | ErrorType; type DecodeArrayErrorType = BytesToNumberErrorType | ErrorType; type DecodeBoolErrorType = BytesToBoolErrorType | ErrorType; type DecodeBytesErrorType = BytesToNumberErrorType | BytesToHexErrorType | ErrorType; type DecodeNumberErrorType = BytesToNumberErrorType | BytesToBigIntErrorType | ErrorType; type DecodeTupleErrorType = BytesToNumberErrorType | ErrorType; type DecodeStringErrorType = BytesToNumberErrorType | BytesToStringErrorType | TrimErrorType | ErrorType; export {}; //# sourceMappingURL=decodeAbiParameters.d.ts.map