@silentswap/react 0.0.76 → 0.0.77
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.
|
@@ -12,6 +12,7 @@ import { BigNumber } from 'bignumber.js';
|
|
|
12
12
|
* - Quote request construction and fetching
|
|
13
13
|
* - Destination amount updates
|
|
14
14
|
*/
|
|
15
|
+
// TODO: Simplify this hook by removing the useCallback and useState and just returning the calculateQuote function.
|
|
15
16
|
export function useQuoteCalculation({ address, evmAddress, wallet, depositorAddress, getQuote, getPrice, setDestinations, proId, }) {
|
|
16
17
|
const [loadingAmounts, setLoadingAmounts] = useState(false);
|
|
17
18
|
const [depositAmountUsdc, setDepositAmountUsdc] = useState(0);
|
|
@@ -187,7 +188,6 @@ export function useQuoteCalculation({ address, evmAddress, wallet, depositorAddr
|
|
|
187
188
|
// Egress quotes are used for retention rates and destination amounts, but NOT for quote request values
|
|
188
189
|
const splitUsdcAmounts = destinations.map((dest, idx) => {
|
|
189
190
|
const splitAmount = idx === 0 ? splits[0] : splits[idx] - splits[idx - 1];
|
|
190
|
-
// Match Svelte's logic to prevent rounding error where sum > total
|
|
191
191
|
let amountStr = usdcAmountBN.times(splitAmount).toFixed(0);
|
|
192
192
|
const amountBN = BigNumber(amountStr);
|
|
193
193
|
if (remainingUsdc.lt(amountBN)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silentswap/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.77",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@bigmi/core": "^0.6.5",
|
|
26
26
|
"@ensdomains/ensjs": "^4.2.0",
|
|
27
|
-
"@silentswap/sdk": "0.0.
|
|
28
|
-
"@silentswap/ui-kit": "0.0.
|
|
27
|
+
"@silentswap/sdk": "0.0.77",
|
|
28
|
+
"@silentswap/ui-kit": "0.0.77",
|
|
29
29
|
"@solana/codecs-strings": "^5.1.0",
|
|
30
30
|
"@solana/kit": "^5.1.0",
|
|
31
31
|
"@solana/rpc": "^5.1.0",
|