web3-types | API | Web3.js (original) (raw)

Type Aliases

AbiBaseFragment: { type: string | FragmentTypes }

Type declaration

AbiConstructorFragment: AbiBaseFragment & { inputs?: ReadonlyArray<AbiParameter>; stateMutability: string | nonpayable | payable; type: string | constructor }

AbiErrorFragment: AbiBaseFragment & { inputs?: ReadonlyArray<AbiParameter>; name: string; type: string | error }

AbiEventFragment: AbiBaseFragment & { anonymous?: boolean; inputs?: ReadonlyArray<AbiParameter>; name: string; type: string | event }

AbiFallbackFragment: AbiBaseFragment & { constant?: boolean; inputs: never; name: never; outputs: never; payable?: boolean; stateMutability: string | nonpayable | payable | pure | view; type: string | fallback }

AbiFunctionFragment: AbiBaseFragment & { constant?: boolean; inputs?: ReadonlyArray<AbiParameter>; methodNameWithInputs?: string; name: string; outputs?: ReadonlyArray<AbiParameter>; payable?: boolean; signature?: string; stateMutability?: string | nonpayable | payable | pure | view; type: string | function }

AbiInput: string | AbiParameter | { components?: Components; index?: boolean; internalType?: string; name: string; type: string } | {}

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

Type declaration

Type declaration

Type parameters

ByteTypes: { BYTES_HEX: HexString; BYTES_UINT8ARRAY: Uint8Array }

Type declaration

Cipher: aes-128-ctr | aes-128-cbc | aes-256-cbc

CipherOptions: { c?: number; dklen?: number; iv?: Uint8Array | string; kdf?: scrypt | pbkdf2; n?: number; p?: number; r?: number; salt?: Uint8Array | string }

Type declaration

Components: { components?: Components[]; indexed?: boolean; name: string; type: string }

Type declaration

ConnectionEvent: { code: number; reason: string; wasClean?: boolean }

Type declaration

Type parameters

ContractMethodOutputParameters<Params>: Params extends readonly [] ? void : Params extends readonly [infer

H, ...infer

R] ? R extends readonly [] ? H extends AbiParameter ? MatchPrimitiveType<H[type], H[components]> : [] : ArrToObjectWithFunctions<[...ContractMethodOutputParametersRecursiveArray<Params>]> & ContractMethodOutputParametersRecursiveRecord<Params> : []

Type parameters

ConvertToNumber<T, Range>: Range extends unknown ? `${Range}` extends T ? Range : never : never

Type parameters

Eip1193Compatible<API>: Omit<Omit<Web3BaseProvider, request>, asEIP1193Provider> & { request: any }

Eip1193EventName: connect | disconnect | message | chainChanged | accountsChanged

EthExecutionAPI: { eth_accounts: () => Address[]; eth_blockNumber: () => Uint; eth_call: (transaction: TransactionCallAPI, blockNumber: BlockNumberOrTag) => HexStringBytes; eth_clearSubscriptions: (keepSyncing?: boolean) => void; eth_coinbase: () => Address; eth_compileLLL: (code: string) => HexStringBytes; eth_compileSerpent: (code: string) => HexStringBytes; eth_compileSolidity: (code: string) => CompileResultAPI; eth_estimateGas: (transaction: Partial<TransactionWithSenderAPI>, blockNumber: BlockNumberOrTag) => Uint; eth_feeHistory: (blockCount: Uint, newestBlock: BlockNumberOrTag, rewardPercentiles: number[]) => FeeHistoryResultAPI; eth_gasPrice: () => Uint; eth_getBalance: (address: Address, blockNumber: BlockNumberOrTag) => Uint; eth_getBlockByHash: (blockHash: HexString32Bytes, hydrated: boolean) => BlockAPI; eth_getBlockByNumber: (blockNumber: BlockNumberOrTag, hydrated: boolean) => BlockAPI; eth_getBlockTransactionCountByHash: (blockHash: HexString32Bytes) => Uint; eth_getBlockTransactionCountByNumber: (blockNumber: BlockNumberOrTag) => Uint; eth_getCode: (address: Address, blockNumber: BlockNumberOrTag) => HexStringBytes; eth_getCompilers: () => string[]; eth_getFilterChanges: (filterIdentifier: Uint) => FilterResultsAPI; eth_getFilterLogs: (filterIdentifier: Uint) => FilterResultsAPI; eth_getLogs: (filter: Filter) => FilterResultsAPI; eth_getStorageAt: (address: Address, storageSlot: Uint256, blockNumber: BlockNumberOrTag) => HexStringBytes; eth_getTransactionByBlockHashAndIndex: (blockHash: HexString32Bytes, transactionIndex: Uint) => TransactionInfoAPI | undefined; eth_getTransactionByBlockNumberAndIndex: (blockNumber: BlockNumberOrTag, transactionIndex: Uint) => TransactionInfoAPI | undefined; eth_getTransactionByHash: (transactionHash: HexString32Bytes) => TransactionInfoAPI | undefined; eth_getTransactionCount: (address: Address, blockNumber: BlockNumberOrTag) => Uint; eth_getTransactionReceipt: (transactionHash: HexString32Bytes) => TransactionReceiptAPI | undefined; eth_getUncleByBlockHashAndIndex: (blockHash: HexString32Bytes, uncleIndex: Uint) => BlockAPI; eth_getUncleByBlockNumberAndIndex: (blockNumber: BlockNumberOrTag, uncleIndex: Uint) => BlockAPI; eth_getUncleCountByBlockHash: (blockHash: HexString32Bytes) => Uint; eth_getUncleCountByBlockNumber: (blockNumber: BlockNumberOrTag) => Uint; eth_getWork: () => [HexString32Bytes, HexString32Bytes, HexString32Bytes]; eth_hashrate: () => Uint; eth_maxPriorityFeePerGas: () => Uint; eth_mining: () => boolean; eth_newBlockFilter: () => Uint; eth_newFilter: (filter: Filter) => Uint; eth_newPendingTransactionFilter: () => Uint; eth_protocolVersion: () => string; eth_sendRawTransaction: (transaction: HexStringBytes) => HexString32Bytes; eth_sendTransaction: (transaction: TransactionWithSenderAPI | Partial<TransactionWithSenderAPI>) => HexString32Bytes; eth_sign: (address: Address, message: HexStringBytes) => HexString256Bytes; eth_signTransaction: (transaction: TransactionWithSenderAPI | Partial<TransactionWithSenderAPI>) => HexStringBytes | SignedTransactionInfoAPI; eth_submitHashrate: (hashRate: HexString32Bytes, id: HexString32Bytes) => boolean; eth_submitWork: (nonce: HexString8Bytes, hash: HexString32Bytes, digest: HexString32Bytes) => boolean; eth_subscribe: (...params: [newHeads] | [newPendingTransactions] | [syncing] | [logs, { address?: HexString; topics?: HexString[] }]) => HexString; eth_syncing: () => SyncingStatusAPI; eth_uninstallFilter: (filterIdentifier: Uint) => boolean; eth_unsubscribe: (subscriptionId: HexString) => HexString }

Type declaration

EthPersonalAPI: { personal_ecRecover: (signedData: HexString, signature: HexString) => Address; personal_importRawKey: (keyData: HexString, passphrase: string) => HexString; personal_listAccounts: () => Address[]; personal_lockAccount: (address: Address) => boolean; personal_newAccount: (password: string) => Address; personal_sendTransaction: (tx: Transaction, passphrase: string) => HexString; personal_sign: (data: HexString, address: Address, passphrase: string) => HexString; personal_signTransaction: (tx: Transaction, passphrase: string) => HexString; personal_unlockAccount: (address: Address, password: string, unlockDuration: number) => boolean }

Type declaration

FilterAbis<Abis, Filter, Abi>: Abi extends Filter ? Abi : never

Type parameters

FilterParams: Omit<Filter, blockHash | filter>

FixedSizeArray<T, N>: GrowToSize<T, [], N>

Type parameters

FormatType<T, F>: number extends Extract<T, Numbers> ? NumberTypes[F[number]] | Exclude<T, Numbers> : Uint8Array extends Extract<T, Bytes> ? ByteTypes[F[bytes]] | Exclude<T, Bytes> : T extends object | undefined ? { [ P in keyof T ]: FormatType<T[P], F> } : T

GrowToSize<T, A, N>: { 0: A; 1: GrowToSize<T, _Grow<T, A>, N> }[A[length] extends N ? 0 : 1]

Type parameters

IndexKeysForArray<A>: Exclude<keyof A, keyof []>

Type parameters

JsonEventInterface: { anonymous: boolean; indexed: boolean; inputs: Components[]; name: string; type: event }

Type declaration

JsonFunctionInterface: { inputs: Components[]; name: string; outputs?: AbiInput[]; stateMutability?: string; type: function }

Type declaration

JsonRpcId: string | number | undefined

JsonRpcIdentifier: string & (2.0 | 1.0)

Type parameters

JsonRpcResult: string | number | boolean | Record<string, unknown>

KeyStore: { address: string; crypto: { cipher: Cipher; cipherparams: { iv: string }; ciphertext: string; kdf: pbkdf2 | scrypt; kdfparams: ScryptParams | PBKDF2SHA256Params; mac: HexString }; id: string; version: 3 }

Type declaration

Type parameters

Mutable<T>: { -readonly [ P in keyof T ]: T[P] }

Type parameters

NumberTypes: { NUMBER_BIGINT: bigint; NUMBER_HEX: HexString; NUMBER_NUMBER: number; NUMBER_STR: string }

Type declaration

Numbers: number | bigint | string | HexString

Optional<T, K>: Pick<Partial<T>, K> & Omit<T, K>

Type parameters

PBKDF2SHA256Params: { c: number; dklen: number; prf: hmac-sha256; salt: Uint8Array | string }

Type declaration

PrimitiveAddressType<Type>: Type extends `address[${infer

Size}]` ? _TypedArray<Address, Size> : Type extends address ? Address : never

Type parameters

PrimitiveBooleanType<Type>: Type extends `bool[${infer

Size}]` ? _TypedArray<boolean, Size> : Type extends bool ? boolean : never

Type parameters

PrimitiveBytesType<Type>: Type extends `bytes${string}[${infer

Size}]` ? _TypedArray<Bytes, Size> : Type extends bytes | `bytes${string}` ? Bytes : never

Type parameters

PrimitiveIntegerType<Type>: Type extends `uint${string}[${infer

Size}]` | `int${string}[${infer

Size}]` ? _TypedArray<Numbers, Size> : Type extends uint | int | `int${string}` | `uint${string}` ? Numbers : never

Type parameters

PrimitiveStringType<Type>: Type extends `string${string}[${infer

Size}]` ? _TypedArray<string, Size> : Type extends string | `string${string}` ? string : never

Type parameters

PrimitiveTupleType<Type, TypeComponents>: TypeComponents extends ReadonlyArray<AbiParameter> ? Type extends tuple ? { [ Param in TypeComponents[number] as Param[name] ]: MatchPrimitiveType<Param[type], Param[components]> } : Type extends `tuple[${infer

Size}]` ? _TypedArray<{ [ Param in TypeComponents[number] as Param[name] ]: MatchPrimitiveType<Param[type], Param[components]> }, Size> : never : never

Type parameters

ProviderAccounts: string[]

Receipt: Record<string, unknown>

ScryptParams: { dklen: number; n: number; p: number; r: number; salt: Uint8Array | string }

Type declaration

SignResult: SignatureObject & { message?: string; signature: string }

SignTransactionResult: SignatureObject & { rawTransaction: string; transactionHash: string }

SignatureObject: { messageHash: string; r: string; s: string; v: string }

Type declaration

SyncingStatusAPI: { currentBlock: Uint; highestBlock: Uint; startingBlock: Uint } | boolean

TransactionOutput: { blockNumber?: Numbers; from?: HexString; gas?: Numbers; gasLimit?: string; input: string; nonce: Numbers; to?: HexString; transactionIndex?: Numbers; value: Numbers } & ({ gasPrice?: never; maxFeePerGas: Numbers; maxPriorityFeePerGas: Numbers } | { gasPrice: Numbers; maxFeePerGas?: never; maxPriorityFeePerGas?: never })

TypedObjectAbbreviated: { t: string; v: EncodingTypes }

ValidChains: goerli | kovan | mainnet | rinkeby | ropsten | sepolia

ValueTypes: address | bool | string | int256 | uint256 | bytes | bigint

Web3APIMethod<T>: string & keyof Exclude<T, unknown>

Web3APIParams<API, Method>: API extends Exclude<Web3APISpec, unknown> ? Parameters<API[Method]> : unknown

Web3APIReturnType<API, Method>: API extends Record<string, (...params: any) => any> ? ReturnType<API[Method]> : any

Web3APISpec: Record<string, (...params: any) => any> | unknown

Web3BaseProviderConstructor: new <API>(url: string, net?: Socket) => Web3BaseProvider<API>

Type declaration

Web3Eip1193ProviderEventCallback<T>: (data: T) => void

Type parameters

Type declaration

Web3NetAPI: { net_listening: () => boolean; net_peerCount: () => HexString; net_version: () => string }

Type declaration

Type declaration

Type parameters

Type declaration

Web3ProviderStatus: connecting | connected | disconnected

Web3ValidationErrorObject<K, P, S>: { data?: unknown; instancePath: string; keyword: K; message?: string; params: P; propertyName?: string; schema?: S; schemaPath: string }

Type parameters

Type declaration

Variables

DEFAULT_RETURN_FORMAT: { bytes: HEX; number: BIGINT } = ...

Type declaration

ETH_DATA_FORMAT: { bytes: HEX; number: HEX } = ...

Type declaration