# invoke

Calls one or more contracts on-chain and returns the relayed transaction hash.

## Parameters

#### 1. invocations *(required)*

`InvocationArguments[]`

Each invocation defines a contract hash, operation, arguments, and optional `abortOnFail`.

#### 2. signers *(optional)*

`Signer[]`

Witness scope information for the transaction.

#### 3. attributes *(optional)*

`TransactionAttribute[]`

Supported standard attributes include `HighPriority` and `OracleResponse`.

#### 4. options *(optional)*

`TransactionOptions`

```ts
type TransactionOptions = {
  suggestedSystemFee?: Integer;
  extraSystemFee?: Integer;
  validUntilBlock?: number;
};
```

## Returns

`Promise<UInt256>`

The relayed transaction hash.

## Errors

| Code    | Name        | Description                        |
| ------- | ----------- | ---------------------------------- |
| `10002` | `INVALID`   | One or more inputs are invalid.    |
| `10004` | `FAILED`    | Contract execution failed.         |
| `10005` | `TIMEOUT`   | The request timed out.             |
| `10006` | `CANCELED`  | The user rejected the transaction. |
| `10008` | `RPC_ERROR` | The RPC server returned an error.  |

## Example

### Request

```js
const txid = await provider.invoke(
  [
    {
      hash: "0xd2a4cff31913016155e38e474a2c06d08be276cf",
      operation: "transfer",
      args: [
        { type: "Hash160", value: "0x682cca3ebdc66210e5847d7f8115846586079d4a" },
        { type: "Hash160", value: "0xd45b7756498f83c9af7c2f71c66f8d6a8f6d6d11" },
        { type: "Integer", value: "100000000" },
        { type: "Any" },
      ],
      abortOnFail: true,
    },
  ],
  [
    {
      account: "0x682cca3ebdc66210e5847d7f8115846586079d4a",
      scopes: "CalledByEntry",
    },
  ],
  [],
  {
    extraSystemFee: "10000",
    suggestedSystemFee: "1000000",
  },
);
```

### Response

```js
"0x1f4d1defa46faa5e7b9b8d3f79a06bec777d7c26c4aa5f6f5899a291daa87c15"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tutorial.neoline.io/reference/neo3-provider-api/invoke.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
