diff --git a/packages/frontend/src/components/projects/create/Configure.tsx b/packages/frontend/src/components/projects/create/Configure.tsx index 9a5e1501..711b448b 100644 --- a/packages/frontend/src/components/projects/create/Configure.tsx +++ b/packages/frontend/src/components/projects/create/Configure.tsx @@ -35,12 +35,15 @@ type ConfigureDeploymentFormValues = { type ConfigureFormValues = ConfigureDeploymentFormValues & EnvironmentVariablesFormValues; +const DEFAULT_MAX_PRICE = '10000'; + const Configure = () => { const { signClient, session, accounts } = useWalletConnectClient(); const [isLoading, setIsLoading] = useState(false); const [deployers, setDeployers] = useState([]); const [selectedAccount, setSelectedAccount] = useState(); + const [selectedDeployer, setSelectedDeployer] = useState(); const [isPaymentLoading, setIsPaymentLoading] = useState(false); const [isPaymentDone, setIsPaymentDone] = useState(false); @@ -64,9 +67,9 @@ const Configure = () => { const methods = useForm({ defaultValues: { option: 'Auction', - maxPrice: '0', + maxPrice: DEFAULT_MAX_PRICE, lrn: '', - numProviders: 0, + numProviders: 1, }, }); @@ -214,12 +217,12 @@ const Configure = () => { txHash = txHashResponse; - const isTxHashValid = verifyTx( + const isTxHashValid = await verifyTx( senderAddress, txHash, amount.toString(), ); - if (!isTxHashValid) { + if (isTxHashValid === false) { console.error('Invalid Tx hash', txHash); return; } @@ -276,6 +279,11 @@ const Configure = () => { setSelectedAccount(account); }, []); + const onDeployerChange = useCallback((selectedLrn: string) => { + const deployer = deployers.find((d) => d.deployerLrn === selectedLrn); + setSelectedDeployer(deployer); + }, [deployers]); + const cosmosSendTokensHandler = useCallback( async (selectedAccount: string, amount: string) => { if (!signClient || !session || !selectedAccount) { @@ -410,7 +418,10 @@ const Configure = () => {