Skip to content

Commit

Permalink
feat: add avalanche and bsc blockchains as supported blockchains
Browse files Browse the repository at this point in the history
  • Loading branch information
Polybius93 committed Jan 3, 2025
1 parent f470ce5 commit 50e4010
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 6 deletions.
7 changes: 6 additions & 1 deletion config.mainnet.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"appEnvironment": "mainnet",
"coordinatorURL": "https://mainnet.dlc.link/attestor-1",
"enabledEthereumNetworkIDs": ["42161", "8453"],
"enabledEthereumNetworkIDs": ["42161", "8453", "56", "43114"],
"enabledRippleNetworkIDs": ["0"],
"bitcoinNetwork": "mainnet",
"bitcoinNetworkIndex": 0,
Expand Down Expand Up @@ -41,6 +41,11 @@
"name": "Pattern Research",
"addresses": ["0x707A141c5c19c25E2e6D50b214e39A4293B63234"],
"logo": "/images/logos/pattern-research-logo.svg"
},
{
"name": "VanEck",
"addresses": ["0x5aEF63A4291177e27892382B0B68E95CEef3B6FC"],
"logo": "/images/logos/vaneck-logo.svg"
}
],
"protocols": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"concurrently": "^8.2.2",
"d3": "^7.9.0",
"decimal.js": "^10.4.3",
"dlc-btc-lib": "2.5.4",
"dlc-btc-lib": "2.5.5",
"dotenv": "^16.3.1",
"ethers": "5.7.2",
"formik": "^2.4.5",
Expand Down
40 changes: 40 additions & 0 deletions public/images/logos/vaneck-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions src/app/providers/ethereum-network-configuration.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import { equals, find } from 'ramda';
import {
arbitrum,
arbitrumSepolia,
avalanche,
base,
baseSepolia,
bsc,
hardhat,
mainnet,
sepolia,
Expand Down Expand Up @@ -167,6 +169,48 @@ function getEthereumNetworkConfiguration(
),
chain: arbitrumSepolia,
};
case EthereumNetworkID.Avalanche:
return {
ethereumExplorerAPIURL: avalanche.blockExplorers.default.apiUrl,
websocketURL: appConfiguration.avalancheWebsocket,
httpURL: appConfiguration.avalancheHTTP,
ethereumAttestorChainID: 'evm-avax',
enabledEthereumNetworks,
dlcManagerContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(avalanche),
avalanche,
'DLCManager',
appConfiguration.avalancheWebsocket
),
iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(avalanche),
avalanche,
'IBTC',
appConfiguration.avalancheWebsocket
),
chain: avalanche,
};
case EthereumNetworkID.BSC:
return {
ethereumExplorerAPIURL: bsc.blockExplorers.default.apiUrl,
websocketURL: appConfiguration.bscWebsocket,
httpURL: appConfiguration.bscHTTP,
ethereumAttestorChainID: 'evm-bsc',
enabledEthereumNetworks,
dlcManagerContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(bsc),
bsc,
'DLCManager',
appConfiguration.bscWebsocket
),
iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(bsc),
bsc,
'IBTC',
appConfiguration.bscWebsocket
),
chain: bsc,
};
case EthereumNetworkID.Hardhat:
return {
ethereumExplorerAPIURL: '',
Expand Down
4 changes: 4 additions & 0 deletions src/shared/constants/ethereum.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Chain } from 'viem';
import {
arbitrum,
arbitrumSepolia,
avalanche,
base,
baseSepolia,
bsc,
hardhat,
mainnet,
sepolia,
Expand All @@ -15,6 +17,8 @@ export const SUPPORTED_VIEM_CHAINS: Chain[] = [
arbitrum,
arbitrumSepolia,
base,
bsc,
avalanche,
baseSepolia,
hardhat,
];
4 changes: 4 additions & 0 deletions src/shared/models/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export interface Configuration {
arbitrumHTTP: string;
baseWebsocket: string;
baseHTTP: string;
avalancheWebsocket: string;
avalancheHTTP: string;
bscWebsocket: string;
bscHTTP: string;
xrplWebsocket: string;
walletConnectProjectID: string;
bitcoinNetwork: BitcoinNetworkName;
Expand Down
2 changes: 2 additions & 0 deletions src/shared/models/ethereum-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export interface EthereumNetworkConfiguration {
| 'evm-arbsepolia'
| 'evm-base'
| 'evm-basesepolia'
| 'evm-avax'
| 'evm-bsc'
| 'evm-hardhat-arb'
| 'evm-hardhat-eth';
enabledEthereumNetworks: EthereumNetwork[];
Expand Down
7 changes: 7 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,19 @@ export default defineConfig(async ({ mode }) => {
const arbitrumURLs: string[] = env.VITE_ARBITRUM_OBSERVER_NODE.split(',');
const l1URLs: string[] = env.VITE_L1_OBSERVER_NODE.split(',');
const baseURLs: string[] = env.VITE_BASE_OBSERVER_NODE.split(',');
const avalancheURLs: string[] = env.VITE_AVALANCHE_OBSERVER_NODE.split(',');
const bscURLs: string[] = env.VITE_BSC_OBSERVER_NODE.split(',');

appConfiguration.arbitrumWebsocket = arbitrumURLs[0];
appConfiguration.arbitrumHTTP = arbitrumURLs[1];
appConfiguration.l1Websocket = l1URLs[0];
appConfiguration.l1HTTP = l1URLs[1];
appConfiguration.baseWebsocket = baseURLs[0];
appConfiguration.baseHTTP = baseURLs[1];
appConfiguration.avalancheWebsocket = avalancheURLs[0];
appConfiguration.avalancheHTTP = avalancheURLs[1];
appConfiguration.bscWebsocket = bscURLs[0];
appConfiguration.bscHTTP = bscURLs[1];
appConfiguration.walletConnectProjectID = env.VITE_WALLET_CONNECT_PROJECT_ID;


Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5220,10 +5220,10 @@ dir-glob@^3.0.1:
dependencies:
path-type "^4.0.0"

[email protected].4:
version "2.5.4"
resolved "https://registry.yarnpkg.com/dlc-btc-lib/-/dlc-btc-lib-2.5.4.tgz#265dcc14f3a6f090bb19dbb9753c36359f65b615"
integrity sha512-EYm7pupdooxexGlTuljsCU31hl3v0OoA4Oers8Anwf4FkZPsItIxFMV2HpFy/cmDlGuwtzKw9RNLXun10KcLLg==
[email protected].5:
version "2.5.5"
resolved "https://registry.yarnpkg.com/dlc-btc-lib/-/dlc-btc-lib-2.5.5.tgz#0fac68391c1026793c6bd6e6774f88f00d51678b"
integrity sha512-GnioCuGZ7pUHC6/StY7K5Fncx1o4mWxTAKJn/S1V3uDjD6iI/kst/5qqaT6bzxEY1zubNp+jCVeI2IhLi4DW3A==
dependencies:
"@dfns/sdk" "^0.5.9"
"@dfns/sdk-browser" "^0.5.9"
Expand Down

0 comments on commit 50e4010

Please sign in to comment.