Contract
Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:165
A [[BaseContract]] with no type guards on its methods or events.
Extends
Section titled “Extends”Indexable
Section titled “Indexable”[key: string]: BaseContractMethod<any[], any, any>[key: number]: BaseContractMethod<any[], any, any>Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Contract( target, abi, runner?): Contract;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:161
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
target | | string | Addressable |
abi | | Interface | InterfaceAbi |
runner? | | ContractRunner | null |
Returns
Section titled “Returns”Contract
Inherited from
Section titled “Inherited from”Contract_base.constructorProperties
Section titled “Properties”[internal]
Section titled “[internal]”readonly [internal]: any;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:46
@_ignore:
Inherited from
Section titled “Inherited from”Contract_base.[internal]fallback
Section titled “fallback”readonly fallback: | WrappedFallback | null;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:50
The fallback or receive function if any.
Inherited from
Section titled “Inherited from”Contract_base.fallbackfilters
Section titled “filters”readonly filters: Record<string, ContractEvent>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:42
All the Events available on this contract.
Inherited from
Section titled “Inherited from”Contract_base.filtersinterface
Section titled “interface”readonly interface: Interface;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:30
The contract Interface.
Inherited from
Section titled “Inherited from”Contract_base.interfacerunner
Section titled “runner”readonly runner: | ContractRunner | null;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:38
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.
Inherited from
Section titled “Inherited from”Contract_base.runnertarget
Section titled “target”readonly target: | string | Addressable;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:26
The target to connect to.
This can be an address, ENS name or any [[Addressable]], such as
another contract. To get the resovled address, use the getAddress
method.
Inherited from
Section titled “Inherited from”Contract_base.targetMethods
Section titled “Methods”addListener()
Section titled “addListener()”addListener(event, listener): Promise<Contract>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:147
Alias for [on].
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | ContractEventName |
listener | Listener |
Returns
Section titled “Returns”Promise<Contract>
Inherited from
Section titled “Inherited from”Contract_base.addListenerattach()
Section titled “attach()”attach(target): BaseContract;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:66
Return a new Contract instance with the same ABI and runner, but a different %%target%%.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
target | | string | Addressable |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Contract_base.attachconnect()
Section titled “connect()”connect(runner): BaseContract;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:61
Return a new Contract instance with the same target and ABI, but a different %%runner%%.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
runner | | ContractRunner | null |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Contract_base.connectdeploymentTransaction()
Section titled “deploymentTransaction()”deploymentTransaction(): | ContractTransactionResponse | null;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:86
Return the transaction used to deploy this contract.
This is only available if this instance was returned from a [[ContractFactory]].
Returns
Section titled “Returns”| ContractTransactionResponse
| null
Inherited from
Section titled “Inherited from”Contract_base.deploymentTransactionemit()
Section titled “emit()”emit(event, ...args): Promise<boolean>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:123
Emit an %%event%% calling all listeners with %%args%%.
Resolves to true if any listeners were called.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | ContractEventName |
…args | any[] |
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”Contract_base.emitgetAddress()
Section titled “getAddress()”getAddress(): Promise<string>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:70
Return the resolved address of this Contract.
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”Contract_base.getAddressgetDeployedCode()
Section titled “getDeployedCode()”getDeployedCode(): Promise<string | null>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:74
Return the deployed bytecode or null if no bytecode is found.
Returns
Section titled “Returns”Promise<string | null>
Inherited from
Section titled “Inherited from”Contract_base.getDeployedCodegetEvent()
Section titled “getEvent()”getEvent(key): ContractEvent;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:98
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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key | | string | EventFragment |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Contract_base.getEventgetFunction()
Section titled “getFunction()”getFunction<T>(key): T;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:92
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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T extends ContractMethod<any[], any, any> | ContractMethod<any[], any, any> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
key | | string | FunctionFragment |
Returns
Section titled “Returns”T
Inherited from
Section titled “Inherited from”Contract_base.getFunctionlistenerCount()
Section titled “listenerCount()”listenerCount(event?): Promise<number>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:128
Resolves to the number of listeners of %%event%% or the total number of listeners if unspecified.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event? | ContractEventName |
Returns
Section titled “Returns”Promise<number>
Inherited from
Section titled “Inherited from”Contract_base.listenerCountlisteners()
Section titled “listeners()”listeners(event?): Promise<Listener[]>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:133
Resolves to the listeners subscribed to %%event%% or all listeners if unspecified.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event? | ContractEventName |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Contract_base.listenersoff(event, listener?): Promise<Contract>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:138
Remove the %%listener%% from the listeners for %%event%% or remove all listeners if unspecified.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | ContractEventName |
listener? | Listener |
Returns
Section titled “Returns”Promise<Contract>
Inherited from
Section titled “Inherited from”Contract_base.offon(event, listener): Promise<Contract>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:112
Add an event %%listener%% for the %%event%%.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | ContractEventName |
listener | Listener |
Returns
Section titled “Returns”Promise<Contract>
Inherited from
Section titled “Inherited from”Contract_base.ononce()
Section titled “once()”once(event, listener): Promise<Contract>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:117
Add an event %%listener%% for the %%event%%, but remove the listener after it is fired once.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | ContractEventName |
listener | Listener |
Returns
Section titled “Returns”Promise<Contract>
Inherited from
Section titled “Inherited from”Contract_base.oncequeryFilter()
Section titled “queryFilter()”queryFilter( event, fromBlock?, toBlock?): Promise<( | Log| EventLog)[]>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:108
Provide historic access to event data for %%event%% in the range
%%fromBlock%% (default: 0) to %%toBlock%% (default: "latest")
inclusive.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | ContractEventName |
fromBlock? | BlockTag |
toBlock? | BlockTag |
Returns
Section titled “Returns”Promise<(
| Log
| EventLog)[]>
Inherited from
Section titled “Inherited from”Contract_base.queryFilterqueryTransaction()
Section titled “queryTransaction()”queryTransaction(hash): Promise<EventLog[]>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:102
@_ignore:
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
hash | string |
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Contract_base.queryTransactionremoveAllListeners()
Section titled “removeAllListeners()”removeAllListeners(event?): Promise<Contract>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:143
Remove all the listeners for %%event%% or remove all listeners if unspecified.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event? | ContractEventName |
Returns
Section titled “Returns”Promise<Contract>
Inherited from
Section titled “Inherited from”Contract_base.removeAllListenersremoveListener()
Section titled “removeListener()”removeListener(event, listener): Promise<Contract>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:151
Alias for [off].
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | ContractEventName |
listener | Listener |
Returns
Section titled “Returns”Promise<Contract>
Inherited from
Section titled “Inherited from”Contract_base.removeListenerwaitForDeployment()
Section titled “waitForDeployment()”waitForDeployment(): Promise<Contract>;Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:79
Resolve to this Contract once the bytecode has been deployed, or resolve immediately if already deployed.
Returns
Section titled “Returns”Promise<Contract>
Inherited from
Section titled “Inherited from”Contract_base.waitForDeployment