web3
Index
Classes
- AbiError
- BaseWeb3Error
- ChainIdMismatchError
- ChainMismatchError
- CommonOrChainAndHardforkError
- ConfigChainMismatchError
- ConfigHardforkMismatchError
- ConnectionCloseError
- ConnectionError
- ConnectionNotOpenError
- ConnectionTimeoutError
- Contract
- ContractCodeNotStoredError
- ContractEventDoesNotExistError
- ContractExecutionError
- ContractInstantiationError
- ContractMissingABIError
- ContractMissingDeployDataError
- ContractNoAddressDefinedError
- ContractNoFromAddressDefinedError
- ContractOnceRequiresCallbackError
- ContractReservedEventError
- ENSCheckInterfaceSupportError
- ENSNetworkNotSyncedError
- ENSUnsupportedNetworkError
- Eip1559GasPriceError
- Eip1559NotSupportedError
- Eip838ExecutionError
- ExistingPluginNamespaceError
- FormatterError
- HardforkMismatchError
- HexProcessingError
- HttpProvider
- IVLengthError
- Iban
- InternalError
- InvalidAddressError
- InvalidBlockError
- InvalidBooleanError
- InvalidBytesError
- InvalidClientError
- InvalidConnectionError
- InvalidGasOrGasPrice
- InvalidInputError
- InvalidKdfError
- InvalidLargeValueError
- InvalidMaxPriorityFeePerGasOrMaxFeePerGas
- InvalidMethodParamsError
- InvalidNonceOrChainIdError
- InvalidNumberError
- InvalidNumberOfParamsError
- InvalidParamsError
- InvalidPasswordError
- InvalidPrivateKeyError
- InvalidProviderError
- InvalidRequestError
- InvalidResponseError
- InvalidSignatureError
- InvalidSizeError
- InvalidStringError
- InvalidTransactionCall
- InvalidTransactionObjectError
- InvalidTransactionWithReceiver
- InvalidTransactionWithSender
- InvalidTypeAbiInputError
- InvalidTypeError
- InvalidUnitError
- InvalidUnsignedIntegerError
- InvalidValueError
- IpcProvider
- KeyDerivationError
- KeyStoreVersionError
- LimitExceededError
- LocalWalletNotAvailableError
- MaxAttemptsReachedOnReconnectingError
- MethodNotFoundError
- MethodNotImplementedError
- MethodNotSupported
- MissingChainOrHardforkError
- MissingCustomChainError
- MissingCustomChainIdError
- MissingGasError
- Net
- NibbleWidthError
- NoContractAddressFoundError
- OperationAbortError
- OperationTimeoutError
- PBKDF2IterationsError
- ParseError
- PendingRequestsOnReconnectingError
- Personal
- PrivateKeyLengthError
- ProviderError
- RequestAlreadySentError
- ResolverMethodMissingError
- ResourceUnavailableError
- ResourcesNotFoundError
- ResponseError
- RevertInstructionError
- RpcError
- SignatureError
- SubscriptionError
- TransactionBlockTimeoutError
- TransactionDataAndInputError
- TransactionError
- TransactionGasMismatchError
- TransactionMissingReceiptOrBlockHashError
- TransactionNotFound
- TransactionOutOfGasError
- TransactionPollingTimeoutError
- TransactionReceiptMissingBlockNumberError
- TransactionRejectedError
- TransactionRevertError
- TransactionRevertedWithoutReasonError
- TransactionSendTimeoutError
- TransactionSigningError
- UnableToPopulateNonceError
- UndefinedRawTransactionError
- UnsupportedFeeMarketError
- UnsupportedTransactionTypeError
- VersionNotSupportedError
- Web3
- Web3BaseProvider
- Web3BaseWallet
- Web3ContractError
- Web3Eth
- Web3WSProviderError
- WebSocketProvider
Enumerations
Interfaces
- AbiCoderStruct
- AbiStruct
- AccessListEntry
- AccountObject
- BaseTransactionAPI
- BlockBase
- BlockHeaderOutput
- BlockInput
- BlockOutput
- Common
- CompileResultAPI
- CustomChain
- DecodedParams
- EIP1193Provider
- EthSubscription
- FeeHistoryBase
- Filter
- JsonRpcError
- JsonRpcNotification
- JsonRpcOptionalRequest
- JsonRpcRequest
- JsonRpcResponseWithError
- JsonRpcResponseWithResult
- JsonRpcSubscriptionResult
- LegacyRequestProvider
- LegacySendAsyncProvider
- LegacySendProvider
- Log
- LogBase
- LogsInput
- LogsOutput
- PopulatedUnsignedBaseTransaction
- PopulatedUnsignedEip1559Transaction
- PopulatedUnsignedEip2930Transaction
- PostInput
- PostOutput
- Proof
- ProviderConnectInfo
- ProviderMessage
- ProviderRpcError
- ReceiptInput
- ReceiptOutput
- SignedTransactionInfoAPI
- SocketRequestItem
- StorageProof
- SubscriptionParams
- SyncInput
- SyncOutput
- Transaction
- Transaction1559SignedAPI
- Transaction1559UnsignedAPI
- Transaction2930SignedAPI
- Transaction2930UnsignedAPI
- TransactionCall
- TransactionCallAPI
- TransactionForAccessList
- TransactionInfo
- TransactionInput
- TransactionLegacySignedAPI
- TransactionLegacyUnsignedAPI
- TransactionReceiptBase
- TransactionWithFromAndToLocalWalletIndex
- TransactionWithFromLocalWalletIndex
- TransactionWithToLocalWalletIndex
- Web3APIPayload
- Web3APIRequest
- Web3AccountProvider
- Web3BaseWalletAccount
- Web3DeferredPromiseInterface
- Web3Error
- Web3EthInterface
Namespaces
References
Type Aliases
- AbiBaseFragment
- AbiConstructorFragment
- AbiErrorFragment
- AbiEventFragment
- AbiFallbackFragment
- AbiFragment
- AbiFunctionFragment
- AbiInput
- AbiParameter
- AccessList
- AccessListResult
- Address
- ArrayToIndexObject
- Block
- BlockAPI
- BlockNumberOrTag
- BlockTag
- Bytes
- Cipher
- CipherOptions
- Components
- ConnectionEvent
- ContractAbi
- ContractConstructor
- ContractConstructorArgs
- ContractEvent
- ContractEvents
- ContractMethod
- ContractMethodInputParameters
- ContractMethodOutputParameters
- ContractMethods
- ConvertToNumber
- EncodingTypes
- EthExecutionAPI
- EthPersonalAPI
- FeeHistory
- FeeHistoryResultAPI
- FilterAbis
- FilterResultsAPI
- FixedSizeArray
- GrowToSize
- Hardfork
- HexString
- HexString16Bytes
- HexString256Bytes
- HexString32Bytes
- HexString8Bytes
- HexStringBytes
- HexStringSingleByte
- IndexKeysForArray
- JsonEventInterface
- JsonFunctionInterface
- JsonRpcBatchRequest
- JsonRpcBatchResponse
- JsonRpcId
- JsonRpcIdentifier
- JsonRpcPayload
- JsonRpcResponse
- JsonRpcResult
- KeyStore
- LogAPI
- MatchPrimitiveType
- Mutable
- Numbers
- Optional
- PBKDF2SHA256Params
- PopulatedUnsignedTransaction
- PrimitiveAddressType
- PrimitiveBooleanType
- PrimitiveBytesType
- PrimitiveIntegerType
- PrimitiveStringType
- PrimitiveTupleType
- Receipt
- ScryptParams
- Sha3Input
- SupportedProviders
- SyncingStatusAPI
- Topic
- TransactionHash
- TransactionInfoAPI
- TransactionOutput
- TransactionReceipt
- TransactionReceiptAPI
- TransactionSignedAPI
- TransactionUnsignedAPI
- TransactionWithSenderAPI
- TypedObject
- TypedObjectAbbreviated
- Uint
- Uint256
- Uncles
- ValidChains
- ValueTypes
- Web3APIMethod
- Web3APIParams
- Web3APIReturnType
- Web3APISpec
- Web3BaseProviderConstructor
- Web3EthExecutionAPI
- Web3NetAPI
- Web3ProviderEventCallback
- Web3ProviderRequestCallback
- Web3ProviderStatus
Variables
- ERR_ABI_ENCODING
- ERR_CONN
- ERR_CONN_CLOSE
- ERR_CONN_INVALID
- ERR_CONN_MAX_ATTEMPTS
- ERR_CONN_NOT_OPEN
- ERR_CONN_PENDING_REQUESTS
- ERR_CONN_TIMEOUT
- ERR_CONTRACT
- ERR_CONTRACT_ABI_MISSING
- ERR_CONTRACT_EVENT_NOT_EXISTS
- ERR_CONTRACT_EXECUTION_REVERTED
- ERR_CONTRACT_INSTANTIATION
- ERR_CONTRACT_MISSING_ADDRESS
- ERR_CONTRACT_MISSING_DEPLOY_DATA
- ERR_CONTRACT_MISSING_FROM_ADDRESS
- ERR_CONTRACT_REQUIRED_CALLBACK
- ERR_CONTRACT_RESERVED_EVENT
- ERR_CONTRACT_RESOLVER_MISSING
- ERR_CORE_CHAIN_MISMATCH
- ERR_CORE_HARDFORK_MISMATCH
- ERR_ENS_CHECK_INTERFACE_SUPPORT
- ERR_ENS_NETWORK_NOT_SYNCED
- ERR_ENS_UNSUPPORTED_NETWORK
- ERR_EXISTING_PLUGIN_NAMESPACE
- ERR_FORMATTERS
- ERR_INVALID_ADDRESS
- ERR_INVALID_BLOCK
- ERR_INVALID_BOOLEAN
- ERR_INVALID_BYTES
- ERR_INVALID_CLIENT
- ERR_INVALID_HEX
- ERR_INVALID_KEYSTORE
- ERR_INVALID_LARGE_VALUE
- ERR_INVALID_METHOD_PARAMS
- ERR_INVALID_NIBBLE_WIDTH
- ERR_INVALID_NUMBER
- ERR_INVALID_PASSWORD
- ERR_INVALID_PRIVATE_KEY
- ERR_INVALID_PROVIDER
- ERR_INVALID_RESPONSE
- ERR_INVALID_SIGNATURE
- ERR_INVALID_SIZE
- ERR_INVALID_STRING
- ERR_INVALID_TYPE
- ERR_INVALID_TYPE_ABI
- ERR_INVALID_UNIT
- ERR_INVALID_UNSIGNED_INTEGER
- ERR_IV_LENGTH
- ERR_KEY_DERIVATION_FAIL
- ERR_KEY_VERSION_UNSUPPORTED
- ERR_METHOD_NOT_IMPLEMENTED
- ERR_OPERATION_ABORT
- ERR_OPERATION_TIMEOUT
- ERR_PARAM
- ERR_PBKDF2_ITERATIONS
- ERR_PRIVATE_KEY_LENGTH
- ERR_PROVIDER
- ERR_RAW_TX_UNDEFINED
- ERR_REQ_ALREADY_SENT
- ERR_RESPONSE
- ERR_RPC_INTERNAL_ERROR
- ERR_RPC_INVALID_INPUT
- ERR_RPC_INVALID_JSON
- ERR_RPC_INVALID_METHOD
- ERR_RPC_INVALID_PARAMS
- ERR_RPC_INVALID_REQUEST
- ERR_RPC_LIMIT_EXCEEDED
- ERR_RPC_MISSING_RESOURCE
- ERR_RPC_NOT_SUPPORTED
- ERR_RPC_TRANSACTION_REJECTED
- ERR_RPC_UNAVAILABLE_RESOURCE
- ERR_RPC_UNSUPPORTED_METHOD
- ERR_SIGNATURE_FAILED
- ERR_SUBSCRIPTION
- ERR_TX
- ERR_TX_BLOCK_TIMEOUT
- ERR_TX_CHAIN_ID_MISMATCH
- ERR_TX_CHAIN_MISMATCH
- ERR_TX_CONTRACT_NOT_STORED
- ERR_TX_DATA_AND_INPUT
- ERR_TX_GAS_MISMATCH
- ERR_TX_HARDFORK_MISMATCH
- ERR_TX_INVALID_CALL
- ERR_TX_INVALID_CHAIN_INFO
- ERR_TX_INVALID_FEE_MARKET_GAS
- ERR_TX_INVALID_FEE_MARKET_GAS_PRICE
- ERR_TX_INVALID_LEGACY_FEE_MARKET
- ERR_TX_INVALID_LEGACY_GAS
- ERR_TX_INVALID_NONCE_OR_CHAIN_ID
- ERR_TX_INVALID_OBJECT
- ERR_TX_INVALID_RECEIVER
- ERR_TX_INVALID_SENDER
- ERR_TX_LOCAL_WALLET_NOT_AVAILABLE
- ERR_TX_MISSING_CHAIN_INFO
- ERR_TX_MISSING_CUSTOM_CHAIN
- ERR_TX_MISSING_CUSTOM_CHAIN_ID
- ERR_TX_MISSING_GAS
- ERR_TX_NOT_FOUND
- ERR_TX_NO_CONTRACT_ADDRESS
- ERR_TX_OUT_OF_GAS
- ERR_TX_POLLING_TIMEOUT
- ERR_TX_RECEIPT_MISSING_BLOCK_NUMBER
- ERR_TX_RECEIPT_MISSING_OR_BLOCKHASH_NULL
- ERR_TX_REVERT_INSTRUCTION
- ERR_TX_REVERT_TRANSACTION
- ERR_TX_REVERT_WITHOUT_REASON
- ERR_TX_SEND_TIMEOUT
- ERR_TX_SIGNING
- ERR_TX_UNABLE_TO_POPULATE_NONCE
- ERR_TX_UNSUPPORTED_EIP_1559
- ERR_TX_UNSUPPORTED_TYPE
- ERR_UNSUPPORTED_KDF
- ERR_VALIDATION
- ERR_WS_PROVIDER
- GENESIS_BLOCK_NUMBER
- JSONRPC_ERR_CHAIN_DISCONNECTED
- JSONRPC_ERR_DISCONNECTED
- JSONRPC_ERR_REJECTED_REQUEST
- JSONRPC_ERR_UNAUTHORIZED
- JSONRPC_ERR_UNSUPPORTED_METHOD
- TypedArray
- rpcErrorsMap
References
default
Renames and re-exports Web3
Type Aliases
AbiBaseFragment
Type declaration
readonlytype: string | FragmentTypes
AbiConstructorFragment
AbiErrorFragment
AbiEventFragment
AbiFallbackFragment
AbiFragment
AbiFunctionFragment
AbiInput
AbiParameter
Type declaration
optionalreadonlyarrayChildren?: ReadonlyArray<AbiParameter>
optionalreadonlyarrayLength?: number
optionalreadonlybaseType?: string
optionalreadonlycomponents?: ReadonlyArray<AbiParameter>
optionalreadonlyindexed?: boolean
readonlyname: string
readonlytype: string
AccessList
AccessListResult
Type declaration
optionalreadonlyaccessList?: AccessList
optionalreadonlygasUsed?: Numbers
Address
ArrayToIndexObject
Type parameters
- T: ReadonlyArray<unknown>
Block
BlockAPI
BlockNumberOrTag
BlockTag
Bytes
Cipher
CipherOptions
Type declaration
optionalc?: number
optionaldklen?: number
optionaliv?: Buffer | string
optionalkdf?: scrypt | pbkdf2
optionaln?: number
optionalp?: number
optionalr?: number
optionalsalt?: Buffer | string
Components
Type declaration
optionalcomponents?: Components[]
optionalindexed?: boolean
name: string
type: string
ConnectionEvent
Type declaration
code: number
reason: string
optionalwasClean?: boolean
ContractAbi
ContractConstructor
Type parameters
- Abis: ContractAbi
ContractConstructorArgs
Type parameters
- Abis: ContractAbi
ContractEvent
Type parameters
- Abi: AbiEventFragment
Type declaration
readonlyAbi: Abi
readonlyInputs: ContractMethodInputParameters<Abi[inputs]>
ContractEvents
Type parameters
- Abis: ContractAbi
ContractMethod
Type parameters
- Abi: AbiFunctionFragment
Type declaration
readonlyAbi: Abi
readonlyInputs: ContractMethodInputParameters<Abi[inputs]>
readonlyOutputs: ContractMethodOutputParameters<Abi[outputs]>
ContractMethodInputParameters
Type parameters
- Params: ReadonlyArray<unknown> | undefined
ContractMethodOutputParameters
Type parameters
- Params: ReadonlyArray<unknown> | undefined
ContractMethods
Type parameters
- Abis: ContractAbi
ConvertToNumber
Type parameters
- T: string
- Range: number = _SolidityIndexRange
EncodingTypes
EthExecutionAPI
Type declaration
eth_accounts: function
Returns string[]
eth_blockNumber: function
Returns string
eth_call: function
Parameters
transaction: TransactionCallAPI
blockNumber: BlockNumberOrTag
Returns string
eth_clearSubscriptions: function
Parameters
optionalkeepSyncing: boolean
Returns void
eth_coinbase: function
Returns string
eth_compileLLL: function
Parameters
code: string
Returns string
eth_compileSerpent: function
Parameters
code: string
Returns string
eth_compileSolidity: function
Parameters
code: string
Returns CompileResultAPI
eth_estimateGas: function
Parameters
transaction: Partial<TransactionWithSenderAPI>
blockNumber: BlockNumberOrTag
Returns string
eth_feeHistory: function
Parameters
blockCount: string
newestBlock: BlockNumberOrTag
rewardPercentiles: number[]
Returns FeeHistoryResultAPI
eth_gasPrice: function
Returns string
eth_getBalance: function
Parameters
address: string
blockNumber: BlockNumberOrTag
Returns string
eth_getBlockByHash: function
Parameters
blockHash: string
hydrated: boolean
Returns BlockAPI
eth_getBlockByNumber: function
Parameters
blockNumber: BlockNumberOrTag
hydrated: boolean
Returns BlockAPI
eth_getBlockTransactionCountByHash: function
Parameters
blockHash: string
Returns string
eth_getBlockTransactionCountByNumber: function
Parameters
blockNumber: BlockNumberOrTag
Returns string
eth_getCode: function
Parameters
address: string
blockNumber: BlockNumberOrTag
Returns string
eth_getCompilers: function
Returns string[]
eth_getFilterChanges: function
Parameters
filterIdentifier: string
Returns FilterResultsAPI
eth_getFilterLogs: function
Parameters
filterIdentifier: string
Returns FilterResultsAPI
eth_getLogs: function
Parameters
filter: Filter
Returns FilterResultsAPI
eth_getStorageAt: function
Parameters
address: string
storageSlot: string
blockNumber: BlockNumberOrTag
Returns string
eth_getTransactionByBlockHashAndIndex: function
Parameters
blockHash: string
transactionIndex: string
Returns undefined | TransactionInfoAPI
eth_getTransactionByBlockNumberAndIndex: function
Parameters
blockNumber: BlockNumberOrTag
transactionIndex: string
Returns undefined | TransactionInfoAPI
eth_getTransactionByHash: function
Parameters
transactionHash: string
Returns undefined | TransactionInfoAPI
eth_getTransactionCount: function
Parameters
address: string
blockNumber: BlockNumberOrTag
Returns string
eth_getTransactionReceipt: function
Parameters
transactionHash: string
Returns undefined | TransactionReceiptAPI
eth_getUncleByBlockHashAndIndex: function
Parameters
blockHash: string
uncleIndex: string
Returns BlockAPI
eth_getUncleByBlockNumberAndIndex: function
Parameters
blockNumber: BlockNumberOrTag
uncleIndex: string
Returns BlockAPI
eth_getUncleCountByBlockHash: function
Parameters
blockHash: string
Returns string
eth_getUncleCountByBlockNumber: function
Parameters
blockNumber: BlockNumberOrTag
Returns string
eth_getWork: function
Returns [string, string, string]
eth_hashrate: function
Returns string
eth_mining: function
Returns boolean
eth_newBlockFilter: function
Returns string
eth_newFilter: function
Parameters
filter: Filter
Returns string
eth_newPendingTransactionFilter: function
Returns string
eth_protocolVersion: function
Returns string
eth_sendRawTransaction: function
Parameters
transaction: string
Returns string
eth_sendTransaction: function
Parameters
transaction: TransactionWithSenderAPI | Partial<TransactionWithSenderAPI>
Returns string
eth_sign: function
Parameters
address: string
message: string
Returns string
eth_signTransaction: function
Parameters
transaction: TransactionWithSenderAPI | Partial<TransactionWithSenderAPI>
Returns string | SignedTransactionInfoAPI
eth_submitHashrate: function
Parameters
hashRate: string
id: string
Returns boolean
eth_submitWork: function
Parameters
nonce: string
hash: string
digest: string
Returns boolean
eth_subscribe: function
eth_syncing: function
Returns SyncingStatusAPI
eth_uninstallFilter: function
Parameters
filterIdentifier: string
Returns boolean
eth_unsubscribe: function
Parameters
subscriptionId: string
Returns string
EthPersonalAPI
Type declaration
personal_ecRecover: function
Parameters
signedData: string
signature: string
Returns string
personal_importRawKey: function
Parameters
keyData: string
passphrase: string
Returns string
personal_listAccounts: function
Returns string[]
personal_lockAccount: function
Parameters
address: string
Returns boolean
personal_newAccount: function
Parameters
password: string
Returns string
personal_sendTransaction: function
Parameters
tx: Transaction
passphrase: string
Returns string
personal_sign: function
Parameters
data: string
address: string
passphrase: string
Returns string
personal_signTransaction: function
Parameters
tx: Transaction
passphrase: string
Returns string
personal_unlockAccount: function
Parameters
address: string
password: string
unlockDuration: number
Returns boolean
FeeHistory
FeeHistoryResultAPI
FilterAbis
Type parameters
- Abis: ContractAbi
- Filter
- Abi = Abis[number]
FilterResultsAPI
FixedSizeArray
Type parameters
- T
- N: number
GrowToSize
Type parameters
- T
- A: T[]
- N: number
Hardfork
HexString
HexString16Bytes
HexString256Bytes
HexString32Bytes
HexString8Bytes
HexStringBytes
HexStringSingleByte
IndexKeysForArray
Type parameters
- A: readonly unknown[]
JsonEventInterface
Type declaration
anonymous: boolean
indexed: boolean
inputs: Components[]
name: string
type: event
JsonFunctionInterface
Type declaration
inputs: Components[]
name: string
optionaloutputs?: AbiInput[]
optionalstateMutability?: string
type: function
JsonRpcBatchRequest
JsonRpcBatchResponse
Type parameters
- Result = JsonRpcResult
- Error = JsonRpcResult
JsonRpcId
JsonRpcIdentifier
JsonRpcPayload
Type parameters
- Param = unknown[]
JsonRpcResponse
Type parameters
- Result = JsonRpcResult
- Error = JsonRpcResult
JsonRpcResult
KeyStore
Type declaration
address: string
crypto: { cipher: Cipher; cipherparams: { iv: string }; ciphertext: string; kdf: pbkdf2 | scrypt; kdfparams: ScryptParams | PBKDF2SHA256Params; mac: HexString }
cipher: Cipher
cipherparams: { iv: string }
iv: string
ciphertext: string
kdf: pbkdf2 | scrypt
kdfparams: ScryptParams | PBKDF2SHA256Params
mac: HexString
id: string
version: 3
LogAPI
MatchPrimitiveType
Type parameters
- Type: string
- TypeComponents: ReadonlyArray<AbiParameter> | undefined
Mutable
Type parameters
- T
Numbers
Optional
Type parameters
- T
- K: keyof T
PBKDF2SHA256Params
Type declaration
c: number
dklen: number
prf: hmac-sha256
salt: Buffer | string
PopulatedUnsignedTransaction
PrimitiveAddressType
Type parameters
- Type: string
PrimitiveBooleanType
Type parameters
- Type: string
PrimitiveBytesType
Type parameters
- Type: string
PrimitiveIntegerType
Type parameters
- Type: string
PrimitiveStringType
Type parameters
- Type: string
PrimitiveTupleType
Type parameters
- Type: string
- TypeComponents: ReadonlyArray<AbiParameter> | undefined = []
Receipt
ScryptParams
Type declaration
dklen: number
n: number
p: number
r: number
salt: Buffer | string
Sha3Input
SupportedProviders
Type parameters
- API: Web3APISpec = Web3EthExecutionAPI
SyncingStatusAPI
Topic
TransactionHash
TransactionInfoAPI
TransactionOutput
TransactionReceipt
TransactionReceiptAPI
TransactionSignedAPI
TransactionUnsignedAPI
TransactionWithSenderAPI
TypedObject
Type declaration
type: string
value: EncodingTypes
TypedObjectAbbreviated
Type declaration
t: string
v: EncodingTypes
Uint
Uint256
Uncles
ValidChains
ValueTypes
Web3APIMethod
Type parameters
- T: Web3APISpec
Web3APIParams
Type parameters
- API: Web3APISpec
- Method: Web3APIMethod<API>
Web3APIReturnType
Type parameters
- API: Web3APISpec
- Method: Web3APIMethod<API>
Web3APISpec
Web3BaseProviderConstructor
Type declaration
Type parameters
- API: Web3APISpec
Parameters
url: string
optionalnet: Socket
Returns Web3BaseProvider<API>
Web3EthExecutionAPI
Web3NetAPI
Type declaration
net_listening: function
Returns boolean
net_peerCount: function
Returns string
net_version: function
Returns string
Web3ProviderEventCallback
Type parameters
- T = JsonRpcResult
Type declaration
Parameters
error: Error | ProviderRpcError | undefined
optionalresult: JsonRpcSubscriptionResult | JsonRpcNotification<T>
Returns void
Web3ProviderRequestCallback
Type parameters
- ResultType = unknown
Type declaration
Parameters
optionalerr: Error | Web3Error | null | JsonRpcResponseWithError<Error>
optionalresponse: JsonRpcResponseWithResult<ResultType>
Returns void
This is the main (or ‘umbrella’) class of the web3.js library.
Web3.modules
Will return an object with the classes of all major sub modules, to be able to instantiate them manually.
Returns
Object
A list of module constructors:Eth
-Constructor
: The Eth module for interacting with the Ethereum networkNet
-Constructor
: The Net module for interacting with network properties.Personal
-constructor
: The Personal module for interacting with the Ethereum accounts (web3.eth.personal).Example
See details: Web3.modules
Web3 Instance
The Web3 class is an umbrella package to house all Ethereum related modules.
version
Contains the current package version of the web3.js library.
Returns
//todo enable when functionality added // @see Web3.version
utils
Static accessible property of the Web3 class and property of the instance as well.
Utility functions are also exposed on the
Web3
class object diretly.//todo enable when implemented //See details: Web3.utils
setProvider
Will change the provider for its module.
NOTE: When called on the umbrella package web3 it will also set the provider for all sub modules web3.eth etc.
Parameters
Object
-myProvider
: a valid provider.Returns
Boolean
See details: Web3.setProvider
Example: Local Geth Node
Example: Remote Geth Node
providers
Contains the current available providers.
Returns
Object
with the following providers:Object
-HttpProvider
: HTTP provider, does not support subscriptions.Object
-WebSocketProvider
: The WebSocket provider is the standard for usage in legacy browsers.Object
-IpcProvider
: The IPC provider is used in node.js dapps when running a local node. Gives the most secure connection.Example
Configuration
More information for the Http and Websocket provider modules can be found here:
See details: Web3.providers
givenProvider
When using web3.js in an Ethereum compatible browser, it will set with the current native provider by that browser. Will return the given provider by the (browser) environment, otherwise
undefined
.Returns
Object
- The given provider set orundefined
.See details: Web3.givenProvider
currentProvider
Will return the current provider, otherwise
undefined
.Returns
Object
: The current provider, otherwiseundefined
.See details: Web3.currentProvider
BatchRequest
Class to create and execute batch requests.
Parameters
none
Returns
Object
: With the following methods:add(request)
: To add a request object to the batch call.execute()
: To execute the batch request.Example
See details: Web3.BatchRequest