@arkiv-network/sdk
Version:
TypeScript client library for Arkiv's blockchains interactions
56 lines (54 loc) • 1.81 kB
JavaScript
//#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
Object.defineProperty(exports, 'InvalidCreationFlagsError', {
enumerable: true,
get: function () {
return InvalidCreationFlagsError;
}
});
Object.defineProperty(exports, 'InvalidExpiryError', {
enumerable: true,
get: function () {
return InvalidExpiryError;
}
});
Object.defineProperty(exports, 'InvalidSaltError', {
enumerable: true,
get: function () {
return InvalidSaltError;
}
});
Object.defineProperty(exports, 'NoRandomSourceError', {
enumerable: true,
get: function () {
return NoRandomSourceError;
}
});