Skip to content

Repository files navigation

joinmarket-ng-api-ts

OpenAPI TypeScript types and client for JoinMarket-NG (jmwalletd).

This package generates TypeScript models, a fetch client, and React Query hooks based on the JoinMarket-NG OpenAPI specification.

Getting Started

1. Install dependencies

npm install

2. Fetch the OpenAPI Schema (Optional)

By default, the package includes pre-generated client files. If you want to update the schema from a running jmwalletd daemon:

# Fetch schema using the default local endpoint (https://127.0.0.1:28183/openapi.json)
npm run openapi-ts:fetch-schema

# Or specify a custom URL using JM_NG_OPENAPI_URL
JM_NG_OPENAPI_URL=https://127.0.0.1:28183/openapi.json npm run openapi-ts:fetch-schema

This will write the schema to:

3. Generate the TypeScript Client

Generate the fetch client and React Query hooks from the fetched OpenAPI schema:

npm run openapi-ts

This creates the generated files under src/generated/client/.

4. Build the Project

Compile the code with tsup:

npm run build

5. Run the Example

If you have a local jmwalletd running, you can run the example script:

npm run example

API

The client and types are generated from the JoinMarket-NG OpenAPI schema files:

License

The project is licensed under the MIT License. See LICENSE for details.

Resources

About

OpenAPI TypeScript types and client for JoinMarket NG

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages