Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cardano-nftcdn-client

Package Overview
Dependencies
Maintainers
1
Versions
5
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

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Discord NPM CODEQL

Cardano NFTCDN TypeScript Client

[!NOTE] Automatically generated Openapi-fetch (Axios) client for XRAY/Graph NFTCDN API based on schema.yaml OpenAPI schema. Cardano native tokens metadata/datums indexer/explorer and images CDN. IPFS gateway included

Installation

To install the client with Yarn, run:

yarn install 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/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

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

const client = NftcdnClient("https://graph.xray.app/output/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.signl,
  })

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

app()

Endpoints

API URLs

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

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

FAQs

Package last updated on 11 Jun 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc