From 26cbffbbfe8edbc0a4a9ba31fe9c0d42852118d9 Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Wed, 16 Oct 2024 16:03:27 +0500 Subject: [PATCH] feat(hooks-store): add sell/buy amounts to hook-dapp context (#4990) --- .../modules/hooksStore/hooks/useSetupHooksStoreOrderParams.ts | 2 ++ libs/hook-dapp-lib/src/types.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/cowswap-frontend/src/modules/hooksStore/hooks/useSetupHooksStoreOrderParams.ts b/apps/cowswap-frontend/src/modules/hooksStore/hooks/useSetupHooksStoreOrderParams.ts index 7bc2cb2dce..7f531ad420 100644 --- a/apps/cowswap-frontend/src/modules/hooksStore/hooks/useSetupHooksStoreOrderParams.ts +++ b/apps/cowswap-frontend/src/modules/hooksStore/hooks/useSetupHooksStoreOrderParams.ts @@ -16,6 +16,8 @@ export function useSetupHooksStoreOrderParams() { setOrderParams({ validTo: orderParams.validTo, + sellAmount: orderParams.inputAmount.quotient.toString(), + buyAmount: orderParams.outputAmount.quotient.toString(), sellTokenAddress: getCurrencyAddress(orderParams.inputAmount.currency), buyTokenAddress: getCurrencyAddress(orderParams.outputAmount.currency), }) diff --git a/libs/hook-dapp-lib/src/types.ts b/libs/hook-dapp-lib/src/types.ts index f44aa21a06..9adea48b49 100644 --- a/libs/hook-dapp-lib/src/types.ts +++ b/libs/hook-dapp-lib/src/types.ts @@ -44,6 +44,8 @@ export interface HookDappOrderParams { validTo: number sellTokenAddress: string buyTokenAddress: string + sellAmount: string + buyAmount: string } export interface HookDappContext {