From bae9a89dc10a462bd45def2503ce321a32390955 Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Fri, 3 Oct 2025 15:38:30 -0700 Subject: [PATCH] Use jupiter string amount where possible --- packages/common/src/api/tan-query/jupiter/executors.ts | 6 +++--- packages/web/src/store/application/ui/buy-audio/sagas.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/common/src/api/tan-query/jupiter/executors.ts b/packages/common/src/api/tan-query/jupiter/executors.ts index 06c4bb46b2f..8dcfafff348 100644 --- a/packages/common/src/api/tan-query/jupiter/executors.ts +++ b/packages/common/src/api/tan-query/jupiter/executors.ts @@ -167,7 +167,7 @@ export class DirectSwapExecutor extends BaseSwapExecutor { tokenInfo: inputTokenConfig, userPublicKey, ethAddress: ethAddress!, - amountLamports: BigInt(quote.inputAmount.amount), + amountLamports: BigInt(quote.inputAmount.amountString), sdk, feePayer, instructions @@ -382,7 +382,7 @@ export class IndirectSwapExecutor extends BaseSwapExecutor { tokenInfo: inputTokenConfig, userPublicKey, ethAddress: ethAddress!, - amountLamports: BigInt(firstQuote.inputAmount.amount), + amountLamports: BigInt(firstQuote.inputAmount.amountString), sdk, feePayer, instructions @@ -543,7 +543,7 @@ export class IndirectSwapExecutor extends BaseSwapExecutor { tokenInfo: audioTokenInfo, userPublicKey, ethAddress: ethAddress!, - amountLamports: BigInt(secondQuote.inputAmount.amount), + amountLamports: BigInt(secondQuote.inputAmount.amountString), sdk, feePayer, instructions diff --git a/packages/web/src/store/application/ui/buy-audio/sagas.ts b/packages/web/src/store/application/ui/buy-audio/sagas.ts index c3364295350..fa1b6cf3df0 100644 --- a/packages/web/src/store/application/ui/buy-audio/sagas.ts +++ b/packages/web/src/store/application/ui/buy-audio/sagas.ts @@ -1154,7 +1154,8 @@ function* recoverPurchaseIfNecessary() { // Use proportion to guesstimate an $AUDIO quote for the exchangeable balance const estimatedAudio = existingBalance > 0 - ? (BigInt(exchangableBalance) * BigInt(quote.outputAmount.amount)) / + ? (BigInt(exchangableBalance) * + BigInt(quote.outputAmount.amountString)) / BigInt(existingBalance) : BigInt(0)