A BaseContract with no type guards on its methods or events.
BaseContract
<this
> & Omit
<ContractInterface
, keyof BaseContract
>Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
fallback | readonly | null | WrappedFallback | The fallback or receive function if any. | _ContractBase().fallback |
filters | readonly | Record <string , ContractEvent <any []>> | All the Events available on this contract. | _ContractBase().filters |
interface | readonly | Interface | The contract Interface. | _ContractBase().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. | _ContractBase().runner |
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. | _ContractBase().target |
Alias for on.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to listen for. |
listener | Listener | The listener to call when the event is emitted. |
Promise
<Contract
>
_ContractBase().addListener
Return a new Contract instance with the same ABI and runner, but a different target
.
Parameter | Type | Description |
---|---|---|
target | string | Addressable | The target to connect to. |
The new contract instance.
_ContractBase().attach
Return a new Contract instance with the same target and ABI, but a different runner
.
Parameter | Type | Description |
---|---|---|
runner | null | ContractRunner | The runner to use. |
The new contract instance.
_ContractBase().connect
Return the transaction used to deploy this contract.
This is only available if this instance was returned from a ContractFactor.
null
| ContractTransactionResponse
The transaction used to deploy this contract or null
.
_ContractBase().deploymentTransaction
Emit an 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.
_ContractBase().emit
Return the resolved address of this Contract.
Promise
<string
>
The resolved address.
_ContractBase().getAddress
Return the deployed bytecode or null if no bytecode is found.
Promise
<null
| string
>
The deployed bytecode or null.
_ContractBase().getDeployedCode
If the runner does not support .provider.
Return the event for a given name. This is useful when a contract event name conflicts with a JavaScript name
such as 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.
_ContractBase().getEvent
Return the function for a given name. This is useful when a contract method name conflicts with a JavaScript name
such as 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.
_ContractBase().getFunction
Resolves to the number of listeners of 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.
_ContractBase().listenerCount
Resolves to the listeners subscribed to event
or all listeners if unspecified.
Parameter | Type | Description |
---|---|---|
event ? | ContractEventName | The event to get listeners for. |
Promise
<Listener
[]>
The listeners.
_ContractBase().listeners
Remove the 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
<Contract
>
This contract instance.
_ContractBase().off
Add an event 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
<Contract
>
This contract instance.
_ContractBase().on
Add an event 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
<Contract
>
_ContractBase().once
Provide historic access to event data for 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. |
An array of event logs.
_ContractBase().queryFilter
Remove all the listeners for event
or remove all listeners if unspecified.
Parameter | Type | Description |
---|---|---|
event ? | ContractEventName | The event to remove the listeners from. |
Promise
<Contract
>
This contract instance.
_ContractBase().removeAllListeners
Alias for off.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to remove the listener from. |
listener | Listener | The listener to remove. |
Promise
<Contract
>
_ContractBase().removeListener
Resolve to this Contract once the bytecode has been deployed, or resolve immediately if already deployed.
Promise
<Contract
>
The contract instance.
_ContractBase().waitForDeployment
If the contract runner does not support .provider.
A BaseContract with no type guards on its methods or events.
BaseContract
<this
> & Omit
<ContractInterface
, keyof BaseContract
>Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
fallback | readonly | null | WrappedFallback | The fallback or receive function if any. | _ContractBase().fallback |
filters | readonly | Record <string , ContractEvent <any []>> | All the Events available on this contract. | _ContractBase().filters |
interface | readonly | Interface | The contract Interface. | _ContractBase().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. | _ContractBase().runner |
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. | _ContractBase().target |
Alias for on.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to listen for. |
listener | Listener | The listener to call when the event is emitted. |
Promise
<Contract
>
_ContractBase().addListener
Return a new Contract instance with the same ABI and runner, but a different target
.
Parameter | Type | Description |
---|---|---|
target | string | Addressable | The target to connect to. |
The new contract instance.
_ContractBase().attach
Return a new Contract instance with the same target and ABI, but a different runner
.
Parameter | Type | Description |
---|---|---|
runner | null | ContractRunner | The runner to use. |
The new contract instance.
_ContractBase().connect
Return the transaction used to deploy this contract.
This is only available if this instance was returned from a ContractFactor.
null
| ContractTransactionResponse
The transaction used to deploy this contract or null
.
_ContractBase().deploymentTransaction
Emit an 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.
_ContractBase().emit
Return the resolved address of this Contract.
Promise
<string
>
The resolved address.
_ContractBase().getAddress
Return the deployed bytecode or null if no bytecode is found.
Promise
<null
| string
>
The deployed bytecode or null.
_ContractBase().getDeployedCode
If the runner does not support .provider.
Return the event for a given name. This is useful when a contract event name conflicts with a JavaScript name
such as 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.
_ContractBase().getEvent
Return the function for a given name. This is useful when a contract method name conflicts with a JavaScript name
such as 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.
_ContractBase().getFunction
Resolves to the number of listeners of 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.
_ContractBase().listenerCount
Resolves to the listeners subscribed to event
or all listeners if unspecified.
Parameter | Type | Description |
---|---|---|
event ? | ContractEventName | The event to get listeners for. |
Promise
<Listener
[]>
The listeners.
_ContractBase().listeners
Remove the 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
<Contract
>
This contract instance.
_ContractBase().off
Add an event 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
<Contract
>
This contract instance.
_ContractBase().on
Add an event 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
<Contract
>
_ContractBase().once
Provide historic access to event data for 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. |
An array of event logs.
_ContractBase().queryFilter
Remove all the listeners for event
or remove all listeners if unspecified.
Parameter | Type | Description |
---|---|---|
event ? | ContractEventName | The event to remove the listeners from. |
Promise
<Contract
>
This contract instance.
_ContractBase().removeAllListeners
Alias for off.
Parameter | Type | Description |
---|---|---|
event | ContractEventName | The event to remove the listener from. |
listener | Listener | The listener to remove. |
Promise
<Contract
>
_ContractBase().removeListener
Resolve to this Contract once the bytecode has been deployed, or resolve immediately if already deployed.
Promise
<Contract
>
The contract instance.
_ContractBase().waitForDeployment
If the contract runner does not support .provider.