Skip to content

Commit

Permalink
add wallet connect
Browse files Browse the repository at this point in the history
  • Loading branch information
simke9445 committed Dec 7, 2023
1 parent 4564c90 commit f6d042f
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 10 deletions.
1 change: 1 addition & 0 deletions apps/warp-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@mui/material": "^5.10.2",
"@popperjs/core": "^2.11.6",
"@terra-money/feather.js": "^1.0.11",
"@terra-money/terra-station-mobile": "1.0.8",
"@terra-money/wallet-kit": "^1.0.11",
"@terra-money/warp-sdk": "^0.1.65",
"assert": "^2.0.0",
Expand Down
9 changes: 7 additions & 2 deletions apps/warp-protocol/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import { TemplatesPage } from 'pages/templates';
import { useWalletDefaultNetworks } from 'hooks/useWalletDefaultNetworks';
import { ChainSelectorProvider } from '@terra-money/apps/hooks';
import { useTermsOfUseDialog } from 'components/dialog/terms-of-use/TermsOfUseDialog';
import { useEffect } from 'react';
import TerraStationMobileWallet from '@terra-money/terra-station-mobile';
import { useEffect, useMemo } from 'react';

const queryClient = new QueryClient();

Expand Down Expand Up @@ -51,6 +52,10 @@ const Inner = () => {
const [theme] = useTheme();
const walletDefaultNetworks = useWalletDefaultNetworks();

const extraWallets = useMemo(() => {
return [new TerraStationMobileWallet()];
}, []);

useEffect(() => {
const accepted = localStorage.getItem('TermsOfUseAccepted_Oct-3-2023');
if (!accepted) {
Expand All @@ -61,7 +66,7 @@ const Inner = () => {

// TODO: check later if chainOptions would cause a flicker due to being null for first couple of calls
return walletDefaultNetworks ? (
<WalletProvider defaultNetworks={walletDefaultNetworks}>
<WalletProvider defaultNetworks={walletDefaultNetworks} extraWallets={extraWallets}>
<main className={styles.root} data-theme={theme}>
{/* <NetworkGuard> */}
<ChainSelectorProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ export const ConnectWalletDialog = (props: DialogProps<ConnectWalletDialogProps,
};

const fixName = (name: string) => {
if (name.includes('Station')) {
if (name.includes('Station (Extension)')) {
return 'Station';
}

if (name.includes('Terra Station (Mobile)')) {
return 'Wallet Connect';
}

return name;
};

Expand Down
Loading

0 comments on commit f6d042f

Please sign in to comment.