diff --git a/src/containers/BuildUnsignedSweepCoin/BuildUnsignedSweepCoin.tsx b/src/containers/BuildUnsignedSweepCoin/BuildUnsignedSweepCoin.tsx index 00da3d67..41606f10 100644 --- a/src/containers/BuildUnsignedSweepCoin/BuildUnsignedSweepCoin.tsx +++ b/src/containers/BuildUnsignedSweepCoin/BuildUnsignedSweepCoin.tsx @@ -143,7 +143,7 @@ function Form() { chain: getEthLikeRecoveryChainId(coin, bitGoEnvironment), hardfork: 'london', }, - bitgoKey: '', + bitgoKey: values.bitgoKey || '', ignoreAddressTypes: [], }); assert( diff --git a/src/containers/BuildUnsignedSweepCoin/EthLikeForm.tsx b/src/containers/BuildUnsignedSweepCoin/EthLikeForm.tsx index d86bbee0..bdd4b653 100644 --- a/src/containers/BuildUnsignedSweepCoin/EthLikeForm.tsx +++ b/src/containers/BuildUnsignedSweepCoin/EthLikeForm.tsx @@ -6,8 +6,18 @@ import { allCoinMetas } from '~/helpers/config'; const validationSchema = Yup.object({ apiKey: Yup.string().required(), - backupKey: Yup.string().required(), + backupKey: Yup.string().when('isTss', { + is: false, + then: Yup.string().required(), + otherwise: Yup.string().notRequired(), + }), + bitgoKey: Yup.string().when('isTss', { + is: true, + then: Yup.string().required(), + otherwise: Yup.string().notRequired(), + }), backupKeyId: Yup.string(), + seed: Yup.string(), gasLimit: Yup.number() .typeError('Gas limit must be a number') .integer() @@ -16,7 +26,11 @@ const validationSchema = Yup.object({ maxFeePerGas: Yup.number().required(), maxPriorityFeePerGas: Yup.number().required(), recoveryDestination: Yup.string().required(), - userKey: Yup.string().required(), + userKey: Yup.string().when('isTss', { + is: false, + then: Yup.string().required(), + otherwise: Yup.string().notRequired(), + }), userKeyId: Yup.string(), walletContractAddress: Yup.string().required(), isTss: Yup.boolean(), @@ -39,6 +53,8 @@ export function EthLikeForm({ onSubmit, coinName }: EthLikeFormProps) { apiKey: '', backupKey: '', backupKeyId: '', + bitgoKey: '', + seed: '', gasLimit: allCoinMetas[coinName]?.defaultGasLimitNum ?? 500000, maxFeePerGas: 20, maxPriorityFeePerGas: 10, @@ -57,46 +73,79 @@ export function EthLikeForm({ onSubmit, coinName }: EthLikeFormProps) {

Self-managed cold wallet details

-
- -
-
- -
-
- -
-
- -
-
- -
+ {allCoinMetas[coinName].isTssSupported && ( +
+ +
+ )} + {formik.values.isTss ? null : ( +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ )} + {formik.values.isTss ? ( +
+
+ +
+
+ +
+
+ ) : null + }
- {allCoinMetas[coinName].isTssSupported && ( -
- -
- )}