Skip to content

Commit

Permalink
move isDevnet to useSolana
Browse files Browse the repository at this point in the history
  • Loading branch information
bryzettler committed Sep 19, 2023
1 parent 328f7d1 commit e6c4f61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/features/swaps/SwapScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ enum SelectorMode {
const SwapScreen = () => {
const { t } = useTranslation()
const { currentAccount } = useAccountStorage()
const { cluster, anchorProvider, connection } = useSolana()
const { isDevnet, anchorProvider, connection } = useSolana()
const wallet = useCurrentWallet()
const colors = useColors()
const navigation = useNavigation<SwapNavigationProp>()
Expand Down Expand Up @@ -118,7 +118,6 @@ const SwapScreen = () => {
getRoute,
} = useJupiter()

const isDevnet = useMemo(() => cluster === 'devnet', [cluster])
const inputMintDecimals = useMint(inputMint)?.info?.decimals
const outputMintDecimals = useMint(outputMint)?.info?.decimals

Expand Down
3 changes: 3 additions & 0 deletions src/solana/SolanaProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const useSolanaHook = () => {
return getConnection(cluster, sessionKeyActual)
}
}, [cluster, sessionKey, loading])
const isDevnet = useMemo(() => cluster === 'devnet', [cluster])
const address = useMemo(
() => currentAccount?.address,
[currentAccount?.address],
Expand Down Expand Up @@ -173,6 +174,7 @@ const useSolanaHook = () => {
return {
anchorProvider,
cluster,
isDevnet,
connection,
dcProgram,
hemProgram,
Expand All @@ -186,6 +188,7 @@ const useSolanaHook = () => {
const initialState = {
anchorProvider: undefined,
cluster: 'mainnet-beta' as Cluster,
isDevnet: false,
connection: undefined,
dcProgram: undefined,
hemProgram: undefined,
Expand Down

0 comments on commit e6c4f61

Please sign in to comment.