-
Notifications
You must be signed in to change notification settings - Fork 841
feat: basename renewals #2227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: basename renewals #2227
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🟡 Heimdall Review Status
|
// Params | ||
const normalizedName = normalizeEnsDomainName(name); | ||
const { basePrice, premiumPrice } = useRentPrice(normalizedName, years); | ||
const totalPrice = basePrice + premiumPrice; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A renewal will only ever use the base price. Premiums are only used when a name is being registered and might be in a dutch auction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, i'll either only use baseprice here or see if we have a hook that only pulls baseprice
function secondsInYears(years: number): bigint { | ||
const secondsPerYear = 365.25 * 24 * 60 * 60; // .25 accounting for leap years | ||
return BigInt(Math.round(years * secondsPerYear)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to swap this call out to the shared util?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, there are a bunch to dedupe, i'll handle that once we get the renewals working
43ebd3a
to
d6dfc2f
Compare
return Promise.resolve(); | ||
}, | ||
reverseRecord: false, | ||
setReverseRecord: function () { | ||
return undefined; | ||
}, | ||
hasExistingBasename: false, | ||
registerNameIsPending: false, | ||
registerNameError: null, | ||
code: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add all empty values to default context
@@ -28,7 +39,7 @@ export function useRegisterNameCallback( | |||
years: number, | |||
discountKey?: `0x${string}`, | |||
validationData?: `0x${string}`, | |||
) { | |||
): UseRegisterNameCallbackReturnType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix type issue
@@ -61,7 +72,7 @@ export function useRegisterNameCallback( | |||
transactionStatus: registerNameStatus, | |||
transactionIsLoading: registerNameIsLoading, | |||
transactionError: registerNameError, | |||
} = useWriteContractWithReceipt({ | |||
} = useWriteContractWithReceipt<typeof REGISTER_CONTRACT_ABI, 'register'>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix type issue
type ContractFunctionPayableInfo<TAbi extends Abi, TFunctionName extends string> = Extract< | ||
TAbi[number], | ||
{ name: TFunctionName; stateMutability: string } | ||
>['stateMutability'] extends 'payable' | ||
? { value: bigint | undefined } | ||
: { value?: never }; | ||
|
||
type WriteContractParameters< | ||
TAbi extends Abi = Abi, | ||
TFunctionName extends string = string, | ||
> = ContractFunctionParameters & ContractFunctionPayableInfo<TAbi, TFunctionName>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add value
parameter to methods with stateMutability: payable
What changed? Why?
Notes to reviewers
How has it been tested?
Have you tested the following pages?
BaseWeb
BaseDocs