-
Notifications
You must be signed in to change notification settings - Fork 50
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
feature: domain resolver #2866
feature: domain resolver #2866
Conversation
Signed-off-by: banklesss <105349292+banklesss@users.noreply.github.com>
5e15c7c
to
a337a43
Compare
@@ -54,7 +54,7 @@ export const LINEAR_FEE = { | |||
} as const | |||
export const MINIMUM_UTXO_VAL = '1000000' | |||
|
|||
export const HISTORY_REFRESH_TIME = 25000 | |||
export const HISTORY_REFRESH_TIME = 35000 |
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.
avg block is ~20s, doing below 30s has a high chance to sync with no updates, ideal 30/worst 40/avg 35s. (suggesting to add as a config) for the user
@@ -742,7 +742,7 @@ export const useIsOnline = ( | |||
() => true, | |||
() => false, | |||
), | |||
refetchInterval: 5000, | |||
refetchInterval: 15000, |
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.
too often, under a block is fine avg 20s
if (!receiver.includes('.')) throw new Resolver.Errors.InvalidDomain() | ||
if (!isCnsDomain(receiver)) | ||
return Promise.reject(new Resolver.Errors.UnsupportedTld()) | ||
return Promise.reject(new Resolver.Errors.UnsupportedTld()) |
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.
unsupported for now, needs implementation.
// ultra_rare = 'ultra_rare', // - 2 characters | ||
// legendary = 'legendary' // - 1 character | ||
// } | ||
rarity: string // translated to string only |
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.
rarity on handle API is an enum, we translate it to string for now.
@@ -0,0 +1,8 @@ | |||
import {ResolverNameServer} from './service' | |||
|
|||
export type ResolverReceiver = { |
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.
receiver is no longer a string and becomes a new data structure,
resolve
=> domain/address/receiver to use/resolve aka URL
as
=> type, domain
means supported domain
selectedNameServer
defaults to the only response if === 1 aka NS
addressRecords
the list of addresses per name server aka A record
a337a43
to
014285b
Compare
apps/wallet-mobile/translations/messages/src/WalletInit/WalletForm.json
Outdated
Show resolved
Hide resolved
e09e018
to
62ca9c3
Compare
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.
Tried and works well!
import {Api, Resolver} from '@yoroi/types' | ||
import {fetchData, FetchData, handleApiError, isLeft} from '@yoroi/common' | ||
import {z} from 'zod' | ||
import {AxiosRequestConfig} from 'axios' |
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.
Should it be wrapped in @yoroi/common
?
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.
yap, is a little bit leaky since is exposing the "fetcher" config directly, but also didn't want a 1:1, it's a @banklesss good call for an improvement, maybe we can expose only what we are actually using.
Co-authored-by: banklesss <105349292+banklesss@users.noreply.github.com> Signed-off-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com>
@@ -18,7 +19,7 @@ export type TextInputProps = RNTextInputProps & | |||
Omit<React.ComponentProps<typeof RNPTextInput>, 'theme'> & { | |||
containerStyle?: ViewStyle | |||
renderComponentStyle?: ViewStyle | |||
helperText?: string | |||
helper?: string | React.ReactNode |
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.
helper?: string | React.ReactNode | |
helper?: React.ReactNode |
Signed-off-by: banklesss <105349292+banklesss@users.noreply.github.com> Signed-off-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com> Co-authored-by: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com>
Working with unstoppable and $handle domains at the moment
Related to YOMO-898
TODO:
preprod support