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

# FunctionFragment

A Fragment which represents a method.

## Extends

* [`NamedFragment`](/sdk/content/classes/NamedFragment)

## Properties

| Property          | Modifier   | Type                                                      | Description                                                           | Inherited from                                                 |
| :---------------- | :--------- | :-------------------------------------------------------- | :-------------------------------------------------------------------- | :------------------------------------------------------------- |
| `constant`        | `readonly` | `boolean`                                                 | If the function is constant (e.g. `pure` or `view` functions).        | -                                                              |
| `gas`             | `readonly` | `null` \| `bigint`                                        | The recommended gas limit to send when calling this function.         | -                                                              |
| `inputs`          | `readonly` | readonly [`ParamType`](/sdk/content/classes/ParamType)\[] | The inputs for the fragment.                                          | [`NamedFragment`](/sdk/content/classes/NamedFragment).`inputs` |
| `name`            | `readonly` | `string`                                                  | The name of the fragment.                                             | [`NamedFragment`](/sdk/content/classes/NamedFragment).`name`   |
| `outputs`         | `readonly` | readonly [`ParamType`](/sdk/content/classes/ParamType)\[] | The returned types for the result of calling this function.           | -                                                              |
| `payable`         | `readonly` | `boolean`                                                 | If the function can be sent value during invocation.                  | -                                                              |
| `stateMutability` | `readonly` | `"payable"` \| `"nonpayable"` \| `"view"` \| `"pure"`     | The state mutability (e.g. `payable`, `nonpayable`, `view` or `pure`) | -                                                              |
| `type`            | `readonly` | [`FragmentType`](/sdk/content/type-aliases/FragmentType)  | The type of the fragment.                                             | [`NamedFragment`](/sdk/content/classes/NamedFragment).`type`   |

## Accessors

### selector

```ts theme={null}
get selector(): string
```

The Function selector.

#### Returns

`string`

#### Source

[abi/fragments.ts:1632](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1632)

## Methods

### format()

```ts theme={null}
format(format?): string
```

Returns a string representation of this function as `format`.

#### Parameters

| Parameter | Type                                                 |
| :-------- | :--------------------------------------------------- |
| `format`? | [`FormatType`](/sdk/content/type-aliases/FormatType) |

#### Returns

`string`

#### Overrides

[`NamedFragment`](/sdk/content/classes/NamedFragment).[`format`](/sdk/content/classes/NamedFragment#format)

#### Source

[abi/fragments.ts:1639](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1639)

***

### from()

```ts theme={null}
static from(obj): FunctionFragment
```

Returns a new **FunctionFragment** for `obj`.

#### Parameters

| Parameter | Type  |
| :-------- | :---- |
| `obj`     | `any` |

#### Returns

[`FunctionFragment`](/sdk/content/classes/FunctionFragment)

#### Overrides

[`NamedFragment`](/sdk/content/classes/NamedFragment).[`from`](/sdk/content/classes/NamedFragment#from)

#### Source

[abi/fragments.ts:1693](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1693)

***

### getSelector()

```ts theme={null}
static getSelector(name, params?): string
```

Return the selector for a function with `name` and `params`.

#### Parameters

| Parameter | Type     |
| :-------- | :------- |
| `name`    | `string` |
| `params`? | `any`\[] |

#### Returns

`string`

#### Source

[abi/fragments.ts:1684](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1684)

***

### isConstructor()

```ts theme={null}
static isConstructor(value): value is ConstructorFragment
```

Returns true if `value` is a [**ConstructorFragment**](/sdk/content/classes/ConstructorFragment).

#### Parameters

| Parameter | Type  |
| :-------- | :---- |
| `value`   | `any` |

#### Returns

`value is ConstructorFragment`

#### Inherited from

[`NamedFragment`](/sdk/content/classes/NamedFragment).[`isConstructor`](/sdk/content/classes/NamedFragment#isconstructor)

#### Source

[abi/fragments.ts:1122](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1122)

***

### isError()

```ts theme={null}
static isError(value): value is ErrorFragment
```

Returns true if `value` is an [**ErrorFragment**](/sdk/content/classes/ErrorFragment).

#### Parameters

| Parameter | Type  |
| :-------- | :---- |
| `value`   | `any` |

#### Returns

`value is ErrorFragment`

#### Inherited from

[`NamedFragment`](/sdk/content/classes/NamedFragment).[`isError`](/sdk/content/classes/NamedFragment#iserror)

#### Source

[abi/fragments.ts:1129](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1129)

***

### isEvent()

```ts theme={null}
static isEvent(value): value is EventFragment
```

Returns true if `value` is an [**EventFragment**](/sdk/content/classes/EventFragment).

#### Parameters

| Parameter | Type  |
| :-------- | :---- |
| `value`   | `any` |

#### Returns

`value is EventFragment`

#### Inherited from

[`NamedFragment`](/sdk/content/classes/NamedFragment).[`isEvent`](/sdk/content/classes/NamedFragment#isevent)

#### Source

[abi/fragments.ts:1136](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1136)

***

### isFragment()

```ts theme={null}
static isFragment(value): value is FunctionFragment
```

Returns `true` and provides a type guard if `value` is a **FunctionFragment**.

#### Parameters

| Parameter | Type  |
| :-------- | :---- |
| `value`   | `any` |

#### Returns

`value is FunctionFragment`

#### Source

[abi/fragments.ts:1756](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1756)

***

### isFunction()

```ts theme={null}
static isFunction(value): value is FunctionFragment
```

Returns true if `value` is a [**FunctionFragment**](/sdk/content/classes/FunctionFragment).

#### Parameters

| Parameter | Type  |
| :-------- | :---- |
| `value`   | `any` |

#### Returns

`value is FunctionFragment`

#### Inherited from

[`NamedFragment`](/sdk/content/classes/NamedFragment).[`isFunction`](/sdk/content/classes/NamedFragment#isfunction)

#### Source

[abi/fragments.ts:1143](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1143)

***

### isStruct()

```ts theme={null}
static isStruct(value): value is StructFragment
```

Returns true if `value` is a [**StructFragment**](/sdk/content/classes/StructFragment).

#### Parameters

| Parameter | Type  |
| :-------- | :---- |
| `value`   | `any` |

#### Returns

`value is StructFragment`

#### Inherited from

[`NamedFragment`](/sdk/content/classes/NamedFragment).[`isStruct`](/sdk/content/classes/NamedFragment#isstruct)

#### Source

[abi/fragments.ts:1150](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/abi/fragments.ts#L1150)
