diff --git a/.changeset/hungry-jobs-teach.md b/.changeset/hungry-jobs-teach.md deleted file mode 100644 index d0f23dc25..000000000 --- a/.changeset/hungry-jobs-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@repo/ui': patch ---- - -Fix sidebar font diff --git a/.changeset/pretty-pants-smash.md b/.changeset/pretty-pants-smash.md new file mode 100644 index 000000000..f14d6783e --- /dev/null +++ b/.changeset/pretty-pants-smash.md @@ -0,0 +1,5 @@ +--- +'@penumbra-zone/client': major +--- + +adr006 implementation diff --git a/apps/minifront/CHANGELOG.md b/apps/minifront/CHANGELOG.md index c615bb719..baead4b12 100644 --- a/apps/minifront/CHANGELOG.md +++ b/apps/minifront/CHANGELOG.md @@ -1,5 +1,18 @@ # minifront +## 6.17.0 + +### Minor Changes + +- df2ac99: Use newer client package for minifront. Fix disconnect in transport-chrome + +### Patch Changes + +- Updated dependencies [e6f019e] +- Updated dependencies [ca3c325] + - @repo/ui@7.4.1 + - @penumbra-zone/client@17.0.0 + ## 6.16.0 ### Minor Changes diff --git a/apps/minifront/package.json b/apps/minifront/package.json index 8888033fe..ea849d141 100644 --- a/apps/minifront/package.json +++ b/apps/minifront/package.json @@ -1,6 +1,6 @@ { "name": "minifront", - "version": "6.16.0", + "version": "6.17.0", "private": true, "license": "(MIT OR Apache-2.0)", "type": "module", diff --git a/apps/minifront/src/abort-loader.ts b/apps/minifront/src/abort-loader.ts index 08c9b25aa..960a522d2 100644 --- a/apps/minifront/src/abort-loader.ts +++ b/apps/minifront/src/abort-loader.ts @@ -1,4 +1,4 @@ -import { isPraxConnected, throwIfPraxNotConnected, throwIfPraxNotInstalled } from './prax'; +import { penumbra, throwIfPraxNotConnected, throwIfPraxNotInstalled } from './prax'; /** * Retry test, resolving `true`, or resolving `false` if timeout reached. @@ -30,7 +30,7 @@ const retry = async (fn: () => boolean, ms = 500, rate = Math.max(ms / 10, 50)) */ export const abortLoader = async (): Promise => { await throwIfPraxNotInstalled(); - await retry(() => isPraxConnected()); + await retry(() => Boolean(penumbra.connected)); throwIfPraxNotConnected(); // Loaders are required to return a value, even if it's null. By returning diff --git a/apps/minifront/src/clients.ts b/apps/minifront/src/clients.ts deleted file mode 100644 index 46b64a929..000000000 --- a/apps/minifront/src/clients.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { - CustodyService, - DexService, - IbcChannelService, - IbcClientService, - IbcConnectionService, - SctService, - SimulationService, - StakeService, - TendermintProxyService, - ViewService, -} from '@penumbra-zone/protobuf'; -import { createPraxClient } from './prax'; - -export const custodyClient = createPraxClient(CustodyService); -export const dexClient = createPraxClient(DexService); -export const ibcChannelClient = createPraxClient(IbcChannelService); -export const ibcClient = createPraxClient(IbcClientService); -export const ibcConnectionClient = createPraxClient(IbcConnectionService); -export const sctClient = createPraxClient(SctService); -export const simulationClient = createPraxClient(SimulationService); -export const stakeClient = createPraxClient(StakeService); -export const tendermintClient = createPraxClient(TendermintProxyService); -export const viewClient = createPraxClient(ViewService); diff --git a/apps/minifront/src/components/extension-not-connected.tsx b/apps/minifront/src/components/extension-not-connected.tsx index 196a3f935..663da8634 100644 --- a/apps/minifront/src/components/extension-not-connected.tsx +++ b/apps/minifront/src/components/extension-not-connected.tsx @@ -6,7 +6,8 @@ import { HeadTag } from './metadata/head-tag'; import { useState } from 'react'; import { PenumbraRequestFailure } from '@penumbra-zone/client'; -import { requestPraxAccess } from '../prax'; +import { penumbra } from '../prax'; +import { useNavigate } from 'react-router-dom'; const handleErr = (e: unknown) => { if (e instanceof Error && e.cause) { @@ -34,11 +35,12 @@ const handleErr = (e: unknown) => { const useExtConnector = () => { const [result, setResult] = useState(); + const navigate = useNavigate(); const request = async () => { try { - await requestPraxAccess(); - location.reload(); + await penumbra.connect(); + navigate('/'); } catch (e) { handleErr(e); } finally { diff --git a/apps/minifront/src/components/extension-not-installed.tsx b/apps/minifront/src/components/extension-not-installed.tsx index aa2a33e40..210e7baf9 100644 --- a/apps/minifront/src/components/extension-not-installed.tsx +++ b/apps/minifront/src/components/extension-not-installed.tsx @@ -10,14 +10,14 @@ export const ExtensionNotInstalled = () => {
- To get started, install the Penumbra Chrome extension. + To get started, install a Penumbra extension.
diff --git a/apps/minifront/src/components/header/menu/provider.tsx b/apps/minifront/src/components/header/menu/provider.tsx index b7e41c141..dab2b2cbb 100644 --- a/apps/minifront/src/components/header/menu/provider.tsx +++ b/apps/minifront/src/components/header/menu/provider.tsx @@ -1,31 +1,21 @@ import { cn } from '@repo/ui/lib/utils'; import * as NavigationMenu from '@radix-ui/react-navigation-menu'; import { getChainId } from '../../../fetchers/chain-id'; -import { useCallback, useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { itemStyle, triggerStyle, dropdownStyle, linkStyle, viewportStyle } from './nav-style'; -import { Link1Icon, LinkBreak1Icon } from '@radix-ui/react-icons'; -import { getPraxManifest, getPraxOrigin } from '../../../prax'; -import { PenumbraSymbol } from '@penumbra-zone/client'; +import { LinkBreak1Icon } from '@radix-ui/react-icons'; +import { penumbra } from '../../../prax'; export const ProviderMenu = () => { const [chainId, setChainId] = useState(); - const [providerManifest, setProviderManifest] = useState(); - const [providerOrigin] = useState(getPraxOrigin()); - const [manifestIconUnavailable, setManifestIconUnavailable] = useState(); - - const disconnect = useCallback(() => { - void window[PenumbraSymbol]?.[providerOrigin] - ?.disconnect() - .then(() => window.location.reload()); - }, [providerOrigin]); + const disconnect = () => void penumbra.disconnect().then(() => window.location.reload()); useEffect(() => { - void getPraxManifest().then(m => setProviderManifest(m as ProviderManifest)); void getChainId().then(setChainId); }, []); - if (!providerManifest) { + if (!penumbra.manifest) { return null; } @@ -39,17 +29,12 @@ export const ProviderMenu = () => { 'h-[42px] flex flex-row gap-2 place-items-center justify-evenly whitespace-nowrap', )} > - {manifestIconUnavailable ? ( - - ) : ( - {`${providerManifest.name} setManifestIconUnavailable(true)} - /> - )} + {`${penumbra.manifest['name']} {chainId} @@ -58,20 +43,14 @@ export const ProviderMenu = () => {
- {providerManifest.name} {providerManifest.version} + {penumbra.manifest['name']} {penumbra.manifest['version']} -

{providerManifest.description}

+

{penumbra.manifest['description']}

-