Skip to content

Commit

Permalink
add osmosis to supported chains
Browse files Browse the repository at this point in the history
  • Loading branch information
simke9445 committed Mar 12, 2024
1 parent c6dd84e commit 28e165d
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config.osmosis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"NETWORK": "mainnet",
"CHAIN": "osmosis",
"MNEMONIC_KEY": "notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius",
"COIN_TYPE": 118
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"bot-neutron": "esbuild src/bot.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/bot.js ./config.neutron.json",
"bot-injective": "esbuild src/bot.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/bot.js ./config.injective.json",
"bot-nibiru": "esbuild src/bot.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/bot.js ./config.nibiru.json",
"bot-osmosis": "esbuild src/bot.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/bot.js ./config.osmosis.json",
"generate-dts": "dts-bundle-generator -o types.d.ts src/index.ts",
"example-mito": "esbuild src/examples/example_mito.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/examples/example_mito.js ./config.injective.json",
"format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
Expand Down
27 changes: 26 additions & 1 deletion src/modules/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import refsInjective from '../refs.injective.json';
import refsNeutron from '../refs.neutron.json';
import refsNibiru from '../refs.nibiru.json';
import refsMigaloo from '../refs.migaloo.json';
import refsOsmosis from '../refs.osmosis.json';
import { LCDClient, LCDClientConfig } from '@terra-money/feather.js';

export type ChainName = 'terra' | 'injective' | 'neutron' | 'nibiru' | 'migaloo';
export type ChainName = 'terra' | 'injective' | 'neutron' | 'nibiru' | 'migaloo' | 'osmosis';
export type NetworkName = 'testnet' | 'mainnet';

interface ContractDefinition {
Expand Down Expand Up @@ -77,6 +78,13 @@ const mainnetConfig: Record<string, LCDClientConfig> = {
},
prefix: 'migaloo',
},
'osmosis-1': {
chainID: 'osmosis-1',
lcd: 'https://lcd-osmosis.tfl.foundation',
gasAdjustment: 1.5,
gasPrices: { uosmo: 0.025 },
prefix: 'osmo',
},
};

const testnetConfig: Record<string, LCDClientConfig> = {
Expand Down Expand Up @@ -123,6 +131,13 @@ const testnetConfig: Record<string, LCDClientConfig> = {
},
prefix: 'migaloo',
},
'osmo-test-5': {
chainID: 'osmo-test-5',
lcd: 'https://lcd.osmotest5.osmosis.zone',
gasAdjustment: 1.5,
gasPrices: { uosmo: 0.025 },
prefix: 'osmo',
},
};

export const TERRA_CHAIN: ChainMetadata = {
Expand Down Expand Up @@ -170,12 +185,22 @@ export const MIGALOO_CHAIN: ChainMetadata = {
refs: refsMigaloo,
};

export const OSMOSIS_CHAIN: ChainMetadata = {
name: 'osmosis',
testnet: 'osmo-test-5',
testnetConfig: testnetConfig['osmo-test-5'],
mainnet: 'osmosis-1',
mainnetConfig: mainnetConfig['osmosis-1'],
refs: refsOsmosis,
};

export const SUPPORTED_CHAINS: ChainMetadata[] = [
TERRA_CHAIN,
INJECTIVE_CHAIN,
NEUTRON_CHAIN,
NIBIRU_CHAIN,
MIGALOO_CHAIN,
OSMOSIS_CHAIN,
];

export interface ContractAddresses {
Expand Down
38 changes: 38 additions & 0 deletions src/refs.osmosis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"testnet": {
"warp-controller": {
"codeId": "585",
"address": "osmo1ckw5cf9saj6cg83jcqw8vxvjp2kcnrn8qdw8gwgxwv0n50umemmsntpfhs"
},
"warp-resolver": {
"codeId": "586",
"address": "osmo19avh24whtxaqrvagkhh3ck270gpsql37m522sx33ykkll43mv9fqxa2xm9"
},
"warp-templates": {
"codeId": "587",
"address": "osmo173vt7uu92ycn4vtj5fk3n9mw7rrtdd9nhf8m5ump53uxj3q9czss4qc8km"
},
"warp-account-tracker": {
"codeId": "584",
"address": "osmo1g02vtmy60p9w9r9q96m8jf996c4shxzc0q7qqna6ectkamr7zzfszqqkqd"
}
},
"mainnet": {
"warp-controller": {
"codeId": "585",
"address": "osmo1ckw5cf9saj6cg83jcqw8vxvjp2kcnrn8qdw8gwgxwv0n50umemmsntpfhs"
},
"warp-resolver": {
"codeId": "586",
"address": "osmo19avh24whtxaqrvagkhh3ck270gpsql37m522sx33ykkll43mv9fqxa2xm9"
},
"warp-templates": {
"codeId": "587",
"address": "osmo173vt7uu92ycn4vtj5fk3n9mw7rrtdd9nhf8m5ump53uxj3q9czss4qc8km"
},
"warp-account-tracker": {
"codeId": "584",
"address": "osmo1g02vtmy60p9w9r9q96m8jf996c4shxzc0q7qqna6ectkamr7zzfszqqkqd"
}
}
}

0 comments on commit 28e165d

Please sign in to comment.