Skip to content

Commit

Permalink
Create a separate type - Currency
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosiorowska committed Nov 24, 2023
1 parent d866e8f commit 2a7c10f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dapp/src/components/Navbar/ConnectWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function ConnectWallet() {
? "0.00"
: formatSatoshiAmount(btcAccount.balance.toString())}
</Text>
<Text>{BITCOIN.token}</Text>
<Text>{BITCOIN.symbol}</Text>
</Box>
<ConnectButton
leftIcon={BitcoinIcon}
Expand Down
13 changes: 11 additions & 2 deletions dapp/src/constants/chains.ts → dapp/src/constants/currency.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
export const BITCOIN = {
import { Currency } from "../types"

export const BITCOIN: Currency = {
name: "Bitcoin",
token: "BTC",
symbol: "BTC",
decimals: 8,
}

export const ETHEREUM: Currency = {
name: "Ethereum",
symbol: "ETH",
decimals: 18,
}

export const CURRENCY_ID_BITCOIN =
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "./chains"
export * from "./currency"
5 changes: 5 additions & 0 deletions dapp/src/types/currency.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type Currency = {
name: string
symbol: string
decimals: number
}
1 change: 1 addition & 0 deletions dapp/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./ledger-live-app"
export * from "./currency"

0 comments on commit 2a7c10f

Please sign in to comment.