chore: initial repo skeleton + 14-protocol catalog seed#1
Merged
Conversation
Bootstraps @avaprotocol/protocols as a standalone npm package. Ships
the static-data DeFi catalog (addresses, ABI fragments, event topic
hashes) that previously lived inside @avaprotocol/sdk-js@4.0.0-dev.2
at packages/sdk-js/src/v4/protocols/. Extracted unchanged at the
data level; doc comments rewritten for standalone context.
Protocols covered (14 + shared ERC-20 helper):
- aaveV3 Pool/Oracle/wethGateway × 4 chains + ABI + topics
- aerodrome Router on Base
- chainlink ETH/USD + BTC/USD feeds + AggregatorV3 ABI
- compoundV3 USDC Comet on mainnet + Base
- ethena sUSDe vault + USDe + custom (cooldown) ABI
- fraxEther sfrxETH vault + frxETH + ERC-4626 ABI
- lido wstETH × 2 + stETH + L1 wrap/unwrap ABI
- morphoBlue Singleton on mainnet + Base + MarketParams ABI
- rocketPool rETH × 2 chains + L1 burn/rate/value ABI
- sky sDAI vault + ERC-4626 ABI
- spark SparkLend Pool (AAVE V3 fork)
- superfluid CFAv1Forwarder × 2 + setFlowrate/createFlow ABI
- uniswapV3 Router/Quoter/Permit2/Factory/PM/UR × 4 + ABIs
- wrapped WETH × 4 chains + WETH9 ABI
- erc20 Standard approve fragment
Shared ABIs in common.ts:
- aggregatorV3Abi Any Chainlink-compatible price feed
- erc4626VaultAbi Standard ERC-4626 vault (Frax sfrxETH, Sky sDAI)
Package shape:
- Dual CJS (.cjs) + ESM (.js) + .d.ts via tsup + tsc
- Built tarball: 45 files, 14.7 kB
- Node 18+, MIT, public access on npm
- Type imports surface: `Chains`, `ChainId`, `Protocols`,
`AbiFragment`, `AddressByChain`, `aggregatorV3Abi`,
`erc4626VaultAbi`
Infra:
- tsconfig.json (root) for editor/dev mode, tsconfig.build.json
pinning rootDir=src/outDir=dist for declaration emit
- vitest @ 1.6
- GitHub Actions CI: typecheck + test + build + tarball
verification on Node 18/20/22
Tests (15/15 pass):
- Namespace surface (every protocol enumerated + frozen)
- Address shape (every 0x[40-hex] across the catalog)
- Event-topic shape (32-byte keccak hashes)
- AAVE V3 per-chain Pool coverage + Pool method ABI completeness
+ Borrow event ABI/topic lockstep
- Uniswap V3 per-chain SwapRouter02 + exactInputSingle/
exactOutputSingle + Permit2 same-address invariant
- Shared ABI references stay object-identical across protocol
modules (Frax/Sky share the same erc4626VaultAbi instance)
- Cross-chain coverage parity (AAVE Pool/Oracle/Gateway all
cover the same chain set; Uniswap Router/Factory match)
EOF
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
tsup with package.json "type": "module" emits ESM as index.js and CJS as index.cjs — verify those, not the legacy index.mjs that doesn't exist. The exports map already points at the correct filenames; this just brings the CI check in line.
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
Bootstraps @avaprotocol/protocols as a standalone npm package — the data-only DeFi catalog (addresses, ABI fragments, event topic hashes) extracted from
@avaprotocol/sdk-js@4.0.0-dev.2.Cross-repo conversation between sdk-js, context-memory, and studio concluded that the catalog should ship as a separate public package both repos depend on rather than each maintaining its own copy. Background:
A standalone package (this repo) is the natural home — public so partner SDKs in Python/Rust can consume the JSON, narrow surface so it stays light, single source of truth.
What's in this PR
package.json, dualtsconfig.json(editor) +tsconfig.build.json(declaration emit),.gitignore, MITLICENSE.src/):chains.ts(EIP-155 ID constants),index.ts(top-level export),protocols/(14 protocol modules + sharedcommon.ts+erc20.ts+types.ts+index.tsnamespacing).tests/catalog.test.ts): 15 tests covering namespace surface, address/topic shape, per-protocol completeness, cross-chain coverage parity, shared-ABI reference identity..github/workflows/ci.yml): typecheck + test + build + tarball verification on Node 18/20/22.Surface
14 protocols × 4–5 chains × addresses + curated ABI fragments + event topic hashes. Full table in README.md.
Package shape
dist/index.cjs) + ESM (dist/index.js) + full.d.tsChains,ChainId,Protocols,AbiFragment,AddressByChain,aggregatorV3Abi,erc4626VaultAbiTest plan
yarn typecheck— cleanyarn test:run— 15/15 passyarn build— emitsdist/index.cjs(27.4 KB) +dist/index.js(25.9 KB) + nested.d.tsnpm pack --dry-run— tarball contents includedist/recursively, README, LICENSE0.1.0(ordevtag), bump@avaprotocol/sdk-jsto consume from here and drop the duplicatesrc/v4/protocols/tree.context-memoryto optionally consume the address map for label resolution (currently inlined per AvaProtocol/context-memory#20).🤖 Generated with Claude Code