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

# BaseContractMethod

A Contract method can be called directly, or used in various ways.

## Extended by

* [`ContractMethod`](/sdk/content/interfaces/ContractMethod)

## Type parameters

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

```ts theme={null}
interface BaseContractMethod(...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:137](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/contract/types.ts#L137)

## Properties

| Property   | Type                                                        | Description                                                                     |
| :--------- | :---------------------------------------------------------- | :------------------------------------------------------------------------------ |
| `fragment` | [`FunctionFragment`](/sdk/content/classes/FunctionFragment) | The fragment of the Contract method. This will throw on ambiguous method names. |
| `name`     | `string`                                                    | The name of the Contract method.                                                |

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

#### 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`](/sdk/content/classes/FunctionFragment)

The constrained fragment.

#### 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`](/sdk/content/interfaces/ContractTransaction)>

A promise resolving to the populated transaction.

#### 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`](/sdk/content/classes/ContractTransactionResponse)>

A promise resolving to the transaction response.

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

#### 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`](/sdk/content/classes/Result)>

A promise resolving to the Result of the static call.

#### Source

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