AffixedProof
import { AffixedProof } from "https://raw.githubusercontent.com/marigold-dev/tzstamp/0.3.4/proof/mod.ts";Cryptographic timestamp proof affixed to the Tezos blockchain
class AffixedProof extends Proof { }
constructor({ hash, operations, network, timestamp }: AffixedProofOptions);
readonly blockHash: string;
readonly mainnet: boolean;
readonly network: string;
readonly timestamp: Date;
concat(_: AnyProof): never;
isAffixed(): this is AffixedProof;
toJSON(): AffixedProofTemplate;
§Constructors
§
new AffixedProof({ hash, operations, network, timestamp }: AffixedProofOptions)
[src]Throws InvalidTezosNetworkError if the Tezos network identifier is invalid.
@param hash
Input hash
@param operations
Proof operations
@param network
Tezos network identifier
@param timestamp
Asserted timestamp
§Properties
§Methods
§
isAffixed(): this is AffixedProof
[src]§
toJSON(): AffixedProofTemplate
[src]§
verify(rpcURL: string): Promise<VerifyResult>
[src]Verifies the proof by querying Tezos node RPC with the derived block hash and comparing the timestamp of the block header with the timestamp asserted by the proof.
Throws TypeError if the RPC URL is invalid or a network error
is encountered.
Throws FetchError if the response has a status other than
200 or 404.
Throws SyntaxError if the fetched block header is not valid JSON
or does not contain a valid timestamp field.
Resolves a VerifyResult containing a explanatory message of
verification success or fail.
@param rpcURL
Tezos node RPC base URL