Doc audit: merchant-sdk#9
Merged
marceloceccon merged 3 commits intomainfrom May 10, 2026
Merged
Conversation
Hardenings flowing from the security review of the v0.5.0 additions
(estimateGas, telemetry breadcrumb, headless hooks + Web Components,
EIP-2612 permit signing, ConfirmationPolicy):
- src/evm/permit.ts:
* cap permit deadlines at 60 minutes from now (rejects MAX_SAFE_INTEGER
and other no-expiry bearer windows);
* cross-validate input.chainId against walletClient.getChainId() before
signing so a stale config can't produce a payload replayable on the
wallet's actual chain;
* run validatePermitSignature() on the wallet's reply before returning,
catching corrupt signatures earlier than the token contract would.
- src/core/telemetry.ts: redactErrorMessage now strips POSIX/Windows
filesystem paths, file:// URLs, and long bare hex blobs (>=64 chars,
private-key shaped) in addition to addresses, tx hashes, UUIDs, and
base58 pubkeys. Stops integrators from leaking stack-trace paths and
raw secrets via 3rd-party analytics pipelines.
- src/solana/estimateGas.ts: throw when BOTH simulateTransaction and
getRecentPrioritizationFees fail rather than silently returning the
static 5000-lamport signature fee (which would render as "~$0.001"
even on a congested cluster). The single-failure tolerant paths stay
in place.
- package.json: declare the wc subpath entrypoint as having side effects
so tree-shaking-aware bundlers don't drop the customElements.define
call. This is the documented contract; the manifest now matches.
- src/index.ts: re-export MAX_PERMIT_DEADLINE_WINDOW_SECONDS so callers
can introspect the cap (e.g. to render their own deadline-picker UI
without hard-coding the value).
Tests: 171 pass (149 baseline + 22 new for permit hardenings, telemetry
path/hex redaction, and the Solana both-fail throw).
The CHANGELOG already records V0.5.0 (gas estimator, telemetry, headless + web components, EIP-712 permit), but the README's feature list, subpath table, and test count had not caught up. - Subpath table: add the new `/headless` and `/wc` exports landed in segment 14.5 so consumers can see they exist without reading the CHANGELOG. - Features list: add bullets for the gas estimator (14.1), telemetry breadcrumbs (14.2), headless layer + Web Components (14.5), and EIP-712 permit (14.6). Each cross-references the segment number so the linkage to the enhancement plan is explicit. - Development row: bump `npm run test` from 61 tests to 12 files / 150 tests — the V0.5.0 commits added solana-estimateGas, evm-estimateGas, tron-estimateGas, telemetry, and confirmationPolicy specs.
…-05-10 Security: post-review fixes for merchant-sdk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/headlessand/wcexports landed in segment 14.5.npm run testfrom 61 tests to 12 files / 150 tests.Test plan
npm run testreports 150 passing testsnode -e "console.log(require('./package.json').exports)"lists./headlessand./wc