@ledgerhq/coin-tezos
Version:
58 lines • 2.14 kB
JavaScript
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
// SPDX-License-Identifier: Apache-2.0
export class NotEnoughBalanceToDelegate extends Error {
name = 'NotEnoughBalanceToDelegate';
constructor(message) {
super(message || 'NotEnoughBalanceToDelegate');
}
}
export class InvalidAddressBecauseAlreadyDelegated extends Error {
name = 'InvalidAddressBecauseAlreadyDelegated';
constructor(message, fields) {
super(message || 'InvalidAddressBecauseAlreadyDelegated');
if (fields)
Object.assign(this, fields);
}
}
export class UnsupportedTransactionMode extends Error {
name = 'UnsupportedTransactionMode';
constructor(message, fields) {
super(message || 'UnsupportedTransactionMode');
if (fields)
Object.assign(this, fields);
}
}
export class UnsupportedOperationKind extends Error {
name = 'UnsupportedOperationKind';
constructor(message, fields) {
super(message || 'UnsupportedOperationKind');
if (fields)
Object.assign(this, fields);
}
}
export class MustDelegateBeforeStaking extends Error {
name = 'MustDelegateBeforeStaking';
constructor(message, fields) {
super(message || 'MustDelegateBeforeStaking');
if (fields)
Object.assign(this, fields);
}
}
export class TezosNotEnoughStaked extends Error {
name = 'TezosNotEnoughStaked';
constructor(message, fields) {
super(message || 'TezosNotEnoughStaked');
if (fields)
Object.assign(this, fields);
}
}
// Staking with a new delegate is rejected by the protocol while an unfinalizable unstake request
// to the previous delegate still exists (~4-day freeze). Surfaced during stake fee estimation.
// Display is i18n-driven (via error.name); the message is a fallback for logs.
export class TezosStakeBlockedByPendingUnstake extends Error {
constructor() {
super('Cannot stake with the new validator while an unfinalizable unstake to the previous one is pending');
this.name = 'TezosStakeBlockedByPendingUnstake';
}
}
//# sourceMappingURL=errors.js.map