You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the ens-referrals package 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 the USDQuantity and RevenueContribution price data models currently defined in ens-referrals.
A more mature price data model for PriceUsdc and PriceEth are defined in ensnode-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 USDQuantity should be removed and replaced with PriceUsdc.
All uses of RevenueContribution should be removed and replaced with PriceEth.
NOTE: please take special care of how PriceUsdc and PriceEth store 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 currencyInfo in packages/ensnode-sdk/src/shared/currencies.ts
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:
Prerequisites
ens-referralsandensnode-sdkpackages #1519Background info
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.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
Goals
ensnode-sdk.Suggested actions
USDQuantityshould be removed and replaced withPriceUsdc.RevenueContributionshould be removed and replaced withPriceEth.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.currencyInfoinpackages/ensnode-sdk/src/shared/currencies.ts