@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
@@ -1,69 +1,95 @@
1
+ import { ServerTransactionInstruction } from '../../types';
2
+ import { Provider } from '@reown/appkit-adapter-solana/react';
3
+ import { BitcoinConnector } from '@reown/appkit-adapter-bitcoin';
4
+
1
5
  export declare const useSignTransaction: () => {
2
- error: null;
3
- status: "idle";
4
- reset: () => void;
5
- context: unknown;
6
- variables: undefined;
7
- isError: false;
8
- isIdle: true;
9
- isPending: false;
10
- isSuccess: false;
11
- failureCount: number;
12
- failureReason: import('@wagmi/core').SendTransactionErrorType | null;
13
- isPaused: boolean;
14
- submittedAt: number;
15
- sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
16
- hash: `0x${string}` | undefined;
17
- signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
18
- } | {
19
- error: null;
20
- status: "pending";
21
- reset: () => void;
22
- context: unknown;
23
- variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
24
- isError: false;
25
- isIdle: false;
26
- isPending: true;
27
- isSuccess: false;
28
- failureCount: number;
29
- failureReason: import('@wagmi/core').SendTransactionErrorType | null;
30
- isPaused: boolean;
31
- submittedAt: number;
32
- sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
33
- hash: `0x${string}` | undefined;
34
- signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
35
- } | {
36
- error: import('@wagmi/core').SendTransactionErrorType;
37
- status: "error";
38
- reset: () => void;
39
- context: unknown;
40
- variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
41
- isError: true;
42
- isIdle: false;
43
- isPending: false;
44
- isSuccess: false;
45
- failureCount: number;
46
- failureReason: import('@wagmi/core').SendTransactionErrorType | null;
47
- isPaused: boolean;
48
- submittedAt: number;
49
- sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
50
- hash: `0x${string}` | undefined;
51
- signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
52
- } | {
53
- error: null;
54
- status: "success";
55
- reset: () => void;
56
- context: unknown;
57
- variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
58
- isError: false;
59
- isIdle: false;
60
- isPending: false;
61
- isSuccess: true;
62
- failureCount: number;
63
- failureReason: import('@wagmi/core').SendTransactionErrorType | null;
64
- isPaused: boolean;
65
- submittedAt: number;
66
- sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
67
- hash: `0x${string}` | undefined;
68
- signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
6
+ evm: {
7
+ error: null;
8
+ status: "idle";
9
+ reset: () => void;
10
+ context: unknown;
11
+ variables: undefined;
12
+ isError: false;
13
+ isIdle: true;
14
+ isPending: false;
15
+ isSuccess: false;
16
+ failureCount: number;
17
+ failureReason: import('@wagmi/core').SendTransactionErrorType | null;
18
+ isPaused: boolean;
19
+ submittedAt: number;
20
+ sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
21
+ hash: `0x${string}` | undefined;
22
+ signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
23
+ } | {
24
+ error: null;
25
+ status: "pending";
26
+ reset: () => void;
27
+ context: unknown;
28
+ variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
29
+ isError: false;
30
+ isIdle: false;
31
+ isPending: true;
32
+ isSuccess: false;
33
+ failureCount: number;
34
+ failureReason: import('@wagmi/core').SendTransactionErrorType | null;
35
+ isPaused: boolean;
36
+ submittedAt: number;
37
+ sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
38
+ hash: `0x${string}` | undefined;
39
+ signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
40
+ } | {
41
+ error: import('@wagmi/core').SendTransactionErrorType;
42
+ status: "error";
43
+ reset: () => void;
44
+ context: unknown;
45
+ variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
46
+ isError: true;
47
+ isIdle: false;
48
+ isPending: false;
49
+ isSuccess: false;
50
+ failureCount: number;
51
+ failureReason: import('@wagmi/core').SendTransactionErrorType | null;
52
+ isPaused: boolean;
53
+ submittedAt: number;
54
+ sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
55
+ hash: `0x${string}` | undefined;
56
+ signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
57
+ } | {
58
+ error: null;
59
+ status: "success";
60
+ reset: () => void;
61
+ context: unknown;
62
+ variables: import('wagmi/query').SendTransactionVariables<import('wagmi').Config, number>;
63
+ isError: false;
64
+ isIdle: false;
65
+ isPending: false;
66
+ isSuccess: true;
67
+ failureCount: number;
68
+ failureReason: import('@wagmi/core').SendTransactionErrorType | null;
69
+ isPaused: boolean;
70
+ submittedAt: number;
71
+ sendTransaction: import('wagmi/query').SendTransactionMutate<import('wagmi').Config, unknown>;
72
+ hash: `0x${string}` | undefined;
73
+ signTransaction: import('wagmi/query').SendTransactionMutateAsync<import('wagmi').Config, unknown>;
74
+ };
75
+ solana: {
76
+ signTransaction: ({ feePayer, instructions }: {
77
+ feePayer: string;
78
+ instructions: ServerTransactionInstruction[];
79
+ }) => Promise<string | undefined>;
80
+ connection: import('@solana/web3.js').Connection | undefined;
81
+ walletProvider: Provider;
82
+ };
83
+ bitcoin: {
84
+ signTransaction: (params: {
85
+ psbt: string;
86
+ signInputs: {
87
+ address: string;
88
+ index: number;
89
+ sighashTypes: number[];
90
+ }[];
91
+ broadcast: boolean;
92
+ }) => Promise<string>;
93
+ walletProvider: BitcoinConnector;
94
+ };
69
95
  };
@@ -1,17 +1,66 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const react$1 = require("@reown/appkit/react");
5
+ const react = require("@reown/appkit-adapter-solana/react");
6
+ const web3_js = require("@solana/web3.js");
4
7
  const wagmi = require("wagmi");
5
8
  const useSignTransaction = () => {
6
9
  const {
7
10
  data: hash,
8
- sendTransactionAsync: signTransaction,
11
+ sendTransactionAsync: signEvmTransaction,
9
12
  ...rest
10
13
  } = wagmi.useSendTransaction();
14
+ const { connection } = react.useAppKitConnection();
15
+ const { walletProvider: solWalletProvider } = react$1.useAppKitProvider("solana");
16
+ const { walletProvider: btcWalletProvider } = react$1.useAppKitProvider("bip122");
17
+ const signTransactionSolanaTransaction = async ({
18
+ feePayer,
19
+ instructions
20
+ }) => {
21
+ for (const instruction of instructions) {
22
+ const instructionData = Buffer.from(instruction.data);
23
+ const sender = new web3_js.PublicKey(instruction.keys[0].pubkey);
24
+ const receiver = new web3_js.PublicKey(instruction.keys[1].pubkey);
25
+ const transactionInstruction = new web3_js.TransactionInstruction({
26
+ keys: [
27
+ { pubkey: sender, isSigner: true, isWritable: true },
28
+ { pubkey: receiver, isSigner: false, isWritable: true }
29
+ ],
30
+ programId: new web3_js.PublicKey(instruction.programId),
31
+ data: instructionData
32
+ });
33
+ const transaction = new web3_js.Transaction().add(transactionInstruction);
34
+ transaction.feePayer = new web3_js.PublicKey(feePayer);
35
+ if (connection) {
36
+ transaction.recentBlockhash = (await connection.getLatestBlockhash("confirmed")).blockhash;
37
+ }
38
+ return await solWalletProvider.signAndSendTransaction(transaction);
39
+ }
40
+ };
41
+ const signPSBT = async (params) => {
42
+ if (!btcWalletProvider) {
43
+ throw Error("user is disconnected");
44
+ }
45
+ params.signInputs = [];
46
+ const signature = await btcWalletProvider.signPSBT(params);
47
+ return signature.psbt;
48
+ };
11
49
  return {
12
- hash,
13
- signTransaction,
14
- ...rest
50
+ evm: {
51
+ hash,
52
+ signTransaction: signEvmTransaction,
53
+ ...rest
54
+ },
55
+ solana: {
56
+ signTransaction: signTransactionSolanaTransaction,
57
+ connection,
58
+ walletProvider: solWalletProvider
59
+ },
60
+ bitcoin: {
61
+ signTransaction: signPSBT,
62
+ walletProvider: btcWalletProvider
63
+ }
15
64
  };
16
65
  };
17
66
  exports.useSignTransaction = useSignTransaction;
@@ -1,14 +1,63 @@
1
+ import { useAppKitProvider } from "@reown/appkit/react";
2
+ import { useAppKitConnection } from "@reown/appkit-adapter-solana/react";
3
+ import { PublicKey, TransactionInstruction, Transaction } from "@solana/web3.js";
1
4
  import { useSendTransaction } from "wagmi";
2
5
  const useSignTransaction = () => {
3
6
  const {
4
7
  data: hash,
5
- sendTransactionAsync: signTransaction,
8
+ sendTransactionAsync: signEvmTransaction,
6
9
  ...rest
7
10
  } = useSendTransaction();
11
+ const { connection } = useAppKitConnection();
12
+ const { walletProvider: solWalletProvider } = useAppKitProvider("solana");
13
+ const { walletProvider: btcWalletProvider } = useAppKitProvider("bip122");
14
+ const signTransactionSolanaTransaction = async ({
15
+ feePayer,
16
+ instructions
17
+ }) => {
18
+ for (const instruction of instructions) {
19
+ const instructionData = Buffer.from(instruction.data);
20
+ const sender = new PublicKey(instruction.keys[0].pubkey);
21
+ const receiver = new PublicKey(instruction.keys[1].pubkey);
22
+ const transactionInstruction = new TransactionInstruction({
23
+ keys: [
24
+ { pubkey: sender, isSigner: true, isWritable: true },
25
+ { pubkey: receiver, isSigner: false, isWritable: true }
26
+ ],
27
+ programId: new PublicKey(instruction.programId),
28
+ data: instructionData
29
+ });
30
+ const transaction = new Transaction().add(transactionInstruction);
31
+ transaction.feePayer = new PublicKey(feePayer);
32
+ if (connection) {
33
+ transaction.recentBlockhash = (await connection.getLatestBlockhash("confirmed")).blockhash;
34
+ }
35
+ return await solWalletProvider.signAndSendTransaction(transaction);
36
+ }
37
+ };
38
+ const signPSBT = async (params) => {
39
+ if (!btcWalletProvider) {
40
+ throw Error("user is disconnected");
41
+ }
42
+ params.signInputs = [];
43
+ const signature = await btcWalletProvider.signPSBT(params);
44
+ return signature.psbt;
45
+ };
8
46
  return {
9
- hash,
10
- signTransaction,
11
- ...rest
47
+ evm: {
48
+ hash,
49
+ signTransaction: signEvmTransaction,
50
+ ...rest
51
+ },
52
+ solana: {
53
+ signTransaction: signTransactionSolanaTransaction,
54
+ connection,
55
+ walletProvider: solWalletProvider
56
+ },
57
+ bitcoin: {
58
+ signTransaction: signPSBT,
59
+ walletProvider: btcWalletProvider
60
+ }
12
61
  };
13
62
  };
14
63
  export {
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require$$0 = require("react");
4
+ const React = require("react");
5
5
  const reactjs_utils_hasEnoughFunds = require("../../utils/hasEnoughFunds.js");
6
6
  const reactjs_utils_testNumber = require("../../utils/testNumber.js");
7
7
  const useTestHasEnoughFunds = () => {
8
- const shouldThrow = require$$0.useCallback(
8
+ const shouldThrow = React.useCallback(
9
9
  (value, context) => {
10
10
  if (!reactjs_utils_testNumber.testNumber(value)) {
11
11
  return false;
@@ -22,7 +22,7 @@ const useTestHasEnoughFunds = () => {
22
22
  },
23
23
  []
24
24
  );
25
- return require$$0.useCallback(
25
+ return React.useCallback(
26
26
  (value, context) => {
27
27
  if (!shouldThrow(value, context)) {
28
28
  return true;
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const require$$0 = require("react");
4
+ const React = require("react");
5
5
  const reactjs_hooks_useAccount = require("../useAccount.js");
6
6
  const useTestIsConnected = () => {
7
7
  const { address } = reactjs_hooks_useAccount.useAccount();
8
- return require$$0.useCallback(
8
+ return React.useCallback(
9
9
  (_value, context) => {
10
10
  if (Boolean(address)) {
11
11
  return true;
package/reactjs/index.js CHANGED
@@ -26,6 +26,7 @@ const reactjs_components_TokenSelector_TokenSelector = require("./components/Tok
26
26
  const reactjs_components_TransactionToast_TransactionToastContainer = require("./components/TransactionToast/TransactionToastContainer.js");
27
27
  const reactjs_components_TransactionToast_TransactionToast = require("./components/TransactionToast/TransactionToast.js");
28
28
  const reactjs_components_TrimAddress_TrimAddress = require("./components/TrimAddress/TrimAddress.js");
29
+ const reactjs_components_Error_Error = require("./components/Error/Error.js");
29
30
  const reactjs_constants_index = require("./constants/index.js");
30
31
  const reactjs_context_Web3AppProvider = require("./context/Web3AppProvider.js");
31
32
  const reactjs_context_useWeb3App = require("./context/useWeb3App.js");
@@ -35,7 +36,7 @@ const reactjs_hooks_validation_useSecondAmountSchema = require("./hooks/validati
35
36
  const reactjs_hooks_validation_useTestHasEnoughFunds = require("./hooks/validation/useTestHasEnoughFunds.js");
36
37
  const reactjs_hooks_validation_useTestIsConnected = require("./hooks/validation/useTestIsConnected.js");
37
38
  const reactjs_hooks_useAccount = require("./hooks/useAccount.js");
38
- const reactjs_hooks_useBalances = require("../useBalances-C4YhEYxy.js");
39
+ const reactjs_hooks_useBalances = require("../useBalances-gZTsFZHe.js");
39
40
  const reactjs_hooks_useBridgeFormik = require("./hooks/useBridgeFormik.js");
40
41
  const reactjs_hooks_useDebounce = require("./hooks/useDebounce.js");
41
42
  const reactjs_hooks_useFetchBridgeData = require("./hooks/useFetchBridgeData.js");
@@ -51,7 +52,6 @@ const reactjs_queries_useGetEvmTokensBalances_query = require("./queries/useGetE
51
52
  const reactjs_queries_useGetHistory_query = require("./queries/useGetHistory.query.js");
52
53
  const reactjs_queries_useGetMvxTokensBalances_query = require("./queries/useGetMvxTokensBalances.query.js");
53
54
  const reactjs_queries_useGetRate_mutation = require("./queries/useGetRate.mutation.js");
54
- const reactjs_queries_useGetTokens_query = require("./queries/useGetTokens.query.js");
55
55
  const reactjs_utils_delay = require("./utils/delay.js");
56
56
  const reactjs_utils_formatAmount = require("./utils/formatAmount.js");
57
57
  const reactjs_utils_getCleanStringAmount = require("./utils/getCleanStringAmount.js");
@@ -64,11 +64,9 @@ const reactjs_utils_pipe = require("./utils/pipe.js");
64
64
  const reactjs_utils_removeCommas = require("./utils/removeCommas.js");
65
65
  const reactjs_utils_roundAmount = require("./utils/roundAmount.js");
66
66
  const reactjs_utils_testNumber = require("./utils/testNumber.js");
67
- const react$1 = require("../react-R_xxu7fN.js");
67
+ const react = require("@reown/appkit/react");
68
68
  const wagmi = require("wagmi");
69
69
  const reactjs_constants_chains = require("./constants/chains.js");
70
- const index = require("../index-DsBh-EBw.js");
71
- const react = require("../react-CqKlu0W0.js");
72
70
  exports.AccountAddress = reactjs_components_AccountAddress_AccountAddress.AccountAddress;
73
71
  exports.AmountCard = reactjs_components_AmountCard_AmountCard.AmountCard;
74
72
  exports.AmountInput = reactjs_components_AmountInput_AmountInput.AmountInput;
@@ -93,6 +91,7 @@ exports.TokenSelector = reactjs_components_TokenSelector_TokenSelector.TokenSele
93
91
  exports.TransactionToastContainer = reactjs_components_TransactionToast_TransactionToastContainer.TransactionToastContainer;
94
92
  exports.TransactionToast = reactjs_components_TransactionToast_TransactionToast.TransactionToast;
95
93
  exports.TrimAddress = reactjs_components_TrimAddress_TrimAddress.TrimAddress;
94
+ exports.Error = reactjs_components_Error_Error.Error;
96
95
  exports.safeDocument = reactjs_constants_index.safeDocument;
97
96
  exports.safeWindow = reactjs_constants_index.safeWindow;
98
97
  exports.Web3AppContext = reactjs_context_Web3AppProvider.Web3AppContext;
@@ -124,7 +123,6 @@ exports.useGetHistoryQuery = reactjs_queries_useGetHistory_query.useGetHistoryQu
124
123
  exports.invalidateMvxTokensBalancesQuery = reactjs_queries_useGetMvxTokensBalances_query.invalidateMvxTokensBalancesQuery;
125
124
  exports.useGetMvxTokensBalancesQuery = reactjs_queries_useGetMvxTokensBalances_query.useGetMvxTokensBalancesQuery;
126
125
  exports.useGetRateMutation = reactjs_queries_useGetRate_mutation.useGetRateMutation;
127
- exports.useGetTokensQuery = reactjs_queries_useGetTokens_query.useGetTokensQuery;
128
126
  exports.delay = reactjs_utils_delay.delay;
129
127
  exports.formatAmount = reactjs_utils_formatAmount.formatAmount;
130
128
  exports.getCleanStringAmount = reactjs_utils_getCleanStringAmount.getCleanStringAmount;
@@ -137,19 +135,49 @@ exports.pipe = reactjs_utils_pipe.pipe;
137
135
  exports.removeCommas = reactjs_utils_removeCommas.removeCommas;
138
136
  exports.roundAmount = reactjs_utils_roundAmount.roundAmount;
139
137
  exports.testNumber = reactjs_utils_testNumber.testNumber;
140
- exports.useAppKitNetwork = react$1.useAppKitNetwork;
138
+ Object.defineProperty(exports, "useAppKit", {
139
+ enumerable: true,
140
+ get: () => react.useAppKit
141
+ });
142
+ Object.defineProperty(exports, "useAppKitAccount", {
143
+ enumerable: true,
144
+ get: () => react.useAppKitAccount
145
+ });
146
+ Object.defineProperty(exports, "useAppKitEvents", {
147
+ enumerable: true,
148
+ get: () => react.useAppKitEvents
149
+ });
150
+ Object.defineProperty(exports, "useAppKitNetwork", {
151
+ enumerable: true,
152
+ get: () => react.useAppKitNetwork
153
+ });
154
+ Object.defineProperty(exports, "useAppKitNetworkCore", {
155
+ enumerable: true,
156
+ get: () => react.useAppKitNetworkCore
157
+ });
158
+ Object.defineProperty(exports, "useAppKitProvider", {
159
+ enumerable: true,
160
+ get: () => react.useAppKitProvider
161
+ });
162
+ Object.defineProperty(exports, "useAppKitState", {
163
+ enumerable: true,
164
+ get: () => react.useAppKitState
165
+ });
166
+ Object.defineProperty(exports, "useAppKitTheme", {
167
+ enumerable: true,
168
+ get: () => react.useAppKitTheme
169
+ });
170
+ Object.defineProperty(exports, "useDisconnect", {
171
+ enumerable: true,
172
+ get: () => react.useDisconnect
173
+ });
174
+ Object.defineProperty(exports, "useWalletInfo", {
175
+ enumerable: true,
176
+ get: () => react.useWalletInfo
177
+ });
141
178
  Object.defineProperty(exports, "useWaitForTransactionReceipt", {
142
179
  enumerable: true,
143
180
  get: () => wagmi.useWaitForTransactionReceipt
144
181
  });
145
182
  exports.ALL_NETWORK_ID = reactjs_constants_chains.ALL_NETWORK_ID;
146
183
  exports.chainIdentifier = reactjs_constants_chains.chainIdentifier;
147
- exports.useAppKit = index.useAppKit;
148
- exports.useAppKitEvents = index.useAppKitEvents;
149
- exports.useAppKitProvider = index.useAppKitProvider;
150
- exports.useAppKitState = index.useAppKitState;
151
- exports.useAppKitTheme = index.useAppKitTheme;
152
- exports.useWalletInfo = index.useWalletInfo;
153
- exports.useAppKitAccount = react.useAppKitAccount;
154
- exports.useAppKitNetworkCore = react.useAppKitNetworkCore;
155
- exports.useDisconnect = react.useDisconnect;
package/reactjs/index.mjs CHANGED
@@ -23,6 +23,7 @@ import { TokenSelector } from "./components/TokenSelector/TokenSelector.mjs";
23
23
  import { TransactionToastContainer } from "./components/TransactionToast/TransactionToastContainer.mjs";
24
24
  import { TransactionToast } from "./components/TransactionToast/TransactionToast.mjs";
25
25
  import { TrimAddress } from "./components/TrimAddress/TrimAddress.mjs";
26
+ import { Error } from "./components/Error/Error.mjs";
26
27
  import { safeDocument, safeWindow } from "./constants/index.mjs";
27
28
  import { Web3AppContext, Web3AppProvider } from "./context/Web3AppProvider.mjs";
28
29
  import { useWeb3App } from "./context/useWeb3App.mjs";
@@ -32,7 +33,7 @@ import { useSecondAmountSchema } from "./hooks/validation/useSecondAmountSchema.
32
33
  import { useTestHasEnoughFunds } from "./hooks/validation/useTestHasEnoughFunds.mjs";
33
34
  import { useTestIsConnected } from "./hooks/validation/useTestIsConnected.mjs";
34
35
  import { useAccount } from "./hooks/useAccount.mjs";
35
- import { u } from "../useBalances-C_69CFoa.mjs";
36
+ import { u } from "../useBalances-Bom1mw1J.mjs";
36
37
  import { BridgeFormikValuesEnum, useBridgeFormik } from "./hooks/useBridgeFormik.mjs";
37
38
  import { useDebounce } from "./hooks/useDebounce.mjs";
38
39
  import { useFetchBridgeData } from "./hooks/useFetchBridgeData.mjs";
@@ -48,7 +49,6 @@ import { invalidateEvmTokensBalances, useGetEvmTokensBalancesQuery } from "./que
48
49
  import { invalidateHistoryQuery, useGetHistoryQuery } from "./queries/useGetHistory.query.mjs";
49
50
  import { invalidateMvxTokensBalancesQuery, useGetMvxTokensBalancesQuery } from "./queries/useGetMvxTokensBalances.query.mjs";
50
51
  import { useGetRateMutation } from "./queries/useGetRate.mutation.mjs";
51
- import { useGetTokensQuery } from "./queries/useGetTokens.query.mjs";
52
52
  import { delay } from "./utils/delay.mjs";
53
53
  import { formatAmount } from "./utils/formatAmount.mjs";
54
54
  import { getCleanStringAmount } from "./utils/getCleanStringAmount.mjs";
@@ -61,11 +61,9 @@ import { pipe } from "./utils/pipe.mjs";
61
61
  import { removeCommas } from "./utils/removeCommas.mjs";
62
62
  import { roundAmount } from "./utils/roundAmount.mjs";
63
63
  import { testNumber } from "./utils/testNumber.mjs";
64
- import { u as u2 } from "../react-B_iI3-1z.mjs";
64
+ import { useAppKit, useAppKitAccount, useAppKitEvents, useAppKitNetwork, useAppKitNetworkCore, useAppKitProvider, useAppKitState, useAppKitTheme, useDisconnect, useWalletInfo } from "@reown/appkit/react";
65
65
  import { useWaitForTransactionReceipt } from "wagmi";
66
66
  import { ALL_NETWORK_ID, chainIdentifier } from "./constants/chains.mjs";
67
- import { u as u3, a, e, b, c, d } from "../index-BIVnypNe.mjs";
68
- import { u as u4, b as b2, a as a2 } from "../react-47kZTyAT.mjs";
69
67
  export {
70
68
  ALL_NETWORK_ID,
71
69
  AccountAddress,
@@ -79,6 +77,7 @@ export {
79
77
  CopyButton,
80
78
  CustomConnectButton,
81
79
  DisplayAmount,
80
+ Error,
82
81
  MvxAccountDisplay,
83
82
  MvxConnectButton,
84
83
  MxButton,
@@ -117,18 +116,18 @@ export {
117
116
  testNumber,
118
117
  useAccount,
119
118
  useAmountSchema,
120
- u3 as useAppKit,
121
- u4 as useAppKitAccount,
122
- a as useAppKitEvents,
123
- u2 as useAppKitNetwork,
124
- b2 as useAppKitNetworkCore,
125
- e as useAppKitProvider,
126
- b as useAppKitState,
127
- c as useAppKitTheme,
119
+ useAppKit,
120
+ useAppKitAccount,
121
+ useAppKitEvents,
122
+ useAppKitNetwork,
123
+ useAppKitNetworkCore,
124
+ useAppKitProvider,
125
+ useAppKitState,
126
+ useAppKitTheme,
128
127
  u as useBalances,
129
128
  useBridgeFormik,
130
129
  useDebounce,
131
- a2 as useDisconnect,
130
+ useDisconnect,
132
131
  useFetchBridgeData,
133
132
  useFetchTokens,
134
133
  useGetAllTokensQuery,
@@ -138,7 +137,6 @@ export {
138
137
  useGetHistoryQuery,
139
138
  useGetMvxTokensBalancesQuery,
140
139
  useGetRateMutation,
141
- useGetTokensQuery,
142
140
  useResolveTokenChain,
143
141
  useSecondAmountSchema,
144
142
  useSendTransactions,
@@ -146,6 +144,6 @@ export {
146
144
  useTestHasEnoughFunds,
147
145
  useTestIsConnected,
148
146
  useWaitForTransactionReceipt,
149
- d as useWalletInfo,
147
+ useWalletInfo,
150
148
  useWeb3App
151
149
  };