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

feat(frontend): add loader for solana balances #4021

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4e543bd
feat(frontend): rename rpc related types for sol
loki344 Dec 18, 2024
7da2390
feat(frontend): fix testnet=mainnet
loki344 Dec 18, 2024
e208b2c
feat(frontend): add rpc urls
loki344 Dec 18, 2024
6d0a89f
feat(frontend): add i18n
loki344 Dec 18, 2024
103d63a
feat(frontend): implement sol-balance.services.ts
loki344 Dec 18, 2024
4d96519
feat(frontend): implement LoaderSolBalances.svelte
loki344 Dec 18, 2024
07740e1
feat(frontend): consolidate balanceLoaders in LoaderBalances
loki344 Dec 18, 2024
477ecca
feat(frontend): fix reactive calls in LoaderSolBalances.svelte
loki344 Dec 18, 2024
8945308
Merge remote-tracking branch 'refs/remotes/origin/main' into feat(fro…
loki344 Dec 18, 2024
19ea7bc
feat(frontend): add tests for sol loader
loki344 Dec 18, 2024
095f0c3
🤖 Apply formatting changes
github-actions[bot] Dec 18, 2024
066143d
feat(frontend): rm ui part to decouple MRs
loki344 Dec 18, 2024
7a37004
feat(frontend): revert unwanted change
loki344 Dec 18, 2024
86b8c5f
feat(frontend): rm websocket urls, add alchemy rpc for mainnet
loki344 Dec 18, 2024
1aa5ab4
🤖 Apply formatting changes
github-actions[bot] Dec 18, 2024
9eb63fa
feat(frontend): rm websocket urls, add alchemy rpc for mainnet
loki344 Dec 18, 2024
4367cff
Merge remote-tracking branch 'origin/feat(frontend)/solana-balances' …
loki344 Dec 18, 2024
6425904
feat(frontend): use derived instead of mapper, makes it more reusable
loki344 Dec 18, 2024
3c7ffad
🤖 Apply formatting changes
github-actions[bot] Dec 18, 2024
78c8a0e
feat(frontend): extract lookup for sol addr
loki344 Dec 18, 2024
01fecd4
🤖 Apply formatting changes
github-actions[bot] Dec 18, 2024
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
272 changes: 272 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@junobuild/analytics": "^0.0.31",
"@metamask/detect-provider": "^2.0.0",
"@solana/addresses": "^2.0.0",
"@solana/rpc": "^2.0.0",
"@walletconnect/web3wallet": "1.14.0",
"alchemy-sdk": "3.4.1",
"buffer": "^6.0.3",
Expand All @@ -80,6 +81,7 @@
"@dfinity/internet-identity-playwright": "^0.0.4",
"@playwright/test": "^1.49.1",
"@rollup/plugin-inject": "^5.0.5",
"@solana/rpc-types": "^2.0.0",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.11.1",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
Expand Down
13 changes: 13 additions & 0 deletions src/frontend/src/env/networks/networks.sol.env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ import { LOCAL } from '$lib/constants/app.constants';
import type { Network, NetworkId } from '$lib/types/network';
import { parseNetworkId } from '$lib/validation/network.validation';

/**
* RPC URLs
*/
export const SOLANA_RPC_HTTP_URL_MAINNET = 'https://api.mainnet-beta.solana.com';
export const SOLANA_RPC_HTTP_URL_TESTNET = 'https://api.testnet.solana.com';
export const SOLANA_RPC_HTTP_URL_DEVNET = 'https://api.devnet.solana.com';
export const SOLANA_RPC_HTTP_URL_LOCAL = 'http://localhost:8899';

export const SOLANA_RPC_WSS_URL_MAINNET = 'wss://api.mainnet-beta.solana.com';
export const SOLANA_RPC_WSS_URL_TESTNET = 'wss://api.testnet.solana.com';
export const SOLANA_RPC_WSS_URL_DEVNET = 'wss://api.devnet.solana.com';
export const SOLANA_RPC_WSS_URL_LOCAL = 'ws://localhost:8900';

/**
* SOL
*/
Expand Down
10 changes: 10 additions & 0 deletions src/frontend/src/lib/components/loaders/LoaderBalances.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
import LoaderEthBalances from '$eth/components/loaders/LoaderEthBalances.svelte';
import LoaderSolBalances from '$sol/components/core/LoaderSolBalances.svelte';
</script>

<LoaderEthBalances>
<LoaderSolBalances>
<slot />
</LoaderSolBalances>
</LoaderEthBalances>
10 changes: 5 additions & 5 deletions src/frontend/src/lib/components/loaders/Loaders.svelte
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<script lang="ts">
import LoaderEthBalances from '$eth/components/loaders/LoaderEthBalances.svelte';
import ExchangeWorker from '$lib/components/exchange/ExchangeWorker.svelte';
import AddressGuard from '$lib/components/guard/AddressGuard.svelte';
import Loader from '$lib/components/loaders/Loader.svelte';
import LoaderBalances from '$lib/components/loaders/LoaderBalances.svelte';
import LoaderMetamask from '$lib/components/loaders/LoaderMetamask.svelte';
import LoaderUserProfile from '$lib/components/loaders/LoaderUserProfile.svelte';
import LoaderWallets from '$lib/components/loaders/LoaderWallets.svelte';
</script>

<AddressGuard>
<Loader>
<LoaderEthBalances>
<LoaderBalances>
<LoaderWallets>
<ExchangeWorker>
<LoaderMetamask
><LoaderUserProfile>
<LoaderMetamask>
<LoaderUserProfile>
<slot />
</LoaderUserProfile>
</LoaderMetamask>
</ExchangeWorker>
</LoaderWallets>
</LoaderEthBalances>
</LoaderBalances>
</Loader>
</AddressGuard>
2 changes: 2 additions & 0 deletions src/frontend/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@
"no_infura_cketh_provider": "No Infura CkETH provider for network $network",
"no_infura_erc20_provider": "No Infura ERC20 provider for network $network",
"no_infura_erc20_icp_provider": "No Infura ERC20 Icp provider for network $network",
"no_solana_rpc": "No Solana RPC for network $network",
"eth_address_unknown": "ETH address is unknown.",
"sol_address_unknown": "SOL address is unknown.",
"loading_address": "Error while loading the $symbol address.",
"loading_balance": "Error while loading the ETH balance.",
"loading_balance_symbol": "Error while loading $symbol balance.",
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/lib/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ interface I18nInit {
no_infura_cketh_provider: string;
no_infura_erc20_provider: string;
no_infura_erc20_icp_provider: string;
no_solana_rpc: string;
eth_address_unknown: string;
sol_address_unknown: string;
loading_address: string;
loading_balance: string;
loading_balance_symbol: string;
Expand Down
Loading
Loading