Skip to content

feat(protocol-core): add @quickswap-defi/protocol-core package#17

Merged
henrypalacios merged 4 commits intomainfrom
feat/protocol-core
Apr 16, 2026
Merged

feat(protocol-core): add @quickswap-defi/protocol-core package#17
henrypalacios merged 4 commits intomainfrom
feat/protocol-core

Conversation

@henrypalacios
Copy link
Copy Markdown
Collaborator

@henrypalacios henrypalacios commented Apr 16, 2026

Summary

  • Add @quickswap-defi/protocol-core — zero-dependency foundation package with chain configs, stablecoins, fees, schema detection, and protocol version queries as single source of truth
  • Convert repo to pnpm workspace monorepo (@quickswap-defi/sdk + @quickswap-defi/protocol-core)
  • Consolidation Phase 1: remove analytics leak (utils/), fix data bugs (WWDOGE→WDOGE, WMATIC→WPOL), rename hasDynamicFeeexposeDynamicFee, add CHAIN_ID const map, getChainOrThrow, stablecoin cache guard

Changes

Area What
Monorepo pnpm workspace, root tsconfig.base.json, shared ESLint flat config
protocol-core 11 chain configs, registry with deep-freeze, token queries (native, wrapped, stablecoins), fee computation, schema/version detection
Removed utils/constants.ts, math.ts, time.ts — analytics concerns that leaked into protocol layer
Fixed Dogechain WWDOGEWDOGE typo, Polygon WMATICWPOL alignment with SDK, Dogechain DAI address isolation
SDK Moved to packages/sdk/, updated package.json

Verification

  • 154 tests, 100% coverage (packages/protocol-core/)
  • tsc --noEmit clean
  • Judgment Day: 2 rounds, 2 independent blind judges per round — APPROVED ✅
  • SDD verified (sdd-verify green, 25/25 tasks complete)

Test plan

  • pnpm --filter @quickswap-defi/protocol-core test — 154 passed
  • pnpm --filter @quickswap-defi/protocol-core exec tsc --noEmit — clean
  • pnpm --filter @quickswap-defi/sdk test — existing SDK tests pass

Convert QuickSwap-sdk repo to pnpm workspace monorepo and create
protocol-core — a pure, zero-dependency protocol knowledge package
that serves as single source of truth for chain configurations,
stablecoin registries, fee constants, and protocol detection across
all QuickSwap repos.

Monorepo conversion:
- Move existing SDK to packages/sdk/ (git mv, history preserved)
- Add pnpm-workspace.yaml, root package.json, tsconfig.base.json
- SDK build and tests unchanged (125 pass, 3 skipped)

protocol-core (packages/protocol-core/):
- 11 production chains: Polygon, Base, MANTRA, Manta, Soneium,
  Somnia, IMX, X-Layer, zkEVM, Dogechain, Ethereum
- All 44 addresses EIP-55 checksummed with build-time validator
- Pure functions + static data, zero runtime dependencies
- Deep-frozen registry (Object.freeze recursive)
- 167 tests, 12 test files, strict TDD
- Dual CJS/ESM build via tsup
- Publish: @quickswap-defi/protocol-core on npm
… fix data, improve API

Remove utils/ module (constants, math, time) that leaked analytics concerns
into the protocol knowledge layer. Fix data inconsistencies: WWDOGE→WDOGE
typo, WMATIC→WPOL alignment with SDK migration, Dogechain DAI address
isolation. Rename hasDynamicFee→exposeDynamicFee for clarity. Add CHAIN_ID
const map, getChainOrThrow, and stablecoin cache guard for invalid chainIds.
Improve barrel exports and type safety.

154 tests, 100% coverage, tsc --noEmit clean.
Split broken publish.yaml into publish-sdk.yaml and
publish-protocol-core.yaml. Each workflow independently versions,
builds, and publishes its package via OIDC trusted publishers.
Namespaced tags: sdk/v*.*.* and protocol-core/v*.*.*.
SHA-pin all GitHub Actions to immutable commit hashes, remove
continue-on-error from audit and test steps, scope permissions to
job level (least privilege), replace third-party softprops/action-gh-release
with gh CLI, add branch guards for both tag-push and workflow_dispatch
paths, fix TOCTOU in git reset --hard, pin npm@11.5.1, remove redundant
artifact download+rebuild.
@henrypalacios henrypalacios merged commit 7599834 into main Apr 16, 2026
2 checks passed
@henrypalacios henrypalacios deleted the feat/protocol-core branch April 16, 2026 23:54
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