UNPKG

@arkiv-network/sdk

Version:

TypeScript client library for Arkiv's blockchains interactions

33 lines (32 loc) • 1.42 kB
//#region src/entity/errors.ts /** An expiry could not be expressed, or would be rejected by the engine. */ var InvalidExpiryError = class extends Error { constructor(reason) { super(`Invalid expiry: ${reason}`); this.name = "InvalidExpiryError"; } }; /** A `creationFlags` byte could not be built or read. */ var InvalidCreationFlagsError = class extends Error { constructor(reason) { super(`Invalid creation flags: ${reason}`); this.name = "InvalidCreationFlagsError"; } }; /** A key salt was outside the `uint128` the wire carries. */ var InvalidSaltError = class extends Error { constructor(salt) { super(`Invalid salt ${String(salt)}. A salt is a uint128, so it must be between 0 and ${2n ** 128n - 1n}. Omit it to get 128 random bits, or pass NO_SALT for a key derived from the owner and nonce alone.`); this.name = "InvalidSaltError"; } }; /** No cryptographic randomness was available to generate a salt. */ var NoRandomSourceError = class extends Error { constructor() { super("No cryptographic random source is available (globalThis.crypto.getRandomValues is missing), so a key salt cannot be generated. Upgrade to Node 18+ or a modern browser, or pass an explicit salt."); this.name = "NoRandomSourceError"; } }; //#endregion export { NoRandomSourceError as i, InvalidExpiryError as n, InvalidSaltError as r, InvalidCreationFlagsError as t }; //# sourceMappingURL=errors-BLeoFbFG.js.map