Skip to content

Commit

Permalink
ZIL-5558: Fix approve (#411)
Browse files Browse the repository at this point in the history
* Fix approve

* Fix walletconnect issue
  • Loading branch information
WuBruno authored Feb 6, 2024
1 parent 73965f0 commit e725eb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 8 additions & 3 deletions products/bridge/bridge-web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function App() {
token.address,
BigInt(toChainConfig.chainId),
ethRecipient as `0x${string}`,
parseUnits(amount!, decimals || 0),
parseUnits(amount!, decimals ?? 0),
],
functionName: "transfer",
gas: 600_000n,
Expand All @@ -173,7 +173,6 @@ function App() {
functionName: "approve",
gas: fromChainConfig.isZilliqa ? 400_000n : undefined,
type: fromChainConfig.isZilliqa ? "legacy" : "eip1559",
enabled: hasEnoughAllowance,
});

const { writeAsync: approve, isLoading: isLoadingApprove } =
Expand Down Expand Up @@ -438,7 +437,13 @@ function App() {
onClick={() => window.open(token.blockExplorer, "_blank")}
className="btn join-item w-32"
>
{token.logo && <img src={token.logo} className="h-8" alt="Zilliqa Logo" />}
{token.logo && (
<img
src={token.logo}
className="h-8"
alt="Zilliqa Logo"
/>
)}
<p>{token.name}</p>
<FontAwesomeIcon
icon={faArrowUpRightFromSquare}
Expand Down
4 changes: 3 additions & 1 deletion products/bridge/bridge-web/src/config/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export const { chains, publicClient } = configureChains(
const connectors = connectorsForWallets([
{
groupName: "Recommended",
wallets: [metaMaskWallet({ chains, projectId: "" })],
wallets: [
metaMaskWallet({ chains, projectId: "", walletConnectVersion: "1" }),
],
},
]);

Expand Down

0 comments on commit e725eb3

Please sign in to comment.