Skip to content

Commit

Permalink
Merge pull request #428 from reservoirprotocol/fix/quote-error-data
Browse files Browse the repository at this point in the history
Quote error data
  • Loading branch information
pedromcunha authored Jan 9, 2025
2 parents 2149439 + a273799 commit d5a135d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-mirrors-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@reservoir0x/relay-kit-ui': patch
---

Fix quote_error data
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const DepositAddressModalRenderer: FC<Props> = ({
const providerOptionsContext = useContext(ProviderOptionsContext)
const { connector } = useAccount()
const deadAddress = getDeadAddress(fromChain?.vmType, fromChain?.id)
const _quoteData =
const quoteParameters: Parameters<typeof useQuote>['2'] =
fromToken && toToken
? {
user: deadAddress,
Expand Down Expand Up @@ -136,24 +136,7 @@ export const DepositAddressModalRenderer: FC<Props> = ({
} = useQuote(
relayClient ? relayClient : undefined,
undefined,
fromToken && toToken
? {
user: deadAddress,
originChainId: fromToken.chainId,
destinationChainId: toToken.chainId,
originCurrency: fromToken.address,
destinationCurrency: toToken.address,
recipient: recipient as string,
tradeType: 'EXACT_INPUT',
appFees: providerOptionsContext.appFees,
amount: parseUnits(
debouncedInputAmountValue,
fromToken.decimals
).toString(),
referrer: relayClient?.source ?? undefined,
useDepositAddress: true
}
: undefined,
quoteParameters,
() => {},
({ steps, details }) => {
onAnalyticEvent?.(EventNames.SWAP_EXECUTE_QUOTE_RECEIVED, {
Expand Down Expand Up @@ -194,7 +177,7 @@ export const DepositAddressModalRenderer: FC<Props> = ({
onAnalyticEvent?.(EventNames.QUOTE_ERROR, {
wallet_connector: connector?.name,
error_message: errorMessage,
parameters: _quoteData
parameters: quoteParameters
})
}
)
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/widgets/SwapWidgetRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ const SwapWidgetRenderer: FC<SwapWidgetRendererProps> = ({
onAnalyticEvent?.(EventNames.QUOTE_ERROR, {
wallet_connector: connector?.name,
error_message: errorMessage,
parameters: _quoteData
parameters: quoteParameters
})
}
)
Expand Down

0 comments on commit d5a135d

Please sign in to comment.