# Hosted Rare Sats

## Application

Application contact sating team for API access and hosted wallet preparation.

Sating will grant ***platform\_id*** and ***secret\_key*** which will be used in each API for authentication.

### signature

Application should add ***signature*** parameter in each API call.&#x20;

```javascript
const crypto = require('crypto');
const stringify = require('fast-json-stable-stringify');

function GenerateSignature(payload, key) {
  const hmac = crypto.createHmac('sha256', key);
  hmac.update(payload);
  const signature = hmac.digest('hex');
  return signature;
}
const secret_key = "xxx"; // get from sating
const platform_id = "xxx"; // get from sating
const req_without_sig = {
  platform_id,
  ...
};
const payload = stringify(req_without_sig);
GenerateSignature(payload, secret_key);

```

## API

<mark style="background-color:orange;">**POST**</mark>**&#x20;Estimate Inscribe Fee**

## Estimate inscribe fee

<mark style="color:green;">`POST`</mark> `https://api.sating.io/api/inscription/estimate`

This endpoint will estimate inscribe fees according to the given address and file.

#### Request Body

| Name                                               | Type   | Description                         |
| -------------------------------------------------- | ------ | ----------------------------------- |
| fee\_rate<mark style="color:red;">\*</mark>        | number | sats/vbyte                          |
| postage<mark style="color:red;">\*</mark>          | number | inscription utxo size, default 546. |
| receive\_address<mark style="color:red;">\*</mark> | string | address to receive inscription      |
| file\_size<mark style="color:red;">\*</mark>       | number | file size in bytes                  |
| signature<mark style="color:red;">\*</mark>        | string | signature                           |
| platform\_id<mark style="color:red;">\*</mark>     | string | platform id                         |

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

```json
{
    "fee_rate": 14,
    "postage": 546,
    "network_fee": 10528,
    "service_fee": 4526,
    "total_fee": 15600
}
```

{% endtab %}
{% endtabs %}

<mark style="background-color:orange;">**POST**</mark>**&#x20;Inscribe**

## start inscribe

<mark style="color:green;">`POST`</mark> `https://api.sating.io/api/inscription/inscribe`

#### Request Body

| Name                                               | Type   | Description                    |
| -------------------------------------------------- | ------ | ------------------------------ |
| receive\_address<mark style="color:red;">\*</mark> | string | address to receive inscription |
| fee\_rate<mark style="color:red;">\*</mark>        | number | sats/vbyte                     |
| postage<mark style="color:red;">\*</mark>          | number | inscription postage size       |
| url<mark style="color:red;">\*</mark>              | string | publicly accessible url        |
| filename<mark style="color:red;">\*</mark>         | string | extension must be correct      |
| platform\_id<mark style="color:red;">\*</mark>     | string | platform                       |
| signature<mark style="color:red;">\*</mark>        | string |                                |
| sat\_type<mark style="color:red;">\*</mark>        | string | see sat\_type enum table       |

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

```json
{
    "request_id": "e28629f9-64b1-5c9b-8c56-8e66d0fd8af7",
    "fee_rate": 14,
    "postage": 546,
    "network_fee": 3682,
    "service_fee": 4184,
    "total_fee": 8412
}
```

{% endtab %}
{% endtabs %}

<mark style="background-color:orange;">**POST**</mark>**&#x20;Query Inscribe**

## query inscribe status

<mark style="color:green;">`POST`</mark> `https://api.sating.io/api/inscription/inscribe`

#### Request Body

| Name                                               | Type   | Description                              |
| -------------------------------------------------- | ------ | ---------------------------------------- |
| request\_id<mark style="color:red;">\*</mark>      | string | request id returned in inscribe response |
| receive\_address<mark style="color:red;">\*</mark> | string | address to receive inscription           |
| platform\_id<mark style="color:red;">\*</mark>     | string | platform                                 |
| signature                                          | string |                                          |

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

```json
{
    "request_id": "181782fb-fdd3-50cf-9736-d5a32949310b",
    "fee_rate": 14,
    "postage": 546,
    "network_fee": 3682,
    "service_fee": 4184,
    "total_fee": 8412,
    "receive_address": "bc1p2twa9r5h98gklwt6xcrz3z63updx0eq6rvemfca23kkxpq6gxx8sxecwms",
    "sat_inscribe": "391567463357",
    "tx_hash": "a141cd4417f28ad39e8dea310c47188d4b342a257e0c67845107ef78c90044f5"
    "status": "Pending",
    "time": "2023-09-17 01:59:43",
}
```

{% endtab %}
{% endtabs %}

## Reference

### inscribe status

| Status    | Description                 |
| --------- | --------------------------- |
| Pending   | Payment Transaction is sent |
| Inscribed | Inscribe complete           |
| Failed    | Contact our team            |

### support sat type

| sat type                   |
| -------------------------- |
| block\_78                  |
| block\_9                   |
| pizza                      |
| nakamoto                   |
| hitman                     |
| vintage                    |
| silk\_road\_first\_auction |
| black                      |
| uncommon                   |
| palindromes\_integer       |


---

# 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.sating.io/sating-api/hosted-rare-sats.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.
