Skip to content

Commit

Permalink
feat: explorer contract details
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Sep 15, 2023
1 parent b62ef91 commit 89ea9e7
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 177 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-fishes-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'explorer': minor
---

Contract details now include expiration, proof, proof deadline, and payout block heights and timestamps.
5 changes: 5 additions & 0 deletions .changeset/funny-years-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'explorer': minor
---

The foundation's public explorer is now siascan.com.
69 changes: 57 additions & 12 deletions apps/explorer/components/Contract/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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(),
},
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/components/ContractSkeleton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function ContractSkeleton() {
</div>
<Skeleton className="h-[40px] w-full" />
<div className="grid grid-cols-1 lg:grid-cols-2 gap-x-20 gap-y-4">
{times(12, (i) => (
{times(18, (i) => (
<DatumSkeleton key={i} />
))}
</div>
Expand Down
164 changes: 0 additions & 164 deletions apps/explorer/components/Host/HostPriceTable.tsx

This file was deleted.

0 comments on commit 89ea9e7

Please sign in to comment.