# AddressDB

## Resync

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:31567/addressdb/resync`

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Adressess Balance

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:31567/addressdb/balance`

Given a list of addresses return the balance per asset of those addresses

#### Path Parameters

| Name       | Type  | Description |
| ---------- | ----- | ----------- |
| addressess | array | addressess  |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Addressess Outputs

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:31567/addressdb/outputs`

Given a list of addresses and a mode return a list of outpoint and spend per address

#### Request Body

| Name       | Type   | Description        |
| ---------- | ------ | ------------------ |
| mode       | string | all or unspentOnly |
| addressess | array  | address list       |

{% tabs %}
{% tab title="200 " %}

```
[
   {
        outpoint: Outpoint,
        spend: {
            asset: string,
            amount: number
        },
        lock: {
            PK?: {
                hash: string,
                address: string
            },
            Coinbase?: {
                blockNumber: number,
                pkHash: string,
                address: string
            },/// all the other lock as well
        }
    }

]
```

{% endtab %}
{% endtabs %}

## Addressess Transactions

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:31567/addressdb/transactions`

Given a list of addresses return the transaction count with the skip and take methods

#### Request Body

| Name       | Type   | Description        |
| ---------- | ------ | ------------------ |
| take       | string | used in pagination |
| skip       | string | used in pagination |
| addressess | array  | address list       |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Addressess Transaction Count

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:31567/addressdb/transactioncount`

Given a list of addresses return the transaction count

#### Request Body

| Name       | Type  | Description  |
| ---------- | ----- | ------------ |
| addressess | array | address list |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Contract History

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:31567/contract/history`

Given a contractID return the history of the execution of that contract

#### Request Body

| Name       | Type   | Description        |
| ---------- | ------ | ------------------ |
| take       | string | used in pagination |
| skip       | string | used in pagination |
| contractId | string | contract ID        |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}

## Contract Info

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:31567/contract/info`

This is used to compute the hints and queries for the contract activation in ZenJs.

#### Request Body

| Name   | Type   | Description                                                                                                                                                       |
| ------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| rlimit | string | Zebra's rlimit for recording hints                                                                                                                                |
| code   | string | Send valid fstar code, for example: `let main _ _ _ _ _ _ _ _ = Zen.ResultT.failw \"This contract does nothing\"\nlet cf _ _ _ _ _ _ _ = Zen.Cost.ret (1 <: nat)` |

{% tabs %}
{% tab title="200 " %}

```
{
    "contractId": "00000000e126b3c70693a7661109d7c7350128f48bf59a7a79ca39a65cf0fc78a9ca7436",
    "address": "ctzn1qqqqqqq8py6euwp5n5anpzzwhcu6sz285306e57neegu6vh8sl3u2njn5xc4qap9y",
    "hints": "[\"04f68069bd73872a976a71eb765538d9\",[[\"Ze126b3c70693a7661109d7c7350128f48bf59a7a79ca39a65cf0fc78a9ca7436.mainFunction\",1,2,1,[\"@MaxIFuel_assumption\",\"@query\",\"Prims_pretyping_ae567c2fb75be05905677af440075565\",\"Prims_pretyping_ce036b6b736ef4e0bc3a9ff132a12aed\",\"Zen.Types.Main_pretyping_5bd8c5a85db081605d2f2b0ef5761cbb\",\"Zen.Types.Main_pretyping_8d0bd552ce32ff91a3c9f4725122e3be\",\"data_typing_intro_Zen.Types.Main.Anonymous@tok\",\"equation_Prims.nat\",\"equation_Ze126b3c70693a7661109d7c7350128f48bf59a7a79ca39a65cf0fc78a9ca7436.cf\",\"equation_Zen.Types.Main.maxCost\",\"fuel_guarded_inversion_Zen.Types.Main.context\",\"function_token_typing_Prims.nat\",\"int_typing\",\"lemma_Zen.Cost.Realized.force_inc\",\"lemma_Zen.Cost.Realized.force_ret\",\"primitive_Prims.op_Addition\",\"proj_equation_Zen.Types.Main.CostFunc_f\",\"proj_equation_Zen.Types.Main.CostFunc_n\",\"projection_inverse_BoxInt_proj_0\",\"projection_inverse_Zen.Types.Main.CostFunc_f\",\"projection_inverse_Zen.Types.Main.CostFunc_n\",\"refinement_interpretation_Prims_Tm_refine_ba523126f67e00e7cd55f0b92f16681d\",\"refinement_interpretation_Zen.Types.Main_Tm_refine_8ae4abcfc6bc8d4903b7e1f40e070ec2\",\"string_inversion\",\"token_correspondence_Ze126b3c70693a7661109d7c7350128f48bf59a7a79ca39a65cf0fc78a9ca7436.cf\",\"token_correspondence_Zen.Types.Main.__proj__CostFunc__item__f\",\"typing_Zen.Cost.Realized.ret\"],0,\"17bfc1c24d1308a3cb3612020f013590\"]]]\n",
    "queries": 27,
    "rlimit": 2723280
}
```

{% endtab %}
{% endtabs %}


---

# 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.zenprotocol.com/apps/headless/api/addressdb.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.
