# invoke

Invoke allows for the generic execution of smart contracts on behalf of the user. It is reccommended to have a general understanding of the NEO blockchain, and to be able successfully use all other commands listed previously in this document before attempting a generic contract execution.

## **Input Arguments**

<table><thead><tr><th width="365">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>scriptHash: string</code></td><td>Script hash of the smart contract to invoke</td></tr><tr><td><code>operation: string</code></td><td>Operation on the smart contract to call</td></tr><tr><td><code>args:</code> <a href="/pages/rXB7bxkMWK9PL7o1S4NL#argument"><img src="http://localhost:8080/assets/images/info.svg" alt="i"></a><code>Argument[]</code></td><td>Any input arguments for the operation</td></tr><tr><td><code>fee?: string</code></td><td>The parsed amount of network fee (in GAS) to include with transaction</td></tr><tr><td><code>extraSystemFee?: string</code></td><td>This fee will be added to system fee</td></tr><tr><td><code>overrideSystemFee?: string</code></td><td>This fee will override the system fee</td></tr><tr><td><code>broadcastOverride?: boolean</code></td><td>In the case that the dApp would like to be responsible for broadcasting the signed transaction rather than the wallet provider</td></tr><tr><td><code>signers:</code> <a href="/pages/V8k8yTt2mQwID5CyTYZb#signer"><img src="http://localhost:8080/assets/images/info.svg" alt="i"></a><code>Signers[]</code></td><td>Sender and the effective scope of signature</td></tr></tbody></table>

### Argument

<table><thead><tr><th width="392">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>

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

<table><thead><tr><th width="283">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="289">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.invoke({
    scriptHash: '0x1415ab3b409a95555b77bc4ab6a7d9d7be0eddbd',
    operation: 'transfer',
    args: [
        {
            type: "Address",
            value: "NaUjKgf5vMuFt7Ffgfffcpc41uH3adx1jq",
        },
        {
            type: "Address",
            value: "NaUjKgf5vMuFt7Ffgfffcpc41uH3adx1jq",
        },
        {
            type: "Integer",
            value: "1",
        },
        {
            type: "Any",
            value: null,
        }
    ],
    fee: '0.0001',
    broadcastOverride: false,
    signers: [
        {
            account: "2cab903ff032ac693f8514581665be534beac39f",
            scopes: 16,
            allowedContracts: ["0x1415ab3b409a95555b77bc4ab6a7d9d7be0eddbd", "0xef4073a0f2b305a38ec4050e4d3d28bc40ea63f5"],
            allowedGroups: []
        }
    ]
})
.then(result => {
    console.log('Invoke transaction success!');
    console.log('Transaction ID: ' + result.txid);
    console.log('RPC node URL: ' + result.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'
};
```


---

# 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-legacy/write-methods/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.
