@ledgerhq/coin-tezos
Version:
30 lines • 1.23 kB
JavaScript
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
// SPDX-License-Identifier: Apache-2.0
/**
* True for account *types* that own a manager key and therefore carry the `revealed`,
* `publicKey`, `counter`, and `balance` fields: plain wallets (`user`) and registered bakers
* (`delegate`). This narrows on the account type, not on whether the key is already published —
* it returns true for unrevealed `user` accounts too (check `revealed` separately for that).
* `empty` accounts (and the non-manager `contract` / `ghost` / `rollup` types we don't model)
* do not qualify. Use this instead of a bare `type === "user"` check so baker accounts aren't
* mistaken for non-manager ones.
*/
export function hasManagerKey(account) {
return account.type === 'user' || account.type === 'delegate';
}
export function isAPITransactionType(op) {
return op.type === 'transaction';
}
export function isAPIDelegationType(op) {
return op.type === 'delegation';
}
export function isAPIRevealType(op) {
return op.type === 'reveal';
}
export function isAPIStakingType(op) {
return op.type === 'staking';
}
export function isAPIOriginationType(op) {
return op.type === 'origination';
}
//# sourceMappingURL=types.js.map