@getomnichain/omnichain 0.2.1 → 0.3.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +256 -0
  2. package/dist/cjs/chain.base.js.map +1 -1
  3. package/dist/cjs/errors.js +55 -6
  4. package/dist/cjs/errors.js.map +1 -1
  5. package/dist/cjs/evm/evm_chain.js +421 -2
  6. package/dist/cjs/evm/evm_chain.js.map +1 -1
  7. package/dist/cjs/evm/evm_transaction_status.js +4 -0
  8. package/dist/cjs/evm/evm_transaction_status.js.map +1 -1
  9. package/dist/cjs/evm/unsigned_evm_transaction.js +12 -0
  10. package/dist/cjs/evm/unsigned_evm_transaction.js.map +1 -1
  11. package/dist/cjs/solana/solana_chain.js +659 -21
  12. package/dist/cjs/solana/solana_chain.js.map +1 -1
  13. package/dist/cjs/solana/unsigned_solana_transaction.js +33 -0
  14. package/dist/cjs/solana/unsigned_solana_transaction.js.map +1 -1
  15. package/dist/cjs/utxo/utxo_chain.js +94 -10
  16. package/dist/cjs/utxo/utxo_chain.js.map +1 -1
  17. package/dist/esm/chain.base.d.ts +38 -1
  18. package/dist/esm/chain.base.d.ts.map +1 -1
  19. package/dist/esm/chain.base.js.map +1 -1
  20. package/dist/esm/errors.d.ts +13 -0
  21. package/dist/esm/errors.d.ts.map +1 -1
  22. package/dist/esm/errors.js +51 -6
  23. package/dist/esm/errors.js.map +1 -1
  24. package/dist/esm/evm/evm_chain.d.ts +48 -2
  25. package/dist/esm/evm/evm_chain.d.ts.map +1 -1
  26. package/dist/esm/evm/evm_chain.js +423 -4
  27. package/dist/esm/evm/evm_chain.js.map +1 -1
  28. package/dist/esm/evm/evm_transaction_status.d.ts +4 -0
  29. package/dist/esm/evm/evm_transaction_status.d.ts.map +1 -1
  30. package/dist/esm/evm/evm_transaction_status.js +4 -0
  31. package/dist/esm/evm/evm_transaction_status.js.map +1 -1
  32. package/dist/esm/evm/unsigned_evm_transaction.d.ts +13 -0
  33. package/dist/esm/evm/unsigned_evm_transaction.d.ts.map +1 -1
  34. package/dist/esm/evm/unsigned_evm_transaction.js +12 -0
  35. package/dist/esm/evm/unsigned_evm_transaction.js.map +1 -1
  36. package/dist/esm/solana/solana_chain.d.ts +100 -3
  37. package/dist/esm/solana/solana_chain.d.ts.map +1 -1
  38. package/dist/esm/solana/solana_chain.js +659 -23
  39. package/dist/esm/solana/solana_chain.js.map +1 -1
  40. package/dist/esm/solana/unsigned_solana_transaction.d.ts +20 -1
  41. package/dist/esm/solana/unsigned_solana_transaction.d.ts.map +1 -1
  42. package/dist/esm/solana/unsigned_solana_transaction.js +33 -0
  43. package/dist/esm/solana/unsigned_solana_transaction.js.map +1 -1
  44. package/dist/esm/utxo/utxo_chain.d.ts +15 -2
  45. package/dist/esm/utxo/utxo_chain.d.ts.map +1 -1
  46. package/dist/esm/utxo/utxo_chain.js +96 -13
  47. package/dist/esm/utxo/utxo_chain.js.map +1 -1
  48. package/docs/CONNECTIONS.md +33 -0
  49. package/docs/EIP7702.md +77 -0
  50. package/docs/JITO.md +41 -0
  51. package/docs/MULTI_RPC.md +28 -0
  52. package/package.json +1 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,256 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@getomnichain/omnichain` are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ---
8
+
9
+ ## [Unreleased]
10
+
11
+ _Nothing yet. Add entries here as PRs merge; on release, rename this section to `[X.Y.Z] — YYYY-MM-DD` and open a fresh empty `[Unreleased]` above it._
12
+
13
+ ---
14
+
15
+ ## [0.3.1] — 2026-08-02
16
+
17
+ Additive minor. Two new `SolanaChain` read primitives to unblock the gasless `RIN-153` migration finish — consumers assembling `MessageV0` locally (custom fee ix + Jito tip + ALTs merged with aggregator swap bytes) can now route every chain **read** through the SDK without being pushed into the opinionated full-builder. Local computation (compile + sign) stays consumer-side by design.
18
+
19
+ ### Added
20
+
21
+ - **`SolanaChain.getLatestBlockhash(commitment?)`** — thin passthrough to `Connection.getLatestBlockhash`. Returns `{ blockhash, lastValidBlockHeight }`. Defaults to `'confirmed'`; accepts `'processed' | 'confirmed' | 'finalized'` (consumers with Jito flows should pass `'processed'` — RPC lag vs Jito's leader tip can otherwise reject a submitted bundle as `Invalid`). Transport failures wrap as `ChainError(RpcError)` with URL-redacted messages.
22
+ - **`SolanaChain.simulateTransaction(signed, opts?)`** — passthrough to `Connection.simulateTransaction`. Accepts a signed `VersionedTransaction` as `Uint8Array` or `0x`-prefixed hex; deserializes internally. Returns `{ unitsConsumed, err, logs }`. Opts: `{ sigVerify?, replaceRecentBlockhash?, commitment? }`. Input validation matches `broadcast` (rejects empty / <65 bytes / malformed hex as `InvalidArgument`). Companion to `estimateAndApplyCu`, which only sizes SDK-built transactions — this is the raw primitive for consumers that build the tx themselves.
23
+
24
+ Both methods reuse the internal `rpcWrap` sanitizer path so no keyed URL can leak through their error messages.
25
+
26
+ ### Notes
27
+
28
+ - `SolanaChain.estimateAndApplyCu` and `SolanaChain.createUnsignedTransaction` continue to be the preferred paths when the SDK owns the tx build; these primitives are for the consumer-owned-build case.
29
+
30
+ ---
31
+
32
+ ## [0.3.0] — 2026-08-02
33
+
34
+ Complete chain-connection surface. Consumers (gasless, depositron, rango-intents, …) can now build any protocol flow — including EIP-7702 relayers, Solana Jito bundles, arbitrary contract calls — without importing `ethers`, `@solana/web3.js`, `@solana/spl-token`, or `bitcoinjs-lib` directly.
35
+
36
+ Design principle: minimum new API surface. 10 new methods total; optional-field extensions where existing shapes already covered the use case. Policy, orchestration, state, jobs, retries, tip sizing, endpoint-list content, wallet custody stay in the consumer.
37
+
38
+ ### Added
39
+
40
+ #### New base method (all 3 families)
41
+
42
+ - `Chain.broadcast(signed: string | Uint8Array, opts?: BroadcastOpts): Promise<string>` — universal broadcast entry point. Returns deterministic tx hash (EVM/UTXO) or base58 signature (Solana, both `direct` and `via: 'jito'`). Handles "already-known" retries as success (safe against load-balanced provider propagation lag).
43
+
44
+ #### `EvmChain`
45
+
46
+ - `getPendingNonce(address): Promise<bigint>`
47
+ - `getDelegation(address): Promise<string | null>` — parses EIP-7702 delegation designator (`0xef0100 || <20-byte>`). Requires `supports7702: true`.
48
+ - `call({ to, data, from?, value?, blockTag?, estimateGas? }): Promise<EvmCallResult>` — read path + optional gas estimate. Revert data on `ChainError.meta.revertData`.
49
+ - `buildAuthorizationDigest({ chainId, delegate, nonce }): Uint8Array` — EIP-7702 auth digest for external signer.
50
+ - `createUnsignedTransaction({ from, to, data?, value?, authorizationList?, gasLimit?, nonce?, maxFeePerGas?, maxPriorityFeePerGas? }): Promise<UnsignedEvmTransaction>` — general-purpose builder; emits `type = 4` when `authorizationList` present, else `2` (or `0` on legacy chains).
51
+
52
+ #### `SolanaChain`
53
+
54
+ - `getAccountInfo(pubkey | pubkey[])` — single or batch.
55
+ - `getTokenAccount(owner, mint, opts?)` — returns ATA + exists/owner-safety flags; distinguishes "not found" from "hostile squat" (`InvalidArgument` on the latter).
56
+ - `fetchAddressLookupTable(address)` — for message compilation.
57
+ - `submitJitoBundle(signedTxs: Uint8Array[], opts?): Promise<string>` — returns bundle id.
58
+ - `getBundleStatus(bundleId | bundleId[])` — polls Jito for landed/failed.
59
+ - `createUnsignedTransaction({ payer, instructions, addressLookupTables? }): Promise<UnsignedSolanaTransaction>` — general-purpose builder; rejects >1232-byte txs at build time.
60
+
61
+ #### Unsigned-tx helpers
62
+
63
+ - `UnsignedSolanaTransaction.digestForSigning(): Uint8Array` — message bytes for external ed25519 signer.
64
+ - `UnsignedSolanaTransaction.finalizeAndSerialize(signatures: Uint8Array[]): Uint8Array` — attach externally-computed signatures, return wire bytes.
65
+
66
+ #### New types / interfaces
67
+
68
+ - `Eip7702Authorization { chainId, address, nonce, signature: { r, s, yParity } }`
69
+ - `CreateEvmUnsignedTransactionRequest`, `CreateSolanaUnsignedTransactionRequest`
70
+ - `EvmCallRequest`, `EvmCallResult`
71
+ - `JitoBundleStatus { bundleId, state: 'Pending' | 'Landed' | 'Failed', slot?, err? }`
72
+ - `SolanaJitoConfig { url, auth? }`
73
+ - `BroadcastOpts`, `GetTransactionStatusOpts`, `CreateUnsignedTransactionRequest`
74
+
75
+ #### New optional fields on existing shapes
76
+
77
+ - `EvmChainInit.rpcUrls?: string[]` (multi-endpoint failover deferred to 0.3.1; >1 throws at construction — fail-closed)
78
+ - `EvmChainInit.supports7702?: boolean` (default `false`)
79
+ - `EvmChainInit.nativeTransferGasLimit?`, `nativeTransferGasMultiplier?` (declarative)
80
+ - `SolanaChainInit.rpcUrls?: string[]` (same failover throw)
81
+ - `SolanaChainInit.jito?: SolanaJitoConfig`
82
+ - `SolanaChainInit.legacyRpcEnvNames?: string[]` (env-var rename compat)
83
+ - `CreateTransferRequest.addressLookupTables?: unknown[]` (Solana honors; EVM/UTXO ignore)
84
+ - `UnsignedEvmTransaction`: `type?`, `authorizationList?`, `gasLimit?`, `nonce?`, `maxFeePerGas?`, `maxPriorityFeePerGas?`
85
+ - `UnsignedSolanaTransaction.addressLookupTables?`
86
+ - `EvmTransactionStatus.blockNumber?: number`
87
+
88
+ #### `ChainErrorKinds` — 7 new kinds
89
+
90
+ - `BroadcastRejected` — chain says no; do not retry, do not re-sign
91
+ - `NonceTooLow`
92
+ - `InsufficientFunds`
93
+ - `BlockhashExpired` — safe to re-broadcast SAME signed bytes on Solana
94
+ - `SimulationFailed` — preflight rejected; revert data on `meta.revertData` (EVM)
95
+ - `TransactionTooLarge`
96
+ - `FeatureNotSupported`
97
+
98
+ #### New helpers (from `errors.ts`)
99
+
100
+ - `isBlockhashExpiredError`, `isSimulationError`, `isNonceError`, `isTransactionTooLargeError`
101
+ - `sanitizeUtxoErrMessage` (was internal; now exported)
102
+
103
+ #### `getTransactionStatus` — batch overload + wait/poll semantics
104
+
105
+ Signature now overloaded:
106
+ ```ts
107
+ getTransactionStatus(hash: string, opts?: GetTransactionStatusOpts): Promise<TransactionStatus>
108
+ getTransactionStatus(hashes: string[], opts?: GetTransactionStatusOpts): Promise<TransactionStatus[]>
109
+ ```
110
+
111
+ `GetTransactionStatusOpts`:
112
+ - `wait?: boolean` — poll until terminal
113
+ - `timeoutMs?: number` — **required** when `wait: true`
114
+ - `confirmations?: number` — EVM: any N ≥1; Solana: 1 or ≥32; UTXO: not supported
115
+ - `signal?: AbortSignal` — honored in poll loop
116
+
117
+ Batch: 8-way worker pool. On any per-item error, all workers abort and the promise rejects with the underlying error.
118
+
119
+ ### Changed
120
+
121
+ #### Behavior changes on existing methods (subtle — audit consumer code)
122
+
123
+ - **`SolanaChain.estimateAndApplyCu`** — throws `ChainErrorKinds.SimulationFailed` (was `InvalidArgument`). Consumers switching on `.kind === InvalidArgument` around this method silently fall through. `SolanaChain.isSimulationError(err)` remains compatible.
124
+ - **`sanitizeCause`** — prefers `err.shortMessage` (ethers v6 one-liner) over `err.message` (multi-line JSON). Reduces leak surface; changes what shows up in `err.cause.message`.
125
+ - **`sanitizeMessage(msg, null)`** — no longer identity; new redactor rules run regardless of `rpcUrl`.
126
+
127
+ #### API surface additions to base class (source-breaking for external subclasses only)
128
+
129
+ - `Chain.broadcast` and the two-signature `Chain.getTransactionStatus` are `abstract`. Only breaks consumers who subclass `Chain` directly (none known today). All internal chain implementations satisfy them.
130
+
131
+ #### Build-time validation (previously deferred to broadcast/sign time)
132
+
133
+ - **`createTransferUnsignedTransaction` on Solana** — throws `TransactionTooLarge` at build time if the serialized tx > 1232 bytes (previously failed later at broadcast).
134
+ - **`createTransferUnsignedTransaction` on Solana** — wraps `MessageV0.compile` failures in `ChainError(InvalidArgument)` (previously escaped as raw `@solana/web3.js` error).
135
+ - **`createTransferUnsignedTransaction` on Solana** — routes returned bytes through `sanitizeMessage` on transport failures (was unwrapped `FetchError` — leaked keyed URLs into logs).
136
+
137
+ #### Fail-closed on unsupported options (deliberate)
138
+
139
+ Where prior code silently accepted-and-ignored, these now throw:
140
+
141
+ - **`broadcast(bytes, { signal })`** — `BroadcastOpts.signal?: never`. Compile-fails on TS; runtime throws `FeatureNotSupported` for JS. Silently ignoring signal would let a caller conclude "not sent" while the tx still lands → double-send hazard.
142
+ - **`createUnsignedTransaction({ signal })`** — same treatment.
143
+ - **`getTransactionStatus(hash, { wait: true })` without `timeoutMs`** — throws `InvalidArgument`. Unbounded polling would pin an RPC worker + connection forever.
144
+ - **`getTransactionStatus(hash, { wait: true, confirmations: N })` on Solana** where `N` is not 1 or ≥32 — throws `InvalidArgument`.
145
+ - **`getTransactionStatus(hash, { wait }|{ confirmations })` on UTXO** — throws `FeatureNotSupported`. Poll block-tip provider consumer-side.
146
+ - **`EvmChain.call({ estimateGas: true, blockTag })`** — throws `InvalidArgument`. ethers v6's `estimateGas` has no block-tag plumbing.
147
+ - **`broadcast(new Uint8Array(0))`** — throws `InvalidArgument` (all families).
148
+ - **`broadcast(bytes)` on Solana** with `< 65` or `> 1232` bytes — throws `InvalidArgument` / `TransactionTooLarge` on both `direct` and `via: 'jito'` paths.
149
+ - **`SolanaChainInit` without `chainAgnosticGenesisHash`** — TS compile error (new required field).
150
+ - **`EvmChain` constructed over a chainId already registered as non-EVM** — throws `InvalidArgument`.
151
+
152
+ #### Batch `getTransactionStatus` — no longer masks failures
153
+
154
+ Previously per-item errors were converted to `NotFound` synthesized statuses. Now: any per-item failure re-throws with an internal `AbortController` stopping the other workers. This closes a double-send hazard where a transport error on one hash caused a relayer to re-sign a mined tx.
155
+
156
+ #### `broadcast` — safer "already-known" handling
157
+
158
+ - **EVM matcher widened** for Nethermind (`AlreadyKnown`), Besu (`TRANSACTION_ALREADY_KNOWN`), Erigon/reth (`txpool: already known`, `already present`), plus generic mempool phrases.
159
+ - **No confirmation gate** — returns `keccak256(hex)` unconditionally on match. Confirmation reads on load-balanced providers (Alchemy/Infura/QuickNode round-robin) routinely hit a different backend and return null; falling into terminal `BroadcastRejected` on that path would trigger re-signs while the original tx is live.
160
+
161
+ #### UTXO `computeUtxoTxidLE` — safe bitcoinjs parse failures
162
+
163
+ Wraps `bitcoinjs-lib` parse errors on the "already-known" path in `ChainError(BroadcastRejected)` with explicit "do NOT re-sign" guidance in the message. Prior code let raw parse errors escape as non-`ChainError`.
164
+
165
+ #### EVM address normalization
166
+
167
+ `createUnsignedTransaction`, `call`, `getPendingNonce` now normalize `to`/`from`/`address` to `0x`-prefixed EIP-55 checksum form via ethers `getAddress` before storing/sending. Accepts unprefixed 40-hex bodies AND `0X`-prefixed input; wraps malformed as `ChainError(InvalidAddress)`.
168
+
169
+ #### URL redactor coverage
170
+
171
+ `sanitizeMessage` now redacts:
172
+ - Signed-bytes hex runs (128+ chars, with/without `0x` prefix)
173
+ - Base64 signed-bytes (160+ chars, e.g. Solana wire format)
174
+ - Query params: `?apiKey=`, `?api-key=`, `?api_key=`, `?token=`, `?auth=`, `?secret=`, `?access-token=`
175
+ - `Bearer <token>` (case-insensitive)
176
+ - Bare `Authorization: <val>`
177
+ - `x-api-key:` / `X-Api-Key:` / `Api-Key:` / `api_key:` headers
178
+ - Path-embedded keys under `/vN/`, `/api/`, or `/rpc/` (terminator broadened for comma, paren, semicolon, dot, quote, whitespace, end-of-string)
179
+ - Full URLs of known providers (Alchemy, Infura, QuickNode, Helius, Ankr, Blast, dRPC) with the path stripped
180
+ - Basic-auth credentials in URLs (`user:pass@host`)
181
+ - Provider key markers (`pk_`, `sk_`, `ghp_`, `gho_` prefixes)
182
+
183
+ ### Fixed
184
+
185
+ - **Solana `getBundleStatus`** — robust parsing of Jito's `err` shape variants (`null` / `{ Ok: null }` / `{ Err: … }` / `'string'` / omitted / missing row). Prior code could report a failed bundle as landed on some shapes.
186
+ - **Solana Jito auth flow** — request path now honors `AbortSignal` with a bounded 15s timeout; sanitized `RpcError` on transport failure; robust HTTP-shape handling for the block-engine response.
187
+ - **`SolanaChain.rpcUrls.length > 1`** — throws at construction (fail-closed) instead of silently discarding entries.
188
+ - **`EvmChain` `already-known` detection** — deterministic hash returned even when the provider's confirmation read is served by a lagging backend (load-balanced propagation).
189
+ - **UTXO `sanitizeUtxoErrMessage`** — retains legacy hex-path key rule (`/[hex]{32,}` in URL segments), basic-auth scrubbing, and `pk_/sk_/ghp_/gho_` markers; also inherits shared sanitizer rules.
190
+ - **EVM broadcast classifier** — default terminal branch is `BroadcastRejected` (matches Solana/UTXO). Transport signals (`ECONNRESET`, `ETIMEDOUT`, rate-limit codes `-32005/-32007/-32016/-32029/429`, HTTP 5xx) branch to `RpcError`.
191
+ - **`Chain.getTransactionStatus(hash, { wait: true, timeoutMs })`** — on timeout from non-terminal state, throws `ChainError(RpcError)` with explicit "must NOT credit / must NOT re-sign" wording. Previously returned bare `NotFound`, indistinguishable from a definitive read — created a double-send hazard.
192
+
193
+ ### Security
194
+
195
+ - New redactor rules close 4 key-leak paths flagged during review:
196
+ - Query-string keys where the param name isn't literally `key` (e.g. `?auth=`)
197
+ - `x-api-key:` header form (Helius / Alchemy / QuickNode)
198
+ - Path-embedded keys wrapped by `(`, `)`, `,`, `;`, `.`, `"`, `'`
199
+ - `/rpc/<key>` path segments (self-hosted providers)
200
+ - EIP-7702 `buildAuthorizationDigest` — wraps `getAddress` failures in `ChainError(InvalidAddress)` (was raw ethers `TypeError`).
201
+ - EIP-2 low-s canonical form check on EIP-7702 authorization signatures — silently-skipped non-canonical authorizations rejected at build time (prevents "tx lands, gas spent, no delegation installed" hazard).
202
+ - `sanitizeCause` prefers `err.shortMessage` — prevents ethers v6 multi-line JSON dumps from leaking signed bytes into `err.cause.message`.
203
+
204
+ ### Deferred (recorded, not shipping in 0.3.0)
205
+
206
+ Ships in 0.3.1:
207
+ - Multi-endpoint RPC failover (`evm_rpc_client.ts` / `solana_rpc_client.ts` seam). `rpcUrls` field exists but `length > 1` throws.
208
+ - `AbortSignal` end-to-end. Honored in `getTransactionStatus` poll loops today; NOT in `broadcast` / `createUnsignedTransaction` / `getAccountInfo` / `getTokenAccount` / `fetchAddressLookupTable` / `getPendingNonce` / `getDelegation` (these fail-closed on `{ signal }`).
209
+
210
+ Follow-up cards:
211
+ - `SolanaChain.getBundleStatus` — dropped bundles indistinguishable from in-flight; consumer must impose polling timeout policy. Adding a fourth `'Unknown'` state (or querying `getInflightBundleStatuses` for missing rows) is a follow-up.
212
+ - Jito auth header shape — currently `Authorization: Bearer`; the block engine documents `x-jito-auth` on authenticated tiers. Verify against endpoint before wiring `jito.auth`.
213
+ - `withFeatures({ supports7702?, jito?, rpcUrl?, rpcUrls? })` clone method on registered chain factories — currently consumers must hand-rebuild frozen chain singletons to opt in to 7702 or Jito.
214
+ - Blockhash-expiry internal re-broadcast — consumer implements retry loop per safe-broadcast rule (re-broadcast SAME signed bytes, never re-prepare).
215
+
216
+ ---
217
+
218
+ ## [0.2.1] — 2026-08-01
219
+
220
+ Hotfix release. Zero API changes; hygiene only. Native-token sentinel handling deferred to the paired gasless card (out of SDK scope — `Token.isNative()` already covers the SDK-side native check; the `0xeeee…` string convention is a consumer-side external-interop concern).
221
+
222
+ ### Added
223
+
224
+ - Dual CJS+ESM build pipeline: emits `dist/esm/` (ESM) + `dist/cjs/` (CJS) via two `tsc` configs, with per-directory `package.json` `type` overrides so Node picks the correct loader per subpath. Fixes `ERR_REQUIRE_ESM` for CJS consumers (NestJS builds target CJS by default).
225
+
226
+ ### Changed
227
+
228
+ - `class-validator` and `class-transformer` moved from `dependencies` to `peerDependencies` with generous ranges (`class-validator: ^0.14 || ^0.15 || ^0.16`). Prevents duplicate copies when both gasless (0.14) and depositron (0.15) install this package — two copies silently break decorator-metadata dedupe.
229
+ - `decimal.js` stays a regular dependency (already cross-copy-safe via structural probe + toString round-trip in `chain.base.ts`).
230
+
231
+ ### Security
232
+
233
+ - `.env` and `.npmrc.publish` added to `.gitignore` so npm tokens can never be committed.
234
+
235
+ ## [0.2.0] — 2026-07-27
236
+
237
+ Initial npm release of `@getomnichain/omnichain`. Replaces the vendored `pluton-bridge/omnichain` git submodule for consumer repos (`depositron`, `gasless`).
238
+
239
+ ### Added
240
+
241
+ - Package published to npm registry under `@getomnichain` scope with public access.
242
+ - CJS build (single-target) suitable for NestJS consumers.
243
+ - Root barrel + `/evm`, `/utxo`, `/solana` subpath exports.
244
+ - Full API surface at parity with the vendored submodule at commit `65c515002a08eceae29b5089c2ca6de83395a1fe`.
245
+
246
+ ### Migration from vendored submodule
247
+
248
+ - Consumers that previously imported from `../../chain/*` (relative to `src/modules/`) now import from `@getomnichain/omnichain` (root barrel) or `@getomnichain/omnichain/evm` / `/utxo` / `/solana` for subpath-scoped imports.
249
+ - Solana chainId numbering renumbered (breaking; per-consumer SQL data migration required for any persisted Solana chainId).
250
+ - `pluton-bridge/omnichain` git submodule deprecated — do not consume.
251
+
252
+ ---
253
+
254
+ [0.3.0]: https://github.com/getomnichain/omnichain/releases/tag/v0.3.0
255
+ [0.2.1]: https://github.com/getomnichain/omnichain/releases/tag/v0.2.1
256
+ [0.2.0]: https://github.com/getomnichain/omnichain/releases/tag/v0.2.0
@@ -1 +1 @@
1
- {"version":3,"file":"chain.base.js","sourceRoot":"","sources":["../../chain.base.ts"],"names":[],"mappings":";;;AA6DA,sDA+GC;AA5KD,2CAAqC;AAGrC,2CAA0D;AAE1D,mEAAgE;AA8ChE;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CACnC,GAA0B,EAC1B,QAAgB;IAEhB,0EAA0E;IAC1E,6EAA6E;IAC7E,2EAA2E;IAC3E,IAAI,GAAG,CAAC,aAAa,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAC9E,MAAM,IAAI,sBAAU,CAClB,2BAAe,CAAC,eAAe,EAC/B,8DAA8D,OAAO,GAAG,CAAC,aAAa,GAAG,CAC1F,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS;QAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI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EACxB,YAAoB,EACpB,eAAuB;QAEvB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC;IAsBD,QAAQ;QACN,OAAO,iBAAiB,IAAI,CAAC,OAAO,UAAU,IAAI,CAAC,IAAI,iBAAiB,IAAI,CAAC,WAAW,GAAG,CAAC;IAC9F,CAAC;CACF;AAlDD,sBAkDC"}
@@ -4,23 +4,51 @@ exports.ChainError = exports.ChainErrorKinds = void 0;
4
4
  exports.sanitizeMessage = sanitizeMessage;
5
5
  exports.sanitizeCause = sanitizeCause;
6
6
  exports.isChainError = isChainError;
7
+ exports.isBlockhashExpiredError = isBlockhashExpiredError;
8
+ exports.isSimulationError = isSimulationError;
9
+ exports.isNonceError = isNonceError;
10
+ exports.isTransactionTooLargeError = isTransactionTooLargeError;
7
11
  /**
8
12
  * Replace `rpcUrl` in `message` with its host-only form so API keys carried
9
13
  * in the URL path/query don't leak into error strings. Falls back to a
10
14
  * `<rpc>` placeholder if the URL is unparseable.
11
15
  */
12
16
  function sanitizeMessage(message, rpcUrl) {
17
+ let out = message;
18
+ // Long hex runs (with or without 0x prefix) are signed-tx bytes or opaque
19
+ // payloads. Threshold 128 hex chars = 64 bytes, above the largest transient
20
+ // identifier (tx hash / signature = 64 hex / 88 base58) so we don't clobber
21
+ // hashes but do catch even a minimal signed EVM tx (~110 bytes).
22
+ out = out.replace(/(?:0x)?[0-9a-fA-F]{128,}/g, (m) => {
23
+ const hexLen = m.startsWith('0x') || m.startsWith('0X') ? m.length - 2 : m.length;
24
+ return `<signed-bytes:${hexLen / 2}B>`;
25
+ });
26
+ // Long base64 runs (Solana / Jito payloads). base64 signed-tx is ~200 chars.
27
+ out = out.replace(/[A-Za-z0-9+/]{160,}={0,2}/g, (m) => `<signed-bytes-b64:${m.length}c>`);
28
+ out = out.replace(/([?&])([a-zA-Z_-]*(?:api[-_]?key|key|token|access[-_]?token|secret|auth))=[^\s"&]+/gi, '$1$2=<redacted>');
29
+ out = out.replace(/Bearer\s+[A-Za-z0-9._~+/=-]+/gi, 'Bearer <redacted>');
30
+ out = out.replace(/Authorization:\s*[A-Za-z0-9._~+/=-]+/gi, 'Authorization: <redacted>');
31
+ out = out.replace(/((?:x-)?api[-_]?key)\s*:\s*[A-Za-z0-9._~+/=-]+/gi, '$1: <redacted>');
32
+ out = out.replace(/(\/v\d+|\/api|\/rpc)\/[A-Za-z0-9_-]{16,}(?=[\s/,)\];.'"]|$)/gi, '$1/<redacted>');
33
+ out = out.replace(/https?:\/\/[^\s"'`]*\.(?:alchemy\.com|infura\.io|quiknode\.pro|helius-rpc\.com|ankr\.com|blastapi\.io|drpc\.org)\/[A-Za-z0-9_./=-]{8,}/gi, (m) => {
34
+ try {
35
+ const u = new URL(m);
36
+ return `${u.protocol}//${u.host}/<redacted>`;
37
+ }
38
+ catch {
39
+ return '<rpc>';
40
+ }
41
+ });
13
42
  if (!rpcUrl)
14
- return message;
15
- let host;
43
+ return out;
16
44
  try {
17
45
  const u = new URL(rpcUrl);
18
- host = `${u.protocol}//${u.host}`;
46
+ const host = `${u.protocol}//${u.host}`;
47
+ return out.replaceAll(rpcUrl, host);
19
48
  }
20
49
  catch {
21
- return message.replaceAll(rpcUrl, '<rpc>');
50
+ return out.replaceAll(rpcUrl, '<rpc>');
22
51
  }
23
- return message.replaceAll(rpcUrl, host);
24
52
  }
25
53
  /**
26
54
  * Build a fresh `Error` from `cause` with a sanitized message and stack,
@@ -34,7 +62,9 @@ function sanitizeMessage(message, rpcUrl) {
34
62
  function sanitizeCause(cause, rpcUrl) {
35
63
  if (!(cause instanceof Error))
36
64
  return undefined;
37
- const safe = new Error(sanitizeMessage(cause.message, rpcUrl));
65
+ const short = cause.shortMessage;
66
+ const source = typeof short === 'string' && short.length > 0 ? short : cause.message;
67
+ const safe = new Error(sanitizeMessage(source, rpcUrl));
38
68
  safe.name = cause.name;
39
69
  if (cause.stack)
40
70
  safe.stack = sanitizeMessage(cause.stack, rpcUrl);
@@ -49,6 +79,13 @@ exports.ChainErrorKinds = {
49
79
  InvalidAddress: 'invalid_address',
50
80
  InvalidTokenIdentifier: 'invalid_token_identifier',
51
81
  InvalidArgument: 'invalid_argument',
82
+ BroadcastRejected: 'broadcast_rejected',
83
+ NonceTooLow: 'nonce_too_low',
84
+ InsufficientFunds: 'insufficient_funds',
85
+ BlockhashExpired: 'blockhash_expired',
86
+ SimulationFailed: 'simulation_failed',
87
+ TransactionTooLarge: 'transaction_too_large',
88
+ FeatureNotSupported: 'feature_not_supported',
52
89
  };
53
90
  class ChainError extends Error {
54
91
  kind;
@@ -66,4 +103,16 @@ function isChainError(err, kind) {
66
103
  return false;
67
104
  return kind === undefined || err.kind === kind;
68
105
  }
106
+ function isBlockhashExpiredError(err) {
107
+ return isChainError(err, exports.ChainErrorKinds.BlockhashExpired);
108
+ }
109
+ function isSimulationError(err) {
110
+ return isChainError(err, exports.ChainErrorKinds.SimulationFailed);
111
+ }
112
+ function isNonceError(err) {
113
+ return isChainError(err, exports.ChainErrorKinds.NonceTooLow);
114
+ }
115
+ function isTransactionTooLargeError(err) {
116
+ return isChainError(err, exports.ChainErrorKinds.TransactionTooLarge);
117
+ }
69
118
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../errors.ts"],"names":[],"mappings":";;;AAKA,0CAUC;AAWD,sCAMC;AAo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