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(wallet): add metamask #334

Merged
merged 7 commits into from
Oct 7, 2024
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
1 change: 1 addition & 0 deletions apps/deploy-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@cosmjs/encoding": "^0.32.4",
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
"@cosmos-kit/cosmos-extension-metamask": "0.10.0",
"@cosmos-kit/cosmostation-extension": "^2.12.2",
"@cosmos-kit/keplr": "^2.12.2",
"@cosmos-kit/leap": "^2.12.2",
Expand Down
10 changes: 8 additions & 2 deletions apps/deploy-web/src/components/layout/WalletStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { browserEnvConfig } from "@src/config/browser-env.config";
import { useWallet } from "@src/context/WalletProvider";
import { useLoginRequiredEventHandler } from "@src/hooks/useLoginRequiredEventHandler";
import { useManagedEscrowFaqModal } from "@src/hooks/useManagedEscrowFaqModal";
import { getSplitText } from "@src/hooks/useShortText";
import { useWalletBalance } from "@src/hooks/useWalletBalance";
import { udenomToDenom } from "@src/utils/mathHelpers";
import { uaktToAKT } from "@src/utils/priceUtils";
Expand Down Expand Up @@ -104,10 +105,15 @@ export function WalletStatus() {
<Link className="ml-2 cursor-pointer leading-4" href={`https://stats.akash.network/addresses/${address}`} target="_blank">
<Tooltip>
<TooltipTrigger asChild>
<span>{walletName}</span>
{walletName?.length > 20 ? (
<span className="text-xs">{getSplitText(walletName, 4, 4)}</span>
) : (
<span className="text-xs">{walletName}</span>
)}
</TooltipTrigger>
<TooltipContent>
<Address address={address} isCopyable disableTooltip />
<div className="text-xs">{walletName}</div>
<Address address={address} isCopyable disableTooltip disableTruncate />
</TooltipContent>
</Tooltip>
</Link>
Expand Down
4 changes: 2 additions & 2 deletions apps/deploy-web/src/components/settings/CertificateList.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import { useState, useEffect } from "react";
import { useEffect,useState } from "react";
import { FormattedDate } from "react-intl";
import { Button, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, CustomPagination } from "@akashnetwork/ui/components";
import { Button, CustomPagination,Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@akashnetwork/ui/components";
import { Check } from "iconoir-react";

import { ConnectWallet } from "@src/components/shared/ConnectWallet";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { useSnackbar } from "notistack";

import { RestApiCertificate } from "@src/types/certificate";
import { AnalyticsEvents } from "@src/utils/analytics";
import { ApiUrlService, loadWithPagination } from "@src/utils/apiUtils";
import { TransactionMessageData } from "@src/utils/TransactionMessageData";
import { getStorageWallets, updateWallet } from "@src/utils/walletUtils";
import { useSettings } from "../SettingsProvider";
import { useWallet } from "../WalletProvider";
import { ApiUrlService, loadWithPagination } from "@src/utils/apiUtils";

export type LocalCert = {
certPem: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "@interchain-ui/react/styles";
import "@interchain-ui/react/globalStyles";

import { GasPrice } from "@cosmjs/stargate";
import { wallets as metamask } from "@cosmos-kit/cosmos-extension-metamask";
import { wallets as cosmostation } from "@cosmos-kit/cosmostation-extension";
import { wallets as keplr } from "@cosmos-kit/keplr";
import { wallets as leap } from "@cosmos-kit/leap";
Expand All @@ -22,7 +23,7 @@ export function CustomChainProvider({ children }: Props) {
<ChainProvider
chains={[akash, akashSandbox, akashTestnet]}
assetLists={assetLists}
wallets={[...keplr, ...leap, ...cosmostation]}
wallets={[...keplr, ...leap, ...cosmostation, ...metamask]}
sessionOptions={{
duration: 31_556_926_000, // 1 year
callback: () => {
Expand Down
Loading
Loading