Skip to content

Doc audit: merchant-sdk#9

Merged
marceloceccon merged 3 commits intomainfrom
develop
May 10, 2026
Merged

Doc audit: merchant-sdk#9
marceloceccon merged 3 commits intomainfrom
develop

Conversation

@marceloceccon
Copy link
Copy Markdown
Member

Summary

  • The CHANGELOG already captures V0.5.0 (gas estimator, telemetry, headless layer + 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.
  • Features list: add bullets for segments 14.1 / 14.2 / 14.5 / 14.6.
  • Development row: bump npm run test from 61 tests to 12 files / 150 tests.

Test plan

  • CI on this PR
  • npm run test reports 150 passing tests
  • node -e "console.log(require('./package.json').exports)" lists ./headless and ./wc

marceloceccon and others added 3 commits May 10, 2026 00:06
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
@marceloceccon marceloceccon merged commit dd9c97c into main May 10, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant