Skip to content

Commit

Permalink
chore: use Bech32Address.defaultBech32Config for cosmos chain configs
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrsoares committed Aug 15, 2023
1 parent aa1a962 commit 124917b
Show file tree
Hide file tree
Showing 21 changed files with 63 additions and 168 deletions.
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/acrechain.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -14,14 +16,7 @@ export const acrechain: CosmosChain = {
coinDecimals: 18,
coinGeckoId: "arable-protocol",
},
bech32Config: {
bech32PrefixAccAddr: "acre",
bech32PrefixAccPub: "acrepub",
bech32PrefixValAddr: "acrevaloper",
bech32PrefixValPub: "acrevaloperpub",
bech32PrefixConsAddr: "acrevalcons",
bech32PrefixConsPub: "acrevalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("acre"),
bip44: { coinType: 60 },
currencies: [
{
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/archway.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";

export const archway: CosmosChain = {
rest: "https://api.mainnet.archway.io",
rpc: `${COSMOS_PROXY_RPC_MAINNET}/chain/archway`,
bech32Config: {
bech32PrefixAccAddr: "archway",
bech32PrefixAccPub: "archwaypub",
bech32PrefixConsAddr: "archwayvalcons",
bech32PrefixConsPub: "archwayvalconspub",
bech32PrefixValAddr: "archwayvaloper",
bech32PrefixValPub: "archwayvaloperpub",
},
bech32Config: Bech32Address.defaultBech32Config("archway"),
bip44: {
coinType: 118,
},
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/assetmantle.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -13,14 +15,7 @@ export const assetmantle: CosmosChain = {
coinDecimals: 6,
coinGeckoId: "assetmantle",
},
bech32Config: {
bech32PrefixAccAddr: "mantle",
bech32PrefixAccPub: "mantlepub",
bech32PrefixValAddr: "mantlevaloper",
bech32PrefixValPub: "mantlevaloperpub",
bech32PrefixConsAddr: "mantlevalcons",
bech32PrefixConsPub: "mantlevalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("mantle"),
bip44: {
coinType: 118,
},
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/aura.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -10,14 +12,7 @@ export const aura: CosmosChain = {
bip44: {
coinType: 118,
},
bech32Config: {
bech32PrefixAccAddr: "aura",
bech32PrefixAccPub: "aura" + "pub",
bech32PrefixValAddr: "aura" + "valoper",
bech32PrefixValPub: "aura" + "valoperpub",
bech32PrefixConsAddr: "aura" + "valcons",
bech32PrefixConsPub: "aura" + "valconspub",
},
bech32Config: Bech32Address.defaultBech32Config("aura"),
currencies: [
{
coinDenom: "AURA",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/carbon.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -12,14 +14,7 @@ export const carbon: CosmosChain = {
bip44: {
coinType: 118,
},
bech32Config: {
bech32PrefixAccAddr: "swth",
bech32PrefixAccPub: "swthpub",
bech32PrefixValAddr: "swthvaloper",
bech32PrefixValPub: "swthvaloperpub",
bech32PrefixConsAddr: "swthvalcons",
bech32PrefixConsPub: "swthvalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("swth"),
currencies: [
{
coinDenom: "SWTH",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/crescent.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -12,14 +14,7 @@ export const crescent: CosmosChain = {
bip44: {
coinType: 118,
},
bech32Config: {
bech32PrefixAccAddr: "cre",
bech32PrefixAccPub: "crepub",
bech32PrefixValAddr: "crevaloper",
bech32PrefixValPub: "crevaloperpub",
bech32PrefixConsAddr: "crevalcons",
bech32PrefixConsPub: "crevalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("cre"),
currencies: [
{
coinDenom: "CRE",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -13,14 +15,7 @@ export const fetch: CosmosChain = {
coinDecimals: 18,
coinGeckoId: "fetch-ai",
},
bech32Config: {
bech32PrefixAccAddr: "fetch",
bech32PrefixAccPub: "fetchpub",
bech32PrefixValAddr: "fetchvaloper",
bech32PrefixValPub: "fetchvaloperpub",
bech32PrefixConsAddr: "fetchvalcons",
bech32PrefixConsPub: "fetchvalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("fetch"),
bip44: {
coinType: 118,
},
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/ixo.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -22,14 +24,7 @@ export const ixo: CosmosChain = {
bip44: {
coinType: 118,
},
bech32Config: {
bech32PrefixAccAddr: "ixo",
bech32PrefixAccPub: "ixopub",
bech32PrefixValAddr: "ixovaloper",
bech32PrefixValPub: "ixovaloperpub",
bech32PrefixConsAddr: "ixovalcons",
bech32PrefixConsPub: "ixovalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("ixo"),
currencies: [
{
coinDenom: "IXO",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/ki.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -13,14 +15,7 @@ export const ki: CosmosChain = {
coinDecimals: 6,
coinGeckoId: "ki",
},
bech32Config: {
bech32PrefixAccAddr: "ki",
bech32PrefixAccPub: "kipub",
bech32PrefixValAddr: "kivaloper",
bech32PrefixValPub: "kivaloperpub",
bech32PrefixConsAddr: "kivalcons",
bech32PrefixConsPub: "kivalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("ki"),
bip44: {
coinType: 118,
},
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/kujira.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -8,14 +10,7 @@ export const kujira: CosmosChain = {
rpc: `${COSMOS_PROXY_RPC_MAINNET}/chain/kujira`,
rest: "https://lcd.kaiyo.kujira.setten.io",
bip44: { coinType: 118 },
bech32Config: {
bech32PrefixAccAddr: "kujira",
bech32PrefixAccPub: "kujirapub",
bech32PrefixValAddr: "kujiravaloper",
bech32PrefixValPub: "kujiravaloperpub",
bech32PrefixConsAddr: "kujiravalcons",
bech32PrefixConsPub: "kujiravalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("kujira"),
currencies: [
{
coinDenom: "KUJI",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/neutron.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -11,14 +13,7 @@ export const neutron: CosmosChain = {
bip44: {
coinType: 118,
},
bech32Config: {
bech32PrefixAccAddr: "neutron",
bech32PrefixAccPub: "neutronpub",
bech32PrefixValAddr: "neutronvaloper",
bech32PrefixValPub: "neutronvaloperpub",
bech32PrefixConsAddr: "neutronvalcons",
bech32PrefixConsPub: "neutronvalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("neutron"),
currencies: [
{
coinDenom: "NTRN",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/mainnet/sei.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_MAINNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -9,14 +11,7 @@ export const sei: CosmosChain = {
rpc: `${COSMOS_PROXY_RPC_MAINNET}/chain/sei`,
rest: "https://sei-api.polkachu.com",
bip44: { coinType: 118 },
bech32Config: {
bech32PrefixAccAddr: "sei",
bech32PrefixAccPub: "seipub",
bech32PrefixValAddr: "seivaloper",
bech32PrefixValPub: "seivaloperpub",
bech32PrefixConsAddr: "seivalcons",
bech32PrefixConsPub: "seivalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("sei"),
currencies: [{ coinDenom: "SEI", coinMinimalDenom: "usei", coinDecimals: 6 }],
feeCurrencies: [
{ coinDenom: "SEI", coinMinimalDenom: "usei", coinDecimals: 6 },
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/testnet/acrechain.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_TESTNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -14,14 +16,7 @@ export const acrechain: CosmosChain = {
coinDecimals: 18,
coinGeckoId: "unknown",
},
bech32Config: {
bech32PrefixAccAddr: "acre",
bech32PrefixAccPub: "acrepub",
bech32PrefixValAddr: "acrevaloper",
bech32PrefixValPub: "acrevaloperpub",
bech32PrefixConsAddr: "acrevalcons",
bech32PrefixConsPub: "acrevalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("acre"),
bip44: { coinType: 60 },
currencies: [
{
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/testnet/aura.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_TESTNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -10,14 +12,7 @@ export const aura: CosmosChain = {
bip44: {
coinType: 118,
},
bech32Config: {
bech32PrefixAccAddr: "aura",
bech32PrefixAccPub: "aura" + "pub",
bech32PrefixValAddr: "aura" + "valoper",
bech32PrefixValPub: "aura" + "valoperpub",
bech32PrefixConsAddr: "aura" + "valcons",
bech32PrefixConsPub: "aura" + "valconspub",
},
bech32Config: Bech32Address.defaultBech32Config("aura"),
currencies: [
{
coinDenom: "EAURA",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/testnet/comdex.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_TESTNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -14,14 +16,7 @@ export const comdex: CosmosChain = {
coinDecimals: 6,
coinGeckoId: "cmdx",
},
bech32Config: {
bech32PrefixAccAddr: "comdex",
bech32PrefixAccPub: "comdexpub",
bech32PrefixValAddr: "comdexvaloper",
bech32PrefixValPub: "comdexvaloperpub",
bech32PrefixConsAddr: "comdexvalcons",
bech32PrefixConsPub: "comdexvalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("comdex"),
bip44: {
coinType: 118,
},
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/testnet/cosmoshub.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_TESTNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -11,14 +13,7 @@ export const cosmoshub: CosmosChain = {
bip44: {
coinType: 118,
},
bech32Config: {
bech32PrefixAccAddr: "cosmos",
bech32PrefixAccPub: "cosmospub",
bech32PrefixValAddr: "cosmosvaloper",
bech32PrefixValPub: "cosmosvaloperpub",
bech32PrefixConsAddr: "cosmosvalcons",
bech32PrefixConsPub: "cosmosvalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("cosmos"),
currencies: [
{
coinDenom: "ATOM",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/testnet/crescent.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_TESTNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -11,14 +13,7 @@ export const crescent: CosmosChain = {
bip44: {
coinType: 118,
},
bech32Config: {
bech32PrefixAccAddr: "cre",
bech32PrefixAccPub: "crepub",
bech32PrefixValAddr: "crevaloper",
bech32PrefixValPub: "crevaloperpub",
bech32PrefixConsAddr: "crevalcons",
bech32PrefixConsPub: "crevalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("cre"),
currencies: [
{
coinDenom: "CRE",
Expand Down
11 changes: 3 additions & 8 deletions src/config/web3/cosmos/testnet/evmos.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Bech32Address } from "@keplr-wallet/cosmos";

import { COSMOS_PROXY_RPC_TESTNET } from "~/config/constants";

import { CosmosChain } from "../interface";
Expand All @@ -13,14 +15,7 @@ export const evmos: CosmosChain = {
coinDecimals: 18,
coinGeckoId: "evmos",
},
bech32Config: {
bech32PrefixAccAddr: "evmos",
bech32PrefixAccPub: "evmospub",
bech32PrefixValAddr: "evmosvaloper",
bech32PrefixValPub: "evmosvaloperpub",
bech32PrefixConsAddr: "evmosvalcons",
bech32PrefixConsPub: "evmosvalconspub",
},
bech32Config: Bech32Address.defaultBech32Config("evmos"),
bip44: {
coinType: 118,
},
Expand Down
Loading

0 comments on commit 124917b

Please sign in to comment.