> ## Documentation Index
> Fetch the complete documentation index at: https://spiceflow-docs.spicenet.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Venue Transaction Hashes

> Save and query transaction hashes associated with specific venues (e.g., DeFi protocols) and action types (e.g., swap, deposit). 

## Endpoints

| Method | Endpoint                          | Description                   |
| ------ | --------------------------------- | ----------------------------- |
| `POST` | `/venue-tx-hashes`                | Save a venue transaction hash |
| `GET`  | `/venue-tx-hashes`                | Query tx hashes by filters    |
| `GET`  | `/venue-tx-hashes/verify/:txHash` | Verify a specific tx hash     |

***

## POST /venue-tx-hashes

Record a transaction hash with venue and action metadata.

### Request Body

```typescript theme={null}
{
  address: string;    // User wallet address
  txHash: Hash;       // Transaction hash
  actionType: string; // Action type (e.g., "swap", "deposit", "withdraw")
  venue: string;      // Venue identifier (e.g., "uniswap", "aave")
  chainId: number;    // Chain ID
}
```

### Response

**Success (200)**

```json theme={null}
{
  "success": true
}
```

**Error (400)**

```json theme={null}
{
  "success": false,
  "error": {
    "message": "Missing txHash, address, actionType, venue, or chainId"
  }
}
```

### Example

```bash theme={null}
curl -X POST /venue-tx-hashes \
  -H "Content-Type: application/json" \
  -d '{
    "address": "0x742d35Cc6634C0532925a3b844e4B7db0D6d8E5c",
    "txHash": "0x1234567890abcdef...",
    "actionType": "swap",
    "venue": "uniswap",
    "chainId": 84532
  }'
```

***

## GET /venue-tx-hashes

Query transaction hashes by address with optional filters.

### Query Parameters

| Parameter     | Type       | Required | Description                        |
| ------------- | ---------- | -------- | ---------------------------------- |
| `address`     | `string`   | Yes      | User wallet address                |
| `actionTypes` | `string[]` | No       | Filter by action type(s)           |
| `venue`       | `string`   | No       | Filter by venue                    |
| `count`       | `number`   | No       | Max results to return (default: 1) |

### Response

**Success (200)**

```json theme={null}
{
  "success": true,
  "data": {
    "txHashes": [
      {
        "address": "0x742d35Cc6634C0532925a3b844e4B7db0D6d8E5c",
        "txHash": "0x1234567890abcdef...",
        "actionType": "swap",
        "venue": "uniswap",
        "chainId": 84532
      }
    ]
  }
}
```

<Note>
  `success` is `true` only if the number of results matches the requested `count`.
</Note>

### Example

```bash theme={null}
# Get latest swap tx from uniswap for an address
curl "/venue-tx-hashes?address=0x742d35...&actionTypes=swap&venue=uniswap&count=1"

# Get last 5 transactions for an address
curl "/venue-tx-hashes?address=0x742d35...&count=5"
```

***

## GET /venue-tx-hashes/verify/:txHash

Verify that a specific transaction hash exists with expected metadata.

### Path Parameters

| Parameter | Type     | Required | Description      |
| --------- | -------- | -------- | ---------------- |
| `txHash`  | `string` | Yes      | Transaction hash |

### Query Parameters

| Parameter    | Type     | Required | Description          |
| ------------ | -------- | -------- | -------------------- |
| `actionType` | `string` | No       | Expected action type |
| `venue`      | `string` | No       | Expected venue       |

### Response

**Found (200)**

```json theme={null}
{
  "success": true,
  "data": {
    "address": "0x742d35Cc6634C0532925a3b844e4B7db0D6d8E5c",
    "txHash": "0x1234567890abcdef...",
    "actionType": "swap",
    "venue": "uniswap",
    "chainId": 84532
  }
}
```

**Not Found (404)**

```json theme={null}
{
  "success": false,
  "error": {
    "message": "Transaction hash not found"
  }
}
```

### Example

```bash theme={null}
# Verify a swap tx exists for uniswap
curl "/venue-tx-hashes/verify/0x1234...?actionType=swap&venue=uniswap"
```

## Use Cases

* **Transaction Tracking**: Store transaction references for user activity history
* **Verification**: Confirm a user completed a specific action on a venue
* **Rewards/Incentives**: Verify user actions for reward eligibility
