diff --git a/package-lock.json b/package-lock.json index cdf3558..1df3272 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6161,6 +6161,7 @@ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.5.tgz", "integrity": "sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==", "dev": true, + "hasInstallScript": true, "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -6518,6 +6519,7 @@ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.7.tgz", "integrity": "sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==", "dev": true, + "hasInstallScript": true, "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" diff --git a/package.json b/package.json index edcbe39..cc74787 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xlabs-xyz/wallet-monitor", - "version": "0.2.26", + "version": "0.2.27", "description": "A set of utilities to monitor blockchain wallets and react to them", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/price-assistant/supported-tokens.config.ts b/src/price-assistant/supported-tokens.config.ts index 298c0f5..f4166ba 100644 --- a/src/price-assistant/supported-tokens.config.ts +++ b/src/price-assistant/supported-tokens.config.ts @@ -53,7 +53,7 @@ export const coinGeckoIdByChainName = { "cosmoshub": "cosmos", "evmos": "evmos", "kujira": "kujira", - "gateway": "gateway" + "wormchain": "gateway" } as const satisfies Record; const mainnetNativeTokens = [ diff --git a/src/wallets/cosmos/gateway.config.ts b/src/wallets/cosmos/gateway.config.ts deleted file mode 100644 index e970514..0000000 --- a/src/wallets/cosmos/gateway.config.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { CosmosDefaultConfigs } from "."; - -const GATEWAY_MAINNET = "wormchain-mainnet-0"; -const GATEWAY_TESTNET = "wormchain-testnet-0"; -const GATEWAY_CURRENCY_SYMBOL = "WORM"; -const GATEWAY_NATIVE_DENOM = "uworm"; -const GATEWAY_ADDRESS_PREFIX = "wormhole"; -const GATEWAY_DEFAULT_DECIMALS = 6; - -const GATEWAY_MIN_GAS_PRICE = "0utest"; - -export const GATEWAY = "gateway"; -export const GATEWAY_NETWORKS = { - [GATEWAY_MAINNET]: 1, - [GATEWAY_TESTNET]: 2, -}; - -export const GATEWAY_KNOWN_TOKENS = { - [GATEWAY_MAINNET]: {}, - [GATEWAY_TESTNET]: {}, -}; - -const GATEWAY_DEFAULT_TOKEN_POLL_CONCURRENCY = 10; - -export const GATEWAY_DEFAULT_CONFIGS: CosmosDefaultConfigs = { - [GATEWAY_MAINNET]: { - nodeUrl: "https://wormchain-mainnet.jumpisolated.com:443", - tokenPollConcurrency: GATEWAY_DEFAULT_TOKEN_POLL_CONCURRENCY, - nativeDenom: GATEWAY_NATIVE_DENOM, - addressPrefix: GATEWAY_ADDRESS_PREFIX, - defaultDecimals: GATEWAY_DEFAULT_DECIMALS, - minGasPrice: GATEWAY_MIN_GAS_PRICE, - }, - [GATEWAY_TESTNET]: { - nodeUrl: "https://wormchain-testnet.jumpisolated.com:443", - tokenPollConcurrency: GATEWAY_DEFAULT_TOKEN_POLL_CONCURRENCY, - nativeDenom: GATEWAY_NATIVE_DENOM, - addressPrefix: GATEWAY_ADDRESS_PREFIX, - defaultDecimals: GATEWAY_DEFAULT_DECIMALS, - minGasPrice: GATEWAY_MIN_GAS_PRICE, - }, -}; - -export const GATEWAY_CHAIN_CONFIG = { - chainName: GATEWAY, - networks: GATEWAY_NETWORKS, - knownTokens: GATEWAY_KNOWN_TOKENS, - defaultConfigs: GATEWAY_DEFAULT_CONFIGS, - nativeCurrencySymbol: GATEWAY_CURRENCY_SYMBOL, - defaultNetwork: GATEWAY_MAINNET, -}; - -export type GatewayNetwork = keyof typeof GATEWAY_NETWORKS; diff --git a/src/wallets/cosmos/index.ts b/src/wallets/cosmos/index.ts index 9a492c7..3339b76 100644 --- a/src/wallets/cosmos/index.ts +++ b/src/wallets/cosmos/index.ts @@ -27,10 +27,10 @@ import { import { EVMOS, EVMOS_CHAIN_CONFIG, EvmosNetwork } from "./evmos.config"; import { KUJIRA, KUJIRA_CHAIN_CONFIG, KujiraNetwork } from "./kujira.config"; import { - GATEWAY, - GATEWAY_CHAIN_CONFIG, - GatewayNetwork, -} from "./gateway.config"; + WORMCHAIN, + WORMCHAIN_CHAIN_CONFIG, + WormchainNetwork, +} from "./wormchain.config"; export type CosmosChainConfig = { chainName: string; @@ -46,7 +46,7 @@ const COSMOS_CHAINS = { [COSMOSHUB]: 2, [EVMOS]: 3, [KUJIRA]: 4, - [GATEWAY]: 5, + [WORMCHAIN]: 5, }; export type CosmosDefaultConfig = { @@ -69,7 +69,7 @@ export const COSMOS_CHAIN_CONFIGS: Record = [COSMOSHUB]: COSMOSHUB_CHAIN_CONFIG, [EVMOS]: EVMOS_CHAIN_CONFIG, [KUJIRA]: KUJIRA_CHAIN_CONFIG, - [GATEWAY]: GATEWAY_CHAIN_CONFIG, + [WORMCHAIN]: WORMCHAIN_CHAIN_CONFIG, }; export type CosmosWalletOptions = BaseWalletOptions & { @@ -85,7 +85,7 @@ export type CosmosNetworks = | CosmoshubNetwork | EvmosNetwork | KujiraNetwork - | GatewayNetwork; + | WormchainNetwork; export class CosmosWalletToolbox extends WalletToolbox { private provider: CosmosProvider | null; diff --git a/src/wallets/cosmos/wormchain.config.ts b/src/wallets/cosmos/wormchain.config.ts new file mode 100644 index 0000000..17d59f4 --- /dev/null +++ b/src/wallets/cosmos/wormchain.config.ts @@ -0,0 +1,53 @@ +import { CosmosDefaultConfigs } from "."; + +const WORMCHAIN_MAINNET = "wormchain-mainnet-0"; +const WORMCHAIN_TESTNET = "wormchain-testnet-0"; +const WORMCHAIN_CURRENCY_SYMBOL = "WORM"; +const WORMCHAIN_NATIVE_DENOM = "uworm"; +const WORMCHAIN_ADDRESS_PREFIX = "wormhole"; +const WORMCHAIN_DEFAULT_DECIMALS = 6; + +const WORMCHAIN_MIN_GAS_PRICE = "0utest"; + +export const WORMCHAIN = "wormchain"; +export const WORMCHAIN_NETWORKS = { + [WORMCHAIN_MAINNET]: 1, + [WORMCHAIN_TESTNET]: 2, +}; + +export const WORMCHAIN_KNOWN_TOKENS = { + [WORMCHAIN_MAINNET]: {}, + [WORMCHAIN_TESTNET]: {}, +}; + +const WORMCHAIN_DEFAULT_TOKEN_POLL_CONCURRENCY = 10; + +export const WORMCHAIN_DEFAULT_CONFIGS: CosmosDefaultConfigs = { + [WORMCHAIN_MAINNET]: { + nodeUrl: "https://wormchain-mainnet.jumpisolated.com:443", + tokenPollConcurrency: WORMCHAIN_DEFAULT_TOKEN_POLL_CONCURRENCY, + nativeDenom: WORMCHAIN_NATIVE_DENOM, + addressPrefix: WORMCHAIN_ADDRESS_PREFIX, + defaultDecimals: WORMCHAIN_DEFAULT_DECIMALS, + minGasPrice: WORMCHAIN_MIN_GAS_PRICE, + }, + [WORMCHAIN_TESTNET]: { + nodeUrl: "https://wormchain-testnet.jumpisolated.com:443", + tokenPollConcurrency: WORMCHAIN_DEFAULT_TOKEN_POLL_CONCURRENCY, + nativeDenom: WORMCHAIN_NATIVE_DENOM, + addressPrefix: WORMCHAIN_ADDRESS_PREFIX, + defaultDecimals: WORMCHAIN_DEFAULT_DECIMALS, + minGasPrice: WORMCHAIN_MIN_GAS_PRICE, + }, +}; + +export const WORMCHAIN_CHAIN_CONFIG = { + chainName: WORMCHAIN, + networks: WORMCHAIN_NETWORKS, + knownTokens: WORMCHAIN_KNOWN_TOKENS, + defaultConfigs: WORMCHAIN_DEFAULT_CONFIGS, + nativeCurrencySymbol: WORMCHAIN_CURRENCY_SYMBOL, + defaultNetwork: WORMCHAIN_MAINNET, +}; + +export type WormchainNetwork = keyof typeof WORMCHAIN_NETWORKS;