Skip to content

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.

[key: string]: BaseContractMethod<any[], any, any>
[key: number]: BaseContractMethod<any[], any, any>
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

ParameterType
target| string | Addressable
abi| Interface | InterfaceAbi
runner?| null | ContractRunner

Contract

Contract_base.constructor
readonly [internal]: any;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:46

@_ignore:

Contract_base.[internal]

readonly fallback:
| null
| WrappedFallback;

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.

Contract_base.fallback

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.

Contract_base.filters

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.

Contract_base.interface

readonly runner:
| null
| ContractRunner;

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.

Contract_base.runner

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.

Contract_base.target
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].

ParameterType
eventContractEventName
listenerListener

Promise<Contract>

Contract_base.addListener

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%%.

ParameterType
target| string | Addressable

BaseContract

Contract_base.attach

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%%.

ParameterType
runner| null | ContractRunner

BaseContract

Contract_base.connect

deploymentTransaction():
| null
| ContractTransactionResponse;

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]].

| null | ContractTransactionResponse

Contract_base.deploymentTransaction

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.

ParameterType
eventContractEventName
argsany[]

Promise<boolean>

Contract_base.emit

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.

Promise<string>

Contract_base.getAddress

getDeployedCode(): Promise<null | string>;

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.

Promise<null | string>

Contract_base.getDeployedCode

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.

ParameterType
key| string | EventFragment

ContractEvent

Contract_base.getEvent

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 ParameterDefault type
T extends ContractMethod<any[], any, any>ContractMethod<any[], any, any>
ParameterType
key| string | FunctionFragment

T

Contract_base.getFunction

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.

ParameterType
event?ContractEventName

Promise<number>

Contract_base.listenerCount

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.

ParameterType
event?ContractEventName

Promise<Listener[]>

Contract_base.listeners

off(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.

ParameterType
eventContractEventName
listener?Listener

Promise<Contract>

Contract_base.off

on(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%%.

ParameterType
eventContractEventName
listenerListener

Promise<Contract>

Contract_base.on

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.

ParameterType
eventContractEventName
listenerListener

Promise<Contract>

Contract_base.once

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.

ParameterType
eventContractEventName
fromBlock?BlockTag
toBlock?BlockTag

Promise<( | Log | EventLog)[]>

Contract_base.queryFilter

queryTransaction(hash): Promise<EventLog[]>;

Defined in: node_modules/.pnpm/ethers@6.15.0/node_modules/ethers/lib.esm/contract/contract.d.ts:102

@_ignore:

ParameterType
hashstring

Promise<EventLog[]>

Contract_base.queryTransaction

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.

ParameterType
event?ContractEventName

Promise<Contract>

Contract_base.removeAllListeners

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].

ParameterType
eventContractEventName
listenerListener

Promise<Contract>

Contract_base.removeListener

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.

Promise<Contract>

Contract_base.waitForDeployment