Rosetta TypeScript Client

Hey Rosetta Community, we made a TypeScript Client to interface with your nodes and lunar.dev.

It’s relatively straightforward to get started…

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

/**
 * Initialize Client
 * RosettaClient params are optional
 */ 
const baseUrl = 'https://api.lunar.dev/v1/'; // Your public node endpoint here
const headers = { // headers are optional
  'X-Api-Key': 'XXXXXXXXXX'
};
const client = new RosettaClient({baseUrl, headers});

/**
 * Example getting a list of available networks
 */ 
const metadata = {};
const networks = await client.networksList(metadata);

Feel free to test it out, add issues, or do a PR to help improve the code.
Take a look at Github or download the package from NPM. Feedback is welcome!

3 Likes

Awesome to see a simple client library like this! This was very high up on our wishlist!

Thanks for the notification, @alan.verbner and I will check it out :+1:

1 Like