Socket
Book a DemoInstallSign in
Socket

cardano-nftcdn-client

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cardano-nftcdn-client

TypeScript client for XRAY/Graph NFTCDN API

latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

Discord NPM CODEQL

TypeScript Client for XRAY/Graph NFTCDN

Automatically generated Openapi-fetch (Axios) client for NFTCDN API — Cardano native tokens metadata/datums indexer/explorer and images CDN. IPFS gateway included.

Installation

To install the client with Yarn, run:

yarn add cardano-nftcdn-client

To install the client with NPM, run:

npm i cardano-nftcdn-client

Usage

import NftcdnClient from "cardano-nftcdn-client"

const client = NftcdnClient("https://graph.xray.app/output/services/nftcdn/mainnet/api/v1")

const app = async () => {
  const metadata = await client.GET("/metadata/{fingerprint}", {
    params: {
      path: {
        fingerprint: "asset1zwa4chw9xm7xwk7g46ef94qsj28hmnd7qffhgx",
      },
    },
  })

  if (metadata.data) {
    console.log(tip.data)
  }
  if (metadata.error) {
    console.error(tip.error)
  }
}

app()

Advanced Usage

Headers
import NftcdnClient from "cardano-nftcdn-client"

const baseUrl = "https://graph.xray.app/output/services/nftcdn/mainnet/api/v1"
const headers = {} // rest headers
const client = NftcdnClient(baseUrl, headers)

const app = async () => {
  const metadata = await client.GET("/metadata/{id}", {
    params: {
      path: {
        id: "b6798a74fb7441ef5f7af1ff4ea6150bbb7aaeb0aca0113e558592f6584449414d4f4e44",
      },
    },
  })

  console.log(metadata.data)
}

app()
Request Cancellation (AbortSignal)
import NftcdnClient from "cardano-nftcdn-client"

const client = NftcdnClient("https://graph.xray.app/output/services/nftcdn/mainnet/api/v1")

const app = async () => {
  const abortController = new AbortController()

  setTimeout(() => {
    abortController.abort() // cancel request
    console.log('Aborted!')
  }, 200)

  const assets = await client.GET("/assets", {
    signal: abortController.signal,
  })

  if (assets.data) {
    console.log(tip.data?.[0]?.block_no)
  }
  if (assets.error) {
    console.error(tip.error)
  }
}

app()
Updating Schema

Run schema update:

yarn schema

Playground

API URLs

Managed by XRAY/Network (XRAY/Graph, Cloudflare WAF & Load Balancer)

https://graph.xray.app/output/services/nftcdn/mainnet/api/v1
https://graph.xray.app/output/services/nftcdn/preprod/api/v1
https://graph.xray.app/output/services/nftcdn/preview/api/v1

FAQs

Package last updated on 02 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts