Skip to content
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

Upgrade dependencies & default to 0 storage #35

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,215 changes: 735 additions & 1,480 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"main": "./src/App",
"dependencies": {
"@adraffy/ens-normalize": "1.9.0",
"@bonfida/name-offers": "0.0.10",
"@bonfida/name-tokenizer": "0.0.12",
"@bonfida/sns-emitter": "0.1.7",
"@bonfida/name-offers": "0.2.1",
"@bonfida/name-tokenizer": "0.1.0",
"@bonfida/sns-emitter": "0.2.1",
"@bonfida/sns-react": "2.1.0",
"@bonfida/sns-records": "0.0.1-alpha.8",
"@bonfida/spl-name-service": "2.3.2",
"@bonfida/sns-records": "0.0.1",
"@bonfida/spl-name-service": "2.3.5",
"@coral-xyz/common-public": "0.2.0-latest.3375",
"@expo-google-fonts/dev": "*",
"@expo/html-elements": "0.5.1",
Expand All @@ -45,16 +45,15 @@
"@react-navigation/native": "6.1.9",
"@react-navigation/native-stack": "6.9.17",
"@react-navigation/stack": "6.3.20",
"@solana-mobile/mobile-wallet-adapter-protocol": "2.0.1",
"@solana-mobile/mobile-wallet-adapter-protocol-web3js": "2.0.2",
"@solana-mobile/mobile-wallet-adapter-protocol": "2.1.1",
"@solana-mobile/mobile-wallet-adapter-protocol-web3js": "2.1.1",
"@solana/buffer-layout": "4.0.1",
"@solana/spl-token": "0.3.9",
"@solana/wallet-adapter-base": "0.9.23",
"@solana/wallet-adapter-react": "0.15.35",
"@solana/wallet-adapter-react-ui": "0.9.34",
"@solana/web3.js": "1.87.6",
"axios": "1.4.0",
"bn.js": "^5.2.1",
"axios": "1.6.7",
"buffer": "6.0.3",
"expo": "49.0.18",
"expo-blur": "~12.4.1",
Expand Down Expand Up @@ -89,7 +88,6 @@
"@babel/core": "7.21.3",
"@bonfida/prettier-config": "^1.0.0",
"@expo/webpack-config": "^19.0.0",
"@types/bn.js": "^5.1.5",
"@types/lodash": "4.14.201",
"@types/react": "~18.2.14",
"@types/react-native-dotenv": "0.2.0",
Expand Down
3 changes: 2 additions & 1 deletion src/components/DomainSizeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useStorageMap } from "@src/hooks/useStorageMap";
import { WrapModal } from "./WrapModal";

const LIST = [
{ label: "0kb", value: 0 },
{ label: "1kb", value: 1_000 },
{ label: "2kb", value: 2_000 },
{ label: "3kb", value: 3_000 },
Expand All @@ -29,7 +30,7 @@ export const DomainSizeModal = ({

useEffect(() => {
if (!map.get(domain)) {
actions.set(domain, 1_000);
actions.set(domain, 0);
}
}, []);

Expand Down
15 changes: 6 additions & 9 deletions src/hooks/useSubdomains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
ROOT_DOMAIN_ACCOUNT,
getHashedNameSync,
REVERSE_LOOKUP_CLASS,
deserializeReverse,
} from "@bonfida/spl-name-service";
import { useSolanaConnection } from "./xnft-hooks";
import { AccountInfo, PublicKey } from "@solana/web3.js";
import BN from "bn.js";

export interface SubdomainResult {
key: string;
Expand All @@ -33,15 +33,12 @@ export const useSubdomains = (domain: string) => {
return useAsync(fn, [!!connection, domain]);
};

const deserializeReverse = (
const deserializeReverseSub = (
e: AccountInfo<Buffer> | null,
): string | undefined => {
if (!e?.data) return undefined;
const nameLength = new BN(e.data.slice(96, 96 + 4), "le").toNumber();
return e.data
.slice(96 + 4, 96 + 4 + nameLength)
.toString()
.replace("\0", "");
const reverse = deserializeReverse(e.data.slice(96));
return reverse?.replace("\0", "");
};

export const useSubdomainsFromUser = (owner: string) => {
Expand Down Expand Up @@ -72,7 +69,7 @@ export const useSubdomainsFromUser = (owner: string) => {
return key;
}),
)
).map(deserializeReverse);
).map(deserializeReverseSub);

const parentsWithSubsRevKey = subsRev
.map((e, idx) => {
Expand All @@ -91,7 +88,7 @@ export const useSubdomainsFromUser = (owner: string) => {
const parentRev = (
await connection.getMultipleAccountsInfo(parentsWithSubsRevKey)
)
.map(deserializeReverse)
.map(deserializeReverseSub)
.filter((e) => !!e) as string[];

const result = subsRev
Expand Down
6 changes: 3 additions & 3 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ msgstr ""
msgid "Domains"
msgstr ""

#: src/components/DomainSizeModal.tsx:63
#: src/components/DomainSizeModal.tsx:64
msgid "Each additional kb of memory costs around 0.007 SOL (0.001 USDC)"
msgstr ""

Expand Down Expand Up @@ -645,7 +645,7 @@ msgstr ""
#~ msgid "Something went wrong - try again"
#~ msgstr ""

#: src/components/DomainSizeModal.tsx:46
#: src/components/DomainSizeModal.tsx:47
msgid "Storage Size"
msgstr ""

Expand Down Expand Up @@ -690,7 +690,7 @@ msgstr ""
#~ msgid "The record must be a valid wallet address"
#~ msgstr ""

#: src/components/DomainSizeModal.tsx:51
#: src/components/DomainSizeModal.tsx:52
msgid "The storage size will determine the maximum amount of data you can store on your domain."
msgstr ""

Expand Down
6 changes: 3 additions & 3 deletions src/locales/es/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ msgstr "La tokenización de un nombre de dominio (envuelto) implica convertir un
msgid "Domains"
msgstr "Dominios"

#: src/components/DomainSizeModal.tsx:63
#: src/components/DomainSizeModal.tsx:64
msgid "Each additional kb of memory costs around 0.007 SOL (0.001 USDC)"
msgstr "Cada kb adicional de memoria cuesta alrededor de 0.007 SOL (0.001 USDC)"

Expand Down Expand Up @@ -515,7 +515,7 @@ msgstr "Saltar"
msgid "Socials"
msgstr "Redes Sociales"

#: src/components/DomainSizeModal.tsx:46
#: src/components/DomainSizeModal.tsx:47
msgid "Storage Size"
msgstr "Tamaño de Almacenamiento"

Expand Down Expand Up @@ -551,7 +551,7 @@ msgstr "¡Éxito!"
msgid "Telegram"
msgstr "Telegram"

#: src/components/DomainSizeModal.tsx:51
#: src/components/DomainSizeModal.tsx:52
msgid "The storage size will determine the maximum amount of data you can store on your domain."
msgstr "El tamaño de almacenamiento determinará la cantidad máxima de datos que puedes almacenar en tu dominio."

Expand Down
6 changes: 3 additions & 3 deletions src/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ msgstr "La tokenisation (enveloppement) de noms de domaine consiste à convertir
msgid "Domains"
msgstr "Domaines"

#: src/components/DomainSizeModal.tsx:63
#: src/components/DomainSizeModal.tsx:64
msgid "Each additional kb of memory costs around 0.007 SOL (0.001 USDC)"
msgstr "Chaque kb supplémentaire de mémoire coûte environ 0,007 SOL (0,001 USDC)."

Expand Down Expand Up @@ -541,7 +541,7 @@ msgstr "Passer"
msgid "Socials"
msgstr "Réseaux sociaux"

#: src/components/DomainSizeModal.tsx:46
#: src/components/DomainSizeModal.tsx:47
msgid "Storage Size"
msgstr "Taille de stockage"

Expand Down Expand Up @@ -577,7 +577,7 @@ msgstr "Succès !"
msgid "Telegram"
msgstr "Telegram"

#: src/components/DomainSizeModal.tsx:51
#: src/components/DomainSizeModal.tsx:52
msgid "The storage size will determine the maximum amount of data you can store on your domain."
msgstr "La taille de stockage déterminera la quantité maximale de données que vous pouvez stocker sur votre domaine."

Expand Down
6 changes: 3 additions & 3 deletions src/locales/kr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ msgstr "도메인 이름 토큰화(래핑)는 도메인 이름을 NFT로 변환
msgid "Domains"
msgstr "도메인"

#: src/components/DomainSizeModal.tsx:63
#: src/components/DomainSizeModal.tsx:64
msgid "Each additional kb of memory costs around 0.007 SOL (0.001 USDC)"
msgstr "메모리 1kb 추가당 비용은 약 0.007 SOL (0.001 USDC)입니다"

Expand Down Expand Up @@ -653,7 +653,7 @@ msgstr "소셜"
#~ msgid "Something went wrong - try again"
#~ msgstr "문제가 발생했습니다 - 다시 시도하세요"

#: src/components/DomainSizeModal.tsx:46
#: src/components/DomainSizeModal.tsx:47
msgid "Storage Size"
msgstr "저장 용량"

Expand Down Expand Up @@ -693,7 +693,7 @@ msgstr "완료되었습니다!"
msgid "Telegram"
msgstr "텔레그램"

#: src/components/DomainSizeModal.tsx:51
#: src/components/DomainSizeModal.tsx:52
msgid "The storage size will determine the maximum amount of data you can store on your domain."
msgstr "저장 용량은 도메인에 저장할 수 있는 데이터의 최대량입니다."

Expand Down
6 changes: 3 additions & 3 deletions src/locales/tr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ msgstr "Domain ismini tokenize edilmesi (wrapping), domain isminin NFT'ye dönü
msgid "Domains"
msgstr "Domainler"

#: src/components/DomainSizeModal.tsx:63
#: src/components/DomainSizeModal.tsx:64
msgid "Each additional kb of memory costs around 0.007 SOL (0.001 USDC)"
msgstr "Her bir fazladan kb hafıza 0.007 SOL ya da 0.001 USDC masraf çıkartır."

Expand Down Expand Up @@ -515,7 +515,7 @@ msgstr "Atla"
msgid "Socials"
msgstr "Sosyal Medya Hesapları"

#: src/components/DomainSizeModal.tsx:46
#: src/components/DomainSizeModal.tsx:47
msgid "Storage Size"
msgstr "Depo Hacmi"

Expand Down Expand Up @@ -551,7 +551,7 @@ msgstr "Başarılı!"
msgid "Telegram"
msgstr "Telegram"

#: src/components/DomainSizeModal.tsx:51
#: src/components/DomainSizeModal.tsx:52
msgid "The storage size will determine the maximum amount of data you can store on your domain."
msgstr "Depo kapasitesi, domaininide depolanabilecek azami veri miktarını belirler. "

Expand Down
6 changes: 3 additions & 3 deletions src/locales/zh-Hans/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ msgstr "域名通证化(封装)是指将域名转换为 NFT,如果您需
msgid "Domains"
msgstr "域名"

#: src/components/DomainSizeModal.tsx:63
#: src/components/DomainSizeModal.tsx:64
msgid "Each additional kb of memory costs around 0.007 SOL (0.001 USDC)"
msgstr "每额外增加的1kb内存需花费约0.007 SOL(0.001 USDC)"

Expand Down Expand Up @@ -517,7 +517,7 @@ msgstr "跳过"
msgid "Socials"
msgstr "社交媒体"

#: src/components/DomainSizeModal.tsx:46
#: src/components/DomainSizeModal.tsx:47
msgid "Storage Size"
msgstr "存储容量"

Expand Down Expand Up @@ -553,7 +553,7 @@ msgstr "成功!"
msgid "Telegram"
msgstr "Telegram"

#: src/components/DomainSizeModal.tsx:51
#: src/components/DomainSizeModal.tsx:52
msgid "The storage size will determine the maximum amount of data you can store on your domain."
msgstr "存储容量将会决定域名可储存的最大数据量"

Expand Down
2 changes: 1 addition & 1 deletion src/screens/Cart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const checkEnoughFunds = async (
return balances > total;
};

const DEFAULT_SPACE = 1_000;
const DEFAULT_SPACE = 0;

type CurrentStep = 1 | 2 | 3;

Expand Down
Loading