# Assets

Endpoints to list the assets and tokens supported by the system.

## Get Asset List

`GET /v2/assets/{source}`

Get all assets for a given source. If you are trading via a blockchain please use that as the source, if not use OFFCHAIN

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you wish to trade on to see its supported assets. |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `assets` | string[] |  |


  Example (Asset List Response):
  ```json
  {"assets":["btc","usd","gbp","eur","eth","sol"]}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid Order Source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/assets/{source}" \
  -H "Authorization: Bearer <token>"
```

---

## Get Token Information

`GET /v2/assets/{source}/token-information`

Get on-chain information for an asset

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you wish to trade on to see its supported tokens. |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `tokenInfoResponses` | TokenInfoResponse[] | tokenInformation |


  Example (Token Information):
  ```json
  {"tokenInfoResponses":[{"asset":"usd","tokens":[{"token":"usdc","tokenAddress":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","decimals":"6"}]}]}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid Order Source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/assets/{source}/token-information" \
  -H "Authorization: Bearer <token>"
```

---

