Skip to content
Merged
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
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export default defineConfig({
],
resolve: {
alias: []
}
},
publicDir: 'public'
}
})
54 changes: 1 addition & 53 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,8 @@ import { h } from 'vue'
import DefaultTheme from 'vitepress/theme'
import type { Theme } from 'vitepress'
import './style.css'
import { theme, useOpenapi } from 'vitepress-openapi/client'
import 'vitepress-openapi/dist/style.css'
import ActionHighlight from './components/ActionHighlight.vue'

// Global server fetching utility
export const fetchWaxEndpoints = async () => {
// Check cache first
const cacheKey = 'wax-endpoints-cache'
const cacheExpiry = 1000 * 60 * 60 * 24 // 24 hours in milliseconds

try {
const cached = localStorage.getItem(cacheKey)
if (cached) {
const { endpoints: cachedEndpoints, timestamp } = JSON.parse(cached)
const now = Date.now()

// Use cached endpoints if they're still valid
if (now - timestamp < cacheExpiry) {
console.log('Using cached endpoint list')
return cachedEndpoints
}
}

// Fetch fresh data if cache is expired or doesn't exist
console.log('Fetching fresh endpoint list')
const response = await fetch('https://validate.eosnation.io/wax/reports/endpoints.json')
const data = await response.json()
const endpoints = data.report

// Cache the new data
const cacheData = {
endpoints,
timestamp: Date.now()
}
localStorage.setItem(cacheKey, JSON.stringify(cacheData))

return endpoints
} catch (err) {
console.error('Failed to fetch endpoints, using defaults:', err)
return null
}
}

/** @type {import('vitepress').Theme} */
export default {
extends: DefaultTheme,
Expand All @@ -55,17 +14,6 @@ export default {
})
},
async enhanceApp({ app, router, siteData }) {
app.component('ActionHighlight', ActionHighlight),
useOpenapi({
config: {
spec: {
groupByTags: false,
},
server: {
allowCustomServer: true,
},
},
}),
theme.enhanceApp({ app, router, siteData })
app.component('ActionHighlight', ActionHighlight)
}
} satisfies Theme
17 changes: 17 additions & 0 deletions docs/apis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: WAX API Documentation
description: Redirecting to API Reference
---

<script setup>
import { onMounted } from 'vue'

onMounted(() => {
// Redirect to the main API reference page
window.location.href = '/build/api-reference'
})
</script>

# Redirecting to API Reference...

If you're not redirected automatically, [click here](/build/api-reference) to view the WAX API documentation.
17 changes: 17 additions & 0 deletions docs/apis/atomic-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: WAX Atomic Assets API
description: WAX Blockchain Atomic Assets API Documentation
---

<script setup>
import { onMounted } from 'vue'

onMounted(() => {
// Redirect to the static HTML file
window.location.href = '/apis/atomic-api'
})
</script>

# Redirecting to Atomic Assets API...

If you're not redirected automatically, [click here](/apis/atomic-api) to view the WAX Atomic Assets API documentation.
17 changes: 17 additions & 0 deletions docs/apis/chain-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: WAX Chain API
description: WAX Blockchain Chain API Documentation
---

<script setup>
import { onMounted } from 'vue'

onMounted(() => {
// Redirect to the static HTML file
window.location.href = '/apis/chain-api'
})
</script>

# Redirecting to Chain API...

If you're not redirected automatically, [click here](/apis/chain-api) to view the WAX Chain API documentation.
17 changes: 17 additions & 0 deletions docs/build/api-reference/atomic_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: WAX Atomic Assets API
description: Redirecting to Atomic Assets API
---

<script setup>
import { onMounted } from 'vue'

onMounted(() => {
// Redirect to the Atomic Assets API page
window.location.href = '/apis/atomic-api'
})
</script>

# Redirecting to Atomic Assets API...

If you're not redirected automatically, [click here](/apis/atomic-api) to view the WAX Atomic Assets API documentation.
17 changes: 17 additions & 0 deletions docs/build/api-reference/rpc_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: WAX RPC API
description: Redirecting to Chain API
---

<script setup>
import { onMounted } from 'vue'

onMounted(() => {
// Redirect to the Chain API page
window.location.href = '/apis/chain-api'
})
</script>

# Redirecting to Chain API...

If you're not redirected automatically, [click here](/apis/chain-api) to view the WAX Chain API documentation.
62 changes: 0 additions & 62 deletions docs/en/build/api-reference/atomic_api.md

This file was deleted.

16 changes: 11 additions & 5 deletions docs/en/build/api-reference/index.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
---
title: WAX API Reference
description: API documentation for WAX Blockchain
---

# WAX API Reference
# {{ $frontmatter.title }}

Here you'll find detailed documentation, usage guides, and examples to help you understand and integrate WAX APIs into your applications efficiently.
Here you'll find comprehensive documentation for WAX Blockchain APIs

## APIs

- [Chain API](/build/api-reference/rpc_api)
- [AtomiAssets API](/build/api-reference/atomic_api)
- [CDT](/build/api-reference/cdt_api)
**[Chain API](/apis/chain-api)**
The Chain API offers blockchain data access including account information, transaction details, and blockchain state.

**[Atomic Assets API](/apis/atomic-api)**
The Atomic Assets API provides endpoints for managing and querying NFT assets on the WAX blockchain.

**[CDT](/build/api-reference/cdt_api)**
Contract Development Toolkit for smart contract development.
67 changes: 0 additions & 67 deletions docs/en/build/api-reference/rpc_api.md

This file was deleted.

49 changes: 49 additions & 0 deletions docs/public/apis/atomic-api
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<title>WAX Atomic Assets API</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
</head>
<body>
<div id="header-container"></div>

<div id="redoc"></div>
<script src="https://unpkg.com/redoc@2.1.3/bundles/redoc.standalone.js"></script>
<script>
// Load the reusable header
fetch('header.html')
.then(response => response.text())
.then(html => {
document.getElementById('header-container').innerHTML = html;
// Wait a bit for the script to execute, then set the title
setTimeout(() => {
if (typeof setApiTitle === 'function') {
setApiTitle('WAX Atomic Assets API');
} else {
// Fallback: directly update the title element
const titleElement = document.getElementById('api-title');
if (titleElement) {
titleElement.textContent = 'WAX Atomic Assets API';
}
}
}, 100);
})
.catch(error => console.error('Error loading header:', error));

Redoc.init('../openapi/atomic-openapi.json', {
scrollYOffset: 0,
hideDownloadButton: true,
hideHostname: true,
theme: {
colors: {
primary: {
main: '#8e5cd9'
}
}
}
}, document.getElementById('redoc'));
</script>
</body>
</html>
Loading