Skip to content

Commit

Permalink
feat: hostd v2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Aug 14, 2024
1 parent a6c956e commit ecedd53
Show file tree
Hide file tree
Showing 68 changed files with 1,269 additions and 813 deletions.
6 changes: 6 additions & 0 deletions .changeset/dirty-jeans-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'hostd': minor
---

Sync status is now determined by whether the last block's timestamp is within
the last 12 hours.
7 changes: 7 additions & 0 deletions .changeset/famous-pears-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@siafoundation/hostd-js': minor
'@siafoundation/hostd-react': minor
'@siafoundation/hostd-types': minor
---

Updated with v2 endpoints and data types. Closes https://github.com/SiaFoundation/hostd/issues/440
9 changes: 9 additions & 0 deletions .changeset/kind-trains-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@siafoundation/hostd-js': minor
'@siafoundation/hostd-react': minor
'@siafoundation/hostd-types': minor
'@siafoundation/types': minor
'@siafoundation/walletd-types': minor
---

Core Event types have been moved to the core types library. Closes https://github.com/SiaFoundation/hostd/issues/440
5 changes: 5 additions & 0 deletions .changeset/old-hounds-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'hostd': minor
---

The app has been updated to use the new v2 endpoints and data types. Closes https://github.com/SiaFoundation/hostd/issues/440
8 changes: 8 additions & 0 deletions .changeset/pretty-coins-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'hostd': minor
'walletd': minor
'@siafoundation/design-system': minor
'@siafoundation/units': minor
---

Transaction types have been refined to include new v2 derived transaction types.
5 changes: 5 additions & 0 deletions .changeset/thin-shirts-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'hostd': minor
---

The wallet balance tip now includes an immature balance.
7 changes: 7 additions & 0 deletions .changeset/two-olives-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'walletd': minor
'@siafoundation/units': minor
'@siafoundation/design-system': minor
---

Event and transaction utility methods have been moved to the units library.
5 changes: 5 additions & 0 deletions .changeset/wise-dolls-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@siafoundation/design-system': minor
---

WalletBalance now supports an optional immature sc value.
2 changes: 1 addition & 1 deletion apps/explorer/components/EntityHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
humanId,
Button,
Link,
EntityType,
} from '@siafoundation/design-system'
import { Copy16 } from '@siafoundation/react-icons'
import { EntityType } from '@siafoundation/units'
import { upperFirst } from '@technically/lodash'

type Props = {
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/components/ExplorerDatum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {
ValueSf,
ValueSc,
ValueCopyable,
EntityType,
} from '@siafoundation/design-system'
import BigNumber from 'bignumber.js'
import { upperFirst } from '@technically/lodash'
import { getHref } from '../lib/utils'
import { EntityType } from '@siafoundation/units'

// entityType&entityValue | value | values | sc | sf
export type DatumProps = {
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EntityType } from '@siafoundation/design-system'
import { routes } from '../config/routes'
import { Metadata } from 'next'
import { siteName } from '../config'
import { EntityType } from '@siafoundation/units'

export function getHref(type: EntityType, value: string) {
// block accepts blockhash as a value.
Expand Down
4 changes: 2 additions & 2 deletions apps/hostd-e2e/src/specs/volumes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
} from '../fixtures/volumes'

test('can create and delete a volume', async ({ page }) => {
const name = 'my-new-bucket'
const path = '/tmp'
const name = 'my-new-volume'
const path = '/data'
await login({ page })
await navigateToVolumes({ page })
await deleteVolumeIfExists(page, name, path)
Expand Down
6 changes: 3 additions & 3 deletions apps/hostd/components/CmdRoot/WalletCmdGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { routes } from '../../config/routes'
import { useRouter } from 'next/router'
import { useDialog } from '../../contexts/dialog'
import { CommandGroup, CommandItemNav, CommandItemSearch } from './Item'
import { useStateHost } from '@siafoundation/hostd-react'
import { useWallet } from '@siafoundation/hostd-react'
import { Page } from './types'

const commandPage = {
Expand All @@ -20,7 +20,7 @@ type Props = {
export function WalletCmdGroup({ currentPage, parentPage, pushPage }: Props) {
const { openDialog, closeDialog } = useDialog()
const router = useRouter()
const state = useStateHost({
const wallet = useWallet({
config: {
swr: {
revalidateOnFocus: false,
Expand Down Expand Up @@ -81,7 +81,7 @@ export function WalletCmdGroup({ currentPage, parentPage, pushPage }: Props) {
currentPage={currentPage}
commandPage={commandPage}
onSelect={() => {
copyToClipboard(state.data?.walletAddress, 'wallet address')
copyToClipboard(wallet.data?.address, 'wallet address')
closeDialog()
}}
>
Expand Down
4 changes: 2 additions & 2 deletions apps/hostd/components/Config/AnnounceButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useDialog } from '../../contexts/dialog'
import {
useSettings,
useSettingsAnnounce,
useStateHost,
useHostState,
useTxPoolFee,
} from '@siafoundation/hostd-react'
import { humanSiacoin } from '@siafoundation/units'
Expand All @@ -21,7 +21,7 @@ export function AnnounceButton() {
const { openConfirmDialog } = useDialog()
const txpoolFee = useTxPoolFee()
const settingsAnnounce = useSettingsAnnounce()
const host = useStateHost()
const host = useHostState()
const settings = useSettings({
config: {
swr: {
Expand Down
Loading

0 comments on commit ecedd53

Please sign in to comment.