# STAS Tokens (Beta)

STAS is a token protocol that consists of a bitcoin script for locking/unlocking bitcoin transaction outputs. Read more in the [official documentation](https://docs.stastoken.com/).

## Get All Tokens

This endpoint retrieves a list of supported tokens along with the relevant metadata.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/tokens
```

{% endcode %}

{% code title="Example Request" %}

```shell
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tokens"
```

{% endcode %}

{% code title="Example Response" %}

```json
{
    "tokens": [
        {
            "description": "-",
            "image": "https://firebasestorage.googleapis.com/v0/b/musicartstaging/o/nftAssets%2F3e75ba7e-fa51-4efb-a483-3b2c71bab180_250x250?alt=media",
            "name": "fdsfs",
            "properties": {
                "issuer": {
                    "email": "info@musicart.io",
                    "governing_law": "England and Wales",
                    "issuer_country": "UK",
                    "jurisdiction": "UK",
                    "legal_form": "Limited",
                    "organisation": "Calekta Limited"
                },
                "legal": {
                    "terms": "\u00a9 2020 TAAL TECHNOLOGIES SEZC\nALL RIGHTS RESERVED. ANY USE OF THIS SOFTWARE IS SUBJECT TO TERMS AND CONDITIONS OF LICENSE. USE OF THIS SOFTWARE WITHOUT LICENSE CONSTITUTES INFRINGEMENT OF INTELLECTUAL PROPERTY. FOR LICENSE DETAILS OF THE SOFTWARE, PLEASE REFER TO: www.taal.com/stas-token-license-agreement"
                }
            },
            "protocol": "STAS",
            "schema_id": "NFT1.0/MA",
            "symbol": "ujtVA5",
            "token_id": "7bfb2ae7e878d107191259c1be72cf116da3f59d"
        },
        {
            "token_id": "2",
            "protocol": "STAS",
            "ticker": "CIPS",
            ....
        }
        ]
}
```

{% endcode %}

**URL Parameters**

<table><thead><tr><th width="381">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>network</td><td>Selected network: <code>main</code>.</td></tr></tbody></table>

## Get Token by ID

This endpoint retrieves the token metadata including contract and issuance details.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/token/<tokenId>/<symbol>
```

{% endcode %}

{% code title="Example Request" %}

```shell
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/token/c402bc341157265f5f8a747c11099847056a229a/test1124"
```

{% endcode %}

{% code title="Example Response" %}

```json
{
    "token": {
        "contract_txs": [
            "72ae93f5fdc5a4fa5abfab780d7d1c8ad988d25ae34578b80dce5ff9e5c3db03"
        ],
        "description": "generating stas token",
        "image": "https://firebasestorage.googleapis.com/v0/b/nftdev/o/nftTemp%2FWL1DdD?alt=media",
        "issuance_txs": [
            "b00bcc9dfc7dd483ff989f3d1d3f091b23e88ca2207c9e15788e3e84a5b10c8b"
        ],
        "name": "test",
        "properties": {
            "issuer": {
                "email": "info@vaionex.com",
                "governing_law": "US",
                "issuer_country": "US",
                "jurisdiction": "US",
                "legal_form": "Limited",
                "organisation": "vaionex corp."
            },
            "legal": {
                "terms": "test"
            }
        },
        "protocol": "STAS",
        "schema_id": "NFT1.0/MA",
        "symbol": "test1124",
        "token_id": "c402bc341157265f5f8a747c11099847056a229a",
        "tx_count": 3
    }
}
```

{% endcode %}

**URL Parameters**

| Parameter | Description                                   |
| --------- | --------------------------------------------- |
| network   | Selected network: `main`.                     |
| tokenId   | Unique ID of the token.                       |
| symbol    | Symbol used in the registration of the token. |

## Get Token UTXOs for Address

This endpoint retrieves the token UTXOs for a given address.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/address/<address>/tokens/unspent
```

{% endcode %}

{% code title="Example Request" %}

```shell
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/1GJ3x5bcEnKMnzNFPPELDfXUCwKEaLHM5H/tokens/unspent"
```

{% endcode %}

{% code title="Example Response" %}

```json
{
    "address": "1JsQieDaYUg5pSRtpeEQhTv3buHvSX7WH4",
    "utxos": [
        {
            "amount": 2000,
            "index": 1,
            "redeemAddr": "c402bc341157265f5f8a747c11099847056a229a",
            "symbol": "test1124",
            "txid": "cf3968e6950286cf94aa9efb7a1cc1b9c74190d159ff6d2a4dc7d9feb6e50c55"
        }
    ]
}
```

{% endcode %}

**URL Parameters**

| Parameter | Description               |
| --------- | ------------------------- |
| network   | Selected network: `main`. |
| address   | Address.                  |

## Get Address Token Balance

This endpoint retrieves the token balances for a given address.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/address/<address>/tokens
```

{% endcode %}

{% code title="Example Request" %}

```shell
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/1JsQieDaYUg5pSRtpeEQhTv3buHvSX7WH4/tokens"
```

{% endcode %}

{% code title="Example Response" %}

```json
{
    "address": "1JsQieDaYUg5pSRtpeEQhTv3buHvSX7WH4",
    "tokens": [
        {
            "balance": 0,
            "image": "https://firebasestorage.googleapis.com/v0/b/nftdev/o/nftTemp%2FWL1DdD?alt=media",
            "protocol": "STAS",
            "redeemAddr": "c402bc341157265f5f8a747c11099847056a229a",
            "symbol": "test2"
        },
        {
            "balance": -2000,
            "image": "https://firebasestorage.googleapis.com/v0/b/nftdev/o/nftTemp%2FWL1DdD?alt=media",
            "protocol": "STAS",
            "redeemAddr": "c402bc341157265f5f8a747c11099847056a229a",
            "symbol": "test1124"
        }
    ]
}
```

{% endcode %}

**URL Parameters**

| Parameter | Description               |
| --------- | ------------------------- |
| network   | Selected network: `main`. |
| address   | Address.                  |

## Get Token Transactions

This endpoint retrieves the transactions for a given token.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/token/<tokenId>/<symbol>/tx
```

{% endcode %}

{% code title="Example Request" %}

```shell
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/token/c402bc341157265f5f8a747c11099847056a229a/test1124/tx"
```

{% endcode %}

{% code title="Example Response" %}

```json
{
    "redeem_addr": "c402bc341157265f5f8a747c11099847056a229a",
    "symbol": "test1124",
    "txs": [
        "cf3968e6950286cf94aa9efb7a1cc1b9c74190d159ff6d2a4dc7d9feb6e50c55",
        "b00bcc9dfc7dd483ff989f3d1d3f091b23e88ca2207c9e15788e3e84a5b10c8b",
        "72ae93f5fdc5a4fa5abfab780d7d1c8ad988d25ae34578b80dce5ff9e5c3db03"
    ]
}
```

{% endcode %}

**URL Parameters**

| Parameter | Description                                   |
| --------- | --------------------------------------------- |
| network   | Selected network: `main`.                     |
| tokenId   | Unique ID of the token.                       |
| symbol    | Symbol used in the registration of the token. |

## Get Token Output Details

This endpoint returns the details of a valid token output or *Not Found (404)* for an invalid token output.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/token/tx/<txid>/out/<index>
```

{% endcode %}

{% code title="Example Request" %}

```shell
curl --location --request GET "wget -O- https://api.whatsonchain.com/v1/bsv/main/token/tx/cf3968e6950286cf94aa9efb7a1cc1b9c74190d159ff6d2a4dc7d9feb6e50c55/out/1"
```

{% endcode %}

{% code title="Example Response" %}

```json
{
    "has_data": true,
    "icon_url": "https://firebasestorage.googleapis.com/v0/b/nftdev/o/nftTemp%2FWL1DdD?alt=media",
    "index": 1,
    "is_splittable": true,
    "symbol": "test1124",
    "token_id": "c402bc341157265f5f8a747c11099847056a229a",
    "txid": "cf3968e6950286cf94aa9efb7a1cc1b9c74190d159ff6d2a4dc7d9feb6e50c55",
    "value": 2000
}
```

{% endcode %}

**URL Parameters**

| Parameter | Description               |
| --------- | ------------------------- |
| network   | Selected network: `main`. |
| txid      | Transaction ID.           |
| index     | Output/Vout index.        |

### Need an additional API endpoint?

If you want to make a request for an additional API endpoint that would help with your use case, please reach out to us using our [WoC Telegram channel](http://t.me/+SNmGhFqKVB9kf%E2%80%A6). Please provide as much detail on what you're trying to achieve as possible.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.taal.com/core-products/whatsonchain/tokens/stas-tokens-beta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
