Skip to content

Commit f2c354a

Browse files
committed
chore: cleanup
1 parent 30b52bc commit f2c354a

15 files changed

Lines changed: 2544 additions & 9121 deletions

blockfrost-openapi.yaml

Lines changed: 13 additions & 1330 deletions
Large diffs are not rendered by default.

docs/blockfrost-openapi.yaml

Lines changed: 22 additions & 1515 deletions
Large diffs are not rendered by default.

docs/midnight/index.html

Lines changed: 124 additions & 78 deletions
Large diffs are not rendered by default.

openapi.json

Lines changed: 2272 additions & 3719 deletions
Large diffs are not rendered by default.

openapi.yaml

Lines changed: 22 additions & 1515 deletions
Large diffs are not rendered by default.

spectaql.yaml

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,58 +16,60 @@ info:
1616
1717
The deployed version is **v3**. For the complete GraphQL schema specification, see the [Midnight Indexer GraphQL Schema](https://github.com/midnightntwrk/midnight-indexer/blob/release/3.0.0/indexer-api/graphql/schema-v3.graphql).
1818
19-
## Quick Start
20-
21-
```bash
22-
curl -X POST https://midnight-preview.blockfrost.io/api/v0 \
23-
-H "project_id: YOUR_PROJECT_ID" \
24-
-H "Content-Type: application/json" \
25-
-d '{"query": "{ block { hash height timestamp } }"}'
26-
```
27-
28-
## Endpoints
29-
30-
All GraphQL operations (queries, mutations, and subscriptions) use the same endpoint:
31-
* **HTTP:** `https://midnight-{network}.blockfrost.io/api/v0` (POST requests)
32-
* **WebSocket:** `wss://midnight-{network}.blockfrost.io/api/v0/ws` (for subscriptions)
33-
34-
Where `{network}` is either `mainnet` or `preview`.
35-
36-
## Authentication
37-
38-
Include your project ID as the `project_id` HTTP header.
19+
x-introItems:
20+
- title: Quick Start
21+
description: |
22+
Create a Midnight project on [blockfrost.io](https://blockfrost.io) and make your first API call:
3923
40-
When using WebSocket in the browser (which doesn't support custom headers), include your project ID as a subprotocol by prefixing it with `project_id_`:
41-
```javascript
42-
new WebSocket("wss://midnight-preview.blockfrost.io/api/v0/ws", [
43-
"graphql-transport-ws",
44-
"project_id_YOUR_PROJECT_ID"
45-
]);
46-
```
24+
```bash
25+
curl -X POST https://midnight-preview.blockfrost.io/api/v0 \
26+
-H "project_id: YOUR_PROJECT_ID" \
27+
-H "Content-Type: application/json" \
28+
-d '{"query": "{ block { hash height timestamp } }"}'
29+
```
4730
48-
## Request Format
31+
- title: Endpoints
32+
description: |
33+
All GraphQL operations (queries, mutations, and subscriptions) use the same endpoint:
34+
* **HTTP:** `https://midnight-{network}.blockfrost.io/api/v0` (POST requests)
35+
* **WebSocket:** `wss://midnight-{network}.blockfrost.io/api/v0/ws` (for subscriptions)
4936
50-
Send a POST request with a JSON body containing:
51-
* `query` (required): The GraphQL query, mutation, or subscription string
52-
* `variables` (optional): Variables for the GraphQL operation
37+
Currently available network is `preview`. The `mainnet` network is coming soon.
5338
54-
Example:
55-
```json
56-
{
57-
"query": "query GetBlock($offset: BlockOffset) { block(offset: $offset) { hash height } }",
58-
"variables": { "offset": { "height": 100 } }
59-
}
60-
```
39+
- title: Authentication
40+
description: |
41+
Include your project ID as the `project_id` HTTP header.
6142
62-
## Query Limits
43+
When using WebSocket in the browser (which doesn't support custom headers), include your project ID as a subprotocol by prefixing it with `project_id_`:
44+
```javascript
45+
new WebSocket("wss://midnight-preview.blockfrost.io/api/v0/ws", [
46+
"graphql-transport-ws",
47+
"project_id_YOUR_PROJECT_ID"
48+
]);
49+
```
6350
64-
The server may apply limitations to queries:
65-
* `max-depth`: Maximum nesting depth
66-
* `max-fields`: Maximum number of fields
67-
* `timeout`: Query execution timeout
68-
* `complexity`: Query complexity cost
51+
- title: Request Format
52+
description: |
53+
Send a POST request with a JSON body containing:
54+
* `query` (required): The GraphQL query, mutation, or subscription string
55+
* `variables` (optional): Variables for the GraphQL operation
56+
57+
Example:
58+
```json
59+
{
60+
"query": "query GetBlock($offset: BlockOffset) { block(offset: $offset) { hash height } }",
61+
"variables": { "offset": { "height": 100 } }
62+
}
63+
```
64+
65+
- title: Query Limits
66+
description: |
67+
The server may apply limitations to queries:
68+
* `max-depth`: Maximum nesting depth
69+
* `max-fields`: Maximum number of fields
70+
* `timeout`: Query execution timeout
71+
* `complexity`: Query complexity cost
6972
70-
x-introItems:
7173
- title: Scalar Types
7274
description: |
7375
The API uses custom scalar types:

src/definitions.yaml

Lines changed: 44 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ info:
235235
</table>
236236
237237
238-
## Midnight Indexer API
238+
## Midnight API
239239
240240
241241
The Midnight Indexer API exposes a GraphQL API that enables clients to query and subscribe to blockchain data—blocks, transactions, contracts, and wallet-related events—indexed from the Midnight blockchain.
@@ -248,7 +248,8 @@ info:
248248
249249
### Quick Start
250250
251-
Make your first API call:
251+
Create a Midnight project on [blockfrost.io](https://blockfrost.io) and make your first API call:
252+
252253
```bash
253254
curl -X POST https://midnight-{network}.blockfrost.io/api/v0 \
254255
-H "project_id: YOUR_PROJECT_ID" \
@@ -262,7 +263,7 @@ info:
262263
* **HTTP:** `https://midnight-{network}.blockfrost.io/api/v0` (POST requests)
263264
* **WebSocket:** `wss://midnight-{network}.blockfrost.io/api/v0/ws` (for subscriptions)
264265
265-
Where `{network}` is either `mainnet` or `preview`.
266+
Currently available network is `preview`. The `mainnet` network is coming soon.
266267
267268
### Request Format
268269
@@ -325,19 +326,6 @@ info:
325326
]);
326327
```
327328
328-
### Scalar Types
329-
330-
The API uses custom scalar types:
331-
332-
| Scalar | Description | Example |
333-
|--------|-------------|---------|
334-
| `HexEncoded` | Hex-encoded bytes (hashes, addresses, session IDs) | `"0x1234abcd..."` |
335-
| `ViewingKey` | Wallet viewing key in Bech32m or hex format | `"mn_shield-esk1abc..."` |
336-
| `CardanoRewardAddress` | Bech32-encoded Cardano reward address | `"stake_test1..."` |
337-
| `UnshieldedAddress` | Bech32m-encoded Midnight unshielded address | `"midnight1..."` |
338-
| `DustAddress` | Bech32m-encoded DUST address | `"midnight1..."` |
339-
| `Unit` | Empty return type for mutations with no data | `null` |
340-
341329
### Query Limits
342330
343331
The server may apply limitations to queries:
@@ -380,6 +368,15 @@ info:
380368
}
381369
```
382370
371+
### Available Operations
372+
373+
The following links will redirect you to the Midnight GraphQL API Reference:
374+
375+
* [**Queries**](midnight/#group-Operations-Queries): Fetch blockchain data (blocks, transactions, contracts, DUST status, governance parameters)
376+
* [**Mutations**](midnight/#group-Operations-Mutations): Wallet connection management (connect/disconnect)
377+
* [**Subscriptions**](midnight/#group-Operations-Subscriptions): Real-time updates via WebSocket (blocks, contract actions, transactions, ledger events)
378+
379+
383380
For the full list of available queries, mutations, subscriptions and types, see
384381
385382
[![GraphQL API Reference →](https://img.shields.io/badge/Midnight_GraphQL_Reference_→-0033AD?style=for-the-badge)](./midnight/)
@@ -391,10 +388,6 @@ servers:
391388
description: Cardano Preprod network
392389
- url: https://cardano-preview.blockfrost.io/api/v0
393390
description: Cardano Preview network
394-
- url: https://midnight-mainnet.blockfrost.io/api/v0
395-
description: Midnight Mainnet network
396-
- url: https://midnight-preview.blockfrost.io/api/v0
397-
description: Midnight Preview network
398391
- url: https://localhost:3000
399392
description: local
400393

@@ -436,37 +429,37 @@ tags:
436429
- name: IPFS » Add
437430
- name: IPFS » Gateway
438431
- name: IPFS » Pins
439-
- name: Midnight » Queries
440-
description: |
441-
Query data from the Midnight blockchain using the Midnight Indexer GraphQL API.
442-
443-
All queries are sent as POST requests to the `/` endpoint with the GraphQL query in the request body.
444-
- name: Midnight » Mutations
445-
description: |
446-
Execute mutations on the Midnight Indexer GraphQL API.
447-
448-
All mutations are sent as POST requests to the `/` endpoint with the GraphQL mutation in the request body.
449-
- name: Midnight » Subscriptions
450-
description: |
451-
Subscribe to real-time updates from the Midnight blockchain via WebSocket.
452-
453-
Connect to `wss://midnight-{network}.blockfrost.io/api/v0/ws` using the `graphql-transport-ws` protocol.
454-
455-
**Available subscriptions:**
456-
* `blocks` - Subscribe to new blocks
457-
* `contractActions` - Subscribe to contract actions for a specific address
458-
* `dustLedgerEvents` - Subscribe to DUST ledger events
459-
* `shieldedTransactions` - Subscribe to shielded transaction events for a wallet session
460-
* `unshieldedTransactions` - Subscribe to unshielded transaction events for an address
461-
* `zswapLedgerEvents` - Subscribe to zswap ledger events
462-
463-
**WebSocket Authentication:**
464-
```javascript
465-
new WebSocket("wss://midnight-preview.blockfrost.io/api/v0/ws", [
466-
"graphql-transport-ws",
467-
"project_id_YOUR_PROJECT_ID"
468-
]);
469-
```
432+
# - name: Midnight » Queries
433+
# description: |
434+
# Query data from the Midnight blockchain using the Midnight Indexer GraphQL API.
435+
436+
# All queries are sent as POST requests to the `/` endpoint with the GraphQL query in the request body.
437+
# - name: Midnight » Mutations
438+
# description: |
439+
# Execute mutations on the Midnight Indexer GraphQL API.
440+
441+
# All mutations are sent as POST requests to the `/` endpoint with the GraphQL mutation in the request body.
442+
# - name: Midnight » Subscriptions
443+
# description: |
444+
# Subscribe to real-time updates from the Midnight blockchain via WebSocket.
445+
446+
# Connect to `wss://midnight-{network}.blockfrost.io/api/v0/ws` using the `graphql-transport-ws` protocol.
447+
448+
# **Available subscriptions:**
449+
# * `blocks` - Subscribe to new blocks
450+
# * `contractActions` - Subscribe to contract actions for a specific address
451+
# * `dustLedgerEvents` - Subscribe to DUST ledger events
452+
# * `shieldedTransactions` - Subscribe to shielded transaction events for a wallet session
453+
# * `unshieldedTransactions` - Subscribe to unshielded transaction events for an address
454+
# * `zswapLedgerEvents` - Subscribe to zswap ledger events
455+
456+
# **WebSocket Authentication:**
457+
# ```javascript
458+
# new WebSocket("wss://midnight-preview.blockfrost.io/api/v0/ws", [
459+
# "graphql-transport-ws",
460+
# "project_id_YOUR_PROJECT_ID"
461+
# ]);
462+
# ```
470463

471464
paths:
472465
/:
@@ -880,36 +873,6 @@ paths:
880873
/nutlink/tickers/{ticker}:
881874
$ref: ./paths/api/nutlink/tickers/{ticker}/index.yaml
882875

883-
# midnight indexer - queries
884-
885-
/query/block:
886-
$ref: ./paths/midnight/block.yaml
887-
888-
/query/transactions:
889-
$ref: ./paths/midnight/transactions.yaml
890-
891-
/query/contract-action:
892-
$ref: ./paths/midnight/contract_action.yaml
893-
894-
/query/dust-generation-status:
895-
$ref: ./paths/midnight/dust_generation_status.yaml
896-
897-
/query/d-parameter-history:
898-
$ref: ./paths/midnight/d_parameter_history.yaml
899-
900-
# midnight indexer - mutations
901-
902-
/mutation/connect:
903-
$ref: ./paths/midnight/connect.yaml
904-
905-
/mutation/disconnect:
906-
$ref: ./paths/midnight/disconnect.yaml
907-
908-
# midnight indexer - subscriptions (WebSocket)
909-
910-
/ws:
911-
$ref: ./paths/midnight/subscriptions.yaml
912-
913876
components:
914877
schemas:
915878
onchain_metadata_cip25:

src/paths/midnight/block.yaml

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)