@hyperlane-xyz/utils
Version:
General utilities and types for the Hyperlane network
38 lines • 1.52 kB
JavaScript
export var ProtocolType;
(function (ProtocolType) {
ProtocolType["Ethereum"] = "ethereum";
ProtocolType["Sealevel"] = "sealevel";
ProtocolType["Cosmos"] = "cosmos";
ProtocolType["CosmosNative"] = "cosmosnative";
ProtocolType["Starknet"] = "starknet";
ProtocolType["Radix"] = "radix";
ProtocolType["Aleo"] = "aleo";
ProtocolType["Tron"] = "tron";
ProtocolType["Unknown"] = "unknown";
})(ProtocolType || (ProtocolType = {}));
export function isEVMLike(protocol) {
return protocol === ProtocolType.Ethereum || protocol === ProtocolType.Tron;
}
export const ProtocolSmallestUnit = {
[ProtocolType.Ethereum]: 'wei',
[ProtocolType.Sealevel]: 'lamports',
[ProtocolType.Cosmos]: 'uATOM',
[ProtocolType.CosmosNative]: 'uATOM',
[ProtocolType.Starknet]: 'fri',
[ProtocolType.Radix]: 'attos',
[ProtocolType.Aleo]: 'microcredits',
[ProtocolType.Tron]: 'SUN',
[ProtocolType.Unknown]: 'unknown',
};
export var MessageStatus;
(function (MessageStatus) {
MessageStatus[MessageStatus["NONE"] = 0] = "NONE";
MessageStatus[MessageStatus["PROCESSED"] = 1] = "PROCESSED";
})(MessageStatus || (MessageStatus = {}));
/** The URL hash of a `ValidatorMetadata.rpcs` entry, regardless of which of the
* two historical wire shapes (bare hash string, or `{ url_hash, host_hash }`)
* it was serialized in. */
export function validatorMetadataRpcUrlHash(entry) {
return typeof entry === 'string' ? entry : entry.url_hash;
}
//# sourceMappingURL=types.js.map