@multiversx/sdk-dapp-liquidity 1.1.0-alpha.2 → 1.1.0-alpha.21
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/README.md +6 -1
- package/api/getTransactions.d.ts +8 -2
- package/api/getTransactions.js +23 -3
- package/api/getTransactions.mjs +23 -3
- package/api/tests/getChains.spec.js +2 -1
- package/api/tests/getChains.spec.mjs +2 -1
- package/api/tests/getTokens.spec.js +2 -2
- package/api/tests/getTokens.spec.mjs +2 -2
- package/api/tests/getTransactions.spec.js +79 -69
- package/api/tests/getTransactions.spec.mjs +79 -69
- package/constants/index.d.ts +1 -1
- package/constants/index.js +1 -1
- package/constants/index.mjs +1 -1
- package/dto/Chain.dto.d.ts +3 -1
- package/dto/ConfirmRate.dto.d.ts +1 -0
- package/dto/Token.dto.d.ts +7 -2
- package/index.js +44 -16
- package/index.mjs +14 -16
- package/package.json +10 -6
- package/reactjs/components/BridgeForm/BridgeForm.d.ts +3 -1
- package/reactjs/components/BridgeForm/BridgeForm.js +182 -87
- package/reactjs/components/BridgeForm/BridgeForm.mjs +153 -58
- package/reactjs/components/BridgeHistory/BridgeHistory.js +73 -26
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +68 -21
- package/reactjs/components/Connect/BridgeAccountDisplay.js +2 -5
- package/reactjs/components/Connect/BridgeAccountDisplay.mjs +2 -5
- package/reactjs/components/Connect/CustomConnectButton.js +2 -5
- package/reactjs/components/Connect/CustomConnectButton.mjs +1 -4
- package/reactjs/components/Connect/MvxConnectButton.d.ts +2 -4
- package/reactjs/components/Connect/MvxConnectButton.js +2 -2
- package/reactjs/components/Connect/MvxConnectButton.mjs +2 -2
- package/reactjs/components/Connect/SwitchChainButton.js +2 -6
- package/reactjs/components/Connect/SwitchChainButton.mjs +1 -5
- package/reactjs/components/CopyButton/CopyButton.js +2 -2
- package/reactjs/components/CopyButton/CopyButton.mjs +2 -2
- package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +5 -5
- package/reactjs/components/Error/Error.d.ts +6 -0
- package/reactjs/components/Error/Error.js +67 -0
- package/reactjs/components/Error/Error.mjs +66 -0
- package/reactjs/components/Error/index.d.ts +1 -0
- package/reactjs/components/Error/index.js +5 -0
- package/reactjs/components/Error/index.mjs +4 -0
- package/reactjs/components/TokenSelector/TokenSelector.d.ts +2 -1
- package/reactjs/components/TokenSelector/TokenSelector.js +17 -9
- package/reactjs/components/TokenSelector/TokenSelector.mjs +13 -5
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +2 -1
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +7 -3
- package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +4 -0
- package/reactjs/components/TokenSelector/components/SelectContent.d.ts +2 -1
- package/reactjs/components/TokenSelector/components/SelectContent.js +12 -9
- package/reactjs/components/TokenSelector/components/SelectContent.mjs +4 -1
- package/reactjs/components/TokenSelector/components/TokenIcon.js +3 -3
- package/reactjs/components/TokenSelector/components/TokenItem.js +9 -9
- package/reactjs/components/TokenSelector/components/TokenItem.mjs +6 -6
- package/reactjs/components/base/MxCard/MxCard.js +2 -2
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.d.ts +4 -0
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +29 -0
- package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +28 -0
- package/reactjs/components/base/MxCircleLoader/index.d.ts +1 -0
- package/reactjs/components/base/MxCircleLoader/index.js +5 -0
- package/reactjs/components/base/MxCircleLoader/index.mjs +4 -0
- package/reactjs/components/base/MxLink/MxLink.js +2 -2
- package/reactjs/components/base/MxSearch/MxSearch.js +4 -4
- package/reactjs/components/base/MxSlideover/MxSlideover.js +4 -4
- package/reactjs/components/base/MxTooltip/MxTooltip.js +9 -9
- package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +2 -2
- package/reactjs/components/index.d.ts +1 -0
- package/reactjs/components/index.js +2 -0
- package/reactjs/components/index.mjs +2 -0
- package/reactjs/context/Web3AppProvider.d.ts +3 -1
- package/reactjs/context/Web3AppProvider.js +7 -5
- package/reactjs/context/Web3AppProvider.mjs +4 -2
- package/reactjs/context/useWeb3App.js +2 -2
- package/reactjs/hooks/index.js +1 -1
- package/reactjs/hooks/index.mjs +1 -1
- package/reactjs/hooks/useAccount.js +1 -5
- package/reactjs/hooks/useAccount.mjs +1 -5
- package/reactjs/hooks/useBalances.d.ts +4 -4
- package/reactjs/hooks/useBalances.js +16 -1
- package/reactjs/hooks/useBalances.mjs +16 -1
- package/reactjs/hooks/useBridgeFormik.js +9 -16
- package/reactjs/hooks/useBridgeFormik.mjs +0 -7
- package/reactjs/hooks/useDebounce.js +3 -3
- package/reactjs/hooks/useFetchBridgeData.d.ts +14 -4
- package/reactjs/hooks/useFetchTokens.d.ts +14 -4
- package/reactjs/hooks/useFetchTokens.js +9 -9
- package/reactjs/hooks/useFetchTokens.mjs +2 -2
- package/reactjs/hooks/useFiatData.d.ts +7 -2
- package/reactjs/hooks/useFiatData.js +6 -6
- package/reactjs/hooks/useFiatData.mjs +1 -1
- package/reactjs/hooks/useGetChainId.js +3 -3
- package/reactjs/hooks/useGetChainId.mjs +1 -1
- package/reactjs/hooks/useResolveTokenChain.js +2 -2
- package/reactjs/hooks/useSendTransactions.js +2 -2
- package/reactjs/hooks/useSignTransaction.d.ts +93 -67
- package/reactjs/hooks/useSignTransaction.js +53 -4
- package/reactjs/hooks/useSignTransaction.mjs +53 -4
- package/reactjs/hooks/validation/useTestHasEnoughFunds.js +3 -3
- package/reactjs/hooks/validation/useTestIsConnected.js +2 -2
- package/reactjs/index.js +44 -16
- package/reactjs/index.mjs +14 -16
- package/reactjs/init/init.d.ts +220 -1
- package/reactjs/init/init.js +34 -10
- package/reactjs/init/init.mjs +31 -7
- package/reactjs/init/tests/init.spec.js +5 -6
- package/reactjs/init/tests/init.spec.mjs +5 -6
- package/reactjs/queries/index.d.ts +0 -1
- package/reactjs/queries/index.js +0 -2
- package/reactjs/queries/index.mjs +1 -3
- package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +8 -3
- package/reactjs/queries/useGetEvmTokensBalances.query.js +15 -18
- package/reactjs/queries/useGetEvmTokensBalances.query.mjs +15 -18
- package/reactjs/queries/useGetHistory.query.d.ts +9 -1
- package/reactjs/queries/useGetHistory.query.js +23 -5
- package/reactjs/queries/useGetHistory.query.mjs +23 -5
- package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +7 -2
- package/reactjs/queries/useGetMvxTokensBalances.query.js +2 -2
- package/reactjs/reexports.d.ts +2 -1
- package/reactjs/reexports.js +41 -13
- package/reactjs/reexports.mjs +11 -13
- package/reactjs/utils/getInitialTokens.d.ts +4 -1
- package/reactjs/utils/getInitialTokens.js +3 -3
- package/reactjs/utils/getInitialTokens.mjs +3 -3
- package/style.css +33 -1730
- package/types/chainType.d.ts +6 -0
- package/types/chainType.js +11 -0
- package/types/chainType.mjs +10 -0
- package/types/transaction.d.ts +28 -0
- package/types/utxo.d.ts +11 -0
- package/types/utxo.js +2 -0
- package/types/utxo.mjs +1 -0
- package/{useBalances-C_69CFoa.mjs → useBalances-Bom1mw1J.mjs} +101 -23
- package/{useBalances-C4YhEYxy.js → useBalances-gZTsFZHe.js} +102 -24
- package/index-BIVnypNe.mjs +0 -108
- package/index-Ben8n3bd.js +0 -58656
- package/index-CnKr4rL1.mjs +0 -91
- package/index-CnuruJNu.js +0 -329
- package/index-DsBh-EBw.js +0 -108
- package/index-iN9APQ6x.mjs +0 -58735
- package/modules/fiat/components/FiatForm/FiatForm.d.ts +0 -9
- package/modules/fiat/components/FiatForm/FiatForm.js +0 -314
- package/modules/fiat/components/FiatForm/FiatForm.mjs +0 -313
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.d.ts +0 -13
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.js +0 -117
- package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.mjs +0 -116
- package/modules/fiat/components/FiatForm/components/AmountInput/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/components/AmountInput/index.js +0 -5
- package/modules/fiat/components/FiatForm/components/AmountInput/index.mjs +0 -4
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.js +0 -74
- package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.mjs +0 -73
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.d.ts +0 -14
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.js +0 -94
- package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.mjs +0 -93
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.js +0 -82
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.mjs +0 -81
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.js +0 -91
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.mjs +0 -90
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.d.ts +0 -5
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.js +0 -30
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.mjs +0 -29
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.d.ts +0 -8
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.js +0 -103
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.mjs +0 -102
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.js +0 -33
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.mjs +0 -32
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.d.ts +0 -7
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.js +0 -21
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.mjs +0 -20
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.d.ts +0 -9
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.js +0 -26
- package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.mjs +0 -25
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.js +0 -5
- package/modules/fiat/components/FiatForm/components/TokenSelector/index.mjs +0 -4
- package/modules/fiat/components/FiatForm/index.d.ts +0 -1
- package/modules/fiat/components/FiatForm/index.js +0 -5
- package/modules/fiat/components/FiatForm/index.mjs +0 -4
- package/modules/fiat/components/index.d.ts +0 -1
- package/modules/fiat/components/index.js +0 -5
- package/modules/fiat/components/index.mjs +0 -4
- package/modules/fiat/context/FiatProvider.d.ts +0 -8
- package/modules/fiat/context/FiatProvider.js +0 -24
- package/modules/fiat/context/FiatProvider.mjs +0 -23
- package/modules/fiat/context/queryClient.d.ts +0 -3
- package/modules/fiat/context/queryClient.js +0 -12
- package/modules/fiat/context/queryClient.mjs +0 -11
- package/modules/fiat/context/useFiat.d.ts +0 -1
- package/modules/fiat/context/useFiat.js +0 -13
- package/modules/fiat/context/useFiat.mjs +0 -12
- package/modules/fiat/hooks/index.d.ts +0 -2
- package/modules/fiat/hooks/index.js +0 -7
- package/modules/fiat/hooks/index.mjs +0 -6
- package/modules/fiat/hooks/useFiatData.d.ts +0 -7
- package/modules/fiat/hooks/useFiatData.js +0 -75
- package/modules/fiat/hooks/useFiatData.mjs +0 -74
- package/modules/fiat/hooks/validation/index.d.ts +0 -1
- package/modules/fiat/hooks/validation/index.js +0 -5
- package/modules/fiat/hooks/validation/index.mjs +0 -4
- package/modules/fiat/hooks/validation/useAmountSchema.d.ts +0 -2
- package/modules/fiat/hooks/validation/useAmountSchema.js +0 -27
- package/modules/fiat/hooks/validation/useAmountSchema.mjs +0 -9
- package/modules/fiat/index.d.ts +0 -8
- package/modules/fiat/index.js +0 -22
- package/modules/fiat/index.mjs +0 -21
- package/modules/fiat/init/index.d.ts +0 -2
- package/modules/fiat/init/index.js +0 -5
- package/modules/fiat/init/index.mjs +0 -4
- package/modules/fiat/init/init.d.ts +0 -22
- package/modules/fiat/init/init.js +0 -15
- package/modules/fiat/init/init.mjs +0 -14
- package/modules/fiat/queries/index.d.ts +0 -2
- package/modules/fiat/queries/index.js +0 -7
- package/modules/fiat/queries/index.mjs +0 -6
- package/modules/fiat/queries/useGetRate.mutation.d.ts +0 -6
- package/modules/fiat/queries/useGetRate.mutation.js +0 -20
- package/modules/fiat/queries/useGetRate.mutation.mjs +0 -19
- package/modules/fiat/queries/useGetTokens.query.d.ts +0 -5
- package/modules/fiat/queries/useGetTokens.query.js +0 -33
- package/modules/fiat/queries/useGetTokens.query.mjs +0 -32
- package/react-47kZTyAT.mjs +0 -51
- package/react-B_iI3-1z.mjs +0 -3133
- package/react-BomcNL1v.js +0 -254
- package/react-CqKlu0W0.js +0 -51
- package/react-R_xxu7fN.js +0 -3133
- package/react-cXurUY4Z.mjs +0 -254
- package/reactjs/queries/useGetTokens.query.d.ts +0 -3
- package/reactjs/queries/useGetTokens.query.js +0 -34
- package/reactjs/queries/useGetTokens.query.mjs +0 -33
- package/w3m-modal-Bhg44d6I.js +0 -356
- package/w3m-modal-Br2Ec3MM.mjs +0 -356
package/reactjs/init/init.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CreateConfigParameters } from '@wagmi/core';
|
|
2
|
+
import { AppKitNetwork } from '@reown/appkit-common';
|
|
2
3
|
import { AppKitOptions } from '@reown/appkit/react';
|
|
3
4
|
|
|
4
5
|
export type InitOptions = {
|
|
@@ -13,7 +14,7 @@ export type InitOptions = {
|
|
|
13
14
|
/**
|
|
14
15
|
* Accepted chain IDs. The chains with ids [31, 44, 54] will be ignored as these are mapped to the mvx networks as [1, D, T]
|
|
15
16
|
*/
|
|
16
|
-
acceptedChainIDs:
|
|
17
|
+
acceptedChainIDs: string[];
|
|
17
18
|
/**
|
|
18
19
|
* Accepted connectors IDs
|
|
19
20
|
*/
|
|
@@ -44,4 +45,222 @@ export declare function init(options: InitOptions): {
|
|
|
44
45
|
config: import('@wagmi/core').Config;
|
|
45
46
|
appKit: import('@reown/appkit/react').AppKit;
|
|
46
47
|
options: InitOptions;
|
|
48
|
+
supportedChains: ({
|
|
49
|
+
blockExplorers: {
|
|
50
|
+
readonly default: {
|
|
51
|
+
readonly name: "Solscan";
|
|
52
|
+
readonly url: "https://solscan.io";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
contracts?: {
|
|
56
|
+
[x: string]: import('viem').ChainContract | {
|
|
57
|
+
[sourceId: number]: import('viem').ChainContract | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
ensRegistry?: import('viem').ChainContract | undefined;
|
|
60
|
+
ensUniversalResolver?: import('viem').ChainContract | undefined;
|
|
61
|
+
multicall3?: import('viem').ChainContract | undefined;
|
|
62
|
+
universalSignatureVerifier?: import('viem').ChainContract | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
name: "Solana";
|
|
65
|
+
nativeCurrency: {
|
|
66
|
+
readonly name: "Solana";
|
|
67
|
+
readonly symbol: "SOL";
|
|
68
|
+
readonly decimals: 9;
|
|
69
|
+
};
|
|
70
|
+
rpcUrls: {
|
|
71
|
+
readonly default: {
|
|
72
|
+
readonly http: readonly ["https://rpc.walletconnect.org/v1"];
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
sourceId?: number | undefined | undefined;
|
|
76
|
+
testnet: false;
|
|
77
|
+
custom?: Record<string, unknown> | undefined;
|
|
78
|
+
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
79
|
+
formatters?: undefined;
|
|
80
|
+
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
81
|
+
id: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
82
|
+
chainNamespace: "solana";
|
|
83
|
+
caipNetworkId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
84
|
+
assets?: {
|
|
85
|
+
imageId: string | undefined;
|
|
86
|
+
imageUrl: string | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
readonly network: "solana-mainnet";
|
|
89
|
+
readonly deprecatedCaipNetworkId: "solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ";
|
|
90
|
+
} | {
|
|
91
|
+
blockExplorers: {
|
|
92
|
+
readonly default: {
|
|
93
|
+
readonly name: "Solscan";
|
|
94
|
+
readonly url: "https://solscan.io";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
contracts?: {
|
|
98
|
+
[x: string]: import('viem').ChainContract | {
|
|
99
|
+
[sourceId: number]: import('viem').ChainContract | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
ensRegistry?: import('viem').ChainContract | undefined;
|
|
102
|
+
ensUniversalResolver?: import('viem').ChainContract | undefined;
|
|
103
|
+
multicall3?: import('viem').ChainContract | undefined;
|
|
104
|
+
universalSignatureVerifier?: import('viem').ChainContract | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
name: "Solana Devnet";
|
|
107
|
+
nativeCurrency: {
|
|
108
|
+
readonly name: "Solana";
|
|
109
|
+
readonly symbol: "SOL";
|
|
110
|
+
readonly decimals: 9;
|
|
111
|
+
};
|
|
112
|
+
rpcUrls: {
|
|
113
|
+
readonly default: {
|
|
114
|
+
readonly http: readonly ["https://rpc.walletconnect.org/v1"];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
sourceId?: number | undefined | undefined;
|
|
118
|
+
testnet: true;
|
|
119
|
+
custom?: Record<string, unknown> | undefined;
|
|
120
|
+
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
121
|
+
formatters?: undefined;
|
|
122
|
+
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
123
|
+
id: "EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
|
|
124
|
+
chainNamespace: "solana";
|
|
125
|
+
caipNetworkId: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
|
|
126
|
+
assets?: {
|
|
127
|
+
imageId: string | undefined;
|
|
128
|
+
imageUrl: string | undefined;
|
|
129
|
+
} | undefined;
|
|
130
|
+
readonly network: "solana-devnet";
|
|
131
|
+
readonly deprecatedCaipNetworkId: "solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K";
|
|
132
|
+
} | {
|
|
133
|
+
blockExplorers: {
|
|
134
|
+
readonly default: {
|
|
135
|
+
readonly name: "Solscan";
|
|
136
|
+
readonly url: "https://solscan.io";
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
contracts?: {
|
|
140
|
+
[x: string]: import('viem').ChainContract | {
|
|
141
|
+
[sourceId: number]: import('viem').ChainContract | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
ensRegistry?: import('viem').ChainContract | undefined;
|
|
144
|
+
ensUniversalResolver?: import('viem').ChainContract | undefined;
|
|
145
|
+
multicall3?: import('viem').ChainContract | undefined;
|
|
146
|
+
universalSignatureVerifier?: import('viem').ChainContract | undefined;
|
|
147
|
+
} | undefined;
|
|
148
|
+
name: "Solana Testnet";
|
|
149
|
+
nativeCurrency: {
|
|
150
|
+
readonly name: "Solana";
|
|
151
|
+
readonly symbol: "SOL";
|
|
152
|
+
readonly decimals: 9;
|
|
153
|
+
};
|
|
154
|
+
rpcUrls: {
|
|
155
|
+
readonly default: {
|
|
156
|
+
readonly http: readonly ["https://rpc.walletconnect.org/v1"];
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
sourceId?: number | undefined | undefined;
|
|
160
|
+
testnet: true;
|
|
161
|
+
custom?: Record<string, unknown> | undefined;
|
|
162
|
+
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
163
|
+
formatters?: undefined;
|
|
164
|
+
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
165
|
+
id: "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z";
|
|
166
|
+
chainNamespace: "solana";
|
|
167
|
+
caipNetworkId: "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z";
|
|
168
|
+
assets?: {
|
|
169
|
+
imageId: string | undefined;
|
|
170
|
+
imageUrl: string | undefined;
|
|
171
|
+
} | undefined;
|
|
172
|
+
readonly network: "solana-testnet";
|
|
173
|
+
} | {
|
|
174
|
+
blockExplorers?: {
|
|
175
|
+
[key: string]: {
|
|
176
|
+
name: string;
|
|
177
|
+
url: string;
|
|
178
|
+
apiUrl?: string | undefined;
|
|
179
|
+
};
|
|
180
|
+
default: {
|
|
181
|
+
name: string;
|
|
182
|
+
url: string;
|
|
183
|
+
apiUrl?: string | undefined;
|
|
184
|
+
};
|
|
185
|
+
} | undefined | undefined;
|
|
186
|
+
contracts?: {
|
|
187
|
+
[x: string]: import('viem').ChainContract | {
|
|
188
|
+
[sourceId: number]: import('viem').ChainContract | undefined;
|
|
189
|
+
} | undefined;
|
|
190
|
+
ensRegistry?: import('viem').ChainContract | undefined;
|
|
191
|
+
ensUniversalResolver?: import('viem').ChainContract | undefined;
|
|
192
|
+
multicall3?: import('viem').ChainContract | undefined;
|
|
193
|
+
universalSignatureVerifier?: import('viem').ChainContract | undefined;
|
|
194
|
+
} | undefined;
|
|
195
|
+
name: "Bitcoin";
|
|
196
|
+
nativeCurrency: {
|
|
197
|
+
readonly name: "Bitcoin";
|
|
198
|
+
readonly symbol: "BTC";
|
|
199
|
+
readonly decimals: 8;
|
|
200
|
+
};
|
|
201
|
+
rpcUrls: {
|
|
202
|
+
readonly default: {
|
|
203
|
+
readonly http: readonly ["https://rpc.walletconnect.org/v1"];
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
sourceId?: number | undefined | undefined;
|
|
207
|
+
testnet?: boolean | undefined | undefined;
|
|
208
|
+
custom?: Record<string, unknown> | undefined;
|
|
209
|
+
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
210
|
+
formatters?: undefined;
|
|
211
|
+
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
212
|
+
id: "000000000019d6689c085ae165831e93";
|
|
213
|
+
chainNamespace: "bip122";
|
|
214
|
+
caipNetworkId: "bip122:000000000019d6689c085ae165831e93";
|
|
215
|
+
assets?: {
|
|
216
|
+
imageId: string | undefined;
|
|
217
|
+
imageUrl: string | undefined;
|
|
218
|
+
} | undefined;
|
|
219
|
+
} | {
|
|
220
|
+
blockExplorers?: {
|
|
221
|
+
[key: string]: {
|
|
222
|
+
name: string;
|
|
223
|
+
url: string;
|
|
224
|
+
apiUrl?: string | undefined;
|
|
225
|
+
};
|
|
226
|
+
default: {
|
|
227
|
+
name: string;
|
|
228
|
+
url: string;
|
|
229
|
+
apiUrl?: string | undefined;
|
|
230
|
+
};
|
|
231
|
+
} | undefined | undefined;
|
|
232
|
+
contracts?: {
|
|
233
|
+
[x: string]: import('viem').ChainContract | {
|
|
234
|
+
[sourceId: number]: import('viem').ChainContract | undefined;
|
|
235
|
+
} | undefined;
|
|
236
|
+
ensRegistry?: import('viem').ChainContract | undefined;
|
|
237
|
+
ensUniversalResolver?: import('viem').ChainContract | undefined;
|
|
238
|
+
multicall3?: import('viem').ChainContract | undefined;
|
|
239
|
+
universalSignatureVerifier?: import('viem').ChainContract | undefined;
|
|
240
|
+
} | undefined;
|
|
241
|
+
name: "Bitcoin Testnet";
|
|
242
|
+
nativeCurrency: {
|
|
243
|
+
readonly name: "Bitcoin";
|
|
244
|
+
readonly symbol: "BTC";
|
|
245
|
+
readonly decimals: 8;
|
|
246
|
+
};
|
|
247
|
+
rpcUrls: {
|
|
248
|
+
readonly default: {
|
|
249
|
+
readonly http: readonly ["https://rpc.walletconnect.org/v1"];
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
sourceId?: number | undefined | undefined;
|
|
253
|
+
testnet: true;
|
|
254
|
+
custom?: Record<string, unknown> | undefined;
|
|
255
|
+
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
256
|
+
formatters?: undefined;
|
|
257
|
+
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
258
|
+
id: "000000000933ea01ad0ee984209779ba";
|
|
259
|
+
chainNamespace: "bip122";
|
|
260
|
+
caipNetworkId: "bip122:000000000933ea01ad0ee984209779ba";
|
|
261
|
+
assets?: {
|
|
262
|
+
imageId: string | undefined;
|
|
263
|
+
imageUrl: string | undefined;
|
|
264
|
+
} | undefined;
|
|
265
|
+
} | AppKitNetwork)[];
|
|
47
266
|
};
|
package/reactjs/init/init.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const
|
|
4
|
+
const networks = require("@reown/appkit/networks");
|
|
5
|
+
const react$1 = require("@reown/appkit/react");
|
|
6
|
+
const appkitAdapterBitcoin = require("@reown/appkit-adapter-bitcoin");
|
|
7
|
+
const react = require("@reown/appkit-adapter-solana/react");
|
|
5
8
|
const appkitAdapterWagmi = require("@reown/appkit-adapter-wagmi");
|
|
6
|
-
const
|
|
9
|
+
const viemNetworks = require("viem/chains");
|
|
7
10
|
const constants_index = require("../../constants/index.js");
|
|
8
11
|
const store_inMemoryStore = require("../../store/inMemoryStore.js");
|
|
9
12
|
function _interopNamespaceDefault(e) {
|
|
@@ -22,7 +25,7 @@ function _interopNamespaceDefault(e) {
|
|
|
22
25
|
n.default = e;
|
|
23
26
|
return Object.freeze(n);
|
|
24
27
|
}
|
|
25
|
-
const
|
|
28
|
+
const viemNetworks__namespace = /* @__PURE__ */ _interopNamespaceDefault(viemNetworks);
|
|
26
29
|
function init(options) {
|
|
27
30
|
const store = store_inMemoryStore.InMemoryStore.getInstance();
|
|
28
31
|
store.setItem("apiURL", options.apiURL);
|
|
@@ -30,24 +33,45 @@ function init(options) {
|
|
|
30
33
|
store.setItem("mvxApiURL", options.mvxApiURL);
|
|
31
34
|
store.setItem("mvxExplorerAddress", options.mvxExplorerAddress);
|
|
32
35
|
store.setItem("mvxChainId", options.mvxChainId);
|
|
33
|
-
const
|
|
34
|
-
|
|
36
|
+
const networks$1 = {
|
|
37
|
+
solana: networks.solana,
|
|
38
|
+
solanaDevnet: networks.solanaDevnet,
|
|
39
|
+
solanaTestnet: networks.solanaTestnet,
|
|
40
|
+
bitcoin: networks.bitcoin,
|
|
41
|
+
bitcoinTestnet: networks.bitcoinTestnet,
|
|
42
|
+
...viemNetworks__namespace
|
|
43
|
+
};
|
|
44
|
+
const acceptedNetworks = Object.values(networks$1).filter(
|
|
45
|
+
(chain) => options.acceptedChainIDs.includes(chain.id.toString()) && !constants_index.MVX_CHAIN_IDS.includes(chain.id.toString())
|
|
35
46
|
).map((network) => network);
|
|
47
|
+
const supportedChains = [
|
|
48
|
+
...acceptedNetworks,
|
|
49
|
+
networks.bitcoin,
|
|
50
|
+
networks.bitcoinTestnet,
|
|
51
|
+
networks.solana,
|
|
52
|
+
networks.solanaDevnet,
|
|
53
|
+
networks.solanaTestnet
|
|
54
|
+
];
|
|
36
55
|
const wagmiAdapter = new appkitAdapterWagmi.WagmiAdapter({
|
|
37
56
|
...options.adapterConfig,
|
|
38
57
|
ssr: options.adapterConfig.ssr ?? true,
|
|
39
58
|
projectId: options.appKitOptions.projectId,
|
|
40
|
-
networks:
|
|
59
|
+
networks: supportedChains
|
|
60
|
+
});
|
|
61
|
+
const solanaAdapter = new react.SolanaAdapter();
|
|
62
|
+
const bitcoinAdapter = new appkitAdapterBitcoin.BitcoinAdapter({
|
|
63
|
+
projectId: options.appKitOptions.projectId
|
|
41
64
|
});
|
|
42
|
-
const appKit = react.createAppKit({
|
|
65
|
+
const appKit = react$1.createAppKit({
|
|
43
66
|
...options.appKitOptions,
|
|
44
|
-
adapters: [wagmiAdapter],
|
|
45
|
-
networks: [
|
|
67
|
+
adapters: [wagmiAdapter, solanaAdapter, bitcoinAdapter],
|
|
68
|
+
networks: [supportedChains[0], ...supportedChains.slice(1)]
|
|
46
69
|
});
|
|
47
70
|
return {
|
|
48
71
|
config: wagmiAdapter.wagmiConfig,
|
|
49
72
|
appKit,
|
|
50
|
-
options
|
|
73
|
+
options,
|
|
74
|
+
supportedChains
|
|
51
75
|
};
|
|
52
76
|
}
|
|
53
77
|
exports.init = init;
|
package/reactjs/init/init.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bitcoinTestnet, bitcoin, solanaTestnet, solanaDevnet, solana } from "@reown/appkit/networks";
|
|
2
|
+
import { createAppKit } from "@reown/appkit/react";
|
|
3
|
+
import { BitcoinAdapter } from "@reown/appkit-adapter-bitcoin";
|
|
4
|
+
import { SolanaAdapter } from "@reown/appkit-adapter-solana/react";
|
|
2
5
|
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
|
|
3
|
-
import * as
|
|
6
|
+
import * as viemNetworks from "viem/chains";
|
|
4
7
|
import { MVX_CHAIN_IDS } from "../../constants/index.mjs";
|
|
5
8
|
import { InMemoryStore } from "../../store/inMemoryStore.mjs";
|
|
6
9
|
function init(options) {
|
|
@@ -10,24 +13,45 @@ function init(options) {
|
|
|
10
13
|
store.setItem("mvxApiURL", options.mvxApiURL);
|
|
11
14
|
store.setItem("mvxExplorerAddress", options.mvxExplorerAddress);
|
|
12
15
|
store.setItem("mvxChainId", options.mvxChainId);
|
|
16
|
+
const networks = {
|
|
17
|
+
solana,
|
|
18
|
+
solanaDevnet,
|
|
19
|
+
solanaTestnet,
|
|
20
|
+
bitcoin,
|
|
21
|
+
bitcoinTestnet,
|
|
22
|
+
...viemNetworks
|
|
23
|
+
};
|
|
13
24
|
const acceptedNetworks = Object.values(networks).filter(
|
|
14
|
-
(chain) => options.acceptedChainIDs.includes(
|
|
25
|
+
(chain) => options.acceptedChainIDs.includes(chain.id.toString()) && !MVX_CHAIN_IDS.includes(chain.id.toString())
|
|
15
26
|
).map((network) => network);
|
|
27
|
+
const supportedChains = [
|
|
28
|
+
...acceptedNetworks,
|
|
29
|
+
bitcoin,
|
|
30
|
+
bitcoinTestnet,
|
|
31
|
+
solana,
|
|
32
|
+
solanaDevnet,
|
|
33
|
+
solanaTestnet
|
|
34
|
+
];
|
|
16
35
|
const wagmiAdapter = new WagmiAdapter({
|
|
17
36
|
...options.adapterConfig,
|
|
18
37
|
ssr: options.adapterConfig.ssr ?? true,
|
|
19
38
|
projectId: options.appKitOptions.projectId,
|
|
20
|
-
networks:
|
|
39
|
+
networks: supportedChains
|
|
40
|
+
});
|
|
41
|
+
const solanaAdapter = new SolanaAdapter();
|
|
42
|
+
const bitcoinAdapter = new BitcoinAdapter({
|
|
43
|
+
projectId: options.appKitOptions.projectId
|
|
21
44
|
});
|
|
22
45
|
const appKit = createAppKit({
|
|
23
46
|
...options.appKitOptions,
|
|
24
|
-
adapters: [wagmiAdapter],
|
|
25
|
-
networks: [
|
|
47
|
+
adapters: [wagmiAdapter, solanaAdapter, bitcoinAdapter],
|
|
48
|
+
networks: [supportedChains[0], ...supportedChains.slice(1)]
|
|
26
49
|
});
|
|
27
50
|
return {
|
|
28
51
|
config: wagmiAdapter.wagmiConfig,
|
|
29
52
|
appKit,
|
|
30
|
-
options
|
|
53
|
+
options,
|
|
54
|
+
supportedChains
|
|
31
55
|
};
|
|
32
56
|
}
|
|
33
57
|
export {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
const networks = require("
|
|
4
|
-
require("
|
|
5
|
-
const react = require("../../../react-R_xxu7fN.js");
|
|
3
|
+
const networks = require("@reown/appkit/networks");
|
|
4
|
+
const react = require("@reown/appkit/react");
|
|
6
5
|
const appkitAdapterWagmi = require("@reown/appkit-adapter-wagmi");
|
|
7
6
|
const connectors = require("wagmi/connectors");
|
|
8
7
|
const reactjs_init_init = require("../init.js");
|
|
@@ -38,7 +37,7 @@ describe("init", () => {
|
|
|
38
37
|
metadata: mockMetadata,
|
|
39
38
|
debug: true
|
|
40
39
|
},
|
|
41
|
-
acceptedChainIDs: [1],
|
|
40
|
+
acceptedChainIDs: ["1"],
|
|
42
41
|
apiURL: "https://localhost:3000",
|
|
43
42
|
bridgeURL: "https://devnet-bridge.example.com",
|
|
44
43
|
mvxApiURL: "https://devnet-api.multiversx.com",
|
|
@@ -69,7 +68,7 @@ describe("init", () => {
|
|
|
69
68
|
projectId: projectID,
|
|
70
69
|
metadata: mockMetadata
|
|
71
70
|
},
|
|
72
|
-
acceptedChainIDs: [1],
|
|
71
|
+
acceptedChainIDs: ["1"],
|
|
73
72
|
apiURL: "https://localhost:3000",
|
|
74
73
|
bridgeURL: "https://devnet-bridge.example.com",
|
|
75
74
|
mvxApiURL: "https://devnet-api.multiversx.com",
|
|
@@ -91,7 +90,7 @@ describe("init", () => {
|
|
|
91
90
|
metadata: mockMetadata,
|
|
92
91
|
debug: false
|
|
93
92
|
},
|
|
94
|
-
acceptedChainIDs: [1],
|
|
93
|
+
acceptedChainIDs: ["1"],
|
|
95
94
|
apiURL: "https://localhost:3000",
|
|
96
95
|
bridgeURL: "https://devnet-bridge.example.com",
|
|
97
96
|
mvxApiURL: "https://devnet-api.multiversx.com",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { mainnet } from "
|
|
2
|
-
import "
|
|
3
|
-
import { c as createAppKit } from "../../../react-B_iI3-1z.mjs";
|
|
1
|
+
import { mainnet } from "@reown/appkit/networks";
|
|
2
|
+
import { createAppKit } from "@reown/appkit/react";
|
|
4
3
|
import { WagmiAdapter } from "@reown/appkit-adapter-wagmi";
|
|
5
4
|
import { injected, walletConnect } from "wagmi/connectors";
|
|
6
5
|
import { init } from "../init.mjs";
|
|
@@ -36,7 +35,7 @@ describe("init", () => {
|
|
|
36
35
|
metadata: mockMetadata,
|
|
37
36
|
debug: true
|
|
38
37
|
},
|
|
39
|
-
acceptedChainIDs: [1],
|
|
38
|
+
acceptedChainIDs: ["1"],
|
|
40
39
|
apiURL: "https://localhost:3000",
|
|
41
40
|
bridgeURL: "https://devnet-bridge.example.com",
|
|
42
41
|
mvxApiURL: "https://devnet-api.multiversx.com",
|
|
@@ -67,7 +66,7 @@ describe("init", () => {
|
|
|
67
66
|
projectId: projectID,
|
|
68
67
|
metadata: mockMetadata
|
|
69
68
|
},
|
|
70
|
-
acceptedChainIDs: [1],
|
|
69
|
+
acceptedChainIDs: ["1"],
|
|
71
70
|
apiURL: "https://localhost:3000",
|
|
72
71
|
bridgeURL: "https://devnet-bridge.example.com",
|
|
73
72
|
mvxApiURL: "https://devnet-api.multiversx.com",
|
|
@@ -89,7 +88,7 @@ describe("init", () => {
|
|
|
89
88
|
metadata: mockMetadata,
|
|
90
89
|
debug: false
|
|
91
90
|
},
|
|
92
|
-
acceptedChainIDs: [1],
|
|
91
|
+
acceptedChainIDs: ["1"],
|
|
93
92
|
apiURL: "https://localhost:3000",
|
|
94
93
|
bridgeURL: "https://devnet-bridge.example.com",
|
|
95
94
|
mvxApiURL: "https://devnet-api.multiversx.com",
|
package/reactjs/queries/index.js
CHANGED
|
@@ -7,7 +7,6 @@ const reactjs_queries_useGetEvmTokensBalances_query = require("./useGetEvmTokens
|
|
|
7
7
|
const reactjs_queries_useGetHistory_query = require("./useGetHistory.query.js");
|
|
8
8
|
const reactjs_queries_useGetMvxTokensBalances_query = require("./useGetMvxTokensBalances.query.js");
|
|
9
9
|
const reactjs_queries_useGetRate_mutation = require("./useGetRate.mutation.js");
|
|
10
|
-
const reactjs_queries_useGetTokens_query = require("./useGetTokens.query.js");
|
|
11
10
|
exports.useGetAllTokensQuery = reactjs_queries_useGetAllTokens_query.useGetAllTokensQuery;
|
|
12
11
|
exports.useGetChainsQuery = reactjs_queries_useGetChains_query.useGetChainsQuery;
|
|
13
12
|
exports.invalidateEvmTokensBalances = reactjs_queries_useGetEvmTokensBalances_query.invalidateEvmTokensBalances;
|
|
@@ -17,4 +16,3 @@ exports.useGetHistoryQuery = reactjs_queries_useGetHistory_query.useGetHistoryQu
|
|
|
17
16
|
exports.invalidateMvxTokensBalancesQuery = reactjs_queries_useGetMvxTokensBalances_query.invalidateMvxTokensBalancesQuery;
|
|
18
17
|
exports.useGetMvxTokensBalancesQuery = reactjs_queries_useGetMvxTokensBalances_query.useGetMvxTokensBalancesQuery;
|
|
19
18
|
exports.useGetRateMutation = reactjs_queries_useGetRate_mutation.useGetRateMutation;
|
|
20
|
-
exports.useGetTokensQuery = reactjs_queries_useGetTokens_query.useGetTokensQuery;
|
|
@@ -4,7 +4,6 @@ import { invalidateEvmTokensBalances, useGetEvmTokensBalancesQuery } from "./use
|
|
|
4
4
|
import { invalidateHistoryQuery, useGetHistoryQuery } from "./useGetHistory.query.mjs";
|
|
5
5
|
import { invalidateMvxTokensBalancesQuery, useGetMvxTokensBalancesQuery } from "./useGetMvxTokensBalances.query.mjs";
|
|
6
6
|
import { useGetRateMutation } from "./useGetRate.mutation.mjs";
|
|
7
|
-
import { useGetTokensQuery } from "./useGetTokens.query.mjs";
|
|
8
7
|
export {
|
|
9
8
|
invalidateEvmTokensBalances,
|
|
10
9
|
invalidateHistoryQuery,
|
|
@@ -14,6 +13,5 @@ export {
|
|
|
14
13
|
useGetEvmTokensBalancesQuery,
|
|
15
14
|
useGetHistoryQuery,
|
|
16
15
|
useGetMvxTokensBalancesQuery,
|
|
17
|
-
useGetRateMutation
|
|
18
|
-
useGetTokensQuery
|
|
16
|
+
useGetRateMutation
|
|
19
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TokenType } from '../../types
|
|
1
|
+
import { TokenType } from '../../types';
|
|
2
2
|
import { AxiosError } from 'axios';
|
|
3
3
|
|
|
4
4
|
export declare const useGetEvmTokensBalancesQuery: ({ tokens, chainId }: {
|
|
@@ -6,7 +6,7 @@ export declare const useGetEvmTokensBalancesQuery: ({ tokens, chainId }: {
|
|
|
6
6
|
chainId?: string;
|
|
7
7
|
}) => import('@tanstack/react-query').UseQueryResult<{
|
|
8
8
|
balance: string;
|
|
9
|
-
chainId:
|
|
9
|
+
chainId: string;
|
|
10
10
|
address: string;
|
|
11
11
|
name: string;
|
|
12
12
|
symbol: string;
|
|
@@ -18,6 +18,11 @@ export declare const useGetEvmTokensBalancesQuery: ({ tokens, chainId }: {
|
|
|
18
18
|
minBridgeAmount: string;
|
|
19
19
|
maxBridgeAmount: string;
|
|
20
20
|
};
|
|
21
|
-
availableTokens?:
|
|
21
|
+
availableTokens?: {
|
|
22
|
+
address: string;
|
|
23
|
+
chainId: string;
|
|
24
|
+
symbol: string;
|
|
25
|
+
}[];
|
|
26
|
+
isNative?: boolean;
|
|
22
27
|
}[], AxiosError<unknown, any>>;
|
|
23
28
|
export declare function invalidateEvmTokensBalances(): void;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
require("
|
|
5
|
-
const react = require("../../react-CqKlu0W0.js");
|
|
6
|
-
require("viem");
|
|
7
|
-
require("viem/chains");
|
|
8
|
-
const require$$0 = require("react");
|
|
4
|
+
const react = require("@reown/appkit/react");
|
|
9
5
|
const reactQuery = require("@tanstack/react-query");
|
|
10
6
|
const reactjs_context_queryClient = require("../context/queryClient.js");
|
|
11
|
-
|
|
7
|
+
require("yup");
|
|
8
|
+
require("react");
|
|
9
|
+
require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");
|
|
10
|
+
require("../../bignumber-B8vjg9qn.js");
|
|
11
|
+
require("wagmi");
|
|
12
|
+
const reactjs_hooks_useBalances = require("../../useBalances-gZTsFZHe.js");
|
|
13
|
+
require("formik");
|
|
14
|
+
require("axios");
|
|
15
|
+
require("../context/Web3AppProvider.js");
|
|
16
|
+
require("../constants/index.js");
|
|
17
|
+
require("@reown/appkit-adapter-solana/react");
|
|
18
|
+
require("@solana/web3.js");
|
|
12
19
|
const useGetEvmTokensBalancesQuery = ({
|
|
13
20
|
tokens,
|
|
14
21
|
chainId
|
|
15
22
|
}) => {
|
|
16
23
|
const { address } = react.useAppKitAccount();
|
|
17
24
|
const { fetchBalances } = reactjs_hooks_useBalances.useBalances();
|
|
18
|
-
const tokenIdentifiers = require$$0.useMemo(() => {
|
|
19
|
-
return tokens.filter((token) => token.chainId.toString() === (chainId == null ? void 0 : chainId.toString())).map(({ address: tokenId }) => tokenId);
|
|
20
|
-
}, [tokens, chainId]);
|
|
21
25
|
const queryFn = async () => {
|
|
22
26
|
try {
|
|
23
27
|
if (!address) {
|
|
@@ -27,9 +31,7 @@ const useGetEvmTokensBalancesQuery = ({
|
|
|
27
31
|
throw new Error("Chain ID is required");
|
|
28
32
|
}
|
|
29
33
|
const assets = await fetchBalances({
|
|
30
|
-
|
|
31
|
-
chainId: chainId.toString(),
|
|
32
|
-
tokenIdentifiers
|
|
34
|
+
tokens
|
|
33
35
|
});
|
|
34
36
|
return assets.map((asset) => {
|
|
35
37
|
const foundToken = tokens.find(
|
|
@@ -52,12 +54,7 @@ const useGetEvmTokensBalancesQuery = ({
|
|
|
52
54
|
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
53
55
|
};
|
|
54
56
|
return reactQuery.useQuery({
|
|
55
|
-
queryKey: [
|
|
56
|
-
"evm-tokens-balances",
|
|
57
|
-
address,
|
|
58
|
-
chainId,
|
|
59
|
-
tokenIdentifiers.sort()
|
|
60
|
-
],
|
|
57
|
+
queryKey: ["evm-tokens-balances", address, chainId],
|
|
61
58
|
queryFn,
|
|
62
59
|
retry,
|
|
63
60
|
enabled: Boolean(address) && Boolean(chainId),
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { u as useAppKitAccount } from "../../react-47kZTyAT.mjs";
|
|
3
|
-
import "viem";
|
|
4
|
-
import "viem/chains";
|
|
5
|
-
import { useMemo } from "react";
|
|
1
|
+
import { useAppKitAccount } from "@reown/appkit/react";
|
|
6
2
|
import { useQuery } from "@tanstack/react-query";
|
|
7
3
|
import { getQueryClient } from "../context/queryClient.mjs";
|
|
8
|
-
import
|
|
4
|
+
import "yup";
|
|
5
|
+
import "react";
|
|
6
|
+
import "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
|
|
7
|
+
import "../../bignumber-CKZkoo0g.mjs";
|
|
8
|
+
import "wagmi";
|
|
9
|
+
import { u as useBalances } from "../../useBalances-Bom1mw1J.mjs";
|
|
10
|
+
import "formik";
|
|
11
|
+
import "axios";
|
|
12
|
+
import "../context/Web3AppProvider.mjs";
|
|
13
|
+
import "../constants/index.mjs";
|
|
14
|
+
import "@reown/appkit-adapter-solana/react";
|
|
15
|
+
import "@solana/web3.js";
|
|
9
16
|
const useGetEvmTokensBalancesQuery = ({
|
|
10
17
|
tokens,
|
|
11
18
|
chainId
|
|
12
19
|
}) => {
|
|
13
20
|
const { address } = useAppKitAccount();
|
|
14
21
|
const { fetchBalances } = useBalances();
|
|
15
|
-
const tokenIdentifiers = useMemo(() => {
|
|
16
|
-
return tokens.filter((token) => token.chainId.toString() === (chainId == null ? void 0 : chainId.toString())).map(({ address: tokenId }) => tokenId);
|
|
17
|
-
}, [tokens, chainId]);
|
|
18
22
|
const queryFn = async () => {
|
|
19
23
|
try {
|
|
20
24
|
if (!address) {
|
|
@@ -24,9 +28,7 @@ const useGetEvmTokensBalancesQuery = ({
|
|
|
24
28
|
throw new Error("Chain ID is required");
|
|
25
29
|
}
|
|
26
30
|
const assets = await fetchBalances({
|
|
27
|
-
|
|
28
|
-
chainId: chainId.toString(),
|
|
29
|
-
tokenIdentifiers
|
|
31
|
+
tokens
|
|
30
32
|
});
|
|
31
33
|
return assets.map((asset) => {
|
|
32
34
|
const foundToken = tokens.find(
|
|
@@ -49,12 +51,7 @@ const useGetEvmTokensBalancesQuery = ({
|
|
|
49
51
|
return ((_a = error.response) == null ? void 0 : _a.status) === 404;
|
|
50
52
|
};
|
|
51
53
|
return useQuery({
|
|
52
|
-
queryKey: [
|
|
53
|
-
"evm-tokens-balances",
|
|
54
|
-
address,
|
|
55
|
-
chainId,
|
|
56
|
-
tokenIdentifiers.sort()
|
|
57
|
-
],
|
|
54
|
+
queryKey: ["evm-tokens-balances", address, chainId],
|
|
58
55
|
queryFn,
|
|
59
56
|
retry,
|
|
60
57
|
enabled: Boolean(address) && Boolean(chainId),
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { ProviderType } from 'types/providerType';
|
|
1
2
|
import { AxiosError } from 'axios';
|
|
2
3
|
|
|
3
|
-
export declare const useGetHistoryQuery: (
|
|
4
|
+
export declare const useGetHistoryQuery: ({ address, sender, provider, status, tokenIn, tokenOut }: {
|
|
5
|
+
address?: string;
|
|
6
|
+
sender?: string;
|
|
7
|
+
provider?: ProviderType;
|
|
8
|
+
status?: string;
|
|
9
|
+
tokenIn?: string;
|
|
10
|
+
tokenOut?: string;
|
|
11
|
+
}) => import('@tanstack/react-query').UseQueryResult<import('../..').TransactionDTO[], AxiosError<unknown, any>>;
|
|
4
12
|
export declare const invalidateHistoryQuery: () => void;
|