Class: ContractInterface
Implemented by​
Indexable​
â–ª [key: string
]: AsyncContractFunction
| any
Constructors​
constructor​
• new ContractInterface()
Properties​
abi​
• Abstract
abi: Abi
Defined in​
address​
• Abstract
address: string
Defined in​
providerOrAccount​
• Abstract
providerOrAccount: ProviderInterface
| AccountInterface
Defined in​
deployTransactionHash​
• Optional
Abstract
deployTransactionHash: string
Defined in​
functions​
• Readonly
functions: Object
Index signature​
â–ª [name: string
]: AsyncContractFunction
Defined in​
callStatic​
• Readonly
callStatic: Object
Index signature​
â–ª [name: string
]: AsyncContractFunction
Defined in​
populateTransaction​
• Readonly
populateTransaction: Object
Index signature​
â–ª [name: string
]: ContractFunction
Defined in​
estimateFee​
• Readonly
estimateFee: Object
Index signature​
â–ª [name: string
]: ContractFunction
Defined in​
Methods​
attach​
â–¸ Abstract
attach(address
): void
Saves the address of the contract deployed on network that will be used for interaction
Parameters​
Name | Type | Description |
---|---|---|
address | string | address of the contract |
Returns​
void
Defined in​
connect​
â–¸ Abstract
connect(providerOrAccount
): void
Attaches to new Provider or Account
Parameters​
Name | Type | Description |
---|---|---|
providerOrAccount | ProviderInterface | AccountInterface | new Provider or Account to attach to |
Returns​
void
Defined in​
deployed​
â–¸ Abstract
deployed(): Promise
<ContractInterface
>
Resolves when contract is deployed on the network or when no deployment transaction is found
Throws
When deployment fails
Returns​
Promise
<ContractInterface
>
Promise that resolves when contract is deployed on the network or when no deployment transaction is found
Defined in​
call​
â–¸ Abstract
call(method
, args?
, options?
): Promise
<Result
>
Calls a method on a contract
Parameters​
Name | Type | Description |
---|---|---|
method | string | name of the method |
args? | ArgsOrCalldata | Array of the arguments for the call |
options? | CallOptions | optional blockIdentifier |
Returns​
Promise
<Result
>
Result of the call as an array with key value pars
Defined in​
invoke​
â–¸ Abstract
invoke(method
, args?
, options?
): Promise
<InvokeFunctionResponse
>
Invokes a method on a contract
Parameters​
Name | Type | Description |
---|---|---|
method | string | name of the method |
args? | ArgsOrCalldata | Array of the arguments for the invoke or Calldata |
options? | InvokeOptions |
Returns​
Promise
<InvokeFunctionResponse
>
Add Transaction Response
Defined in​
estimate​
â–¸ Abstract
estimate(method
, args?
, options?
): Promise
<EstimateFeeResponse
>
Estimates a method on a contract
Parameters​
Name | Type | Description |
---|---|---|
method | string | name of the method |
args? | ArgsOrCalldata | Array of the arguments for the call or Calldata |
options? | Object | optional blockIdentifier |
options.blockIdentifier? | BlockIdentifier | - |
Returns​
Promise
<EstimateFeeResponse
>
Defined in​
populate​
â–¸ Abstract
populate(method
, args?
): Invocation
Calls a method on a contract
Parameters​
Name | Type | Description |
---|---|---|
method | string | name of the method |
args? | ArgsOrCalldata | Array of the arguments for the call or Calldata |
Returns​
Invocation object
Defined in​
parseEvents​
â–¸ Abstract
parseEvents(receipt
): ParsedEvents
Parse contract events of a GetTransactionReceiptResponse received from waitForTransaction. Based on contract's abi
Parameters​
Name | Type | Description |
---|---|---|
receipt | GetTransactionReceiptResponse | transaction receipt |
Returns​
Events parsed
Defined in​
isCairo1​
â–¸ Abstract
isCairo1(): boolean
tells if the contract comes from a Cairo 1 contract
Example
const isCairo1: boolean = myContract.isCairo1();
Returns​
boolean
TRUE if the contract comes from a Cairo1 contract
Defined in​
getVersion​
â–¸ Abstract
getVersion(): Promise
<ContractVersion
>
Retrieves the version of the contract (cairo version & compiler version)
Returns​
Promise
<ContractVersion
>
Defined in​
typed​
â–¸ Abstract
typed<TAbi
>(tAbi
): TypedContract
<TAbi
>
Type parameters​
Name | Type |
---|---|
TAbi | extends readonly (AbiFunction | AbiEvent | AbiStruct | AbiEnum )[] |
Parameters​
Name | Type |
---|---|
tAbi | TAbi |
Returns​
TypedContract
<TAbi
>