UNPKG

@hashgraph/sdk

Version:
65 lines (64 loc) 1.45 kB
/** * Represents the ID of a network. */ declare class LedgerId { /** * @param {string} ledgerId * @returns {LedgerId} */ static fromString(ledgerId: string): LedgerId; /** * Using the UTF-8 byte representation of "mainnet", "testnet", * or "previewnet" is NOT supported. * * @param {Uint8Array} bytes * @returns {LedgerId} */ static fromBytes(bytes: Uint8Array): LedgerId; /** * @hideconstructor * @internal * @param {Uint8Array} ledgerId */ constructor(ledgerId: Uint8Array); /** * @readonly * @type {Uint8Array} */ readonly _ledgerId: Uint8Array; /** * If the ledger ID is a known value such as `[0]`, `[1]`, `[2]` this method * will instead return "mainnet", "testnet", or "previewnet", otherwise it will * hex encode the bytes. * * @returns {string} */ toString(): string; /** * @returns {Uint8Array} */ toBytes(): Uint8Array; /** * @returns {boolean} */ isMainnet(): boolean; /** * @returns {boolean} */ isTestnet(): boolean; /** * @returns {boolean} */ isPreviewnet(): boolean; /** * @returns {boolean} */ isLocalNode(): boolean; } declare namespace LedgerId { let MAINNET: LedgerId; let TESTNET: LedgerId; let PREVIEWNET: LedgerId; let LOCAL_NODE: LedgerId; } export default LedgerId;