northstar-eva-sdk 0.9.0 → 0.10.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 CHANGED
@@ -14,7 +14,7 @@ const sdk = NorthstarEva.create({ network: "localnet", wallet });
14
14
  // OR keep your existing AnchorProvider + read-only wallet + custom RPC (see 0.2.0):
15
15
  const sdk = NorthstarEva.create({ provider, erRpc: ER_RPC_URL, evaProgramId });
16
16
  ```
17
- > Ships compiled JS + TypeScript types — works in any Node ≥18 project (JS or TS). The three Solana libs are **peer dependencies** (install them alongside). Prefer a single drop-in file instead? See `share/` (no npm). Publishing it yourself? See [PUBLISHING.md](PUBLISHING.md).
17
+ > Ships compiled JS + TypeScript types — works in any Node ≥18 project (JS or TS). **Dual ESM + CommonJS**: works with both `import { NorthstarEva } from "northstar-eva-sdk"` (ESM) and `const { NorthstarEva } = require("northstar-eva-sdk")` (CommonJS / NestJS backends). The three Solana libs are **peer dependencies** (install them alongside). Prefer a single drop-in file instead? See `share/` (no npm). Publishing it yourself? See [PUBLISHING.md](PUBLISHING.md).
18
18
 
19
19
  ## Construction — one SDK, three ways (NorthStar or not)
20
20
 
@@ -36,6 +36,7 @@ const sdk = NorthstarEva.create({ provider, erRpc: "https://ephemeral.devnet.son
36
36
  - **`l1Endpoint`** means "the provider's RPC is the ER; this is the L1." It's the cleanest fit when your app's provider already points at the ER. (`L1Endpoint` is accepted too.)
37
37
  - **Same SDK, both services:** with no `l1Endpoint`/`erRpc`, you get a normal eva client — one codebase covers the NorthStar and non-NorthStar deployments.
38
38
  - **Withdraw returns to the sender:** `withdrawFeeFromEr({ lamports })` reclaims the fee to whoever funded the ER (the SDK signer) — no recipient needed.
39
+ - **Typed IDL straight from the SDK:** `import { EVA_IDL, type EvaArena } from "northstar-eva-sdk"` → `new anchor.Program<EvaArena>(EVA_IDL, provider)` (official eva v0.1.6 IDL; `EVA_IDL` is the value, `EvaArena` the type).
39
40
  - **Session helpers:** `await sdk.isSessionOpen()` (read-only boolean), `await sdk.getSession()` (decoded session struct — validator, `ttlSlots`, `createdAt`, `expiresAtSlot`, … or `null`), and `await sdk.buildEnsureSessionIx()` (returns the OpenSession instruction to compose/sign yourself, or `null` if the session already exists).
40
41
 
41
42
  ## What's new in 0.4.0