UNPKG

chaingate

Version:

Multi-chain cryptocurrency SDK for TypeScript — unified API for Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash, Polygon, Arbitrum, and any EVM-compatible chain. Create wallets, query balances, send transactions, and manage tokens and NFTs across UTXO

76 lines (75 loc) 2.88 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HDKeyNullError = exports.EncryptedAccessError = exports.AlreadyEncryptedError = exports.NotEncryptedError = exports.DecryptionCancelledError = exports.InvalidPublicKeyError = exports.InvalidSeedError = exports.InvalidPrivateKeyError = exports.InvalidPhraseError = void 0; /** Thrown when a mnemonic phrase is invalid. */ class InvalidPhraseError extends Error { constructor(message) { super(message); this.name = 'InvalidPhraseError'; } } exports.InvalidPhraseError = InvalidPhraseError; /** Thrown when a private key has an invalid format. */ class InvalidPrivateKeyError extends Error { constructor(message) { super(message); this.name = 'InvalidPrivateKeyError'; } } exports.InvalidPrivateKeyError = InvalidPrivateKeyError; /** Thrown when a seed value is invalid. */ class InvalidSeedError extends Error { constructor(message) { super(message); this.name = 'InvalidSeedError'; } } exports.InvalidSeedError = InvalidSeedError; /** Thrown when a public key has an invalid format. */ class InvalidPublicKeyError extends Error { constructor(message) { super(message); this.name = 'InvalidPublicKeyError'; } } exports.InvalidPublicKeyError = InvalidPublicKeyError; /** Thrown when the user cancels the password prompt during decryption. */ class DecryptionCancelledError extends Error { constructor() { super('Decryption cancelled by user'); this.name = 'DecryptionCancelledError'; } } exports.DecryptionCancelledError = DecryptionCancelledError; /** Thrown when calling {@link Secret.getEncryptedExport} on a non-encrypted secret. */ class NotEncryptedError extends Error { constructor() { super('Secret is not encrypted'); this.name = 'NotEncryptedError'; } } exports.NotEncryptedError = NotEncryptedError; /** Thrown when attempting to encrypt a secret that is already encrypted. */ class AlreadyEncryptedError extends Error { constructor() { super('Already encrypted'); this.name = 'AlreadyEncryptedError'; } } exports.AlreadyEncryptedError = AlreadyEncryptedError; /** Thrown when accessing secret data while encrypted. Use {@link Secret.withDecrypted} instead. */ class EncryptedAccessError extends Error { constructor() { super('Cannot access secret data while encrypted. Use withDecrypted() to access it.'); this.name = 'EncryptedAccessError'; } } exports.EncryptedAccessError = EncryptedAccessError; /** Thrown when HD key derivation produces a null value for a required property. */ class HDKeyNullError extends Error { constructor(property) { super(`HDKey derivation produced null ${property}`); this.name = 'HDKeyNullError'; } } exports.HDKeyNullError = HDKeyNullError;