Typescript Rest client to connect apps with Rosetta nodes.
The rosetta-client-typescript
provides a generated typescript reset client. The client uses fetch
under the hood.
Much of the code in this repository is generated from the rosetta-specifications.
Before diving into the SDK, we recommend taking a look at the Rosetta API Docs:
Install this package:
npm install rosetta-client-typescript
Create and use a Rosetta rest client:
import { RosettaRestClientFactory } from 'rosetta-client-typescript';
const restClientFactory = new RosettaRestClientFactory({
url: 'http://localhost:8080',
});
const networkClient = restClientFactory.network();
const networkList = await networkClient.networkList({
metadataRequest: {},
});
console.log(JSON.stringify(networkList, null, 2));
npm install
to install dependenciesnpm run gen
to generate types and helpersnpm test
to run testsnpm style:fix
to pretty, index, and lint the source code (including generated code)
This project is available open source under the terms of the Apache 2.0 License.
© 2022 Fernando Boucquez