@picon-finance/dlmm-sdk 1.16.2 → 1.16.3
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 +13 -8
- package/dist/quote/wasm-node/picon_dlmm_quote_bg.wasm +0 -0
- package/dist/quote/wasm-web/picon_dlmm_quote_bg.wasm +0 -0
- package/dist/utils/assert.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/quote/wasm-node/picon_dlmm_quote_bg.wasm +0 -0
- package/src/quote/wasm-web/picon_dlmm_quote_bg.wasm +0 -0
- package/src/utils/assert.ts +0 -1
package/README.md
CHANGED
|
@@ -5,9 +5,22 @@ TypeScript SDK for the [Picon DLMM](https://github.com/picon-finance) protocol o
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
+
bun add @picon-finance/dlmm-sdk
|
|
9
|
+
yarn add @picon-finance/dlmm-sdk
|
|
8
10
|
npm install @picon-finance/dlmm-sdk
|
|
9
11
|
```
|
|
10
12
|
|
|
13
|
+
## Environments
|
|
14
|
+
|
|
15
|
+
The package targets ESM (`"type": "module"`), but its ESM resolution has limitations —
|
|
16
|
+
supported consumption splits into two scenarios:
|
|
17
|
+
|
|
18
|
+
- **Server-side (Node scripts, tests, tooling): use [Bun](https://bun.sh).**
|
|
19
|
+
- **Client-side / anything bundler-fronted (webpack, Vite, Rollup, ...): works as-is.** Webpack
|
|
20
|
+
needs `resolve.fullySpecified: false` on `.m?js$`; most other bundlers are lenient by default.
|
|
21
|
+
|
|
22
|
+
**Not currently supported: bare `node` with no Bun and no bundler in front of it.**
|
|
23
|
+
|
|
11
24
|
## Usage
|
|
12
25
|
|
|
13
26
|
The SDK is built around stateful classes (`DlmmProgram`, `Pool`, `Position`, `BinArray`) that cache on-chain state to avoid redundant RPC round trips. Every method returns unsigned `Instruction`s (never signs or sends) — build, sign, and send the transaction yourself with `@solana/kit`.
|
|
@@ -188,14 +201,6 @@ for (const claimIxs of claimTxs) {
|
|
|
188
201
|
}
|
|
189
202
|
```
|
|
190
203
|
|
|
191
|
-
### Admin
|
|
192
|
-
|
|
193
|
-
`Pool.claimProtocolFee(authority)` drains `pool.data.protocolFeeX`/`protocolFeeY` to the admin's associated token accounts — `authority` must match `AdminConfig.authority`. `Pool.setProtocolShare(authority, protocolShare)` and `Pool.setDynamicFeeConfig(authority, config)` are similarly admin-gated single instructions:
|
|
194
|
-
|
|
195
|
-
```ts
|
|
196
|
-
const claimProtocolFeeIxs = await pool.claimProtocolFee(adminSigner);
|
|
197
|
-
```
|
|
198
|
-
|
|
199
204
|
### Price math
|
|
200
205
|
|
|
201
206
|
`getBaseBinPrice(binStep)`, `getBinPrice(baseBinPrice, binId)`, and `getBinPriceFromStep(binStep, binId)` are direct `bigint` ports of the on-chain Q64.64 price math (`bin_math.rs`'s `base_bin_price`/`bin_price`/`bin_price_from_step`) — useful for computing a bin's price without an RPC round trip, e.g. when picking `lowerBinId`/`upperBinId` for a new position before it exists on-chain. `getBinPrice`/`getBinPriceFromStep` return `undefined` (mirroring the Rust `Option`) if `binId` is outside the representable range for that `binStep`:
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/utils/assert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/utils/assert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,UAAU,GAChB,IAAI,CAMN;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,EAC3B,IAAI,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GACzB,IAAI,CAMN"}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|