diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..293d733 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,4 @@ +localhost { + tls internal + reverse_proxy localhost:3000 +} diff --git a/components/Balances.tsx b/components/Balances.tsx index c2d7982..3e680d7 100644 --- a/components/Balances.tsx +++ b/components/Balances.tsx @@ -1,28 +1,45 @@ -import { useBalances } from '@/components/hooks'; -import type { ValueView } from '@penumbra-zone/protobuf/penumbra/core/asset/v1/asset_pb'; +import { useBalances, useAddresses } from '@/components/hooks'; +import type { ValueView, AddressView } from '@penumbra-zone/protobuf/penumbra/core/asset/v1/asset_pb'; import { ValueViewComponent } from '@penumbra-zone/ui/ValueViewComponent'; +import { AddressViewComponent } from '@penumbra-zone/ui/AddressViewComponent'; import type React from 'react'; + export function Balances() { const { data: balances } = useBalances(); + const { data: addresses } = useAddresses(1); + + const filteredBalances = balances?.filter(b => + b.balanceView !== undefined && + b.accountAddress?.addressView.case === 'decoded' && + b.accountAddress.addressView.value.index?.account === 0 + ); + + if (!filteredBalances?.length || !addresses?.length) return null; - return balances?.every((b) => b.balanceView !== undefined) - ? balances.map(({ balanceView }) => ( - - )) - : null; -} + const addressView: AddressView = { + addressView: { + case: 'decoded', + value: { + address: addresses[0].address, + index: { + account: 0, + randomizer: new Uint8Array() + } + } + } + }; -function BalanceRow({ - balance, -}: { - balance: ValueView; -}) { return ( -
- +
+
+ + {filteredBalances.map(({ balanceView }) => ( + + ))} +
); -} +} \ No newline at end of file diff --git a/components/WalletInstallSteps.tsx b/components/WalletInstallSteps.tsx new file mode 100644 index 0000000..f5f3618 --- /dev/null +++ b/components/WalletInstallSteps.tsx @@ -0,0 +1,56 @@ +import React from 'react'; +import { useWalletManifests, useConnect } from './hooks'; + +const WalletInstallSteps = () => { + const { data: wallets } = useWalletManifests(); + const { connected, connectionLoading, onConnect } = useConnect(); + + const isPraxInstalled = wallets && + Object.values(wallets).some(manifest => manifest.name.includes('Prax')); + + return ( +
+
+ {isPraxInstalled ? ( +
+ Prax Wallet Installed +
+ ) : ( + + Install Prax Wallet + + )} +
+ +
+ +
+ {connected ? ( +
+ Wallet Connected +
+ ) : ( + + )} +
+
+ ); +}; + +export default WalletInstallSteps; \ No newline at end of file diff --git a/pages/_meta.json b/pages/_meta.json index 2c5e5d5..0678330 100644 --- a/pages/_meta.json +++ b/pages/_meta.json @@ -35,7 +35,7 @@ "breadcrumb": false } }, - "web": "Using Penumbra on the web", + "web": "Getting Started", "pcli": "Using Penumbra from the command line", "node": "Running a node", "frontend": "Running a frontend", @@ -58,4 +58,4 @@ "breadcrumb": false } } -} +} \ No newline at end of file diff --git a/pages/interchain-privacy.mdx b/pages/interchain-privacy.mdx index a1b0af6..6d53151 100644 --- a/pages/interchain-privacy.mdx +++ b/pages/interchain-privacy.mdx @@ -9,6 +9,17 @@ across chains. +### Test + + + +### Nested + + + + + + ### Deposit To deposit tokens into Penumbra's shielded pool, users initiate an ordinary IBC diff --git a/pages/web.md b/pages/web.mdx similarity index 72% rename from pages/web.md rename to pages/web.mdx index 3d67008..a3e5072 100644 --- a/pages/web.md +++ b/pages/web.mdx @@ -1,4 +1,28 @@ -# Using Penumbra on the web +import WalletInstallSteps from '@/components/WalletInstallSteps'; +import {Balances} from '@/components/Balances'; +import { Callout, Steps } from 'nextra/components' + + + +### Install Prax Wallet + +To get started, [install Prax Wallet](https://praxwallet.com), then open it from the Chrome extensions toolbar to create a wallet. + + + +Connected sites, like this one, can view your addresses and balances: + + + + +### Shield Funds + +Test + + + + +(Old Content) Penumbra's web tooling is designed to support a decentralized ecosystem of frontends. This allows different frontends to focus on different user diff --git a/pages/web/_meta.json b/pages/web/_meta.json index b755e3b..1dd309e 100644 --- a/pages/web/_meta.json +++ b/pages/web/_meta.json @@ -1,5 +1,4 @@ { - "prax": "Prax Wallet", "balances": "Viewing Balances", "ibc-transfers": "Shielding Funds", "send": "Sending Funds",