Skip to content

Commit da995d3

Browse files
authored
Add support for tracking offchain accounts (#4)
1 parent ac8f855 commit da995d3

17 files changed

Lines changed: 678 additions & 169 deletions

File tree

.github/workflows/docker.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches: [main]
66
tags: ['v*']
7-
pull_request:
8-
branches: [main]
97

108
jobs:
119
build:

client/src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { AccountCard } from './components/AccountCard'
44
import { BalanceCard } from './components/BalanceCard'
55
import { ChainCard } from './components/ChainCard'
66
import { Layout } from './components/Layout'
7+
import { PortfolioCard } from './components/PortfolioCard'
78
import { TokenCard } from './components/TokenCard'
89
import { Home } from './screens/Home'
910

@@ -12,10 +13,11 @@ function App() {
1213
<Layout>
1314
<Routes>
1415
<Route path="/" element={<Home />} />
15-
<Route path="/portfolio" element={<BalanceCard />} />
16+
<Route path="/portfolio" element={<PortfolioCard />} />
1617
<Route path="/chains" element={<ChainCard />} />
1718
<Route path="/accounts" element={<AccountCard />} />
1819
<Route path="/tokens" element={<TokenCard />} />
20+
<Route path="/balances" element={<BalanceCard />} />
1921
</Routes>
2022
</Layout>
2123
)

client/src/components/AccountCard.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export function AccountCard() {
7373
variant="outline"
7474
size="icon"
7575
onClick={async () => {
76-
const promise = honoClient.accounts[':address'].$delete({
77-
param: { address: account.address },
76+
const promise = honoClient.accounts[':id'].$delete({
77+
param: { id: account.id.toString() },
7878
})
7979

8080
toast.promise(promise, {
@@ -104,15 +104,15 @@ export function AccountCard() {
104104
const addAccountSchema = zfd.formData({
105105
name: zfd.text(z.string().optional()),
106106
description: zfd.text(z.string().optional()),
107-
addressOrName: zfd.text(),
107+
addressOrName: zfd.text(z.string().optional()),
108108
})
109109

110110
function AccountDialog({
111111
address,
112112
prompt,
113113
...buttonProps
114114
}: {
115-
address?: string
115+
address?: string | null
116116
prompt: 'Add' | 'Edit'
117117
} & VariantProps<typeof buttonVariants>) {
118118
const accounts = useAccounts()
@@ -141,7 +141,6 @@ function AccountDialog({
141141
},
142142
error: {
143143
message: `Failed to ${prompt.toLowerCase()} account`,
144-
description: 'Be sure to use the checksummed address',
145144
},
146145
})
147146
}
@@ -198,7 +197,7 @@ function AccountDialog({
198197
<Input
199198
name="addressOrName"
200199
placeholder="0x1234567890123456789012345678901234567890"
201-
defaultValue={selectedAccount?.address}
200+
defaultValue={selectedAccount?.address ?? ''}
202201
autoComplete="off"
203202
data-1p-ignore
204203
/>

0 commit comments

Comments
 (0)