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): make solana native tokens requiredtokens #4040

Merged
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
10 changes: 5 additions & 5 deletions src/frontend/src/env/tokens/tokens.sol.env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SOLANA_TESTNET_NETWORK
} from '$env/networks/networks.sol.env';
import sol from '$lib/assets/networks/sol.svg';
import type { Token, TokenId } from '$lib/types/token';
import type { RequiredToken, TokenId } from '$lib/types/token';
import { parseTokenId } from '$lib/validation/token.validation';

export const SOLANA_DEFAULT_DECIMALS = 9;
Expand All @@ -14,7 +14,7 @@ const SOLANA_SYMBOL = 'SOL';

export const SOLANA_TOKEN_ID: TokenId = parseTokenId(SOLANA_SYMBOL);

export const SOLANA_TOKEN: Token = {
export const SOLANA_TOKEN: RequiredToken = {
id: SOLANA_TOKEN_ID,
network: SOLANA_MAINNET_NETWORK,
standard: 'solana',
Expand All @@ -32,7 +32,7 @@ const SOLANA_TESTNET_SYMBOL = 'SOL (Testnet)';

export const SOLANA_TESTNET_TOKEN_ID: TokenId = parseTokenId(SOLANA_TESTNET_SYMBOL);

export const SOLANA_TESTNET_TOKEN: Token = {
export const SOLANA_TESTNET_TOKEN: RequiredToken = {
id: SOLANA_TESTNET_TOKEN_ID,
network: SOLANA_TESTNET_NETWORK,
standard: 'solana',
Expand All @@ -47,7 +47,7 @@ const SOLANA_DEVNET_SYMBOL = 'SOL (Devnet)';

export const SOLANA_DEVNET_TOKEN_ID: TokenId = parseTokenId(SOLANA_DEVNET_SYMBOL);

export const SOLANA_DEVNET_TOKEN: Token = {
export const SOLANA_DEVNET_TOKEN: RequiredToken = {
id: SOLANA_DEVNET_TOKEN_ID,
network: SOLANA_DEVNET_NETWORK,
standard: 'solana',
Expand All @@ -62,7 +62,7 @@ const SOLANA_LOCAL_SYMBOL = 'SOL (Local)';

export const SOLANA_LOCAL_TOKEN_ID: TokenId = parseTokenId(SOLANA_LOCAL_SYMBOL);

export const SOLANA_LOCAL_TOKEN: Token = {
export const SOLANA_LOCAL_TOKEN: RequiredToken = {
id: SOLANA_LOCAL_TOKEN_ID,
network: SOLANA_LOCAL_NETWORK,
standard: 'solana',
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/sol/derived/tokens.derived.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
} from '$env/tokens/tokens.sol.env';
import { LOCAL } from '$lib/constants/app.constants';
import { testnets } from '$lib/derived/testnets.derived';
import type { Token } from '$lib/types/token';
import type { RequiredToken } from '$lib/types/token';
import { derived, type Readable } from 'svelte/store';

export const enabledSolanaTokens: Readable<Token[]> = derived([testnets], ([$testnets]) =>
export const enabledSolanaTokens: Readable<RequiredToken[]> = derived([testnets], ([$testnets]) =>
SOLANA_NETWORK_ENABLED
? [
SOLANA_TOKEN,
Expand Down
Loading