# send

Invoke a transfer of a specified amount of a given asset from the connected account to another account.

## **Input Arguments**

<table><thead><tr><th width="328">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>fromAddress: string</code></td><td>Address of the connected account to send the assets from</td></tr><tr><td><code>toAddress: string</code></td><td>Address of the receiver of the assets to be sent</td></tr><tr><td><code>asset: string</code></td><td>Asset script hash to be sent. Accepts asset symbol only for "MainNet"</td></tr><tr><td><code>amount: string</code></td><td>The parsed amount of the asset to be sent</td></tr><tr><td><code>remark?: string</code></td><td>Description of the transaction to be made</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>network?: string</code></td><td>Network to submit this request to. If omitted, will default to network the wallet is currently set to</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></tbody></table>

## **Success Response**

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

<table><thead><tr><th width="266">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>txid: string</code></td><td>The transaction ID of the send 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="264">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>txid: string</code></td><td>The transaction ID of the send invocation</td></tr><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="269">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
neoline.send({
  fromAddress: 'AWSEU4BXpjGVdw9ajnFBXh8Rg8cgw9f3Zo',
  toAddress: 'ALWNCcuQDoE287UWvYhRZYpPBDfswggbTX',
  asset: 'NEO',
  amount: '1',
  remark: 'NEOLine',
  fee: '0.0001',
  network: 'TestNet',
  broadcastOverride: false
})
.then(result => {
  console.log('Send 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 'MALFORMED_INPUT':
        console.log('The receiver address provided is not valid.');
        break;
    case 'CANCELED':
        console.log('The user has canceled this transaction.');
        break;
    case 'INSUFFICIENT_FUNDS':
        console.log('The user has insufficient funds to execute this transaction.');
        break;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});
```

### Response

```js
{
  txid: 'cb0cf81cdd75762545965038cea350c717a5d500bb40d4ca80fe45f416f564ac',
  nodeURL: 'https://testnet.api.neoline.io'
}
```
