meteora-api 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -88
- package/dist/index.cjs +3619 -10149
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5573 -10552
- package/dist/index.d.mts +5573 -10551
- package/dist/index.mjs +3637 -10131
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -31
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
package/README.md
CHANGED
|
@@ -1,99 +1,14 @@
|
|
|
1
|
-
# Meteora API Client
|
|
2
|
-
|
|
3
|
-
## Table of Contents
|
|
4
|
-
|
|
5
|
-
- [Installation](#installation)
|
|
6
|
-
- [Usage](#usage)
|
|
7
|
-
- [Developing](#developing)
|
|
8
|
-
|
|
9
|
-
## Installation
|
|
10
|
-
|
|
11
|
-
Install the package:
|
|
1
|
+
# Meteora API TypeScript Client
|
|
12
2
|
|
|
13
3
|
```bash
|
|
14
4
|
bun add meteora-api
|
|
15
5
|
```
|
|
16
6
|
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
Each Meteora product has its own client class because its API is served from an
|
|
20
|
-
independent base URL. Instantiate only the client for the product you need:
|
|
21
|
-
|
|
22
7
|
```ts
|
|
23
8
|
import { DlmmApi } from "meteora-api";
|
|
24
9
|
|
|
25
10
|
const dlmm = new DlmmApi();
|
|
26
|
-
const pools = await dlmm.pools.getPools(
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
The available clients are:
|
|
30
|
-
|
|
31
|
-
- `DlmmApi`
|
|
32
|
-
- `DammV1Api`
|
|
33
|
-
- `DammV2Api`
|
|
34
|
-
- `DynamicVaultApi`
|
|
35
|
-
- `Stake2EarnApi`
|
|
36
|
-
|
|
37
|
-
Every client uses its product's production base URL by default.
|
|
38
|
-
|
|
39
|
-
Generated API classes and models are also exported under product-specific
|
|
40
|
-
namespaces such as `DlmmGenerated` and `DammV2Generated`.
|
|
41
|
-
|
|
42
|
-
## Developing
|
|
43
|
-
|
|
44
|
-
This repository uses Bun. Install its dependencies with:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
bun install
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### OpenAPI generation
|
|
51
|
-
|
|
52
|
-
The version-controlled source specifications live under `openapi/`, organized
|
|
53
|
-
by Meteora product. Because each product has its own API origin and may define
|
|
54
|
-
overlapping operation names, each specification generates into its own
|
|
55
|
-
directory and is exposed through its own client class.
|
|
56
|
-
|
|
57
|
-
`prepare-openapi` normalizes the upstream OpenAPI 3.1 documents into the
|
|
58
|
-
temporary, ignored `.openapi/` directory. This is required because the current
|
|
59
|
-
TypeScript fetch generator expects the nullable schemas in OpenAPI 3.0 form.
|
|
60
|
-
The source documents under `openapi/` are not modified.
|
|
61
|
-
|
|
62
|
-
To add a new OpenAPI specification to the client:
|
|
63
|
-
|
|
64
|
-
1. Add the source document under `openapi/<product>/openapi.json`.
|
|
65
|
-
2. Add normalization and generator scripts for the product in `package.json`.
|
|
66
|
-
3. Add the product's default base URL and a standalone client class under
|
|
67
|
-
`clients/ts/`.
|
|
68
|
-
4. Export the client and generated namespace from `clients/ts/index.ts`.
|
|
69
|
-
5. Run the validation commands below before committing the change.
|
|
70
|
-
|
|
71
|
-
Use these commands during development:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
# Normalize source specifications into the generator inputs.
|
|
75
|
-
bun run prepare-openapi
|
|
76
|
-
|
|
77
|
-
# Generate all product-specific TypeScript clients.
|
|
78
|
-
bun run generate
|
|
79
|
-
|
|
80
|
-
# Apply lint fixes and verify formatting.
|
|
81
|
-
bun run lint
|
|
82
|
-
bun run format:check
|
|
83
|
-
|
|
84
|
-
# Type-check source and generated clients.
|
|
85
|
-
bun run typecheck
|
|
86
|
-
|
|
87
|
-
# Regenerate and compile the published ESM, CJS, and declaration output.
|
|
88
|
-
bun run build
|
|
11
|
+
const pools = await dlmm.pools.getPools();
|
|
89
12
|
```
|
|
90
13
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Create a changeset for a publishable change, then use the release workflow:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
bun run changeset
|
|
97
|
-
bun run version
|
|
98
|
-
bun run release
|
|
99
|
-
```
|
|
14
|
+
See the repository README for complete TypeScript and Rust documentation.
|