Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 10/28/24-1 #41

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,21 @@ just web build
```sh
touch web/src/config/chainConfigs/ChainConfigsMainnet.ts
```
* update logic in `getIbcChains` and `getEvmChains`. add new condition to
check for the new environment and use the correct config
* import new configs in
`astria-bridge-web-app/web/src/config/chainConfigs/index.ts`, while renaming
them
```typescript
if (getEnvVariable("REACT_APP_ENV") === "mainnet") {
return mainnetIbcChains;
}
import {
evmChains as mainnetEvmChains,
ibcChains as mainnetIbcChains,
} from "./ChainConfigsMainnet";
```
* add entry to `EVM_CHAIN_CONFIGS`
```typescript
const ENV_CHAIN_CONFIGS = {
local: { evm: localEvmChains, ibc: localIbcChains },
dusk: { evm: duskEvmChains, ibc: duskIbcChains },
dawn: { evm: dawnEvmChains, ibc: dawnIbcChains },
mainnet: { evm: mainnetEvmChains, ibc: mainnetIbcChains },
} as const;
```
2 changes: 2 additions & 0 deletions web/src/components/WithdrawCard/WithdrawCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ export default function WithdrawCard(): React.ReactElement {
fromAddress,
recipientAddress,
amount,
selectedEvmCurrency.coinDecimals,
selectedEvmCurrency.ibcWithdrawalFeeWei,
"",
);
addNotification({
Expand Down
4 changes: 3 additions & 1 deletion web/src/config/chainConfigs/ChainConfigsDawn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EvmChainInfo, EvmChains, IbcChainInfo, IbcChains } from ".";
import type { EvmChainInfo, EvmChains, IbcChainInfo, IbcChains } from "./types";

const CelestiaChainInfo: IbcChainInfo = {
// Chain-id of the celestia chain.
Expand Down Expand Up @@ -194,13 +194,15 @@ const FlameChainInfo: EvmChainInfo = {
coinDecimals: 18,
nativeTokenWithdrawerContractAddress:
"0x77Af806d724699B3644F9CCBFD45CC999CCC3d49",
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-celestia",
},
{
coinDenom: "USDC",
coinMinimalDenom: "uusdc",
coinDecimals: 18,
erc20ContractAddress: "0x6e18cE6Ec3Fc7b8E3EcFca4fA35e25F3f6FA879a",
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-noble",
},
],
Expand Down
7 changes: 5 additions & 2 deletions web/src/config/chainConfigs/ChainConfigsDusk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EvmChainInfo, EvmChains, IbcChainInfo, IbcChains } from ".";
import type { EvmChainInfo, EvmChains, IbcChainInfo, IbcChains } from "./types";

const CelestiaChainInfo: IbcChainInfo = {
// Chain-id of the celestia chain.
Expand Down Expand Up @@ -192,17 +192,19 @@ const FlameChainInfo: EvmChainInfo = {
coinDenom: "RIA",
coinMinimalDenom: "uria",
coinDecimals: 18,
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-celestia",
},
{
coinDenom: "USDC",
coinMinimalDenom: "uusdc",
coinDecimals: 18,
iconClass: "i-noble",
// address of erc20 contract on dusk-11
erc20ContractAddress: "0xa4f59B3E97EC22a2b949cB5b6E8Cd6135437E857",
// this value would only exist for native tokens
nativeTokenWithdrawerContractAddress: "",
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-noble",
},
{
coinDenom: "fakeTIA",
Expand All @@ -212,6 +214,7 @@ const FlameChainInfo: EvmChainInfo = {
// just using this for testing the UI.
erc20ContractAddress: "0xFc83F6A786728F448481B7D7d5C0659A92a62C4d",
nativeTokenWithdrawerContractAddress: "",
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-celestia",
},
],
Expand Down
8 changes: 6 additions & 2 deletions web/src/config/chainConfigs/ChainConfigsLocal.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { EvmChainInfo, EvmChains, IbcChainInfo, IbcChains } from ".";
import type { EvmChainInfo, EvmChains, IbcChainInfo, IbcChains } from "./types";

const CelestiaChainInfo: IbcChainInfo = {
// Chain-id of the celestia chain.
chainId: "celestia-local-0",
// The name of the chain to be displayed to the user.
chainName: "celestia-local-0",
chainName: "Celestia Local",
// RPC endpoint of the chain
rpc: "http://rpc.app.celestia.localdev.me",
// REST endpoint of the chain.
Expand Down Expand Up @@ -185,6 +185,7 @@ const FlameChainInfo: EvmChainInfo = {
coinDenom: "RIA",
coinMinimalDenom: "uria",
coinDecimals: 18,
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-celestia",
},
{
Expand All @@ -193,6 +194,7 @@ const FlameChainInfo: EvmChainInfo = {
coinDecimals: 6,
nativeTokenWithdrawerContractAddress:
"0xA58639fB5458e65E4fA917FF951C390292C24A15",
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-celestia",
},
],
Expand All @@ -207,6 +209,7 @@ const FakeChainInfo: EvmChainInfo = {
coinDenom: "FAKE",
coinMinimalDenom: "ufake",
coinDecimals: 18,
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-celestia",
},
{
Expand All @@ -216,6 +219,7 @@ const FakeChainInfo: EvmChainInfo = {
// fake address here so it shows up in the currency dropdown
nativeTokenWithdrawerContractAddress:
"0x0000000000000000000000000000000000000000",
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-flame",
},
],
Expand Down
200 changes: 200 additions & 0 deletions web/src/config/chainConfigs/ChainConfigsMainnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
import type { EvmChainInfo, EvmChains, IbcChainInfo, IbcChains } from "./types";

const CelestiaChainInfo: IbcChainInfo = {
// Chain-id of the celestia chain.
chainId: "celestia",
// The name of the chain to be displayed to the user.
chainName: "Celestia",
// RPC endpoint of the chain
rpc: "wss://rpc.celestia.pops.one",
// REST endpoint of the chain.
rest: "https://api.celestia.pops.one",
// Staking coin information
stakeCurrency: {
// Coin denomination to be displayed to the user.
coinDenom: "TIA",
// Actual denom (i.e. uatom, uscrt) used by the blockchain.
coinMinimalDenom: "utia",
// # of decimal points to convert minimal denomination to user-facing denomination.
coinDecimals: 6,
// (Optional) Keplr can show the fiat value of the coin if a coingecko id is provided.
// You can get id from https://api.coingecko.com/api/v3/coins/list if it is listed.
// coinGeckoId: ""
},
// (Optional) If you have a wallet webpage used to stake the coin then provide the url to the website in `walletUrlForStaking`.
// The 'stake' button in Keplr extension will link to the webpage.
// walletUrlForStaking: "",
// The BIP44 path.
bip44: {
// You can only set the coin type of BIP44.
// 'Purpose' is fixed to 44.
coinType: 118,
},
// The address prefix of the chain.
bech32Config: {
bech32PrefixAccAddr: "celestia",
bech32PrefixAccPub: "celestiapub",
bech32PrefixConsAddr: "celestiavalcons",
bech32PrefixConsPub: "celestiavalconspub",
bech32PrefixValAddr: "celestiavaloper",
bech32PrefixValPub: "celestiavaloperpub",
},
// List of all coin/tokens used in this chain.
currencies: [
{
// Coin denomination to be displayed to the user.
coinDenom: "TIA",
// Actual denom (i.e. uatom, uscrt) used by the blockchain.
coinMinimalDenom: "utia",
// # of decimal points to convert minimal denomination to user-facing denomination.
coinDecimals: 6,
// (Optional) Keplr can show the fiat value of the coin if a coingecko id is provided.
// You can get id from https://api.coingecko.com/api/v3/coins/list if it is listed.
// coinGeckoId: ""
ibcChannel: "channel-48",
sequencerBridgeAccount: "astria13vptdafyttpmlwppt0s844efey2cpc0mevy92p",
iconClass: "i-celestia",
},
],
// List of coin/tokens used as a fee token in this chain.
feeCurrencies: [
{
// Coin denomination to be displayed to the user.
coinDenom: "TIA",
// Actual denom (i.e. nria, uscrt) used by the blockchain.
coinMinimalDenom: "utia",
// # of decimal points to convert minimal denomination to user-facing denomination.
coinDecimals: 6,
// (Optional) Keplr can show the fiat value of the coin if a coingecko id is provided.
// You can get id from https://api.coingecko.com/api/v3/coins/list if it is listed.
// coinGeckoId: ""
// (Optional) This is used to set the fee of the transaction.
// If this field is not provided and suggesting chain is not natively integrated, Keplr extension will set the Keplr default gas price (low: 0.01, average: 0.025, high: 0.04).
// Currently, Keplr doesn't support dynamic calculation of the gas prices based on on-chain data.
// Make sure that the gas prices are higher than the minimum gas prices accepted by chain validators and RPC/REST endpoint.
gasPriceStep: {
low: 0.01,
average: 0.02,
high: 0.1,
},
},
],
iconClass: "i-celestia",
};

const NobleChainInfo: IbcChainInfo = {
chainId: "noble-1",
chainName: "Noble",
// RPC endpoint of the chain
rpc: "https://noble-rpc.polkachu.com:443",
// REST endpoint of the chain.
rest: "https://noble-api.polkachu.com",
// Staking coin information
stakeCurrency: {
// Coin denomination to be displayed to the user.
coinDenom: "USDC",
// Actual denom (i.e. uatom, uscrt) used by the blockchain.
coinMinimalDenom: "uusdc",
// # of decimal points to convert minimal denomination to user-facing denomination.
coinDecimals: 6,
// (Optional) Keplr can show the fiat value of the coin if a coingecko id is provided.
// You can get id from https://api.coingecko.com/api/v3/coins/list if it is listed.
// coinGeckoId: ""
},
// (Optional) If you have a wallet webpage used to stake the coin then provide the url to the website in `walletUrlForStaking`.
// The 'stake' button in Keplr extension will link to the webpage.
// walletUrlForStaking: "",
// The BIP44 path.
bip44: {
// You can only set the coin type of BIP44.
// 'Purpose' is fixed to 44.
coinType: 118,
},
// The address prefix of the chain.
bech32Config: {
bech32PrefixAccAddr: "noble",
bech32PrefixAccPub: "noblepub",
bech32PrefixConsAddr: "noblevalcons",
bech32PrefixConsPub: "noblevalconspub",
bech32PrefixValAddr: "noblevaloper",
bech32PrefixValPub: "noblevaloperpub",
},
// List of all coin/tokens used in this chain.
currencies: [
{
// Coin denomination to be displayed to the user.
coinDenom: "USDC",
// Actual denom (i.e. uatom, uscrt) used by the blockchain.
coinMinimalDenom: "uusdc",
// # of decimal points to convert minimal denomination to user-facing denomination.
coinDecimals: 6,
// (Optional) Keplr can show the fiat value of the coin if a coingecko id is provided.
// You can get id from https://api.coingecko.com/api/v3/coins/list if it is listed.
// coinGeckoId: ""
ibcChannel: "channel-104",
// NOTE - noble requires the astria compat address (https://slowli.github.io/bech32-buffer/)
sequencerBridgeAccount:
"astriacompat1eg8hhey0n4untdvqqdvlyl0e7zx8wfcaz3l6wu",
iconClass: "i-noble",
},
],
// List of coin/tokens used as a fee token in this chain.
feeCurrencies: [
{
// Coin denomination to be displayed to the user.
coinDenom: "USDC",
// Actual denom (i.e. nria, uscrt) used by the blockchain.
coinMinimalDenom: "usdc",
// # of decimal points to convert minimal denomination to user-facing denomination.
coinDecimals: 6,
// (Optional) Keplr can show the fiat value of the coin if a coingecko id is provided.
// You can get id from https://api.coingecko.com/api/v3/coins/list if it is listed.
// coinGeckoId: ""
// (Optional) This is used to set the fee of the transaction.
// If this field is not provided and suggesting chain is not natively integrated, Keplr extension will set the Keplr default gas price (low: 0.01, average: 0.025, high: 0.04).
// Currently, Keplr doesn't support dynamic calculation of the gas prices based on on-chain data.
// Make sure that the gas prices are higher than the minimum gas prices accepted by chain validators and RPC/REST endpoint.
gasPriceStep: {
low: 0.01,
average: 0.02,
high: 0.1,
},
},
],
iconClass: "i-noble",
};

export const ibcChains: IbcChains = {
Celestia: CelestiaChainInfo,
Noble: NobleChainInfo,
};

const FlameChainInfo: EvmChainInfo = {
chainId: 253368190,
chainName: "Flame",
rpcUrls: ["https://rpc.flame.astria.org"],
currencies: [
{
coinDenom: "TIA",
coinMinimalDenom: "utia",
coinDecimals: 18,
nativeTokenWithdrawerContractAddress:
"0xB086557f9B5F6fAe5081CC5850BE94e62B1dDE57",
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-celestia",
},
{
coinDenom: "USDC",
coinMinimalDenom: "uusdc",
coinDecimals: 6,
erc20ContractAddress: "0x3f65144F387f6545bF4B19a1B39C94231E1c849F",
ibcWithdrawalFeeWei: "10000000000000000",
iconClass: "i-noble",
},
],
iconClass: "i-flame",
};

export const evmChains: EvmChains = {
Flame: FlameChainInfo,
};
Loading