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!