@iota/dapp-kit 0.2.0 → 0.3.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 (460) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +14 -12
  3. package/dist/cjs/components/AccountDropdownMenu.css +26 -54
  4. package/dist/cjs/components/AccountDropdownMenu.css.css +18 -27
  5. package/dist/cjs/components/AccountDropdownMenu.css.css.map +3 -3
  6. package/dist/cjs/components/AccountDropdownMenu.css.d.ts +0 -1
  7. package/dist/cjs/components/AccountDropdownMenu.css.js +4 -6
  8. package/dist/cjs/components/AccountDropdownMenu.css.js.map +2 -2
  9. package/dist/cjs/components/AccountDropdownMenu.css.map +3 -3
  10. package/dist/cjs/components/AccountDropdownMenu.d.ts +3 -1
  11. package/dist/cjs/components/AccountDropdownMenu.js +25 -21
  12. package/dist/cjs/components/AccountDropdownMenu.js.map +3 -3
  13. package/dist/cjs/components/ConnectButton.css +181 -190
  14. package/dist/cjs/components/ConnectButton.css.map +3 -3
  15. package/dist/cjs/components/ConnectButton.d.ts +5 -3
  16. package/dist/cjs/components/ConnectButton.js +345 -664
  17. package/dist/cjs/components/ConnectButton.js.map +4 -4
  18. package/dist/cjs/components/IotaClientProvider.d.ts +0 -1
  19. package/dist/cjs/components/IotaClientProvider.js +1 -1
  20. package/dist/cjs/components/IotaClientProvider.js.map +2 -2
  21. package/dist/cjs/components/WalletProvider.d.ts +3 -3
  22. package/dist/cjs/components/WalletProvider.js +108 -153
  23. package/dist/cjs/components/WalletProvider.js.map +3 -3
  24. package/dist/cjs/components/connect-modal/ConnectModal.css +214 -172
  25. package/dist/cjs/components/connect-modal/ConnectModal.css.css +69 -32
  26. package/dist/cjs/components/connect-modal/ConnectModal.css.css.map +3 -3
  27. package/dist/cjs/components/connect-modal/ConnectModal.css.d.ts +5 -1
  28. package/dist/cjs/components/connect-modal/ConnectModal.css.js +15 -7
  29. package/dist/cjs/components/connect-modal/ConnectModal.css.js.map +2 -2
  30. package/dist/cjs/components/connect-modal/ConnectModal.css.map +3 -3
  31. package/dist/cjs/components/connect-modal/ConnectModal.js +412 -702
  32. package/dist/cjs/components/connect-modal/ConnectModal.js.map +4 -4
  33. package/dist/cjs/components/connect-modal/InfoSection.css +7 -11
  34. package/dist/cjs/components/connect-modal/InfoSection.css.css.map +1 -1
  35. package/dist/cjs/components/connect-modal/InfoSection.css.map +3 -3
  36. package/dist/cjs/components/connect-modal/InfoSection.js +1 -1
  37. package/dist/cjs/components/connect-modal/InfoSection.js.map +2 -2
  38. package/dist/cjs/components/connect-modal/views/ConnectionStatus.css +145 -0
  39. package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.css +32 -0
  40. package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.css.map +7 -0
  41. package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.d.ts +5 -0
  42. package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.js +35 -0
  43. package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.js.map +7 -0
  44. package/dist/cjs/components/connect-modal/views/ConnectionStatus.css.map +7 -0
  45. package/dist/cjs/components/connect-modal/views/ConnectionStatus.d.ts +8 -0
  46. package/dist/cjs/components/connect-modal/views/ConnectionStatus.js +173 -0
  47. package/dist/cjs/components/connect-modal/views/ConnectionStatus.js.map +7 -0
  48. package/dist/cjs/components/connect-modal/views/GetTheWallet.css.css.map +1 -1
  49. package/dist/cjs/components/connect-modal/views/GetTheWallet.css.map +1 -1
  50. package/dist/cjs/components/connect-modal/views/GetTheWallet.js +11 -384
  51. package/dist/cjs/components/connect-modal/views/GetTheWallet.js.map +2 -2
  52. package/dist/cjs/components/connect-modal/views/GettingStarted.css +144 -0
  53. package/dist/cjs/components/connect-modal/views/GettingStarted.css.css +23 -0
  54. package/dist/cjs/components/connect-modal/views/GettingStarted.css.css.map +7 -0
  55. package/dist/cjs/components/connect-modal/views/GettingStarted.css.d.ts +3 -0
  56. package/dist/cjs/components/connect-modal/views/GettingStarted.css.js +31 -0
  57. package/dist/cjs/components/connect-modal/views/GettingStarted.css.js.map +7 -0
  58. package/dist/cjs/components/connect-modal/views/GettingStarted.css.map +7 -0
  59. package/dist/cjs/components/connect-modal/views/GettingStarted.d.ts +1 -0
  60. package/dist/cjs/components/connect-modal/views/GettingStarted.js +172 -0
  61. package/dist/cjs/components/connect-modal/views/GettingStarted.js.map +7 -0
  62. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css +95 -0
  63. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.css +17 -0
  64. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.css.map +7 -0
  65. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.d.ts +2 -0
  66. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.js +29 -0
  67. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.js.map +7 -0
  68. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.css.map +7 -0
  69. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.d.ts +1 -0
  70. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.js +135 -0
  71. package/dist/cjs/components/connect-modal/views/WhatIsAWallet.js.map +7 -0
  72. package/dist/cjs/components/connect-modal/views/index.css +115 -124
  73. package/dist/cjs/components/connect-modal/views/index.css.map +3 -3
  74. package/dist/cjs/components/connect-modal/views/index.d.ts +2 -1
  75. package/dist/cjs/components/connect-modal/views/index.js +135 -633
  76. package/dist/cjs/components/connect-modal/views/index.js.map +4 -4
  77. package/dist/cjs/components/connect-modal/wallet-list/WalletList.css +10 -22
  78. package/dist/cjs/components/connect-modal/wallet-list/WalletList.css.css +2 -5
  79. package/dist/cjs/components/connect-modal/wallet-list/WalletList.css.css.map +3 -3
  80. package/dist/cjs/components/connect-modal/wallet-list/WalletList.css.js.map +1 -1
  81. package/dist/cjs/components/connect-modal/wallet-list/WalletList.css.map +3 -3
  82. package/dist/cjs/components/connect-modal/wallet-list/WalletList.d.ts +4 -4
  83. package/dist/cjs/components/connect-modal/wallet-list/WalletList.js +67 -38
  84. package/dist/cjs/components/connect-modal/wallet-list/WalletList.js.map +4 -4
  85. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css +8 -17
  86. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.css +8 -17
  87. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.css.map +3 -3
  88. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.d.ts +0 -1
  89. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.js +2 -4
  90. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.js.map +2 -2
  91. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.css.map +3 -3
  92. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.js +5 -32
  93. package/dist/cjs/components/connect-modal/wallet-list/WalletListItem.js.map +4 -4
  94. package/dist/cjs/components/icons/BackIcon.d.ts +2 -0
  95. package/dist/cjs/components/icons/BackIcon.js +36 -0
  96. package/dist/cjs/components/icons/BackIcon.js.map +7 -0
  97. package/dist/cjs/components/icons/IotaIcon.js +11 -384
  98. package/dist/cjs/components/icons/IotaIcon.js.map +2 -2
  99. package/dist/cjs/components/styling/InjectedThemeStyles.js +2 -0
  100. package/dist/cjs/components/styling/InjectedThemeStyles.js.map +2 -2
  101. package/dist/cjs/components/styling/StyleMarker.css +1 -16
  102. package/dist/cjs/components/styling/StyleMarker.css.css +1 -16
  103. package/dist/cjs/components/styling/StyleMarker.css.css.map +3 -3
  104. package/dist/cjs/components/styling/StyleMarker.css.map +3 -3
  105. package/dist/cjs/components/styling/StyleMarker.d.ts +0 -1
  106. package/dist/cjs/components/styling/StyleMarker.js +4 -4
  107. package/dist/cjs/components/styling/StyleMarker.js.map +3 -3
  108. package/dist/cjs/components/ui/Button.css.css.map +1 -1
  109. package/dist/cjs/components/ui/Button.css.map +1 -1
  110. package/dist/cjs/components/ui/Button.d.ts +1 -1
  111. package/dist/cjs/components/ui/Heading.css.css.map +1 -1
  112. package/dist/cjs/components/ui/Heading.css.map +1 -1
  113. package/dist/cjs/components/ui/Heading.d.ts +0 -1
  114. package/dist/cjs/components/ui/IconButton.css.css.map +1 -1
  115. package/dist/cjs/components/ui/IconButton.css.map +1 -1
  116. package/dist/cjs/components/ui/IconButton.d.ts +1 -1
  117. package/dist/cjs/components/ui/Text.css +7 -11
  118. package/dist/cjs/components/ui/Text.css.css +7 -11
  119. package/dist/cjs/components/ui/Text.css.css.map +3 -3
  120. package/dist/cjs/components/ui/Text.css.d.ts +0 -3
  121. package/dist/cjs/components/ui/Text.css.js +1 -1
  122. package/dist/cjs/components/ui/Text.css.js.map +2 -2
  123. package/dist/cjs/components/ui/Text.css.map +3 -3
  124. package/dist/cjs/components/ui/Text.d.ts +0 -1
  125. package/dist/cjs/components/ui/Text.js +1 -1
  126. package/dist/cjs/components/ui/Text.js.map +2 -2
  127. package/dist/cjs/constants/styleDataAttribute.js.map +1 -1
  128. package/dist/cjs/constants/walletDefaults.d.ts +2 -2
  129. package/dist/cjs/constants/walletDefaults.js +4 -5
  130. package/dist/cjs/constants/walletDefaults.js.map +2 -2
  131. package/dist/cjs/constants/walletMutationKeys.d.ts +3 -2
  132. package/dist/cjs/constants/walletMutationKeys.js +4 -3
  133. package/dist/cjs/constants/walletMutationKeys.js.map +2 -2
  134. package/dist/cjs/contexts/walletContext.d.ts +1 -2
  135. package/dist/cjs/hooks/networkConfig.js +1 -1
  136. package/dist/cjs/hooks/networkConfig.js.map +2 -2
  137. package/dist/cjs/hooks/useIotaClient.js +1 -1
  138. package/dist/cjs/hooks/useIotaClient.js.map +2 -2
  139. package/dist/cjs/hooks/useIotaClientInfiniteQuery.js +1 -1
  140. package/dist/cjs/hooks/useIotaClientInfiniteQuery.js.map +2 -2
  141. package/dist/cjs/hooks/useIotaClientMutation.js +1 -1
  142. package/dist/cjs/hooks/useIotaClientMutation.js.map +2 -2
  143. package/dist/cjs/hooks/useIotaClientQueries.js +1 -1
  144. package/dist/cjs/hooks/useIotaClientQueries.js.map +2 -2
  145. package/dist/cjs/hooks/useIotaClientQuery.js +4 -2
  146. package/dist/cjs/hooks/useIotaClientQuery.js.map +2 -2
  147. package/dist/cjs/hooks/wallet/useAutoConnectWallet.js +17 -7
  148. package/dist/cjs/hooks/wallet/useAutoConnectWallet.js.map +2 -2
  149. package/dist/cjs/hooks/wallet/useConnectWallet.js +10 -4
  150. package/dist/cjs/hooks/wallet/useConnectWallet.js.map +2 -2
  151. package/dist/cjs/hooks/wallet/useCurrentWallet.d.ts +3 -0
  152. package/dist/cjs/hooks/wallet/useCurrentWallet.js +7 -3
  153. package/dist/cjs/hooks/wallet/useCurrentWallet.js.map +2 -2
  154. package/dist/cjs/hooks/wallet/useDisconnectWallet.js +11 -6
  155. package/dist/cjs/hooks/wallet/useDisconnectWallet.js.map +2 -2
  156. package/dist/cjs/hooks/wallet/useReportTransactionEffects.d.ts +15 -0
  157. package/dist/cjs/hooks/wallet/{useSignTransactionBlock.js → useReportTransactionEffects.js} +41 -37
  158. package/dist/cjs/hooks/wallet/useReportTransactionEffects.js.map +7 -0
  159. package/dist/cjs/hooks/wallet/useSignAndExecuteTransaction.d.ts +29 -0
  160. package/dist/cjs/hooks/wallet/useSignAndExecuteTransaction.js +252 -0
  161. package/dist/cjs/hooks/wallet/useSignAndExecuteTransaction.js.map +7 -0
  162. package/dist/cjs/hooks/wallet/useSignPersonalMessage.js +21 -27
  163. package/dist/cjs/hooks/wallet/useSignPersonalMessage.js.map +2 -2
  164. package/dist/cjs/hooks/wallet/useSignTransaction.d.ts +18 -0
  165. package/dist/cjs/hooks/wallet/{useSignAndExecuteTransactionBlock.js → useSignTransaction.js} +87 -47
  166. package/dist/cjs/hooks/wallet/useSignTransaction.js.map +7 -0
  167. package/dist/cjs/hooks/wallet/useSwitchAccount.js +11 -6
  168. package/dist/cjs/hooks/wallet/useSwitchAccount.js.map +2 -2
  169. package/dist/cjs/hooks/wallet/useUnsafeBurnerWallet.js +46 -34
  170. package/dist/cjs/hooks/wallet/useUnsafeBurnerWallet.js.map +2 -2
  171. package/dist/cjs/hooks/wallet/useWalletPropertiesChanged.js +7 -3
  172. package/dist/cjs/hooks/wallet/useWalletPropertiesChanged.js.map +2 -2
  173. package/dist/cjs/hooks/wallet/useWalletsChanged.d.ts +1 -1
  174. package/dist/cjs/hooks/wallet/useWalletsChanged.js +7 -6
  175. package/dist/cjs/hooks/wallet/useWalletsChanged.js.map +2 -2
  176. package/dist/cjs/index.css +232 -241
  177. package/dist/cjs/index.css.map +3 -3
  178. package/dist/cjs/index.d.ts +4 -3
  179. package/dist/cjs/index.js +818 -1038
  180. package/dist/cjs/index.js.map +4 -4
  181. package/dist/cjs/themes/lightTheme.js +19 -19
  182. package/dist/cjs/themes/lightTheme.js.map +1 -1
  183. package/dist/cjs/themes/themeContract.js.map +1 -1
  184. package/dist/cjs/types.d.ts +1 -1
  185. package/dist/cjs/types.js.map +1 -1
  186. package/dist/cjs/utils/assertUnreachable.js.map +1 -1
  187. package/dist/cjs/utils/walletUtils.d.ts +2 -2
  188. package/dist/cjs/utils/walletUtils.js +2 -2
  189. package/dist/cjs/utils/walletUtils.js.map +2 -2
  190. package/dist/cjs/walletStore.d.ts +3 -2
  191. package/dist/cjs/walletStore.js +8 -4
  192. package/dist/cjs/walletStore.js.map +2 -2
  193. package/dist/esm/components/AccountDropdownMenu.css +26 -54
  194. package/dist/esm/components/AccountDropdownMenu.css.css +18 -27
  195. package/dist/esm/components/AccountDropdownMenu.css.css.map +3 -3
  196. package/dist/esm/components/AccountDropdownMenu.css.d.ts +0 -1
  197. package/dist/esm/components/AccountDropdownMenu.css.js +4 -6
  198. package/dist/esm/components/AccountDropdownMenu.css.js.map +2 -2
  199. package/dist/esm/components/AccountDropdownMenu.css.map +3 -3
  200. package/dist/esm/components/AccountDropdownMenu.d.ts +3 -1
  201. package/dist/esm/components/AccountDropdownMenu.js +25 -21
  202. package/dist/esm/components/AccountDropdownMenu.js.map +3 -3
  203. package/dist/esm/components/ConnectButton.css +181 -190
  204. package/dist/esm/components/ConnectButton.css.map +3 -3
  205. package/dist/esm/components/ConnectButton.d.ts +5 -3
  206. package/dist/esm/components/ConnectButton.js +346 -665
  207. package/dist/esm/components/ConnectButton.js.map +4 -4
  208. package/dist/esm/components/IotaClientProvider.d.ts +0 -1
  209. package/dist/esm/components/IotaClientProvider.js +1 -1
  210. package/dist/esm/components/IotaClientProvider.js.map +2 -2
  211. package/dist/esm/components/WalletProvider.d.ts +3 -3
  212. package/dist/esm/components/WalletProvider.js +107 -152
  213. package/dist/esm/components/WalletProvider.js.map +3 -3
  214. package/dist/esm/components/connect-modal/ConnectModal.css +214 -172
  215. package/dist/esm/components/connect-modal/ConnectModal.css.css +69 -32
  216. package/dist/esm/components/connect-modal/ConnectModal.css.css.map +3 -3
  217. package/dist/esm/components/connect-modal/ConnectModal.css.d.ts +5 -1
  218. package/dist/esm/components/connect-modal/ConnectModal.css.js +15 -7
  219. package/dist/esm/components/connect-modal/ConnectModal.css.js.map +2 -2
  220. package/dist/esm/components/connect-modal/ConnectModal.css.map +3 -3
  221. package/dist/esm/components/connect-modal/ConnectModal.js +408 -698
  222. package/dist/esm/components/connect-modal/ConnectModal.js.map +4 -4
  223. package/dist/esm/components/connect-modal/InfoSection.css +7 -11
  224. package/dist/esm/components/connect-modal/InfoSection.css.css.map +1 -1
  225. package/dist/esm/components/connect-modal/InfoSection.css.map +3 -3
  226. package/dist/esm/components/connect-modal/InfoSection.js +1 -1
  227. package/dist/esm/components/connect-modal/InfoSection.js.map +2 -2
  228. package/dist/esm/components/connect-modal/views/ConnectionStatus.css +145 -0
  229. package/dist/esm/components/connect-modal/views/ConnectionStatus.css.css +32 -0
  230. package/dist/esm/components/connect-modal/views/ConnectionStatus.css.css.map +7 -0
  231. package/dist/esm/components/connect-modal/views/ConnectionStatus.css.d.ts +5 -0
  232. package/dist/esm/components/connect-modal/views/ConnectionStatus.css.js +14 -0
  233. package/dist/esm/components/connect-modal/views/ConnectionStatus.css.js.map +7 -0
  234. package/dist/esm/components/connect-modal/views/ConnectionStatus.css.map +7 -0
  235. package/dist/esm/components/connect-modal/views/ConnectionStatus.d.ts +8 -0
  236. package/dist/esm/components/connect-modal/views/ConnectionStatus.js +140 -0
  237. package/dist/esm/components/connect-modal/views/ConnectionStatus.js.map +7 -0
  238. package/dist/esm/components/connect-modal/views/GetTheWallet.css.css.map +1 -1
  239. package/dist/esm/components/connect-modal/views/GetTheWallet.css.map +1 -1
  240. package/dist/esm/components/connect-modal/views/GetTheWallet.js +16 -389
  241. package/dist/esm/components/connect-modal/views/GetTheWallet.js.map +3 -3
  242. package/dist/esm/components/connect-modal/views/GettingStarted.css +144 -0
  243. package/dist/esm/components/connect-modal/views/GettingStarted.css.css +23 -0
  244. package/dist/esm/components/connect-modal/views/GettingStarted.css.css.map +7 -0
  245. package/dist/esm/components/connect-modal/views/GettingStarted.css.d.ts +3 -0
  246. package/dist/esm/components/connect-modal/views/GettingStarted.css.js +10 -0
  247. package/dist/esm/components/connect-modal/views/GettingStarted.css.js.map +7 -0
  248. package/dist/esm/components/connect-modal/views/GettingStarted.css.map +7 -0
  249. package/dist/esm/components/connect-modal/views/GettingStarted.d.ts +1 -0
  250. package/dist/esm/components/connect-modal/views/GettingStarted.js +139 -0
  251. package/dist/esm/components/connect-modal/views/GettingStarted.js.map +7 -0
  252. package/dist/esm/components/connect-modal/views/WhatIsAWallet.css +95 -0
  253. package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.css +17 -0
  254. package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.css.map +7 -0
  255. package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.d.ts +2 -0
  256. package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.js +8 -0
  257. package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.js.map +7 -0
  258. package/dist/esm/components/connect-modal/views/WhatIsAWallet.css.map +7 -0
  259. package/dist/esm/components/connect-modal/views/WhatIsAWallet.d.ts +1 -0
  260. package/dist/esm/components/connect-modal/views/WhatIsAWallet.js +102 -0
  261. package/dist/esm/components/connect-modal/views/WhatIsAWallet.js.map +7 -0
  262. package/dist/esm/components/connect-modal/views/index.css +115 -124
  263. package/dist/esm/components/connect-modal/views/index.css.map +3 -3
  264. package/dist/esm/components/connect-modal/views/index.d.ts +2 -1
  265. package/dist/esm/components/connect-modal/views/index.js +137 -635
  266. package/dist/esm/components/connect-modal/views/index.js.map +4 -4
  267. package/dist/esm/components/connect-modal/wallet-list/WalletList.css +10 -22
  268. package/dist/esm/components/connect-modal/wallet-list/WalletList.css.css +2 -5
  269. package/dist/esm/components/connect-modal/wallet-list/WalletList.css.css.map +3 -3
  270. package/dist/esm/components/connect-modal/wallet-list/WalletList.css.js.map +1 -1
  271. package/dist/esm/components/connect-modal/wallet-list/WalletList.css.map +3 -3
  272. package/dist/esm/components/connect-modal/wallet-list/WalletList.d.ts +4 -4
  273. package/dist/esm/components/connect-modal/wallet-list/WalletList.js +65 -36
  274. package/dist/esm/components/connect-modal/wallet-list/WalletList.js.map +4 -4
  275. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css +8 -17
  276. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.css +8 -17
  277. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.css.map +3 -3
  278. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.d.ts +0 -1
  279. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.js +2 -4
  280. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.js.map +2 -2
  281. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.css.map +3 -3
  282. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.js +5 -32
  283. package/dist/esm/components/connect-modal/wallet-list/WalletListItem.js.map +4 -4
  284. package/dist/esm/components/icons/BackIcon.d.ts +2 -0
  285. package/dist/esm/components/icons/BackIcon.js +15 -0
  286. package/dist/esm/components/icons/BackIcon.js.map +7 -0
  287. package/dist/esm/components/icons/IotaIcon.js +12 -385
  288. package/dist/esm/components/icons/IotaIcon.js.map +2 -2
  289. package/dist/esm/components/styling/InjectedThemeStyles.js +2 -0
  290. package/dist/esm/components/styling/InjectedThemeStyles.js.map +2 -2
  291. package/dist/esm/components/styling/StyleMarker.css +1 -16
  292. package/dist/esm/components/styling/StyleMarker.css.css +1 -16
  293. package/dist/esm/components/styling/StyleMarker.css.css.map +3 -3
  294. package/dist/esm/components/styling/StyleMarker.css.js +4 -4
  295. package/dist/esm/components/styling/StyleMarker.css.js.map +3 -3
  296. package/dist/esm/components/styling/StyleMarker.css.map +3 -3
  297. package/dist/esm/components/styling/StyleMarker.d.ts +0 -1
  298. package/dist/esm/components/styling/StyleMarker.js +4 -4
  299. package/dist/esm/components/styling/StyleMarker.js.map +3 -3
  300. package/dist/esm/components/ui/Button.css.css.map +1 -1
  301. package/dist/esm/components/ui/Button.css.map +1 -1
  302. package/dist/esm/components/ui/Button.d.ts +1 -1
  303. package/dist/esm/components/ui/Heading.css.css.map +1 -1
  304. package/dist/esm/components/ui/Heading.css.map +1 -1
  305. package/dist/esm/components/ui/Heading.d.ts +0 -1
  306. package/dist/esm/components/ui/IconButton.css.css.map +1 -1
  307. package/dist/esm/components/ui/IconButton.css.map +1 -1
  308. package/dist/esm/components/ui/IconButton.d.ts +1 -1
  309. package/dist/esm/components/ui/Text.css +7 -11
  310. package/dist/esm/components/ui/Text.css.css +7 -11
  311. package/dist/esm/components/ui/Text.css.css.map +3 -3
  312. package/dist/esm/components/ui/Text.css.d.ts +0 -3
  313. package/dist/esm/components/ui/Text.css.js +1 -1
  314. package/dist/esm/components/ui/Text.css.js.map +2 -2
  315. package/dist/esm/components/ui/Text.css.map +3 -3
  316. package/dist/esm/components/ui/Text.d.ts +0 -1
  317. package/dist/esm/components/ui/Text.js +1 -1
  318. package/dist/esm/components/ui/Text.js.map +2 -2
  319. package/dist/esm/constants/styleDataAttribute.js.map +1 -1
  320. package/dist/esm/constants/walletDefaults.d.ts +2 -2
  321. package/dist/esm/constants/walletDefaults.js +4 -5
  322. package/dist/esm/constants/walletDefaults.js.map +2 -2
  323. package/dist/esm/constants/walletMutationKeys.d.ts +3 -2
  324. package/dist/esm/constants/walletMutationKeys.js +4 -3
  325. package/dist/esm/constants/walletMutationKeys.js.map +2 -2
  326. package/dist/esm/contexts/walletContext.d.ts +1 -2
  327. package/dist/esm/hooks/networkConfig.js +1 -1
  328. package/dist/esm/hooks/networkConfig.js.map +2 -2
  329. package/dist/esm/hooks/useIotaClient.js +1 -1
  330. package/dist/esm/hooks/useIotaClient.js.map +2 -2
  331. package/dist/esm/hooks/useIotaClientInfiniteQuery.js +1 -1
  332. package/dist/esm/hooks/useIotaClientInfiniteQuery.js.map +2 -2
  333. package/dist/esm/hooks/useIotaClientMutation.js +1 -1
  334. package/dist/esm/hooks/useIotaClientMutation.js.map +2 -2
  335. package/dist/esm/hooks/useIotaClientQueries.js +1 -1
  336. package/dist/esm/hooks/useIotaClientQueries.js.map +2 -2
  337. package/dist/esm/hooks/useIotaClientQuery.js +4 -2
  338. package/dist/esm/hooks/useIotaClientQuery.js.map +2 -2
  339. package/dist/esm/hooks/wallet/useAutoConnectWallet.js +17 -7
  340. package/dist/esm/hooks/wallet/useAutoConnectWallet.js.map +2 -2
  341. package/dist/esm/hooks/wallet/useConnectWallet.js +10 -4
  342. package/dist/esm/hooks/wallet/useConnectWallet.js.map +2 -2
  343. package/dist/esm/hooks/wallet/useCurrentWallet.d.ts +3 -0
  344. package/dist/esm/hooks/wallet/useCurrentWallet.js +7 -3
  345. package/dist/esm/hooks/wallet/useCurrentWallet.js.map +2 -2
  346. package/dist/esm/hooks/wallet/useDisconnectWallet.js +11 -6
  347. package/dist/esm/hooks/wallet/useDisconnectWallet.js.map +2 -2
  348. package/dist/esm/hooks/wallet/useReportTransactionEffects.d.ts +15 -0
  349. package/dist/esm/hooks/wallet/{useSignTransactionBlock.js → useReportTransactionEffects.js} +38 -34
  350. package/dist/esm/hooks/wallet/useReportTransactionEffects.js.map +7 -0
  351. package/dist/esm/hooks/wallet/useSignAndExecuteTransaction.d.ts +29 -0
  352. package/dist/esm/hooks/wallet/useSignAndExecuteTransaction.js +231 -0
  353. package/dist/esm/hooks/wallet/useSignAndExecuteTransaction.js.map +7 -0
  354. package/dist/esm/hooks/wallet/useSignPersonalMessage.js +21 -27
  355. package/dist/esm/hooks/wallet/useSignPersonalMessage.js.map +2 -2
  356. package/dist/esm/hooks/wallet/useSignTransaction.d.ts +18 -0
  357. package/dist/esm/hooks/wallet/{useSignAndExecuteTransactionBlock.js → useSignTransaction.js} +84 -44
  358. package/dist/esm/hooks/wallet/useSignTransaction.js.map +7 -0
  359. package/dist/esm/hooks/wallet/useSwitchAccount.js +11 -6
  360. package/dist/esm/hooks/wallet/useSwitchAccount.js.map +2 -2
  361. package/dist/esm/hooks/wallet/useUnsafeBurnerWallet.js +45 -33
  362. package/dist/esm/hooks/wallet/useUnsafeBurnerWallet.js.map +2 -2
  363. package/dist/esm/hooks/wallet/useWalletPropertiesChanged.js +7 -3
  364. package/dist/esm/hooks/wallet/useWalletPropertiesChanged.js.map +2 -2
  365. package/dist/esm/hooks/wallet/useWalletsChanged.d.ts +1 -1
  366. package/dist/esm/hooks/wallet/useWalletsChanged.js +7 -6
  367. package/dist/esm/hooks/wallet/useWalletsChanged.js.map +2 -2
  368. package/dist/esm/index.css +232 -241
  369. package/dist/esm/index.css.map +3 -3
  370. package/dist/esm/index.d.ts +4 -3
  371. package/dist/esm/index.js +821 -1041
  372. package/dist/esm/index.js.map +4 -4
  373. package/dist/esm/themes/lightTheme.js +19 -19
  374. package/dist/esm/themes/lightTheme.js.map +1 -1
  375. package/dist/esm/themes/themeContract.js.map +1 -1
  376. package/dist/esm/types.d.ts +1 -1
  377. package/dist/esm/utils/assertUnreachable.js.map +1 -1
  378. package/dist/esm/utils/walletUtils.d.ts +2 -2
  379. package/dist/esm/utils/walletUtils.js +2 -2
  380. package/dist/esm/utils/walletUtils.js.map +2 -2
  381. package/dist/esm/walletStore.d.ts +3 -2
  382. package/dist/esm/walletStore.js +8 -4
  383. package/dist/esm/walletStore.js.map +2 -2
  384. package/dist/index.css/package.json +5 -0
  385. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  386. package/dist/tsconfig.tsbuildinfo +1 -1
  387. package/package.json +28 -28
  388. package/src/components/AccountDropdownMenu.css.ts +11 -17
  389. package/src/components/AccountDropdownMenu.tsx +10 -5
  390. package/src/components/ConnectButton.tsx +12 -5
  391. package/src/components/IotaClientProvider.tsx +1 -1
  392. package/src/components/WalletProvider.tsx +11 -22
  393. package/src/components/connect-modal/ConnectModal.css.ts +58 -17
  394. package/src/components/connect-modal/ConnectModal.tsx +101 -16
  395. package/src/components/connect-modal/views/ConnectionStatus.css.ts +36 -0
  396. package/src/components/connect-modal/views/ConnectionStatus.tsx +55 -0
  397. package/src/components/connect-modal/views/GettingStarted.css.ts +26 -0
  398. package/src/components/connect-modal/views/GettingStarted.tsx +40 -0
  399. package/src/components/connect-modal/views/WhatIsAWallet.css.ts +20 -0
  400. package/src/components/connect-modal/views/WhatIsAWallet.tsx +24 -0
  401. package/src/components/connect-modal/views/index.ts +2 -1
  402. package/src/components/connect-modal/wallet-list/WalletList.css.ts +1 -5
  403. package/src/components/connect-modal/wallet-list/WalletList.tsx +25 -11
  404. package/src/components/connect-modal/wallet-list/WalletListItem.css.ts +6 -14
  405. package/src/components/connect-modal/wallet-list/WalletListItem.tsx +9 -12
  406. package/src/components/icons/BackIcon.tsx +18 -0
  407. package/src/components/icons/IotaIcon.tsx +5 -217
  408. package/src/components/styling/InjectedThemeStyles.tsx +4 -0
  409. package/src/components/styling/StyleMarker.css.ts +0 -15
  410. package/src/components/ui/Text.css.ts +1 -1
  411. package/src/constants/walletDefaults.ts +6 -5
  412. package/src/constants/walletMutationKeys.ts +3 -2
  413. package/src/hooks/useIotaClientInfiniteQuery.ts +2 -1
  414. package/src/hooks/useIotaClientQuery.ts +3 -1
  415. package/src/hooks/wallet/useAutoConnectWallet.ts +1 -1
  416. package/src/hooks/wallet/useConnectWallet.ts +6 -1
  417. package/src/hooks/wallet/useCurrentWallet.ts +4 -0
  418. package/src/hooks/wallet/useReportTransactionEffects.ts +87 -0
  419. package/src/hooks/wallet/useSignAndExecuteTransaction.ts +165 -0
  420. package/src/hooks/wallet/useSignPersonalMessage.ts +11 -25
  421. package/src/hooks/wallet/useSignTransaction.ts +117 -0
  422. package/src/hooks/wallet/useUnsafeBurnerWallet.ts +41 -18
  423. package/src/hooks/wallet/useWalletsChanged.ts +5 -4
  424. package/src/index.ts +4 -3
  425. package/src/themes/lightTheme.ts +19 -19
  426. package/src/types.ts +1 -1
  427. package/src/utils/walletUtils.ts +8 -3
  428. package/src/walletStore.ts +12 -1
  429. package/dist/cjs/components/connect-modal/views/WalletConnect.css +0 -179
  430. package/dist/cjs/components/connect-modal/views/WalletConnect.css.css +0 -51
  431. package/dist/cjs/components/connect-modal/views/WalletConnect.css.css.map +0 -7
  432. package/dist/cjs/components/connect-modal/views/WalletConnect.css.d.ts +0 -8
  433. package/dist/cjs/components/connect-modal/views/WalletConnect.css.js +0 -41
  434. package/dist/cjs/components/connect-modal/views/WalletConnect.css.js.map +0 -7
  435. package/dist/cjs/components/connect-modal/views/WalletConnect.css.map +0 -7
  436. package/dist/cjs/components/connect-modal/views/WalletConnect.d.ts +0 -7
  437. package/dist/cjs/components/connect-modal/views/WalletConnect.js +0 -325
  438. package/dist/cjs/components/connect-modal/views/WalletConnect.js.map +0 -7
  439. package/dist/cjs/hooks/wallet/useSignAndExecuteTransactionBlock.d.ts +0 -15
  440. package/dist/cjs/hooks/wallet/useSignAndExecuteTransactionBlock.js.map +0 -7
  441. package/dist/cjs/hooks/wallet/useSignTransactionBlock.d.ts +0 -13
  442. package/dist/cjs/hooks/wallet/useSignTransactionBlock.js.map +0 -7
  443. package/dist/esm/components/connect-modal/views/WalletConnect.css +0 -179
  444. package/dist/esm/components/connect-modal/views/WalletConnect.css.css +0 -51
  445. package/dist/esm/components/connect-modal/views/WalletConnect.css.css.map +0 -7
  446. package/dist/esm/components/connect-modal/views/WalletConnect.css.d.ts +0 -8
  447. package/dist/esm/components/connect-modal/views/WalletConnect.css.js +0 -20
  448. package/dist/esm/components/connect-modal/views/WalletConnect.css.js.map +0 -7
  449. package/dist/esm/components/connect-modal/views/WalletConnect.css.map +0 -7
  450. package/dist/esm/components/connect-modal/views/WalletConnect.d.ts +0 -7
  451. package/dist/esm/components/connect-modal/views/WalletConnect.js +0 -294
  452. package/dist/esm/components/connect-modal/views/WalletConnect.js.map +0 -7
  453. package/dist/esm/hooks/wallet/useSignAndExecuteTransactionBlock.d.ts +0 -15
  454. package/dist/esm/hooks/wallet/useSignAndExecuteTransactionBlock.js.map +0 -7
  455. package/dist/esm/hooks/wallet/useSignTransactionBlock.d.ts +0 -13
  456. package/dist/esm/hooks/wallet/useSignTransactionBlock.js.map +0 -7
  457. package/src/components/connect-modal/views/WalletConnect.css.ts +0 -55
  458. package/src/components/connect-modal/views/WalletConnect.tsx +0 -79
  459. package/src/hooks/wallet/useSignAndExecuteTransactionBlock.ts +0 -117
  460. package/src/hooks/wallet/useSignTransactionBlock.ts +0 -85
package/dist/esm/index.js CHANGED
@@ -4,6 +4,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __typeError = (msg) => {
8
+ throw TypeError(msg);
9
+ };
7
10
  var __esm = (fn, res) => function __init() {
8
11
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
12
  };
@@ -26,23 +29,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
29
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
30
  mod
28
31
  ));
29
- var __accessCheck = (obj, member, msg) => {
30
- if (!member.has(obj))
31
- throw TypeError("Cannot " + msg);
32
- };
33
- var __privateGet = (obj, member, getter) => {
34
- __accessCheck(obj, member, "read from private field");
35
- return getter ? getter.call(obj) : member.get(obj);
36
- };
37
- var __privateAdd = (obj, member, value) => {
38
- if (member.has(obj))
39
- throw TypeError("Cannot add the same private member more than once");
40
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
41
- };
32
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
33
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
34
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
42
35
 
43
- // vanilla-extract-css-ns:src/components/styling/StyleMarker.css.ts.vanilla.css?source=#H4sIAAAAAAAAA51US4/TMBC+91fMcYtiqYXCIT0iIe6LxHkSe2Orrm2NJyRZxH9HtrttmrAL4hLJ4+8xL6cetCL18G4LPzcAjR9FNM/GdTU0nqQi0fjxuAFovfVUww+kByEkhiBOhkWORtF4OW0T6sk7Fk94NnZaYXkKviMMehIJ9iWjbqxontWKk26+K9NpjsJ5OqOdEXiya8bC5TGBbpwha/2rjTVOCf1nyswnwb5mVGEpZkUiBmxzH98gZuRjAW6Pm1+bukyj6Zm9KyPBEBQSulbV4LxTyaLB9tSR750Ul7kwoYsBSTledNQ4rcjwajqz+F2d8/iiktnVxXYWKetSwy4dAkqZKfl0RuqMy4driViqYzWykKr1hGy8u5W4NvA9p0RfIFclbyvobZGzJl4X40Vp5n6f2FVB7yvQ7yvQHyrQhwr0xwr0p6L4RieHdcfuK63FoJo089iSt7ZBypKDkaxr2B/C+ApMMGF7urzI/AoJpenjaplS2IjRInVly/+yGa+46f7c3N6/RumHVFZUDDvYwX4XxvJZ2N/cPpcfQdH8lvS2x//I/rJDhzBC9NbIRfa/AfAolD6tBAAA
44
- var init_ = __esm({
45
- "vanilla-extract-css-ns:src/components/styling/StyleMarker.css.ts.vanilla.css?source=#H4sIAAAAAAAAA51US4/TMBC+91fMcYtiqYXCIT0iIe6LxHkSe2Orrm2NJyRZxH9HtrttmrAL4hLJ4+8xL6cetCL18G4LPzcAjR9FNM/GdTU0nqQi0fjxuAFovfVUww+kByEkhiBOhkWORtF4OW0T6sk7Fk94NnZaYXkKviMMehIJ9iWjbqxontWKk26+K9NpjsJ5OqOdEXiya8bC5TGBbpwha/2rjTVOCf1nyswnwb5mVGEpZkUiBmxzH98gZuRjAW6Pm1+bukyj6Zm9KyPBEBQSulbV4LxTyaLB9tSR750Ul7kwoYsBSTledNQ4rcjwajqz+F2d8/iiktnVxXYWKetSwy4dAkqZKfl0RuqMy4driViqYzWykKr1hGy8u5W4NvA9p0RfIFclbyvobZGzJl4X40Vp5n6f2FVB7yvQ7yvQHyrQhwr0xwr0p6L4RieHdcfuK63FoJo089iSt7ZBypKDkaxr2B/C+ApMMGF7urzI/AoJpenjaplS2IjRInVly/+yGa+46f7c3N6/RumHVFZUDDvYwX4XxvJZ2N/cPpcfQdH8lvS2x//I/rJDhzBC9NbIRfa/AfAolD6tBAAA"() {
36
+ // vanilla-extract-css-ns:src/components/styling/StyleMarker.css.ts.vanilla.css?source=OndoZXJlKCopIHsKICBib3gtc2l6aW5nOiBib3JkZXItYm94OwogIGNvbG9yOiB2YXIoLS1kYXBwLWtpdC1jb2xvcnMtYm9keSk7CiAgZm9udC1mYW1pbHk6IHZhcigtLWRhcHAta2l0LXR5cG9ncmFwaHktZm9udEZhbWlseSk7CiAgZm9udC1zaXplOiB2YXIoLS1kYXBwLWtpdC1mb250V2VpZ2h0cy1ub3JtYWwpOwogIGZvbnQtc3R5bGU6IHZhcigtLWRhcHAta2l0LXR5cG9ncmFwaHktZm9udFN0eWxlKTsKICBmb250LXdlaWdodDogdmFyKC0tZGFwcC1raXQtZm9udFdlaWdodHMtbm9ybWFsKTsKICBsaW5lLWhlaWdodDogdmFyKC0tZGFwcC1raXQtdHlwb2dyYXBoeS1saW5lSGVpZ2h0KTsKICBsZXR0ZXItc3BhY2luZzogdmFyKC0tZGFwcC1raXQtdHlwb2dyYXBoeS1sZXR0ZXJTcGFjaW5nKTsKfQo6d2hlcmUoYnV0dG9uKSB7CiAgYXBwZWFyYW5jZTogbm9uZTsKICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDsKICBmb250LXNpemU6IGluaGVyaXQ7CiAgZm9udC1mYW1pbHk6IGluaGVyaXQ7CiAgbGluZS1oZWlnaHQ6IGluaGVyaXQ7CiAgbGV0dGVyLXNwYWNpbmc6IGluaGVyaXQ7CiAgY29sb3I6IGluaGVyaXQ7CiAgYm9yZGVyOiAwOwogIHBhZGRpbmc6IDA7CiAgbWFyZ2luOiAwOwp9Cjp3aGVyZShhKSB7CiAgdGV4dC1kZWNvcmF0aW9uOiBub25lOwogIGNvbG9yOiBpbmhlcml0OwogIG91dGxpbmU6IG5vbmU7Cn0KOndoZXJlKG9sLCB1bCkgewogIGxpc3Qtc3R5bGU6IG5vbmU7CiAgbWFyZ2luOiAwOwogIHBhZGRpbmc6IDA7Cn0KOndoZXJlKGgxLCBoMiwgaDMsIGg0LCBoNSwgaDYpIHsKICBmb250LXNpemU6IGluaGVyaXQ7CiAgZm9udC13ZWlnaHQ6IGluaGVyaXQ7CiAgbWFyZ2luOiAwOwp9
37
+ var init_StyleMarker_css_ts_vanilla = __esm({
38
+ "vanilla-extract-css-ns:src/components/styling/StyleMarker.css.ts.vanilla.css?source=OndoZXJlKCopIHsKICBib3gtc2l6aW5nOiBib3JkZXItYm94OwogIGNvbG9yOiB2YXIoLS1kYXBwLWtpdC1jb2xvcnMtYm9keSk7CiAgZm9udC1mYW1pbHk6IHZhcigtLWRhcHAta2l0LXR5cG9ncmFwaHktZm9udEZhbWlseSk7CiAgZm9udC1zaXplOiB2YXIoLS1kYXBwLWtpdC1mb250V2VpZ2h0cy1ub3JtYWwpOwogIGZvbnQtc3R5bGU6IHZhcigtLWRhcHAta2l0LXR5cG9ncmFwaHktZm9udFN0eWxlKTsKICBmb250LXdlaWdodDogdmFyKC0tZGFwcC1raXQtZm9udFdlaWdodHMtbm9ybWFsKTsKICBsaW5lLWhlaWdodDogdmFyKC0tZGFwcC1raXQtdHlwb2dyYXBoeS1saW5lSGVpZ2h0KTsKICBsZXR0ZXItc3BhY2luZzogdmFyKC0tZGFwcC1raXQtdHlwb2dyYXBoeS1sZXR0ZXJTcGFjaW5nKTsKfQo6d2hlcmUoYnV0dG9uKSB7CiAgYXBwZWFyYW5jZTogbm9uZTsKICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDsKICBmb250LXNpemU6IGluaGVyaXQ7CiAgZm9udC1mYW1pbHk6IGluaGVyaXQ7CiAgbGluZS1oZWlnaHQ6IGluaGVyaXQ7CiAgbGV0dGVyLXNwYWNpbmc6IGluaGVyaXQ7CiAgY29sb3I6IGluaGVyaXQ7CiAgYm9yZGVyOiAwOwogIHBhZGRpbmc6IDA7CiAgbWFyZ2luOiAwOwp9Cjp3aGVyZShhKSB7CiAgdGV4dC1kZWNvcmF0aW9uOiBub25lOwogIGNvbG9yOiBpbmhlcml0OwogIG91dGxpbmU6IG5vbmU7Cn0KOndoZXJlKG9sLCB1bCkgewogIGxpc3Qtc3R5bGU6IG5vbmU7CiAgbWFyZ2luOiAwOwogIHBhZGRpbmc6IDA7Cn0KOndoZXJlKGgxLCBoMiwgaDMsIGg0LCBoNSwgaDYpIHsKICBmb250LXNpemU6IGluaGVyaXQ7CiAgZm9udC13ZWlnaHQ6IGluaGVyaXQ7CiAgbWFyZ2luOiAwOwp9"() {
46
39
  }
47
40
  });
48
41
 
@@ -50,18 +43,136 @@ var init_ = __esm({
50
43
  var require_StyleMarker_css = __commonJS({
51
44
  "src/components/styling/StyleMarker.css.ts"() {
52
45
  "use strict";
53
- init_();
46
+ init_StyleMarker_css_ts_vanilla();
54
47
  }
55
48
  });
56
49
 
57
50
  // src/components/connect-modal/ConnectModal.tsx
58
51
  import * as Dialog from "@radix-ui/react-dialog";
59
- import { useState as useState2 } from "react";
52
+ import clsx6 from "clsx";
53
+ import { useState } from "react";
60
54
 
61
- // src/components/icons/CloseIcon.tsx
55
+ // src/hooks/wallet/useConnectWallet.ts
56
+ import { isSupportedChain } from "@iota/wallet-standard";
57
+ import { useMutation } from "@tanstack/react-query";
58
+
59
+ // src/constants/walletMutationKeys.ts
60
+ var walletMutationKeys = {
61
+ all: { baseScope: "wallet" },
62
+ connectWallet: formMutationKeyFn("connect-wallet"),
63
+ autoconnectWallet: formMutationKeyFn("autoconnect-wallet"),
64
+ disconnectWallet: formMutationKeyFn("disconnect-wallet"),
65
+ signPersonalMessage: formMutationKeyFn("sign-personal-message"),
66
+ signTransaction: formMutationKeyFn("sign-transaction"),
67
+ signAndExecuteTransaction: formMutationKeyFn("sign-and-execute-transaction"),
68
+ switchAccount: formMutationKeyFn("switch-account"),
69
+ reportTransactionEffects: formMutationKeyFn("report-transaction-effects")
70
+ };
71
+ function formMutationKeyFn(baseEntity) {
72
+ return function mutationKeyFn(additionalKeys = []) {
73
+ return [{ ...walletMutationKeys.all, baseEntity }, ...additionalKeys];
74
+ };
75
+ }
76
+
77
+ // src/hooks/wallet/useWalletStore.ts
78
+ import { useContext } from "react";
79
+ import { useStore } from "zustand";
80
+
81
+ // src/contexts/walletContext.ts
82
+ import { createContext } from "react";
83
+ var WalletContext = createContext(null);
84
+
85
+ // src/hooks/wallet/useWalletStore.ts
86
+ function useWalletStore(selector) {
87
+ const store = useContext(WalletContext);
88
+ if (!store) {
89
+ throw new Error(
90
+ "Could not find WalletContext. Ensure that you have set up the WalletProvider."
91
+ );
92
+ }
93
+ return useStore(store, selector);
94
+ }
95
+
96
+ // src/hooks/wallet/useConnectWallet.ts
97
+ function useConnectWallet({
98
+ mutationKey,
99
+ ...mutationOptions
100
+ } = {}) {
101
+ const setWalletConnected = useWalletStore((state) => state.setWalletConnected);
102
+ const setConnectionStatus = useWalletStore((state) => state.setConnectionStatus);
103
+ return useMutation({
104
+ mutationKey: walletMutationKeys.connectWallet(mutationKey),
105
+ mutationFn: async ({ wallet, accountAddress, ...connectArgs }) => {
106
+ try {
107
+ setConnectionStatus("connecting");
108
+ const connectResult = await wallet.features["standard:connect"].connect(connectArgs);
109
+ const connectedIotaAccounts = connectResult.accounts.filter(
110
+ (account) => account.chains.some(isSupportedChain)
111
+ );
112
+ const selectedAccount = getSelectedAccount(connectedIotaAccounts, accountAddress);
113
+ setWalletConnected(
114
+ wallet,
115
+ connectedIotaAccounts,
116
+ selectedAccount,
117
+ connectResult.supportedIntents
118
+ );
119
+ return { accounts: connectedIotaAccounts };
120
+ } catch (error) {
121
+ setConnectionStatus("disconnected");
122
+ throw error;
123
+ }
124
+ },
125
+ ...mutationOptions
126
+ });
127
+ }
128
+ function getSelectedAccount(connectedAccounts, accountAddress) {
129
+ if (connectedAccounts.length === 0) {
130
+ return null;
131
+ }
132
+ if (accountAddress) {
133
+ const selectedAccount = connectedAccounts.find(
134
+ (account) => account.address === accountAddress
135
+ );
136
+ return selectedAccount ?? connectedAccounts[0];
137
+ }
138
+ return connectedAccounts[0];
139
+ }
140
+
141
+ // src/utils/walletUtils.ts
142
+ import { getWallets, isWalletWithRequiredFeatureSet } from "@iota/wallet-standard";
143
+ function getRegisteredWallets(preferredWallets, walletFilter) {
144
+ const walletsApi = getWallets();
145
+ const wallets = walletsApi.get();
146
+ const iotaWallets = wallets.filter(
147
+ (wallet) => isWalletWithRequiredFeatureSet(wallet) && (!walletFilter || walletFilter(wallet))
148
+ );
149
+ return [
150
+ // Preferred wallets, in order:
151
+ ...preferredWallets.map((name) => iotaWallets.find((wallet) => wallet.name === name)).filter(Boolean),
152
+ // Wallets in default order:
153
+ ...iotaWallets.filter((wallet) => !preferredWallets.includes(wallet.name))
154
+ ];
155
+ }
156
+ function getWalletUniqueIdentifier(wallet) {
157
+ return wallet?.id ?? wallet?.name;
158
+ }
159
+
160
+ // src/components/icons/BackIcon.tsx
62
161
  import { jsx } from "react/jsx-runtime";
162
+ function BackIcon(props) {
163
+ return /* @__PURE__ */ jsx("svg", { width: 24, height: 24, fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx(
164
+ "path",
165
+ {
166
+ d: "M7.57 12.262c0 .341.13.629.403.895l5.175 5.059c.204.205.45.307.751.307.609 0 1.101-.485 1.101-1.087 0-.293-.123-.574-.349-.8L10.14 12.27l4.511-4.375A1.13 1.13 0 0 0 15 7.087C15 6.485 14.508 6 13.9 6c-.295 0-.54.103-.752.308l-5.175 5.058c-.28.28-.404.56-.404.896Z",
167
+ fill: "currentColor"
168
+ }
169
+ ) });
170
+ }
171
+
172
+ // src/components/icons/CloseIcon.tsx
173
+ import { jsx as jsx2 } from "react/jsx-runtime";
63
174
  function CloseIcon(props) {
64
- return /* @__PURE__ */ jsx("svg", { width: 10, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx(
175
+ return /* @__PURE__ */ jsx2("svg", { width: 10, height: 10, fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx2(
65
176
  "path",
66
177
  {
67
178
  d: "M9.708.292a.999.999 0 0 0-1.413 0l-3.289 3.29L1.717.291A.999.999 0 0 0 .305 1.705l3.289 3.289-3.29 3.289a.999.999 0 1 0 1.413 1.412l3.29-3.289 3.288 3.29a.999.999 0 0 0 1.413-1.413l-3.29-3.29 3.29-3.288a.999.999 0 0 0 0-1.413Z",
@@ -81,8 +192,8 @@ var styleDataAttribute = { [styleDataAttributeName]: "" };
81
192
 
82
193
  // src/components/styling/StyleMarker.tsx
83
194
  var import_StyleMarker_css = __toESM(require_StyleMarker_css());
84
- import { jsx as jsx2 } from "react/jsx-runtime";
85
- var StyleMarker = forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx2(Slot, { ref: forwardedRef, ...props, ...styleDataAttribute, children }));
195
+ import { jsx as jsx3 } from "react/jsx-runtime";
196
+ var StyleMarker = forwardRef(({ children, ...props }, forwardedRef) => /* @__PURE__ */ jsx3(Slot, { ref: forwardedRef, ...props, ...styleDataAttribute, children }));
86
197
  StyleMarker.displayName = "StyleMarker";
87
198
 
88
199
  // src/components/ui/Heading.tsx
@@ -95,7 +206,7 @@ import { createRuntimeFn as _7a468 } from "@vanilla-extract/recipes/createRuntim
95
206
  var headingVariants = _7a468({ defaultClassName: "Heading__12b5l8i0", variantClassNames: { size: { sm: "Heading_headingVariants_size_sm__12b5l8i1", md: "Heading_headingVariants_size_md__12b5l8i2", lg: "Heading_headingVariants_size_lg__12b5l8i3", xl: "Heading_headingVariants_size_xl__12b5l8i4" }, weight: { normal: "Heading_headingVariants_weight_normal__12b5l8i5", bold: "Heading_headingVariants_weight_bold__12b5l8i6" }, truncate: { true: "Heading_headingVariants_truncate_true__12b5l8i7" } }, defaultVariants: { size: "lg", weight: "bold" }, compoundVariants: [] });
96
207
 
97
208
  // src/components/ui/Heading.tsx
98
- import { jsx as jsx3 } from "react/jsx-runtime";
209
+ import { jsx as jsx4 } from "react/jsx-runtime";
99
210
  var Heading = forwardRef2(
100
211
  ({
101
212
  children,
@@ -107,13 +218,13 @@ var Heading = forwardRef2(
107
218
  truncate,
108
219
  ...headingProps
109
220
  }, forwardedRef) => {
110
- return /* @__PURE__ */ jsx3(
221
+ return /* @__PURE__ */ jsx4(
111
222
  Slot2,
112
223
  {
113
224
  ...headingProps,
114
225
  ref: forwardedRef,
115
226
  className: clsx(headingVariants({ size, weight, truncate }), className),
116
- children: asChild ? children : /* @__PURE__ */ jsx3(Tag, { children })
227
+ children: asChild ? children : /* @__PURE__ */ jsx4(Tag, { children })
117
228
  }
118
229
  );
119
230
  }
@@ -129,190 +240,247 @@ import { forwardRef as forwardRef3 } from "react";
129
240
  var container = "IconButton_container__ap1qll0";
130
241
 
131
242
  // src/components/ui/IconButton.tsx
132
- import { jsx as jsx4 } from "react/jsx-runtime";
243
+ import { jsx as jsx5 } from "react/jsx-runtime";
133
244
  var IconButton = forwardRef3(
134
245
  ({ className, asChild = false, ...props }, forwardedRef) => {
135
246
  const Comp = asChild ? Slot3 : "button";
136
- return /* @__PURE__ */ jsx4(Comp, { ...props, className: clsx2(container, className), ref: forwardedRef });
247
+ return /* @__PURE__ */ jsx5(Comp, { ...props, className: clsx2(container, className), ref: forwardedRef });
137
248
  }
138
249
  );
139
250
  IconButton.displayName = "Button";
140
251
 
141
252
  // src/components/connect-modal/ConnectModal.css.ts
142
- var closeButtonContainer = "ConnectModal_closeButtonContainer__17mljma5";
143
- var content = "ConnectModal_content__17mljma3";
253
+ var backButtonContainer = "ConnectModal_backButtonContainer__17mljma6";
254
+ var closeButtonContainer = "ConnectModal_closeButtonContainer__17mljma7";
255
+ var content = "ConnectModal_content__17mljma2";
144
256
  var overlay = "ConnectModal_overlay__17mljma0";
145
- var separator = "ConnectModal_separator__17mljma2";
257
+ var selectedViewContainer = "ConnectModal_selectedViewContainer__17mljma5";
146
258
  var title = "ConnectModal_title__17mljma1";
147
- var walletListContent = "ConnectModal_walletListContent__17mljma6";
259
+ var viewContainer = "ConnectModal_viewContainer__17mljma4";
260
+ var walletListContainer = "ConnectModal_walletListContainer__17mljma9";
261
+ var walletListContainerWithViewSelected = "ConnectModal_walletListContainerWithViewSelected__17mljmaa";
262
+ var walletListContent = "ConnectModal_walletListContent__17mljma8";
263
+ var whatIsAWalletButton = "ConnectModal_whatIsAWalletButton__17mljma3";
148
264
 
149
- // src/hooks/wallet/useWalletStore.ts
150
- import { useContext } from "react";
151
- import { useStore } from "zustand";
265
+ // src/components/ui/Button.tsx
266
+ import { Slot as Slot4 } from "@radix-ui/react-slot";
267
+ import clsx3 from "clsx";
268
+ import { forwardRef as forwardRef4 } from "react";
152
269
 
153
- // src/contexts/walletContext.ts
154
- import { createContext } from "react";
155
- var WalletContext = createContext(null);
270
+ // src/components/ui/Button.css.ts
271
+ import { createRuntimeFn as _7a4682 } from "@vanilla-extract/recipes/createRuntimeFn";
272
+ var buttonVariants = _7a4682({ defaultClassName: "Button_buttonVariants__ctbx2n0", variantClassNames: { variant: { primary: "Button_buttonVariants_variant_primary__ctbx2n1", outline: "Button_buttonVariants_variant_outline__ctbx2n2" }, size: { md: "Button_buttonVariants_size_md__ctbx2n3", lg: "Button_buttonVariants_size_lg__ctbx2n4" } }, defaultVariants: { variant: "primary", size: "md" }, compoundVariants: [] });
156
273
 
157
- // src/hooks/wallet/useWalletStore.ts
158
- function useWalletStore(selector) {
159
- const store = useContext(WalletContext);
160
- if (!store) {
161
- throw new Error(
162
- "Could not find WalletContext. Ensure that you have set up the WalletProvider."
274
+ // src/components/ui/Button.tsx
275
+ import { jsx as jsx6 } from "react/jsx-runtime";
276
+ var Button = forwardRef4(
277
+ ({ className, variant, size, asChild = false, ...props }, forwardedRef) => {
278
+ const Comp = asChild ? Slot4 : "button";
279
+ return /* @__PURE__ */ jsx6(
280
+ Comp,
281
+ {
282
+ ...props,
283
+ className: clsx3(buttonVariants({ variant, size }), className),
284
+ ref: forwardedRef
285
+ }
163
286
  );
164
287
  }
165
- return useStore(store, selector);
166
- }
288
+ );
289
+ Button.displayName = "Button";
167
290
 
168
- // src/hooks/wallet/useWallets.ts
169
- function useWallets() {
170
- return useWalletStore((state) => state.wallets);
171
- }
291
+ // src/components/ui/Text.tsx
292
+ import { Slot as Slot5 } from "@radix-ui/react-slot";
293
+ import clsx4 from "clsx";
294
+ import { forwardRef as forwardRef5 } from "react";
172
295
 
173
- // src/components/connect-modal/views/WalletConnect.tsx
174
- import { useState } from "react";
296
+ // src/components/ui/Text.css.ts
297
+ import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRuntimeFn";
298
+ var textVariants = _7a4683({ defaultClassName: "Text__aprhbd0", variantClassNames: { size: { sm: "Text_textVariants_size_sm__aprhbd1" }, weight: { normal: "Text_textVariants_weight_normal__aprhbd2", medium: "Text_textVariants_weight_medium__aprhbd3", bold: "Text_textVariants_weight_bold__aprhbd4" }, color: { muted: "Text_textVariants_color_muted__aprhbd5", danger: "Text_textVariants_color_danger__aprhbd6" }, mono: { true: "Text_textVariants_mono_true__aprhbd7" } }, defaultVariants: { size: "sm", weight: "normal" }, compoundVariants: [] });
175
299
 
176
- // src/utils/walletUtils.ts
177
- import { getWallets, isWalletWithRequiredFeatureSet } from "@iota/wallet-standard";
178
- function getRegisteredWallets(preferredWallets, requiredFeatures) {
179
- const walletsApi = getWallets();
180
- const wallets = walletsApi.get();
181
- const iotaWallets = wallets.filter(
182
- (wallet) => isWalletWithRequiredFeatureSet(wallet, requiredFeatures)
183
- );
184
- return [
185
- // Preferred wallets, in order:
186
- ...preferredWallets.map((name) => iotaWallets.find((wallet) => wallet.name === name)).filter(Boolean),
187
- // Wallets in default order:
188
- ...iotaWallets.filter((wallet) => !preferredWallets.includes(wallet.name))
189
- ];
190
- }
191
- function getWalletUniqueIdentifier(wallet) {
192
- return wallet?.id ?? wallet?.name;
300
+ // src/components/ui/Text.tsx
301
+ import { jsx as jsx7 } from "react/jsx-runtime";
302
+ var Text = forwardRef5(
303
+ ({
304
+ children,
305
+ className,
306
+ asChild = false,
307
+ as: Tag = "div",
308
+ size,
309
+ weight,
310
+ color,
311
+ mono,
312
+ ...textProps
313
+ }, forwardedRef) => {
314
+ return /* @__PURE__ */ jsx7(
315
+ Slot5,
316
+ {
317
+ ...textProps,
318
+ ref: forwardedRef,
319
+ className: clsx4(textVariants({ size, weight, color, mono }), className),
320
+ children: asChild ? children : /* @__PURE__ */ jsx7(Tag, { children })
321
+ }
322
+ );
323
+ }
324
+ );
325
+ Text.displayName = "Text";
326
+
327
+ // src/components/connect-modal/views/ConnectionStatus.css.ts
328
+ var connectionStatus = "ConnectionStatus_connectionStatus__c5q1ll3";
329
+ var container2 = "ConnectionStatus_container__c5q1ll0";
330
+ var retryButtonContainer = "ConnectionStatus_retryButtonContainer__c5q1ll4";
331
+ var title2 = "ConnectionStatus_title__c5q1ll2";
332
+ var walletIcon = "ConnectionStatus_walletIcon__c5q1ll1";
333
+
334
+ // src/components/connect-modal/views/ConnectionStatus.tsx
335
+ import { jsx as jsx8, jsxs } from "react/jsx-runtime";
336
+ function ConnectionStatus({
337
+ selectedWallet,
338
+ hadConnectionError,
339
+ onRetryConnection
340
+ }) {
341
+ return /* @__PURE__ */ jsxs("div", { className: container2, children: [
342
+ /* @__PURE__ */ jsx8(
343
+ "img",
344
+ {
345
+ className: walletIcon,
346
+ src: selectedWallet.icon,
347
+ alt: `${selectedWallet.name} logo`
348
+ }
349
+ ),
350
+ /* @__PURE__ */ jsx8("div", { className: title2, children: /* @__PURE__ */ jsxs(Heading, { as: "h2", size: "xl", children: [
351
+ "Opening ",
352
+ selectedWallet.name
353
+ ] }) }),
354
+ /* @__PURE__ */ jsx8("div", { className: connectionStatus, children: hadConnectionError ? /* @__PURE__ */ jsx8(Text, { color: "danger", children: "Connection failed" }) : /* @__PURE__ */ jsx8(Text, { color: "muted", children: "Confirm connection in the wallet..." }) }),
355
+ hadConnectionError ? /* @__PURE__ */ jsx8("div", { className: retryButtonContainer, children: /* @__PURE__ */ jsx8(
356
+ Button,
357
+ {
358
+ type: "button",
359
+ variant: "outline",
360
+ onClick: () => onRetryConnection(selectedWallet),
361
+ children: "Retry Connection"
362
+ }
363
+ ) }) : null
364
+ ] });
193
365
  }
194
366
 
195
- // src/hooks/wallet/useConnectWallet.ts
196
- import { isSupportedChain } from "@iota/wallet-standard";
197
- import { useMutation } from "@tanstack/react-query";
367
+ // src/components/connect-modal/InfoSection.css.ts
368
+ var container3 = "InfoSection_container__1d1nrmt0";
198
369
 
199
- // src/constants/walletMutationKeys.ts
200
- var walletMutationKeys = {
201
- all: { baseScope: "wallet" },
202
- connectWallet: formMutationKeyFn("connect-wallet"),
203
- autoconnectWallet: formMutationKeyFn("autoconnect-wallet"),
204
- disconnectWallet: formMutationKeyFn("disconnect-wallet"),
205
- signPersonalMessage: formMutationKeyFn("sign-personal-message"),
206
- signTransactionBlock: formMutationKeyFn("sign-transaction-block"),
207
- signAndExecuteTransactionBlock: formMutationKeyFn("sign-and-execute-transaction-block"),
208
- switchAccount: formMutationKeyFn("switch-account")
209
- };
210
- function formMutationKeyFn(baseEntity) {
211
- return function mutationKeyFn(additionalKeys = []) {
212
- return [{ ...walletMutationKeys.all, baseEntity }, ...additionalKeys];
213
- };
370
+ // src/components/connect-modal/InfoSection.tsx
371
+ import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
372
+ function InfoSection({ title: title3, children }) {
373
+ return /* @__PURE__ */ jsxs2("section", { className: container3, children: [
374
+ /* @__PURE__ */ jsx9(Heading, { as: "h3", size: "sm", weight: "normal", children: title3 }),
375
+ /* @__PURE__ */ jsx9(Text, { weight: "medium", color: "muted", children })
376
+ ] });
214
377
  }
215
378
 
216
- // src/hooks/wallet/useConnectWallet.ts
217
- function useConnectWallet({
218
- mutationKey,
219
- ...mutationOptions
220
- } = {}) {
221
- const setWalletConnected = useWalletStore((state) => state.setWalletConnected);
222
- const setConnectionStatus = useWalletStore((state) => state.setConnectionStatus);
223
- return useMutation({
224
- mutationKey: walletMutationKeys.connectWallet(mutationKey),
225
- mutationFn: async ({ wallet, accountAddress, ...connectArgs }) => {
226
- try {
227
- setConnectionStatus("connecting");
228
- const connectResult = await wallet.features["standard:connect"].connect(connectArgs);
229
- const connectedIotaAccounts = connectResult.accounts.filter(
230
- (account) => account.chains.some(isSupportedChain)
231
- );
232
- const selectedAccount = getSelectedAccount(connectedIotaAccounts, accountAddress);
233
- setWalletConnected(wallet, connectedIotaAccounts, selectedAccount);
234
- return { accounts: connectedIotaAccounts };
235
- } catch (error) {
236
- setConnectionStatus("disconnected");
237
- throw error;
238
- }
239
- },
240
- ...mutationOptions
241
- });
242
- }
243
- function getSelectedAccount(connectedAccounts, accountAddress) {
244
- if (connectedAccounts.length === 0) {
245
- return null;
246
- }
247
- if (accountAddress) {
248
- const selectedAccount = connectedAccounts.find(
249
- (account) => account.address === accountAddress
250
- );
251
- return selectedAccount ?? connectedAccounts[0];
252
- }
253
- return connectedAccounts[0];
379
+ // src/components/connect-modal/views/GettingStarted.css.ts
380
+ var container4 = "GettingStarted_container__qu36t90";
381
+ var content2 = "GettingStarted_content__qu36t91";
382
+ var installButtonContainer = "GettingStarted_installButtonContainer__qu36t92";
383
+
384
+ // src/components/connect-modal/views/GettingStarted.tsx
385
+ import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
386
+ function GettingStarted() {
387
+ return /* @__PURE__ */ jsxs3("div", { className: container4, children: [
388
+ /* @__PURE__ */ jsx10(Heading, { as: "h2", children: "Get Started with IOTA" }),
389
+ /* @__PURE__ */ jsxs3("div", { className: content2, children: [
390
+ /* @__PURE__ */ jsx10(InfoSection, { title: "Install the IOTA Wallet Extension", children: "We recommend pinning IOTA Wallet to your taskbar for quicker access." }),
391
+ /* @__PURE__ */ jsx10(InfoSection, { title: "Create or Import a Wallet", children: "Be sure to back up your wallet using a secure method. Never share your secret phrase with anyone." }),
392
+ /* @__PURE__ */ jsx10(InfoSection, { title: "Refresh Your Browser", children: "Once you set up your wallet, refresh this window browser to load up the extension." }),
393
+ /* @__PURE__ */ jsx10("div", { className: installButtonContainer, children: /* @__PURE__ */ jsx10(Button, { variant: "outline", asChild: true, children: /* @__PURE__ */ jsx10(
394
+ "a",
395
+ {
396
+ href: "https://chrome.google.com/webstore/detail/iota-wallet/iidjkmdceolghepehaaddojmnjnkkija",
397
+ target: "_blank",
398
+ rel: "noreferrer",
399
+ children: "Install Wallet Extension"
400
+ }
401
+ ) }) })
402
+ ] })
403
+ ] });
254
404
  }
255
405
 
256
- // src/components/connect-modal/wallet-list/WalletList.css.ts
257
- var container2 = "WalletList_container__1tkdegw0";
258
-
259
- // src/components/connect-modal/wallet-list/WalletListItem.tsx
260
- import { clsx as clsx3 } from "clsx";
406
+ // src/components/connect-modal/views/WhatIsAWallet.css.ts
407
+ var container5 = "WhatIsAWallet_container__1kdcimq0";
408
+ var content3 = "WhatIsAWallet_content__1kdcimq1";
409
+
410
+ // src/components/connect-modal/views/WhatIsAWallet.tsx
411
+ import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
412
+ function WhatIsAWallet() {
413
+ return /* @__PURE__ */ jsxs4("div", { className: container5, children: [
414
+ /* @__PURE__ */ jsx11(Heading, { as: "h2", children: "What is a Wallet" }),
415
+ /* @__PURE__ */ jsxs4("div", { className: content3, children: [
416
+ /* @__PURE__ */ jsx11(InfoSection, { title: "Easy Login", children: "No need to create new accounts and passwords for every website. Just connect your wallet and get going." }),
417
+ /* @__PURE__ */ jsx11(InfoSection, { title: "Store your Digital Assets", children: "Send, receive, store, and display your digital assets like NFTs & coins." })
418
+ ] })
419
+ ] });
420
+ }
261
421
 
262
- // src/components/connect-modal/wallet-list/WalletListItem.css.ts
263
- var container3 = "WalletListItem_container__1vrvezk0";
264
- var selectedWalletItem = "WalletListItem_selectedWalletItem__1vrvezk2";
265
- var walletIcon = "WalletListItem_walletIcon__1vrvezk4";
266
- var walletItem = "WalletListItem_walletItem__1vrvezk1";
267
- var walletName = "WalletListItem_walletName__1vrvezk3";
422
+ // src/hooks/wallet/useWallets.ts
423
+ function useWallets() {
424
+ return useWalletStore((state) => state.wallets);
425
+ }
268
426
 
269
- // src/components/icons/ArrowRightIcon.tsx
270
- import { jsx as jsx5 } from "react/jsx-runtime";
271
- function ArrowRightIcon(props) {
272
- return /* @__PURE__ */ jsx5(
427
+ // src/components/icons/IotaIcon.tsx
428
+ import { jsx as jsx12 } from "react/jsx-runtime";
429
+ function IotaIcon(props) {
430
+ return /* @__PURE__ */ jsx12(
273
431
  "svg",
274
432
  {
275
433
  xmlns: "http://www.w3.org/2000/svg",
276
- width: "24",
277
- height: "24",
278
- viewBox: "0 0 24 24",
434
+ width: "28px",
435
+ height: "28px",
279
436
  fill: "none",
437
+ viewBox: "0 0 24 24",
280
438
  ...props,
281
- children: /* @__PURE__ */ jsx5(
439
+ children: /* @__PURE__ */ jsx12(
282
440
  "path",
283
441
  {
284
- fill: "currentColor",
285
- d: "m10.707 6.293 5 5a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414-1.414L13.586 12 9.293 7.707a1 1 0 0 1 1.414-1.414Z"
442
+ fill: "#171d26",
443
+ d: "M18.27 2.259c0 .695-.568 1.259-1.268 1.259s-1.267-.564-1.267-1.259S16.302 1 17.002 1s1.268.564 1.268 1.259m1.425 17.785c0 .695-.568 1.259-1.268 1.259s-1.267-.564-1.267-1.26c0-.695.567-1.258 1.267-1.258s1.268.563 1.268 1.259m-2.33-13.379a1.06 1.06 0 0 0 1.063-1.056 1.06 1.06 0 0 0-1.063-1.057A1.06 1.06 0 0 0 16.3 5.61a1.06 1.06 0 0 0 1.064 1.056Zm3.891-.651a1.06 1.06 0 0 1-1.063 1.056 1.06 1.06 0 0 1-1.064-1.056 1.06 1.06 0 0 1 1.064-1.057 1.06 1.06 0 0 1 1.063 1.057m-4.253 3.329c.5 0 .905-.403.905-.9 0-.496-.405-.9-.905-.9s-.906.404-.906.9c0 .497.406.9.906.9m3.734-.52c0 .497-.405.9-.905.9a.903.903 0 0 1-.906-.9c0-.496.405-.9.906-.9.5 0 .905.404.905.9m1.357 1.777c.5 0 .906-.402.906-.899s-.405-.9-.906-.9c-.5 0-.905.403-.905.9s.405.9.905.9Zm-2.309.495a.79.79 0 0 1-.792.787.79.79 0 0 1-.791-.787c0-.434.354-.786.791-.786s.792.352.792.786m-3.62.404a.79.79 0 0 0 .792-.787.79.79 0 0 0-.792-.786.79.79 0 0 0-.791.786c0 .435.354.787.791.787m5.907.471a.79.79 0 0 1-.791.787.79.79 0 0 1-.792-.786.79.79 0 0 1 .792-.787.79.79 0 0 1 .791.787Zm-4.21 1.554c.375 0 .68-.302.68-.675a.677.677 0 0 0-.68-.675.68.68 0 0 0-.68.675c0 .373.304.675.68.675m2.968.178a.68.68 0 0 1-.68.676.677.677 0 0 1-.68-.676c0-.373.304-.675.68-.675.375 0 .68.302.68.675m-5.774-.582c.375 0 .68-.302.68-.675a.68.68 0 0 0-.68-.675.68.68 0 0 0-.68.675c0 .373.304.675.68.675m2.127.943c0 .31-.254.561-.566.561a.564.564 0 0 1-.566-.562c0-.31.253-.561.566-.561s.566.251.566.562m.407 2.114a.496.496 0 0 0 .498-.494.496.496 0 0 0-.498-.495.496.496 0 0 0-.498.495c0 .273.223.494.498.494m-.791-.09a.407.407 0 0 1-.408.405.407.407 0 0 1-.408-.405c0-.223.182-.405.408-.405s.408.181.408.405m-1.472-.765a.496.496 0 0 0 .498-.494.496.496 0 0 0-.498-.495.496.496 0 0 0-.498.495c0 .273.223.494.498.494m-.973-1.64c0 .31-.254.562-.566.562a.564.564 0 0 1-.566-.562c0-.31.253-.562.566-.562s.566.251.566.562m-.588-3.666a.564.564 0 0 0 .566-.562.564.564 0 0 0-.566-.562.564.564 0 0 0-.565.562c0 .31.253.562.565.562m.745-2.473a.496.496 0 0 1-.497.494.496.496 0 0 1-.498-.494c0-.273.223-.494.498-.494s.498.22.498.494Zm.047-1.123a.406.406 0 0 0 .407-.406.406.406 0 0 0-.407-.405.407.407 0 0 0-.408.405c0 .224.182.406.408.406m-.452-1.26a.496.496 0 0 1-.498.494.496.496 0 0 1-.498-.494c0-.273.223-.494.498-.494s.498.22.498.494m4.776 10.32a.564.564 0 0 0 .566-.561.564.564 0 0 0-.566-.562.564.564 0 0 0-.566.562c0 .31.253.562.566.562ZM12.883 4.439c0 .31-.254.562-.566.562a.564.564 0 0 1-.566-.562c0-.31.254-.562.566-.562s.566.251.566.562m-.18 2.945a.564.564 0 0 0 .566-.562.564.564 0 0 0-.566-.561.564.564 0 0 0-.566.561c0 .31.253.562.566.562m.045 1.597a.677.677 0 0 1-.68.676.68.68 0 0 1-.679-.676c0-.373.304-.675.68-.675.375 0 .68.302.68.675Zm-2.74.676a.79.79 0 0 0 .791-.786.79.79 0 0 0-.791-.787.79.79 0 0 0-.792.787c0 .434.354.786.792.786m-1.494-.36c0 .497-.405.9-.905.9a.903.903 0 0 1-.906-.9c0-.497.406-.9.906-.9s.905.403.905.9m-3.529 2.18a1.06 1.06 0 0 0 1.063-1.056 1.06 1.06 0 0 0-1.063-1.056A1.06 1.06 0 0 0 3.92 10.42a1.06 1.06 0 0 0 1.064 1.056Zm-1.45.9c0 .696-.568 1.26-1.268 1.26S1 13.073 1 12.377c0-.695.567-1.259 1.267-1.259s1.268.564 1.268 1.26Zm.386-3.531A1.06 1.06 0 0 0 4.985 7.79 1.06 1.06 0 0 0 3.92 6.733 1.06 1.06 0 0 0 2.858 7.79 1.06 1.06 0 0 0 3.92 8.846Zm3.53-2.181c0 .497-.405.9-.906.9a.903.903 0 0 1-.905-.9c0-.496.405-.9.905-.9s.906.404.906.9M6.162 5.182c.5 0 .905-.403.905-.9 0-.496-.405-.9-.905-.9s-.906.404-.906.9c0 .497.406.9.906.9m3.19-1.326a.79.79 0 0 1-.791.787.79.79 0 0 1-.792-.787c0-.434.354-.786.792-.786.437 0 .791.352.791.786m1.268.788c.375 0 .68-.303.68-.675a.677.677 0 0 0-.68-.676.68.68 0 0 0-.68.675c0 .373.304.676.68.676m1.063 1.708a.68.68 0 0 1-.68.675.677.677 0 0 1-.68-.675c0-.373.305-.675.68-.675s.68.302.68.675m-2.739.695a.79.79 0 0 0 .792-.786.79.79 0 0 0-.792-.786.79.79 0 0 0-.791.786c0 .434.354.786.791.786m-1.832 5.578a.407.407 0 0 1-.408.405.407.407 0 0 1-.408-.405c0-.223.182-.405.408-.405s.408.181.408.405m1.221.201a.496.496 0 0 0 .497-.494.496.496 0 0 0-.497-.495.496.496 0 0 0-.498.495c0 .273.223.494.498.494m2.354-1.236c0 .31-.253.562-.565.562a.564.564 0 0 1-.566-.562c0-.31.253-.562.566-.562s.565.252.565.562m-.135 2.361c.375 0 .68-.302.68-.675a.677.677 0 0 0-.68-.675.677.677 0 0 0-.68.675c0 .373.304.675.68.675m-1.608-.135c0 .31-.253.562-.566.562a.564.564 0 0 1-.565-.562c0-.31.253-.562.565-.562.313 0 .566.252.566.562m-2.488.538a.496.496 0 0 0 .498-.494.496.496 0 0 0-.498-.495.496.496 0 0 0-.498.495c0 .273.223.494.498.494m.588.991c0 .31-.254.562-.566.562a.564.564 0 0 1-.566-.562c0-.31.253-.562.566-.562s.566.252.566.562m1.742.855c.376 0 .68-.303.68-.675a.677.677 0 0 0-.68-.676.677.677 0 0 0-.68.675c0 .373.305.676.68.676m3.484-1.08a.79.79 0 0 1-.79.786.79.79 0 0 1-.792-.786c0-.435.354-.787.791-.787s.792.352.792.787Zm.794 2.743c.5 0 .906-.402.906-.9 0-.496-.406-.899-.906-.899s-.905.403-.905.9.405.9.905.9Zm-2.536-.518a.79.79 0 0 1-.792.786.79.79 0 0 1-.792-.787.79.79 0 0 1 .792-.786.79.79 0 0 1 .792.787m-2.669 2.316a.79.79 0 0 0 .791-.786.79.79 0 0 0-.792-.786.79.79 0 0 0-.791.786c0 .434.354.786.792.786m2.466 1.079c0 .497-.405.9-.905.9a.903.903 0 0 1-.906-.9c0-.496.405-.9.906-.9.5 0 .905.404.905.9M13.584 22a1.06 1.06 0 0 0 1.064-1.056 1.06 1.06 0 0 0-1.064-1.057 1.06 1.06 0 0 0-1.063 1.057A1.06 1.06 0 0 0 13.584 22m-1.379-2.788c0 .497-.405.9-.905.9a.903.903 0 0 1-.906-.9c0-.497.405-.9.905-.9s.906.403.906.9m3.123.54a1.06 1.06 0 0 0 1.063-1.057 1.06 1.06 0 0 0-1.063-1.056 1.06 1.06 0 0 0-1.064 1.056 1.06 1.06 0 0 0 1.064 1.057m-7.741-2.699a.677.677 0 0 1-.68.676.677.677 0 0 1-.68-.676c0-.373.305-.675.68-.675s.68.302.68.675"
286
444
  }
287
445
  )
288
446
  }
289
447
  );
290
448
  }
291
449
 
450
+ // src/components/connect-modal/wallet-list/WalletList.css.ts
451
+ var container6 = "WalletList_container__1tkdegw0";
452
+
292
453
  // src/components/connect-modal/wallet-list/WalletListItem.tsx
293
- import { jsx as jsx6, jsxs } from "react/jsx-runtime";
294
- function WalletListItem({ name, icon: icon3, onClick, isSelected = false }) {
295
- return /* @__PURE__ */ jsx6("li", { className: container3, children: /* @__PURE__ */ jsxs(
454
+ import { clsx as clsx5 } from "clsx";
455
+
456
+ // src/components/connect-modal/wallet-list/WalletListItem.css.ts
457
+ var container7 = "WalletListItem_container__1vrvezk0";
458
+ var selectedWalletItem = "WalletListItem_selectedWalletItem__1vrvezk2";
459
+ var walletIcon2 = "WalletListItem_walletIcon__1vrvezk3";
460
+ var walletItem = "WalletListItem_walletItem__1vrvezk1";
461
+
462
+ // src/components/connect-modal/wallet-list/WalletListItem.tsx
463
+ import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
464
+ function WalletListItem({ name, icon, onClick, isSelected = false }) {
465
+ return /* @__PURE__ */ jsx13("li", { className: container7, children: /* @__PURE__ */ jsxs5(
296
466
  "button",
297
467
  {
298
- className: clsx3(walletItem, { [selectedWalletItem]: isSelected }),
468
+ className: clsx5(walletItem, { [selectedWalletItem]: isSelected }),
299
469
  type: "button",
300
470
  onClick,
301
471
  children: [
302
- /* @__PURE__ */ jsxs("div", { className: clsx3(walletName), children: [
303
- typeof icon3 === "string" ? /* @__PURE__ */ jsx6("img", { className: walletIcon, src: icon3, alt: `${name} logo` }) : icon3,
304
- /* @__PURE__ */ jsx6(Heading, { size: "md", truncate: true, asChild: true, children: /* @__PURE__ */ jsx6("div", { children: name }) })
305
- ] }),
306
- /* @__PURE__ */ jsx6(ArrowRightIcon, {})
472
+ typeof icon === "string" ? /* @__PURE__ */ jsx13("img", { className: walletIcon2, src: icon, alt: `${name} logo` }) : icon,
473
+ /* @__PURE__ */ jsx13(Heading, { size: "md", truncate: true, asChild: true, children: /* @__PURE__ */ jsx13("div", { children: name }) })
307
474
  ]
308
475
  }
309
476
  ) });
310
477
  }
311
478
 
312
479
  // src/components/connect-modal/wallet-list/WalletList.tsx
313
- import { jsx as jsx7 } from "react/jsx-runtime";
314
- function WalletList({ selectedWalletName, onSelect, wallets }) {
315
- return /* @__PURE__ */ jsx7("ul", { className: container2, children: wallets.map((wallet) => /* @__PURE__ */ jsx7(
480
+ import { jsx as jsx14 } from "react/jsx-runtime";
481
+ function WalletList({ selectedWalletName, onPlaceholderClick, onSelect }) {
482
+ const wallets = useWallets();
483
+ return /* @__PURE__ */ jsx14("ul", { className: container6, children: wallets.length > 0 ? wallets.map((wallet) => /* @__PURE__ */ jsx14(
316
484
  WalletListItem,
317
485
  {
318
486
  name: wallet.name,
@@ -321,597 +489,126 @@ function WalletList({ selectedWalletName, onSelect, wallets }) {
321
489
  onClick: () => onSelect(wallet)
322
490
  },
323
491
  getWalletUniqueIdentifier(wallet)
324
- )) });
492
+ )) : /* @__PURE__ */ jsx14(
493
+ WalletListItem,
494
+ {
495
+ name: "IOTA Wallet",
496
+ icon: /* @__PURE__ */ jsx14(IotaIcon, {}),
497
+ onClick: onPlaceholderClick,
498
+ isSelected: true
499
+ }
500
+ ) });
325
501
  }
326
502
 
327
- // src/components/connect-modal/views/WalletConnect.css.ts
328
- var confirmText = "WalletConnect_confirmText__uo0o3s6";
329
- var errorContainer = "WalletConnect_errorContainer__uo0o3s2";
330
- var errorMessage = "WalletConnect_errorMessage__uo0o3s3";
331
- var openingText = "WalletConnect_openingText__uo0o3s5";
332
- var separator2 = "WalletConnect_separator__uo0o3s7";
333
- var successContainer = "WalletConnect_successContainer__uo0o3s4";
334
- var walletConnectContainer = "WalletConnect_walletConnectContainer__uo0o3s0";
335
- var walletConnectFooter = "WalletConnect_walletConnectFooter__uo0o3s1";
336
-
337
- // src/components/ui/Button.tsx
338
- import { Slot as Slot4 } from "@radix-ui/react-slot";
339
- import clsx4 from "clsx";
340
- import { forwardRef as forwardRef4 } from "react";
341
-
342
- // src/components/ui/Button.css.ts
343
- import { createRuntimeFn as _7a4682 } from "@vanilla-extract/recipes/createRuntimeFn";
344
- var buttonVariants = _7a4682({ defaultClassName: "Button_buttonVariants__ctbx2n0", variantClassNames: { variant: { primary: "Button_buttonVariants_variant_primary__ctbx2n1", outline: "Button_buttonVariants_variant_outline__ctbx2n2" }, size: { md: "Button_buttonVariants_size_md__ctbx2n3", lg: "Button_buttonVariants_size_lg__ctbx2n4" } }, defaultVariants: { variant: "primary", size: "md" }, compoundVariants: [] });
345
-
346
- // src/components/ui/Button.tsx
347
- import { jsx as jsx8 } from "react/jsx-runtime";
348
- var Button = forwardRef4(
349
- ({ className, variant, size, asChild = false, ...props }, forwardedRef) => {
350
- const Comp = asChild ? Slot4 : "button";
351
- return /* @__PURE__ */ jsx8(
352
- Comp,
353
- {
354
- ...props,
355
- className: clsx4(buttonVariants({ variant, size }), className),
356
- ref: forwardedRef
357
- }
358
- );
359
- }
360
- );
361
- Button.displayName = "Button";
362
-
363
- // src/components/connect-modal/views/WalletConnect.tsx
364
- import { Fragment, jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
365
- function WalletConnectListView({ wallets, onOpenChange }) {
503
+ // src/components/connect-modal/ConnectModal.tsx
504
+ import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
505
+ function ConnectModal({ trigger, open, defaultOpen, onOpenChange }) {
506
+ const [isModalOpen, setModalOpen] = useState(open ?? defaultOpen);
507
+ const [currentView, setCurrentView] = useState();
366
508
  const [selectedWallet, setSelectedWallet] = useState();
367
509
  const { mutate, isError } = useConnectWallet();
368
- function handleSelectWallet(wallet) {
369
- if (getWalletUniqueIdentifier(selectedWallet) !== getWalletUniqueIdentifier(wallet)) {
370
- setSelectedWallet(wallet);
371
- connectWallet(wallet);
372
- }
373
- }
374
- function resetSelection() {
510
+ const resetSelection = () => {
375
511
  setSelectedWallet(void 0);
376
- }
377
- function handleOpenChange(open) {
378
- if (!open) {
512
+ setCurrentView(void 0);
513
+ };
514
+ const handleOpenChange = (open2) => {
515
+ if (!open2) {
379
516
  resetSelection();
380
517
  }
381
- onOpenChange(open);
382
- }
383
- function connectWallet(wallet) {
518
+ setModalOpen(open2);
519
+ onOpenChange?.(open2);
520
+ };
521
+ const connectWallet = (wallet) => {
522
+ setCurrentView("connection-status");
384
523
  mutate(
385
524
  { wallet },
386
525
  {
387
526
  onSuccess: () => handleOpenChange(false)
388
527
  }
389
528
  );
529
+ };
530
+ let modalContent;
531
+ switch (currentView) {
532
+ case "what-is-a-wallet":
533
+ modalContent = /* @__PURE__ */ jsx15(WhatIsAWallet, {});
534
+ break;
535
+ case "getting-started":
536
+ modalContent = /* @__PURE__ */ jsx15(GettingStarted, {});
537
+ break;
538
+ case "connection-status":
539
+ modalContent = /* @__PURE__ */ jsx15(
540
+ ConnectionStatus,
541
+ {
542
+ selectedWallet,
543
+ hadConnectionError: isError,
544
+ onRetryConnection: connectWallet
545
+ }
546
+ );
547
+ break;
548
+ default:
549
+ modalContent = /* @__PURE__ */ jsx15(WhatIsAWallet, {});
390
550
  }
391
- return /* @__PURE__ */ jsxs2(Fragment, { children: [
392
- /* @__PURE__ */ jsx9("div", { className: walletConnectContainer, children: /* @__PURE__ */ jsx9(
393
- WalletList,
394
- {
395
- selectedWalletName: getWalletUniqueIdentifier(selectedWallet),
396
- onSelect: handleSelectWallet,
397
- wallets
398
- }
399
- ) }),
400
- selectedWallet && /* @__PURE__ */ jsx9("div", { className: walletConnectFooter, children: isError ? /* @__PURE__ */ jsxs2("div", { className: errorContainer, children: [
401
- /* @__PURE__ */ jsx9("p", { className: errorMessage, children: "Connection failed" }),
402
- /* @__PURE__ */ jsx9(
403
- Button,
551
+ return /* @__PURE__ */ jsxs6(Dialog.Root, { open: open ?? isModalOpen, onOpenChange: handleOpenChange, children: [
552
+ /* @__PURE__ */ jsx15(Dialog.Trigger, { asChild: true, children: trigger }),
553
+ /* @__PURE__ */ jsx15(Dialog.Portal, { children: /* @__PURE__ */ jsx15(StyleMarker, { children: /* @__PURE__ */ jsx15(Dialog.Overlay, { className: overlay, children: /* @__PURE__ */ jsxs6(Dialog.Content, { className: content, "aria-describedby": void 0, children: [
554
+ /* @__PURE__ */ jsxs6(
555
+ "div",
404
556
  {
405
- size: "md",
406
- variant: "outline",
407
- onClick: () => connectWallet(selectedWallet),
408
- children: "Retry"
557
+ className: clsx6(walletListContainer, {
558
+ [walletListContainerWithViewSelected]: !!currentView
559
+ }),
560
+ children: [
561
+ /* @__PURE__ */ jsxs6("div", { className: walletListContent, children: [
562
+ /* @__PURE__ */ jsx15(Dialog.Title, { className: title, asChild: true, children: /* @__PURE__ */ jsx15(Heading, { as: "h2", children: "Connect a Wallet" }) }),
563
+ /* @__PURE__ */ jsx15(
564
+ WalletList,
565
+ {
566
+ selectedWalletName: getWalletUniqueIdentifier(
567
+ selectedWallet
568
+ ),
569
+ onPlaceholderClick: () => setCurrentView("getting-started"),
570
+ onSelect: (wallet) => {
571
+ if (getWalletUniqueIdentifier(selectedWallet) !== getWalletUniqueIdentifier(wallet)) {
572
+ setSelectedWallet(wallet);
573
+ connectWallet(wallet);
574
+ }
575
+ }
576
+ }
577
+ )
578
+ ] }),
579
+ /* @__PURE__ */ jsx15(
580
+ "button",
581
+ {
582
+ className: whatIsAWalletButton,
583
+ onClick: () => setCurrentView("what-is-a-wallet"),
584
+ type: "button",
585
+ children: "What is a Wallet?"
586
+ }
587
+ )
588
+ ]
409
589
  }
410
- )
411
- ] }) : /* @__PURE__ */ jsxs2("div", { className: successContainer, children: [
412
- /* @__PURE__ */ jsxs2("p", { className: openingText, children: [
413
- "Opening ",
414
- selectedWallet.name,
415
- "..."
416
- ] }),
417
- /* @__PURE__ */ jsx9("div", { className: separator2 }),
418
- /* @__PURE__ */ jsx9("p", { className: confirmText, children: "Please confirm the connection in your wallet" })
419
- ] }) })
420
- ] });
421
- }
422
-
423
- // src/utils/stateStorage.ts
424
- function createInMemoryStore() {
425
- const store = /* @__PURE__ */ new Map();
426
- return {
427
- getItem(key) {
428
- return store.get(key);
429
- },
430
- setItem(key, value) {
431
- store.set(key, value);
432
- },
433
- removeItem(key) {
434
- store.delete(key);
435
- }
436
- };
437
- }
438
-
439
- // src/constants/walletDefaults.ts
440
- var IOTA_WALLET_NAME = "Iota Wallet";
441
- var DEFAULT_STORAGE = typeof window !== "undefined" && window.localStorage ? localStorage : createInMemoryStore();
442
- var DEFAULT_STORAGE_KEY = "iota-dapp-kit:wallet-connection-info";
443
- var DEFAULT_REQUIRED_FEATURES = [
444
- "iota:signTransactionBlock"
445
- ];
446
- var DEFAULT_PREFERRED_WALLETS = [IOTA_WALLET_NAME];
447
- var WALLET_CHROME_EXTENSION_ID = "TODO";
448
- var WALLET_DOWNLOAD_URL = "https://chromewebstore.google.com/detail/" + WALLET_CHROME_EXTENSION_ID;
449
-
450
- // src/components/icons/ArrowTopRightIcon.tsx
451
- import { jsx as jsx10 } from "react/jsx-runtime";
452
- function ArrowTopRightIcon(props) {
453
- return /* @__PURE__ */ jsx10(
454
- "svg",
455
- {
456
- xmlns: "http://www.w3.org/2000/svg",
457
- width: "24",
458
- height: "24",
459
- viewBox: "0 0 24 24",
460
- fill: "none",
461
- ...props,
462
- children: /* @__PURE__ */ jsx10(
463
- "path",
590
+ ),
591
+ /* @__PURE__ */ jsxs6(
592
+ "div",
464
593
  {
465
- d: "M17.4825 6.29014C17.3873 6.19563 17.2778 6.12421 17.161 6.07588C17.0431 6.02699 16.9138 6 16.7782 6L8.70711 6C8.15482 6 7.70711 6.44772 7.70711 7C7.70711 7.55228 8.15482 8 8.70711 8L14.364 8L6.29289 16.0711C5.90237 16.4616 5.90237 17.0948 6.29289 17.4853C6.68342 17.8758 7.31658 17.8758 7.70711 17.4853L15.7782 9.41421V15.0711C15.7782 15.6234 16.2259 16.0711 16.7782 16.0711C17.3305 16.0711 17.7782 15.6234 17.7782 15.0711L17.7782 7.0008C17.7782 6.86458 17.7509 6.73391 17.7016 6.61556C17.6531 6.49895 17.5816 6.38966 17.487 6.29464L17.4853 6.29289L17.4825 6.29014Z",
466
- fill: "currentColor"
594
+ className: clsx6(viewContainer, {
595
+ [selectedViewContainer]: !!currentView
596
+ }),
597
+ children: [
598
+ /* @__PURE__ */ jsx15("div", { className: backButtonContainer, children: /* @__PURE__ */ jsx15(
599
+ IconButton,
600
+ {
601
+ type: "button",
602
+ "aria-label": "Back",
603
+ onClick: () => resetSelection(),
604
+ children: /* @__PURE__ */ jsx15(BackIcon, {})
605
+ }
606
+ ) }),
607
+ modalContent
608
+ ]
467
609
  }
468
- )
469
- }
470
- );
471
- }
472
-
473
- // src/components/icons/IotaIcon.tsx
474
- import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
475
- function IotaIcon(props) {
476
- return /* @__PURE__ */ jsxs3(
477
- "svg",
478
- {
479
- xmlns: "http://www.w3.org/2000/svg",
480
- width: "24",
481
- height: "24",
482
- viewBox: "0 0 24 24",
483
- fill: "none",
484
- ...props,
485
- children: [
486
- /* @__PURE__ */ jsx11(
487
- "path",
488
- {
489
- d: "M18.2698 2.25899C18.2698 2.95431 17.7023 3.51797 17.0023 3.51797C16.3024 3.51797 15.7349 2.95431 15.7349 2.25899C15.7349 1.56367 16.3024 1 17.0023 1C17.7023 1 18.2698 1.56367 18.2698 2.25899Z",
490
- fill: "currentColor"
491
- }
492
- ),
493
- /* @__PURE__ */ jsx11(
494
- "path",
495
- {
496
- d: "M19.6946 20.0436C19.6946 20.7389 19.1272 21.3026 18.4272 21.3026C17.7272 21.3026 17.1598 20.7389 17.1598 20.0436C17.1598 19.3483 17.7272 18.7846 18.4272 18.7846C19.1272 18.7846 19.6946 19.3483 19.6946 20.0436Z",
497
- fill: "currentColor"
498
- }
499
- ),
500
- /* @__PURE__ */ jsx11(
501
- "path",
502
- {
503
- d: "M17.3647 6.66519C17.952 6.66519 18.4282 6.19222 18.4282 5.60878C18.4282 5.02534 17.952 4.55236 17.3647 4.55236C16.7773 4.55236 16.3012 5.02534 16.3012 5.60878C16.3012 6.19222 16.7773 6.66519 17.3647 6.66519Z",
504
- fill: "currentColor"
505
- }
506
- ),
507
- /* @__PURE__ */ jsx11(
508
- "path",
509
- {
510
- d: "M21.2564 6.01379C21.2564 6.59723 20.7802 7.0702 20.1929 7.0702C19.6055 7.0702 19.1294 6.59723 19.1294 6.01379C19.1294 5.43034 19.6055 4.95737 20.1929 4.95737C20.7802 4.95737 21.2564 5.43034 21.2564 6.01379Z",
511
- fill: "currentColor"
512
- }
513
- ),
514
- /* @__PURE__ */ jsx11(
515
- "path",
516
- {
517
- d: "M17.0027 9.34312C17.5028 9.34312 17.9083 8.94036 17.9083 8.44353C17.9083 7.9467 17.5028 7.54394 17.0027 7.54394C16.5026 7.54394 16.0971 7.9467 16.0971 8.44353C16.0971 8.94036 16.5026 9.34312 17.0027 9.34312Z",
518
- fill: "currentColor"
519
- }
520
- ),
521
- /* @__PURE__ */ jsx11(
522
- "path",
523
- {
524
- d: "M20.7373 8.82346C20.7373 9.32029 20.3318 9.72305 19.8317 9.72305C19.3315 9.72305 18.9261 9.32029 18.9261 8.82346C18.9261 8.32663 19.3315 7.92388 19.8317 7.92388C20.3318 7.92388 20.7373 8.32663 20.7373 8.82346Z",
525
- fill: "currentColor"
526
- }
527
- ),
528
- /* @__PURE__ */ jsx11(
529
- "path",
530
- {
531
- d: "M22.0944 10.6007C22.5945 10.6007 23 10.1979 23 9.70111C23 9.20428 22.5945 8.80152 22.0944 8.80152C21.5942 8.80152 21.1888 9.20428 21.1888 9.70111C21.1888 10.1979 21.5942 10.6007 22.0944 10.6007Z",
532
- fill: "currentColor"
533
- }
534
- ),
535
- /* @__PURE__ */ jsx11(
536
- "path",
537
- {
538
- d: "M19.7849 11.0954C19.7849 11.5297 19.4305 11.8817 18.9933 11.8817C18.5562 11.8817 18.2018 11.5297 18.2018 11.0954C18.2018 10.6611 18.5562 10.3091 18.9933 10.3091C19.4305 10.3091 19.7849 10.6611 19.7849 11.0954Z",
539
- fill: "currentColor"
540
- }
541
- ),
542
- /* @__PURE__ */ jsx11(
543
- "path",
544
- {
545
- d: "M16.1651 11.4988C16.6023 11.4988 16.9567 11.1467 16.9567 10.7124C16.9567 10.2782 16.6023 9.92612 16.1651 9.92612C15.7279 9.92612 15.3735 10.2782 15.3735 10.7124C15.3735 11.1467 15.7279 11.4988 16.1651 11.4988Z",
546
- fill: "currentColor"
547
- }
548
- ),
549
- /* @__PURE__ */ jsx11(
550
- "path",
551
- {
552
- d: "M22.0722 11.9708C22.0722 12.405 21.7178 12.7571 21.2806 12.7571C20.8434 12.7571 20.489 12.405 20.489 11.9708C20.489 11.5365 20.8434 11.1845 21.2806 11.1845C21.7178 11.1845 22.0722 11.5365 22.0722 11.9708Z",
553
- fill: "currentColor"
554
- }
555
- ),
556
- /* @__PURE__ */ jsx11(
557
- "path",
558
- {
559
- d: "M17.8618 13.5243C18.2372 13.5243 18.5415 13.222 18.5415 12.849C18.5415 12.4761 18.2372 12.1738 17.8618 12.1738C17.4864 12.1738 17.182 12.4761 17.182 12.849C17.182 13.222 17.4864 13.5243 17.8618 13.5243Z",
560
- fill: "currentColor"
561
- }
562
- ),
563
- /* @__PURE__ */ jsx11(
564
- "path",
565
- {
566
- d: "M20.8296 13.7024C20.8296 14.0753 20.5252 14.3776 20.1498 14.3776C19.7744 14.3776 19.4701 14.0753 19.4701 13.7024C19.4701 13.3294 19.7744 13.0271 20.1498 13.0271C20.5252 13.0271 20.8296 13.3294 20.8296 13.7024Z",
567
- fill: "currentColor"
568
- }
569
- ),
570
- /* @__PURE__ */ jsx11(
571
- "path",
572
- {
573
- d: "M15.0558 13.12C15.4312 13.12 15.7356 12.8177 15.7356 12.4448C15.7356 12.0719 15.4312 11.7695 15.0558 11.7695C14.6804 11.7695 14.3761 12.0719 14.3761 12.4448C14.3761 12.8177 14.6804 13.12 15.0558 13.12Z",
574
- fill: "currentColor"
575
- }
576
- ),
577
- /* @__PURE__ */ jsx11(
578
- "path",
579
- {
580
- d: "M17.1825 14.0625C17.1825 14.3729 16.9292 14.6245 16.6168 14.6245C16.3043 14.6245 16.0511 14.3729 16.0511 14.0625C16.0511 13.7521 16.3043 13.5005 16.6168 13.5005C16.9292 13.5005 17.1825 13.7521 17.1825 14.0625Z",
581
- fill: "currentColor"
582
- }
583
- ),
584
- /* @__PURE__ */ jsx11(
585
- "path",
586
- {
587
- d: "M17.59 16.1771C17.8649 16.1771 18.0878 15.9557 18.0878 15.6826C18.0878 15.4095 17.8649 15.1882 17.59 15.1882C17.3151 15.1882 17.0923 15.4095 17.0923 15.6826C17.0923 15.9557 17.3151 16.1771 17.59 16.1771Z",
588
- fill: "currentColor"
589
- }
590
- ),
591
- /* @__PURE__ */ jsx11(
592
- "path",
593
- {
594
- d: "M16.7985 16.0872C16.7985 16.311 16.6159 16.4924 16.3906 16.4924C16.1654 16.4924 15.9828 16.311 15.9828 16.0872C15.9828 15.8635 16.1654 15.6821 16.3906 15.6821C16.6159 15.6821 16.7985 15.8635 16.7985 16.0872Z",
595
- fill: "currentColor"
596
- }
597
- ),
598
- /* @__PURE__ */ jsx11(
599
- "path",
600
- {
601
- d: "M15.3273 15.3222C15.6022 15.3222 15.825 15.1008 15.825 14.8278C15.825 14.5547 15.6022 14.3333 15.3273 14.3333C15.0524 14.3333 14.8295 14.5547 14.8295 14.8278C14.8295 15.1008 15.0524 15.3222 15.3273 15.3222Z",
602
- fill: "currentColor"
603
- }
604
- ),
605
- /* @__PURE__ */ jsx11(
606
- "path",
607
- {
608
- d: "M14.3535 13.6818C14.3535 13.9922 14.1003 14.2438 13.7878 14.2438C13.4754 14.2438 13.2221 13.9922 13.2221 13.6818C13.2221 13.3714 13.4754 13.1198 13.7878 13.1198C14.1003 13.1198 14.3535 13.3714 14.3535 13.6818Z",
609
- fill: "currentColor"
610
- }
611
- ),
612
- /* @__PURE__ */ jsx11(
613
- "path",
614
- {
615
- d: "M13.7663 10.0159C14.0788 10.0159 14.3321 9.76428 14.3321 9.45391C14.3321 9.14355 14.0788 8.89194 13.7663 8.89194C13.4539 8.89194 13.2006 9.14355 13.2006 9.45391C13.2006 9.76428 13.4539 10.0159 13.7663 10.0159Z",
616
- fill: "currentColor"
617
- }
618
- ),
619
- /* @__PURE__ */ jsx11(
620
- "path",
621
- {
622
- d: "M14.5115 7.54296C14.5115 7.81603 14.2886 8.03741 14.0137 8.03741C13.7388 8.03741 13.516 7.81603 13.516 7.54296C13.516 7.26988 13.7388 7.04851 14.0137 7.04851C14.2886 7.04851 14.5115 7.26988 14.5115 7.54296Z",
623
- fill: "currentColor"
624
- }
625
- ),
626
- /* @__PURE__ */ jsx11(
627
- "path",
628
- {
629
- d: "M14.5576 6.41961C14.7828 6.41961 14.9654 6.23823 14.9654 6.01447C14.9654 5.79072 14.7828 5.60933 14.5576 5.60933C14.3323 5.60933 14.1497 5.79072 14.1497 6.01447C14.1497 6.23823 14.3323 6.41961 14.5576 6.41961Z",
630
- fill: "currentColor"
631
- }
632
- ),
633
- /* @__PURE__ */ jsx11(
634
- "path",
635
- {
636
- d: "M14.1056 5.16003C14.1056 5.4331 13.8827 5.65448 13.6078 5.65448C13.3329 5.65448 13.1101 5.4331 13.1101 5.16003C13.1101 4.88695 13.3329 4.66558 13.6078 4.66558C13.8827 4.66558 14.1056 4.88695 14.1056 5.16003Z",
637
- fill: "currentColor"
638
- }
639
- ),
640
- /* @__PURE__ */ jsx11(
641
- "path",
642
- {
643
- d: "M18.8818 15.4808C19.1943 15.4808 19.4475 15.2292 19.4475 14.9189C19.4475 14.6085 19.1943 14.3569 18.8818 14.3569C18.5694 14.3569 18.3161 14.6085 18.3161 14.9189C18.3161 15.2292 18.5694 15.4808 18.8818 15.4808Z",
644
- fill: "currentColor"
645
- }
646
- ),
647
- /* @__PURE__ */ jsx11(
648
- "path",
649
- {
650
- d: "M12.8827 4.43881C12.8827 4.74918 12.6294 5.00078 12.3169 5.00078C12.0045 5.00078 11.7512 4.74918 11.7512 4.43881C11.7512 4.12845 12.0045 3.87684 12.3169 3.87684C12.6294 3.87684 12.8827 4.12845 12.8827 4.43881Z",
651
- fill: "currentColor"
652
- }
653
- ),
654
- /* @__PURE__ */ jsx11(
655
- "path",
656
- {
657
- d: "M12.7029 7.38447C13.0153 7.38447 13.2686 7.13287 13.2686 6.8225C13.2686 6.51214 13.0153 6.26053 12.7029 6.26053C12.3904 6.26053 12.1371 6.51214 12.1371 6.8225C12.1371 7.13287 12.3904 7.38447 12.7029 7.38447Z",
658
- fill: "currentColor"
659
- }
660
- ),
661
- /* @__PURE__ */ jsx11(
662
- "path",
663
- {
664
- d: "M12.7485 8.98132C12.7485 9.35424 12.4442 9.65656 12.0688 9.65656C11.6934 9.65656 11.389 9.35424 11.389 8.98132C11.389 8.6084 11.6934 8.30609 12.0688 8.30609C12.4442 8.30609 12.7485 8.6084 12.7485 8.98132Z",
665
- fill: "currentColor"
666
- }
667
- ),
668
- /* @__PURE__ */ jsx11(
669
- "path",
670
- {
671
- d: "M10.0077 9.65685C10.4448 9.65685 10.7992 9.3048 10.7992 8.87053C10.7992 8.43626 10.4448 8.08421 10.0077 8.08421C9.57049 8.08421 9.21609 8.43626 9.21609 8.87053C9.21609 9.3048 9.57049 9.65685 10.0077 9.65685Z",
672
- fill: "currentColor"
673
- }
674
- ),
675
- /* @__PURE__ */ jsx11(
676
- "path",
677
- {
678
- d: "M8.51443 9.29686C8.51443 9.79369 8.10898 10.1964 7.60883 10.1964C7.10868 10.1964 6.70323 9.79369 6.70323 9.29686C6.70323 8.80003 7.10868 8.39727 7.60883 8.39727C8.10898 8.39727 8.51443 8.80003 8.51443 9.29686Z",
679
- fill: "currentColor"
680
- }
681
- ),
682
- /* @__PURE__ */ jsx11(
683
- "path",
684
- {
685
- d: "M4.98453 11.4774C5.57188 11.4774 6.04801 11.0044 6.04801 10.421C6.04801 9.83755 5.57188 9.36458 4.98453 9.36458C4.39719 9.36458 3.92105 9.83755 3.92105 10.421C3.92105 11.0044 4.39719 11.4774 4.98453 11.4774Z",
686
- fill: "currentColor"
687
- }
688
- ),
689
- /* @__PURE__ */ jsx11(
690
- "path",
691
- {
692
- d: "M3.53481 12.3773C3.53481 13.0726 2.96737 13.6363 2.2674 13.6363C1.56744 13.6363 1 13.0726 1 12.3773C1 11.682 1.56744 11.1183 2.2674 11.1183C2.96737 11.1183 3.53481 11.682 3.53481 12.3773Z",
693
- fill: "currentColor"
694
- }
695
- ),
696
- /* @__PURE__ */ jsx11(
697
- "path",
698
- {
699
- d: "M3.92108 8.846C4.50842 8.846 4.98455 8.37303 4.98455 7.78959C4.98455 7.20614 4.50842 6.73317 3.92108 6.73317C3.33373 6.73317 2.8576 7.20614 2.8576 7.78959C2.8576 8.37303 3.33373 8.846 3.92108 8.846Z",
700
- fill: "currentColor"
701
- }
702
- ),
703
- /* @__PURE__ */ jsx11(
704
- "path",
705
- {
706
- d: "M7.45097 6.66545C7.45097 7.16228 7.04552 7.56504 6.54537 7.56504C6.04522 7.56504 5.63977 7.16228 5.63977 6.66545C5.63977 6.16862 6.04522 5.76586 6.54537 5.76586C7.04552 5.76586 7.45097 6.16862 7.45097 6.66545Z",
707
- fill: "currentColor"
708
- }
709
- ),
710
- /* @__PURE__ */ jsx11(
711
- "path",
712
- {
713
- d: "M6.16173 5.18211C6.66188 5.18211 7.06733 4.77935 7.06733 4.28252C7.06733 3.78569 6.66188 3.38293 6.16173 3.38293C5.66158 3.38293 5.25613 3.78569 5.25613 4.28252C5.25613 4.77935 5.66158 5.18211 6.16173 5.18211Z",
714
- fill: "currentColor"
715
- }
716
- ),
717
- /* @__PURE__ */ jsx11(
718
- "path",
719
- {
720
- d: "M9.35214 3.85619C9.35214 4.29046 8.99774 4.64251 8.56057 4.64251C8.12339 4.64251 7.76899 4.29046 7.76899 3.85619C7.76899 3.42192 8.12339 3.06987 8.56057 3.06987C8.99774 3.06987 9.35214 3.42192 9.35214 3.85619Z",
721
- fill: "currentColor"
722
- }
723
- ),
724
- /* @__PURE__ */ jsx11(
725
- "path",
726
- {
727
- d: "M10.6194 4.64374C10.9948 4.64374 11.2991 4.34143 11.2991 3.9685C11.2991 3.59558 10.9948 3.29327 10.6194 3.29327C10.244 3.29327 9.93964 3.59558 9.93964 3.9685C9.93964 4.34143 10.244 4.64374 10.6194 4.64374Z",
728
- fill: "currentColor"
729
- }
730
- ),
731
- /* @__PURE__ */ jsx11(
732
- "path",
733
- {
734
- d: "M11.6828 6.3522C11.6828 6.72512 11.3784 7.02743 11.003 7.02743C10.6276 7.02743 10.3233 6.72512 10.3233 6.3522C10.3233 5.97927 10.6276 5.67696 11.003 5.67696C11.3784 5.67696 11.6828 5.97927 11.6828 6.3522Z",
735
- fill: "currentColor"
736
- }
737
- ),
738
- /* @__PURE__ */ jsx11(
739
- "path",
740
- {
741
- d: "M8.94421 7.04748C9.38139 7.04748 9.73579 6.69543 9.73579 6.26116C9.73579 5.82688 9.38139 5.47484 8.94421 5.47484C8.50703 5.47484 8.15263 5.82688 8.15263 6.26116C8.15263 6.69543 8.50703 7.04748 8.94421 7.04748Z",
742
- fill: "currentColor"
743
- }
744
- ),
745
- /* @__PURE__ */ jsx11(
746
- "path",
747
- {
748
- d: "M7.1115 12.6253C7.1115 12.849 6.9289 13.0304 6.70365 13.0304C6.4784 13.0304 6.2958 12.849 6.2958 12.6253C6.2958 12.4015 6.4784 12.2201 6.70365 12.2201C6.9289 12.2201 7.1115 12.4015 7.1115 12.6253Z",
749
- fill: "currentColor"
750
- }
751
- ),
752
- /* @__PURE__ */ jsx11(
753
- "path",
754
- {
755
- d: "M8.33273 12.8261C8.60763 12.8261 8.83048 12.6047 8.83048 12.3316C8.83048 12.0585 8.60763 11.8372 8.33273 11.8372C8.05782 11.8372 7.83497 12.0585 7.83497 12.3316C7.83497 12.6047 8.05782 12.8261 8.33273 12.8261Z",
756
- fill: "currentColor"
757
- }
758
- ),
759
- /* @__PURE__ */ jsx11(
760
- "path",
761
- {
762
- d: "M10.6874 11.5899C10.6874 11.9003 10.4342 12.1519 10.1217 12.1519C9.80928 12.1519 9.55599 11.9003 9.55599 11.5899C9.55599 11.2795 9.80928 11.0279 10.1217 11.0279C10.4342 11.0279 10.6874 11.2795 10.6874 11.5899Z",
763
- fill: "currentColor"
764
- }
765
- ),
766
- /* @__PURE__ */ jsx11(
767
- "path",
768
- {
769
- d: "M10.5519 13.9513C10.9273 13.9513 11.2316 13.649 11.2316 13.2761C11.2316 12.9031 10.9273 12.6008 10.5519 12.6008C10.1764 12.6008 9.87212 12.9031 9.87212 13.2761C9.87212 13.649 10.1764 13.9513 10.5519 13.9513Z",
770
- fill: "currentColor"
771
- }
772
- ),
773
- /* @__PURE__ */ jsx11(
774
- "path",
775
- {
776
- d: "M8.94418 13.8163C8.94418 14.1267 8.69089 14.3783 8.37845 14.3783C8.06601 14.3783 7.81272 14.1267 7.81272 13.8163C7.81272 13.5059 8.06601 13.2543 8.37845 13.2543C8.69089 13.2543 8.94418 13.5059 8.94418 13.8163Z",
777
- fill: "currentColor"
778
- }
779
- ),
780
- /* @__PURE__ */ jsx11(
781
- "path",
782
- {
783
- d: "M6.45595 14.3542C6.73085 14.3542 6.9537 14.1328 6.9537 13.8597C6.9537 13.5866 6.73085 13.3653 6.45595 13.3653C6.18105 13.3653 5.95819 13.5866 5.95819 13.8597C5.95819 14.1328 6.18105 14.3542 6.45595 14.3542Z",
784
- fill: "currentColor"
785
- }
786
- ),
787
- /* @__PURE__ */ jsx11(
788
- "path",
789
- {
790
- d: "M7.04361 15.3451C7.04361 15.6555 6.79033 15.9071 6.47788 15.9071C6.16544 15.9071 5.91216 15.6555 5.91216 15.3451C5.91216 15.0348 6.16544 14.7832 6.47788 14.7832C6.79033 14.7832 7.04361 15.0348 7.04361 15.3451Z",
791
- fill: "currentColor"
792
- }
793
- ),
794
- /* @__PURE__ */ jsx11(
795
- "path",
796
- {
797
- d: "M8.78634 16.1997C9.16176 16.1997 9.46609 15.8974 9.46609 15.5245C9.46609 15.1516 9.16176 14.8493 8.78634 14.8493C8.41093 14.8493 8.10659 15.1516 8.10659 15.5245C8.10659 15.8974 8.41093 16.1997 8.78634 16.1997Z",
798
- fill: "currentColor"
799
- }
800
- ),
801
- /* @__PURE__ */ jsx11(
802
- "path",
803
- {
804
- d: "M12.2709 15.1196C12.2709 15.5539 11.9165 15.906 11.4793 15.906C11.0421 15.906 10.6877 15.5539 10.6877 15.1196C10.6877 14.6854 11.0421 14.3333 11.4793 14.3333C11.9165 14.3333 12.2709 14.6854 12.2709 15.1196Z",
805
- fill: "currentColor"
806
- }
807
- ),
808
- /* @__PURE__ */ jsx11(
809
- "path",
810
- {
811
- d: "M13.0642 17.8635C13.5644 17.8635 13.9698 17.4607 13.9698 16.9639C13.9698 16.4671 13.5644 16.0643 13.0642 16.0643C12.5641 16.0643 12.1586 16.4671 12.1586 16.9639C12.1586 17.4607 12.5641 17.8635 13.0642 17.8635Z",
812
- fill: "currentColor"
813
- }
814
- ),
815
- /* @__PURE__ */ jsx11(
816
- "path",
817
- {
818
- d: "M10.5276 17.3445C10.5276 17.7788 10.1732 18.1308 9.73605 18.1308C9.29887 18.1308 8.94447 17.7788 8.94447 17.3445C8.94447 16.9103 9.29887 16.5582 9.73605 16.5582C10.1732 16.5582 10.5276 16.9103 10.5276 17.3445Z",
819
- fill: "currentColor"
820
- }
821
- ),
822
- /* @__PURE__ */ jsx11(
823
- "path",
824
- {
825
- d: "M7.8585 19.6612C8.29568 19.6612 8.65008 19.3092 8.65008 18.8749C8.65008 18.4406 8.29568 18.0886 7.8585 18.0886C7.42132 18.0886 7.06692 18.4406 7.06692 18.8749C7.06692 19.3092 7.42132 19.6612 7.8585 19.6612Z",
826
- fill: "currentColor"
827
- }
828
- ),
829
- /* @__PURE__ */ jsx11(
830
- "path",
831
- {
832
- d: "M10.3252 20.7404C10.3252 21.2372 9.91977 21.64 9.41962 21.64C8.91947 21.64 8.51402 21.2372 8.51402 20.7404C8.51402 20.2436 8.91947 19.8408 9.41962 19.8408C9.91977 19.8408 10.3252 20.2436 10.3252 20.7404Z",
833
- fill: "currentColor"
834
- }
835
- ),
836
- /* @__PURE__ */ jsx11(
837
- "path",
838
- {
839
- d: "M13.5843 22C14.1716 22 14.6477 21.527 14.6477 20.9436C14.6477 20.3601 14.1716 19.8872 13.5843 19.8872C12.9969 19.8872 12.5208 20.3601 12.5208 20.9436C12.5208 21.527 12.9969 22 13.5843 22Z",
840
- fill: "currentColor"
841
- }
842
- ),
843
- /* @__PURE__ */ jsx11(
844
- "path",
845
- {
846
- d: "M12.2051 19.2123C12.2051 19.7091 11.7996 20.1119 11.2995 20.1119C10.7993 20.1119 10.3939 19.7091 10.3939 19.2123C10.3939 18.7155 10.7993 18.3127 11.2995 18.3127C11.7996 18.3127 12.2051 18.7155 12.2051 19.2123Z",
847
- fill: "currentColor"
848
- }
849
- ),
850
- /* @__PURE__ */ jsx11(
851
- "path",
852
- {
853
- d: "M15.3275 19.7516C15.9149 19.7516 16.391 19.2786 16.391 18.6951C16.391 18.1117 15.9149 17.6387 15.3275 17.6387C14.7402 17.6387 14.2641 18.1117 14.2641 18.6951C14.2641 19.2786 14.7402 19.7516 15.3275 19.7516Z",
854
- fill: "currentColor"
855
- }
856
- ),
857
- /* @__PURE__ */ jsx11(
858
- "path",
859
- {
860
- d: "M7.58701 17.0534C7.58701 17.4263 7.28268 17.7286 6.90726 17.7286C6.53185 17.7286 6.22751 17.4263 6.22751 17.0534C6.22751 16.6804 6.53185 16.3781 6.90726 16.3781C7.28268 16.3781 7.58701 16.6804 7.58701 17.0534Z",
861
- fill: "currentColor"
862
- }
863
- )
864
- ]
865
- }
866
- );
867
- }
868
-
869
- // src/components/connect-modal/views/GetTheWallet.css.ts
870
- var button = "GetTheWallet_button__1iomrym3";
871
- var container4 = "GetTheWallet_container__1iomrym0";
872
- var content2 = "GetTheWallet_content__1iomrym1";
873
- var icon = "GetTheWallet_icon__1iomrym4";
874
- var text = "GetTheWallet_text__1iomrym2";
875
-
876
- // src/components/connect-modal/views/GetTheWallet.tsx
877
- import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
878
- function GetTheWalletView() {
879
- return /* @__PURE__ */ jsxs4("div", { className: container4, children: [
880
- /* @__PURE__ */ jsxs4("div", { className: content2, children: [
881
- /* @__PURE__ */ jsx12(IotaIcon, { className: icon, width: 48, height: 48 }),
882
- /* @__PURE__ */ jsx12("p", { className: text, children: "Don't have a wallet yet?" })
883
- ] }),
884
- /* @__PURE__ */ jsx12("a", { href: WALLET_DOWNLOAD_URL, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxs4(Button, { size: "md", variant: "primary", className: button, children: [
885
- "Get the IOTA wallet",
886
- /* @__PURE__ */ jsx12(ArrowTopRightIcon, { width: 16, height: 16 })
887
- ] }) })
888
- ] });
889
- }
890
-
891
- // src/components/connect-modal/ConnectModal.tsx
892
- import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
893
- function ConnectModal({ trigger, open, defaultOpen, onOpenChange }) {
894
- const wallets = useWallets();
895
- const [isModalOpen, setModalOpen] = useState2(open ?? defaultOpen);
896
- const handleOpenChange = (open2) => {
897
- setModalOpen(open2);
898
- onOpenChange?.(open2);
899
- };
900
- return /* @__PURE__ */ jsxs5(Dialog.Root, { open: open ?? isModalOpen, onOpenChange: handleOpenChange, children: [
901
- /* @__PURE__ */ jsx13(Dialog.Trigger, { asChild: true, children: trigger }),
902
- /* @__PURE__ */ jsx13(Dialog.Portal, { children: /* @__PURE__ */ jsx13(StyleMarker, { children: /* @__PURE__ */ jsx13(Dialog.Overlay, { className: overlay, children: /* @__PURE__ */ jsxs5(Dialog.Content, { className: content, "aria-describedby": void 0, children: [
903
- /* @__PURE__ */ jsxs5("div", { className: walletListContent, children: [
904
- /* @__PURE__ */ jsx13(Dialog.Title, { className: title, asChild: true, children: /* @__PURE__ */ jsx13(Heading, { as: "h2", children: "Connect a Wallet" }) }),
905
- /* @__PURE__ */ jsx13("div", { className: separator }),
906
- wallets?.length ? /* @__PURE__ */ jsx13(
907
- WalletConnectListView,
908
- {
909
- wallets,
910
- onOpenChange: handleOpenChange
911
- }
912
- ) : /* @__PURE__ */ jsx13(GetTheWalletView, {})
913
- ] }),
914
- /* @__PURE__ */ jsx13(Dialog.Close, { className: closeButtonContainer, asChild: true, children: /* @__PURE__ */ jsx13(IconButton, { type: "button", "aria-label": "Close", children: /* @__PURE__ */ jsx13(CloseIcon, {}) }) })
610
+ ),
611
+ /* @__PURE__ */ jsx15(Dialog.Close, { className: closeButtonContainer, asChild: true, children: /* @__PURE__ */ jsx15(IconButton, { type: "button", "aria-label": "Close", children: /* @__PURE__ */ jsx15(CloseIcon, {}) }) })
915
612
  ] }) }) }) })
916
613
  ] });
917
614
  }
@@ -924,7 +621,7 @@ function useCurrentAccount() {
924
621
  // src/components/AccountDropdownMenu.tsx
925
622
  import { formatAddress } from "@iota/iota-sdk/utils";
926
623
  import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
927
- import clsx6 from "clsx";
624
+ import clsx7 from "clsx";
928
625
 
929
626
  // src/hooks/wallet/useAccounts.ts
930
627
  function useAccounts() {
@@ -947,31 +644,35 @@ var WalletAccountNotFoundError = class extends Error {
947
644
  // src/hooks/wallet/useCurrentWallet.ts
948
645
  function useCurrentWallet() {
949
646
  const currentWallet = useWalletStore((state) => state.currentWallet);
950
- const connectionStatus = useWalletStore((state) => state.connectionStatus);
951
- switch (connectionStatus) {
647
+ const connectionStatus2 = useWalletStore((state) => state.connectionStatus);
648
+ const supportedIntents = useWalletStore((state) => state.supportedIntents);
649
+ switch (connectionStatus2) {
952
650
  case "connecting":
953
651
  return {
954
- connectionStatus,
652
+ connectionStatus: connectionStatus2,
955
653
  currentWallet: null,
956
654
  isDisconnected: false,
957
655
  isConnecting: true,
958
- isConnected: false
656
+ isConnected: false,
657
+ supportedIntents: []
959
658
  };
960
659
  case "disconnected":
961
660
  return {
962
- connectionStatus,
661
+ connectionStatus: connectionStatus2,
963
662
  currentWallet: null,
964
663
  isDisconnected: true,
965
664
  isConnecting: false,
966
- isConnected: false
665
+ isConnected: false,
666
+ supportedIntents: []
967
667
  };
968
668
  case "connected": {
969
669
  return {
970
- connectionStatus,
670
+ connectionStatus: connectionStatus2,
971
671
  currentWallet,
972
672
  isDisconnected: false,
973
673
  isConnecting: false,
974
- isConnected: true
674
+ isConnected: true,
675
+ supportedIntents
975
676
  };
976
677
  }
977
678
  }
@@ -1034,88 +735,51 @@ function useSwitchAccount({
1034
735
 
1035
736
  // src/components/AccountDropdownMenu.css.ts
1036
737
  var connectedAccount = "AccountDropdownMenu_connectedAccount__1x0gmpf0";
1037
- var icon2 = "AccountDropdownMenu_icon__1x0gmpf2";
1038
- var menuContainer = "AccountDropdownMenu_menuContainer__1x0gmpf1";
1039
- var menuContent = "AccountDropdownMenu_menuContent__1x0gmpf3";
1040
- var menuItem = "AccountDropdownMenu_menuItem__1x0gmpf4";
1041
- var separator3 = "AccountDropdownMenu_separator__1x0gmpf6";
1042
- var switchAccountMenuItem = "AccountDropdownMenu_switchAccountMenuItem__1x0gmpf5";
1043
-
1044
- // src/components/icons/CheckIcon.tsx
1045
- import { jsx as jsx14 } from "react/jsx-runtime";
1046
- function CheckIcon(props) {
1047
- return /* @__PURE__ */ jsx14("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", ...props, children: /* @__PURE__ */ jsx14(
1048
- "path",
1049
- {
1050
- fill: "currentColor",
1051
- d: "m11.726 5.048-4.73 5.156-1.722-1.879a.72.72 0 0 0-.529-.23.722.722 0 0 0-.525.24.858.858 0 0 0-.22.573.86.86 0 0 0 .211.576l2.255 2.458c.14.153.332.24.53.24.2 0 .391-.087.532-.24l5.261-5.735A.86.86 0 0 0 13 5.63a.858.858 0 0 0-.22-.572.722.722 0 0 0-.525-.24.72.72 0 0 0-.529.23Z"
1052
- }
1053
- ) });
1054
- }
1055
-
1056
- // src/components/icons/ChevronIcon.tsx
1057
- import { jsx as jsx15 } from "react/jsx-runtime";
1058
- function ChevronIcon(props) {
1059
- return /* @__PURE__ */ jsx15("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", ...props, children: /* @__PURE__ */ jsx15(
1060
- "path",
1061
- {
1062
- stroke: "#A0B6C3",
1063
- strokeLinecap: "round",
1064
- strokeLinejoin: "round",
1065
- strokeWidth: 1.5,
1066
- d: "m4 6 4 4 4-4"
1067
- }
1068
- ) });
1069
- }
1070
-
1071
- // src/components/ui/Text.tsx
1072
- import { Slot as Slot5 } from "@radix-ui/react-slot";
1073
- import clsx5 from "clsx";
1074
- import { forwardRef as forwardRef5 } from "react";
1075
-
1076
- // src/components/ui/Text.css.ts
1077
- import { createRuntimeFn as _7a4683 } from "@vanilla-extract/recipes/createRuntimeFn";
1078
- var textVariants = _7a4683({ defaultClassName: "Text__aprhbd0", variantClassNames: { size: { sm: "Text_textVariants_size_sm__aprhbd1" }, weight: { normal: "Text_textVariants_weight_normal__aprhbd2", medium: "Text_textVariants_weight_medium__aprhbd3", bold: "Text_textVariants_weight_bold__aprhbd4" }, color: { body: "Text_textVariants_color_body__aprhbd5", muted: "Text_textVariants_color_muted__aprhbd6", danger: "Text_textVariants_color_danger__aprhbd7" }, mono: { true: "Text_textVariants_mono_true__aprhbd8" } }, defaultVariants: { size: "sm", weight: "normal" }, compoundVariants: [] });
1079
-
1080
- // src/components/ui/Text.tsx
1081
- import { jsx as jsx16 } from "react/jsx-runtime";
1082
- var Text = forwardRef5(
1083
- ({
1084
- children,
1085
- className,
1086
- asChild = false,
1087
- as: Tag = "div",
1088
- size,
1089
- weight,
1090
- color,
1091
- mono,
1092
- ...textProps
1093
- }, forwardedRef) => {
1094
- return /* @__PURE__ */ jsx16(
1095
- Slot5,
1096
- {
1097
- ...textProps,
1098
- ref: forwardedRef,
1099
- className: clsx5(textVariants({ size, weight, color, mono }), className),
1100
- children: asChild ? children : /* @__PURE__ */ jsx16(Tag, { children })
1101
- }
1102
- );
1103
- }
1104
- );
1105
- Text.displayName = "Text";
738
+ var menuContainer = "AccountDropdownMenu_menuContainer__1x0gmpf1";
739
+ var menuContent = "AccountDropdownMenu_menuContent__1x0gmpf2";
740
+ var menuItem = "AccountDropdownMenu_menuItem__1x0gmpf3";
741
+ var separator = "AccountDropdownMenu_separator__1x0gmpf5";
742
+ var switchAccountMenuItem = "AccountDropdownMenu_switchAccountMenuItem__1x0gmpf4";
743
+
744
+ // src/components/icons/CheckIcon.tsx
745
+ import { jsx as jsx16 } from "react/jsx-runtime";
746
+ function CheckIcon(props) {
747
+ return /* @__PURE__ */ jsx16("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", ...props, children: /* @__PURE__ */ jsx16(
748
+ "path",
749
+ {
750
+ fill: "currentColor",
751
+ d: "m11.726 5.048-4.73 5.156-1.722-1.879a.72.72 0 0 0-.529-.23.722.722 0 0 0-.525.24.858.858 0 0 0-.22.573.86.86 0 0 0 .211.576l2.255 2.458c.14.153.332.24.53.24.2 0 .391-.087.532-.24l5.261-5.735A.86.86 0 0 0 13 5.63a.858.858 0 0 0-.22-.572.722.722 0 0 0-.525-.24.72.72 0 0 0-.529.23Z"
752
+ }
753
+ ) });
754
+ }
755
+
756
+ // src/components/icons/ChevronIcon.tsx
757
+ import { jsx as jsx17 } from "react/jsx-runtime";
758
+ function ChevronIcon(props) {
759
+ return /* @__PURE__ */ jsx17("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", ...props, children: /* @__PURE__ */ jsx17(
760
+ "path",
761
+ {
762
+ stroke: "#A0B6C3",
763
+ strokeLinecap: "round",
764
+ strokeLinejoin: "round",
765
+ strokeWidth: 1.5,
766
+ d: "m4 6 4 4 4-4"
767
+ }
768
+ ) });
769
+ }
1106
770
 
1107
771
  // src/components/AccountDropdownMenu.tsx
1108
- import { jsx as jsx17, jsxs as jsxs6 } from "react/jsx-runtime";
1109
- function AccountDropdownMenu({ currentAccount }) {
772
+ import { jsx as jsx18, jsxs as jsxs7 } from "react/jsx-runtime";
773
+ function AccountDropdownMenu({ currentAccount, size = "lg" }) {
1110
774
  const { mutate: disconnectWallet } = useDisconnectWallet();
1111
775
  const accounts = useAccounts();
1112
- return /* @__PURE__ */ jsxs6(DropdownMenu.Root, { modal: false, children: [
1113
- /* @__PURE__ */ jsx17(StyleMarker, { children: /* @__PURE__ */ jsx17(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { size: "md", className: connectedAccount, children: [
1114
- /* @__PURE__ */ jsx17(Text, { children: currentAccount.label ?? formatAddress(currentAccount.address) }),
1115
- /* @__PURE__ */ jsx17(ChevronIcon, { className: icon2 })
776
+ return /* @__PURE__ */ jsxs7(DropdownMenu.Root, { modal: false, children: [
777
+ /* @__PURE__ */ jsx18(StyleMarker, { children: /* @__PURE__ */ jsx18(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs7(Button, { size, className: connectedAccount, children: [
778
+ /* @__PURE__ */ jsx18(Text, { mono: true, weight: "bold", children: currentAccount.label ?? formatAddress(currentAccount.address) }),
779
+ /* @__PURE__ */ jsx18(ChevronIcon, {})
1116
780
  ] }) }) }),
1117
- /* @__PURE__ */ jsx17(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx17(StyleMarker, { className: menuContainer, children: /* @__PURE__ */ jsxs6(DropdownMenu.Content, { className: menuContent, children: [
1118
- accounts.map((account) => /* @__PURE__ */ jsx17(
781
+ /* @__PURE__ */ jsx18(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx18(StyleMarker, { className: menuContainer, children: /* @__PURE__ */ jsxs7(DropdownMenu.Content, { className: menuContent, children: [
782
+ accounts.map((account) => /* @__PURE__ */ jsx18(
1119
783
  AccountDropdownMenuItem,
1120
784
  {
1121
785
  account,
@@ -1123,11 +787,11 @@ function AccountDropdownMenu({ currentAccount }) {
1123
787
  },
1124
788
  account.address
1125
789
  )),
1126
- /* @__PURE__ */ jsx17(DropdownMenu.Separator, { className: separator3 }),
1127
- /* @__PURE__ */ jsx17(
790
+ /* @__PURE__ */ jsx18(DropdownMenu.Separator, { className: separator }),
791
+ /* @__PURE__ */ jsx18(
1128
792
  DropdownMenu.Item,
1129
793
  {
1130
- className: clsx6(menuItem),
794
+ className: clsx7(menuItem),
1131
795
  onSelect: () => disconnectWallet(),
1132
796
  children: "Disconnect"
1133
797
  }
@@ -1140,38 +804,42 @@ function AccountDropdownMenuItem({
1140
804
  active
1141
805
  }) {
1142
806
  const { mutate: switchAccount } = useSwitchAccount();
1143
- return /* @__PURE__ */ jsxs6(
807
+ return /* @__PURE__ */ jsxs7(
1144
808
  DropdownMenu.Item,
1145
809
  {
1146
- className: clsx6(menuItem, switchAccountMenuItem),
810
+ className: clsx7(menuItem, switchAccountMenuItem),
1147
811
  onSelect: () => switchAccount({ account }),
1148
812
  children: [
1149
- /* @__PURE__ */ jsx17(Text, { children: account.label ?? formatAddress(account.address) }),
1150
- active ? /* @__PURE__ */ jsx17(CheckIcon, {}) : null
813
+ /* @__PURE__ */ jsx18(Text, { mono: true, children: account.label ?? formatAddress(account.address) }),
814
+ active ? /* @__PURE__ */ jsx18(CheckIcon, {}) : null
1151
815
  ]
1152
816
  }
1153
817
  );
1154
818
  }
1155
819
 
1156
820
  // src/components/ConnectButton.tsx
1157
- import { jsx as jsx18 } from "react/jsx-runtime";
1158
- function ConnectButton({ connectText = "Connect", ...buttonProps }) {
821
+ import { jsx as jsx19 } from "react/jsx-runtime";
822
+ function ConnectButton({
823
+ connectText = "Connect Wallet",
824
+ size,
825
+ ...buttonProps
826
+ }) {
1159
827
  const currentAccount = useCurrentAccount();
1160
- return currentAccount ? /* @__PURE__ */ jsx18(AccountDropdownMenu, { currentAccount }) : /* @__PURE__ */ jsx18(
828
+ return currentAccount ? /* @__PURE__ */ jsx19(AccountDropdownMenu, { currentAccount, size }) : /* @__PURE__ */ jsx19(
1161
829
  ConnectModal,
1162
830
  {
1163
- trigger: /* @__PURE__ */ jsx18(StyleMarker, { children: /* @__PURE__ */ jsx18(Button, { ...buttonProps, children: connectText }) })
831
+ trigger: /* @__PURE__ */ jsx19(StyleMarker, { children: /* @__PURE__ */ jsx19(Button, { ...buttonProps, size, children: connectText }) })
1164
832
  }
1165
833
  );
1166
834
  }
1167
835
 
1168
836
  // src/components/IotaClientProvider.tsx
1169
837
  import { getNetwork, isIotaClient, Network, IotaClient } from "@iota/iota-sdk/client";
1170
- import { createContext as createContext2, useMemo, useState as useState3 } from "react";
1171
- import { jsx as jsx19 } from "react/jsx-runtime";
838
+ import { createContext as createContext2, useMemo, useState as useState2 } from "react";
839
+ import { jsx as jsx20 } from "react/jsx-runtime";
1172
840
  var IotaClientContext = createContext2(null);
1173
841
  var DEFAULT_NETWORKS = {
1174
- localnet: { url: getNetwork(Network.Local).url }
842
+ localnet: { url: getNetwork(Network.Localnet).url }
1175
843
  };
1176
844
  var DEFAULT_CREATE_CLIENT = function createClient(_name, config) {
1177
845
  if (isIotaClient(config)) {
@@ -1183,7 +851,7 @@ function IotaClientProvider(props) {
1183
851
  const { onNetworkChange, network, children } = props;
1184
852
  const networks = props.networks ?? DEFAULT_NETWORKS;
1185
853
  const createClient2 = props.createClient ?? DEFAULT_CREATE_CLIENT;
1186
- const [selectedNetwork, setSelectedNetwork] = useState3(
854
+ const [selectedNetwork, setSelectedNetwork] = useState2(
1187
855
  props.network ?? props.defaultNetwork ?? Object.keys(networks)[0]
1188
856
  );
1189
857
  const currentNetwork = props.network ?? selectedNetwork;
@@ -1207,15 +875,41 @@ function IotaClientProvider(props) {
1207
875
  }
1208
876
  };
1209
877
  }, [client, networks, selectedNetwork, currentNetwork, network, onNetworkChange]);
1210
- return /* @__PURE__ */ jsx19(IotaClientContext.Provider, { value: ctx, children });
878
+ return /* @__PURE__ */ jsx20(IotaClientContext.Provider, { value: ctx, children });
1211
879
  }
1212
880
 
1213
881
  // src/components/WalletProvider.tsx
1214
882
  import { useRef } from "react";
1215
883
 
884
+ // src/utils/stateStorage.ts
885
+ function createInMemoryStore() {
886
+ const store = /* @__PURE__ */ new Map();
887
+ return {
888
+ getItem(key) {
889
+ return store.get(key);
890
+ },
891
+ setItem(key, value) {
892
+ store.set(key, value);
893
+ },
894
+ removeItem(key) {
895
+ store.delete(key);
896
+ }
897
+ };
898
+ }
899
+
900
+ // src/constants/walletDefaults.ts
901
+ var IOTA_WALLET_NAME = "IOTA Wallet";
902
+ var DEFAULT_STORAGE = typeof window !== "undefined" && window.localStorage ? localStorage : createInMemoryStore();
903
+ var DEFAULT_STORAGE_KEY = "iota-dapp-kit:wallet-connection-info";
904
+ var SIGN_FEATURES = ["iota:signTransaction"];
905
+ var DEFAULT_WALLET_FILTER = (wallet) => SIGN_FEATURES.some((feature) => wallet.features[feature]);
906
+ var DEFAULT_PREFERRED_WALLETS = [IOTA_WALLET_NAME];
907
+ var WALLET_CHROME_EXTENSION_ID = "TODO";
908
+ var WALLET_DOWNLOAD_URL = "https://chromewebstore.google.com/detail/" + WALLET_CHROME_EXTENSION_ID;
909
+
1216
910
  // src/hooks/wallet/useAutoConnectWallet.ts
1217
911
  import { useQuery } from "@tanstack/react-query";
1218
- import { useLayoutEffect, useState as useState4 } from "react";
912
+ import { useLayoutEffect, useState as useState3 } from "react";
1219
913
  function useAutoConnectWallet() {
1220
914
  const { mutateAsync: connectWallet } = useConnectWallet();
1221
915
  const autoConnectEnabled = useWalletStore((state) => state.autoConnectEnabled);
@@ -1225,7 +919,7 @@ function useAutoConnectWallet() {
1225
919
  );
1226
920
  const wallets = useWallets();
1227
921
  const { isConnected } = useCurrentWallet();
1228
- const [clientOnly, setClientOnly] = useState4(false);
922
+ const [clientOnly, setClientOnly] = useState3(false);
1229
923
  useLayoutEffect(() => {
1230
924
  setClientOnly(true);
1231
925
  }, []);
@@ -1290,6 +984,8 @@ function useAutoConnectWallet() {
1290
984
 
1291
985
  // src/hooks/wallet/useUnsafeBurnerWallet.ts
1292
986
  import { Ed25519Keypair } from "@iota/iota-sdk/keypairs/ed25519";
987
+ import { Transaction } from "@iota/iota-sdk/transactions";
988
+ import { toB64 } from "@iota/iota-sdk/utils";
1293
989
  import { getWallets as getWallets2, ReadonlyWalletAccount, SUPPORTED_CHAINS } from "@iota/wallet-standard";
1294
990
  import { useEffect } from "react";
1295
991
 
@@ -1321,7 +1017,7 @@ function useUnsafeBurnerWallet(enabled) {
1321
1017
  }, [enabled, iotaClient]);
1322
1018
  }
1323
1019
  function registerUnsafeBurnerWallet(iotaClient) {
1324
- var _on, _connect, _signPersonalMessage, _signTransactionBlock, _signAndExecuteTransactionBlock;
1020
+ var _on, _connect, _signPersonalMessage, _signTransaction, _signAndExecuteTransaction;
1325
1021
  const walletsApi = getWallets2();
1326
1022
  const registeredWallets = walletsApi.get();
1327
1023
  if (registeredWallets.find((wallet) => wallet.name === WALLET_NAME)) {
@@ -1338,7 +1034,7 @@ function registerUnsafeBurnerWallet(iotaClient) {
1338
1034
  address: keypair.getPublicKey().toIotaAddress(),
1339
1035
  publicKey: keypair.getPublicKey().toIotaBytes(),
1340
1036
  chains: ["iota:unknown"],
1341
- features: ["iota:signAndExecuteTransactionBlock", "iota:signTransactionBlock"]
1037
+ features: ["iota:signTransaction", "iota:signAndExecuteTransaction"]
1342
1038
  });
1343
1039
  class UnsafeBurnerWallet {
1344
1040
  constructor() {
@@ -1353,23 +1049,40 @@ function registerUnsafeBurnerWallet(iotaClient) {
1353
1049
  const { bytes, signature } = await keypair.signPersonalMessage(messageInput.message);
1354
1050
  return { bytes, signature };
1355
1051
  });
1356
- __privateAdd(this, _signTransactionBlock, async (transactionInput) => {
1357
- const { bytes, signature } = await transactionInput.transactionBlock.sign({
1052
+ __privateAdd(this, _signTransaction, async (transactionInput) => {
1053
+ const { bytes, signature } = await Transaction.from(
1054
+ await transactionInput.transaction.toJSON()
1055
+ ).sign({
1358
1056
  client: iotaClient,
1359
1057
  signer: keypair
1360
1058
  });
1059
+ transactionInput.signal?.throwIfAborted();
1361
1060
  return {
1362
- transactionBlockBytes: bytes,
1061
+ bytes,
1363
1062
  signature
1364
1063
  };
1365
1064
  });
1366
- __privateAdd(this, _signAndExecuteTransactionBlock, async (transactionInput) => {
1367
- return await iotaClient.signAndExecuteTransactionBlock({
1368
- signer: keypair,
1369
- transactionBlock: transactionInput.transactionBlock,
1370
- options: transactionInput.options,
1371
- requestType: transactionInput.requestType
1065
+ __privateAdd(this, _signAndExecuteTransaction, async (transactionInput) => {
1066
+ const { bytes, signature } = await Transaction.from(
1067
+ await transactionInput.transaction.toJSON()
1068
+ ).sign({
1069
+ client: iotaClient,
1070
+ signer: keypair
1071
+ });
1072
+ transactionInput.signal?.throwIfAborted();
1073
+ const { rawEffects, digest } = await iotaClient.executeTransactionBlock({
1074
+ signature,
1075
+ transactionBlock: bytes,
1076
+ options: {
1077
+ showRawEffects: true
1078
+ }
1372
1079
  });
1080
+ return {
1081
+ bytes,
1082
+ signature,
1083
+ digest,
1084
+ effects: toB64(new Uint8Array(rawEffects))
1085
+ };
1373
1086
  });
1374
1087
  }
1375
1088
  get version() {
@@ -1381,7 +1094,7 @@ function registerUnsafeBurnerWallet(iotaClient) {
1381
1094
  get icon() {
1382
1095
  return "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAJrElEQVR42tWbe2xT1x3H7UxAyD3XrdrSbGXlUbKWsq5rWdVuVOMRSEqSOmnVRZMmJqZNYv1nf3R/jWmVmVrtRRM/YwPd1nVTNcrE3pQCoikrIRAC4VVNY0hlD9ZOo1uCfe3ra9979v0dcy3s5Pper76Oh/STE+495/4+5/c85zqe2f7HAx5vKsS+monJj/CdHi/f4/HWW4f6AwdblmXjTM0NyS+movKtw9v+j6C5gKhyTMTTpA2x15Qwy+Pz75motOGdgKep8WF5ATgVZIt5NeO2wMqD0hfVGNPh3oYaYflsjG0l63PeyLCDnqbsLpZIhaRNFI+Ox+Le5KB0RybK8gDmJOkI07U4i/FhT1NDQl8Me5rUIfaDfELOJ0NsFa/SJQHm1WLsHcDqRWiy9BCL8s0N5t6UWWFVvxplejYm60hC91cNjPtzCTZsAptCVoeLP8PDDQJNCSodap6H+LtE8ZcdkvVkkD38vwDn4/Jvy4EhBhZSvRaUHiTXn31gJJxkUPoClBKKFizM+inhVA2cYIdM4HJouPvoe9s9H+KzDhyGK6KkmIqitBhww2C11rjQL2L4kgUwFxk8yPyzauUA3Pk/353XnA6zKbKCaQ2UlMvJF6W5uF5F8yHfZWZpC9HRmBziaEpm1bpY9XvhxuWJRldC7Mt03WlZwpjnkZUNa2DMG2EaPj9MGd2l2mofd0hQ7ZSopsXckHxVCUp32fXGdD0ZktrgFUmMqwhcWFjp87RArsD+9bn585IRaSHAKgBL3SZwOTRc8BKg7yYoskp5OJDiiPmF2Sj7ox0siYJ7lJA04EqvzZ9B1xSVt6PlW0IxZgUMJdZYAJuWngLQt9IRuZXmoTEkmci8ZtTXTViUKyasA9FRun5d8z6bfw0gYWm9mmCXxZatQgxfC7I2NVpRYQOxKWppLs4mcgn5NcibgL1K40xYp8CYY5TXEpjcb3LAJ0OZyyg3+2nySm6fjEtzkEz+7VBx3RTb+60z9dma7pkvwO2QQL5HzTtAdpKF7euw/HuzfrosBHy+ZsBimzbQshjWTVMDgez53B5MbjcGbr1ZjdUJOM5O0SLXzJ2R+uOA1dMAVoLsm5zb73JSId8t8Aa1LsAJdoTCrCaw6e3NC2DdFMUXWRg173mysJNOSUNskUJ1cOlXa2LhcbgmSszXYSn9hl3KSxTDjrZ2cbbfbWDyumsh9m3e7zCG7a3ETt+gtI7fx6lEOanZKDVvuA2cjYmt5xNOd2Louz3IQ12UZ2Zo3lkb9cDlvSs6m4Vk5Yqlabs0B97wT7PUuCXQz0Bnt9QxMPTW4iwBtmUlY8hFsHJPlzcQ1xuG75CVK1kXofCUGnU9fg1aVD7kfE9MoabtYkcAvIUYS2op3Hc3TTrDQzIAeojugTVLFolWDR6wFPtY0R66n6HltwjCIawnE2ymresk9NtN+pfUUi0mX6RJLfrh9zMRaRPOqubSA8W2MNzC0mHpK7j2ruuw5mYkxl5+2+HGQeg4yNYg7vNg+xMxFsuRMuiTsRJZG3cysAl4D9n4aC4un8L9qUyVvbCyYwFXX1nGUxFf1cCiEQqy75O+TpMwYKNKSPQUqhLyyWLsRbESLctx0YnixgfphRWA8pOPc+N4F9d+eV9V4OlCX/As5w5g+wtGhJGukp5go2R3D7EW9rSDcnGL56YgJHj+8GcFND/Vy41jj/H0jxc6HU/AA2QlR01UlH3D7CmITQnJq4lVWBi1yl8XYEh278c5H++F+Iui7r7bYR8tH/gbqoJN7fVODUhLYVVxzmYCEyOxFg7RUVa0egCHZZ55eRHnp/tKgMna6s/bbMdTxZgMzl9CCcmq7k690OzDfaeSN4QcsREjsQpgXHwyWyfg9K5WE7hc6JqTWjyihObfygOFOkv6i5K5TZx8LsL1sVS4NL8ItiB7sgAcEKcWHfUCVhK3kUVnBNbfXIs4l5xAv5sJs234eTUy93L0Au2otQOw5ORMyfQ6WwexFupVSHowG6uThXfebmlhWojMS3fazmMeGxEI6S2SUti6RAo2vKohVuH3qUG5FWm/PjH8kzutgSH5g58xrVwzIbZkxHf7OFjFC+wrMDXcpOqOKX/g01U/XPvVJyxdWsiJblqYmnZoWbDxAcR56X5WPuh4ewcL5PY9JBRUYjc7fzjG6Uc3mHBWbg23X1BLaFHOSnrw4bWiNAXSEWcWRntIignXTP/oDsfKZX66mMbZAPfhviU1AyYmJLYAMZa/QXjUSeIiixpj3UUFtd884KytjN7EjdGNNMbWwtlf3FvbQ4OQtIoYSzbxqVDLXMTxP8jnnbiyKcaJLvueGLD6kXW2sKZov1tpn7hwXf3ZUvq0K2FXOM7Op/Xgb6PhxsWIErYGVuK3WGXWkkwMMZVCVl5kWtax5A6usgemvnx4DelUcYcFC0eIbcbXKzggeyBjeXIhkftaKknJKLtnuSg7KmKQsrH+1nqbmLWY6w/tBGy/8xrruR5SM99LLIjfT/4ZbNZnQEPssIVb21rKTGRIPDagNoLdFMKgcuLc/TF6Bulk6c7ovg4TU+XvS6FNw1tDfVqH9MOPmBDui0hcK6wz744FlDjNe0m3aVldJYagtI6YbF+3ZGPsQHlN1vbeh8lJofqJ+uo9Zi4wXZxKFiXKGxbHT7pNq71oNg4Qi6MviE0FpRVqjGXILYoJ4tCjdYU1rWeMdPLc/ochj3B9pGNGL4NupGPRlUl35KMVxFLNO6ZnxYlBsUPqoMkbUqAb6VhMVKQ7MVT1dYdrL8hzEAcjpmvjHKphgaFb0ZVJZw7dwVD9q5fkgPTRbBxnzmGfgRLQsMCkG+moQdcp6GzzZsL2MGyllvBNGWM9RqMCk26kI7aBK526csVShZTfzid6FEzeiNAGP92jpCPQEbrW7EW5MbZxAz/fN9lg0IbQaaxrQ83/VoKPb/HqJx67Hw+43CDQBPsX0gm6ufXNvH4vP9rZapzx7+Nn+oxZAjfo2caZ3n350c5W6FSEdQ86sNarj3c/jRV+H42AXsdGRBfPPIlnb/mUtxzWXfALn/PmRze2Gud6E/xsXwYtnlsWN8Tc5/oyxjn/jvyJrlY82xLUfWuPr/TqxzuXQZkIP9M7CXiyuP4B4WmsTnNhzinjrD+WO9bRhmdZWLXe4EKRtV5tpN3Hx3s2G+d79/MJf4qff0LnE72kfFEs4ITQvWLMab8C131dP9n9Je1Yx000Nz2jAf+UJwCBchc3NvGR1Qx71XXY2Ww1Jvx7YalzAPkX9rp5E5Z+pv+ja8bE43uN491b9dHO9Xx4lUxziLn21Nai/wXWM6t9vkvtrwAAAABJRU5ErkJggg==";
1383
1096
  }
1384
- // Return the Iota chains that your wallet supports.
1097
+ // Return the IOTA chains that your wallet supports.
1385
1098
  get chains() {
1386
1099
  return SUPPORTED_CHAINS;
1387
1100
  }
@@ -1402,13 +1115,13 @@ function registerUnsafeBurnerWallet(iotaClient) {
1402
1115
  version: "1.0.0",
1403
1116
  signPersonalMessage: __privateGet(this, _signPersonalMessage)
1404
1117
  },
1405
- "iota:signTransactionBlock": {
1406
- version: "1.0.0",
1407
- signTransactionBlock: __privateGet(this, _signTransactionBlock)
1118
+ "iota:signTransaction": {
1119
+ version: "2.0.0",
1120
+ signTransaction: __privateGet(this, _signTransaction)
1408
1121
  },
1409
- "iota:signAndExecuteTransactionBlock": {
1410
- version: "1.0.0",
1411
- signAndExecuteTransactionBlock: __privateGet(this, _signAndExecuteTransactionBlock)
1122
+ "iota:signAndExecuteTransaction": {
1123
+ version: "2.0.0",
1124
+ signAndExecuteTransaction: __privateGet(this, _signAndExecuteTransaction)
1412
1125
  }
1413
1126
  };
1414
1127
  }
@@ -1416,8 +1129,8 @@ function registerUnsafeBurnerWallet(iotaClient) {
1416
1129
  _on = new WeakMap();
1417
1130
  _connect = new WeakMap();
1418
1131
  _signPersonalMessage = new WeakMap();
1419
- _signTransactionBlock = new WeakMap();
1420
- _signAndExecuteTransactionBlock = new WeakMap();
1132
+ _signTransaction = new WeakMap();
1133
+ _signAndExecuteTransaction = new WeakMap();
1421
1134
  return walletsApi.register(new UnsafeBurnerWallet());
1422
1135
  }
1423
1136
 
@@ -1442,17 +1155,18 @@ function useWalletPropertiesChanged() {
1442
1155
  // src/hooks/wallet/useWalletsChanged.ts
1443
1156
  import { getWallets as getWallets3 } from "@iota/wallet-standard";
1444
1157
  import { useEffect as useEffect3 } from "react";
1445
- function useWalletsChanged(preferredWallets, requiredFeatures) {
1158
+ function useWalletsChanged(preferredWallets, walletFilter) {
1446
1159
  const setWalletRegistered = useWalletStore((state) => state.setWalletRegistered);
1447
1160
  const setWalletUnregistered = useWalletStore((state) => state.setWalletUnregistered);
1448
1161
  useEffect3(() => {
1449
1162
  const walletsApi = getWallets3();
1163
+ setWalletRegistered(getRegisteredWallets(preferredWallets, walletFilter));
1450
1164
  const unsubscribeFromRegister = walletsApi.on("register", () => {
1451
- setWalletRegistered(getRegisteredWallets(preferredWallets, requiredFeatures));
1165
+ setWalletRegistered(getRegisteredWallets(preferredWallets, walletFilter));
1452
1166
  });
1453
1167
  const unsubscribeFromUnregister = walletsApi.on("unregister", (unregisteredWallet) => {
1454
1168
  setWalletUnregistered(
1455
- getRegisteredWallets(preferredWallets, requiredFeatures),
1169
+ getRegisteredWallets(preferredWallets, walletFilter),
1456
1170
  unregisteredWallet
1457
1171
  );
1458
1172
  });
@@ -1460,38 +1174,38 @@ function useWalletsChanged(preferredWallets, requiredFeatures) {
1460
1174
  unsubscribeFromRegister();
1461
1175
  unsubscribeFromUnregister();
1462
1176
  };
1463
- }, [preferredWallets, requiredFeatures, setWalletRegistered, setWalletUnregistered]);
1177
+ }, [preferredWallets, walletFilter, setWalletRegistered, setWalletUnregistered]);
1464
1178
  }
1465
1179
 
1466
1180
  // src/themes/lightTheme.ts
1467
1181
  var lightTheme = {
1468
1182
  blurs: {
1469
- modalOverlay: "blur(12px)"
1183
+ modalOverlay: "blur(0)"
1470
1184
  },
1471
1185
  backgroundColors: {
1472
- primaryButton: "#DDE4F0",
1473
- primaryButtonHover: "#002F6D14",
1474
- outlineButtonHover: "#002F6D14",
1475
- modalOverlay: "rgba(0, 47, 109, 0.72)",
1476
- modalPrimary: "#ffffff",
1477
- modalSecondary: "#e3eaf6",
1186
+ primaryButton: "#F6F7F9",
1187
+ primaryButtonHover: "#F0F2F5",
1188
+ outlineButtonHover: "#F4F4F5",
1189
+ modalOverlay: "rgba(24 36 53 / 20%)",
1190
+ modalPrimary: "white",
1191
+ modalSecondary: "#F7F8F8",
1478
1192
  iconButton: "transparent",
1479
1193
  dropdownMenu: "#FFFFFF",
1480
- dropdownMenuSeparator: "#002f6d14",
1481
- walletItemSelected: "#EFF4FA",
1482
- walletItemHover: "rgba(0, 103, 238, 0.12)",
1194
+ dropdownMenuSeparator: "#F3F6F8",
1195
+ walletItemSelected: "white",
1196
+ walletItemHover: "#3C424226",
1483
1197
  scrollThumb: "#cad4e2"
1484
1198
  },
1485
1199
  borderColors: {
1486
- outlineButton: "#6E7787"
1200
+ outlineButton: "#E4E4E7"
1487
1201
  },
1488
1202
  colors: {
1489
- primaryButton: "#171D26",
1490
- outlineButtonHover: "#E3EAF6",
1491
- iconButton: "#171D26",
1492
- body: "#171D26",
1493
- bodyMuted: "#545E6E",
1494
- bodyDanger: "#B51431"
1203
+ primaryButton: "#373737",
1204
+ outlineButtonHover: "#373737",
1205
+ iconButton: "#000000",
1206
+ body: "#182435",
1207
+ bodyMuted: "#767A81",
1208
+ bodyDanger: "#FF794B"
1495
1209
  },
1496
1210
  radii: {
1497
1211
  small: "6px",
@@ -1514,8 +1228,8 @@ var lightTheme = {
1514
1228
  typography: {
1515
1229
  fontFamily: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
1516
1230
  fontStyle: "normal",
1517
- lineHeight: "24px",
1518
- letterSpacing: "0.1px"
1231
+ lineHeight: "1.3",
1232
+ letterSpacing: "1"
1519
1233
  },
1520
1234
  spacing: {
1521
1235
  xxsmall: "4px",
@@ -1547,19 +1261,21 @@ function createWalletStore({
1547
1261
  lastConnectedAccountAddress: null,
1548
1262
  lastConnectedWalletName: null,
1549
1263
  connectionStatus: "disconnected",
1550
- setConnectionStatus(connectionStatus) {
1264
+ supportedIntents: [],
1265
+ setConnectionStatus(connectionStatus2) {
1551
1266
  set(() => ({
1552
- connectionStatus
1267
+ connectionStatus: connectionStatus2
1553
1268
  }));
1554
1269
  },
1555
- setWalletConnected(wallet, connectedAccounts, selectedAccount) {
1270
+ setWalletConnected(wallet, connectedAccounts, selectedAccount, supportedIntents = []) {
1556
1271
  set(() => ({
1557
1272
  accounts: connectedAccounts,
1558
1273
  currentWallet: wallet,
1559
1274
  currentAccount: selectedAccount,
1560
1275
  lastConnectedWalletName: getWalletUniqueIdentifier(wallet),
1561
1276
  lastConnectedAccountAddress: selectedAccount?.address,
1562
- connectionStatus: "connected"
1277
+ connectionStatus: "connected",
1278
+ supportedIntents
1563
1279
  }));
1564
1280
  },
1565
1281
  setWalletDisconnected() {
@@ -1569,7 +1285,8 @@ function createWalletStore({
1569
1285
  currentAccount: null,
1570
1286
  lastConnectedWalletName: null,
1571
1287
  lastConnectedAccountAddress: null,
1572
- connectionStatus: "disconnected"
1288
+ connectionStatus: "disconnected",
1289
+ supportedIntents: []
1573
1290
  }));
1574
1291
  },
1575
1292
  setAccountSwitched(selectedAccount) {
@@ -1590,7 +1307,8 @@ function createWalletStore({
1590
1307
  currentAccount: null,
1591
1308
  lastConnectedWalletName: null,
1592
1309
  lastConnectedAccountAddress: null,
1593
- connectionStatus: "disconnected"
1310
+ connectionStatus: "disconnected",
1311
+ supportedIntents: []
1594
1312
  }));
1595
1313
  } else {
1596
1314
  set(() => ({ wallets: updatedWallets }));
@@ -1691,12 +1409,14 @@ var themeVars = createGlobalThemeContract(
1691
1409
  );
1692
1410
 
1693
1411
  // src/components/styling/InjectedThemeStyles.tsx
1694
- import { jsx as jsx20 } from "react/jsx-runtime";
1412
+ import { jsx as jsx21 } from "react/jsx-runtime";
1695
1413
  function InjectedThemeStyles({ theme }) {
1696
1414
  const themeStyles = Array.isArray(theme) ? getDynamicThemeStyles(theme) : getStaticThemeStyles(theme);
1697
- return /* @__PURE__ */ jsx20(
1415
+ return /* @__PURE__ */ jsx21(
1698
1416
  "style",
1699
1417
  {
1418
+ precedence: "default",
1419
+ href: "iota-dapp-kit-theme",
1700
1420
  dangerouslySetInnerHTML: {
1701
1421
  __html: themeStyles
1702
1422
  }
@@ -1717,107 +1437,34 @@ function cssStringFromTheme(theme) {
1717
1437
  return Object.entries(assignInlineVars(themeVars, theme)).map(([key, value]) => `${key}:${value};`).join("");
1718
1438
  }
1719
1439
 
1720
- // src/themes/darkTheme.ts
1721
- var darkTheme = {
1722
- blurs: {
1723
- modalOverlay: "blur(12px)"
1724
- },
1725
- backgroundColors: {
1726
- primaryButton: "#253041",
1727
- primaryButtonHover: "#313D50",
1728
- outlineButtonHover: "#313D50",
1729
- modalOverlay: "rgba(0, 47, 109, 0.72)",
1730
- modalPrimary: "#0f141c",
1731
- modalSecondary: "#171d26",
1732
- iconButton: "transparent",
1733
- dropdownMenu: "#0f141c",
1734
- dropdownMenuSeparator: "#bed8ff14",
1735
- walletItemSelected: "#171D26",
1736
- walletItemHover: "rgba(190, 216, 255, 0.12)",
1737
- scrollThumb: "#3c4656"
1738
- },
1739
- borderColors: {
1740
- outlineButton: "#8892A1"
1741
- },
1742
- colors: {
1743
- primaryButton: "#E3EAF6",
1744
- outlineButtonHover: "#171D26",
1745
- iconButton: "#E3EAF6",
1746
- body: "#E3EAF6",
1747
- bodyMuted: "#8892A1",
1748
- bodyDanger: "#FFB0BE"
1749
- },
1750
- radii: {
1751
- small: "6px",
1752
- medium: "8px",
1753
- large: "12px",
1754
- xlarge: "16px",
1755
- full: "120px"
1756
- },
1757
- fontWeights: {
1758
- normal: "400",
1759
- medium: "500",
1760
- bold: "600"
1761
- },
1762
- fontSizes: {
1763
- small: "14px",
1764
- medium: "16px",
1765
- large: "18px",
1766
- xlarge: "20px"
1767
- },
1768
- typography: {
1769
- fontFamily: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
1770
- fontStyle: "normal",
1771
- lineHeight: "24px",
1772
- letterSpacing: "0.1px"
1773
- },
1774
- spacing: {
1775
- xxsmall: "4px",
1776
- xsmall: "8px",
1777
- small: "12px",
1778
- medium: "16px",
1779
- large: "24px",
1780
- xlarge: "32px"
1781
- }
1782
- };
1783
-
1784
1440
  // src/components/WalletProvider.tsx
1785
- import { jsx as jsx21, jsxs as jsxs7 } from "react/jsx-runtime";
1786
- var themeWithSelectorAndMediaQuery = [
1787
- {
1788
- selector: ".dark",
1789
- variables: darkTheme
1790
- },
1791
- {
1792
- variables: lightTheme
1793
- }
1794
- ];
1441
+ import { jsx as jsx22, jsxs as jsxs8 } from "react/jsx-runtime";
1795
1442
  function WalletProvider({
1796
1443
  preferredWallets = DEFAULT_PREFERRED_WALLETS,
1797
- requiredFeatures = DEFAULT_REQUIRED_FEATURES,
1444
+ walletFilter = DEFAULT_WALLET_FILTER,
1798
1445
  storage = DEFAULT_STORAGE,
1799
1446
  storageKey = DEFAULT_STORAGE_KEY,
1800
1447
  enableUnsafeBurner = false,
1801
1448
  autoConnect = false,
1802
- theme = themeWithSelectorAndMediaQuery,
1449
+ theme = lightTheme,
1803
1450
  children
1804
1451
  }) {
1805
1452
  const storeRef = useRef(
1806
1453
  createWalletStore({
1807
1454
  autoConnectEnabled: autoConnect,
1808
- wallets: getRegisteredWallets(preferredWallets, requiredFeatures),
1455
+ wallets: getRegisteredWallets(preferredWallets, walletFilter),
1809
1456
  storage: storage || createInMemoryStore(),
1810
1457
  storageKey
1811
1458
  })
1812
1459
  );
1813
- return /* @__PURE__ */ jsx21(WalletContext.Provider, { value: storeRef.current, children: /* @__PURE__ */ jsxs7(
1460
+ return /* @__PURE__ */ jsx22(WalletContext.Provider, { value: storeRef.current, children: /* @__PURE__ */ jsxs8(
1814
1461
  WalletConnectionManager,
1815
1462
  {
1816
1463
  preferredWallets,
1817
- requiredFeatures,
1464
+ walletFilter,
1818
1465
  enableUnsafeBurner,
1819
1466
  children: [
1820
- theme ? /* @__PURE__ */ jsx21(InjectedThemeStyles, { theme }) : null,
1467
+ theme ? /* @__PURE__ */ jsx22(InjectedThemeStyles, { theme }) : null,
1821
1468
  children
1822
1469
  ]
1823
1470
  }
@@ -1825,11 +1472,11 @@ function WalletProvider({
1825
1472
  }
1826
1473
  function WalletConnectionManager({
1827
1474
  preferredWallets = DEFAULT_PREFERRED_WALLETS,
1828
- requiredFeatures = DEFAULT_REQUIRED_FEATURES,
1475
+ walletFilter = DEFAULT_WALLET_FILTER,
1829
1476
  enableUnsafeBurner = false,
1830
1477
  children
1831
1478
  }) {
1832
- useWalletsChanged(preferredWallets, requiredFeatures);
1479
+ useWalletsChanged(preferredWallets, walletFilter);
1833
1480
  useWalletPropertiesChanged();
1834
1481
  useUnsafeBurnerWallet(enableUnsafeBurner);
1835
1482
  useAutoConnectWallet();
@@ -1903,7 +1550,9 @@ function useIotaClientQuery(...args) {
1903
1550
  ...options,
1904
1551
  queryKey: [iotaContext.network, method, params, ...queryKey],
1905
1552
  queryFn: async () => {
1906
- return await iotaContext.client[method](params);
1553
+ return await iotaContext.client[method](
1554
+ params
1555
+ );
1907
1556
  }
1908
1557
  });
1909
1558
  }
@@ -1930,146 +1579,276 @@ function useIotaClientQueries({
1930
1579
  });
1931
1580
  }
1932
1581
 
1933
- // src/hooks/wallet/useSignAndExecuteTransactionBlock.ts
1582
+ // src/hooks/wallet/useSignAndExecuteTransaction.ts
1583
+ import { toB64 as toB643 } from "@iota/iota-sdk/utils";
1584
+ import { signTransaction } from "@iota/wallet-standard";
1585
+ import { useMutation as useMutation6 } from "@tanstack/react-query";
1586
+
1587
+ // src/hooks/wallet/useReportTransactionEffects.ts
1588
+ import { toB64 as toB642 } from "@iota/iota-sdk/utils";
1934
1589
  import { useMutation as useMutation5 } from "@tanstack/react-query";
1935
- function useSignAndExecuteTransactionBlock({
1590
+ function useReportTransactionEffects({
1936
1591
  mutationKey,
1937
- executeFromWallet,
1938
1592
  ...mutationOptions
1939
1593
  } = {}) {
1940
1594
  const { currentWallet } = useCurrentWallet();
1941
1595
  const currentAccount = useCurrentAccount();
1942
- const client = useIotaClient();
1943
1596
  return useMutation5({
1944
- mutationKey: walletMutationKeys.signAndExecuteTransactionBlock(mutationKey),
1945
- mutationFn: async ({ requestType, options, ...signTransactionBlockArgs }) => {
1597
+ mutationKey: walletMutationKeys.reportTransactionEffects(mutationKey),
1598
+ mutationFn: async ({
1599
+ effects,
1600
+ chain = currentWallet?.chains[0],
1601
+ account = currentAccount
1602
+ }) => {
1946
1603
  if (!currentWallet) {
1947
1604
  throw new WalletNotConnectedError("No wallet is connected.");
1948
1605
  }
1949
- const signerAccount = signTransactionBlockArgs.account ?? currentAccount;
1950
- if (!signerAccount) {
1606
+ if (!account) {
1951
1607
  throw new WalletNoAccountSelectedError(
1952
- "No wallet account is selected to sign and execute the transaction block with."
1608
+ "No wallet account is selected to report transaction effects for"
1953
1609
  );
1954
1610
  }
1955
- if (executeFromWallet) {
1956
- const walletFeature2 = currentWallet.features["iota:signAndExecuteTransactionBlock"];
1957
- if (!walletFeature2) {
1958
- throw new WalletFeatureNotSupportedError(
1959
- "This wallet doesn't support the `signAndExecuteTransactionBlock` feature."
1960
- );
1961
- }
1962
- return walletFeature2.signAndExecuteTransactionBlock({
1963
- ...signTransactionBlockArgs,
1964
- account: signerAccount,
1965
- chain: signTransactionBlockArgs.chain ?? signerAccount.chains[0],
1966
- requestType,
1967
- options
1611
+ const reportTransactionEffectsFeature = currentWallet.features["iota:reportTransactionEffects"];
1612
+ if (reportTransactionEffectsFeature) {
1613
+ return await reportTransactionEffectsFeature.reportTransactionEffects({
1614
+ effects: Array.isArray(effects) ? toB642(new Uint8Array(effects)) : effects,
1615
+ account,
1616
+ chain: chain ?? currentWallet?.chains[0]
1968
1617
  });
1969
1618
  }
1970
- const walletFeature = currentWallet.features["iota:signTransactionBlock"];
1971
- if (!walletFeature) {
1619
+ },
1620
+ ...mutationOptions
1621
+ });
1622
+ }
1623
+
1624
+ // src/hooks/wallet/useSignAndExecuteTransaction.ts
1625
+ function useSignAndExecuteTransaction({
1626
+ mutationKey,
1627
+ execute,
1628
+ ...mutationOptions
1629
+ } = {}) {
1630
+ const { currentWallet, supportedIntents } = useCurrentWallet();
1631
+ const currentAccount = useCurrentAccount();
1632
+ const client = useIotaClient();
1633
+ const { mutate: reportTransactionEffects } = useReportTransactionEffects();
1634
+ const executeTransaction = execute ?? (async ({ bytes, signature }) => {
1635
+ const { digest, rawEffects } = await client.executeTransactionBlock({
1636
+ transactionBlock: bytes,
1637
+ signature,
1638
+ options: {
1639
+ showRawEffects: true
1640
+ }
1641
+ });
1642
+ return {
1643
+ digest,
1644
+ rawEffects,
1645
+ effects: toB643(new Uint8Array(rawEffects)),
1646
+ bytes,
1647
+ signature
1648
+ };
1649
+ });
1650
+ return useMutation6({
1651
+ mutationKey: walletMutationKeys.signAndExecuteTransaction(mutationKey),
1652
+ mutationFn: async ({ transaction, ...signTransactionArgs }) => {
1653
+ if (!currentWallet) {
1654
+ throw new WalletNotConnectedError("No wallet is connected.");
1655
+ }
1656
+ const signerAccount = signTransactionArgs.account ?? currentAccount;
1657
+ if (!signerAccount) {
1658
+ throw new WalletNoAccountSelectedError(
1659
+ "No wallet account is selected to sign the transaction with."
1660
+ );
1661
+ }
1662
+ const chain = signTransactionArgs.chain ?? signerAccount?.chains[0];
1663
+ if (!currentWallet.features["iota:signTransaction"]) {
1972
1664
  throw new WalletFeatureNotSupportedError(
1973
- "This wallet doesn't support the `signTransactionBlock` feature."
1665
+ "This wallet doesn't support the `signTransaction` feature."
1974
1666
  );
1975
1667
  }
1976
- const { signature, transactionBlockBytes } = await walletFeature.signTransactionBlock({
1977
- ...signTransactionBlockArgs,
1668
+ const { signature, bytes } = await signTransaction(currentWallet, {
1669
+ ...signTransactionArgs,
1670
+ transaction: {
1671
+ async toJSON() {
1672
+ return typeof transaction === "string" ? transaction : await transaction.toJSON({
1673
+ supportedIntents,
1674
+ client
1675
+ });
1676
+ }
1677
+ },
1978
1678
  account: signerAccount,
1979
- chain: signTransactionBlockArgs.chain ?? signerAccount.chains[0]
1980
- });
1981
- return client.executeTransactionBlock({
1982
- transactionBlock: transactionBlockBytes,
1983
- signature,
1984
- requestType,
1985
- options
1679
+ chain: signTransactionArgs.chain ?? signerAccount.chains[0]
1986
1680
  });
1681
+ const result = await executeTransaction({ bytes, signature });
1682
+ let effects;
1683
+ if ("effects" in result && result.effects?.bcs) {
1684
+ effects = result.effects.bcs;
1685
+ } else if ("rawEffects" in result) {
1686
+ effects = toB643(new Uint8Array(result.rawEffects));
1687
+ } else {
1688
+ throw new Error("Could not parse effects from transaction result.");
1689
+ }
1690
+ reportTransactionEffects({ effects, account: signerAccount, chain });
1691
+ return result;
1987
1692
  },
1988
1693
  ...mutationOptions
1989
1694
  });
1990
1695
  }
1991
1696
 
1992
1697
  // src/hooks/wallet/useSignPersonalMessage.ts
1993
- import { useMutation as useMutation6 } from "@tanstack/react-query";
1698
+ import { useMutation as useMutation7 } from "@tanstack/react-query";
1994
1699
  function useSignPersonalMessage({
1995
1700
  mutationKey,
1996
1701
  ...mutationOptions
1997
1702
  } = {}) {
1998
1703
  const { currentWallet } = useCurrentWallet();
1999
1704
  const currentAccount = useCurrentAccount();
2000
- return useMutation6({
1705
+ return useMutation7({
2001
1706
  mutationKey: walletMutationKeys.signPersonalMessage(mutationKey),
2002
1707
  mutationFn: async (signPersonalMessageArgs) => {
2003
1708
  if (!currentWallet) {
2004
1709
  throw new WalletNotConnectedError("No wallet is connected.");
2005
1710
  }
1711
+ const signPersonalMessageFeature = currentWallet.features["iota:signPersonalMessage"];
1712
+ if (!signPersonalMessageFeature) {
1713
+ throw new WalletFeatureNotSupportedError(
1714
+ "This wallet doesn't support the `signPersonalMessage` feature."
1715
+ );
1716
+ }
2006
1717
  const signerAccount = signPersonalMessageArgs.account ?? currentAccount;
2007
1718
  if (!signerAccount) {
2008
1719
  throw new WalletNoAccountSelectedError(
2009
1720
  "No wallet account is selected to sign the personal message with."
2010
1721
  );
2011
1722
  }
2012
- const signPersonalMessageFeature = currentWallet.features["iota:signPersonalMessage"];
2013
- if (signPersonalMessageFeature) {
2014
- return await signPersonalMessageFeature.signPersonalMessage({
2015
- ...signPersonalMessageArgs,
2016
- account: signerAccount
2017
- });
2018
- }
2019
- const signMessageFeature = currentWallet.features["iota:signMessage"];
2020
- if (signMessageFeature) {
2021
- console.warn(
2022
- "This wallet doesn't support the `signPersonalMessage` feature... falling back to `signMessage`."
2023
- );
2024
- const { messageBytes, signature } = await signMessageFeature.signMessage({
2025
- ...signPersonalMessageArgs,
2026
- account: signerAccount
2027
- });
2028
- return { bytes: messageBytes, signature };
2029
- }
2030
- throw new WalletFeatureNotSupportedError(
2031
- "This wallet doesn't support the `signPersonalMessage` feature."
2032
- );
1723
+ return await signPersonalMessageFeature.signPersonalMessage({
1724
+ ...signPersonalMessageArgs,
1725
+ account: signerAccount
1726
+ });
2033
1727
  },
2034
1728
  ...mutationOptions
2035
1729
  });
2036
1730
  }
2037
1731
 
2038
- // src/hooks/wallet/useSignTransactionBlock.ts
2039
- import { useMutation as useMutation7 } from "@tanstack/react-query";
2040
- function useSignTransactionBlock({
1732
+ // src/hooks/wallet/useSignTransaction.ts
1733
+ import { signTransaction as signTransaction2 } from "@iota/wallet-standard";
1734
+ import { useMutation as useMutation8 } from "@tanstack/react-query";
1735
+ function useSignTransaction({
2041
1736
  mutationKey,
2042
1737
  ...mutationOptions
2043
1738
  } = {}) {
2044
1739
  const { currentWallet } = useCurrentWallet();
2045
1740
  const currentAccount = useCurrentAccount();
2046
- return useMutation7({
2047
- mutationKey: walletMutationKeys.signTransactionBlock(mutationKey),
2048
- mutationFn: async (signTransactionBlockArgs) => {
1741
+ const client = useIotaClient();
1742
+ const { mutate: reportTransactionEffects } = useReportTransactionEffects();
1743
+ return useMutation8({
1744
+ mutationKey: walletMutationKeys.signTransaction(mutationKey),
1745
+ mutationFn: async ({ transaction, ...signTransactionArgs }) => {
2049
1746
  if (!currentWallet) {
2050
1747
  throw new WalletNotConnectedError("No wallet is connected.");
2051
1748
  }
2052
- const signerAccount = signTransactionBlockArgs.account ?? currentAccount;
1749
+ const signerAccount = signTransactionArgs.account ?? currentAccount;
2053
1750
  if (!signerAccount) {
2054
1751
  throw new WalletNoAccountSelectedError(
2055
- "No wallet account is selected to sign the transaction block with."
1752
+ "No wallet account is selected to sign the transaction with."
2056
1753
  );
2057
1754
  }
2058
- const walletFeature = currentWallet.features["iota:signTransactionBlock"];
2059
- if (!walletFeature) {
1755
+ if (!currentWallet.features["iota:signTransaction"]) {
2060
1756
  throw new WalletFeatureNotSupportedError(
2061
- "This wallet doesn't support the `SignTransactionBlock` feature."
1757
+ "This wallet doesn't support the `signTransaction` feature."
2062
1758
  );
2063
1759
  }
2064
- return await walletFeature.signTransactionBlock({
2065
- ...signTransactionBlockArgs,
1760
+ const { bytes, signature } = await signTransaction2(currentWallet, {
1761
+ ...signTransactionArgs,
1762
+ transaction: {
1763
+ toJSON: async () => {
1764
+ return typeof transaction === "string" ? transaction : await transaction.toJSON({
1765
+ supportedIntents: [],
1766
+ client
1767
+ });
1768
+ }
1769
+ },
2066
1770
  account: signerAccount,
2067
- chain: signTransactionBlockArgs.chain ?? signerAccount.chains[0]
1771
+ chain: signTransactionArgs.chain ?? signerAccount.chains[0]
2068
1772
  });
1773
+ return {
1774
+ bytes,
1775
+ signature,
1776
+ reportTransactionEffects: (effects) => {
1777
+ reportTransactionEffects({
1778
+ effects,
1779
+ account: signerAccount,
1780
+ chain: signTransactionArgs.chain ?? signerAccount.chains[0]
1781
+ });
1782
+ }
1783
+ };
2069
1784
  },
2070
1785
  ...mutationOptions
2071
1786
  });
2072
1787
  }
1788
+
1789
+ // src/themes/darkTheme.ts
1790
+ var darkTheme = {
1791
+ blurs: {
1792
+ modalOverlay: "blur(12px)"
1793
+ },
1794
+ backgroundColors: {
1795
+ primaryButton: "#253041",
1796
+ primaryButtonHover: "#313D50",
1797
+ outlineButtonHover: "#313D50",
1798
+ modalOverlay: "rgba(0, 47, 109, 0.72)",
1799
+ modalPrimary: "#0f141c",
1800
+ modalSecondary: "#171d26",
1801
+ iconButton: "transparent",
1802
+ dropdownMenu: "#0f141c",
1803
+ dropdownMenuSeparator: "#bed8ff14",
1804
+ walletItemSelected: "#171D26",
1805
+ walletItemHover: "rgba(190, 216, 255, 0.12)",
1806
+ scrollThumb: "#3c4656"
1807
+ },
1808
+ borderColors: {
1809
+ outlineButton: "#8892A1"
1810
+ },
1811
+ colors: {
1812
+ primaryButton: "#E3EAF6",
1813
+ outlineButtonHover: "#171D26",
1814
+ iconButton: "#E3EAF6",
1815
+ body: "#E3EAF6",
1816
+ bodyMuted: "#8892A1",
1817
+ bodyDanger: "#FFB0BE"
1818
+ },
1819
+ radii: {
1820
+ small: "6px",
1821
+ medium: "8px",
1822
+ large: "12px",
1823
+ xlarge: "16px",
1824
+ full: "120px"
1825
+ },
1826
+ fontWeights: {
1827
+ normal: "400",
1828
+ medium: "500",
1829
+ bold: "600"
1830
+ },
1831
+ fontSizes: {
1832
+ small: "14px",
1833
+ medium: "16px",
1834
+ large: "18px",
1835
+ xlarge: "20px"
1836
+ },
1837
+ typography: {
1838
+ fontFamily: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
1839
+ fontStyle: "normal",
1840
+ lineHeight: "24px",
1841
+ letterSpacing: "0.1px"
1842
+ },
1843
+ spacing: {
1844
+ xxsmall: "4px",
1845
+ xsmall: "8px",
1846
+ small: "12px",
1847
+ medium: "16px",
1848
+ large: "24px",
1849
+ xlarge: "32px"
1850
+ }
1851
+ };
2073
1852
  export {
2074
1853
  ConnectButton,
2075
1854
  ConnectModal,
@@ -2091,9 +1870,10 @@ export {
2091
1870
  useIotaClientMutation,
2092
1871
  useIotaClientQueries,
2093
1872
  useIotaClientQuery,
2094
- useSignAndExecuteTransactionBlock,
1873
+ useReportTransactionEffects,
1874
+ useSignAndExecuteTransaction,
2095
1875
  useSignPersonalMessage,
2096
- useSignTransactionBlock,
1876
+ useSignTransaction,
2097
1877
  useSwitchAccount,
2098
1878
  useWallets
2099
1879
  };