Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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;
async verify(rpcURL: string): Promise<VerifyResult>;
}

§Extends

§
Proof
[src]

§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

§
blockHash: string
[src]

Base58 encoded Tezos block hash

§
mainnet: boolean
[src]

Indicates that the proof is affixed to the Tezos mainnet

§
network: string
[src]

Tezos network identifier

§
timestamp: Date
[src]

Timestamp asserted by the proof

§Methods

§
concat(_: AnyProof): never
[src]
§
isAffixed(): this is AffixedProof
[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