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

cardano-pricing-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-pricing-client

TypeScript client for XRAY/Graph Pricing API

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Discord NPM CODEQL

Cardano Pricing TypeScript Client

[!WARNING] XRAY/Graph Pricing API and client are in active development, stay tuned to https://twitter.com/xray_network for updates.

[!NOTE] Automatically generated Openapi-fetch (Axios) client for XRAY/Graph Pricing API based on schema.yaml OpenAPI schema. DEX price tracking for any Cardano token

Installation

To install the client with Yarn, run:

yarn install cardano-pricing-client

To install the client with NPM, run:

npm i cardano-pricing-client

Usage

import PricingClient from "cardano-pricing-client"

const client = PricingClient("https://graph.xray.app/output/pricing/mainnet/api/v1")

const app = async () => {
  const orders = await client.GET("/orders")

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

app()

Advanced Usage

Request Cancellation (AbortSignal)
import PricingClient from "cardano-pricing-client"

const client = PricingClient("https://graph.xray.app/output/pricing/mainnet/api/v1")

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

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

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

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

app()

Endpoints

API URLs

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

https://graph.xray.app/output/pricing/mainnet/api/v1
https://graph.xray.app/output/pricing/preprod/api/v1
https://graph.xray.app/output/pricing/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