Skip to content

Commit

Permalink
Merge pull request #505 from BitGo/feature/COIN-1708
Browse files Browse the repository at this point in the history
chore(wrw): config changes addition of avaxc coin
  • Loading branch information
nrjsuthar authored Oct 7, 2024
2 parents b2b0c19 + f4e3938 commit 0e6ae2b
Show file tree
Hide file tree
Showing 8 changed files with 7,301 additions and 4,989 deletions.
12,173 changes: 7,233 additions & 4,940 deletions package-lock.json

Large diffs are not rendered by default.

86 changes: 43 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,49 @@
}
},
"dependencies": {
"@bitgo/abstract-cosmos": "11.0.5",
"@bitgo/abstract-utxo": "8.14.2",
"@bitgo/sdk-api": "1.54.1",
"@bitgo/sdk-coin-ada": "4.2.14",
"@bitgo/sdk-coin-algo": "2.1.34",
"@bitgo/sdk-coin-arbeth": "21.0.28",
"@bitgo/sdk-coin-atom": "13.0.5",
"@bitgo/sdk-coin-avaxc": "5.0.28",
"@bitgo/sdk-coin-bch": "2.0.36",
"@bitgo/sdk-coin-bcha": "2.1.20",
"@bitgo/sdk-coin-bld": "3.0.5",
"@bitgo/sdk-coin-bsc": "22.1.20",
"@bitgo/sdk-coin-bsv": "2.0.36",
"@bitgo/sdk-coin-btc": "2.2.7",
"@bitgo/sdk-coin-btg": "2.0.36",
"@bitgo/sdk-coin-coreum": "21.0.5",
"@bitgo/sdk-coin-dash": "2.0.36",
"@bitgo/sdk-coin-doge": "2.0.36",
"@bitgo/sdk-coin-dot": "4.1.14",
"@bitgo/sdk-coin-eos": "2.1.29",
"@bitgo/sdk-coin-etc": "2.2.3",
"@bitgo/sdk-coin-eth": "24.2.25",
"@bitgo/sdk-coin-ethlike": "1.1.17",
"@bitgo/sdk-coin-ethw": "20.0.36",
"@bitgo/sdk-coin-hash": "3.0.5",
"@bitgo/sdk-coin-hbar": "2.0.36",
"@bitgo/sdk-coin-injective": "3.0.5",
"@bitgo/sdk-coin-ltc": "3.0.36",
"@bitgo/sdk-coin-near": "2.0.36",
"@bitgo/sdk-coin-opeth": "18.1.21",
"@bitgo/sdk-coin-osmo": "3.0.5",
"@bitgo/sdk-coin-polygon": "21.0.5",
"@bitgo/sdk-coin-sei": "3.0.5",
"@bitgo/sdk-coin-sol": "4.5.2",
"@bitgo/sdk-coin-sui": "5.7.0",
"@bitgo/sdk-coin-tia": "3.0.5",
"@bitgo/sdk-coin-trx": "2.0.36",
"@bitgo/sdk-coin-xlm": "3.2.10",
"@bitgo/sdk-coin-xrp": "2.1.17",
"@bitgo/sdk-coin-zec": "2.0.36",
"@bitgo/sdk-coin-zeta": "3.0.5",
"@bitgo/sdk-opensslbytes": "^2.0.0",
"@bitgo/utxo-lib": "10.3.0",
"@bitgo/abstract-cosmos": "11.0.8",
"@bitgo/abstract-utxo": "9.0.0",
"@bitgo/sdk-api": "1.55.0",
"@bitgo/sdk-coin-ada": "4.2.17",
"@bitgo/sdk-coin-algo": "2.1.37",
"@bitgo/sdk-coin-arbeth": "21.0.31",
"@bitgo/sdk-coin-atom": "13.0.8",
"@bitgo/sdk-coin-avaxc": "5.1.0",
"@bitgo/sdk-coin-bch": "2.0.39",
"@bitgo/sdk-coin-bcha": "2.1.23",
"@bitgo/sdk-coin-bld": "3.0.8",
"@bitgo/sdk-coin-bsc": "22.1.23",
"@bitgo/sdk-coin-bsv": "2.0.39",
"@bitgo/sdk-coin-btc": "2.3.0",
"@bitgo/sdk-coin-btg": "2.0.39",
"@bitgo/sdk-coin-coreum": "21.0.8",
"@bitgo/sdk-coin-dash": "2.0.39",
"@bitgo/sdk-coin-doge": "2.0.39",
"@bitgo/sdk-coin-dot": "4.1.17",
"@bitgo/sdk-coin-eos": "2.1.32",
"@bitgo/sdk-coin-etc": "2.2.6",
"@bitgo/sdk-coin-eth": "24.2.28",
"@bitgo/sdk-coin-ethlike": "1.1.20",
"@bitgo/sdk-coin-ethw": "20.0.39",
"@bitgo/sdk-coin-hash": "3.0.8",
"@bitgo/sdk-coin-hbar": "2.0.39",
"@bitgo/sdk-coin-injective": "3.0.8",
"@bitgo/sdk-coin-ltc": "3.0.39",
"@bitgo/sdk-coin-near": "2.0.39",
"@bitgo/sdk-coin-opeth": "18.1.24",
"@bitgo/sdk-coin-osmo": "3.0.8",
"@bitgo/sdk-coin-polygon": "21.0.8",
"@bitgo/sdk-coin-sei": "3.0.8",
"@bitgo/sdk-coin-sol": "4.5.5",
"@bitgo/sdk-coin-sui": "5.7.2",
"@bitgo/sdk-coin-tia": "3.0.8",
"@bitgo/sdk-coin-trx": "2.0.39",
"@bitgo/sdk-coin-xlm": "3.2.13",
"@bitgo/sdk-coin-xrp": "2.1.20",
"@bitgo/sdk-coin-zec": "2.0.39",
"@bitgo/sdk-coin-zeta": "3.0.8",
"@bitgo/sdk-opensslbytes": "2.0.0",
"@bitgo/utxo-lib": "11.0.0",
"@ethereumjs/common": "2.6.5",
"@lottiefiles/react-lottie-player": "3.4.9",
"clsx": "1.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const validationSchema = Yup.object({
userKeyId: Yup.string(),
walletContractAddress: Yup.string().required(),
tokenContractAddress: Yup.string(),
apiKey: Yup.string().required(),
apiKey: Yup.string(),
wrongChain: Yup.string().required(),
intendedChain: Yup.string().required(),
}).required();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import {
CoinMetadata,
allWalletMetas,
} from '~/helpers/config';
import { BitgoEnv, isBscChain, safeEnv } from '~/helpers';
import { allCoinMetas } from '~/helpers/config';
import { BitgoEnv, isAvaxcCoin, safeEnv } from '~/helpers';

export function EvmCrossChainRecoveryBaseForm({
formik,
Expand All @@ -34,6 +33,7 @@ export function EvmCrossChainRecoveryBaseForm({
{`${coin.Title}: ${coin.Description}`}
</option>
));

wrongChainCoinsChildren.unshift(
<option disabled selected value="">
{' '}
Expand Down Expand Up @@ -128,7 +128,7 @@ export function EvmCrossChainRecoveryBaseForm({
Width="fill"
/>
</div>
{!isCustodyWallet && (
{!isCustodyWallet && !isAvaxcCoin(wrongChain) &&(
<div className="tw-mb-4">
<FormikTextfield
HelperText="An Api-Key Token required for the explorer."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface CustodyWalletParams extends BaseParams {
interface NonCustodyWalletParams extends BaseParams {
walletContractAddress: string;
bitgoFeeAddress: string;
apiKey: string;
apiKey?: string;
}

interface HotWalletParams extends NonCustodyWalletParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const validationSchema = Yup.object({
walletContractAddress: Yup.string().required(),
walletPassphrase: Yup.string().required(),
tokenContractAddress: Yup.string(),
apiKey: Yup.string().required(),
apiKey: Yup.string(),
wrongChain: Yup.string().required(),
intendedChain: Yup.string().required(),
}).required();
Expand Down
14 changes: 14 additions & 0 deletions src/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ export const evmCCRWrongChainCoins: Record<BitgoEnv, readonly CoinMetadata[]> =
allCoinMetas.bsc,
allCoinMetas.baseeth,
allCoinMetas.arbeth,
allCoinMetas.avaxc
] as const,
test: [
allCoinMetas.tpolygon,
Expand All @@ -828,6 +829,7 @@ export const evmCCRWrongChainCoins: Record<BitgoEnv, readonly CoinMetadata[]> =
allCoinMetas.tbsc,
allCoinMetas.tbaseeth,
allCoinMetas.tarbeth,
allCoinMetas.tavaxc
] as const,
};

Expand Down Expand Up @@ -897,6 +899,18 @@ export const evmCCRIntendedChainCoins: Record<string, readonly CoinMetadata[]> =
allCoinMetas.tpolygon,
allCoinMetas.topeth,
] as const,
avaxc: [
allCoinMetas.eth,
allCoinMetas.polygon,
allCoinMetas.opeth,
allCoinMetas.arbeth,
] as const,
tavaxc: [
allCoinMetas.hteth,
allCoinMetas.tpolygon,
allCoinMetas.topeth,
allCoinMetas.tarbeth,
] as const,
};

export const broadcastTransactionCoins: Record<
Expand Down
5 changes: 5 additions & 0 deletions src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,8 @@ export function getEip1559Params(coin: string, maxFeePerGas: number, maxPriority
maxPriorityFeePerGas: toWei(maxPriorityFeePerGas),
}
}


export function isAvaxcCoin(chainName: string) {
return (chainName === 'tavaxc' || chainName === 'avaxc') ;
}

0 comments on commit 0e6ae2b

Please sign in to comment.