Background
- The
ensnode-sdk package currently imports from the ens-referrals package in the ENSNode monorepo. This was done to accelerate shipping ENS Holiday Awards, but is now a key issue blocking next steps.
- The
ens-referrals package in the ENSNode monorepo currently copy-pastes a number of ideas from the ensnode-sdk package. This code duplication is unfortunate but was done to accelerate shipping ENS Holiday Awards while avoiding a circular dependency between ensnode-sdk and ens-referrals.
Big picture goals
The following goals are NOT for this issue specifically. However they are the bigger goals we are working towards getting closer to enabling in this issue.
- The backend logic for fetching referral dashboards / referral data by the ENS Awards site should be transitioned out of ENSApi and instead into a completely new app that will be moved completely out of the ENSNode monorepo and will build on the
ENSDbClient that Tomasz is advancing prerequisites for.
- The
ens-referrals package needs to be fully transitioned out of the ENSNode monorepo.
Goals for this specific issue
- The
ensnode-sdk package must remove its dependency on the ens-referrals package.
- All ideas that currently live in the
ensnode-sdk package related to referrals need to move into the ens-referrals package.
- This will include a need for us to define an entirely new "client" in
ens-referrals that replicates the overall design patterns from the "client" in ensnode-sdk (packages/ensnode-sdk/src/client.ts) but becomes the new home for implementing the following:
getReferrerLeaderboardPage
getReferrerDetail
- This will mean that the ENSAwards site will need to create both an
ENSNodeClient from ensnode-sdk and a (new!) ENSReferralsClient from ens-referrals.
- ENSAwards will therefore have dependencies on both
ensnode-sdk and ens-referrals.
- This will also mean that (for now!) the ENSApi app will have dependencies on both
ensnode-sdk and ens-referrals. This is a temporary step until we can complete the big picture goals identified in the section above.
- The
ens-referrals package should add a dependency on ensnode-sdk.
- Each of the following ideas that are currently defined in
ens-referrals should be deleted from ens-referrals and instead be converted into imports from ensnode-sdk to remove code duplication and improve code maintainability moving forward:
ChainId
AccountId
UnixTimestamp
Duration
- Introduce zero changes that would break the ENSAwards site from the perspective of the network layer of API requests / responses. Breaks to the ENSAwards site at the code import / build layer are fully expected by this work and are ok 👍
Background
ensnode-sdkpackage currently imports from theens-referralspackage in the ENSNode monorepo. This was done to accelerate shipping ENS Holiday Awards, but is now a key issue blocking next steps.ens-referralspackage in the ENSNode monorepo currently copy-pastes a number of ideas from theensnode-sdkpackage. This code duplication is unfortunate but was done to accelerate shipping ENS Holiday Awards while avoiding a circular dependency betweenensnode-sdkandens-referrals.Big picture goals
The following goals are NOT for this issue specifically. However they are the bigger goals we are working towards getting closer to enabling in this issue.
ENSDbClientthat Tomasz is advancing prerequisites for.ens-referralspackage needs to be fully transitioned out of the ENSNode monorepo.Goals for this specific issue
ensnode-sdkpackage must remove its dependency on theens-referralspackage.ensnode-sdkpackage related to referrals need to move into theens-referralspackage.ens-referralsthat replicates the overall design patterns from the "client" inensnode-sdk(packages/ensnode-sdk/src/client.ts) but becomes the new home for implementing the following:getReferrerLeaderboardPagegetReferrerDetailENSNodeClientfromensnode-sdkand a (new!)ENSReferralsClientfromens-referrals.ensnode-sdkandens-referrals.ensnode-sdkandens-referrals. This is a temporary step until we can complete the big picture goals identified in the section above.ens-referralspackage should add a dependency onensnode-sdk.ens-referralsshould be deleted fromens-referralsand instead be converted into imports fromensnode-sdkto remove code duplication and improve code maintainability moving forward:ChainIdAccountIdUnixTimestampDuration