/**
* This module defines a struct storing the metadata of the block and new block events.
*
* **Module ID:** `0x1::block`
*
* @module
*/
import type * as p from "@movingco/prelude";
/**
* Should be in-sync with BlockResource rust struct in new_block.rs
*
* Type name: `0x1::block::BlockResource`
*/
export interface IBlockResource {
/** Height of the current block */
height: p.U64;
/** Time period between epochs. */
epoch_interval: p.U64;
/** Handle where events with the time of new blocks are emitted */
new_block_events: {
/** Total number of events emitted to this event stream. */
counter: p.U64;
/** A globally unique ID for this event stream. */
guid: {
id: {
/** If creation_num is `i`, this is the `i+1`th GUID created by `addr` */
creation_num: p.U64;
/** Address that created the GUID */
addr: p.RawAddress;
};
};
};
}
/**
* Should be in-sync with NewBlockEvent rust struct in new_block.rs
*
* Type name: `0x1::block::NewBlockEvent`
*/
export interface INewBlockEvent {
epoch: p.U64;
round: p.U64;
height: p.U64;
previous_block_votes_bitvec: p.ByteString;
proposer: p.RawAddress;
failed_proposer_indices: ReadonlyArray
;
/** On-chain time during the block at the given height */
time_microseconds: p.U64;
}
export { idl } from "./idl.js";
/** The address of the module. */
export declare const ADDRESS: "0x1";
/** The full module name. */
export declare const FULL_NAME: "0x1::block";
/** The name of the module. */
export declare const NAME: "block";
/** Module ID information. */
export declare const id: {
readonly ADDRESS: "0x1";
readonly FULL_NAME: "0x1::block";
readonly NAME: "block";
};
export * as errors from "./errors.js";
/** Module error codes. */
export declare const errorCodes: {
readonly "1": {
readonly name: "ENUM_NEW_BLOCK_EVENTS_DOES_NOT_MATCH_BLOCK_HEIGHT";
readonly doc: "The number of new block events does not equal the current block height.";
};
readonly "2": {
readonly name: "EINVALID_PROPOSER";
readonly doc: "An invalid proposer was provided. Expected the proposer to be the VM or an active validator.";
};
readonly "3": {
readonly name: "EZERO_EPOCH_INTERVAL";
readonly doc: "Epoch interval cannot be 0.";
};
};
/** All module function IDLs. */
export declare const functions: {};
/** All struct types with ability `key`. */
export declare const resources: {
readonly BlockResource: "0x1::block::BlockResource";
};
/** All struct types. */
export declare const structs: {
readonly BlockResource: "0x1::block::BlockResource";
readonly NewBlockEvent: "0x1::block::NewBlockEvent";
};
/** This module defines a struct storing the metadata of the block and new block events. */
export declare const moduleDefinition: {
readonly errorCodes: {
readonly "1": {
readonly name: "ENUM_NEW_BLOCK_EVENTS_DOES_NOT_MATCH_BLOCK_HEIGHT";
readonly doc: "The number of new block events does not equal the current block height.";
};
readonly "2": {
readonly name: "EINVALID_PROPOSER";
readonly doc: "An invalid proposer was provided. Expected the proposer to be the VM or an active validator.";
};
readonly "3": {
readonly name: "EZERO_EPOCH_INTERVAL";
readonly doc: "Epoch interval cannot be 0.";
};
};
readonly functions: {};
readonly resources: {
readonly BlockResource: "0x1::block::BlockResource";
};
readonly structs: {
readonly BlockResource: "0x1::block::BlockResource";
readonly NewBlockEvent: "0x1::block::NewBlockEvent";
};
readonly ADDRESS: "0x1";
readonly FULL_NAME: "0x1::block";
readonly NAME: "block";
};
//# sourceMappingURL=index.d.ts.map