@b3dotfun/sdk 0.0.40-alpha.24 → 0.0.40-alpha.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -111,7 +111,9 @@ function useAnyspendFlow({ paymentType = "crypto", recipientAddress, loadOrder,
111
111
  }
112
112
  };
113
113
  // Get quote
114
- const activeInputAmountInWei = (0, viem_1.parseUnits)(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals).toString();
114
+ // For fiat payments, always use USDC decimals (6) regardless of selectedSrcToken
115
+ const effectiveDecimals = paymentType === "fiat" ? anyspend_1.USDC_BASE.decimals : selectedSrcToken.decimals;
116
+ const activeInputAmountInWei = (0, viem_1.parseUnits)(srcAmount.replace(/,/g, ""), effectiveDecimals).toString();
115
117
  const { anyspendQuote, isLoadingAnyspendQuote, getAnyspendQuoteError } = (0, react_1.useAnyspendQuote)({
116
118
  srcChain: paymentType === "fiat" ? chains_1.base.id : selectedSrcChainId,
117
119
  dstChain: isDepositMode ? chains_1.base.id : selectedDstChainId, // For deposits, always Base; for swaps, use selected destination
@@ -107,7 +107,9 @@ export function useAnyspendFlow({ paymentType = "crypto", recipientAddress, load
107
107
  }
108
108
  };
109
109
  // Get quote
110
- const activeInputAmountInWei = parseUnits(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals).toString();
110
+ // For fiat payments, always use USDC decimals (6) regardless of selectedSrcToken
111
+ const effectiveDecimals = paymentType === "fiat" ? USDC_BASE.decimals : selectedSrcToken.decimals;
112
+ const activeInputAmountInWei = parseUnits(srcAmount.replace(/,/g, ""), effectiveDecimals).toString();
111
113
  const { anyspendQuote, isLoadingAnyspendQuote, getAnyspendQuoteError } = useAnyspendQuote({
112
114
  srcChain: paymentType === "fiat" ? base.id : selectedSrcChainId,
113
115
  dstChain: isDepositMode ? base.id : selectedDstChainId, // For deposits, always Base; for swaps, use selected destination
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.40-alpha.24",
3
+ "version": "0.0.40-alpha.25",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -157,7 +157,9 @@ export function useAnyspendFlow({
157
157
  };
158
158
 
159
159
  // Get quote
160
- const activeInputAmountInWei = parseUnits(srcAmount.replace(/,/g, ""), selectedSrcToken.decimals).toString();
160
+ // For fiat payments, always use USDC decimals (6) regardless of selectedSrcToken
161
+ const effectiveDecimals = paymentType === "fiat" ? USDC_BASE.decimals : selectedSrcToken.decimals;
162
+ const activeInputAmountInWei = parseUnits(srcAmount.replace(/,/g, ""), effectiveDecimals).toString();
161
163
  const { anyspendQuote, isLoadingAnyspendQuote, getAnyspendQuoteError } = useAnyspendQuote({
162
164
  srcChain: paymentType === "fiat" ? base.id : selectedSrcChainId,
163
165
  dstChain: isDepositMode ? base.id : selectedDstChainId, // For deposits, always Base; for swaps, use selected destination