Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/scripts/generate-meta-schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ const metaSchema = z.object({
'\n}',
'\n```',
].join(' ')),

/**
* Optional tag of the folder in the sidebar (page tree on the left).
*
* This is custom field that extends the default schema.
*/
tag: z.string().optional().describe([
'Optional tag of the folder in the sidebar (page tree on the left).',
'\nThis is custom field that extends the default schema.',
].join(' ')),
});

const metaJsonSchema = z.toJSONSchema(metaSchema);
Expand Down
65 changes: 65 additions & 0 deletions .github/scripts/generate-openapi-pages.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import path from 'node:path';
import { generateFiles } from 'fumadocs-openapi';
import { createOpenAPI } from 'fumadocs-openapi/server';

/**
* @type {Omit<import('fumadocs-openapi').Config, 'input' | 'output'>}
*/
const commonConfig = {
frontmatter: () => ({ noindex: true }),
includeDescription: true,
addGeneratedComment: true,
beforeWrite: (files) => files.forEach(file => file.content += '\n'),
};

/**
* @param name {string}
*/
const commonNameTransform = (name) => (name
.toLocaleLowerCase()
.replace(/[^a-z0-9\s\-]/g, '')
.replace(/\s+/g, '-')
.replace(/-+/g, '-')
.replace(/^-+/, '')
.replace(/-+$/, '')
);

const genV2 = async () => await generateFiles({
...commonConfig,
input: createOpenAPI({
// NOTE: Key here must match the one used in .github/scripts/generate-openapi-pages.mjs
input: () => ({ 'v2': path.resolve('./content/ecosystem/api/toncenter/v2.json') })
}),
output: path.resolve('./content/ecosystem/api/toncenter/v2'),
per: 'operation',
groupBy: 'tag',
name: (path) => commonNameTransform(path.info.title),
});

const genV3 = async () => await generateFiles({
...commonConfig,
input: createOpenAPI({
// NOTE: Key here must match the one used in .github/scripts/generate-openapi-pages.mjs
input: () => ({ 'v3': path.resolve('./content/ecosystem/api/toncenter/v3.yaml') })
}),
output: path.resolve('./content/ecosystem/api/toncenter/v3'),
per: 'operation',
groupBy: 'tag',
name: (path) => commonNameTransform(path.info.title),
});

const genSmcIndex = async () => await generateFiles({
...commonConfig,
input: createOpenAPI({
// NOTE: Key here must match the one used in .github/scripts/generate-openapi-pages.mjs
input: () => ({ 'smc-index': path.resolve('./content/ecosystem/api/toncenter/smc-index.json') })
}),
output: path.resolve('./content/ecosystem/api/toncenter/smc-index'),
per: 'operation',
groupBy: 'none',
name: (path) => commonNameTransform(path.info.title),
});

await genV2();
await genV3();
await genSmcIndex();
12 changes: 6 additions & 6 deletions .github/scripts/generate-v3-api-table.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
'vesting',
'stats',
'utils',
'api/v2',
'api v2',
]

# Map tag slugs to Mintlify's actual URL slugs
TAG_SLUG_MAP = {
'api-v2': 'apiv2',
}
# TAG_SLUG_MAP = {
# 'api-v2': 'api-v2',
# }


def load_openapi_spec(filepath: Path) -> dict:
Expand Down Expand Up @@ -78,7 +78,7 @@ def generate_mintlify_link(endpoint: dict) -> str:
tag = endpoint['tag'].lower().replace(' ', '-').replace('_', '-').replace('/', '-')

# Apply tag slug mapping for Mintlify
tag = TAG_SLUG_MAP.get(tag, tag)
# tag = TAG_SLUG_MAP.get(tag, tag)

summary = endpoint.get('summary', '')

Expand Down Expand Up @@ -129,7 +129,7 @@ def sort_key(tag):

# Handle tag display
display_tag = tag
if tag.lower() == 'api/v2':
if tag.lower() == 'api v2':
display_tag = 'Legacy (v2)'
elif tag.lower() == 'blockchain data':
display_tag = 'Blockchain data'
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def resolve_file(slug: str) -> Optional[str]:
str(Path(slug) / "index.mdx"),
str(Path(slug) / "index.md"),
):
if (REPO_ROOT / rel).exists():
return rel
if (REPO_ROOT / 'content' / rel).exists():
return 'content' / rel
return None


Expand Down
18 changes: 18 additions & 0 deletions content/contract-dev/blueprint/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "../../../meta-schema.json",
"title": "Blueprint",
"tag": "legacy",
"pages": [
"overview",
"first-smart-contract",
"develop",
"testing",
"debug",
"deploy",
"coverage",
"benchmarks",
"config",
"cli",
"api"
]
}
9 changes: 9 additions & 0 deletions content/contract-dev/blueprint/testing/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "../../../../meta-schema.json",
"title": "Testing",
"pages": [
"overview",
"style-guide",
"reference"
]
}
5 changes: 4 additions & 1 deletion content/contract-dev/meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"$schema": "../../meta-schema.json",
"title": "Contract development",
"pages": [
"!acton",
"external:[Acton toolchain](https://ton-blockchain.github.io/acton/docs/welcome)",
"..."
"...ide",
"techniques",
"blueprint"
]
}
2 changes: 1 addition & 1 deletion content/contract-dev/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ How to build, test, deploy, and debug TON smart contracts. This section covers t

## Toolchain

The recommended language for TON smart contracts is [Tolk](/tolk/overview). [Acton ↗️](/contract-dev/acton) is the recommended all-in-one toolchain for the entire contract development lifecycle, including building, testing, and deploying Tolk contracts.
[Tolk](/tolk/overview) is the recommended language for TON smart contracts. [Acton ↗️](/contract-dev/acton) is the recommended all-in-one toolchain for the entire contract development lifecycle, including building, testing, and deploying Tolk contracts.

<Callout
type="note"
Expand Down
18 changes: 18 additions & 0 deletions content/contract-dev/techniques/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "../../../meta-schema.json",
"title": "Techniques",
"defaultOpen": true,
"pages": [
"signing",
"contract-sharding",
"security",
"gas",
"on-chain-jetton-processing",
"using-on-chain-libraries",
"random",
"upgrades",
"vanity",
"zero-knowledge",
"groth16-examples"
]
}
8 changes: 8 additions & 0 deletions content/contribute/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "../../meta-schema.json",
"title": "Contributing",
"pages": [
"style-guide",
"snippets"
]
}
10 changes: 10 additions & 0 deletions content/contribute/snippets/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "../../../meta-schema.json",
"title": "Components and snippets",
"pages": [
"overview",
"aside",
"image",
"filetree"
]
}
10 changes: 10 additions & 0 deletions content/ecosystem/ai/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "../../../meta-schema.json",
"title": "AI",
"defaultOpen": true,
"pages": [
"overview",
"mcp",
"wallets"
]
}
9 changes: 9 additions & 0 deletions content/ecosystem/api/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "../../../meta-schema.json",
"title": "APIs",
"pages": [
"overview",
"toncenter",
"price"
]
}
26 changes: 26 additions & 0 deletions content/ecosystem/api/toncenter/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "../../../../meta-schema.json",
"title": "TON Center",
"defaultOpen": true,
"pages": [
"introduction",
"rate-limit",
"get-api-key",
"---API v2---",
"v2/overview",
"v2-authentication",
"v2-errors",
"v2-tonlib-types",
"...v2",
"---API v3---",
"v3/overview",
"v3-errors",
"v3-authentication",
"v3-pagination",
"...v3",
"---Streaming API---",
"...streaming",
"---Nominator Pools API---",
"...smc-index"
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
---
openapi: get /getNominatorBookings
title: Get Nominator Bookings Method
full: true
noindex: true
_openapi:
method: GET
webhook: false
toc: []
structuredData:
headings: []
contents:
- content: Get nominator bookings (debits and credits) in specified pool.
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

<APIPage document={"smc-index"} operations={[{"path":"/getNominatorBookings","method":"get"}]} showDescription />
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
---
openapi: get /getNominatorEarnings
title: Get Nominator Earnings Method
full: true
noindex: true
_openapi:
method: GET
webhook: false
toc: []
structuredData:
headings: []
contents:
- content: >-
Get nominator income in specified pool with his stake on each
timepoint.
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

<APIPage document={"smc-index"} operations={[{"path":"/getNominatorEarnings","method":"get"}]} showDescription />
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
---
openapi: get /getNominator
title: Get Nominator Method
full: true
noindex: true
_openapi:
method: GET
webhook: false
toc: []
structuredData:
headings: []
contents:
- content: >-
Get nominator data in given pool (the only in list) or, if pool is not
specified, in all pools where nominator stakes.
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

<APIPage document={"smc-index"} operations={[{"path":"/getNominator","method":"get"}]} showDescription />
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
---
openapi: get /getPoolBookings
title: Get Pool Bookings Method
full: true
noindex: true
_openapi:
method: GET
webhook: false
toc: []
structuredData:
headings: []
contents:
- content: Get all the bookings (debits and credits) in specified pool.
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

<APIPage document={"smc-index"} operations={[{"path":"/getPoolBookings","method":"get"}]} showDescription />
15 changes: 14 additions & 1 deletion content/ecosystem/api/toncenter/smc-index/get-pool-method.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
---
openapi: get /getPool
title: Get Pool Method
full: true
noindex: true
_openapi:
method: GET
webhook: false
toc: []
structuredData:
headings: []
contents:
- content: Get pool data with all its nominators.
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

<APIPage document={"smc-index"} operations={[{"path":"/getPool","method":"get"}]} showDescription />
17 changes: 16 additions & 1 deletion content/ecosystem/api/toncenter/smc-index/lifecheck-method.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
---
openapi: get /lifecheck
title: Lifecheck Method
full: true
noindex: true
_openapi:
method: GET
webhook: false
toc: []
structuredData:
headings: []
contents:
- content: |-
Check if there are any bookings in the last 19 hours.
Returns status "ok" if bookings exist, "dead" otherwise.
---

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

<APIPage document={"smc-index"} operations={[{"path":"/lifecheck","method":"get"}]} showDescription />
Loading