cardano-kupo-client
v1.0.5
Published
TypeScript client for Kupo blockchain indexer
Readme
TypeScript Client for Kupo blockchain indexer
Automatically generated Openapi-fetch client for Kupo.
Installation
To install the client with Yarn, run:
yarn add cardano-kupo-clientTo install the client with NPM, run:
npm i cardano-kupo-clientUsage
import KupoClient from "cardano-kupo-client"
const client = KupoClient("https://graph.xray.app/output/services/kupo/mainnet/api/v1")
const app = async () => {
const health = await client.GET("/health")
if (health.data) {
console.log(health.data)
}
if (health.error) {
console.error(health.error)
}
}
app()Advanced Usage
import KupoClient from "cardano-kupo-client"
const baseUrl = "https://graph.xray.app/output/services/kupo/mainnet/api/v1"
const headers = {} // rest headers
const client = KupoClient(baseUrl, headers)
const app = async () => {
const health = await client.GET("/health", {
headers: { "Content-Type": "application/json" }, // one shot headers
})
console.log(health.data)
}
app()import KupoClient from "cardano-kupo-client"
const client = KupoClient("https://graph.xray.app/output/services/kupo/mainnet/api/v1")
const app = async () => {
const abortController = new AbortController()
setTimeout(() => {
abortController.abort() // cancel request
console.log('Aborted!')
}, 200)
const assets = await client.GET("/health", {
signal: abortController.signal,
})
}
app()Run schema update:
yarn schemaPlayground
- XRAY/Graph Kupo — https://graph.xray.app/output/services/kupo/mainnet/api/v1/
API URLs
Managed by XRAY/Network (XRAY/Graph, Cloudflare WAF & Load Balancer), requires paid subscription
https://graph.xray.app/output/services/kupo/mainnet/api/v1https://graph.xray.app/output/services/kupo/preprod/api/v1https://graph.xray.app/output/services/kupo/preview/api/v1