diff --git a/apps/frontend/.env.example b/apps/frontend/.env.example index f23375ed..815ed6d3 100644 --- a/apps/frontend/.env.example +++ b/apps/frontend/.env.example @@ -12,11 +12,10 @@ NEXTAUTH_URL=http://localhost:4200 # Secret hash used for encoding JWTs NEXTAUTH_SECRET=doremifasolatidodoremifasolatidodoremifasolatidodoremifasolatido -NEXT_PUBLIC_ALCHEMY_KEY= +NEXT_PUBLIC_ALCHEMY_ID= NEXT_PUBLIC_INFURA_ID= NEXT_PUBLIC_NETWORK_ID= -NEXT_PUBLIC_WC_PROJECT_ID= - +NEXT_PUBLIC_WALLETCONNECT_ID= # Used for GitHub's GraphQL API. Read-only permissions until DM needs mutations on our GitHub repo # https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens GITHUB_API_TOKEN= diff --git a/apps/frontend/components/Escrow/DepositFunds.tsx b/apps/frontend/components/Escrow/DepositFunds.tsx index 2245a1a0..744d90b7 100644 --- a/apps/frontend/components/Escrow/DepositFunds.tsx +++ b/apps/frontend/components/Escrow/DepositFunds.tsx @@ -14,10 +14,10 @@ import { Stack, Text, Tooltip, + useToast, VStack, } from '@raidguild/design-system'; import { commify, getTxLink } from '@raidguild/dm-utils'; -import { useDeposit } from '@raidguild/escrow-hooks'; import { checkedAtIndex, depositedMilestones, @@ -27,6 +27,7 @@ import { parseTokenAddress, PAYMENT_TYPES, } from '@raidguild/escrow-utils'; +import { useDeposit } from '@smartinvoicexyz/hooks'; import _ from 'lodash'; import { useEffect, useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; @@ -47,6 +48,7 @@ const DepositFunds = ({ const { token, amounts, currentMilestone } = invoice; const chainId = useChainId(); const { address } = useAccount(); + const toast = useToast(); const TOKEN_DATA = useMemo( () => ({ @@ -83,12 +85,21 @@ const DepositFunds = ({ paymentType?.value === PAYMENT_TYPES.NATIVE ? 18 : tokenBalance?.decimals; const hasAmount = balance >= parseUnits(amount, decimals); - const { handleDeposit, isLoading, isReady } = useDeposit({ - invoice, - amount, - decimals, + const { handleDeposit, isLoading } = useDeposit({ + invoice: { + tokenMetadata: { + address: invoice.token, // only address is needed + name: '', + symbol: '', + decimals, + totalSupply: BigInt(0), + }, + address: invoice.address, + }, + amount: amount && parseUnits(amount, decimals), hasAmount, // (+ gas) paymentType: paymentType?.value, + toast, }); const depositHandler = async () => { @@ -280,7 +291,7 @@ const DepositFunds = ({