@0xsquid/react-hooks 8.5.0 → 8.5.1-beta-named-config-and-ssr.0
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.
- package/dist/core/externalLinks.d.ts +1 -1
- package/dist/core/types/config.d.ts +9 -2
- package/dist/core/types/event.d.ts +4 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/swap/useUrlSwapParams.d.ts +10 -0
- package/dist/{index-5cyMUZhY.js → index-B9HoEAkw.js} +1078 -946
- package/dist/index-B9HoEAkw.js.map +1 -0
- package/dist/{index-BGVXRZI6.js → index-DerYFnJy.js} +1078 -950
- package/dist/index-DerYFnJy.js.map +1 -0
- package/dist/{index.es-BfdAGErV.js → index.es-6saiqdxO.js} +3 -3
- package/dist/{index.es-BfdAGErV.js.map → index.es-6saiqdxO.js.map} +1 -1
- package/dist/{index.es-CeHwkxPw.js → index.es-D5XAyXYj.js} +3 -3
- package/dist/{index.es-CeHwkxPw.js.map → index.es-D5XAyXYj.js.map} +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/{secretService-BMYOBXhv.js → secretService-CMKzgy2w.js} +3 -3
- package/dist/{secretService-BMYOBXhv.js.map → secretService-CMKzgy2w.js.map} +1 -1
- package/dist/{secretService-D_d3CFdp.js → secretService-MoYDj-tj.js} +3 -3
- package/dist/{secretService-D_d3CFdp.js.map → secretService-MoYDj-tj.js.map} +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.esm.js +100 -0
- package/dist/server.esm.js.map +1 -0
- package/dist/server.js +111 -0
- package/dist/server.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/internal/configService.d.ts +2 -1
- package/dist/services/internal/eventService.d.ts +4 -0
- package/dist/services/internal/urlParamsService.d.ts +19 -0
- package/dist/{stellarService.client-DOrCdvCd.js → stellarService.client-BlRR1b_S.js} +3 -3
- package/dist/{stellarService.client-DOrCdvCd.js.map → stellarService.client-BlRR1b_S.js.map} +1 -1
- package/dist/{stellarService.client-CIkvwxPo.js → stellarService.client-DaNc2W3z.js} +3 -3
- package/dist/{stellarService.client-CIkvwxPo.js.map → stellarService.client-DaNc2W3z.js.map} +1 -1
- package/dist/tests/urlParamsService.test.d.ts +1 -0
- package/package.json +13 -1
- package/dist/index-5cyMUZhY.js.map +0 -1
- package/dist/index-BGVXRZI6.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const squidApiBaseUrl = "https://api.
|
|
1
|
+
export declare const squidApiBaseUrl = "https://v2.api.squidrouter.com";
|
|
@@ -4,6 +4,13 @@ export type TokenConfig = {
|
|
|
4
4
|
address: string;
|
|
5
5
|
chainId: string;
|
|
6
6
|
};
|
|
7
|
+
export type NamedTokenConfig = {
|
|
8
|
+
networkName: string;
|
|
9
|
+
/**
|
|
10
|
+
* When omitted, a default token will be selected automatically
|
|
11
|
+
*/
|
|
12
|
+
symbol?: string;
|
|
13
|
+
};
|
|
7
14
|
export interface AppConfig {
|
|
8
15
|
integratorId: string;
|
|
9
16
|
slippage?: SlippageOption;
|
|
@@ -23,8 +30,8 @@ export interface AppConfig {
|
|
|
23
30
|
* If {@link loadPreviousStateFromLocalStorage} is set to true, this will be ignored
|
|
24
31
|
*/
|
|
25
32
|
initialAssets?: {
|
|
26
|
-
from?: TokenConfig;
|
|
27
|
-
to?: TokenConfig;
|
|
33
|
+
from?: TokenConfig | NamedTokenConfig;
|
|
34
|
+
to?: TokenConfig | NamedTokenConfig;
|
|
28
35
|
};
|
|
29
36
|
/**
|
|
30
37
|
* When chains are changed, this allows to choose the first token that will be selected
|
|
@@ -36,6 +36,10 @@ export interface WidgetEventMap {
|
|
|
36
36
|
toChainId?: string;
|
|
37
37
|
fromTokenAddress?: string;
|
|
38
38
|
toTokenAddress?: string;
|
|
39
|
+
fromNetworkName?: string;
|
|
40
|
+
toNetworkName?: string;
|
|
41
|
+
fromTokenSymbol?: string;
|
|
42
|
+
toTokenSymbol?: string;
|
|
39
43
|
};
|
|
40
44
|
swapTxSignatureRequested: {
|
|
41
45
|
route: RouteResponse["route"];
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ export { useTrackSearchEmpty } from "./analytics/useTrackSearchEmpty";
|
|
|
2
2
|
export { useSquidChains } from "./chains/useSquidChains";
|
|
3
3
|
export { useClient } from "./client/useClient";
|
|
4
4
|
export { useCosmosForChain } from "./cosmos/useCosmosForChain";
|
|
5
|
+
export { useHederaAccountActivation } from "./hedera/useHederaAccountActivation";
|
|
5
6
|
export { useHederaTokenAssociations } from "./hedera/useHederaTokenAssociations";
|
|
6
7
|
export { useKeyboardNavigation } from "./navigation/useKeyboardNavigation";
|
|
7
8
|
export * from "./onramp/useFiatToCrypto";
|
|
8
9
|
export { useSquidQueryClient } from "./query/useSquidQueryClient";
|
|
9
10
|
export { useSquid } from "./squid/useSquid";
|
|
10
11
|
export { useStellarAccountActivation } from "./stellar/useStellarAccountActivation";
|
|
11
|
-
export { useHederaAccountActivation } from "./hedera/useHederaAccountActivation";
|
|
12
12
|
export { useAddressBookStore } from "./store/useAddressBookStore";
|
|
13
13
|
export { useAssetsColorsStore } from "./store/useAssetsColorsStore";
|
|
14
14
|
export { useFavoriteTokensStore, type FavoriteToken, } from "./store/useFavoriteTokensStore";
|
|
@@ -19,6 +19,7 @@ export { ConnectingWalletStatus, useWalletStore } from "./store/useWalletStore";
|
|
|
19
19
|
export type { ConnectingWalletState } from "./store/useWalletStore";
|
|
20
20
|
export { useDepositAddress } from "./swap/useDepositAddress";
|
|
21
21
|
export { useSwap } from "./swap/useSwap";
|
|
22
|
+
export { buildUrlSearchParamsFromSwapEvent, parseInitialAssetsFromUrl, useUrlSwapParams, } from "./swap/useUrlSwapParams";
|
|
22
23
|
export { useAllConnectedWalletBalances } from "./tokens/useAllConnectedWalletBalances";
|
|
23
24
|
export { useAllTokensWithBalanceForChainType } from "./tokens/useAllTokensWithBalanceForChainType";
|
|
24
25
|
export { useCosmosBalance, useEvmBalance } from "./tokens/useBalance";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AppConfig } from "../../core/types/config";
|
|
2
|
+
import { buildUrlSearchParamsFromSwapEvent, parseInitialAssetsFromUrl } from "../../services/internal/urlParamsService";
|
|
3
|
+
export { buildUrlSearchParamsFromSwapEvent, parseInitialAssetsFromUrl };
|
|
4
|
+
/**
|
|
5
|
+
* Reads initial swap assets from URL params on mount, and keeps the URL in
|
|
6
|
+
* sync with swap param changes emitted by the widget.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useUrlSwapParams: () => {
|
|
9
|
+
initialAssets: AppConfig["initialAssets"];
|
|
10
|
+
};
|