diff --git a/.changeset/curvy-fishes-smash.md b/.changeset/curvy-fishes-smash.md new file mode 100644 index 000000000..784a3e83b --- /dev/null +++ b/.changeset/curvy-fishes-smash.md @@ -0,0 +1,5 @@ +--- +'explorer': minor +--- + +Contract details now include expiration, proof, proof deadline, and payout block heights and timestamps. diff --git a/.changeset/funny-years-laugh.md b/.changeset/funny-years-laugh.md new file mode 100644 index 000000000..61b155bcf --- /dev/null +++ b/.changeset/funny-years-laugh.md @@ -0,0 +1,5 @@ +--- +'explorer': minor +--- + +The foundation's public explorer is now siascan.com. diff --git a/apps/explorer/components/Contract/index.tsx b/apps/explorer/components/Contract/index.tsx index c2d40fd70..1a41b2525 100644 --- a/apps/explorer/components/Contract/index.tsx +++ b/apps/explorer/components/Contract/index.tsx @@ -24,40 +24,40 @@ export function Contract({ contract, rates, renewedFrom, renewedTo }: Props) { const values = useMemo(() => { return [ { - label: 'File Size', + label: 'file size', copyable: false, value: humanBytes(contract.file_size), }, { - label: 'Payout', + label: 'payout', copyable: false, value: `${siacoinToDollars(contract.payout, rates)} (${humanSiacoin( contract.payout )})`, }, { - label: 'Transaction ID', + label: 'transaction ID', entityType: 'transaction', entityValue: contract.transaction_id, }, { - label: 'Merkle Root', + label: 'merkle root', value: contract.merkle_root, }, { - label: 'Unlock Hash', + label: 'unlock hash', value: contract.unlock_hash, }, { - label: 'Revision Number', + label: 'revision number', value: contract.revision_number.toLocaleString(), }, { - label: 'Negotiation Height', + label: 'negotiation height', value: contract.negotiation_height?.toLocaleString() || '-', }, { - label: 'Negotiation Time', + label: 'negotiation time', copyable: false, value: contract.negotiation_timestamp !== '0001-01-01T00:00:00Z' @@ -68,11 +68,56 @@ export function Contract({ contract, rates, renewedFrom, renewedTo }: Props) { : '-', }, { - label: 'Payout Height', + label: 'expiration height', + value: contract.expiration_height?.toLocaleString() || '-', + }, + { + label: 'expiration time', + copyable: false, + value: + contract.expiration_timestamp !== '0001-01-01T00:00:00Z' + ? humanDate(contract.expiration_timestamp, { + dateStyle: 'medium', + timeStyle: 'short', + }) + : '-', + }, + { + label: 'proof height', + value: contract.proof_height?.toLocaleString() || '-', + }, + { + label: 'proof time', + copyable: false, + value: + contract.proof_timestamp !== '0001-01-01T00:00:00Z' + ? humanDate(contract.proof_timestamp, { + dateStyle: 'medium', + timeStyle: 'short', + }) + : '-', + }, + { + label: 'proof deadline height', + value: contract.proof_deadline?.toLocaleString() || '-', + }, + { + label: 'proof deadline time', + copyable: false, + value: + contract.proof_deadline_timestamp !== '0001-01-01T00:00:00Z' + ? humanDate(contract.proof_deadline_timestamp, { + dateStyle: 'medium', + timeStyle: 'short', + }) + : '-', + }, + { + label: 'payout height', value: contract.payout_height?.toLocaleString() || '-', }, { - label: 'Payout Time', + label: 'payout time', copyable: false, value: contract.payout_timestamp !== '0001-01-01T00:00:00Z' @@ -83,11 +128,11 @@ export function Contract({ contract, rates, renewedFrom, renewedTo }: Props) { : '-', }, { - label: 'Proof Confirmed', + label: 'proof confirmed', value: String(contract.proof_confirmed), }, { - label: 'Previous Revisions', + label: 'previous revisions', copyable: false, value: (contract.previous_revisions?.length || 0).toLocaleString(), }, diff --git a/apps/explorer/components/ContractSkeleton/index.tsx b/apps/explorer/components/ContractSkeleton/index.tsx index 8444d8ddd..f7142696a 100644 --- a/apps/explorer/components/ContractSkeleton/index.tsx +++ b/apps/explorer/components/ContractSkeleton/index.tsx @@ -17,7 +17,7 @@ export function ContractSkeleton() {
- {times(12, (i) => ( + {times(18, (i) => ( ))}
diff --git a/apps/explorer/components/Host/HostPriceTable.tsx b/apps/explorer/components/Host/HostPriceTable.tsx deleted file mode 100644 index 7db4b0e52..000000000 --- a/apps/explorer/components/Host/HostPriceTable.tsx +++ /dev/null @@ -1,164 +0,0 @@ -'use client' - -import { useMemo } from 'react' -import { SiaCentralHost } from '@siafoundation/sia-central' -import { DatumProps, ExplorerDatum } from '../ExplorerDatum' -import { Panel } from '@siafoundation/design-system' -import BigNumber from 'bignumber.js' - -type Props = { - host: SiaCentralHost -} - -export function HostPriceTable({ host }: Props) { - const priceTableValues = useMemo(() => { - return [ - { - label: 'account balance cost', - sc: new BigNumber(host.price_table.accountbalancecost), - }, - { - label: 'collateral cost', - sc: new BigNumber(host.price_table.collateralcost), - }, - { - label: 'contract price', - sc: new BigNumber(host.price_table.contractprice), - }, - { - label: 'download bandwidth cost', - sc: new BigNumber(host.price_table.downloadbandwidthcost), - }, - { - label: 'drop sectors base cost', - sc: new BigNumber(host.price_table.dropsectorsbasecost), - }, - { - label: 'drop sectors unit cost', - sc: new BigNumber(host.price_table.dropsectorsunitcost), - }, - { - label: 'fund account cost', - sc: new BigNumber(host.price_table.fundaccountcost), - }, - { - label: 'has sector base cost', - sc: new BigNumber(host.price_table.hassectorbasecost), - }, - { - label: 'host block height', - value: host.price_table.hostblockheight, - }, - { - label: 'init base cost', - sc: new BigNumber(host.price_table.initbasecost), - }, - { - label: 'latest revision cost', - sc: new BigNumber(host.price_table.latestrevisioncost), - }, - { - label: 'max collateral', - sc: new BigNumber(host.price_table.maxcollateral), - }, - { - label: 'max duration', - value: host.price_table.maxduration, - }, - { - label: 'memory time cost', - sc: new BigNumber(host.price_table.memorytimecost), - }, - { - label: 'read base cost', - sc: new BigNumber(host.price_table.readbasecost), - }, - { - label: 'read length cost', - sc: new BigNumber(host.price_table.readlengthcost), - }, - { - label: 'registry entries left', - value: host.price_table.registryentriesleft, - }, - { - label: 'registry entries total', - value: host.price_table.registryentriestotal, - }, - { - label: 'renew contract cost', - sc: new BigNumber(host.price_table.renewcontractcost), - }, - { - label: 'revision base cost', - sc: new BigNumber(host.price_table.revisionbasecost), - }, - { - label: 'subscription memory cost', - sc: new BigNumber(host.price_table.subscriptionmemorycost), - }, - { - label: 'subscription notification cost', - sc: new BigNumber(host.price_table.subscriptionnotificationcost), - }, - { - label: 'swap sector cost', - sc: new BigNumber(host.price_table.swapsectorcost), - }, - { - label: 'txn fee max recommended', - sc: new BigNumber(host.price_table.txnfeemaxrecommended), - }, - { - label: 'txn fee min recommended', - sc: new BigNumber(host.price_table.txnfeeminrecommended), - }, - { - label: 'UID', - value: host.price_table.uid, - }, - { - label: 'update price table cost', - sc: new BigNumber(host.price_table.updatepricetablecost), - }, - { - label: 'upload bandwidth cost', - sc: new BigNumber(host.price_table.uploadbandwidthcost), - }, - { - label: 'validity', - value: host.price_table.validity, - }, - { - label: 'window size', - value: host.price_table.windowsize, - }, - { - label: 'write base cost', - sc: new BigNumber(host.price_table.writebasecost), - }, - { - label: 'write length cost', - sc: new BigNumber(host.price_table.writelengthcost), - }, - { - label: 'write store cost', - sc: new BigNumber(host.price_table.writestorecost), - }, - ] as DatumProps[] - }, [host]) - - return ( - -
- {!!priceTableValues?.length && ( -
- {priceTableValues.map((item) => ( - - ))} -
- )} -
-
- ) -}