Documentation
¶
Overview ¶
Package external fetches supplementary data from public blockchains (Stellar Horizon, Bitcoin block explorers) to corroborate proofs against real-world public records.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BitcoinResult ¶
type BitcoinResult struct {
Height int
Timestamp string // ISO 8601 block timestamp from Blockstream
}
BitcoinResult holds the verification result from the Blockstream API.
func VerifyBitcoinBlock ¶
func VerifyBitcoinBlock(blockHash, network string) (*BitcoinResult, bool, error)
VerifyBitcoinBlock checks the Blockstream API to confirm a Bitcoin block exists. Returns the block height and timestamp, or an error. For regtest, returns a skip indicator.
type KeyringKey ¶
type KeyringKey struct {
KeyID string `json:"key_id"`
PublicKey string `json:"public_key"`
Sequence int `json:"sequence"`
Active bool `json:"active"`
}
KeyringKey is a single entry in the keyring.
type KeyringResponse ¶
type KeyringResponse struct {
Version string `json:"version"`
Keys []KeyringKey `json:"keys"`
}
KeyringResponse is the shape of /.well-known/keyring.json.
type StellarResult ¶
type StellarResult struct {
Ledger int
Timestamp string // ISO 8601 ledger close timestamp from Horizon
}
StellarResult holds the verification result from the Stellar Horizon API.
func VerifyStellar ¶
func VerifyStellar(transactionHash, expectedMemoHash, network string, expectedLedger int) (*StellarResult, error)
VerifyStellar checks the Stellar Horizon API to confirm the transaction exists, the memo matches, and the ledger number matches the expected value. Returns the ledger number, the transaction timestamp, or an error.