# invokeMultiple

Invoke Multiple functions the same as Invoke, but accepts inputs to execute multiple invokes in the same transaction.

## **Input Arguments**

| Parameter                                                                                                                                        | Description                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fee?: string`                                                                                                                                   | If a fee is specified then the wallet SHOULD NOT override it, if a fee is not specified the wallet SHOULD allow the user to attach an optional fee |
| `extraSystemFee?: string`                                                                                                                        | This fee will be added to system fee                                                                                                               |
| `overrideSystemFee?: string`                                                                                                                     | This fee will override the system fee                                                                                                              |
| `invokeArgs?:` [![i](http://localhost:8080/assets/images/info.svg)](#invokearguments)`InvokeArguments[]`                                         | Array of contract invoke inputs                                                                                                                    |
| `broadcastOverride?: boolean`                                                                                                                    | If this flag is set to True, the wallet provider will return the signed transaction rather than broadcasting to a node.                            |
| `signers:` [![i](http://localhost:8080/assets/images/info.svg)](https://tutorial.neoline.io/reference/read-methods/invokeread#signer)`Signers[]` | Sender and the effective scope of signature                                                                                                        |

### InvokeArguments

<table><thead><tr><th width="319">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>scriptHash: string</code></td><td>The script hash of the contract that you wish to invoke</td></tr><tr><td><code>operation: string</code></td><td>The operation on the smart contract that you wish to call. This can be fetched from the contract ABI</td></tr><tr><td><code>args:</code> <a href="#argument"><img src="http://localhost:8080/assets/images/info.svg" alt="i"></a><code>Argument[]</code></td><td>A list of arguments necessary to perform on the operation you wish to call</td></tr></tbody></table>

### Argument

<table><thead><tr><th width="411">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>type: 'String' | 'Boolean' | 'Hash160' | 'Hash256' | 'Integer' | 'ByteArray' | 'Array' | 'Address'</code></td><td>The type of the argument with you are using</td></tr><tr><td><code>value: any</code></td><td>String representation of the argument which you are using</td></tr></tbody></table>

## **Success Response**

In the case where the "broadcastOverride" input argument is not set, or set to false.

<table><thead><tr><th width="268">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>txid: string</code></td><td>The transaction ID of the invocation</td></tr><tr><td><code>nodeURL: string</code></td><td>The node which the transaction was broadcast to. Returned if transaction is broadcast by wallet provider</td></tr></tbody></table>

In the case where the "broadcastOverride" input argument is set to True.

<table><thead><tr><th width="275">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>signedTx: string</code></td><td>The serialized signed transaction. Only returned if the broadcastOverride input argument was set to True</td></tr></tbody></table>

## **Error Response**

<table><thead><tr><th width="277">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>type: string</code></td><td>The type of error which has occured</td></tr><tr><td><code>description: string</code></td><td>A description of the error which has occured</td></tr><tr><td><code>data: string</code></td><td>Any raw data associated with the error</td></tr></tbody></table>

## Example

### Request

```js
neolineN3.invokeMultiple({
    invokeArgs: [
        {
            scriptHash: "ef4073a0f2b305a38ec4050e4d3d28bc40ea63f5",
            operation: "transfer",
            args: [
                {
                    type: "Address",
                    value: "NaUjKgf5vMuFt7Ffgfffcpc41uH3adx1jq",
                },
                {
                    type: "Address",
                    value: "NaUjKgf5vMuFt7Ffgfffcpc41uH3adx1jq",
                },
                {
                    type: "Integer",
                    value: "1",
                },
                {
                    type: "Any",
                    value: null
                }
            ]
        },
        {
            scriptHash: "ef4073a0f2b305a38ec4050e4d3d28bc40ea63f5",
            operation: "transfer",
            args: [
                {
                    type: "Address",
                    value: "NaUjKgf5vMuFt7Ffgfffcpc41uH3adx1jq",
                },
                {
                    type: "Address",
                    value: "NPsCvedTnzGcwSYuoxjh7Sec5Zem2vgVmX",
                },
                {
                    type: "Integer",
                    value: "1",
                },
                {
                    type: "Any",
                    value: null
                }
            ]
        }
    ],
    fee: '0.001',
    broadcastOverride: true,
    signers: [
        {
            account: "2cab903ff032ac693f8514581665be534beac39f",
            scopes: 1
        }
    ]
})
.then(({txid, nodeURL}: InvokeOutput) => {
    console.log('Invoke transaction success!');
    console.log('Transaction ID: ' + txid);
    console.log('RPC node URL: ' + nodeURL);
})
.catch((error) => {
    const {type, description, data} = error;
    switch(type) {
        case 'NO_PROVIDER':
            console.log('No provider available.');
            break;
        case 'RPC_ERROR':
            console.log('There was an error when broadcasting this transaction to the network.');
            break;
        case 'CANCELED':
            console.log('The user has canceled this transaction.');
            break;
        default:
            // Not an expected error object.  Just write the error to the console.
            console.error(error);
            break;
    }
});
```

### Response

```js
{
    txid: '0xd6e4edeb66a75b79bec526d14664017eef9ccee5650c32facb1a4d4fe3640808',
    nodeURL: 'https://neo3-testnet.neoline.vip'
};
```
