diff --git a/src/components/CreateSubdomainModal.tsx b/src/components/CreateSubdomainModal.tsx index 5482d811..ca425f6d 100644 --- a/src/components/CreateSubdomainModal.tsx +++ b/src/components/CreateSubdomainModal.tsx @@ -62,7 +62,7 @@ export const CreateSubdomainModal = ({ }, () => { closeModal("CreateSubdomain"); - } + }, ); refresh(); } catch (err) { diff --git a/src/components/DeleteModal.tsx b/src/components/DeleteModal.tsx index 61bd4261..a6df6df4 100644 --- a/src/components/DeleteModal.tsx +++ b/src/components/DeleteModal.tsx @@ -45,7 +45,7 @@ export const DeleteModal = ({ NAME_PROGRAM_ID, getDomainKeySync(domain).pubkey, publicKey, - publicKey + publicKey, ); const sig = await sendTx(connection, publicKey, [ix], signTransaction); console.log(sig); diff --git a/src/components/DomainRowRecord.tsx b/src/components/DomainRowRecord.tsx index 08f3f914..8d613358 100644 --- a/src/components/DomainRowRecord.tsx +++ b/src/components/DomainRowRecord.tsx @@ -34,7 +34,7 @@ export const DomainRowRecord = ({ const connection = useSolanaConnection(); const picRecord = useProfilePic(connection!, domain); const [picPlaceholderColor, setPicPlaceholderColor] = useState( - tw.color("brand-accent") + tw.color("brand-accent"), ); useEffect(() => { diff --git a/src/components/EditPicture.tsx b/src/components/EditPicture.tsx index cd7fd78d..92818237 100644 --- a/src/components/EditPicture.tsx +++ b/src/components/EditPicture.tsx @@ -53,7 +53,7 @@ export const EditPicture = ({ const ixs: TransactionInstruction[] = []; const { pubkey, parent } = getDomainKeySync( Record.Pic + "." + domain, - true + true, ); try { @@ -75,7 +75,7 @@ export const EditPicture = ({ const ix = await registerFavourite( pubkey, new PublicKey(publicKey), - NAME_OFFERS_ID + NAME_OFFERS_ID, ); ixs.push(...ix); } @@ -85,7 +85,7 @@ export const EditPicture = ({ if (!info?.data) { const space = 2_000; const lamports = await connection.getMinimumBalanceForRentExemption( - space + NameRegistryState.HEADER_LEN + space + NameRegistryState.HEADER_LEN, ); const ix = await createNameRegistry( connection, @@ -95,14 +95,14 @@ export const EditPicture = ({ new PublicKey(publicKey), lamports, undefined, - parent + parent, ); ixs.push(ix); } else { // Zero the data stored const { registry } = await NameRegistryState.retrieve( connection, - pubkey + pubkey, ); if (!registry.owner.equals(new PublicKey(publicKey))) { @@ -114,7 +114,7 @@ export const EditPicture = ({ registry.owner, undefined, parent, - new PublicKey(publicKey) + new PublicKey(publicKey), ); ixs.push(ix); } @@ -127,7 +127,7 @@ export const EditPicture = ({ pubkey, new Numberu32(0), zero, - new PublicKey(publicKey) + new PublicKey(publicKey), ); ixs.push(ix); } @@ -139,7 +139,7 @@ export const EditPicture = ({ pubkey, new Numberu32(0), data, - new PublicKey(publicKey) + new PublicKey(publicKey), ); ixs.push(ix); @@ -147,7 +147,7 @@ export const EditPicture = ({ connection, new PublicKey(publicKey), ixs, - signTransaction + signTransaction, ); console.log(sig); diff --git a/src/components/SearchModal.tsx b/src/components/SearchModal.tsx index 3bfaa445..f46d8d23 100644 --- a/src/components/SearchModal.tsx +++ b/src/components/SearchModal.tsx @@ -28,7 +28,7 @@ export const SearchModal = ({ const list = useMemo( () => domains?.filter((e) => e.domain.includes(search)), - [search] + [search], ); return ( diff --git a/src/components/Skeleton.tsx b/src/components/Skeleton.tsx index e9779a45..bc9b045e 100644 --- a/src/components/Skeleton.tsx +++ b/src/components/Skeleton.tsx @@ -30,7 +30,7 @@ export const Skeleton = ({ useNativeDriver: false, easing: Easing.ease, }), - ]) + ]), ).start(); }, [translateX]); diff --git a/src/components/TokenizeModal.tsx b/src/components/TokenizeModal.tsx index 1b6f1822..03e1f6b6 100644 --- a/src/components/TokenizeModal.tsx +++ b/src/components/TokenizeModal.tsx @@ -60,7 +60,7 @@ export const TokenizeModal = ({ const [mintKey] = PublicKey.findProgramAddressSync( [MINT_PREFIX, pubkey.toBuffer()], - NAME_TOKENIZER_ID + NAME_TOKENIZER_ID, ); const ata = await getAssociatedTokenAddress(mintKey, publicKey); @@ -73,7 +73,7 @@ export const TokenizeModal = ({ const closeAtaIx = createCloseAccountInstruction( ata, publicKey, - publicKey + publicKey, ); ixs.push(closeAtaIx); @@ -96,7 +96,7 @@ export const TokenizeModal = ({ publicKey, ata, publicKey, - mintKey + mintKey, ); ixs.push(ix); } diff --git a/src/components/TransferModal.tsx b/src/components/TransferModal.tsx index a2bd54d5..0f2426f8 100644 --- a/src/components/TransferModal.tsx +++ b/src/components/TransferModal.tsx @@ -56,7 +56,7 @@ export const TransferModal = ({ newOwner, publicKey, undefined, - ROOT_DOMAIN_ACCOUNT + ROOT_DOMAIN_ACCOUNT, ); const sig = await sendTx(connection, publicKey, [ix], signTransaction); diff --git a/src/contexts/LanguageContext.tsx b/src/contexts/LanguageContext.tsx index a46b860b..2d68984f 100644 --- a/src/contexts/LanguageContext.tsx +++ b/src/contexts/LanguageContext.tsx @@ -24,7 +24,7 @@ const LanguageProvider = ({ }) => { // Define a state for the current language const [currentLanguage, setCurrentLanguage] = useState( - i18n.locale || "en" + i18n.locale || "en", ); const setLanguage = async (language: string) => { diff --git a/src/hooks/react-native/useKeyboardVisible.tsx b/src/hooks/react-native/useKeyboardVisible.tsx index 53430d81..c5adce4e 100644 --- a/src/hooks/react-native/useKeyboardVisible.tsx +++ b/src/hooks/react-native/useKeyboardVisible.tsx @@ -9,13 +9,13 @@ export const useKeyboardVisible = () => { "keyboardDidShow", () => { setKeyboardVisible(true); - } + }, ); const keyboardDidHideListener = Keyboard.addListener( "keyboardDidHide", () => { setKeyboardVisible(false); - } + }, ); return () => { diff --git a/src/hooks/useDomainInfo.tsx b/src/hooks/useDomainInfo.tsx index 22bd3cf3..d69b9543 100644 --- a/src/hooks/useDomainInfo.tsx +++ b/src/hooks/useDomainInfo.tsx @@ -10,7 +10,7 @@ export const useDomainInfo = (domain: string) => { const { pubkey } = getDomainKeySync(domain); const { registry, nftOwner } = await NameRegistryState.retrieve( connection, - pubkey + pubkey, ); const _isTokenized = await isTokenized(connection, pubkey); diff --git a/src/hooks/useDomains.tsx b/src/hooks/useDomains.tsx index 5f94fe7e..ab9ef5de 100644 --- a/src/hooks/useDomains.tsx +++ b/src/hooks/useDomains.tsx @@ -14,7 +14,7 @@ export interface Response { const get = async (key: string | undefined | null) => { if (!key) return; const { data }: { data: Response } = await axios.get( - `https://sns-sdk-proxy.bonfida.workers.dev/domains/${key}` + `https://sns-sdk-proxy.bonfida.workers.dev/domains/${key}`, ); if (data.s !== "ok") return; data.result.sort((a, b) => a.domain.localeCompare(b.domain)); diff --git a/src/hooks/useHandleError.tsx b/src/hooks/useHandleError.tsx index 489a089c..0af318fa 100644 --- a/src/hooks/useHandleError.tsx +++ b/src/hooks/useHandleError.tsx @@ -9,7 +9,7 @@ export const useHandleError = () => { err: any, { unknownErrorMessage = "Something went wrong - try again", - }: { unknownErrorMessage?: string } = {} + }: { unknownErrorMessage?: string } = {}, ) => { console.error(err); diff --git a/src/hooks/useSearch.tsx b/src/hooks/useSearch.tsx index 75844722..3f646885 100644 --- a/src/hooks/useSearch.tsx +++ b/src/hooks/useSearch.tsx @@ -11,7 +11,7 @@ export interface Result { export const getDomainsResult = async ( connection: Connection, - domains: string[] + domains: string[], ): Promise => { const keys = domains.map((e) => getDomainKeySync(e).pubkey); const infos = await connection?.getMultipleAccountsInfo(keys); @@ -41,7 +41,7 @@ export const useSearch = (domain: string) => { const domainsAlternatives = generateRandom(parsedDomain, 10); const domainsAlternativesResult = await getDomainsResult( connection, - domainsAlternatives + domainsAlternatives, ); // if the subdomain doesn't exists check if the domain is available if (!subdomainInfo?.data) { diff --git a/src/hooks/useStorageMap.tsx b/src/hooks/useStorageMap.tsx index b58a7e38..e0660ba4 100644 --- a/src/hooks/useStorageMap.tsx +++ b/src/hooks/useStorageMap.tsx @@ -17,7 +17,7 @@ export interface Actions { // We hide some setters from the returned map to disable autocompletion type Return = [ Omit, "set" | "clear" | "delete">, - Actions + Actions, ]; export function useStorageMap(): Return { diff --git a/src/hooks/useSubdomains.tsx b/src/hooks/useSubdomains.tsx index 6c1744ea..f32db2c0 100644 --- a/src/hooks/useSubdomains.tsx +++ b/src/hooks/useSubdomains.tsx @@ -17,7 +17,7 @@ export interface SubdomainResult { async function findOwnedNameAccountsForUser( connection: Connection, - userAccount: PublicKey + userAccount: PublicKey, ): Promise { const filters = [ { @@ -57,32 +57,32 @@ export const useSubdomainsFromUser = (owner: string) => { const ownedAccounts = await findOwnedNameAccountsForUser( connection, - new PublicKey(owner) + new PublicKey(owner), ); const nameRegistriesState = ( await NameRegistryState.retrieveBatch(connection, ownedAccounts) ).filter( (registryState): registryState is NameRegistryState => - registryState !== undefined + registryState !== undefined, ); const uniqueRegistryStateParents = nameRegistriesState.filter( (nameRegistryState, idx) => nameRegistriesState.findIndex((e) => - e.parentName.equals(nameRegistryState.parentName) - ) === idx + e.parentName.equals(nameRegistryState.parentName), + ) === idx, ); const userOwnedSubdomainsPromises = uniqueRegistryStateParents.map( async (registryState) => { const domain = await reverseLookup( connection, - registryState.parentName + registryState.parentName, ); const subdomains = await findSubdomains( connection, - registryState.parentName + registryState.parentName, ); const ownedSubdomains: SubdomainResult[] = []; @@ -100,12 +100,12 @@ export const useSubdomainsFromUser = (owner: string) => { } return ownedSubdomains; - } + }, ); const userSubdomainsResult: SubdomainResult[] = []; const userOwnedSubdomains = await Promise.allSettled( - userOwnedSubdomainsPromises + userOwnedSubdomainsPromises, ); userOwnedSubdomains.map((e) => { if (e.status === "fulfilled") { diff --git a/src/hooks/useTopDomainsSales.tsx b/src/hooks/useTopDomainsSales.tsx index b4336662..5896b7f9 100644 --- a/src/hooks/useTopDomainsSales.tsx +++ b/src/hooks/useTopDomainsSales.tsx @@ -28,7 +28,7 @@ export const useTopDomainsSales = (allowedToLoad: boolean = true) => { const { data: { result }, } = await axios.get<{ result: SearchResponseEntity[] }>( - `${URL}?${searchParams.toString()}` + `${URL}?${searchParams.toString()}`, ); // All domains returned by the API are available diff --git a/src/hooks/useWallet.android.tsx b/src/hooks/useWallet.android.tsx index 218f4c90..967e7c1b 100644 --- a/src/hooks/useWallet.android.tsx +++ b/src/hooks/useWallet.android.tsx @@ -12,7 +12,7 @@ export const useMobilePlatformWallet = () => { const { handleError } = useHandleError(); async function signAllTransactions( - transactions: T[] + transactions: T[], ): Promise { try { return transact(async (wallet) => { @@ -27,7 +27,7 @@ export const useMobilePlatformWallet = () => { } async function signTransaction( - transaction: T + transaction: T, ): Promise { try { return transact(async (wallet) => { @@ -49,7 +49,7 @@ export const useMobilePlatformWallet = () => { } async function signMessage( - message: Uint8Array + message: Uint8Array, ): Promise { try { return transact(async (wallet) => { diff --git a/src/hooks/xnft-hooks.tsx b/src/hooks/xnft-hooks.tsx index f415a3e5..032a07a2 100644 --- a/src/hooks/xnft-hooks.tsx +++ b/src/hooks/xnft-hooks.tsx @@ -33,11 +33,11 @@ export function usePublicKeys(): Map { if (didLaunch) { window.xnft.on("publicKeysUpdate", () => { setPublicKeys( - new Map(Object.entries(window.xnft.publicKeys)) + new Map(Object.entries(window.xnft.publicKeys)), ); }); setPublicKeys( - new Map(Object.entries(window.xnft.publicKeys)) + new Map(Object.entries(window.xnft.publicKeys)), ); } }, [didLaunch, setPublicKeys]); diff --git a/src/locales/index.ts b/src/locales/index.ts index 30f18181..31460731 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -33,7 +33,7 @@ export const LANGUAGES: Language[] = [ // format so we can import directly into lingui's i18n.load() export const allTranslations = Object.fromEntries( - LANGUAGES.map(({ locale, messages }) => [locale, messages]) + LANGUAGES.map(({ locale, messages }) => [locale, messages]), ); // export all available locales for lingui.config.js diff --git a/src/providers/android/AuthorizationProvider.tsx b/src/providers/android/AuthorizationProvider.tsx index 4f59b886..06269750 100644 --- a/src/providers/android/AuthorizationProvider.tsx +++ b/src/providers/android/AuthorizationProvider.tsx @@ -34,7 +34,7 @@ function getAccountFromAuthorizedAccount(account: AuthorizedAccount): Account { function getAuthorizationFromAuthorizationResult( authorizationResult: AuthorizationResult, - previouslySelectedAccount?: Account + previouslySelectedAccount?: Account, ): Authorization { let selectedAccount: Account; if ( @@ -42,7 +42,7 @@ function getAuthorizationFromAuthorizationResult( previouslySelectedAccount == null || // The previously selected account is no longer in the set of authorized addresses. !authorizationResult.accounts.some( - ({ address }) => address === previouslySelectedAccount.address + ({ address }) => address === previouslySelectedAccount.address, ) ) { const firstAccount = authorizationResult.accounts[0]; @@ -93,7 +93,7 @@ const AuthorizationContext = React.createContext({ function AuthorizationProvider(props: { children: ReactNode }) { const { children } = props; const [authorization, setAuthorization] = useState( - null + null, ); // useEffect(() => { @@ -116,11 +116,11 @@ function AuthorizationProvider(props: { children: ReactNode }) { const handleAuthorizationResult = useCallback( async ( - authorizationResult: AuthorizationResult + authorizationResult: AuthorizationResult, ): Promise => { const nextAuthorization = getAuthorizationFromAuthorizationResult( authorizationResult, - authorization?.selectedAccount + authorization?.selectedAccount, ); await setAuthorization(nextAuthorization); // try { @@ -128,7 +128,7 @@ function AuthorizationProvider(props: { children: ReactNode }) { // } catch (err) {} return nextAuthorization; }, - [authorization, setAuthorization] + [authorization, setAuthorization], ); const authorizeSession = useCallback( @@ -145,7 +145,7 @@ function AuthorizationProvider(props: { children: ReactNode }) { return (await handleAuthorizationResult(authorizationResult)) .selectedAccount; }, - [authorization, handleAuthorizationResult] + [authorization, handleAuthorizationResult], ); const deauthorizeSession = useCallback( async (wallet: DeauthorizeAPI) => { @@ -155,18 +155,18 @@ function AuthorizationProvider(props: { children: ReactNode }) { await wallet.deauthorize({ auth_token: authorization.authToken }); setAuthorization(null); }, - [authorization, setAuthorization] + [authorization, setAuthorization], ); const onChangeAccount = useCallback( (nextSelectedAccount: Account) => { setAuthorization((currentAuthorization) => { if ( !currentAuthorization?.accounts.some( - ({ address }) => address === nextSelectedAccount.address + ({ address }) => address === nextSelectedAccount.address, ) ) { throw new Error( - `${nextSelectedAccount.address} is not one of the available addresses` + `${nextSelectedAccount.address} is not one of the available addresses`, ); } return { @@ -175,7 +175,7 @@ function AuthorizationProvider(props: { children: ReactNode }) { }; }); }, - [setAuthorization] + [setAuthorization], ); const value = useMemo( () => ({ @@ -185,7 +185,7 @@ function AuthorizationProvider(props: { children: ReactNode }) { onChangeAccount, selectedAccount: authorization?.selectedAccount ?? null, }), - [authorization, authorizeSession, deauthorizeSession, onChangeAccount] + [authorization, authorizeSession, deauthorizeSession, onChangeAccount], ); return ( diff --git a/src/providers/android/ConnectionProvider.tsx b/src/providers/android/ConnectionProvider.tsx index b91d95a7..139984a2 100644 --- a/src/providers/android/ConnectionProvider.tsx +++ b/src/providers/android/ConnectionProvider.tsx @@ -22,7 +22,7 @@ export const ConnectionProvider: FC = ({ }) => { const connection = useMemo( () => new Connection(endpoint, config), - [endpoint, config] + [endpoint, config], ); return ( @@ -37,7 +37,7 @@ export interface ConnectionContextState { } export const ConnectionContext = createContext( - {} as ConnectionContextState + {} as ConnectionContextState, ); export function useConnection(): ConnectionContextState { diff --git a/src/screens/Cart/index.tsx b/src/screens/Cart/index.tsx index 0108a05c..1791c4d0 100644 --- a/src/screens/Cart/index.tsx +++ b/src/screens/Cart/index.tsx @@ -46,7 +46,7 @@ import { useStatusModalContext } from "@src/contexts/StatusModalContext"; const getTokenAccountBalance = async ( connection: Connection, - key: PublicKey + key: PublicKey, ): Promise => { try { const balances = await connection.getTokenAccountBalance(key); @@ -60,7 +60,7 @@ const checkEnoughFunds = async ( connection: Connection, publicKey: PublicKey, mint: PublicKey, - total: number + total: number, ) => { const ata = getAssociatedTokenAddressSync(mint, publicKey); const balances = await getTokenAccountBalance(connection, ata); @@ -95,7 +95,7 @@ export const Cart = () => { const discountMul = mint === FIDA_MINT ? 0.95 : 1; const totalUsd = cart.reduce( (acc, v) => acc + priceFromLength(v, discountMul), - 0 + 0, ); const price = pyth.result?.get(mint)?.price; @@ -114,7 +114,7 @@ export const Cart = () => { connection, new PublicKey(publicKey), new PublicKey(mint), - total + total, )) ) { return setStatus({ @@ -139,7 +139,7 @@ export const Cart = () => { buyer, ata, mintKey, - referrer ? REFERRERS[referrer] : undefined + referrer ? REFERRERS[referrer] : undefined, ); ixs.push(...ix); } @@ -150,7 +150,7 @@ export const Cart = () => { connection, ata, buyer, - Math.ceil(total * 1.01 * Math.pow(10, 9)) + Math.ceil(total * 1.01 * Math.pow(10, 9)), ); const unwrap = unwrapSol(ata, buyer); ixs = [...wrap, ...ixs, ...unwrap]; diff --git a/src/screens/DomainView.tsx b/src/screens/DomainView.tsx index cfbff797..88302acc 100644 --- a/src/screens/DomainView.tsx +++ b/src/screens/DomainView.tsx @@ -180,7 +180,7 @@ export const DomainView = ({ domain }: { domain: string }) => { }; const prepareUpdateInstructions = async ( - fields: { record: SNSRecord; value: string }[] + fields: { record: SNSRecord; value: string }[], ) => { if (!connection || !publicKey || !signTransaction || !signMessage) return []; @@ -192,7 +192,7 @@ export const DomainView = ({ domain }: { domain: string }) => { const sub = Buffer.from([1]).toString() + record; let { pubkey: recordKey, isSub } = getDomainKeySync( record + "." + domain, - true + true, ); const parent = isSub ? getDomainKeySync(domain).pubkey : ROOT_DOMAIN; @@ -210,7 +210,7 @@ export const DomainView = ({ domain }: { domain: string }) => { new PublicKey(value), recordKey, publicKey, - signed + signed, ); } else { ser = serializeRecord(value, record); @@ -220,7 +220,7 @@ export const DomainView = ({ domain }: { domain: string }) => { if (!currentAccount?.data) { const lamports = await connection.getMinimumBalanceForRentExemption( - space + NameRegistryState.HEADER_LEN + space + NameRegistryState.HEADER_LEN, ); const ix = await createNameRegistry( connection, @@ -230,13 +230,13 @@ export const DomainView = ({ domain }: { domain: string }) => { publicKey, lamports, undefined, - parent + parent, ); ixs.push(ix); } else { const { registry } = await NameRegistryState.retrieve( connection, - recordKey + recordKey, ); if (!registry.owner.equals(publicKey)) { @@ -248,7 +248,7 @@ export const DomainView = ({ domain }: { domain: string }) => { registry.owner, undefined, parent, - publicKey + publicKey, ); ixs.push(ix); } @@ -263,18 +263,18 @@ export const DomainView = ({ domain }: { domain: string }) => { NAME_PROGRAM_ID, recordKey, publicKey, - publicKey + publicKey, ); const sig = await sendTx( connection, publicKey, [ixClose], - signTransaction + signTransaction, ); console.log(sig); const lamports = await connection.getMinimumBalanceForRentExemption( - space + NameRegistryState.HEADER_LEN + space + NameRegistryState.HEADER_LEN, ); const ix = await createNameRegistry( connection, @@ -284,7 +284,7 @@ export const DomainView = ({ domain }: { domain: string }) => { publicKey, lamports, undefined, - parent + parent, ); ixs.push(ix); } @@ -295,7 +295,7 @@ export const DomainView = ({ domain }: { domain: string }) => { recordKey, new Numberu32(0), ser, - publicKey + publicKey, ); ixs.push(ix); @@ -308,7 +308,7 @@ export const DomainView = ({ domain }: { domain: string }) => { domain, publicKey, 1_000, - recordKey + recordKey, ); ixs.push(...ix); } @@ -329,7 +329,7 @@ export const DomainView = ({ domain }: { domain: string }) => { NAME_PROGRAM_ID, pubkey, publicKey, - publicKey + publicKey, ); ixs.push(ix); @@ -383,7 +383,7 @@ export const DomainView = ({ domain }: { domain: string }) => { const deleteInstructions = prepareDeleteInstructions(fieldsToDelete); const updateInstructions = await prepareUpdateInstructions( - fieldsToUpdate + fieldsToUpdate, ); if (!deleteInstructions.length && !updateInstructions.length) { @@ -395,7 +395,7 @@ export const DomainView = ({ domain }: { domain: string }) => { connection, publicKey, [...deleteInstructions, ...updateInstructions], - signTransaction + signTransaction, ); await sleep(400); @@ -417,7 +417,7 @@ export const DomainView = ({ domain }: { domain: string }) => { acc.set(v.record, v.value || ""); return acc; }, - new Map() + new Map(), ), }); } diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 59ae8646..37b89130 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -77,7 +77,7 @@ function HomeRoot() { // This css rules are supported only in browser backgroundClip: "text", backgroundImage: `linear-gradient(to right, ${tw.color( - "brand-primary" + "brand-primary", )}, ${tw.color("brand-accent")})`, }, !isMobile && tw`font-medium text-transparent`, diff --git a/src/screens/Profile/index.tsx b/src/screens/Profile/index.tsx index a9e3cfd1..b4a37b6d 100644 --- a/src/screens/Profile/index.tsx +++ b/src/screens/Profile/index.tsx @@ -39,7 +39,7 @@ export const ProfileScreen = ({ owner }: { owner?: string }) => { owner = owner || publicKey?.toBase58(); const domains = useDomains(owner || publicKey?.toBase58()); const subdomains = useSubdomainsFromUser( - owner || publicKey?.toBase58() || "" + owner || publicKey?.toBase58() || "", ); const [isSearchVisible, toggleSearchBar] = useState(false); @@ -52,7 +52,7 @@ export const ProfileScreen = ({ owner }: { owner?: string }) => { const isOwner = owner === publicKey?.toBase58(); const completedStep = (progress?.result || [])?.filter( - (e) => !!e.value + (e) => !!e.value, ).length; const percentage = Math.floor((100 * completedStep) / 6); @@ -93,8 +93,8 @@ export const ProfileScreen = ({ owner }: { owner?: string }) => { if (subdomains.result) { relatedSubdomains.push( ...subdomains.result.filter( - (sub) => sub.subdomain.split(".")[1] === item.domain - ) + (sub) => sub.subdomain.split(".")[1] === item.domain, + ), ); } @@ -110,7 +110,7 @@ export const ProfileScreen = ({ owner }: { owner?: string }) => { }); return domainsResult.sort((a, b) => - a!.domain === favorite.result?.reverse ? -1 : 1 + a!.domain === favorite.result?.reverse ? -1 : 1, ); }, [ domains.status, diff --git a/src/utils/abbreviate/index.tsx b/src/utils/abbreviate/index.tsx index 40222bd6..81e25a39 100644 --- a/src/utils/abbreviate/index.tsx +++ b/src/utils/abbreviate/index.tsx @@ -10,7 +10,7 @@ export const abbreviate = ( text: string | undefined, len: number, - charsAtTheEnd: number = 5 + charsAtTheEnd: number = 5, ) => { if (!text) return ""; if (text.length <= len) return text; diff --git a/src/utils/account/index.tsx b/src/utils/account/index.tsx index b95a2309..b19bc0c9 100644 --- a/src/utils/account/index.tsx +++ b/src/utils/account/index.tsx @@ -2,7 +2,7 @@ import { Connection, PublicKey } from "@solana/web3.js"; export const checkAccountExists = async ( connection: Connection, - key: PublicKey + key: PublicKey, ) => { const info = await connection.getAccountInfo(key); if (!!info?.data) return true; diff --git a/src/utils/ipfs/index.ts b/src/utils/ipfs/index.ts index 24e7cadf..24d52932 100644 --- a/src/utils/ipfs/index.ts +++ b/src/utils/ipfs/index.ts @@ -12,7 +12,7 @@ export const uploadToIPFS = async (image: string) => { const { data }: { data: Response } = await axios.post( "https://ipfs-proxy.bonfida.com/v2/ipfs/add", Buffer.from(blob), - { headers: { "Content-Type": "application/octet-stream" } } + { headers: { "Content-Type": "application/octet-stream" } }, ); return { diff --git a/src/utils/send-tx/index.tsx b/src/utils/send-tx/index.tsx index 610108bb..056a323f 100644 --- a/src/utils/send-tx/index.tsx +++ b/src/utils/send-tx/index.tsx @@ -9,7 +9,7 @@ export const sendTx = async ( connection: Connection, feePayer: PublicKey, ixs: TransactionInstruction[], - signTransaction: (tx: Transaction) => Promise + signTransaction: (tx: Transaction) => Promise, ) => { let tx = new Transaction().add(...ixs); tx.feePayer = feePayer; diff --git a/src/utils/tokens/wrap-sol.tsx b/src/utils/tokens/wrap-sol.tsx index 716b6f95..00fb9c96 100644 --- a/src/utils/tokens/wrap-sol.tsx +++ b/src/utils/tokens/wrap-sol.tsx @@ -14,7 +14,7 @@ export const wrapSol = async ( connection: Connection, ata: PublicKey, owner: PublicKey, - amount: number + amount: number, ) => { let transferAmount = amount; const instructions: TransactionInstruction[] = []; @@ -27,7 +27,7 @@ export const wrapSol = async ( owner, ata, owner, - NATIVE_MINT + NATIVE_MINT, ); instructions.push(ix); } else { diff --git a/src/utils/tx/chunk-tx.tsx b/src/utils/tx/chunk-tx.tsx index 425d066f..b4ca1c7b 100644 --- a/src/utils/tx/chunk-tx.tsx +++ b/src/utils/tx/chunk-tx.tsx @@ -9,7 +9,7 @@ const MAX = 1_232; export const chunkIx = ( instructions: TransactionInstruction[], buyer: PublicKey, - blockhash = "48tzUutUCPDohF4YqFpX9dHHS43V1bn9R45LHEFVhbtq" + blockhash = "48tzUutUCPDohF4YqFpX9dHHS43V1bn9R45LHEFVhbtq", ) => { const result: TransactionInstruction[][] = []; let temp: TransactionInstruction[] = []; @@ -34,7 +34,7 @@ export const chunkIx = ( const getSize = ( instructions: TransactionInstruction[], buyer: PublicKey, - blockhash = "48tzUutUCPDohF4YqFpX9dHHS43V1bn9R45LHEFVhbtq" + blockhash = "48tzUutUCPDohF4YqFpX9dHHS43V1bn9R45LHEFVhbtq", ) => { try { const tx = new Transaction().add(...instructions); diff --git a/src/utils/unwrap/index.tsx b/src/utils/unwrap/index.tsx index 28b52d40..96591381 100644 --- a/src/utils/unwrap/index.tsx +++ b/src/utils/unwrap/index.tsx @@ -21,7 +21,7 @@ export const redeemSol = async ( recordKey: PublicKey, publicKey: PublicKey, tokenAccountLen: number, - nftMint: PublicKey + nftMint: PublicKey, ) => { const instructions: TransactionInstruction[] = []; const recordInfo = await connection.getAccountInfo(recordKey); @@ -29,7 +29,7 @@ export const redeemSol = async ( throw new Error("Record info not found"); } const minRent = await connection.getMinimumBalanceForRentExemption( - recordInfo?.data.length + recordInfo?.data.length, ); if ( recordInfo.lamports > minRent && @@ -37,7 +37,7 @@ export const redeemSol = async ( ) { const ataDestination = await getAssociatedTokenAddress( NATIVE_MINT, - publicKey + publicKey, ); if (!(await checkAccountExists(connection, ataDestination))) { instructions.push( @@ -45,27 +45,27 @@ export const redeemSol = async ( publicKey, ataDestination, publicKey, - NATIVE_MINT - ) + NATIVE_MINT, + ), ); } const ataSource = await getAssociatedTokenAddress( NATIVE_MINT, recordKey, - true + true, ); const createAta = createAssociatedTokenAccountInstruction( publicKey, ataSource, recordKey, - NATIVE_MINT + NATIVE_MINT, ); const withdrawIx = await withdrawTokens( nftMint, NATIVE_MINT, publicKey, recordKey, - NAME_TOKENIZER_ID + NAME_TOKENIZER_ID, ); instructions.push(createAta, ...withdrawIx); } @@ -75,7 +75,7 @@ export const redeemSol = async ( export const unwrap = async ( connection: Connection, domain: string, - publicKey: PublicKey + publicKey: PublicKey, ) => { const instructions: TransactionInstruction[] = []; const { pubkey } = getDomainKeySync(domain); @@ -84,7 +84,7 @@ export const unwrap = async ( const recordTokenAccounts = await connection.getTokenAccountsByOwner( recordKey, - { programId: TOKEN_PROGRAM_ID } + { programId: TOKEN_PROGRAM_ID }, ); for (let tokenAcc of recordTokenAccounts.value) { @@ -95,7 +95,7 @@ export const unwrap = async ( publicKey, ata, publicKey, - des.mint + des.mint, ); instructions.push(ix); } @@ -104,7 +104,7 @@ export const unwrap = async ( des.mint, publicKey, recordKey, - NAME_TOKENIZER_ID + NAME_TOKENIZER_ID, ); instructions.push(...ix); } @@ -113,7 +113,7 @@ export const unwrap = async ( recordKey, publicKey, recordTokenAccounts.value.length, - mint + mint, ); instructions.push(...withdrawNativeSol); diff --git a/src/utils/wrap/index.ts b/src/utils/wrap/index.ts index fbc403f4..51d336a1 100644 --- a/src/utils/wrap/index.ts +++ b/src/utils/wrap/index.ts @@ -18,7 +18,7 @@ export const wrap = async (domain: string, publicKey: PublicKey) => { const { data }: { data: CreateNftResponse } = await axios.post( "https://naming-api.bonfida.com/make-image", { domain: trimTld(domain) }, - { headers: { "Content-type": "application/json" } } + { headers: { "Content-type": "application/json" } }, ); const ix = await createNft( @@ -27,7 +27,7 @@ export const wrap = async (domain: string, publicKey: PublicKey) => { pubkey, publicKey, publicKey, - NAME_TOKENIZER_ID + NAME_TOKENIZER_ID, ); instructions.push(...ix);