From 9d752e053220a3edbeb59ff7f9f975c5bbeb39bc Mon Sep 17 00:00:00 2001 From: John Williams Date: Tue, 24 Sep 2024 12:50:25 -0400 Subject: [PATCH] feat(explored-types): add hostAnnouncements to ExplorerTransaction --- .changeset/thick-mangos-cheat.md | 5 +++++ libs/explored-types/src/types.ts | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .changeset/thick-mangos-cheat.md diff --git a/.changeset/thick-mangos-cheat.md b/.changeset/thick-mangos-cheat.md new file mode 100644 index 000000000..c7fb74813 --- /dev/null +++ b/.changeset/thick-mangos-cheat.md @@ -0,0 +1,5 @@ +--- +'@siafoundation/explored-types': minor +--- + +Added host announcements to the ExplorerTransaction type. diff --git a/libs/explored-types/src/types.ts b/libs/explored-types/src/types.ts index f05d20801..b5476973c 100644 --- a/libs/explored-types/src/types.ts +++ b/libs/explored-types/src/types.ts @@ -9,6 +9,7 @@ import type { FileContractElement, FileContractID, Hash256, + PublicKey, SiacoinElement, SiacoinInput, SiacoinOutputID, @@ -111,6 +112,16 @@ export type TxpoolTransactions = { // for more independent data types--one would not need the original contract to display // a list of revisions, for example. +/** + * HostAnnouncement represents a signed announcement of a host's network address. + * Announcements may be made via arbitrary data (in a v1 transaction) or via attestation + * (in a v2 transaction). + */ +type HostAnnouncement = { + publicKey: PublicKey + netAddress: string +} + /** * The origin of a `SiacoinOutput`--whether it came from a miner or a transaction. */ @@ -181,6 +192,7 @@ export type ExplorerTransaction = { minerFees: Currency arbitraryData: string[][] signatures: TransactionSignature[] + hostAnnouncements: HostAnnouncement[] } /**