> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ContractMethod

A contract method on a Contract.

## Extends

* [`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod)\<`A`, `R`, `D`>

## Extended by

* [`ConstantContractMethod`](https://docs.qu.ai/sdk/content/interfaces/ConstantContractMethod)

## Type parameters

| Type parameter | Value |
| :- | :- |
| `A` *extends* `any`\[] | `any`\[] |
| `R` | `any` |
| `D` *extends* `R` \| [`ContractTransactionResponse`](https://docs.qu.ai/sdk/content/classes/ContractTransactionResponse) | `R` \| [`ContractTransactionResponse`](https://docs.qu.ai/sdk/content/classes/ContractTransactionResponse) |

```ts theme={null}
interface ContractMethod(...args): Promise<D>
```

Call the contract method with arguments.

## Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| ...`args` | `ContractMethodArgs`\<`A`> | The arguments to call the method with. |

## Returns

`Promise`\<`D`>

A promise resolving to the result of the call.

## Source

[contract/types.ts:206](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/contract/types.ts#L206)

## Properties

| Property | Type | Description | Inherited from |
| :- | :- | :- | :- |
| `fragment` | [`FunctionFragment`](https://docs.qu.ai/sdk/content/classes/FunctionFragment) | The fragment of the Contract method. This will throw on ambiguous method names. | [`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod).`fragment` |
| `name` | `string` | The name of the Contract method. | [`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod).`name` |

## Methods

### estimateGas()

```ts theme={null}
estimateGas(...args): Promise<bigint>
```

Estimate the gas to send the contract method with `args`.

#### Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| ...`args` | `ContractMethodArgs`\<`A`> | The arguments to call the method with. |

#### Returns

`Promise`\<`bigint`>

A promise resolving to the estimated gas.

#### Inherited from

[`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod).[`estimateGas`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod#estimategas)

#### Source

[contract/types.ts:190](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/contract/types.ts#L190)

***

### getFragment()

```ts theme={null}
getFragment(...args): FunctionFragment
```

Returns the fragment constrained by `args`. This can be used to resolve ambiguous method names.

#### Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| ...`args` | `ContractMethodArgs`\<`A`> | The arguments to constrain the fragment by. |

#### Returns

[`FunctionFragment`](https://docs.qu.ai/sdk/content/classes/FunctionFragment)

The constrained fragment.

#### Inherited from

[`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod).[`getFragment`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod#getfragment)

#### Source

[contract/types.ts:155](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/contract/types.ts#L155)

***

### populateTransaction()

```ts theme={null}
populateTransaction(...args): Promise<ContractTransaction>
```

Returns a populated transaction that can be used to perform the contract method with `args`.

#### Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| ...`args` | `ContractMethodArgs`\<`A`> | The arguments to populate the transaction with. |

#### Returns

`Promise`\<[`ContractTransaction`](https://docs.qu.ai/sdk/content/interfaces/ContractTransaction)>

A promise resolving to the populated transaction.

#### Inherited from

[`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod).[`populateTransaction`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod#populatetransaction)

#### Source

[contract/types.ts:163](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/contract/types.ts#L163)

***

### send()

```ts theme={null}
send(...args): Promise<ContractTransactionResponse>
```

Send a transaction for the contract method with `args`.

#### Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| ...`args` | `ContractMethodArgs`\<`A`> | The arguments to call the method with. |

#### Returns

`Promise`\<[`ContractTransactionResponse`](https://docs.qu.ai/sdk/content/classes/ContractTransactionResponse)>

A promise resolving to the transaction response.

#### Inherited from

[`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod).[`send`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod#send)

#### Source

[contract/types.ts:182](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/contract/types.ts#L182)

***

### staticCall()

```ts theme={null}
staticCall(...args): Promise<R>
```

Call the contract method with `args` and return the value.

If the return value is a single type, it will be dereferenced and returned directly, otherwise the full Result
will be returned.

#### Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| ...`args` | `ContractMethodArgs`\<`A`> | The arguments to call the method with. |

#### Returns

`Promise`\<`R`>

A promise resolving to the result of the static call.

#### Inherited from

[`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod).[`staticCall`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod#staticcall)

#### Source

[contract/types.ts:174](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/contract/types.ts#L174)

***

### staticCallResult()

```ts theme={null}
staticCallResult(...args): Promise<Result>
```

Call the contract method with `args` and return the Result without any dereferencing.

#### Parameters

| Parameter | Type | Description |
| :- | :- | :- |
| ...`args` | `ContractMethodArgs`\<`A`> | The arguments to call the method with. |

#### Returns

`Promise`\<[`Result`](https://docs.qu.ai/sdk/content/classes/Result)>

A promise resolving to the Result of the static call.

#### Inherited from

[`BaseContractMethod`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod).[`staticCallResult`](https://docs.qu.ai/sdk/content/interfaces/BaseContractMethod#staticcallresult)

#### Source

[contract/types.ts:198](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/contract/types.ts#L198)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.