diff --git a/.env.template b/.env.template deleted file mode 100644 index a8b8d7ab..00000000 --- a/.env.template +++ /dev/null @@ -1 +0,0 @@ -HELIUS_KEY = "" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0395a92d..139e0c57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,6 +39,7 @@ "@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-vercel": "^2.0.2", "@tailwindcss/typography": "^0.5.8", + "@types/js-cookie": "^3.0.3", "@typescript-eslint/eslint-plugin": "^5.59.11", "@typescript-eslint/parser": "^5.59.11", "autoprefixer": "^10.4.7", @@ -3966,6 +3967,12 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==" }, + "node_modules/@types/js-cookie": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.3.tgz", + "integrity": "sha512-Xe7IImK09HP1sv2M/aI+48a20VX+TdRJucfq4vfRVy6nWN8PYPOEnlMRSgxJAgYQIXJVL8dZ4/ilAM7dWNaOww==", + "dev": true + }, "node_modules/@types/json-schema": { "version": "7.0.12", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", diff --git a/package.json b/package.json index 00e2f0d2..332c2de9 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-vercel": "^2.0.2", "@tailwindcss/typography": "^0.5.8", + "@types/js-cookie": "^3.0.3", "@typescript-eslint/eslint-plugin": "^5.59.11", "@typescript-eslint/parser": "^5.59.11", "autoprefixer": "^10.4.7", diff --git a/src/lib/components/account-header.svelte b/src/lib/components/account-header.svelte index c58a88cd..43414146 100644 --- a/src/lib/components/account-header.svelte +++ b/src/lib/components/account-header.svelte @@ -38,7 +38,13 @@ export let account: string = ""; export let link: string = ""; - const accountInfo = client.accountInfo.createQuery(account); + const params = new URLSearchParams(window.location.search); + const network = params.get("network"); + const isMainnetValue = network !== "devnet"; + const accountInfo = client.accountInfo.createQuery([ + account, + isMainnetValue, + ]); const price = client.price.createQuery(SOL); const balance = tweened(0, { diff --git a/src/lib/components/account-info.svelte b/src/lib/components/account-info.svelte index fffcb259..9d863f4e 100644 --- a/src/lib/components/account-info.svelte +++ b/src/lib/components/account-info.svelte @@ -11,12 +11,16 @@ import CopyButton from "$lib/components/copy-button.svelte"; import Namor from "$lib/components/providers/namor-provider.svelte"; - export let account = ""; const client = trpcWithQuery($page); - - const accountInfo = client.accountInfo.createQuery(account); + const params = new URLSearchParams(window.location.search); + const network = params.get("network"); + const isMainnetValue = network !== "devnet"; + const accountInfo = client.accountInfo.createQuery([ + account, + isMainnetValue, + ]); const price = client.price.createQuery(SOL); const balance = tweened(0, { diff --git a/src/lib/components/collapse.svelte b/src/lib/components/collapse.svelte index f482e39c..338e2b1c 100644 --- a/src/lib/components/collapse.svelte +++ b/src/lib/components/collapse.svelte @@ -9,7 +9,7 @@ export let showDetails = false; -
+
{#each filterList as [key, value]}
{$cmt.data?.creationSlot.toLocaleString()} diff --git a/src/routes/account/[account]/tokens/+page.svelte b/src/routes/account/[account]/tokens/+page.svelte index f8cb24a7..cb5b3a33 100644 --- a/src/routes/account/[account]/tokens/+page.svelte +++ b/src/routes/account/[account]/tokens/+page.svelte @@ -12,10 +12,12 @@ const account = $page.params.account; const client = trpcWithQuery($page); + const params = new URLSearchParams(window.location.search); + const network = params.get("network"); + const isMainnetValue = network !== "devnet"; + const balances = client.balances.createQuery([account, isMainnetValue]); - const balances = client.balances.createQuery(account); - - const token2022 = client.token2022.createQuery(account); + const token2022 = client.token2022.createQuery([account, isMainnetValue]); const sol = client.price.createQuery(SOL); diff --git a/src/routes/api/search/[query]/+server.ts b/src/routes/api/search/[query]/+server.ts index abbfb5dd..958866e5 100644 --- a/src/routes/api/search/[query]/+server.ts +++ b/src/routes/api/search/[query]/+server.ts @@ -7,7 +7,6 @@ const { HELIUS_API_KEY } = process.env; // Consume a search, return what to do with it export async function GET({ params }: RequestEvent) { const conection = connect("mainnet", HELIUS_API_KEY); - const result = await search(params?.query || "", conection); return json(result); diff --git a/src/routes/block/[slot]/+page.svelte b/src/routes/block/[slot]/+page.svelte index 10bfc20b..c571e023 100644 --- a/src/routes/block/[slot]/+page.svelte +++ b/src/routes/block/[slot]/+page.svelte @@ -1,4 +1,5 @@ -
-

Transaction

-
- - +{#if $txn == true} +
+

Transaction

+
+ + +
-
- -{#if animate} -
- {#if $transaction.isLoading} - {#each Array(3) as _} -
- + {#if animate} +
+ {#if $transaction.isLoading} + {#each Array(3) as _} +
+ +
+ {/each} + {:else if data} +
+
- {/each} - {:else if data} -
- -
- {#if data.accounts} -
- - {#each data.accounts as account} - - {/each} - -
- {/if} + {#if data.accounts} +
+ + {#each data.accounts as account} + + {/each} + +
+ {/if} -