Skip to content

Commit 2992fc9

Browse files
committed
Final version
1 parent 67da330 commit 2992fc9

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/navigation/ZKPoolEnter.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ const ZKPoolEnter = () => {
2121
return;
2222
}
2323
setLoading(true);
24+
2425
// Generate the ZK proof for the entered amount
2526
const zkProof = await createZKDepositProof(parsedAmount);
27+
2628
// Broadcast or submit the transaction
2729
await broadcastZKPoolEntry(zkProof);
30+
2831
// Show success message and navigate
2932
alert('ZK Pool Entry Successful!');
3033
navigation.goBack();
@@ -53,7 +56,6 @@ const ZKPoolEnter = () => {
5356
<Input
5457
variant="outline"
5558
size="md"
56-
placeholderTextColor="$gray400"
5759
placeholder="Amount (BTC)"
5860
value={amount}
5961
onChangeText={setAmount}
@@ -62,14 +64,16 @@ const ZKPoolEnter = () => {
6264
w="80%"
6365
bg="$white"
6466
borderColor="$gray300"
65-
/>
67+
color="$black"
68+
>
69+
<Input.Input placeholder="Amount (BTC)" />
70+
</Input>
6671
<Button
6772
size="md"
6873
variant="solid"
6974
bg="$primary500"
7075
onPress={onEnterPool}
7176
isDisabled={loading}
72-
$loading={loading} // Fixed from $loading to isLoading
7377
>
7478
<Text color="$white">
7579
{loading ? 'Processing...' : 'Enter Pool'}
@@ -78,7 +82,6 @@ const ZKPoolEnter = () => {
7882
</Box>
7983
);
8084
};
81-
8285
const createZKDepositProof = async (amount: number): Promise<string> => {
8386
// Replace with actual ZK proof generation logic
8487
return new Promise((resolve) => {

src/navigation/ZKProofExit.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React, { useState } from 'react';
22
import { Box, Button, Input, Heading, Text } from '@gluestack-ui/themed';
33
import { useNavigation } from '@react-navigation/native';
4-
// import { createZKDepositProof, broadcastZKPoolEntry } from '../services/zkPoolService';
54

65
// Type definition for navigation prop
7-
type NavigationProp = ReturnType<typeof useNavigation>;
6+
type NavigationProp = {
7+
goBack: () => void;
8+
};
89

910
const ZKPoolExit = () => {
1011
const [amount, setAmount] = useState('');
11-
const [loading, setLoading] = useState(false);
12+
const [loading, setLoading] = useState(false);
1213
const navigation = useNavigation<NavigationProp>();
1314

1415
const onEnterPool = async () => {
@@ -23,10 +24,10 @@ const ZKPoolExit = () => {
2324
setLoading(true);
2425

2526
// Generate ZK Proof of deposit
26-
// const zkProof = await createZKDepositProof(parsedAmount);
27+
const zkProof = await createZKDepositProof(parsedAmount);
2728

2829
// Broadcast the transaction
29-
// await broadcastZKPoolEntry(zkProof);
30+
await broadcastZKPoolEntry(zkProof);
3031

3132
// Success feedback and navigation
3233
alert('ZK Pool Exit Successful!');
@@ -93,4 +94,5 @@ const broadcastZKPoolEntry = async (zkProof: string): Promise<void> => {
9394
// Replace with actual broadcasting logic
9495
console.log('Broadcasting ZK Pool Entry with proof:', zkProof);
9596
};
96-
export default ZKPoolExit;
97+
98+
export default ZKPoolExit;

0 commit comments

Comments
 (0)