# Transactions

### :magic\_wand: Spell Index

Inspect the function name to learn more about how to use each spell!

## Get Incoming Transactions

<mark style="color:blue;">`GET`</mark> `/transactions/get_incoming_transactions`

Returns a list of the incoming transactions **(ERC20 or native)** for an address. Transactions whose dollar value is 0 are not included.

#### Query Parameters

| Name                                      | Type   | Description                    |
| ----------------------------------------- | ------ | ------------------------------ |
| address<mark style="color:red;">\*</mark> | String | The wallet address             |
| page\_size                                | String | Transactions included per page |
| page                                      | String | Pagination number              |

#### Headers

| Name                                  | Type   | Description  |
| ------------------------------------- | ------ | ------------ |
| api<mark style="color:red;">\*</mark> | String | Your API key |

{% tabs %}
{% tab title="200: OK Wizardry!" %}
{% code title="Example Python Input" lineNumbers="true" %}

```python
requests.get("https://wardanalyticsapi.com/transactions/get_incoming_transactions",
        headers = {
            "api": "YOUR_API_KEY"
        }, 
        params = {
            "address": "115GnsdVzGYDGQMeTeMxWUJZySfJ4pgiPT"
        })
```

{% endcode %}

{% code title="Example Output" %}

```json
{
    "total_page_count": 3, # How many pages will need to be scrolled through
    "transactions": [ # List of transactions
        {
         "blockNumber": 18793495, # Block number of the transaction
         "timestamp": 1702667255, # Timestamp of the transaction 
         "currency": "ETH", # Currency of the transaction
         "hash": "0xc8ad24f62c5a65dc4d83f7178b1c26fa1b6ed4a3341681d9c4e1520c7ed11503", # Hash of the transaction
         "inputs": [{"address": "0xb40969f60bfa246a09593099dace2ddd543254a3", "usdValue": 754, "value": 333000000000000000}], # List of inputs (only one for EVMs)
         "outputs": [{"address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", "usdValue": 754, "value": 333000000000000000}], # List of outputs (only one for EVMs)
         "usdValue": 754, # USD value of the transaction
         "value": 333000000000000000}, # Native value of the transaction
         ...
    ]
}    
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request Poorly Cast Spell" %}

{% endtab %}

{% tab title="401: Unauthorized Forbidden Magic (check your API key)" %}

{% endtab %}

{% tab title="429: Too Many Requests Mana Overflow" %}

{% endtab %}

{% tab title="404: Not Found Ancient Knowledge (address has no recent activity)" %}

{% endtab %}
{% endtabs %}

## Get Outgoing Transactions

<mark style="color:blue;">`GET`</mark> `/transactions/get_outgoing_transactions`

Returns a list of the outgoing transactions **(ERC20 or native)** for an address. Transactions whose dollar value is 0 are not included.

#### Query Parameters

| Name                                      | Type   | Description                    |
| ----------------------------------------- | ------ | ------------------------------ |
| address<mark style="color:red;">\*</mark> | String | The wallet address             |
| page\_size                                | String | Transactions included per page |
| page                                      | String | Pagination number              |

#### Headers

| Name                                  | Type   | Description  |
| ------------------------------------- | ------ | ------------ |
| api<mark style="color:red;">\*</mark> | String | Your API key |

{% tabs %}
{% tab title="200: OK Wizardry!" %}
{% code title="Example Python Input" lineNumbers="true" %}

```python
requests.get("https://wardanalyticsapi.com/transactions/get_outgoing_transactions",
        headers = {
            "api": "YOUR_API_KEY"
        }, 
        params = {
            "address": "115GnsdVzGYDGQMeTeMxWUJZySfJ4pgiPT"
        })
```

{% endcode %}

{% code title="Example Output" %}

```json
{
    "total_page_count": 3, # How many pages will need to be scrolled through
    "transactions": [ # List of transactions
        {
         "blockNumber": 18793495, # Block number of the transaction
         "timestamp": 1702667255, # Timestamp of the transaction 
         "currency": "ETH", # Currency of the transaction
         "hash": "0xc8ad24f62c5a65dc4d83f7178b1c26fa1b6ed4a3341681d9c4e1520c7ed11503", # Hash of the transaction
         "inputs": [{"address": "0xb40969f60bfa246a09593099dace2ddd543254a3", "usdValue": 754, "value": 333000000000000000}], # List of inputs (only one for EVMs)
         "outputs": [{"address": "0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad", "usdValue": 754, "value": 333000000000000000}], # List of outputs (only one for EVMs)
         "usdValue": 754, # USD value of the transaction
         "value": 333000000000000000}, # Native value of the transaction
         ...
    ]
}    
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request Poorly Cast Spell" %}

{% endtab %}

{% tab title="401: Unauthorized Forbidden Magic (check your API key)" %}

{% endtab %}

{% tab title="429: Too Many Requests Mana Overflow" %}

{% endtab %}

{% tab title="404: Not Found Ancient Knowledge (address has no recent activity)" %}

{% endtab %}
{% endtabs %}

### Primary Fields

Detailed information on primary fields of `/compliance/analyze-address`

<table><thead><tr><th width="302">Key</th><th>Explanation</th></tr></thead><tbody><tr><td><strong>total_page_count</strong> <mark style="color:blue;">int</mark></td><td>Number of pages that will need to be requested</td></tr><tr><td><strong>transactions</strong> <mark style="color:yellow;">field</mark></td><td>The list of transactions</td></tr><tr><td><strong>blockNumber</strong> <mark style="color:blue;">int</mark></td><td>Block number of the transaction</td></tr><tr><td><strong>timestamp</strong> <mark style="color:blue;">int</mark></td><td>Timestamp of the transaction</td></tr><tr><td><strong>currency</strong> <mark style="color:green;">string</mark></td><td>Currency of the transaction</td></tr><tr><td><strong>hash</strong> <mark style="color:green;">string</mark></td><td>Hash of the transaction</td></tr><tr><td><strong>inputs</strong> <mark style="color:yellow;">field</mark></td><td>List of inputs of the transaction (1 for EVMs)</td></tr><tr><td><strong>outputs</strong> <mark style="color:yellow;">field</mark></td><td>List of outputs of the transaction (1 for EVMs)</td></tr><tr><td><strong>value</strong> <mark style="color:blue;">int</mark></td><td>Native value of the transaction</td></tr><tr><td><strong>usdValue</strong> <mark style="color:blue;">int</mark></td><td>Converted dollar value of the transaction</td></tr></tbody></table>
