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

Sync Prod and Dev Branches #235

Merged
merged 42 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
310adaf
Prod Release
qudo-code Jun 7, 2023
8b19cdc
Revert "Prod Release" (#198)
qudo-code Jun 7, 2023
1e65218
Release Prod (single app refactor) (#203)
qudo-code Jun 18, 2023
71aee2a
Release Prod (#207)
qudo-code Jun 30, 2023
c2f4360
transactions fix
solhosty Aug 12, 2023
9e932bb
remove files
solhosty Aug 12, 2023
ff16828
Merge pull request #210 from helius-labs/trpc-transactions
solhosty Aug 12, 2023
52f1fde
better media view (#211)
qudo-code Aug 22, 2023
cadb723
Q/media updates (#212)
qudo-code Aug 25, 2023
2391c96
rm connect wallet (#213)
qudo-code Aug 25, 2023
2e6a6de
Q/fix cnft history (#220)
qudo-code Sep 9, 2023
1ff90f0
devnet additions
solhosty Sep 15, 2023
4508012
reverting
solhosty Sep 15, 2023
3007b8c
transaction change
solhosty Sep 15, 2023
8ea2c21
txn fixes
solhosty Sep 15, 2023
0e470b5
txn fixes
solhosty Sep 15, 2023
acc9efa
network button
solhosty Sep 15, 2023
75bc94c
new commit
solhosty Sep 15, 2023
9260871
menu change
solhosty Sep 15, 2023
19a5fbb
token fix
solhosty Sep 15, 2023
486de01
Merge pull request #222 from helius-labs/devnet
solhosty Sep 15, 2023
1260e79
new changes
solhosty Sep 15, 2023
de3f739
Merge pull request #223 from helius-labs/styling
solhosty Sep 15, 2023
c3394db
new
solhosty Sep 15, 2023
f9a29b3
Merge pull request #224 from helius-labs/account
solhosty Sep 15, 2023
2accd65
menu changes, nav addition
solhosty Sep 17, 2023
e177331
Merge pull request #225 from helius-labs/menu
solhosty Sep 17, 2023
0f17fa9
lowering opacity of docs button
solhosty Sep 17, 2023
b84d5af
Merge pull request #226 from helius-labs/new-nav
solhosty Sep 17, 2023
071f938
new tool tips for menu items
solhosty Sep 18, 2023
0cd11d0
sellerFeeBasisPoints
solhosty Sep 27, 2023
152825b
sellerFeeBasisPoints
solhosty Sep 27, 2023
692fa6e
Merge pull request #228 from helius-labs/sellerFeeBasisPoints
solhosty Sep 27, 2023
783ab9b
github-actions[bot] Nov 10, 2023
c049892
github-actions[bot] Nov 10, 2023
4645621
Initial Fix Commit
0xIchigo Nov 14, 2023
e285a24
The Conflictooorr
0xIchigo Nov 14, 2023
15508f6
Fix Lint Errors
0xIchigo Nov 14, 2023
daa8583
Fix Build Error in vite.config.js
0xIchigo Nov 14, 2023
13812dc
Disable Lint for transactions.svelte
0xIchigo Nov 14, 2023
7a01d0c
Bug Fixes
0xIchigo Nov 14, 2023
0c2982c
Merge pull request #234 from helius-labs/vercel/staging
0xIchigo Nov 22, 2023
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
4 changes: 4 additions & 0 deletions .husky/pre-commit_
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push_
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
26 changes: 25 additions & 1 deletion src/lib/components/account-header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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");
let isMainnetValue = network !== "devnet";
const accountInfo = client.accountInfo.createQuery([
account,
isMainnetValue,
]);
const price = client.price.createQuery(SOL);

const balance = tweened(0, {
Expand All @@ -54,6 +60,17 @@
$: if ($accountInfo?.data?.balance) {
balance.set($accountInfo.data.balance);
}
function toggleNetwork() {
isMainnetValue = !isMainnetValue;
localStorage.setItem("isMainnet", JSON.stringify(isMainnetValue));

const params = new URLSearchParams(window.location.search);

params.set("network", isMainnetValue ? "mainnet" : "devnet");

history.replaceState({}, "", "?" + params.toString());
history.go(0);
}

$: worth = $balance * $price?.data;
</script>
Expand All @@ -79,6 +96,13 @@
/>
</div>
</div>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="badge-outline badge relative mx-2 flex cursor-default px-4 py-2 opacity-90"
on:click={toggleNetwork}
>
{isMainnetValue ? "mainnet" : "devnet"}
</div>
</div>
<div class="relative text-right">
<h1 class="text-md md:block">
Expand Down
10 changes: 7 additions & 3 deletions src/lib/components/account-info.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/copy-button.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { Icon as IconType } from "src/lib/types";
import type { Icon as IconType } from "$lib/types";
import { copyToClipboard } from "$lib/util/clipboard";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</script>

<footer
class="footer mt-20 grid w-full grid-cols-2 items-center border bg-black p-3"
class="footer mt-0 grid w-full grid-cols-2 items-center border bg-black p-3"
>
<div class="col-span-1 flex items-center">
<PoweredByHelius />
Expand Down
46 changes: 46 additions & 0 deletions src/lib/components/image.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script lang="ts">
import { onMount } from "svelte";

export let src: string;
export let className = "";
export let alt = "image";

let loaded = false;
let failed = false;
let loading = false;

onMount(() => {
const img = new Image();
img.src = src;
loading = true;

img.onload = () => {
loading = false;
loaded = true;
};
img.onerror = () => {
loading = false;
failed = true;
};
});
</script>

{#if loading}
<img
src="https://samherbert.net/svg-loaders/svg-loaders/bars.svg"
class="{className} scale-[0.25] opacity-50"
{alt}
/>
{:else if failed}
<img
src="https://imgs.search.brave.com/_21o9NXVQGftTNHMC4ZBLatg4jZkXGTJj3bRU6Q11CY/rs:fit:860:0:0/g:ce/aHR0cHM6Ly9jZG40/Lmljb25maW5kZXIu/Y29tL2RhdGEvaWNv/bnMvb2ZmaWNlLXRo/aWNrLW91dGxpbmUv/MzYvb2ZmaWNlLTA4/LTEyOC5wbmc"
class="{className} scale-50 opacity-50"
{alt}
/>
{:else if loaded}
<img
{src}
class={className}
{alt}
/>
{/if}
16 changes: 13 additions & 3 deletions src/lib/components/log-messages.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
<style>
.text-sky {
@apply text-info-content;
color: text-info-content;
}

.text-tangerine {
@apply text-[#e8a034];
color: text-#e8a034;
}
</style>

<script lang="ts">
import { txn } from "$lib/state/stores/txn";
import { parseProgramLogs } from "$lib/util/program-logs";

import { onMount } from "svelte";
export let logs: string[];

const parsedLogs = parseProgramLogs(logs);

onMount(() => {
//@ts-ignore
if (parsedLogs == "") {
txn.set(false);
} else {
txn.set(true);
}
});

const totalComputeUnits = parsedLogs.reduce(
(sum, log) => sum + log.computeUnits,
0
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/modals/help.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script lang="ts">
import type { Icon as IconType } from "src/lib/types";
import type { Icon as IconType } from "$lib/types";
import Icon from "$lib/components/icon.svelte";
const supportedSearches: Array<[IconType, string]> = [
["backpack", "xNFT Backpack usernames like @username"],
["globe", ".sol, .abc, .poor, .bonk domains"],
["person", "Wallet/Account addresses"],
["coins", "Token addresses"],
Expand Down
7 changes: 6 additions & 1 deletion src/lib/components/modals/menu.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{#each [{ name: "Home", url: "/" }, { name: "About Helius APIs", url: "https://helius.xyz" }, { name: "Contribute", url: "https://github.com/helius-labs/xray" }, { name: "Join Discord", url: "https://discord.gg/mV3dNPwDnZ" }] as { name, url }}
<script>
import Network from "../network.svelte";
</script>

{#each [{ name: "Home", url: "/" }, { name: "About Helius APIs", url: "https://helius.xyz" }, { name: "Contribute", url: "https://github.com/helius-labs/xray" }, { name: "Join Discord", url: "https://discord.gg/nSkq35VUf5" }] as { name, url }}
<a
href={url}
data-sveltekit-reload
class="btn-ghost btn w-full">{name}</a
>
{/each}
<Network />
2 changes: 0 additions & 2 deletions src/lib/components/modals/transaction-filter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import { transactionActionsMetadata } from "$lib/types";
import { filterStore } from "$lib/util/stores/filter";
import Icon from "../icon.svelte";
const handleClick = (key: string) => {
$filterStore = key;
hideModal();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/modals/wallets.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import shortenString from "$lib/util/shorten-string";
import { hideModal } from "$lib/state/stores/modals";
// import { hideModal } from "$lib/state/stores/modals";
</script>

{#each addresses as address}
Expand Down
64 changes: 47 additions & 17 deletions src/lib/components/nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import Stats from "$lib/components/stats.svelte";

import { showModal } from "$lib/state/stores/modals";
const params = new URLSearchParams(window.location.search);
const network = params.get("network");
const isMainnetValue = network !== "devnet";
</script>

<Stats />
Expand All @@ -24,7 +27,7 @@
>
<a
class="btn-ghost btn px-2"
href="/"
href="/?network={isMainnetValue ? 'mainnet' : 'devnet'}"
rel="noreferrer"
>
<span class="text-3xl">XRAY</span>
Expand All @@ -42,24 +45,51 @@

<div class="col-span-2 flex items-center justify-end">
<div class="flex justify-end pr-2">
<button
class="btn-ghost btn"
on:click={() => showModal("HELP")}
<div
class="tooltip"
data-tip="Docs"
>
<Icon
id="question"
size="md"
/>
</button>
<button
class="btn-ghost btn"
on:click={() => showModal("MENU")}
<a
href="https://docs.helius.dev/welcome/what-is-helius"
rel="noreferrer"
target="_blank"
class="btn-ghost btn"
>
<img
class="h-6 opacity-90"
src="docs.svg"
alt=""
/>
</a>
</div>
<div
class="tooltip"
data-tip="Help"
>
<Icon
id="hamburger"
size="lg"
/>
</button>
<button
class="btn-ghost btn"
on:click={() => showModal("HELP")}
>
<Icon
id="question"
size="md"
/>
</button>
</div>
<div
class="tooltip"
data-tip="Menu"
>
<button
class="btn-ghost btn"
on:click={() => showModal("MENU")}
>
<Icon
id="hamburger"
size="lg"
/>
</button>
</div>
</div>
</div>
</nav>
Expand Down
43 changes: 43 additions & 0 deletions src/lib/components/network.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script lang="ts">
import { onMount } from "svelte";

let isMainnetValue = true;

onMount(() => {
const savedIsMainnet = localStorage.getItem("isMainnet");
if (savedIsMainnet !== null) {
isMainnetValue = JSON.parse(savedIsMainnet);
}
});
onMount(() => {
const params = new URLSearchParams(window.location.search);
const network = params.get("network");
isMainnetValue = network !== "devnet";
localStorage.setItem("isMainnet", JSON.stringify(isMainnetValue));
});
function toggleNetwork(event: Event) {
isMainnetValue = (event.target as HTMLInputElement).checked;
localStorage.setItem("isMainnet", JSON.stringify(isMainnetValue));
const params = new URLSearchParams(window.location.search);
params.set("network", isMainnetValue ? "mainnet" : "devnet");
history.replaceState({}, "", "?" + params.toString());
history.go(0);
}
</script>

<div
class="toggle-container m-auto mt-2 flex w-full flex-col justify-center p-4"
>
<label class="toggle-label m-auto flex flex-col">
<input
type="checkbox"
class="toggle flex justify-center"
bind:checked={isMainnetValue}
on:change={toggleNetwork}
/>
<span class="toggle-mark" />
</label>
<span class="network-text m-auto my-1 flex font-bold"
>{isMainnetValue ? "Mainnet" : "Devnet"}</span
>
</div>
Loading