pineappleworkshop / ntc-services

0 stars 0 forks source link

Build GET /inscriptions/<ixID> endpoint to return inscription information #4

Open hathbanger opened 1 year ago

hathbanger commented 1 year ago

Notes / Response (Matt)

It may be wise to create some sort of cache system that allows us to query this information after the first pass since this information won't ever change. More to chat about.


info

build out endpoint to return inscription info by id.

id example: `65d9a42e48b97e9a77d200bd10b944c0d6f37651bf00a981e352382c0d4cdf76i0'

down to change the route path here as well.

current request / response below

request:

curl --location 'curl --location 'http://localhost:3000/api/inscriptions/65d9a42e48b97e9a77d200bd10b944c0d6f37651bf00a981e352382c0d4cdf76i0''

response:

{
    "data": {
        "inscription_name": "Bitcoin Monke #1519",
        "inscription_id": "65d9a42e48b97e9a77d200bd10b944c0d6f37651bf00a981e352382c0d4cdf76i0",
        "inscription_number": 309914,
        "metadata": {
            "name": "Bitcoin Monke #1519"
        },
        "wallet": "bc1p5pvvfjtnhl32llttswchrtyd9mdzd3p7yps98tlydh2dm6zj6gqsfkmcnd",
        "mime_type": "image/png",
        "media_length": 4222,
        "genesis_ts": 1678048045,
        "genesis_height": 779487,
        "genesis_fee": 1330,
        "output_value": 546,
        "satpoint": "507d326907da044441e9d6928442e9594d3e451eb6693ede5def0ab6e42b70c2:3:0",
        "last_sale_price": null,
        "collection_name": "Bitcoin Monkes",
        "collection_slug": "bitcoin-monkes",
        "last_transfer_block_height": 799246,
        "collection_floor_price": 80007,
        "ordswap_price": null,
        "magiceden_price": null,
        "ordinalswallet_price": null,
        "gammaio_price": null,
        "nostr_price": null,
        "odynals_price": null,
        "unisat_price": null,
        "ordinalsmarket_price": null,
        "content_url": "https://bis-ord-content.fra1.cdn.digitaloceanspaces.com/ordinals/65d9a42e48b97e9a77d200bd10b944c0d6f37651bf00a981e352382c0d4cdf76i0",
        "bis_url": "https://bestinslot.xyz/ordinals/inscription/65d9a42e48b97e9a77d200bd10b944c0d6f37651bf00a981e352382c0d4cdf76i0"
    },
    "block_height": 799614
}

here's the current endpoint (in js)

https://github.com/pineappleworkshop/nakamoto-trading-co/blob/dev/apps/nakamoto/app/api/inscriptions/%5Bid%5D/route.ts#L16-L41