@ledgerhq/coin-hedera
Version:
Ledger Hedera Coin integration
100 lines • 4.2 kB
TypeScript
import type { OperationType } from "@ledgerhq/types-live";
import BigNumber from "bignumber.js";
/**
* Internal types to distinguish custom Hedera transaction behaviors.
* These can be used in transaction.mode and used to route specific preparation logic.
*/
export declare enum HEDERA_TRANSACTION_MODES {
Send = "send",
TokenAssociate = "token-associate",
Delegate = "delegate",
Undelegate = "undelegate",
Redelegate = "redelegate",
ClaimRewards = "claim-rewards"
}
/**
* Enum representing Hedera transaction names used in the Hedera Mirror Node API.
*/
export declare enum HEDERA_TRANSACTION_NAMES {
ContractCall = "CONTRACTCALL",
UpdateAccount = "CRYPTOUPDATEACCOUNT"
}
/**
* Enum representing the supported Hedera operation types for fee estimation
*/
export declare enum HEDERA_OPERATION_TYPES {
CryptoUpdate = "CryptoUpdate",
CryptoTransfer = "CryptoTransfer",
TokenTransfer = "TokenTransfer",
TokenAssociate = "TokenAssociate",
ContractCall = "ContractCall"
}
export declare const TINYBAR_SCALE = 8;
export declare const DEFAULT_TINYBAR_FEE = 150200;
export declare const SYNTHETIC_BLOCK_WINDOW_SECONDS = 10;
export declare const ERC20_TRANSFER_EVENT_TOPIC = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef";
export declare const ESTIMATED_GAS_SAFETY_RATE = 1.2;
export declare const ESTIMATED_FEE_SAFETY_RATE = 2;
export declare const DEFAULT_GAS_LIMIT: BigNumber;
export declare const DEFAULT_GAS_PRICE_TINYBARS: BigNumber;
export declare const HEDERA_MAINNET_CHAIN_ID = 295;
export declare const TRANSACTION_VALID_DURATION_SECONDS = 180;
export declare const HARDCODED_BLOCK_HEIGHT = 10;
/**
* On Hedera, transactions are not appended to a global chain of immutable blocks. Instead, each consensus node
* publishes its own transactions stream, and mirrornode publishes transactions data as it receives it from each
* consensus node. This leads to a changing transaction history on the window [now - delay of worst node, now].
* This delay has been empirically observed to be maximum 10 seconds (see BACK-10242).
*/
export declare const FINALITY_MS = 10000;
/**
* Enum representing the delegation status of a Hedera account
*/
export declare enum HEDERA_DELEGATION_STATUS {
Inactive = "inactive",
Overstaked = "overstaked",
Active = "active"
}
/**
* https://docs.hedera.com/hedera/networks/mainnet/fees
*
* These are Hedera's estimated fee costs in USD, scaled to tinybars (1 HBAR = 10^8 tinybars),
* so they can be converted into actual HBAR amounts based on current USD/crypto rates.
*
* Used in fee estimation logic (estimateFees function) to determine whether an account
* has sufficient balance to cover the cost of a transaction (e.g. token association).
*/
export declare const BASE_USD_FEE_BY_OPERATION_TYPE: {
readonly CryptoUpdate: number;
readonly CryptoTransfer: number;
readonly TokenTransfer: number;
readonly TokenAssociate: number;
readonly ContractCall: 0;
};
/**
* Array of supported ERC20 token IDs for Hedera.
*
* This is a temporary solution to allow bypassing deprecated methods.
* It is essential to update this list in the future to ensure support
* for other erc20 tokens.
*
* task that should remove this: https://ledgerhq.atlassian.net/browse/LIVE-24948
*/
export declare const SUPPORTED_ERC20_TOKENS: {
id: string;
contractAddress: string;
tokenId: string;
}[];
export declare const MAP_STAKING_MODE_TO_MEMO: Record<string, string>;
export declare const MAP_STAKING_MODE_TO_OPERATION_TYPE: Record<string, OperationType>;
export declare const MAP_STAKING_MODE_TO_METHOD: Record<string, string>;
/**
* Operation types where fees should be excluded from value of native HBAR operations.
*/
export declare const OP_TYPES_EXCLUDING_FEES: OperationType[];
/**
* Suffix used for staking reward Ledger operations to distinguish them from operations that trigger the rewards claim.
* Since staking rewards on Hedera are not represented as separate transactions, we need to create synthetic operations for them.
*/
export declare const STAKING_REWARD_HASH_SUFFIX = "-staking-reward";
//# sourceMappingURL=constants.d.ts.map