From 2f0e611a76c3379bc94d3d8de7d7defe95cf7f64 Mon Sep 17 00:00:00 2001 From: Yaroslav Grishajev Date: Tue, 10 Sep 2024 12:43:19 +0200 Subject: [PATCH] feat(deployment): implement deployment deposit top up via managed wallet refs #247 --- .../sign-and-broadcast-tx.router.ts | 3 +- .../authorizations/AllowanceModal.tsx | 4 +- .../components/authorizations/GrantModal.tsx | 4 +- .../deployments/DeploymentDepositModal.tsx | 57 ++++++++------- .../deployments/DeploymentDetailTopBar.tsx | 11 +-- .../deployments/DeploymentListRow.tsx | 16 ++-- .../deployments/DeploymentSubHeader.tsx | 73 +++++++++++-------- .../components/layout/TransactionModal.tsx | 6 +- .../shared/PriceEstimateTooltip.tsx | 4 +- apps/deploy-web/src/config/tx.config.ts | 1 - .../PricingProvider/PricingProvider.tsx | 8 +- .../context/WalletProvider/WalletProvider.tsx | 5 +- apps/deploy-web/src/hooks/useWalletBalance.ts | 23 ++++-- .../managed-wallet-http.service.ts | 2 - 14 files changed, 124 insertions(+), 93 deletions(-) delete mode 100644 apps/deploy-web/src/config/tx.config.ts diff --git a/apps/api/src/billing/routes/sign-and-broadcast-tx/sign-and-broadcast-tx.router.ts b/apps/api/src/billing/routes/sign-and-broadcast-tx/sign-and-broadcast-tx.router.ts index d93df3b0e..1a0d20d17 100644 --- a/apps/api/src/billing/routes/sign-and-broadcast-tx/sign-and-broadcast-tx.router.ts +++ b/apps/api/src/billing/routes/sign-and-broadcast-tx/sign-and-broadcast-tx.router.ts @@ -16,7 +16,8 @@ export const SignTxRequestInputSchema = z.object({ "/akash.cert.v1beta3.MsgCreateCertificate", "/akash.market.v1beta4.MsgCreateLease", "/akash.deployment.v1beta3.MsgUpdateDeployment", - "/akash.deployment.v1beta3.MsgCloseDeployment" + "/akash.deployment.v1beta3.MsgCloseDeployment", + "/akash.deployment.v1beta3.MsgDepositDeployment" ]), value: z.string() }) diff --git a/apps/deploy-web/src/components/authorizations/AllowanceModal.tsx b/apps/deploy-web/src/components/authorizations/AllowanceModal.tsx index 1dce8fb3c..1f817ebfe 100644 --- a/apps/deploy-web/src/components/authorizations/AllowanceModal.tsx +++ b/apps/deploy-web/src/components/authorizations/AllowanceModal.tsx @@ -85,7 +85,7 @@ export const AllowanceModal: React.FunctionComponent = ({ editingAllowanc const onBalanceClick = () => { clearErrors(); - setValue("amount", denomData?.inputMax || 0); + setValue("amount", denomData?.max || 0); }; return ( @@ -143,7 +143,7 @@ export const AllowanceModal: React.FunctionComponent = ({ editingAllowanc autoFocus min={0} step={0.000001} - max={denomData?.inputMax} + max={denomData?.max} startIcon={{denomData?.label}} /> ); diff --git a/apps/deploy-web/src/components/authorizations/GrantModal.tsx b/apps/deploy-web/src/components/authorizations/GrantModal.tsx index b2c134c6c..2199f9821 100644 --- a/apps/deploy-web/src/components/authorizations/GrantModal.tsx +++ b/apps/deploy-web/src/components/authorizations/GrantModal.tsx @@ -100,7 +100,7 @@ export const GrantModal: React.FunctionComponent = ({ editingGrant, addre const onBalanceClick = () => { clearErrors(); - setValue("amount", denomData?.inputMax || 0); + setValue("amount", denomData?.max || 0); }; return ( @@ -187,7 +187,7 @@ export const GrantModal: React.FunctionComponent = ({ editingGrant, addre autoFocus min={0} step={0.000001} - max={denomData?.inputMax} + max={denomData?.max} startIcon={{denomData?.label}} className="ml-4 flex-grow" /> diff --git a/apps/deploy-web/src/components/deployments/DeploymentDepositModal.tsx b/apps/deploy-web/src/components/deployments/DeploymentDepositModal.tsx index a69f1a92d..2f20f0aae 100644 --- a/apps/deploy-web/src/components/deployments/DeploymentDepositModal.tsx +++ b/apps/deploy-web/src/components/deployments/DeploymentDepositModal.tsx @@ -25,19 +25,20 @@ import { event } from "nextjs-google-analytics"; import { useSnackbar } from "notistack"; import { z } from "zod"; +import { browserEnvConfig } from "@src/config/browser-env.config"; import { UAKT_DENOM } from "@src/config/denom.config"; +import { usePricing } from "@src/context/PricingProvider"; import { useSettings } from "@src/context/SettingsProvider"; import { useWallet } from "@src/context/WalletProvider"; -import { useUsdcDenom } from "@src/hooks/useDenom"; import { useDenomData, useWalletBalance } from "@src/hooks/useWalletBalance"; import { useGranteeGrants } from "@src/queries/useGrantsQuery"; import { AnalyticsEvents } from "@src/utils/analytics"; import { denomToUdenom, udenomToDenom } from "@src/utils/mathHelpers"; -import { coinToUDenom, uaktToAKT } from "@src/utils/priceUtils"; +import { coinToUDenom } from "@src/utils/priceUtils"; import { LinkTo } from "../shared/LinkTo"; import { GranteeDepositMenuItem } from "./GranteeDepositMenuItem"; -type Props = { +export type DeploymentDepositModalProps = { infoText?: string | ReactNode; disableMin?: boolean; denom: string; @@ -67,15 +68,22 @@ const formSchema = z { message: "Depositor address is required.", path: ["depositorAddress"] } ); -export const DeploymentDepositModal: React.FunctionComponent = ({ handleCancel, onDeploymentDeposit, disableMin, denom, infoText = null }) => { +export const DeploymentDepositModal: React.FunctionComponent = ({ + handleCancel, + onDeploymentDeposit, + disableMin, + denom, + infoText = null +}) => { const formRef = useRef(null); const { settings } = useSettings(); const { enqueueSnackbar } = useSnackbar(); const [error, setError] = useState(""); const [isCheckingDepositor, setIsCheckingDepositor] = useState(false); - const { address } = useWallet(); + const { address, isManaged, isCustodial } = useWallet(); const { balance: walletBalance } = useWalletBalance(); const { data: granteeGrants } = useGranteeGrants(address); + const pricing = usePricing(); const depositData = useDenomData(denom); const form = useForm>({ defaultValues: { @@ -87,7 +95,6 @@ export const DeploymentDepositModal: React.FunctionComponent = ({ handleC }); const { handleSubmit, control, watch, setValue, clearErrors, unregister } = form; const { amount, useDepositor, depositorAddress } = watch(); - const usdcIbcDenom = useUsdcDenom(); const validGrants = granteeGrants?.filter(x => compareAsc(new Date(), new Date(x.expiration)) !== 1 && x.authorization.spend_limit.denom === denom) || []; useEffect(() => { @@ -156,7 +163,7 @@ export const DeploymentDepositModal: React.FunctionComponent = ({ handleC const onBalanceClick = () => { clearErrors(); - setValue("amount", depositData?.inputMax || 0); + setValue("amount", depositData?.max || 0); }; const onDepositClick = event => { @@ -167,9 +174,8 @@ export const DeploymentDepositModal: React.FunctionComponent = ({ handleC const onSubmit = async ({ amount, depositorAddress }: z.infer) => { setError(""); clearErrors(); - const deposit = denomToUdenom(amount); - const uaktBalance = walletBalance?.balanceUAKT || 0; - const usdcBalance = walletBalance?.balanceUUSDC || 0; + const amountInDenom = (isManaged && denom === UAKT_DENOM ? pricing.usdToAkt(amount) : amount) || 0; + const deposit = denomToUdenom(amountInDenom); if (!disableMin && amount < (depositData?.min || 0)) { setError(`Deposit amount must be greater or equal than ${depositData?.min}.`); @@ -186,15 +192,12 @@ export const DeploymentDepositModal: React.FunctionComponent = ({ handleC category: "deployments", label: "Use depositor to deposit in deployment" }); - } else if (denom === UAKT_DENOM && deposit > uaktBalance) { - setError(`You can't deposit more than you currently have in your balance. Current balance is: ${uaktToAKT(uaktBalance)} AKT.`); - return; - } else if (denom === usdcIbcDenom && deposit > usdcBalance) { - setError(`You can't deposit more than you currently have in your balance. Current balance is: ${udenomToDenom(usdcBalance)} USDC.`); + } else if (depositData && amountInDenom > depositData?.balance) { + setError(`You can't deposit more than you currently have in your balance. Current balance is: ${depositData?.balance} ${depositData?.label}.`); return; } - onDeploymentDeposit(deposit, depositorAddress as string); + onDeploymentDeposit(deposit, isManaged ? browserEnvConfig.NEXT_PUBLIC_MASTER_WALLET_ADDRESS : (depositorAddress as string)); }; return ( @@ -249,7 +252,7 @@ export const DeploymentDepositModal: React.FunctionComponent = ({ handleC autoFocus min={!disableMin ? depositData?.min : 0} step={0.000001} - max={depositData?.inputMax} + max={depositData?.max} startIcon={
{depositData?.label}
} /> ); @@ -257,15 +260,17 @@ export const DeploymentDepositModal: React.FunctionComponent = ({ handleC /> -
- { - return ; - }} - /> -
+ {isCustodial && ( +
+ { + return ; + }} + /> +
+ )} {useDepositor && ( = ({ address, loadDeploymentDetail, removeLeases, setActiveTab, deployment }) => { const { changeDeploymentName, getDeploymentData, getDeploymentName } = useLocalNotes(); const router = useRouter(); - const { signAndBroadcastTx, isManaged } = useWallet(); + const { signAndBroadcastTx } = useWallet(); const [isDepositingDeployment, setIsDepositingDeployment] = useState(false); const storageDeploymentData = getDeploymentData(deployment?.dseq); const deploymentName = getDeploymentName(deployment?.dseq); const previousRoute = usePreviousRoute(); - const wallet = useWallet(); const { closeDeploymentConfirm } = useManagedDeploymentConfirm(); function handleBackClick() { @@ -126,11 +125,9 @@ export const DeploymentDetailTopBar: React.FunctionComponent = ({ address - {!wallet.isManaged && ( - - )} + )} diff --git a/apps/deploy-web/src/components/deployments/DeploymentListRow.tsx b/apps/deploy-web/src/components/deployments/DeploymentListRow.tsx index e4f72c481..3f95c7a24 100644 --- a/apps/deploy-web/src/components/deployments/DeploymentListRow.tsx +++ b/apps/deploy-web/src/components/deployments/DeploymentListRow.tsx @@ -36,7 +36,7 @@ import { CustomDropdownLinkItem } from "../shared/CustomDropdownLinkItem"; import { PricePerMonth } from "../shared/PricePerMonth"; import { PriceValue } from "../shared/PriceValue"; import { SpecDetailList } from "../shared/SpecDetailList"; -import { DeploymentDepositModal } from "./DeploymentDepositModal"; +import { DeploymentDepositModal, DeploymentDepositModalProps } from "./DeploymentDepositModal"; import { LeaseChip } from "./LeaseChip"; type Props = { @@ -127,7 +127,7 @@ export const DeploymentListRow: React.FunctionComponent = ({ deployment, setOpen(false); }; - const onDeploymentDeposit = async (deposit, depositorAddress) => { + const onDeploymentDeposit: DeploymentDepositModalProps["onDeploymentDeposit"] = async (deposit, depositorAddress) => { setIsDepositingDeployment(false); const message = TransactionMessageData.getDepositDeploymentMsg(address, deployment.dseq, deposit, deployment.escrowAccount.balance.denom, depositorAddress); @@ -213,13 +213,9 @@ export const DeploymentListRow: React.FunctionComponent = ({ deployment, title={ <> Your deployment will close soon,{" "} - {isManagedWallet ? ( - "Add funds" - ) : ( - - Add Funds - - )}{" "} + + Add Funds + {" "} to keep it running. } @@ -336,7 +332,7 @@ export const DeploymentListRow: React.FunctionComponent = ({ deployment, > setOpen(false)}>
- {isActive && isManagedWallet && ( + {isActive && ( }> Add funds diff --git a/apps/deploy-web/src/components/deployments/DeploymentSubHeader.tsx b/apps/deploy-web/src/components/deployments/DeploymentSubHeader.tsx index e7846d31a..e1b60eb5d 100644 --- a/apps/deploy-web/src/components/deployments/DeploymentSubHeader.tsx +++ b/apps/deploy-web/src/components/deployments/DeploymentSubHeader.tsx @@ -9,6 +9,7 @@ import { LabelValue } from "@src/components/shared/LabelValue"; import { PricePerMonth } from "@src/components/shared/PricePerMonth"; import { PriceValue } from "@src/components/shared/PriceValue"; import { StatusPill } from "@src/components/shared/StatusPill"; +import { useWallet } from "@src/context/WalletProvider"; import { useDenomData } from "@src/hooks/useWalletBalance"; import { DeploymentDto, LeaseDto } from "@src/types/deployment"; import { udenomToDenom } from "@src/utils/mathHelpers"; @@ -28,6 +29,7 @@ export const DeploymentSubHeader: React.FunctionComponent = ({ deployment const isActive = deployment.state === "active"; const hasActiveLeases = hasLeases && leases.some(l => l.state === "active"); const denomData = useDenomData(deployment.escrowAccount.balance.denom); + const { isCustodial } = useWallet(); return (
@@ -41,19 +43,22 @@ export const DeploymentSubHeader: React.FunctionComponent = ({ deployment denom={deployment.escrowAccount.balance.denom} value={udenomToDenom(isActive && hasActiveLeases && realTimeLeft ? realTimeLeft?.escrow : deployment.escrowBalance, 6)} /> - - - {udenomToDenom(isActive && hasActiveLeases && realTimeLeft ? realTimeLeft?.escrow : deployment.escrowBalance, 6)} {denomData?.label} - -
- The escrow account balance will be fully returned to your wallet balance when the deployment is closed.{" "} - - } - > - -
+ {isCustodial && ( + + + {udenomToDenom(isActive && hasActiveLeases && realTimeLeft ? realTimeLeft?.escrow : deployment.escrowBalance, 6)}  + {denomData?.label} + +
+ The escrow account balance will be fully returned to your wallet balance when the deployment is closed.{" "} + + } + > + +
+ )} {isActive && hasActiveLeases && !!realTimeLeft && realTimeLeft.escrow <= 0 && ( @@ -71,15 +76,17 @@ export const DeploymentSubHeader: React.FunctionComponent = ({ deployment
- - {avgCost} {denomData?.label} / month - - } - > - - + {isCustodial && ( + + {avgCost} {denomData?.label} / month + + } + > + + + )}
) } @@ -94,16 +101,18 @@ export const DeploymentSubHeader: React.FunctionComponent = ({ deployment value={udenomToDenom(isActive && hasActiveLeases && realTimeLeft ? realTimeLeft?.amountSpent : parseFloat(deployment.transferred.amount), 6)} /> - - {udenomToDenom(isActive && hasActiveLeases && realTimeLeft ? realTimeLeft?.amountSpent : parseFloat(deployment.transferred.amount), 6)}{" "} - {denomData?.label} - - } - > - - + {isCustodial && ( + + {udenomToDenom(isActive && hasActiveLeases && realTimeLeft ? realTimeLeft?.amountSpent : parseFloat(deployment.transferred.amount), 6)}{" "} + {denomData?.label} + + } + > + + + )}
} /> diff --git a/apps/deploy-web/src/components/layout/TransactionModal.tsx b/apps/deploy-web/src/components/layout/TransactionModal.tsx index 916e78222..c8c990627 100644 --- a/apps/deploy-web/src/components/layout/TransactionModal.tsx +++ b/apps/deploy-web/src/components/layout/TransactionModal.tsx @@ -9,7 +9,8 @@ export type LoadingState = | "creatingDeployment" | "updatingDeployment" | "creatingLease" - | "closingDeployment"; + | "closingDeployment" + | "depositingDeployment"; type Props = { state?: LoadingState; @@ -24,7 +25,8 @@ const TITLES: Record = { creatingDeployment: "Creating Deployment", updatingDeployment: "Updating Deployment", creatingLease: "Creating Lease", - closingDeployment: "Closing Deployment" + closingDeployment: "Closing Deployment", + depositingDeployment: "Depositing Deployment" }; const CRYPTO_STATES: LoadingState[] = ["waitingForApproval", "broadcasting"]; diff --git a/apps/deploy-web/src/components/shared/PriceEstimateTooltip.tsx b/apps/deploy-web/src/components/shared/PriceEstimateTooltip.tsx index 3a88e35a6..931148672 100644 --- a/apps/deploy-web/src/components/shared/PriceEstimateTooltip.tsx +++ b/apps/deploy-web/src/components/shared/PriceEstimateTooltip.tsx @@ -3,6 +3,7 @@ import { ReactNode } from "react"; import { CustomTooltip } from "@akashnetwork/ui/components"; import { InfoCircle } from "iconoir-react"; +import { useWallet } from "@src/context/WalletProvider"; import { useDenomData } from "@src/hooks/useWalletBalance"; import { averageDaysInMonth } from "@src/utils/dateUtils"; import { udenomToDenom } from "@src/utils/mathHelpers"; @@ -20,6 +21,7 @@ export const PriceEstimateTooltip: React.FunctionComponent = ({ value, de const perDayValue = _value * (60 / averageBlockTime) * 60 * 24; const perMonthValue = _value * (60 / averageBlockTime) * 60 * 24 * averageDaysInMonth; const denomData = useDenomData(denom); + const { isCustodial } = useWallet(); return ( = ({ value, de   per month
-
({`~${udenomToDenom(getAvgCostPerMonth(value as number))} ${denomData?.label}/month`})
+ {isCustodial &&
({`~${udenomToDenom(getAvgCostPerMonth(value as number))} ${denomData?.label}/month`})
} } > diff --git a/apps/deploy-web/src/config/tx.config.ts b/apps/deploy-web/src/config/tx.config.ts deleted file mode 100644 index de646ed5d..000000000 --- a/apps/deploy-web/src/config/tx.config.ts +++ /dev/null @@ -1 +0,0 @@ -export const TX_FEE_BUFFER = 10000; diff --git a/apps/deploy-web/src/context/PricingProvider/PricingProvider.tsx b/apps/deploy-web/src/context/PricingProvider/PricingProvider.tsx index 7205a4c0a..44038f341 100644 --- a/apps/deploy-web/src/context/PricingProvider/PricingProvider.tsx +++ b/apps/deploy-web/src/context/PricingProvider/PricingProvider.tsx @@ -12,6 +12,7 @@ type ContextType = { price: number | undefined; uaktToUSD: (amount: number) => number | null; aktToUSD: (amount: number) => number | null; + usdToAkt: (amount: number) => number | null; getPriceForDenom: (denom: string) => number; }; @@ -31,6 +32,11 @@ export const PricingProvider = ({ children }) => { return roundDecimal(amount * marketData.price, 2); } + function usdToAkt(amount: number) { + if (!marketData) return null; + return roundDecimal(amount / marketData.price, 2); + } + const getPriceForDenom = (denom: string) => { switch (denom) { case UAKT_DENOM: @@ -44,7 +50,7 @@ export const PricingProvider = ({ children }) => { }; return ( - + {children} ); diff --git a/apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx b/apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx index 2ba4db6dd..d94b24398 100644 --- a/apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx +++ b/apps/deploy-web/src/context/WalletProvider/WalletProvider.tsx @@ -46,6 +46,7 @@ type ContextType = { logout: () => void; signAndBroadcastTx: (msgs: EncodeObject[]) => Promise; isManaged: boolean; + isCustodial: boolean; isWalletLoading: boolean; isTrialing: boolean; creditAmount?: number; @@ -59,7 +60,8 @@ const MESSAGE_STATES: Record = { "/akash.deployment.v1beta3.MsgCloseDeployment": "closingDeployment", "/akash.deployment.v1beta3.MsgCreateDeployment": "searchingProviders", "/akash.market.v1beta4.MsgCreateLease": "creatingDeployment", - "/akash.deployment.v1beta3.MsgUpdateDeployment": "updatingDeployment" + "/akash.deployment.v1beta3.MsgUpdateDeployment": "updatingDeployment", + "/akash.deployment.v1beta3.MsgDepositDeployment": "depositingDeployment" }; const initialWallet = getSelectedStorageWallet(); @@ -300,6 +302,7 @@ export const WalletProvider = ({ children }) => { logout, signAndBroadcastTx, isManaged, + isCustodial: !isManaged, isWalletLoading: isLoading, isTrialing: isManaged && !!managedWallet?.isTrialing, creditAmount: isManaged ? managedWallet?.creditAmount : 0, diff --git a/apps/deploy-web/src/hooks/useWalletBalance.ts b/apps/deploy-web/src/hooks/useWalletBalance.ts index 83979fffc..b238b4dce 100644 --- a/apps/deploy-web/src/hooks/useWalletBalance.ts +++ b/apps/deploy-web/src/hooks/useWalletBalance.ts @@ -1,7 +1,6 @@ import { useEffect, useState } from "react"; import { UAKT_DENOM } from "@src/config/denom.config"; -import { TX_FEE_BUFFER } from "@src/config/tx.config"; import { useChainParam } from "@src/context/ChainParamProvider"; import { usePricing } from "@src/context/PricingProvider"; import { useWallet } from "@src/context/WalletProvider"; @@ -10,6 +9,8 @@ import { udenomToDenom } from "@src/utils/mathHelpers"; import { uaktToAKT } from "@src/utils/priceUtils"; import { useUsdcDenom } from "./useDenom"; +export const TX_FEE_BUFFER = 10000; + export type WalletBalance = { totalUsd: number; balanceUAKT: number; @@ -96,17 +97,19 @@ export const useWalletBalance = (): WalletBalanceReturnType => { type DenomData = { min: number; + max: number; label: string; balance: number; - inputMax: number; }; export const useDenomData = (denom: string) => { - const { isLoaded, price } = usePricing(); + const { isLoaded, price, aktToUSD } = usePricing(); const { balance: walletBalance } = useWalletBalance(); const [depositData, setDepositData] = useState(null); const usdcIbcDenom = useUsdcDenom(); const { minDeposit } = useChainParam(); + const { isManaged } = useWallet(); + const txFeeBuffer = isManaged ? 0 : TX_FEE_BUFFER; useEffect(() => { if (isLoaded && walletBalance && minDeposit?.akt && minDeposit?.usdc && price) { @@ -117,7 +120,7 @@ export const useDenomData = (denom: string) => { min: minDeposit.akt, label: "AKT", balance: uaktToAKT(walletBalance.balanceUAKT, 6), - inputMax: uaktToAKT(Math.max(walletBalance.balanceUAKT - TX_FEE_BUFFER, 0), 6) + max: uaktToAKT(Math.max(walletBalance.balanceUAKT - txFeeBuffer, 0), 6) }; break; case usdcIbcDenom: @@ -125,13 +128,23 @@ export const useDenomData = (denom: string) => { min: minDeposit.usdc, label: "USDC", balance: udenomToDenom(walletBalance.balanceUUSDC, 6), - inputMax: udenomToDenom(Math.max(walletBalance.balanceUUSDC - TX_FEE_BUFFER, 0), 6) + max: udenomToDenom(Math.max(walletBalance.balanceUUSDC - txFeeBuffer, 0), 6) }; break; default: break; } + if (depositData && isManaged) { + depositData.label = "USD"; + + if (denom === UAKT_DENOM) { + depositData.balance = aktToUSD(depositData.balance) || 0; + depositData.min = aktToUSD(depositData.min) || 0; + depositData.max = aktToUSD(depositData.max) || 0; + } + } + setDepositData(depositData); } }, [denom, isLoaded, price, walletBalance, usdcIbcDenom, minDeposit]); diff --git a/apps/deploy-web/src/services/managed-wallet-http/managed-wallet-http.service.ts b/apps/deploy-web/src/services/managed-wallet-http/managed-wallet-http.service.ts index 31c6952f9..b86952ef4 100644 --- a/apps/deploy-web/src/services/managed-wallet-http/managed-wallet-http.service.ts +++ b/apps/deploy-web/src/services/managed-wallet-http/managed-wallet-http.service.ts @@ -1,6 +1,5 @@ import { ApiWalletOutput, ManagedWalletHttpService as ManagedWalletHttpServiceOriginal } from "@akashnetwork/http-sdk"; import { AxiosRequestConfig } from "axios"; -import { debounce } from "lodash"; import { browserEnvConfig } from "@src/config/browser-env.config"; import { browserApiUrlService } from "@src/services/api-url/browser-api-url.service"; @@ -13,7 +12,6 @@ class ManagedWalletHttpService extends ManagedWalletHttpServiceOriginal { super(config); this.extractSessionResults(); - this.getWallet = debounce(this.getWallet.bind(this)); } private extractSessionResults() {