npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@orao-network/price-service

v1.1.0

Published

ORAO Oracles Price Service

Downloads

11

Readme

ORAO Price Service

This JavaScript/TypeScript SDK provides a client for interacting with the ORAO Price Service API. It allows users to fetch price feeds for various assets across different networks.

Features

  • Fetch available networks
  • Retrieve whitelists for specific networks
  • Get the latest price feeds for specified assets on a given network

Installation

To use this SDK in your project, install it via npm:

npm install @orao-network/price-service

Usage

Here's a basic example of how to use the SDK:

import {
  Secp256k1PriceService,
  PriceServiceConfig,
} from "@orao-network/price-service";

// Initialize the PriceService
const config: PriceServiceConfig = {
  authToken: "your_auth_token",
  timeout: 5000,
  httpRetries: 3,
  logger: console,
};

const priceService = new Secp256k1PriceService(
  "https://api.example.com",
  config
);

// Get whitelist for a specific network
priceService
  .getWhitelist()
  .then((whitelist) => console.log("whitelist:", whitelist))
  .catch((error) => console.error("Error fetching whitelist:", error));

// Get latest price feeds
const assetNames = ["bitcoin", "ethereum"];
priceService
  .getLatestPriceFeeds(assetNames)
  .then((priceFeed) => {
    console.log("Latest price feed:", priceFeed);
    const priceFeedsUpdateData =
      priceService.getPriceFeedsUpdateData(priceFeed);
    console.log("PriceFeedsUpdateData:", priceFeedsUpdateData);
  })
  .catch((error) => console.error("Error fetching price feeds:", error));

Supported Networks

| Network | Service name | | ------- | --------------------- | | evm | Secp256k1PriceService | | fuel | Ed25519PriceService | | solana | Ed25519PriceService |

API Reference

Secp256k1PriceService

The main class for interacting with the ORAO Price Service API.

Constructor

constructor(endpoint: string, config?: PriceServiceConfig)
  • endpoint: The base URL of the ORAO Price Service API.
  • config: Optional configuration object.

Methods

getWhitelist(): Promise<string[]>

Retrieves the whitelist.

getLatestPriceFeeds(assetNames: string[]): Promise<PriceFeed>

Retrieves the latest price feeds for specified assets.

Types

PriceServiceConfig

{
  authToken?: string;
  timeout?: number;
  httpRetries?: number;
  logger?: Logger;
}

PriceFeed

{
  prices: Record<string, string>;
  metadata: {
    epoch: number;
    requestHash: string;
    configHash: string;
    signatures: Record<string, string>;
    message: string;
  }
}

Error Handling

All-methods return Promises that may reject with errors. It's recommended to use try-catch blocks or .catch() methods to handle potential errors.

Logging

The SDK uses a configurable logger. You can provide your own logger implementation or use the default console logger for warnings and errors.