Skip to content

Commit

Permalink
add archway support
Browse files Browse the repository at this point in the history
  • Loading branch information
simke9445 committed Mar 28, 2024
1 parent 83eedc0 commit 94add93
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config.archway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"NETWORK": "mainnet",
"CHAIN": "archway",
"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 @@ -29,6 +29,7 @@
"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",
"bot-archway": "esbuild src/bot.ts --bundle --platform=node --outdir=dist --outbase=src && node ./dist/bot.js ./config.archway.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
29 changes: 28 additions & 1 deletion src/modules/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ 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 refsArchway from '../refs.archway.json';
import { LCDClient, LCDClientConfig } from '@terra-money/feather.js';

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

interface ContractDefinition {
Expand Down Expand Up @@ -85,6 +86,13 @@ const mainnetConfig: Record<string, LCDClientConfig> = {
gasPrices: { uosmo: 0.025 },
prefix: 'osmo',
},
'archway-1': {
chainID: 'archway-1',
lcd: 'https://lcd-archway.tfl.foundation',
gasAdjustment: 1.75,
gasPrices: { aarch: 1500000000000 },
prefix: 'archway',
},
};

const testnetConfig: Record<string, LCDClientConfig> = {
Expand Down Expand Up @@ -138,6 +146,15 @@ const testnetConfig: Record<string, LCDClientConfig> = {
gasPrices: { uosmo: 0.025 },
prefix: 'osmo',
},
'constantine-3': {
chainID: 'constantine-3',
lcd: 'https://api.constantine.archway.tech',
gasAdjustment: 1.75,
gasPrices: {
aconst: 196000000000,
},
prefix: 'archway',
},
};

export const TERRA_CHAIN: ChainMetadata = {
Expand Down Expand Up @@ -194,13 +211,23 @@ export const OSMOSIS_CHAIN: ChainMetadata = {
refs: refsOsmosis,
};

export const ARCHWAY_CHAIN: ChainMetadata = {
name: 'archway',
testnet: 'constantine-3',
testnetConfig: testnetConfig['constantine-3'],
mainnet: 'archway-1',
mainnetConfig: mainnetConfig['archway-1'],
refs: refsArchway,
};

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

export interface ContractAddresses {
Expand Down
38 changes: 38 additions & 0 deletions src/refs.archway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"testnet": {
"warp-controller": {
"codeId": "2285",
"address": "archway1zkys84a53r2py9ujq6vretlrrxc2k8hvfpnrc2zt8hynnmfwwteq0glgnt"
},
"warp-resolver": {
"codeId": "2283",
"address": "archway1k2j07hjmhz6c9gvfpdceryher3323r4m5mu652e6yn9sqqncxgssgadzc7"
},
"warp-templates": {
"codeId": "2284",
"address": "archway12ul8qkannf0t6q4xxpew2ea58nn9h3zy28m7zn0v5dz5azusyllqclnuuv"
},
"warp-account-tracker": {
"codeId": "2286",
"address": "archway13g8s0atspgt7glwdpajpn47a35e3amy44y9fqqhd8f7sdl0alx0sv4kz5f"
}
},
"mainnet": {
"warp-controller": {
"codeId": "2285",
"address": "archway1zkys84a53r2py9ujq6vretlrrxc2k8hvfpnrc2zt8hynnmfwwteq0glgnt"
},
"warp-resolver": {
"codeId": "2283",
"address": "archway1k2j07hjmhz6c9gvfpdceryher3323r4m5mu652e6yn9sqqncxgssgadzc7"
},
"warp-templates": {
"codeId": "2284",
"address": "archway12ul8qkannf0t6q4xxpew2ea58nn9h3zy28m7zn0v5dz5azusyllqclnuuv"
},
"warp-account-tracker": {
"codeId": "2286",
"address": "archway13g8s0atspgt7glwdpajpn47a35e3amy44y9fqqhd8f7sdl0alx0sv4kz5f"
}
}
}

0 comments on commit 94add93

Please sign in to comment.