@multiversx/sdk-dapp-liquidity 2.0.0 → 2.1.0-alpha.1

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 (375) hide show
  1. package/all-networks--dfVLHLJ.js +2 -0
  2. package/all-networks-Czd8zS1n.mjs +4 -0
  3. package/api/checkAccount.js +1 -21
  4. package/api/checkAccount.mjs +13 -13
  5. package/api/confirmRate.js +1 -29
  6. package/api/confirmRate.mjs +17 -22
  7. package/api/getChains.js +1 -17
  8. package/api/getChains.mjs +10 -10
  9. package/api/getRate.js +1 -27
  10. package/api/getRate.mjs +17 -20
  11. package/api/getTokens.js +1 -22
  12. package/api/getTokens.mjs +14 -15
  13. package/api/getTokensBalances.js +1 -21
  14. package/api/getTokensBalances.mjs +13 -13
  15. package/api/getTransactions.js +1 -38
  16. package/api/getTransactions.mjs +25 -31
  17. package/api/index.js +1 -18
  18. package/api/index.mjs +16 -16
  19. package/api/sendTransactions.js +1 -32
  20. package/api/sendTransactions.mjs +19 -19
  21. package/api/tests/confirmRate.spec.js +1 -130
  22. package/api/tests/confirmRate.spec.mjs +44 -58
  23. package/api/tests/getChains.spec.js +1 -43
  24. package/api/tests/getChains.spec.mjs +15 -18
  25. package/api/tests/getRate.spec.js +1 -87
  26. package/api/tests/getRate.spec.mjs +35 -49
  27. package/api/tests/getTokens.spec.js +1 -68
  28. package/api/tests/getTokens.spec.mjs +23 -29
  29. package/api/tests/getTransactions.spec.js +1 -94
  30. package/api/tests/getTransactions.spec.mjs +35 -51
  31. package/api/tests/sendTransactions.spec.js +1 -96
  32. package/api/tests/sendTransactions.spec.mjs +44 -52
  33. package/constants/index.js +1 -4
  34. package/constants/index.mjs +2 -2
  35. package/default-D0Jk5ROI.mjs +4 -0
  36. package/default-DbU6vPaB.js +2 -0
  37. package/helpers/assertRateConfirmationMatchesIntent.d.ts +8 -0
  38. package/helpers/assertRateConfirmationMatchesIntent.js +2 -0
  39. package/helpers/assertRateConfirmationMatchesIntent.mjs +20 -0
  40. package/helpers/base64Utils.js +1 -31
  41. package/helpers/base64Utils.mjs +14 -24
  42. package/helpers/decodeLoginToken.js +1 -27
  43. package/helpers/decodeLoginToken.mjs +13 -18
  44. package/helpers/decodeToken.js +1 -39
  45. package/helpers/decodeToken.mjs +20 -31
  46. package/helpers/getApiURL.js +1 -7
  47. package/helpers/getApiURL.mjs +3 -5
  48. package/helpers/getBridgeURL.js +1 -7
  49. package/helpers/getBridgeURL.mjs +3 -5
  50. package/helpers/getDisplayName.js +1 -11
  51. package/helpers/getDisplayName.mjs +3 -8
  52. package/helpers/getMvxApiURL.js +1 -7
  53. package/helpers/getMvxApiURL.mjs +3 -5
  54. package/helpers/getMvxChainId.js +1 -7
  55. package/helpers/getMvxChainId.mjs +3 -5
  56. package/helpers/getMvxExplorerAddress.js +1 -7
  57. package/helpers/getMvxExplorerAddress.mjs +3 -5
  58. package/helpers/index.d.ts +2 -0
  59. package/helpers/index.js +1 -22
  60. package/helpers/index.mjs +24 -20
  61. package/helpers/safeImageUrl.d.ts +1 -0
  62. package/helpers/safeImageUrl.js +2 -0
  63. package/helpers/safeImageUrl.mjs +13 -0
  64. package/helpers/serializeTransaction.js +1 -8
  65. package/helpers/serializeTransaction.mjs +3 -5
  66. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.d.ts +1 -0
  67. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +2 -0
  68. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +52 -0
  69. package/helpers/tests/base64Utils.spec.js +1 -29
  70. package/helpers/tests/base64Utils.spec.mjs +11 -24
  71. package/helpers/tests/decodeLoginToken.spec.js +1 -34
  72. package/helpers/tests/decodeLoginToken.spec.mjs +13 -24
  73. package/helpers/tests/decodeToken.spec.js +1 -27
  74. package/helpers/tests/decodeToken.spec.mjs +7 -12
  75. package/helpers/tests/safeImageUrl.spec.d.ts +1 -0
  76. package/helpers/tests/safeImageUrl.spec.js +2 -0
  77. package/helpers/tests/safeImageUrl.spec.mjs +32 -0
  78. package/helpers/tests/serializeTransaction.spec.d.ts +1 -0
  79. package/helpers/tests/serializeTransaction.spec.js +2 -0
  80. package/helpers/tests/serializeTransaction.spec.mjs +24 -0
  81. package/index.js +1 -228
  82. package/index.mjs +196 -192
  83. package/package.json +14 -9
  84. package/react.esm-B0AMOHxa.js +73 -0
  85. package/react.esm-BxvJJ86Q.mjs +9949 -0
  86. package/reactjs/adapters/SuiAdapter.d.ts +14 -0
  87. package/reactjs/adapters/SuiAdapter.js +1 -349
  88. package/reactjs/adapters/SuiAdapter.mjs +171 -199
  89. package/reactjs/components/AccountAddress/AccountAddress.js +1 -31
  90. package/reactjs/components/AccountAddress/AccountAddress.mjs +16 -16
  91. package/reactjs/components/AccountAddress/index.js +1 -4
  92. package/reactjs/components/AccountAddress/index.mjs +2 -2
  93. package/reactjs/components/AmountCard/AmountCard.js +1 -33
  94. package/reactjs/components/AmountCard/AmountCard.mjs +19 -21
  95. package/reactjs/components/AmountCard/index.js +1 -4
  96. package/reactjs/components/AmountCard/index.mjs +2 -2
  97. package/reactjs/components/AmountInput/AmountInput.js +1 -71
  98. package/reactjs/components/AmountInput/AmountInput.mjs +42 -46
  99. package/reactjs/components/AmountInput/index.js +1 -4
  100. package/reactjs/components/AmountInput/index.mjs +2 -2
  101. package/reactjs/components/BridgeForm/BridgeForm.d.ts +9 -0
  102. package/reactjs/components/BridgeForm/BridgeForm.js +1 -89
  103. package/reactjs/components/BridgeForm/BridgeForm.mjs +72 -79
  104. package/reactjs/components/BridgeForm/Deposit.js +1 -673
  105. package/reactjs/components/BridgeForm/Deposit.mjs +381 -503
  106. package/reactjs/components/BridgeForm/Transfer.js +1 -559
  107. package/reactjs/components/BridgeForm/Transfer.mjs +316 -427
  108. package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.js +1 -78
  109. package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.mjs +47 -70
  110. package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.js +1 -58
  111. package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.mjs +36 -47
  112. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +1 -266
  113. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +163 -231
  114. package/reactjs/components/BridgeForm/index.js +1 -4
  115. package/reactjs/components/BridgeForm/index.mjs +2 -2
  116. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -76
  117. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +35 -65
  118. package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -367
  119. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +177 -193
  120. package/reactjs/components/BridgeHistory/index.js +1 -4
  121. package/reactjs/components/BridgeHistory/index.mjs +2 -2
  122. package/reactjs/components/Connect/BridgeAccountDisplay.js +1 -150
  123. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +99 -115
  124. package/reactjs/components/Connect/BridgeConnectButton.js +1 -34
  125. package/reactjs/components/Connect/BridgeConnectButton.mjs +20 -19
  126. package/reactjs/components/Connect/ChainSelectConnect.js +1 -144
  127. package/reactjs/components/Connect/ChainSelectConnect.mjs +70 -83
  128. package/reactjs/components/Connect/CustomConnectButton.js +1 -40
  129. package/reactjs/components/Connect/CustomConnectButton.mjs +24 -30
  130. package/reactjs/components/Connect/MvxAccountDisplay.js +1 -97
  131. package/reactjs/components/Connect/MvxAccountDisplay.mjs +47 -50
  132. package/reactjs/components/Connect/MvxConnectButton.js +1 -43
  133. package/reactjs/components/Connect/MvxConnectButton.mjs +35 -40
  134. package/reactjs/components/Connect/SwitchChainButton.js +1 -29
  135. package/reactjs/components/Connect/SwitchChainButton.mjs +15 -18
  136. package/reactjs/components/Connect/index.js +1 -16
  137. package/reactjs/components/Connect/index.mjs +14 -14
  138. package/reactjs/components/CopyButton/CopyButton.js +1 -46
  139. package/reactjs/components/CopyButton/CopyButton.mjs +33 -36
  140. package/reactjs/components/CopyButton/index.js +1 -4
  141. package/reactjs/components/CopyButton/index.mjs +2 -2
  142. package/reactjs/components/CopyButton/utils/copyToClipboard.js +1 -38
  143. package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +20 -32
  144. package/reactjs/components/CopyButton/utils/index.js +1 -4
  145. package/reactjs/components/CopyButton/utils/index.mjs +2 -2
  146. package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -90
  147. package/reactjs/components/DisplayAmount/DisplayAmount.mjs +68 -75
  148. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +1 -39
  149. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +26 -33
  150. package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +1 -61
  151. package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +38 -46
  152. package/reactjs/components/DisplayAmount/index.js +1 -4
  153. package/reactjs/components/DisplayAmount/index.mjs +2 -2
  154. package/reactjs/components/DisplayAmount/utils/index.js +1 -4
  155. package/reactjs/components/DisplayAmount/utils/index.mjs +2 -2
  156. package/reactjs/components/DisplayAmount/utils/truncateAmount.js +1 -21
  157. package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +9 -13
  158. package/reactjs/components/Error/Error.js +1 -66
  159. package/reactjs/components/Error/Error.mjs +29 -29
  160. package/reactjs/components/Error/index.js +1 -4
  161. package/reactjs/components/Error/index.mjs +2 -2
  162. package/reactjs/components/SmallLoader/SmallLoader.js +1 -21
  163. package/reactjs/components/SmallLoader/SmallLoader.mjs +13 -18
  164. package/reactjs/components/SmallLoader/index.js +1 -4
  165. package/reactjs/components/SmallLoader/index.mjs +2 -2
  166. package/reactjs/components/ToggleDirection/ToggleDirection.js +1 -30
  167. package/reactjs/components/ToggleDirection/ToggleDirection.mjs +22 -28
  168. package/reactjs/components/TokenSelector/TokenSelector.js +1 -172
  169. package/reactjs/components/TokenSelector/TokenSelector.mjs +98 -118
  170. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +1 -94
  171. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +48 -57
  172. package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +1 -51
  173. package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +45 -44
  174. package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +1 -18
  175. package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +9 -14
  176. package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +1 -6
  177. package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +2 -4
  178. package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +1 -39
  179. package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +22 -18
  180. package/reactjs/components/TokenSelector/components/SelectContainer.js +1 -40
  181. package/reactjs/components/TokenSelector/components/SelectContainer.mjs +36 -38
  182. package/reactjs/components/TokenSelector/components/SelectContent.js +1 -136
  183. package/reactjs/components/TokenSelector/components/SelectContent.mjs +79 -103
  184. package/reactjs/components/TokenSelector/components/SelectedOption.js +1 -28
  185. package/reactjs/components/TokenSelector/components/SelectedOption.mjs +22 -24
  186. package/reactjs/components/TokenSelector/components/TokenIcon.js +1 -81
  187. package/reactjs/components/TokenSelector/components/TokenIcon.mjs +52 -57
  188. package/reactjs/components/TokenSelector/components/TokenItem.js +1 -80
  189. package/reactjs/components/TokenSelector/components/TokenItem.mjs +41 -54
  190. package/reactjs/components/TokenSelector/components/TokenList.js +1 -23
  191. package/reactjs/components/TokenSelector/components/TokenList.mjs +19 -21
  192. package/reactjs/components/TokenSelector/components/TokenSymbol.js +1 -25
  193. package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +14 -15
  194. package/reactjs/components/TokenSelector/index.js +1 -4
  195. package/reactjs/components/TokenSelector/index.mjs +2 -2
  196. package/reactjs/components/TransactionToast/TransactionToast.js +1 -53
  197. package/reactjs/components/TransactionToast/TransactionToast.mjs +27 -28
  198. package/reactjs/components/TransactionToast/TransactionToastContainer.js +1 -20
  199. package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +16 -18
  200. package/reactjs/components/TransactionToast/index.js +1 -6
  201. package/reactjs/components/TransactionToast/index.mjs +4 -4
  202. package/reactjs/components/TrimAddress/TrimAddress.js +1 -27
  203. package/reactjs/components/TrimAddress/TrimAddress.mjs +19 -24
  204. package/reactjs/components/TrimAddress/index.js +1 -4
  205. package/reactjs/components/TrimAddress/index.mjs +2 -2
  206. package/reactjs/components/base/MxButton/MxButton.js +1 -71
  207. package/reactjs/components/base/MxButton/MxButton.mjs +46 -46
  208. package/reactjs/components/base/MxButton/index.js +1 -4
  209. package/reactjs/components/base/MxButton/index.mjs +2 -2
  210. package/reactjs/components/base/MxCard/MxCard.js +1 -54
  211. package/reactjs/components/base/MxCard/MxCard.mjs +34 -34
  212. package/reactjs/components/base/MxCard/index.js +1 -4
  213. package/reactjs/components/base/MxCard/index.mjs +2 -2
  214. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +1 -28
  215. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +24 -26
  216. package/reactjs/components/base/MxCircleLoader/index.js +1 -4
  217. package/reactjs/components/base/MxCircleLoader/index.mjs +2 -2
  218. package/reactjs/components/base/MxLink/MxLink.js +1 -70
  219. package/reactjs/components/base/MxLink/MxLink.mjs +44 -46
  220. package/reactjs/components/base/MxLink/index.js +1 -4
  221. package/reactjs/components/base/MxLink/index.mjs +2 -2
  222. package/reactjs/components/base/MxSearch/MxSearch.js +1 -69
  223. package/reactjs/components/base/MxSearch/MxSearch.mjs +37 -41
  224. package/reactjs/components/base/MxSearch/index.js +1 -4
  225. package/reactjs/components/base/MxSearch/index.mjs +2 -2
  226. package/reactjs/components/base/MxSlideover/MxSlideover.js +1 -78
  227. package/reactjs/components/base/MxSlideover/MxSlideover.mjs +72 -74
  228. package/reactjs/components/base/MxSlideover/index.js +1 -4
  229. package/reactjs/components/base/MxSlideover/index.mjs +2 -2
  230. package/reactjs/components/base/MxTooltip/MxTooltip.js +1 -163
  231. package/reactjs/components/base/MxTooltip/MxTooltip.mjs +92 -135
  232. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +1 -33
  233. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +29 -31
  234. package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +1 -4
  235. package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +2 -2
  236. package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +1 -27
  237. package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +23 -25
  238. package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +1 -4
  239. package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +2 -2
  240. package/reactjs/components/base/MxTooltip/components/index.js +1 -6
  241. package/reactjs/components/base/MxTooltip/components/index.mjs +4 -4
  242. package/reactjs/components/base/MxTooltip/index.js +1 -4
  243. package/reactjs/components/base/MxTooltip/index.mjs +2 -2
  244. package/reactjs/components/base/index.js +1 -14
  245. package/reactjs/components/base/index.mjs +12 -12
  246. package/reactjs/components/index.js +1 -54
  247. package/reactjs/components/index.mjs +52 -52
  248. package/reactjs/constants/chains.js +1 -54
  249. package/reactjs/constants/chains.mjs +33 -52
  250. package/reactjs/constants/index.js +1 -13
  251. package/reactjs/constants/index.mjs +9 -10
  252. package/reactjs/context/Web3AppProvider.js +1 -40
  253. package/reactjs/context/Web3AppProvider.mjs +34 -34
  254. package/reactjs/context/queryClient.js +1 -11
  255. package/reactjs/context/queryClient.mjs +5 -8
  256. package/reactjs/context/useWeb3App.js +1 -12
  257. package/reactjs/context/useWeb3App.mjs +7 -8
  258. package/reactjs/helpers/index.js +1 -6
  259. package/reactjs/helpers/index.mjs +4 -4
  260. package/reactjs/helpers/resolveBridgeApiChainId.js +1 -40
  261. package/reactjs/helpers/resolveBridgeApiChainId.mjs +21 -34
  262. package/reactjs/hooks/index.js +1 -35
  263. package/reactjs/hooks/index.mjs +33 -33
  264. package/reactjs/hooks/tests/useGenericSignMessage.spec.d.ts +1 -0
  265. package/reactjs/hooks/tests/useGenericSignMessage.spec.js +2 -0
  266. package/reactjs/hooks/tests/useGenericSignMessage.spec.mjs +52 -0
  267. package/reactjs/hooks/tests/useSignTransaction.spec.d.ts +1 -0
  268. package/reactjs/hooks/tests/useSignTransaction.spec.js +2 -0
  269. package/reactjs/hooks/tests/useSignTransaction.spec.mjs +156 -0
  270. package/reactjs/hooks/useAccount.js +1 -13
  271. package/reactjs/hooks/useAccount.mjs +7 -8
  272. package/reactjs/hooks/useBalances.js +1 -53
  273. package/reactjs/hooks/useBalances.mjs +28 -40
  274. package/reactjs/hooks/useBridgeApiChainId.js +1 -13
  275. package/reactjs/hooks/useBridgeApiChainId.mjs +9 -9
  276. package/reactjs/hooks/useBridgeFormik.js +1 -162
  277. package/reactjs/hooks/useBridgeFormik.mjs +110 -150
  278. package/reactjs/hooks/useDebounce.js +1 -13
  279. package/reactjs/hooks/useDebounce.mjs +8 -10
  280. package/reactjs/hooks/useFetchBridgeData.js +1 -45
  281. package/reactjs/hooks/useFetchBridgeData.mjs +37 -38
  282. package/reactjs/hooks/useFetchTokens.js +1 -113
  283. package/reactjs/hooks/useFetchTokens.mjs +80 -106
  284. package/reactjs/hooks/useGenericSignMessage.js +1 -55
  285. package/reactjs/hooks/useGenericSignMessage.mjs +47 -47
  286. package/reactjs/hooks/useGetChainId.js +1 -11
  287. package/reactjs/hooks/useGetChainId.mjs +7 -8
  288. package/reactjs/hooks/useResolveTokenChain.js +1 -20
  289. package/reactjs/hooks/useResolveTokenChain.mjs +11 -14
  290. package/reactjs/hooks/useSendTransactions.js +1 -25
  291. package/reactjs/hooks/useSendTransactions.mjs +19 -23
  292. package/reactjs/hooks/useSignTransaction.js +1 -86
  293. package/reactjs/hooks/useSignTransaction.mjs +59 -59
  294. package/reactjs/hooks/useSuiConnect.js +1 -86
  295. package/reactjs/hooks/useSuiConnect.mjs +52 -70
  296. package/reactjs/hooks/validation/index.js +1 -10
  297. package/reactjs/hooks/validation/index.mjs +8 -8
  298. package/reactjs/hooks/validation/useAmountSchema.js +1 -32
  299. package/reactjs/hooks/validation/useAmountSchema.mjs +8 -11
  300. package/reactjs/hooks/validation/useSecondAmountSchema.js +1 -26
  301. package/reactjs/hooks/validation/useSecondAmountSchema.mjs +5 -6
  302. package/reactjs/hooks/validation/useTestHasEnoughFunds.js +1 -37
  303. package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +20 -29
  304. package/reactjs/hooks/validation/useTestIsConnected.js +1 -27
  305. package/reactjs/hooks/validation/useTestIsConnected.mjs +13 -19
  306. package/reactjs/index.js +1 -190
  307. package/reactjs/index.mjs +154 -154
  308. package/reactjs/init/index.js +1 -5
  309. package/reactjs/init/index.mjs +3 -3
  310. package/reactjs/init/init.d.ts +1 -0
  311. package/reactjs/init/init.js +1 -139
  312. package/reactjs/init/init.mjs +59 -72
  313. package/reactjs/queries/index.js +1 -17
  314. package/reactjs/queries/index.mjs +15 -15
  315. package/reactjs/queries/useCheckAccount.query.js +1 -39
  316. package/reactjs/queries/useCheckAccount.query.mjs +29 -33
  317. package/reactjs/queries/useGetAllTokens.query.js +1 -35
  318. package/reactjs/queries/useGetAllTokens.query.mjs +26 -30
  319. package/reactjs/queries/useGetChains.query.js +1 -34
  320. package/reactjs/queries/useGetChains.query.mjs +26 -28
  321. package/reactjs/queries/useGetHistory.query.d.ts +1 -1
  322. package/reactjs/queries/useGetHistory.query.js +1 -68
  323. package/reactjs/queries/useGetHistory.query.mjs +55 -58
  324. package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +1 -1
  325. package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -71
  326. package/reactjs/queries/useGetMvxTokensBalances.query.mjs +40 -53
  327. package/reactjs/queries/useGetNonMvxTokensBalances.query.d.ts +1 -1
  328. package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -81
  329. package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +51 -59
  330. package/reactjs/queries/useGetRate.mutation.js +1 -18
  331. package/reactjs/queries/useGetRate.mutation.mjs +12 -15
  332. package/reactjs/reexports.js +1 -48
  333. package/reactjs/reexports.mjs +13 -13
  334. package/reactjs/utils/delay.js +1 -6
  335. package/reactjs/utils/delay.mjs +3 -3
  336. package/reactjs/utils/formatAmount.js +1 -23
  337. package/reactjs/utils/formatAmount.mjs +16 -17
  338. package/reactjs/utils/getCleanStringAmount.js +1 -11
  339. package/reactjs/utils/getCleanStringAmount.mjs +6 -8
  340. package/reactjs/utils/getCompletePathname.js +1 -5
  341. package/reactjs/utils/getCompletePathname.mjs +3 -3
  342. package/reactjs/utils/getInitialTokens.js +1 -12
  343. package/reactjs/utils/getInitialTokens.mjs +6 -7
  344. package/reactjs/utils/hasEnoughFunds.js +1 -19
  345. package/reactjs/utils/hasEnoughFunds.mjs +11 -14
  346. package/reactjs/utils/index.js +1 -26
  347. package/reactjs/utils/index.mjs +24 -24
  348. package/reactjs/utils/isStringFloat.js +1 -21
  349. package/reactjs/utils/isStringFloat.mjs +11 -18
  350. package/reactjs/utils/mxClsx.js +1 -8
  351. package/reactjs/utils/mxClsx.mjs +4 -6
  352. package/reactjs/utils/pipe.js +1 -25
  353. package/reactjs/utils/pipe.mjs +13 -17
  354. package/reactjs/utils/removeCommas.js +1 -6
  355. package/reactjs/utils/removeCommas.mjs +2 -4
  356. package/reactjs/utils/roundAmount.js +1 -40
  357. package/reactjs/utils/roundAmount.mjs +16 -36
  358. package/reactjs/utils/testNumber.js +1 -4
  359. package/reactjs/utils/testNumber.mjs +2 -2
  360. package/store/inMemoryStore.js +1 -39
  361. package/store/inMemoryStore.mjs +17 -21
  362. package/style.css +1 -2274
  363. package/types/chainType.js +1 -11
  364. package/types/chainType.mjs +2 -9
  365. package/types/errors.d.ts +3 -0
  366. package/types/errors.js +2 -0
  367. package/types/errors.mjs +8 -0
  368. package/types/providerType.js +1 -9
  369. package/types/providerType.mjs +2 -7
  370. package/types/transaction.d.ts +2 -0
  371. package/all-networks-EJIVYZ_i.mjs +0 -4
  372. package/all-networks-NYACMyeN.js +0 -4
  373. package/default-BYtXv70Z.mjs +0 -4
  374. package/default-H3AbmzFV.js +0 -4
  375. package/reactjs/hooks/useSignTransaction.d.ts +0 -511
@@ -7,6 +7,11 @@ export type SuiAdapterOptions = {
7
7
  * AppKit sometimes passes an empty `networks` array into `construct`; this keeps WC valid.
8
8
  */
9
9
  explicitCaipChains?: string[];
10
+ /**
11
+ * When set, `connect()` will throw if the WalletConnect session advertises a different address.
12
+ * If not set, any address is accepted (backward-compatible).
13
+ */
14
+ expectedSuiAddress?: string;
10
15
  };
11
16
  export declare class SuiAdapter extends AdapterBlueprint {
12
17
  /**
@@ -16,6 +21,7 @@ export declare class SuiAdapter extends AdapterBlueprint {
16
21
  */
17
22
  private sharedWcProvider?;
18
23
  private readonly explicitCaipChainsFromInit;
24
+ private readonly expectedSuiAddress?;
19
25
  constructor(opts?: SuiAdapterOptions);
20
26
  /**
21
27
  * AppKit passes `networks` here from `createAppKit({ networks })` filtered by namespace.
@@ -47,6 +53,14 @@ export declare class SuiAdapter extends AdapterBlueprint {
47
53
  syncConnection(params: AdapterBlueprint.SyncConnectionParams): Promise<AdapterBlueprint.ConnectResult>;
48
54
  syncConnections({ connectToFirstConnector, caipNetwork }: AdapterBlueprint.SyncConnectionsParams): Promise<void>;
49
55
  getWalletConnectProvider(params: AdapterBlueprint.GetWalletConnectProviderParams): AdapterBlueprint.GetWalletConnectProviderResult;
56
+ /**
57
+ * Resolves the CAIP-2 chain scope string for WalletConnect requests.
58
+ * Resolution order:
59
+ * 1. `caipNetworkId` argument (if it starts with `'sui:'`)
60
+ * 2. First `'sui:'`-prefixed entry in `explicitCaipChainsFromInit`
61
+ * 3. `'sui:mainnet'` as a safe last resort
62
+ */
63
+ private getChainScope;
50
64
  signMessage(params: AdapterBlueprint.SignMessageParams): Promise<AdapterBlueprint.SignMessageResult>;
51
65
  sendTransaction(params: AdapterBlueprint.SendTransactionParams): Promise<AdapterBlueprint.SendTransactionResult>;
52
66
  estimateGas(): Promise<AdapterBlueprint.EstimateGasTransactionResult>;
@@ -1,350 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
- const appkitControllers = require("@reown/appkit-controllers");
8
- const WC_ID = "walletConnect";
9
- const DEFAULT_SUI_CAIP_CHAINS = ["sui:mainnet", "sui:testnet", "sui:devnet"];
10
- class SuiAdapter extends appkitControllers.AdapterBlueprint {
11
- constructor(opts) {
12
- super({
13
- namespace: "sui",
14
- adapterType: "sui"
15
- });
16
- /**
17
- * AppKit’s single WalletConnect UniversalProvider (same instance as Wagmi/EVM).
18
- * @see @reown/appkit-adapter-solana — adapters must NOT call UniversalProvider.init() again
19
- * (duplicate Core breaks pairing / QR). `listenWalletConnect` attaches `display_uri` here only.
20
- */
21
- __publicField(this, "sharedWcProvider");
22
- __publicField(this, "explicitCaipChainsFromInit");
23
- /**
24
- * AppKit passes `networks` here from `createAppKit({ networks })` filtered by namespace.
25
- * `ChainController.getRequestedCaipNetworks('sui')` is often still empty → we must keep this.
26
- */
27
- __publicField(this, "suiNetworksFromConfig", []);
28
- this.explicitCaipChainsFromInit = (opts == null ? void 0 : opts.explicitCaipChains) ?? [];
29
- }
30
- construct(params) {
31
- super.construct(params);
32
- this.suiNetworksFromConfig = params.networks ?? [];
33
- }
34
- /**
35
- * Resolves CAIP-2 chain ids for the WC session. Never return [] (breaks pairing + QR UI).
36
- */
37
- pickChainsFromExplicit(explicit, chainId) {
38
- if (explicit.length === 0) {
39
- return DEFAULT_SUI_CAIP_CHAINS;
40
- }
41
- if (chainId !== void 0 && chainId !== null) {
42
- const cid = chainId.toString();
43
- const match = explicit.find(
44
- (c) => c === `sui:${cid}` || c.endsWith(`:${cid}`)
45
- );
46
- if (match) {
47
- return [match];
48
- }
49
- }
50
- return explicit;
51
- }
52
- resolveSuiChainsForConnect(chainId) {
53
- const fromController = this.getCaipNetworks("sui");
54
- const source = fromController.length > 0 ? fromController : this.suiNetworksFromConfig;
55
- if (source.length === 0) {
56
- return this.pickChainsFromExplicit(
57
- this.explicitCaipChainsFromInit,
58
- chainId
59
- );
60
- }
61
- const toCaip = (n) => n.caipNetworkId || `sui:${n.id}`;
62
- if (chainId !== void 0 && chainId !== null) {
63
- const match = source.find((n) => {
64
- var _a;
65
- return ((_a = n.id) == null ? void 0 : _a.toString()) === chainId.toString();
66
- });
67
- if (match) {
68
- return [toCaip(match)];
69
- }
70
- }
71
- return source.map(toCaip);
72
- }
73
- /**
74
- * `WalletConnectConnector` typings require `caipNetworks` (ChainController may still be empty
75
- * when this runs). Prefer networks from `construct`, else explicit/init CAIP ids.
76
- */
77
- getCaipNetworksForWalletConnectConnector() {
78
- if (this.suiNetworksFromConfig.length > 0) {
79
- return this.suiNetworksFromConfig;
80
- }
81
- const caipIds = this.explicitCaipChainsFromInit.length > 0 ? this.explicitCaipChainsFromInit : DEFAULT_SUI_CAIP_CHAINS;
82
- return caipIds.map((caip) => {
83
- const id = caip.startsWith("sui:") ? caip.slice(4) : caip;
84
- return {
85
- id,
86
- chainNamespace: "sui",
87
- caipNetworkId: caip,
88
- name: "Sui",
89
- nativeCurrency: { name: "SUI", symbol: "SUI", decimals: 9 },
90
- rpcUrls: {
91
- default: { http: [`https://fullnode.${id}.sui.io:443`] }
92
- }
93
- };
94
- });
95
- }
96
- syncConnectors() {
97
- }
98
- async setUniversalProvider(sharedProvider) {
99
- this.sharedWcProvider = sharedProvider;
100
- const wcConnector = new appkitControllers.WalletConnectConnector({
101
- provider: sharedProvider,
102
- namespace: "sui",
103
- caipNetworks: this.getCaipNetworksForWalletConnectConnector()
104
- });
105
- this.addConnector(wcConnector);
106
- appkitControllers.WcHelpersUtil.listenWcProvider({
107
- universalProvider: sharedProvider,
108
- namespace: "sui",
109
- onConnect: (accounts) => this.onConnect(accounts, WC_ID),
110
- onDisconnect: () => this.onDisconnect(WC_ID),
111
- onAccountsChanged: (accounts) => this.onAccountsChanged(accounts, WC_ID, false)
112
- });
113
- }
114
- getWcProvider() {
115
- if (!this.sharedWcProvider) {
116
- throw new Error(
117
- "SuiAdapter: UniversalProvider not ready — setUniversalProvider must run before connect"
118
- );
119
- }
120
- return this.sharedWcProvider;
121
- }
122
- async connectWalletConnect(chainId) {
123
- var _a, _b;
124
- const wc = this.getWcProvider();
125
- if ((_b = (_a = wc.session) == null ? void 0 : _a.namespaces) == null ? void 0 : _b["sui"]) {
126
- const clientId2 = await wc.client.core.crypto.getClientId();
127
- return { clientId: clientId2 };
128
- }
129
- const chains = this.resolveSuiChainsForConnect(chainId);
130
- const safeChains = chains.length > 0 ? chains : DEFAULT_SUI_CAIP_CHAINS;
131
- await wc.connect({
132
- optionalNamespaces: {
133
- sui: {
134
- methods: [
135
- "sui_signPersonalMessage",
136
- "sui_signTransaction",
137
- "sui_signAndExecuteTransaction"
138
- ],
139
- chains: safeChains,
140
- events: []
141
- }
142
- }
143
- });
144
- const clientId = await wc.client.core.crypto.getClientId();
145
- return { clientId };
146
- }
147
- async connect(params) {
148
- var _a, _b, _c;
149
- const connector = this.connectors.find((c) => c.id === params.id);
150
- if (!connector) {
151
- throw new Error("Sui connector not found");
152
- }
153
- const existingConnection = this.getConnection({
154
- address: params.address,
155
- connectorId: connector.id,
156
- connections: this.connections,
157
- connectors: this.connectors
158
- });
159
- if (existingConnection == null ? void 0 : existingConnection.account) {
160
- const chainId2 = ((_a = existingConnection.caipNetwork) == null ? void 0 : _a.id) ?? params.chainId ?? "mainnet";
161
- this.emit("accountChanged", {
162
- address: existingConnection.account.address,
163
- chainId: chainId2,
164
- connector
165
- });
166
- return {
167
- id: connector.id,
168
- address: existingConnection.account.address,
169
- chainId: chainId2,
170
- provider: connector.provider,
171
- type: connector.type
172
- };
173
- }
174
- const wc = this.getWcProvider();
175
- const accounts = appkitControllers.WcHelpersUtil.getWalletConnectAccounts(
176
- wc,
177
- "sui"
178
- );
179
- const address = (_b = accounts[0]) == null ? void 0 : _b.address;
180
- if (!address) {
181
- throw new Error("No Sui account found after WalletConnect session");
182
- }
183
- const caipNetwork = (_c = this.getCaipNetworks()) == null ? void 0 : _c.find(
184
- (n) => n.id === params.chainId
185
- );
186
- this.addConnection({
187
- connectorId: connector.id,
188
- accounts: [{ address }],
189
- caipNetwork
190
- });
191
- const chainId = params.chainId ?? (caipNetwork == null ? void 0 : caipNetwork.id) ?? "mainnet";
192
- this.emit("accountChanged", {
193
- address,
194
- chainId,
195
- connector
196
- });
197
- return {
198
- id: connector.id,
199
- address,
200
- chainId,
201
- provider: connector.provider,
202
- type: connector.type
203
- };
204
- }
205
- async disconnect(params) {
206
- if (params == null ? void 0 : params.id) {
207
- if (this.sharedWcProvider) {
208
- try {
209
- await this.sharedWcProvider.disconnect();
210
- } catch {
211
- }
212
- }
213
- this.deleteConnection(params.id);
214
- }
215
- if (this.connections.length === 0) {
216
- this.emit("disconnect");
217
- } else {
218
- this.emitFirstAvailableConnection();
219
- }
220
- return { connections: this.connections };
221
- }
222
- async getAccounts(params) {
223
- if (!this.sharedWcProvider) {
224
- return { accounts: [] };
225
- }
226
- const accounts = appkitControllers.WcHelpersUtil.getWalletConnectAccounts(
227
- this.sharedWcProvider,
228
- "sui"
229
- );
230
- return {
231
- accounts: accounts.map((a) => ({
232
- namespace: "sui",
233
- address: a.address,
234
- type: "eoa"
235
- }))
236
- };
237
- }
238
- async getBalance(params) {
239
- var _a, _b, _c;
240
- if (!params.address) {
241
- return { balance: "0", symbol: "SUI" };
242
- }
243
- try {
244
- const caipNetwork = (_a = this.getCaipNetworks()) == null ? void 0 : _a.find(
245
- (n) => n.id === params.chainId
246
- );
247
- const rpcUrl = `https://fullnode.${caipNetwork == null ? void 0 : caipNetwork.id}.sui.io:443`;
248
- if (!rpcUrl) {
249
- return { balance: "0", symbol: "SUI" };
250
- }
251
- const res = await fetch(rpcUrl, {
252
- method: "POST",
253
- headers: { "Content-Type": "application/json" },
254
- body: JSON.stringify({
255
- jsonrpc: "2.0",
256
- id: 1,
257
- method: "suix_getBalance",
258
- params: [params.address, "0x2::sui::SUI"]
259
- })
260
- });
261
- const data = await res.json();
262
- const totalBalance = ((_b = data == null ? void 0 : data.result) == null ? void 0 : _b.totalBalance) ?? "0";
263
- const formatted = (parseInt(totalBalance, 10) / 1e9).toString();
264
- return {
265
- balance: formatted,
266
- symbol: ((_c = caipNetwork == null ? void 0 : caipNetwork.nativeCurrency) == null ? void 0 : _c.symbol) || "SUI"
267
- };
268
- } catch {
269
- return { balance: "0", symbol: "SUI" };
270
- }
271
- }
272
- async switchNetwork(params) {
273
- await super.switchNetwork(params);
274
- }
275
- async syncConnection(params) {
276
- return this.connect({ ...params, type: "" });
277
- }
278
- async syncConnections({
279
- connectToFirstConnector,
280
- caipNetwork
281
- }) {
282
- if (!this.sharedWcProvider) {
283
- return;
284
- }
285
- const accounts = appkitControllers.WcHelpersUtil.getWalletConnectAccounts(
286
- this.sharedWcProvider,
287
- "sui"
288
- );
289
- if (accounts.length > 0) {
290
- this.addConnection({
291
- connectorId: WC_ID,
292
- accounts: accounts.map((a) => ({ address: a.address })),
293
- caipNetwork
294
- });
295
- }
296
- if (connectToFirstConnector) {
297
- this.emitFirstAvailableConnection();
298
- }
299
- }
300
- getWalletConnectProvider(params) {
301
- return params.provider;
302
- }
303
- async signMessage(params) {
304
- const wc = this.getWcProvider();
305
- const result = await wc.request(
306
- {
307
- method: "sui_signPersonalMessage",
308
- params: { message: params.message, address: params.address }
309
- },
310
- "sui:mainnet"
311
- );
312
- return { signature: result.signature };
313
- }
314
- async sendTransaction(params) {
315
- const wc = this.getWcProvider();
316
- const result = await wc.request(
317
- {
318
- method: "sui_signAndExecuteTransaction",
319
- params: { transaction: params.data, address: params.to }
320
- },
321
- "sui:mainnet"
322
- );
323
- return { hash: result.digest };
324
- }
325
- async estimateGas() {
326
- return { gas: 0n };
327
- }
328
- async writeContract() {
329
- return { hash: "" };
330
- }
331
- parseUnits() {
332
- return 0n;
333
- }
334
- formatUnits() {
335
- return "";
336
- }
337
- async getCapabilities() {
338
- return {};
339
- }
340
- async grantPermissions() {
341
- return {};
342
- }
343
- async revokePermissions() {
344
- return "0x";
345
- }
346
- async walletGetAssets() {
347
- return {};
348
- }
349
- }
350
- exports.SuiAdapter = SuiAdapter;
2
+ "use strict";var y=Object.defineProperty;var v=(d,o,t)=>o in d?y(d,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[o]=t;var l=(d,o,t)=>v(d,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("@reown/appkit-controllers"),g="walletConnect",m=["sui:mainnet","sui:testnet","sui:devnet"];class w extends h.AdapterBlueprint{constructor(t){super({namespace:"sui",adapterType:"sui"});l(this,"sharedWcProvider");l(this,"explicitCaipChainsFromInit");l(this,"expectedSuiAddress");l(this,"suiNetworksFromConfig",[]);this.explicitCaipChainsFromInit=(t==null?void 0:t.explicitCaipChains)??[],this.expectedSuiAddress=t==null?void 0:t.expectedSuiAddress}construct(t){super.construct(t),this.suiNetworksFromConfig=t.networks??[]}pickChainsFromExplicit(t,e){if(t.length===0)return m;if(e!=null){const n=e.toString(),i=t.find(s=>s===`sui:${n}`||s.endsWith(`:${n}`));if(i)return[i]}return t}resolveSuiChainsForConnect(t){const e=this.getCaipNetworks("sui"),n=e.length>0?e:this.suiNetworksFromConfig;if(n.length===0)return this.pickChainsFromExplicit(this.explicitCaipChainsFromInit,t);const i=s=>s.caipNetworkId||`sui:${s.id}`;if(t!=null){const s=n.find(r=>{var c;return((c=r.id)==null?void 0:c.toString())===t.toString()});if(s)return[i(s)]}return n.map(i)}getCaipNetworksForWalletConnectConnector(){return this.suiNetworksFromConfig.length>0?this.suiNetworksFromConfig:(this.explicitCaipChainsFromInit.length>0?this.explicitCaipChainsFromInit:m).map(e=>{const n=e.startsWith("sui:")?e.slice(4):e;return{id:n,chainNamespace:"sui",caipNetworkId:e,name:"Sui",nativeCurrency:{name:"SUI",symbol:"SUI",decimals:9},rpcUrls:{default:{http:[`https://fullnode.${n}.sui.io:443`]}}}})}syncConnectors(){}async setUniversalProvider(t){this.sharedWcProvider=t;const e=new h.WalletConnectConnector({provider:t,namespace:"sui",caipNetworks:this.getCaipNetworksForWalletConnectConnector()});this.addConnector(e),h.WcHelpersUtil.listenWcProvider({universalProvider:t,namespace:"sui",onConnect:n=>this.onConnect(n,g),onDisconnect:()=>this.onDisconnect(g),onAccountsChanged:n=>this.onAccountsChanged(n,g,!1)})}getWcProvider(){if(!this.sharedWcProvider)throw new Error("SuiAdapter: UniversalProvider not ready — setUniversalProvider must run before connect");return this.sharedWcProvider}async connectWalletConnect(t){var r,c;const e=this.getWcProvider();if((c=(r=e.session)==null?void 0:r.namespaces)!=null&&c.sui)return{clientId:await e.client.core.crypto.getClientId()};const n=this.resolveSuiChainsForConnect(t),i=n.length>0?n:m;return await e.connect({optionalNamespaces:{sui:{methods:["sui_signPersonalMessage","sui_signTransaction","sui_signAndExecuteTransaction"],chains:i,events:[]}}}),{clientId:await e.client.core.crypto.getClientId()}}async connect(t){var C,f,p;const e=this.connectors.find(u=>u.id===t.id);if(!e)throw new Error("Sui connector not found");const n=this.getConnection({address:t.address,connectorId:e.id,connections:this.connections,connectors:this.connectors});if(n!=null&&n.account){const u=((C=n.caipNetwork)==null?void 0:C.id)??t.chainId??"mainnet";return this.emit("accountChanged",{address:n.account.address,chainId:u,connector:e}),{id:e.id,address:n.account.address,chainId:u,provider:e.provider,type:e.type}}const i=this.getWcProvider(),r=(f=h.WcHelpersUtil.getWalletConnectAccounts(i,"sui")[0])==null?void 0:f.address;if(!r)throw new Error("No Sui account found after WalletConnect session");if(this.expectedSuiAddress&&r!==this.expectedSuiAddress)throw new Error(`Sui account mismatch: expected ${this.expectedSuiAddress}, got ${r}`);const c=(p=this.getCaipNetworks())==null?void 0:p.find(u=>u.id===t.chainId);this.addConnection({connectorId:e.id,accounts:[{address:r}],caipNetwork:c});const a=t.chainId??(c==null?void 0:c.id)??"mainnet";return this.emit("accountChanged",{address:r,chainId:a,connector:e}),{id:e.id,address:r,chainId:a,provider:e.provider,type:e.type}}async disconnect(t){if(t!=null&&t.id){if(this.sharedWcProvider)try{await this.sharedWcProvider.disconnect()}catch{}this.deleteConnection(t.id)}return this.connections.length===0?this.emit("disconnect"):this.emitFirstAvailableConnection(),{connections:this.connections}}async getAccounts(t){return this.sharedWcProvider?{accounts:h.WcHelpersUtil.getWalletConnectAccounts(this.sharedWcProvider,"sui").map(n=>({namespace:"sui",address:n.address,type:"eoa"}))}:{accounts:[]}}async getBalance(t){var e,n,i;if(!t.address)return{balance:"0",symbol:"SUI"};try{const s=(e=this.getCaipNetworks())==null?void 0:e.find(p=>p.id===t.chainId),r=`https://fullnode.${s==null?void 0:s.id}.sui.io:443`;if(!r)return{balance:"0",symbol:"SUI"};const a=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"suix_getBalance",params:[t.address,"0x2::sui::SUI"]})})).json(),C=((n=a==null?void 0:a.result)==null?void 0:n.totalBalance)??"0";return{balance:(parseInt(C,10)/1e9).toString(),symbol:((i=s==null?void 0:s.nativeCurrency)==null?void 0:i.symbol)||"SUI"}}catch{return{balance:"0",symbol:"SUI"}}}async switchNetwork(t){await super.switchNetwork(t)}async syncConnection(t){return this.connect({...t,type:""})}async syncConnections({connectToFirstConnector:t,caipNetwork:e}){if(!this.sharedWcProvider)return;const n=h.WcHelpersUtil.getWalletConnectAccounts(this.sharedWcProvider,"sui");n.length>0&&this.addConnection({connectorId:g,accounts:n.map(i=>({address:i.address})),caipNetwork:e}),t&&this.emitFirstAvailableConnection()}getWalletConnectProvider(t){return t.provider}getChainScope(t){if(t!=null&&t.startsWith("sui:"))return t;const e=this.explicitCaipChainsFromInit.find(n=>n.startsWith("sui:"));return e||"sui:mainnet"}async signMessage(t){const e=this.getWcProvider(),n=this.getChainScope();return{signature:(await e.request({method:"sui_signPersonalMessage",params:{message:t.message,address:t.address}},n)).signature}}async sendTransaction(t){var s;const e=this.getWcProvider(),n=this.getChainScope((s=t.caipNetwork)==null?void 0:s.caipNetworkId);return{hash:(await e.request({method:"sui_signAndExecuteTransaction",params:{transaction:t.data,address:t.to}},n)).digest}}async estimateGas(){return{gas:0n}}async writeContract(){return{hash:""}}parseUnits(){return 0n}formatUnits(){return""}async getCapabilities(){return{}}async grantPermissions(){return{}}async revokePermissions(){return"0x"}async walletGetAssets(){return{}}}exports.SuiAdapter=w;