Property | Modifier | Type | Description |
---|---|---|---|
fallback | readonly | null | WrappedFallback | The fallback or receive function if any. |
filters | readonly | Record <string , ContractEvent <any []>> | All the Events available on this contract. |
interface | readonly | Interface | The contract Interface. |
runner | readonly | null | ContractRunner | The connected runner. This is generally a Provider or a Signer, which dictates what operations are supported. For example, a Contract connected to a Provider may only execute read-only operations. |
target | readonly | string | Addressable | The target to connect to. This can be an address or any Addressable, such as another contract. To get the resolved address, use the getAddress method. |
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to listen for. |
listener | Listener | The listener to call when the event is emitted. |
Promise
<BaseContract
>
EventEmitterable
.addListener
target
.
Parameter | Type | Description |
---|---|---|
target | string | Addressable | The target to connect to. |
BaseContract
The new contract instance.
runner
.
Parameter | Type | Description |
---|---|---|
runner | null | ContractRunner | The runner to use. |
BaseContract
The new contract instance.
null
| ContractTransactionResponse
The transaction used to deploy this contract or null
.
event
calling all listeners with args
.
Resolves to true
if any listeners were called.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to emit. |
…args | any [] | The arguments to pass to the listeners. |
Promise
<boolean
>
true
if any listeners were called.
EventEmitterable
.emit
Promise
<string
>
The resolved address.
Addressable
.getAddress
Promise
<null
| string
>
The deployed bytecode or null.
prototype
or when using a Contract programatically.
Parameter | Type | Description |
---|---|---|
key | string | EventFragment | The name of the event to return. |
ContractEvent
<any
[]>
The event for the given name.
prototype
or when using a Contract programatically.
Type parameter | Value |
---|---|
T extends ContractMethod <any [], any , any , T > | ContractMethod <any [], any , any > |
Parameter | Type | Description |
---|---|---|
key | string | FunctionFragment | The name of the function to return. |
T
The function for the given name.
event
or the total number of listeners if unspecified.
Parameter | Type | Description |
---|---|---|
event ? | ContractEventName | The event to count listeners for. |
Promise
<number
>
The number of listeners.
EventEmitterable
.listenerCount
event
or all listeners if unspecified.
Parameter | Type | Description |
---|---|---|
event ? | ContractEventName | The event to get listeners for. |
Promise
<Listener
[]>
The listeners.
EventEmitterable
.listeners
listener
from the listeners for event
or remove all listeners if unspecified.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to remove the listener from. |
listener ? | Listener | The listener to remove. |
Promise
<BaseContract
>
This contract instance.
EventEmitterable
.off
listener
for the event
.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to listen for. |
listener | Listener | The listener to call when the event is emitted. |
Promise
<BaseContract
>
This contract instance.
EventEmitterable
.on
listener
for the event
, but remove the listener after it is fired once.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to listen for. |
listener | Listener | The listener to call when the event is emitted. |
Promise
<BaseContract
>
EventEmitterable
.once
event
in the range fromBlock
(default: 0
) to toBlock
(default:
"latest"
) inclusive.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to query. |
fromBlock ? | BlockTag | The block to start querying from. |
toBlock ? | BlockTag | The block to stop querying at. |
Promise
<(EventLog
| Log
)[]>
An array of event logs.
event
or remove all listeners if unspecified.
Parameter | Type | Description |
---|---|---|
event ? | ContractEventName | The event to remove the listeners from. |
Promise
<BaseContract
>
This contract instance.
EventEmitterable
.removeAllListeners
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to remove the listener from. |
listener | Listener | The listener to remove. |
Promise
<BaseContract
>
EventEmitterable
.removeListener
Promise
<BaseContract
>
The contract instance.
abi
.
Type parameter | Value |
---|---|
T | ContractInterface |
Parameter | Type | Description |
---|---|---|
abi | Interface | InterfaceAbi | The ABI to create the class from. |
Object
The new Class for the ABI.
Type parameter | Value |
---|---|
T | ContractInterface |
Parameter | Type | Description |
---|---|---|
target | string | The target to connect to. |
abi | Interface | InterfaceAbi | The ABI to use. |
runner ? | null | ContractRunner | The runner to use. |
BaseContract
& Omit
<T
, keyof BaseContract
>
The new BaseContract.