@0block.io/sdk 0.4.0 → 0.4.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/dist/events.js CHANGED
@@ -1,7 +1,14 @@
1
1
  import * as web3 from "@solana/web3.js";
2
- // Anchor ships CJS-only; a default import + destructure works everywhere
3
- // (bundlers and raw Node ESM), named imports do not.
4
- import anchor from "@coral-xyz/anchor";
2
+ // Anchor ships BOTH a CJS build (Node resolves it via `require`, exposing
3
+ // everything as the interop `default`; its named exports are NOT statically
4
+ // detectable through Anchor's deep `export *` chain, so named imports fail in
5
+ // Node ESM) AND ESM/browser builds (bundlers like Turbopack/webpack resolve
6
+ // these — they have named exports and NO `default`). Import the namespace and
7
+ // prefer the CJS `default` when present, else fall back to the ESM namespace,
8
+ // so this resolves in Node ESM, webpack, and Turbopack alike.
9
+ import * as anchorNamespace from "@coral-xyz/anchor";
10
+ const anchor = (anchorNamespace
11
+ .default ?? anchorNamespace);
5
12
  const { BN, BorshEventCoder } = anchor;
6
13
  import { ROUTER_IDL } from "./idl/router.js";
7
14
  // Event layouts derive from the vendored (trimmed) router IDL.
package/dist/swap.js CHANGED
@@ -1,7 +1,14 @@
1
1
  import * as web3 from "@solana/web3.js";
2
- // Anchor ships CJS-only; a default import + destructure works everywhere
3
- // (bundlers and raw Node ESM), named imports do not.
4
- import anchor from "@coral-xyz/anchor";
2
+ // Anchor ships BOTH a CJS build (Node resolves it via `require`, exposing
3
+ // everything as the interop `default`; its named exports are NOT statically
4
+ // detectable through Anchor's deep `export *` chain, so named imports fail in
5
+ // Node ESM) AND ESM/browser builds (bundlers like Turbopack/webpack resolve
6
+ // these — they have named exports and NO `default`). Import the namespace and
7
+ // prefer the CJS `default` when present, else fall back to the ESM namespace,
8
+ // so this resolves in Node ESM, webpack, and Turbopack alike.
9
+ import * as anchorNamespace from "@coral-xyz/anchor";
10
+ const anchor = (anchorNamespace
11
+ .default ?? anchorNamespace);
5
12
  const { BN, BorshInstructionCoder } = anchor;
6
13
  import { ASSOCIATED_TOKEN_PROGRAM_ID, FEE_MINT_ALLOWLIST, INSTRUCTIONS_SYSVAR_ID, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, WSOL_MINT, } from "./constants.js";
7
14
  import { TENANT_WRAPPER_IDL } from "./idl/tenantWrapper.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0block.io/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Client-side transaction builder for the 0Block DEX router. Builds unsigned v0 swap transactions entirely offline \u2014 tenant-wrapped or direct \u2014 with shared address lookup tables, gateway tips, and on-chain fee-event decoding for accounting.",
5
5
  "keywords": [
6
6
  "solana",