# getTransaction

Get information about a specific transaction.

## **Input Arguments**

<table><thead><tr><th width="260">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>txid: string</code></td><td>The id of the transaction you would like to get information about</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. If omitted, will default the network which the wallet is set to</td></tr></tbody></table>

## **Success Response**

The wallet will return the direct response from the RPC node.

## **Error Response**

<table><thead><tr><th width="266">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.getTransaction({
  txid: '0xfb3ecd6070e819187acaa307fb303fda7ae18577d98f948c4a4e13bce7ece474',
  network: 'MainNet'
})
.then(result => {
  console.log('Transaction details: ' + JSON.stringify(result));
})
.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;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});
```

### Response

```js
{
  txID: "0xfb3ecd6070e819187acaa307fb303fda7ae18577d98f948c4a4e13bce7ece474,
  vin: [
    {
      address: "AZy5LGtAvwpyJMYq39xX4MsDzAL2B6pEZn",
      assetID: "0xc56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",
      n: 0,
      txid: "0xd7769e675a47bea100e1e9ea5e1723ec181d90b601884ffc4837844d4ca95103",
      value: "4"
    }
  ],
  vout: [
    {
      address: "AZy5LGtAvwpyJMYq39xX4MsDzAL2B6pEZn",
      assetID: "0xc56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b",
      n: 0,
      value: "4"
    }
  ],
  sys_fee: "0",
  net_fee: "0",
  blockIndex: 3840003,
  blocktime: 1559707311
}
```
