Skip to content

Commit

Permalink
Merge pull request #122 from XLabs/sepolia-support
Browse files Browse the repository at this point in the history
Sepolia support
  • Loading branch information
solanoepalacio authored Dec 4, 2023
2 parents b386051 + 3c0070a commit cd42cf2
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 62 deletions.
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/price-assistant/supported-tokens.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const coinGeckoIdByChainName = {
"cosmoshub": "cosmos",
"evmos": "evmos",
"kujira": "kujira",
"gateway": "gateway"
"wormchain": "gateway"
} as const satisfies Record<ChainName, CoinGeckoIds>;

const mainnetNativeTokens = [
Expand Down
53 changes: 0 additions & 53 deletions src/wallets/cosmos/gateway.config.ts

This file was deleted.

14 changes: 7 additions & 7 deletions src/wallets/cosmos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -46,7 +46,7 @@ const COSMOS_CHAINS = {
[COSMOSHUB]: 2,
[EVMOS]: 3,
[KUJIRA]: 4,
[GATEWAY]: 5,
[WORMCHAIN]: 5,
};

export type CosmosDefaultConfig = {
Expand All @@ -69,7 +69,7 @@ export const COSMOS_CHAIN_CONFIGS: Record<CosmosChainName, CosmosChainConfig> =
[COSMOSHUB]: COSMOSHUB_CHAIN_CONFIG,
[EVMOS]: EVMOS_CHAIN_CONFIG,
[KUJIRA]: KUJIRA_CHAIN_CONFIG,
[GATEWAY]: GATEWAY_CHAIN_CONFIG,
[WORMCHAIN]: WORMCHAIN_CHAIN_CONFIG,
};

export type CosmosWalletOptions = BaseWalletOptions & {
Expand All @@ -85,7 +85,7 @@ export type CosmosNetworks =
| CosmoshubNetwork
| EvmosNetwork
| KujiraNetwork
| GatewayNetwork;
| WormchainNetwork;

export class CosmosWalletToolbox extends WalletToolbox {
private provider: CosmosProvider | null;
Expand Down
53 changes: 53 additions & 0 deletions src/wallets/cosmos/wormchain.config.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit cd42cf2

Please sign in to comment.