Skip to content

Commit

Permalink
fix: bob gateway logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rick23p committed Oct 9, 2024
1 parent 40e04a1 commit 84d0f3f
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions apps/frontend/src/app/5_pages/BobGateway/BobGatewayForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,33 +41,24 @@ export const BobGatewayForm: FC = () => {
bobGateway.getTokens().then(setTokens);
}, []);

console.log({
error,
hash,
isPending,
});
const onSbumit = async () => {
const toToken = tokens.find(t => t.address === token);

if (!account || !amount || !toToken) {
return;
}
console.log({

const params = {
toToken: toToken.symbol,
evmAddress: account,
value: BigInt(parseUnits(amount, 8).toString()),
});
};

sendGatewayTransaction(
{
toToken: toToken.symbol,
evmAddress: account,
value: BigInt(parseUnits(amount, 8).toString()),
},
{
onError: error => console.log({ error }),
},
);
console.log(params);

sendGatewayTransaction(params, {
onError: error => console.log({ error }),
});
};

const { value: orders } = useCacheCall(
Expand All @@ -81,19 +72,33 @@ export const BobGatewayForm: FC = () => {
[],
);

console.log({
orders,
});
useEffect(() => {
console.log({
error,
hash,
isPending,
});
}, [error, hash, isPending]);

useEffect(() => {
if (orders.length) {
console.log({
orders,
});
}
}, [orders]);

if (!btcAddress) {
return (
<>
<div className="flex gap-2 my-4">
{connectors.map(connector => (
<button key={connector.name} onClick={() => connect({ connector })}>
{connector.name}
</button>
<Button
key={connector.name}
text={connector.name}
onClick={() => connect({ connector })}
/>
))}
</>
</div>
);
}

Expand Down Expand Up @@ -134,7 +139,7 @@ export const BobGatewayForm: FC = () => {
className="min-w-36 w-full lg:w-auto"
/>
<br />
<Button text="submit" onClick={onSbumit} />
<Button loading={isPending} text="submit" onClick={onSbumit} />
</div>
);
};

0 comments on commit 84d0f3f

Please sign in to comment.