@silentswap/react 0.0.60 → 0.0.62
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useState } from 'react';
|
|
2
|
-
import { isSolanaAsset, isBitcoinAsset, parseEvmCaip19, S_CAIP19_USDC_AVALANCHE, getAssetByCaip19, solveOptimalUsdcAmount, fetchRelayQuote, N_RELAY_CHAIN_ID_SOLANA, N_RELAY_CHAIN_ID_BITCOIN, SB58_ADDR_SOL_PROGRAM_SYSTEM, isSolanaNativeToken, parseSolanaCaip19, EVM_PHONY_ADDRESS, isValidSolanaAddress, isValidBitcoinAddress, isValidEvmAddress, getAddressFromCaip10, S0X_ADDR_USDC_AVALANCHE,
|
|
2
|
+
import { isSolanaAsset, isBitcoinAsset, parseEvmCaip19, S_CAIP19_USDC_AVALANCHE, getAssetByCaip19, solveOptimalUsdcAmount, fetchRelayQuote, N_RELAY_CHAIN_ID_SOLANA, N_RELAY_CHAIN_ID_BITCOIN, SB58_ADDR_SOL_PROGRAM_SYSTEM, isSolanaNativeToken, parseSolanaCaip19, EVM_PHONY_ADDRESS, isValidSolanaAddress, isValidBitcoinAddress, isValidEvmAddress, getAddressFromCaip10, S0X_ADDR_USDC_AVALANCHE, caip19FungibleEvmToken, FacilitatorKeyType, createHdFacilitatorGroupFromEntropy, PublicKeyArgGroups, SB58_CHAIN_ID_SOLANA_MAINNET, caip19SplToken, DeliveryMethod, X_MAX_IMPACT_PERCENT, NI_CHAIN_ID_AVALANCHE, SBTC_ADDR_BITCOIN_NATIVE, isEvmAsset, } from '@silentswap/sdk';
|
|
3
3
|
import { getAddress } from 'viem';
|
|
4
4
|
import { BigNumber } from 'bignumber.js';
|
|
5
5
|
/**
|
|
@@ -250,12 +250,16 @@ export function useQuoteCalculation({ address, evmAddress, wallet, depositorAddr
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
else {
|
|
253
|
-
// EVM destination
|
|
253
|
+
// EVM destination (including XRPL which uses eip155 namespace)
|
|
254
254
|
const destParsed = parseEvmCaip19(dest.asset);
|
|
255
255
|
if (!destParsed) {
|
|
256
256
|
throw new Error(`Failed to parse EVM destination CAIP-19: ${dest.asset}. Expected EVM asset format (eip155:chainId/erc20:address or eip155:chainId/slip44:cointype).`);
|
|
257
257
|
}
|
|
258
|
-
|
|
258
|
+
// Use destParsed.isNative instead of isEvmNativeToken() because:
|
|
259
|
+
// - isEvmNativeToken() uses isEvmAsset() which excludes XRPL (eip155:1440000)
|
|
260
|
+
// - XRPL uses slip44:144, so destParsed.tokenAddress is null
|
|
261
|
+
// - Using isEvmNativeToken() would incorrectly try to construct erc20:null
|
|
262
|
+
const isNative = destParsed.isNative;
|
|
259
263
|
const destChainId = destParsed.chainId;
|
|
260
264
|
asset = isNative
|
|
261
265
|
? dest.asset
|
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.62",
|
|
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.62",
|
|
28
|
+
"@silentswap/ui-kit": "0.0.62",
|
|
29
29
|
"@solana/codecs-strings": "^5.1.0",
|
|
30
30
|
"@solana/kit": "^5.1.0",
|
|
31
31
|
"@solana/rpc": "^5.1.0",
|