Skip to content

Commit

Permalink
feat(frontend): make solana native tokens requiredtokens (#4040)
Browse files Browse the repository at this point in the history
# Motivation

To align with the other implementations, let's make Solana native tokens
of type RequiredToken.

# Changes

adjust type

Co-authored-by: Antonio Ventilii <[email protected]>
  • Loading branch information
loki344 and AntonioVentilii authored Dec 30, 2024
1 parent 1edc6ea commit e9f06bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit e9f06bb

Please sign in to comment.