@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.
Files changed (234) hide show
  1. package/README.md +6 -1
  2. package/api/getTransactions.d.ts +8 -2
  3. package/api/getTransactions.js +23 -3
  4. package/api/getTransactions.mjs +23 -3
  5. package/api/tests/getChains.spec.js +2 -1
  6. package/api/tests/getChains.spec.mjs +2 -1
  7. package/api/tests/getTokens.spec.js +2 -2
  8. package/api/tests/getTokens.spec.mjs +2 -2
  9. package/api/tests/getTransactions.spec.js +79 -69
  10. package/api/tests/getTransactions.spec.mjs +79 -69
  11. package/constants/index.d.ts +1 -1
  12. package/constants/index.js +1 -1
  13. package/constants/index.mjs +1 -1
  14. package/dto/Chain.dto.d.ts +3 -1
  15. package/dto/ConfirmRate.dto.d.ts +1 -0
  16. package/dto/Token.dto.d.ts +7 -2
  17. package/index.js +44 -16
  18. package/index.mjs +14 -16
  19. package/package.json +10 -6
  20. package/reactjs/components/BridgeForm/BridgeForm.d.ts +3 -1
  21. package/reactjs/components/BridgeForm/BridgeForm.js +182 -87
  22. package/reactjs/components/BridgeForm/BridgeForm.mjs +153 -58
  23. package/reactjs/components/BridgeHistory/BridgeHistory.js +73 -26
  24. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +68 -21
  25. package/reactjs/components/Connect/BridgeAccountDisplay.js +2 -5
  26. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +2 -5
  27. package/reactjs/components/Connect/CustomConnectButton.js +2 -5
  28. package/reactjs/components/Connect/CustomConnectButton.mjs +1 -4
  29. package/reactjs/components/Connect/MvxConnectButton.d.ts +2 -4
  30. package/reactjs/components/Connect/MvxConnectButton.js +2 -2
  31. package/reactjs/components/Connect/MvxConnectButton.mjs +2 -2
  32. package/reactjs/components/Connect/SwitchChainButton.js +2 -6
  33. package/reactjs/components/Connect/SwitchChainButton.mjs +1 -5
  34. package/reactjs/components/CopyButton/CopyButton.js +2 -2
  35. package/reactjs/components/CopyButton/CopyButton.mjs +2 -2
  36. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +5 -5
  37. package/reactjs/components/Error/Error.d.ts +6 -0
  38. package/reactjs/components/Error/Error.js +67 -0
  39. package/reactjs/components/Error/Error.mjs +66 -0
  40. package/reactjs/components/Error/index.d.ts +1 -0
  41. package/reactjs/components/Error/index.js +5 -0
  42. package/reactjs/components/Error/index.mjs +4 -0
  43. package/reactjs/components/TokenSelector/TokenSelector.d.ts +2 -1
  44. package/reactjs/components/TokenSelector/TokenSelector.js +17 -9
  45. package/reactjs/components/TokenSelector/TokenSelector.mjs +13 -5
  46. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +2 -1
  47. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +7 -3
  48. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +4 -0
  49. package/reactjs/components/TokenSelector/components/SelectContent.d.ts +2 -1
  50. package/reactjs/components/TokenSelector/components/SelectContent.js +12 -9
  51. package/reactjs/components/TokenSelector/components/SelectContent.mjs +4 -1
  52. package/reactjs/components/TokenSelector/components/TokenIcon.js +3 -3
  53. package/reactjs/components/TokenSelector/components/TokenItem.js +9 -9
  54. package/reactjs/components/TokenSelector/components/TokenItem.mjs +6 -6
  55. package/reactjs/components/base/MxCard/MxCard.js +2 -2
  56. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.d.ts +4 -0
  57. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +29 -0
  58. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +28 -0
  59. package/reactjs/components/base/MxCircleLoader/index.d.ts +1 -0
  60. package/reactjs/components/base/MxCircleLoader/index.js +5 -0
  61. package/reactjs/components/base/MxCircleLoader/index.mjs +4 -0
  62. package/reactjs/components/base/MxLink/MxLink.js +2 -2
  63. package/reactjs/components/base/MxSearch/MxSearch.js +4 -4
  64. package/reactjs/components/base/MxSlideover/MxSlideover.js +4 -4
  65. package/reactjs/components/base/MxTooltip/MxTooltip.js +9 -9
  66. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +2 -2
  67. package/reactjs/components/index.d.ts +1 -0
  68. package/reactjs/components/index.js +2 -0
  69. package/reactjs/components/index.mjs +2 -0
  70. package/reactjs/context/Web3AppProvider.d.ts +3 -1
  71. package/reactjs/context/Web3AppProvider.js +7 -5
  72. package/reactjs/context/Web3AppProvider.mjs +4 -2
  73. package/reactjs/context/useWeb3App.js +2 -2
  74. package/reactjs/hooks/index.js +1 -1
  75. package/reactjs/hooks/index.mjs +1 -1
  76. package/reactjs/hooks/useAccount.js +1 -5
  77. package/reactjs/hooks/useAccount.mjs +1 -5
  78. package/reactjs/hooks/useBalances.d.ts +4 -4
  79. package/reactjs/hooks/useBalances.js +16 -1
  80. package/reactjs/hooks/useBalances.mjs +16 -1
  81. package/reactjs/hooks/useBridgeFormik.js +9 -16
  82. package/reactjs/hooks/useBridgeFormik.mjs +0 -7
  83. package/reactjs/hooks/useDebounce.js +3 -3
  84. package/reactjs/hooks/useFetchBridgeData.d.ts +14 -4
  85. package/reactjs/hooks/useFetchTokens.d.ts +14 -4
  86. package/reactjs/hooks/useFetchTokens.js +9 -9
  87. package/reactjs/hooks/useFetchTokens.mjs +2 -2
  88. package/reactjs/hooks/useFiatData.d.ts +7 -2
  89. package/reactjs/hooks/useFiatData.js +6 -6
  90. package/reactjs/hooks/useFiatData.mjs +1 -1
  91. package/reactjs/hooks/useGetChainId.js +3 -3
  92. package/reactjs/hooks/useGetChainId.mjs +1 -1
  93. package/reactjs/hooks/useResolveTokenChain.js +2 -2
  94. package/reactjs/hooks/useSendTransactions.js +2 -2
  95. package/reactjs/hooks/useSignTransaction.d.ts +93 -67
  96. package/reactjs/hooks/useSignTransaction.js +53 -4
  97. package/reactjs/hooks/useSignTransaction.mjs +53 -4
  98. package/reactjs/hooks/validation/useTestHasEnoughFunds.js +3 -3
  99. package/reactjs/hooks/validation/useTestIsConnected.js +2 -2
  100. package/reactjs/index.js +44 -16
  101. package/reactjs/index.mjs +14 -16
  102. package/reactjs/init/init.d.ts +220 -1
  103. package/reactjs/init/init.js +34 -10
  104. package/reactjs/init/init.mjs +31 -7
  105. package/reactjs/init/tests/init.spec.js +5 -6
  106. package/reactjs/init/tests/init.spec.mjs +5 -6
  107. package/reactjs/queries/index.d.ts +0 -1
  108. package/reactjs/queries/index.js +0 -2
  109. package/reactjs/queries/index.mjs +1 -3
  110. package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +8 -3
  111. package/reactjs/queries/useGetEvmTokensBalances.query.js +15 -18
  112. package/reactjs/queries/useGetEvmTokensBalances.query.mjs +15 -18
  113. package/reactjs/queries/useGetHistory.query.d.ts +9 -1
  114. package/reactjs/queries/useGetHistory.query.js +23 -5
  115. package/reactjs/queries/useGetHistory.query.mjs +23 -5
  116. package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +7 -2
  117. package/reactjs/queries/useGetMvxTokensBalances.query.js +2 -2
  118. package/reactjs/reexports.d.ts +2 -1
  119. package/reactjs/reexports.js +41 -13
  120. package/reactjs/reexports.mjs +11 -13
  121. package/reactjs/utils/getInitialTokens.d.ts +4 -1
  122. package/reactjs/utils/getInitialTokens.js +3 -3
  123. package/reactjs/utils/getInitialTokens.mjs +3 -3
  124. package/style.css +33 -1730
  125. package/types/chainType.d.ts +6 -0
  126. package/types/chainType.js +11 -0
  127. package/types/chainType.mjs +10 -0
  128. package/types/transaction.d.ts +28 -0
  129. package/types/utxo.d.ts +11 -0
  130. package/types/utxo.js +2 -0
  131. package/types/utxo.mjs +1 -0
  132. package/{useBalances-C_69CFoa.mjs → useBalances-Bom1mw1J.mjs} +101 -23
  133. package/{useBalances-C4YhEYxy.js → useBalances-gZTsFZHe.js} +102 -24
  134. package/index-BIVnypNe.mjs +0 -108
  135. package/index-Ben8n3bd.js +0 -58656
  136. package/index-CnKr4rL1.mjs +0 -91
  137. package/index-CnuruJNu.js +0 -329
  138. package/index-DsBh-EBw.js +0 -108
  139. package/index-iN9APQ6x.mjs +0 -58735
  140. package/modules/fiat/components/FiatForm/FiatForm.d.ts +0 -9
  141. package/modules/fiat/components/FiatForm/FiatForm.js +0 -314
  142. package/modules/fiat/components/FiatForm/FiatForm.mjs +0 -313
  143. package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.d.ts +0 -13
  144. package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.js +0 -117
  145. package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.mjs +0 -116
  146. package/modules/fiat/components/FiatForm/components/AmountInput/index.d.ts +0 -1
  147. package/modules/fiat/components/FiatForm/components/AmountInput/index.js +0 -5
  148. package/modules/fiat/components/FiatForm/components/AmountInput/index.mjs +0 -4
  149. package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.d.ts +0 -7
  150. package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.js +0 -74
  151. package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.mjs +0 -73
  152. package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.d.ts +0 -14
  153. package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.js +0 -94
  154. package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.mjs +0 -93
  155. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.d.ts +0 -7
  156. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.js +0 -82
  157. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.mjs +0 -81
  158. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.d.ts +0 -7
  159. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.js +0 -91
  160. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.mjs +0 -90
  161. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.d.ts +0 -5
  162. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.js +0 -30
  163. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.mjs +0 -29
  164. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.d.ts +0 -8
  165. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.js +0 -103
  166. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.mjs +0 -102
  167. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.d.ts +0 -7
  168. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.js +0 -33
  169. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.mjs +0 -32
  170. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.d.ts +0 -7
  171. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.js +0 -21
  172. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.mjs +0 -20
  173. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.d.ts +0 -9
  174. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.js +0 -26
  175. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.mjs +0 -25
  176. package/modules/fiat/components/FiatForm/components/TokenSelector/index.d.ts +0 -1
  177. package/modules/fiat/components/FiatForm/components/TokenSelector/index.js +0 -5
  178. package/modules/fiat/components/FiatForm/components/TokenSelector/index.mjs +0 -4
  179. package/modules/fiat/components/FiatForm/index.d.ts +0 -1
  180. package/modules/fiat/components/FiatForm/index.js +0 -5
  181. package/modules/fiat/components/FiatForm/index.mjs +0 -4
  182. package/modules/fiat/components/index.d.ts +0 -1
  183. package/modules/fiat/components/index.js +0 -5
  184. package/modules/fiat/components/index.mjs +0 -4
  185. package/modules/fiat/context/FiatProvider.d.ts +0 -8
  186. package/modules/fiat/context/FiatProvider.js +0 -24
  187. package/modules/fiat/context/FiatProvider.mjs +0 -23
  188. package/modules/fiat/context/queryClient.d.ts +0 -3
  189. package/modules/fiat/context/queryClient.js +0 -12
  190. package/modules/fiat/context/queryClient.mjs +0 -11
  191. package/modules/fiat/context/useFiat.d.ts +0 -1
  192. package/modules/fiat/context/useFiat.js +0 -13
  193. package/modules/fiat/context/useFiat.mjs +0 -12
  194. package/modules/fiat/hooks/index.d.ts +0 -2
  195. package/modules/fiat/hooks/index.js +0 -7
  196. package/modules/fiat/hooks/index.mjs +0 -6
  197. package/modules/fiat/hooks/useFiatData.d.ts +0 -7
  198. package/modules/fiat/hooks/useFiatData.js +0 -75
  199. package/modules/fiat/hooks/useFiatData.mjs +0 -74
  200. package/modules/fiat/hooks/validation/index.d.ts +0 -1
  201. package/modules/fiat/hooks/validation/index.js +0 -5
  202. package/modules/fiat/hooks/validation/index.mjs +0 -4
  203. package/modules/fiat/hooks/validation/useAmountSchema.d.ts +0 -2
  204. package/modules/fiat/hooks/validation/useAmountSchema.js +0 -27
  205. package/modules/fiat/hooks/validation/useAmountSchema.mjs +0 -9
  206. package/modules/fiat/index.d.ts +0 -8
  207. package/modules/fiat/index.js +0 -22
  208. package/modules/fiat/index.mjs +0 -21
  209. package/modules/fiat/init/index.d.ts +0 -2
  210. package/modules/fiat/init/index.js +0 -5
  211. package/modules/fiat/init/index.mjs +0 -4
  212. package/modules/fiat/init/init.d.ts +0 -22
  213. package/modules/fiat/init/init.js +0 -15
  214. package/modules/fiat/init/init.mjs +0 -14
  215. package/modules/fiat/queries/index.d.ts +0 -2
  216. package/modules/fiat/queries/index.js +0 -7
  217. package/modules/fiat/queries/index.mjs +0 -6
  218. package/modules/fiat/queries/useGetRate.mutation.d.ts +0 -6
  219. package/modules/fiat/queries/useGetRate.mutation.js +0 -20
  220. package/modules/fiat/queries/useGetRate.mutation.mjs +0 -19
  221. package/modules/fiat/queries/useGetTokens.query.d.ts +0 -5
  222. package/modules/fiat/queries/useGetTokens.query.js +0 -33
  223. package/modules/fiat/queries/useGetTokens.query.mjs +0 -32
  224. package/react-47kZTyAT.mjs +0 -51
  225. package/react-B_iI3-1z.mjs +0 -3133
  226. package/react-BomcNL1v.js +0 -254
  227. package/react-CqKlu0W0.js +0 -51
  228. package/react-R_xxu7fN.js +0 -3133
  229. package/react-cXurUY4Z.mjs +0 -254
  230. package/reactjs/queries/useGetTokens.query.d.ts +0 -3
  231. package/reactjs/queries/useGetTokens.query.js +0 -34
  232. package/reactjs/queries/useGetTokens.query.mjs +0 -33
  233. package/w3m-modal-Bhg44d6I.js +0 -356
  234. package/w3m-modal-Br2Ec3MM.mjs +0 -356
package/react-BomcNL1v.js DELETED
@@ -1,254 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- const require$$0 = require("react");
4
- const index = require("./index-Ben8n3bd.js");
5
- var shim = { exports: {} };
6
- var useSyncExternalStoreShim_production_min = {};
7
- /**
8
- * @license React
9
- * use-sync-external-store-shim.production.min.js
10
- *
11
- * Copyright (c) Facebook, Inc. and its affiliates.
12
- *
13
- * This source code is licensed under the MIT license found in the
14
- * LICENSE file in the root directory of this source tree.
15
- */
16
- var hasRequiredUseSyncExternalStoreShim_production_min;
17
- function requireUseSyncExternalStoreShim_production_min() {
18
- if (hasRequiredUseSyncExternalStoreShim_production_min) return useSyncExternalStoreShim_production_min;
19
- hasRequiredUseSyncExternalStoreShim_production_min = 1;
20
- var e = require$$0;
21
- function h(a, b) {
22
- return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
23
- }
24
- var k = "function" === typeof Object.is ? Object.is : h, l = e.useState, m = e.useEffect, n = e.useLayoutEffect, p = e.useDebugValue;
25
- function q(a, b) {
26
- var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
27
- n(function() {
28
- c.value = d;
29
- c.getSnapshot = b;
30
- r(c) && g({ inst: c });
31
- }, [a, d, b]);
32
- m(function() {
33
- r(c) && g({ inst: c });
34
- return a(function() {
35
- r(c) && g({ inst: c });
36
- });
37
- }, [a]);
38
- p(d);
39
- return d;
40
- }
41
- function r(a) {
42
- var b = a.getSnapshot;
43
- a = a.value;
44
- try {
45
- var d = b();
46
- return !k(a, d);
47
- } catch (f) {
48
- return true;
49
- }
50
- }
51
- function t(a, b) {
52
- return b();
53
- }
54
- var u = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t : q;
55
- useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u;
56
- return useSyncExternalStoreShim_production_min;
57
- }
58
- var useSyncExternalStoreShim_development = {};
59
- /**
60
- * @license React
61
- * use-sync-external-store-shim.development.js
62
- *
63
- * Copyright (c) Facebook, Inc. and its affiliates.
64
- *
65
- * This source code is licensed under the MIT license found in the
66
- * LICENSE file in the root directory of this source tree.
67
- */
68
- var hasRequiredUseSyncExternalStoreShim_development;
69
- function requireUseSyncExternalStoreShim_development() {
70
- if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
71
- hasRequiredUseSyncExternalStoreShim_development = 1;
72
- if (process.env.NODE_ENV !== "production") {
73
- (function() {
74
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
75
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
76
- }
77
- var React = require$$0;
78
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
79
- function error(format) {
80
- {
81
- {
82
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
83
- args[_key2 - 1] = arguments[_key2];
84
- }
85
- printWarning("error", format, args);
86
- }
87
- }
88
- }
89
- function printWarning(level, format, args) {
90
- {
91
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
92
- var stack = ReactDebugCurrentFrame.getStackAddendum();
93
- if (stack !== "") {
94
- format += "%s";
95
- args = args.concat([stack]);
96
- }
97
- var argsWithFormat = args.map(function(item) {
98
- return String(item);
99
- });
100
- argsWithFormat.unshift("Warning: " + format);
101
- Function.prototype.apply.call(console[level], console, argsWithFormat);
102
- }
103
- }
104
- function is(x, y) {
105
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y;
106
- }
107
- var objectIs = typeof Object.is === "function" ? Object.is : is;
108
- var useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
109
- var didWarnOld18Alpha = false;
110
- var didWarnUncachedGetSnapshot = false;
111
- function useSyncExternalStore2(subscribe, getSnapshot, getServerSnapshot) {
112
- {
113
- if (!didWarnOld18Alpha) {
114
- if (React.startTransition !== void 0) {
115
- didWarnOld18Alpha = true;
116
- error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
117
- }
118
- }
119
- }
120
- var value = getSnapshot();
121
- {
122
- if (!didWarnUncachedGetSnapshot) {
123
- var cachedValue = getSnapshot();
124
- if (!objectIs(value, cachedValue)) {
125
- error("The result of getSnapshot should be cached to avoid an infinite loop");
126
- didWarnUncachedGetSnapshot = true;
127
- }
128
- }
129
- }
130
- var _useState = useState({
131
- inst: {
132
- value,
133
- getSnapshot
134
- }
135
- }), inst = _useState[0].inst, forceUpdate = _useState[1];
136
- useLayoutEffect(function() {
137
- inst.value = value;
138
- inst.getSnapshot = getSnapshot;
139
- if (checkIfSnapshotChanged(inst)) {
140
- forceUpdate({
141
- inst
142
- });
143
- }
144
- }, [subscribe, value, getSnapshot]);
145
- useEffect(function() {
146
- if (checkIfSnapshotChanged(inst)) {
147
- forceUpdate({
148
- inst
149
- });
150
- }
151
- var handleStoreChange = function() {
152
- if (checkIfSnapshotChanged(inst)) {
153
- forceUpdate({
154
- inst
155
- });
156
- }
157
- };
158
- return subscribe(handleStoreChange);
159
- }, [subscribe]);
160
- useDebugValue(value);
161
- return value;
162
- }
163
- function checkIfSnapshotChanged(inst) {
164
- var latestGetSnapshot = inst.getSnapshot;
165
- var prevValue = inst.value;
166
- try {
167
- var nextValue = latestGetSnapshot();
168
- return !objectIs(prevValue, nextValue);
169
- } catch (error2) {
170
- return true;
171
- }
172
- }
173
- function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
174
- return getSnapshot();
175
- }
176
- var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
177
- var isServerEnvironment = !canUseDOM;
178
- var shim2 = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore2;
179
- var useSyncExternalStore$2 = React.useSyncExternalStore !== void 0 ? React.useSyncExternalStore : shim2;
180
- useSyncExternalStoreShim_development.useSyncExternalStore = useSyncExternalStore$2;
181
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
182
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
183
- }
184
- })();
185
- }
186
- return useSyncExternalStoreShim_development;
187
- }
188
- if (process.env.NODE_ENV === "production") {
189
- shim.exports = requireUseSyncExternalStoreShim_production_min();
190
- } else {
191
- shim.exports = requireUseSyncExternalStoreShim_development();
192
- }
193
- var shimExports = shim.exports;
194
- const useSyncExternalStoreExports = /* @__PURE__ */ index.getDefaultExportFromCjs(shimExports);
195
- const __vite_import_meta_env__ = {};
196
- const { use } = require$$0;
197
- const { useSyncExternalStore } = useSyncExternalStoreExports;
198
- const useAffectedDebugValue = (state, affected) => {
199
- const pathList = require$$0.useRef();
200
- require$$0.useEffect(() => {
201
- pathList.current = index.w(state, affected);
202
- });
203
- require$$0.useDebugValue(pathList.current);
204
- };
205
- const targetCache = /* @__PURE__ */ new WeakMap();
206
- function useSnapshot(proxyObject, options) {
207
- const notifyInSync = void 0;
208
- const lastSnapshot = require$$0.useRef();
209
- const lastAffected = require$$0.useRef();
210
- let inRender = true;
211
- const currSnapshot = useSyncExternalStore(
212
- require$$0.useCallback(
213
- (callback) => {
214
- const unsub = index.subscribe(proxyObject, callback);
215
- callback();
216
- return unsub;
217
- },
218
- [proxyObject, notifyInSync]
219
- ),
220
- () => {
221
- const nextSnapshot = index.snapshot(proxyObject, use);
222
- try {
223
- if (!inRender && lastSnapshot.current && lastAffected.current && !index.p(
224
- lastSnapshot.current,
225
- nextSnapshot,
226
- lastAffected.current,
227
- /* @__PURE__ */ new WeakMap()
228
- )) {
229
- return lastSnapshot.current;
230
- }
231
- } catch (e) {
232
- }
233
- return nextSnapshot;
234
- },
235
- () => index.snapshot(proxyObject, use)
236
- );
237
- inRender = false;
238
- const currAffected = /* @__PURE__ */ new WeakMap();
239
- require$$0.useEffect(() => {
240
- lastSnapshot.current = currSnapshot;
241
- lastAffected.current = currAffected;
242
- });
243
- if ((__vite_import_meta_env__ ? "production" : void 0) !== "production") {
244
- useAffectedDebugValue(currSnapshot, currAffected);
245
- }
246
- const proxyCache = require$$0.useMemo(() => /* @__PURE__ */ new WeakMap(), []);
247
- return index.a(
248
- currSnapshot,
249
- currAffected,
250
- proxyCache,
251
- targetCache
252
- );
253
- }
254
- exports.useSnapshot = useSnapshot;
package/react-CqKlu0W0.js DELETED
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- const index = require("./index-Ben8n3bd.js");
4
- const react = require("./react-BomcNL1v.js");
5
- function useAppKitNetworkCore() {
6
- const { activeCaipNetwork } = react.useSnapshot(index.ChainController.state);
7
- return {
8
- caipNetwork: activeCaipNetwork,
9
- chainId: activeCaipNetwork == null ? void 0 : activeCaipNetwork.id,
10
- caipNetworkId: activeCaipNetwork == null ? void 0 : activeCaipNetwork.caipNetworkId
11
- };
12
- }
13
- function useAppKitAccount(options) {
14
- var _a;
15
- const state = react.useSnapshot(index.ChainController.state);
16
- const chainNamespace = (options == null ? void 0 : options.namespace) || state.activeChain;
17
- if (!chainNamespace) {
18
- return {
19
- allAccounts: [],
20
- address: void 0,
21
- caipAddress: void 0,
22
- status: void 0,
23
- isConnected: false,
24
- embeddedWalletInfo: void 0
25
- };
26
- }
27
- const chainAccountState = (_a = state.chains.get(chainNamespace)) == null ? void 0 : _a.accountState;
28
- const authConnector = index.ConnectorController.getAuthConnector(chainNamespace);
29
- return {
30
- allAccounts: (chainAccountState == null ? void 0 : chainAccountState.allAccounts) || [],
31
- caipAddress: chainAccountState == null ? void 0 : chainAccountState.caipAddress,
32
- address: index.CoreHelperUtil.getPlainAddress(chainAccountState == null ? void 0 : chainAccountState.caipAddress),
33
- isConnected: Boolean(chainAccountState == null ? void 0 : chainAccountState.caipAddress),
34
- status: chainAccountState == null ? void 0 : chainAccountState.status,
35
- embeddedWalletInfo: authConnector ? {
36
- user: chainAccountState == null ? void 0 : chainAccountState.user,
37
- authProvider: (chainAccountState == null ? void 0 : chainAccountState.socialProvider) || "email",
38
- accountType: chainAccountState == null ? void 0 : chainAccountState.preferredAccountType,
39
- isSmartAccountDeployed: Boolean(chainAccountState == null ? void 0 : chainAccountState.smartAccountDeployed)
40
- } : void 0
41
- };
42
- }
43
- function useDisconnect() {
44
- async function disconnect() {
45
- await index.ConnectionController.disconnect();
46
- }
47
- return { disconnect };
48
- }
49
- exports.useAppKitAccount = useAppKitAccount;
50
- exports.useAppKitNetworkCore = useAppKitNetworkCore;
51
- exports.useDisconnect = useDisconnect;