northstar-eva-sdk 0.8.0 → 0.9.1
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 +2 -2
- package/dist/cjs/northstar-eva-sdk.js +2898 -0
- package/dist/cjs/package.json +3 -0
- package/dist/northstar-eva-sdk.d.ts +14 -0
- package/dist/northstar-eva-sdk.js +38 -1
- package/package.json +6 -4
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
|
|
|
@@ -69,7 +69,7 @@ tx.sign(myKeypair); // or wallet.signTransaction(tx)
|
|
|
69
69
|
await connection.sendRawTransaction(tx.serialize());
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
Builders (each mirrors the send-method's inputs): `buildOpenSessionIx()`, `buildCloseSessionIx()`, `buildDepositFeeIx(lamports, recipient?, sender?)` (sender = the depositor/signer; defaults to the SDK signer), `buildWithdrawFeeFromErIx({ lamports, sender?, toL1? })` (Portal SOL bridge), `buildInitializeIx(p)`, `buildUpdateConfigIx(p)`, `buildCreateTrenchIx({ trenchId?, initialVirtualTokenReserves? })`, `buildDepositIx(p)`, `buildWithdrawIx({ trenchId, amount, thinkId? })` (eva trench withdraw), `buildFinalizeIx(p)`, `buildUserAtaIx(p)`, `buildBuyIx(p)`, `buildSellIx(p)`, `buildClosePoolIx(p)`, `buildClaimTokensIx(p)`, `buildDistributePrizeIx(p)`, plus `buildTransaction(ixs, { lane?, feePayer? })`, `nextTrenchId()`, and the `agentPda(id, user?)` PDA helper.
|
|
72
|
+
Builders (each mirrors the send-method's inputs): `buildOpenSessionIx()`, `buildCloseSessionIx()`, `buildDepositFeeIx(lamports, recipient?, sender?)` (sender = the depositor/signer; defaults to the SDK signer), `buildWithdrawFeeFromErIx({ lamports, sender?, toL1? })` (Portal SOL bridge), `buildInitializeIx(p)`, `buildUpdateConfigIx(p)`, `buildCreateTrenchIx({ trenchId?, initialVirtualTokenReserves? })`, `buildDepositIx(p)`, `buildWithdrawIx({ trenchId, amount, thinkId? })` (eva trench withdraw), `buildFinalizeIx(p)`, `buildUserAtaIx(p)`, `buildBuyIx(p)`, `buildSellIx(p)`, `buildClosePoolIx(p)`, `buildCloseTrenchIx({ trenchId, creator? })`, `buildClaimTokensIx(p)`, `buildDistributePrizeIx(p)`, plus `buildTransaction(ixs, { lane?, feePayer? })`, `nextTrenchId()`, and the `agentPda(id, user?)` PDA helper.
|
|
73
73
|
|
|
74
74
|
> The existing send-methods (`buy`, `sell`, `fundFeeToErPayer`, …) are unchanged — they now just call these builders internally. Builders perform the same state **reads** to resolve accounts (e.g. `buildBuyIx` reads global for `feeRecipient`) but never **send**.
|
|
75
75
|
|