-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Milestone
Description
Prerequisites
- Flip dependency relationship between the
ens-referralsandensnode-sdkpackages #1519 - Introduce API versioning for ENS Referrals APIs #1520
Background info
- When the
ens-referralspackage was first implemented, we took a few temporary shortcuts to ensure ENS Holiday Awards could be shipped before Dec 1. These temporary shortcuts included quick fixes for theUSDQuantityandRevenueContributionprice data models currently defined inens-referrals. - A more mature price data model for
PriceUsdcandPriceEthare defined inensnode-sdk, however we were previously blocked on using these more mature data models because of issue 1519 and our need to ensure ENS Holiday Awards was shipped on schedule.
Change Management Notes
- All ideas in this issue should apply exclusively to the "v1" implementation of referral-related APIs. No changes should be made to the "v0" implementations. See issue 1520 for details.
Goals
- The price data models returned in the "v1" implementation of referral-related APIs should transition to use the more mature price data models defined in
ensnode-sdk.
Suggested actions
- All uses of
USDQuantityshould be removed and replaced withPriceUsdc. - All uses of
RevenueContributionshould be removed and replaced withPriceEth. - NOTE: please take special care of how
PriceUsdcandPriceEthstore bigint values to avoid issues with floating point numbers in a context where potentially inaccurate floating point math is unacceptable. Therefore, it is critical to get the amount of 0's correct in representing these values.- For reference, see
currencyInfoinpackages/ensnode-sdk/src/shared/currencies.ts - This may also be helpful for your testing to convert between Wei vs Eth: https://eth-converter.com/
- Also, for reference, we previously built some related utility functions for NameKit that may be helpful copy-paste-refine opportunities for you to solve your goals here:
- For reference, see
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo