feat(protocol-core): add @quickswap-defi/protocol-core package#17
Merged
henrypalacios merged 4 commits intomainfrom Apr 16, 2026
Merged
feat(protocol-core): add @quickswap-defi/protocol-core package#17henrypalacios merged 4 commits intomainfrom
henrypalacios merged 4 commits intomainfrom
Conversation
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.
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
@quickswap-defi/protocol-core— zero-dependency foundation package with chain configs, stablecoins, fees, schema detection, and protocol version queries as single source of truth@quickswap-defi/sdk+@quickswap-defi/protocol-core)utils/), fix data bugs (WWDOGE→WDOGE, WMATIC→WPOL), renamehasDynamicFee→exposeDynamicFee, addCHAIN_IDconst map,getChainOrThrow, stablecoin cache guardChanges
utils/constants.ts,math.ts,time.ts— analytics concerns that leaked into protocol layerWWDOGE→WDOGEtypo, PolygonWMATIC→WPOLalignment with SDK, Dogechain DAI address isolationpackages/sdk/, updatedpackage.jsonVerification
packages/protocol-core/)tsc --noEmitcleanTest plan
pnpm --filter @quickswap-defi/protocol-core test— 154 passedpnpm --filter @quickswap-defi/protocol-core exec tsc --noEmit— cleanpnpm --filter @quickswap-defi/sdk test— existing SDK tests pass