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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lunarhq/rosetta-ts-client

v1.4.8-rc3

Published

This package is for making queries to a Rosetta Node or a Rosetta-compliant service. Read more about Rosetta at [rosetta-api.org](https://www.rosetta-api.org/)

Downloads

22

Readme

Rosetta TypeScript Client

This package is for making queries to a Rosetta Node or a Rosetta-compliant service. Read more about Rosetta at rosetta-api.org

All testnet calls are free. To increase your rate limit or make mainnet queries, get a key at lunar.dev.

All endpoints are Rosetta compliant. Read more about Rosetta at rosetta-api.org

Installation

NPM

npm install @lunarhq/rosetta-ts-client

Yarn

yarn add @lunarhq/rosetta-ts-client

Usage

Create a new client. Both baseUrl and headers are optional. If no baseUrl is provided, the client will default to lunar.dev.

import { RosettaClient } from '@lunarhq/rosetta-ts-client';

/**
 * Initialize Client
 */ 
const baseUrl = 'https://api.lunar.dev/v1';
const headers = {
  'X-Api-Key': 'XXXXXXXXXX'
}
const client = new RosettaClient({baseUrl, headers});

/**
 * Get list of available networks
 */ 
const metadata = {}
const networks = await client.networksList(metadata)

Data Endpoints

You can read more about the Rosetta Data API endpoints at rosetta-api.org/docs/data_api_introduction.html

Network List

networksList(req: MetadataRequest): Promise<NetworkListResponse>

Network Options

networkOptions(req: NetworkRequest): Promise<NetworkOptionsResponse>

Network Status

networkOptions(req: NetworkRequest): Promise<NetworkOptionsResponse>

Account Balance

accountBalance(req: AccountBalanceRequest): Promise<AccountBalanceResponse>

Account Coins

accountCoins(req: AccountCoinsRequest): Promise<AccountCoinsResponse>

Block

block(req: BlockRequest): Promise<BlockResponse>

Block Transaction

blockTransaction(req: BlockTransactionRequest): Promise<BlockTransactionResponse>

Mempool

mempool(req: NetworkRequest): Promise<MempoolResponse>

Mempool Transaction

mempoolTransaction(req: MempoolTransactionRequest): Promise<MempoolTransactionResponse>

Construction Endpoints

Construction endpoints are used to write to a blockchain. You can read more about the Rosetta Construction API endpoints at rosetta-api.org/docs/construction_api_introduction.html

Combine

combine(req: ConstructionCombineRequest): Promise<ConstructionCombineResponse>

Derive

derive(req: ConstructionDeriveRequest): Promise<ConstructionDeriveResponse>

Hash

hash(req: ConstructionHashRequest): Promise<TransactionIdentifierResponse>

Metadata

metadata(req: rosetta.ConstructionMetadataRequest): Promise<rosetta.ConstructionMetadataResponse>

Parse

parse(req: rosetta.ConstructionParseRequest): Promise<rosetta.ConstructionParseResponse>

Payloads

payloads(req: rosetta.ConstructionPayloadsRequest): Promise<rosetta.ConstructionPayloadsResponse>

Preprocess

preprocess(req: rosetta.ConstructionPreprocessRequest): Promise<rosetta.ConstructionPreprocessResponse>

Submit

submit(req: rosetta.ConstructionSubmitRequest): Promise<rosetta.TransactionIdentifierResponse>