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

@lunarhq/rosetta-ts-client

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lunarhq/rosetta-ts-client

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/)

  • 1.4.8-rc1
  • npm
  • Socket score

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

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
 * RosettaClient params are optional
 */ 
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>

FAQs

Package last updated on 09 Dec 2020

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