Skip to content

feat(arbitrum-adapter): scaffold @txkit/arbitrum-adapter (Buildathon Week 1)#18

Merged
mike-diamond merged 2 commits into
mainfrom
feat/arbitrum-adapter-skeleton
May 29, 2026
Merged

feat(arbitrum-adapter): scaffold @txkit/arbitrum-adapter (Buildathon Week 1)#18
mike-diamond merged 2 commits into
mainfrom
feat/arbitrum-adapter-skeleton

Conversation

@mike-diamond
Copy link
Copy Markdown
Contributor

Summary

  • Scaffolds @txkit/arbitrum-adapter skeleton package for the Arbitrum Open House London Buildathon (Week 1 deliverable, originally due 2026-05-28).
  • Mirrors the structure of @txkit/x402-adapter and @txkit/ows-adapter: typed shape on a PreparedEnvelope.meta.arbitrum slot, zero React or wagmi deps, Apache-2.0.
  • Surface covers the four Arbitrum specifics called out in the buildathon strategy: L1->L2 bridging (canonical / Hop / Across / Stargate), retryable-ticket UX hints, sequencer-fee preview (L1 calldata + L2 compute split with a Nova compression flag), and an Arbitrum-aware calldata decoder seed (precompiles, Delayed Inbox on One and Nova, Hop / Across L1 entrypoints).

What's in the package

File Role
src/types.ts ArbitrumChainId, L1ToL2BridgeIntent, L1ToL2BridgeProvider, RetryableTicketHints, SequencerFeePreview, ArbitrumMeta, EnvelopeWithArbitrum, ArbitrumDecodedCall
src/bridge.ts attachBridgeIntent / extractBridgeIntent / isBridgeIntent
src/retryable.ts attachRetryableHints / extractRetryableHints / isRetryableHints
src/sequencer.ts attachSequencerFeePreview / extractSequencerFeePreview / isSequencerFeePreview / previewSequencerFee (stub) / NOVA_USES_COMPRESSED_CALLDATA
src/decoder.ts decodeArbitrumCall + KNOWN_ARBITRUM_ADDRESSES registry
src/__tests__/arbitrum.spec.ts 18 vitest cases covering attach/extract round-trips, type narrowing, meta-preservation, decoder fall-through

Skeleton vs full implementation

Surface alpha.0 (this PR) alpha.1 target
Bridge attach/extract Working Stable
Retryable hints attach/extract Working Stable
Sequencer-fee attach/extract Working Stable
previewSequencerFee Stub (returns null) viem-driven ArbGasInfo + NodeInterface.gasEstimateL1Component reads
Decoder address registry Seed (precompiles + Delayed Inbox One/Nova + Hop / Across L1) Expanded to Camelot / GMX / Pendle / Aave V3 on One, Across SpokePool per chain, Stargate routers
Decoder selector registry 3 selectors (createRetryableTicket, ArbSys.sendTxToL1, ArbSys.withdrawEth) Full per-protocol coverage delegated to @txkit/tx-decoder

Verification

pnpm --filter @txkit/arbitrum-adapter typecheck   # tsc --noEmit, clean
pnpm --filter @txkit/arbitrum-adapter test        # 18/18 pass, 170ms
pnpm --filter @txkit/arbitrum-adapter build       # tsup, 4.86 KB ESM / 5.26 KB CJS / 9.98 KB DTS

Test plan

  • pnpm --filter @txkit/arbitrum-adapter typecheck green
  • pnpm --filter @txkit/arbitrum-adapter test 18/18 pass
  • pnpm --filter @txkit/arbitrum-adapter build produces ESM + CJS + DTS
  • Em-dash / en-dash audit on all new files (zero matches)
  • LICENSE present at package root (Apache-2.0)
  • license: "Apache-2.0" in package.json
  • No per-file license headers (matches @txkit/x402-adapter and @txkit/ows-adapter conventions)
  • CI passes on push
  • Mike review

Out of scope (intentionally)

  • previewSequencerFee body (viem dep would inflate alpha.0 footprint; deferred to alpha.1)
  • Full Hop / Across / Stargate L1 entrypoint coverage per token (alpha.1)
  • Camelot / GMX / Pendle / Aave V3 on Arbitrum One decoder selectors (delegated to @txkit/tx-decoder)
  • Robinhood Chain (Chain ID 46630) coverage (separate task, not Arbitrum-flavoured beyond shared address book)
  • size-limit config + addition to root pnpm size script (alpha.0 not publish-bound, can land in alpha.1)
  • Buildathon Week 1 forum-post markdown (lives in wiki, not committed here)

Forum post draft (out-of-tree, Mike review)

Companion draft for the Builder's Block forum outreach lives at ~/WebstormProjects/claude/wiki/projects/txkit-erc-draft/buildathon-week1-forum-2026-05-29.md (~340 words, intentionally tighter than the 2026-05-28 ERC-composition draft; leads with this adapter as the artifact).

Related

Skeleton package for the Arbitrum Open House London Buildathon Week 1
deliverable. Bridges Arbitrum specifics and the ERC-8265 PreparedTransaction
Envelope via four additive `meta.arbitrum.*` sub-keys plus an Arbitrum-aware
calldata decoder seed.

Surface:
- attach/extract/isBridgeIntent (canonical / Hop / Across / Stargate + open string)
- attach/extract/isRetryableHints (l2Gas, l2GasPriceBid, maxSubmissionCost, refunds)
- attach/extract/isSequencerFeePreview (L1 calldata + L2 compute split, Nova compression flag)
- previewSequencerFee (stub; viem-driven precompile reads land in alpha.1)
- decodeArbitrumCall + KNOWN_ARBITRUM_ADDRESSES (precompiles, Delayed Inbox, Hop / Across L1 entrypoints)

18 vitest tests pass. tsc --noEmit clean. tsup build: 4.86 KB ESM / 5.26 KB CJS / 9.98 KB DTS.
Apache-2.0. Zero React or wagmi deps. Mirrors @txkit/x402-adapter and @txkit/ows-adapter structure.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
txkit-docs Ready Ready Preview, Comment May 29, 2026 10:18am
txkit-land Ready Ready Preview, Comment May 29, 2026 10:18am
txkit-story Ready Ready Preview, Comment May 29, 2026 10:18am

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 29, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedeslint-config-next@​15.5.18991006598100
Addedeslint@​9.39.48910010095100
Addedeslint@​10.1.08910010095100
Addedeslint-plugin-react-hooks@​7.0.110010010096100

View full report

…ards

- New `Publish @txkit/arbitrum-adapter` step before the @txkit/react step (the only consumer of the cohort with internal deps, kept last).
- Each publish step now wraps `pnpm publish` in a `npm view ... >/dev/null 2>&1` check so cohort releases ship only the packages whose package.json version is not yet on the registry. A v* tag can add a new package without forcing a synchronized cohort bump for the seven existing ones (alpha.3 will stay alpha.3, arbitrum-adapter alpha.0 publishes cleanly).
- Behaviour for the documented synchronized-cohort path is unchanged: bump everyone's version, tag v0.1.0-alpha.N, all eight publish.
@mike-diamond mike-diamond merged commit 9378815 into main May 29, 2026
12 of 15 checks passed
@mike-diamond mike-diamond deleted the feat/arbitrum-adapter-skeleton branch May 29, 2026 10:20
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