web3-eth-contract
Index
Classes
Functions
Interfaces
References
Type Aliases
References
TransactionReceipt
Re-exports TransactionReceipt
default
Renames and re-exports Contract
Type Aliases
ContractAbiWithSignature
ContractBoundEvent
Type declaration
The event object can be accessed from
myContract.events.myEvent
.> Remember: To subscribe to an event, your provider must have support for subscriptions.
const subscription = await myContract.events.MyEvent([options])
Parameters
optionaloptions: ContractEventOptions
The options used to subscribe for the event
Returns LogsSubscription
- A Promise resolved with LogsSubscription object
ContractEventEmitterInterface
Type parameters
- Abi: ContractAbi
ContractEventsInterface
Type parameters
- Abi: ContractAbi
- Events: ContractEvents<Abi> = ContractEvents<Abi>
ContractMethodsInterface
Type parameters
- Abi: ContractAbi
ContractOverloadedMethodInputs
Type parameters
- AbiArr: ReadonlyArray<unknown>
ContractOverloadedMethodOutputs
Type parameters
- AbiArr: ReadonlyArray<unknown>
The
web3.eth.Contract
object makes it easy to interact with smart contracts on the Ethereum blockchain. When you create a new contract object you give it the JSON interface of the respective smart contract and web3 will auto convert all calls into low level ABI calls over RPC for you. This allows you to interact with smart contracts as if they were JavaScript objects.To use it standalone: