# FunctionCallWeight

[**promise**](https://near-sdk-js.gitbook.io/near-sdk-js/promise) • **Docs**

***

[near-sdk-js v2.0.0](https://near-sdk-js.gitbook.io/near-sdk-js/packages) / [promise](https://near-sdk-js.gitbook.io/near-sdk-js/promise) / FunctionCallWeight

## Class: FunctionCallWeight

A function call weight promise action.

### Extends

* [`PromiseAction`](https://near-sdk-js.gitbook.io/near-sdk-js/promise/classes/promiseaction)

### Constructors

#### new FunctionCallWeight()

> **new FunctionCallWeight**(`functionName`, `args`, `amount`, `gas`, `weight`): [`FunctionCallWeight`](https://near-sdk-js.gitbook.io/near-sdk-js/promise/classes/functioncallweight)

**Parameters**

• **functionName**: `string`

The name of the function to be called.

• **args**: `string`

The utf-8 string arguments to be passed to the function.

• **amount**: `bigint`

The amount of NEAR to attach to the call.

• **gas**: `bigint`

The amount of Gas to attach to the call.

• **weight**: `bigint`

The weight of unused Gas to use.

**Returns**

[`FunctionCallWeight`](https://near-sdk-js.gitbook.io/near-sdk-js/promise/classes/functioncallweight)

**Overrides**

[`PromiseAction`](https://near-sdk-js.gitbook.io/near-sdk-js/promise/classes/promiseaction).[`constructor`](https://near-sdk-js.gitbook.io/near-sdk-js/promise/promiseaction#constructors)

**Defined in**

[packages/near-sdk-js/src/promise.ts:124](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/promise.ts#L124)

### Properties

#### amount

> **amount**: `bigint`

The amount of NEAR to attach to the call.

**Defined in**

[packages/near-sdk-js/src/promise.ts:127](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/promise.ts#L127)

***

#### args

> **args**: `string`

The utf-8 string arguments to be passed to the function.

**Defined in**

[packages/near-sdk-js/src/promise.ts:126](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/promise.ts#L126)

***

#### functionName

> **functionName**: `string`

The name of the function to be called.

**Defined in**

[packages/near-sdk-js/src/promise.ts:125](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/promise.ts#L125)

***

#### gas

> **gas**: `bigint`

The amount of Gas to attach to the call.

**Defined in**

[packages/near-sdk-js/src/promise.ts:128](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/promise.ts#L128)

***

#### weight

> **weight**: `bigint`

The weight of unused Gas to use.

**Defined in**

[packages/near-sdk-js/src/promise.ts:129](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/promise.ts#L129)

### Methods

#### add()

> **add**(`promiseIndex`): `void`

The method that describes how a promise action adds it's *action* to the promise batch with the provided index.

**Parameters**

• **promiseIndex**: [`PromiseIndex`](https://near-sdk-js.gitbook.io/near-sdk-js/utils/type-aliases/promiseindex)

The index of the promise batch to attach the action to.

**Returns**

`void`

**Overrides**

[`PromiseAction`](https://near-sdk-js.gitbook.io/near-sdk-js/promise/classes/promiseaction).[`add`](https://near-sdk-js.gitbook.io/near-sdk-js/promise/promiseaction#add)

**Defined in**

[packages/near-sdk-js/src/promise.ts:134](https://github.com/near/near-sdk-js/blob/b58ac04fc6dff2f1120e9098c0cb059493486598/packages/near-sdk-js/src/promise.ts#L134)
