Conversation
🦋 Changeset detectedLatest commit: 8216c01 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 50 minutes and 49 seconds.Comment |
There was a problem hiding this comment.
Pull request overview
Adds $ENS as a supported currency in @ensnode/ensnode-sdk, extending the shared currency model and related parsing/schema utilities so ENS-denominated prices can be represented consistently alongside ETH/USDC/DAI.
Changes:
- Add
CurrencyIds.ENSplusPriceEns/SerializedPriceEns,priceEns(), andparseEns()in shared currencies. - Extend Zod price parsing to accept the new
ENScurrency discriminator and addmakePriceEnsSchema(). - Add/extend tests for ENS currency handling and update the SDK changeset.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ensnode-sdk/src/shared/currencies.ts | Adds ENS currency ID, ENS price types, priceEns, and parseEns. |
| packages/ensnode-sdk/src/shared/currencies.test.ts | Adds test coverage for ENS currency info, constructors, scaling, and parsing. |
| packages/ensnode-sdk/src/shared/zod-schemas.ts | Extends makePriceSchema union and introduces makePriceEnsSchema. |
| packages/ensnode-sdk/src/shared/zod-schemas.test.ts | Updates price schema parsing tests to include ENS and adjusts error expectation. |
| .changeset/eager-otters-wave.md | Declares a minor release and summarizes the ENS currency additions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR adds ENS token ( Confidence Score: 5/5Safe to merge — clean, well-tested addition that follows the established currency pattern exactly. All new code mirrors the existing ETH/DAI/USDC implementations without deviation. Types, schemas, serialization, deserialization, and parse helpers are complete and consistent. Tests cover integer/decimal parsing, precision, error cases, and type narrowing. No logic bugs or missing pieces found. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["string input\n(e.g. '1.5')"] -->|parseEnsTokens| B["validateAmountToParse"]
B -->|valid| C["getCurrencyInfo(ENSTokens)\n→ decimals: 18"]
C --> D["parseUnits(value, 18)\nviem"]
D --> E["priceEnsTokens(amount)\n→ PriceEnsTokens"]
E -->|serializePriceEnsTokens| F["SerializedPriceEnsTokens\n{ currency: 'ENSTokens', amount: string }"]
F -->|deserializePriceEnsTokens| G["makePriceEnsTokensSchema\nZod validation"]
G -->|valid| E
E --> H["Price union type\nPriceEth | PriceDai | PriceUsdc | PriceEnsTokens"]
F --> I["SerializedPrice union type"]
Reviews (4): Last reviewed commit: "review" | Re-trigger Greptile |
lightwalker-eth
left a comment
There was a problem hiding this comment.
@Goader Looks good! A few suggestions. Please take the lead to merge when ready 👍
| ETH: "ETH", | ||
| USDC: "USDC", | ||
| DAI: "DAI", | ||
| ENS: "ENS", |
There was a problem hiding this comment.
| ENS: "ENS", | |
| ENSTokens: "ENSTokens", |
Goal: We have "ENS" in so many places all over, therefore trying to give this a more distinctive name, even if it means we aren't strictly following the same pattern for naming ENSTokens as we do for other currencies.
| } | ||
|
|
||
| export type Price = PriceEth | PriceDai | PriceUsdc; | ||
| export interface PriceEns { |
There was a problem hiding this comment.
| export interface PriceEns { | |
| export interface PriceEnsTokens { |
| /** | ||
| * Serialized representation of {@link PriceEns}. | ||
| */ | ||
| export interface SerializedPriceEns extends Omit<PriceEns, "amount"> { |
There was a problem hiding this comment.
| export interface SerializedPriceEns extends Omit<PriceEns, "amount"> { | |
| export interface SerializedPriceEnsTokens extends Omit<PriceEns, "amount"> { |
| }, | ||
| [CurrencyIds.ENS]: { | ||
| id: CurrencyIds.ENS, | ||
| name: "Ethereum Name Service", |
There was a problem hiding this comment.
| name: "Ethereum Name Service", | |
| name: "$ENS Tokens", |
| } | ||
|
|
||
| /** | ||
| * Create price in ENS for given amount. |
There was a problem hiding this comment.
| * Create price in ENS for given amount. | |
| * Create price in ENS Tokens for given amount. |
| return parsed.data; | ||
| } | ||
|
|
||
| export function deserializePriceEns(maybePrice: unknown, valueLabel?: string): PriceEns { |
There was a problem hiding this comment.
| export function deserializePriceEns(maybePrice: unknown, valueLabel?: string): PriceEns { | |
| export function deserializePriceEnsTokens(maybePrice: unknown, valueLabel?: string): PriceEns { |
| /** | ||
| * Serializes a {@link PriceEns} object. | ||
| */ | ||
| export function serializePriceEns(price: PriceEns): SerializedPriceEns { |
There was a problem hiding this comment.
| export function serializePriceEns(price: PriceEns): SerializedPriceEns { | |
| export function serializePriceEnsTokens(price: PriceEns): SerializedPriceEns { |
| "@ensnode/ensnode-sdk": minor | ||
| --- | ||
|
|
||
| Add `$ENS` as a supported currency in `@ensnode/ensnode-sdk`: `CurrencyIds.ENS`, `PriceEns`/`SerializedPriceEns` types, and the `priceEns`, `parseEns`, `serializePriceEns`, `deserializePriceEns` helpers. |
There was a problem hiding this comment.
Could you please update the terminology here based on other feedback? Thanks!
| /** | ||
| * Schema for {@link PriceEns} type. | ||
| */ | ||
| export const makePriceEnsSchema = (valueLabel: string = "Price ENS") => |
There was a problem hiding this comment.
| export const makePriceEnsSchema = (valueLabel: string = "Price ENS") => | |
| export const makePriceEnsTokensSchema = (valueLabel: string = "Price ENS") => |
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@ensnode/ensnode-sdk": minor | |||
There was a problem hiding this comment.
Could you please create a new issue in the ENSAwards GitHub for "Upgrade to ENSNode v1.11.0" (our next coming release).
We'll use this issue to track special actions that should be taken on ENSAwards when it's upgraded to work with the next coming release.
For now, please begin this list of special actions to identify how the new ENS currency type should be used from ensnode-sdk.
There was a problem hiding this comment.
Pull request overview
Adds support for representing ENS token-denominated prices in @ensnode/ensnode-sdk shared currency utilities, including Zod parsing/validation, (de)serialization helpers, and tests.
Changes:
- Added
CurrencyIds.ENSTokensplusPriceEnsTokens/SerializedPriceEnsTokenstypes and helpers (priceEnsTokens,parseEnsTokens). - Extended shared Zod schemas to accept/parse the new currency and added a dedicated
makePriceEnsTokensSchema. - Added serialize/deserialize helpers for ENS-token prices and expanded unit tests for parsing and schema behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ensnode-sdk/src/shared/currencies.ts | Introduces ENS-token currency ID/type and parsing/creation helpers. |
| packages/ensnode-sdk/src/shared/currencies.test.ts | Adds unit tests for the new currency info, helpers, scaling behavior, and parsing. |
| packages/ensnode-sdk/src/shared/zod-schemas.ts | Extends Price discriminated union + adds makePriceEnsTokensSchema. |
| packages/ensnode-sdk/src/shared/zod-schemas.test.ts | Updates makePriceSchema tests to include the new currency and error message. |
| packages/ensnode-sdk/src/shared/serialize.ts | Adds serializePriceEnsTokens. |
| packages/ensnode-sdk/src/shared/deserialize.ts | Adds deserializePriceEnsTokens. |
| .changeset/eager-otters-wave.md | Declares a minor version bump for the new currency support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Added ENS currency to
ensnode-sdkcloses: #1941
Summary
ensnode-sdkWhy
$ENSto currencies #1941Testing
Pre-Review Checklist (Blocking)