0xtrails 0.0.1 → 0.0.2

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 (359) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +42 -0
  3. package/dist/abi.d.ts +37 -0
  4. package/dist/abi.d.ts.map +1 -0
  5. package/dist/abi.js +36 -0
  6. package/dist/apiClient.d.ts +9 -0
  7. package/dist/apiClient.d.ts.map +1 -0
  8. package/dist/apiClient.js +18 -0
  9. package/dist/buffer.d.ts +3 -0
  10. package/dist/buffer.d.ts.map +1 -0
  11. package/dist/buffer.js +8 -0
  12. package/dist/cctp.d.ts +84 -0
  13. package/dist/cctp.d.ts.map +1 -0
  14. package/dist/cctp.js +401 -0
  15. package/dist/chainSwitch.d.ts +7 -0
  16. package/dist/chainSwitch.d.ts.map +1 -0
  17. package/dist/chainSwitch.js +33 -0
  18. package/dist/chains.d.ts +13 -0
  19. package/dist/chains.d.ts.map +1 -0
  20. package/dist/chains.js +95 -0
  21. package/dist/constants.d.ts +11 -0
  22. package/dist/constants.d.ts.map +1 -0
  23. package/dist/constants.js +16 -0
  24. package/dist/encoders.d.ts +7 -0
  25. package/dist/encoders.d.ts.map +1 -0
  26. package/dist/encoders.js +8 -0
  27. package/dist/error.d.ts +2 -0
  28. package/dist/error.d.ts.map +1 -0
  29. package/dist/error.js +12 -0
  30. package/dist/explorer.d.ts +12 -0
  31. package/dist/explorer.d.ts.map +1 -0
  32. package/dist/explorer.js +18 -0
  33. package/dist/gasless.d.ts +116 -0
  34. package/dist/gasless.d.ts.map +1 -0
  35. package/dist/gasless.js +297 -0
  36. package/dist/index.d.ts +13 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +9 -0
  39. package/dist/indexerClient.d.ts +9 -0
  40. package/dist/indexerClient.d.ts.map +1 -0
  41. package/dist/indexerClient.js +18 -0
  42. package/dist/intents.d.ts +83 -0
  43. package/dist/intents.d.ts.map +1 -0
  44. package/dist/intents.js +288 -0
  45. package/dist/metaTxnMonitor.d.ts +14 -0
  46. package/dist/metaTxnMonitor.d.ts.map +1 -0
  47. package/dist/metaTxnMonitor.js +121 -0
  48. package/dist/metaTxns.d.ts +6 -0
  49. package/dist/metaTxns.d.ts.map +1 -0
  50. package/dist/metaTxns.js +4 -0
  51. package/dist/paymasterSend.d.ts +90 -0
  52. package/dist/paymasterSend.d.ts.map +1 -0
  53. package/dist/paymasterSend.js +329 -0
  54. package/dist/preconditions.d.ts +11 -0
  55. package/dist/preconditions.d.ts.map +1 -0
  56. package/dist/preconditions.js +29 -0
  57. package/dist/prepareSend.d.ts +102 -0
  58. package/dist/prepareSend.d.ts.map +1 -0
  59. package/dist/prepareSend.js +1080 -0
  60. package/dist/prices.d.ts +18 -0
  61. package/dist/prices.d.ts.map +1 -0
  62. package/dist/prices.js +142 -0
  63. package/dist/queryParams.d.ts +9 -0
  64. package/dist/queryParams.d.ts.map +1 -0
  65. package/dist/queryParams.js +66 -0
  66. package/dist/relaySdk.d.ts +65 -0
  67. package/dist/relaySdk.d.ts.map +1 -0
  68. package/dist/relaySdk.js +314 -0
  69. package/dist/relayer.d.ts +23 -0
  70. package/dist/relayer.d.ts.map +1 -0
  71. package/dist/relayer.js +230 -0
  72. package/dist/sendUserOp.d.ts +140 -0
  73. package/dist/sendUserOp.d.ts.map +1 -0
  74. package/dist/sendUserOp.js +388 -0
  75. package/dist/sequenceWallet.d.ts +79 -0
  76. package/dist/sequenceWallet.d.ts.map +1 -0
  77. package/dist/sequenceWallet.js +374 -0
  78. package/dist/theme.d.ts +3 -0
  79. package/dist/theme.d.ts.map +1 -0
  80. package/dist/theme.js +1 -0
  81. package/dist/toSimpleSmartAccount.d.ts +95 -0
  82. package/dist/toSimpleSmartAccount.d.ts.map +1 -0
  83. package/dist/toSimpleSmartAccount.js +373 -0
  84. package/dist/tokenBalances.d.ts +118 -0
  85. package/dist/tokenBalances.d.ts.map +1 -0
  86. package/dist/tokenBalances.js +492 -0
  87. package/dist/tokens.d.ts +50 -0
  88. package/dist/tokens.d.ts.map +1 -0
  89. package/dist/tokens.js +356 -0
  90. package/dist/trails.d.ts +128 -0
  91. package/dist/trails.d.ts.map +1 -0
  92. package/dist/trails.js +1031 -0
  93. package/dist/umd/trails.min.js +12610 -0
  94. package/dist/umd/trails.min.js.map +1 -0
  95. package/dist/umd.d.ts +24 -0
  96. package/dist/umd.d.ts.map +1 -0
  97. package/dist/utils.d.ts +5 -0
  98. package/dist/utils.d.ts.map +1 -0
  99. package/dist/utils.js +9 -0
  100. package/dist/widget/ConstantsUtil-B-_-u8aQ.js +6 -0
  101. package/dist/widget/add-hVLs3ldJ.js +20 -0
  102. package/dist/widget/all-wallets-Cwxnx4BT.js +11 -0
  103. package/dist/widget/app-store-CAAVQjW0.js +22 -0
  104. package/dist/widget/apple-C3BSbglw.js +23 -0
  105. package/dist/widget/arrow-bottom-circle-BGU9MmsZ.js +16 -0
  106. package/dist/widget/arrow-bottom-hS_SA8Gp.js +13 -0
  107. package/dist/widget/arrow-left-CJZanWz7.js +13 -0
  108. package/dist/widget/arrow-right-C1qL8EMd.js +13 -0
  109. package/dist/widget/arrow-top-CbuCmbQs.js +13 -0
  110. package/dist/widget/bank-CXBEEGbb.js +19 -0
  111. package/dist/widget/bin-Dqzv3zCZ.js +9 -0
  112. package/dist/widget/bitcoin-4y3sovZp.js +18 -0
  113. package/dist/widget/browser-DyOl4_8m.js +1413 -0
  114. package/dist/widget/browser-t7Fh0sEU.js +19 -0
  115. package/dist/widget/card-Bo4CZkTs.js +19 -0
  116. package/dist/widget/ccip-BynehMIN.js +232 -0
  117. package/dist/widget/checkmark-DV6OKvnY.js +16 -0
  118. package/dist/widget/checkmark-bold-CAp1-IQ2.js +13 -0
  119. package/dist/widget/chevron-bottom-BjzsVzk9.js +13 -0
  120. package/dist/widget/chevron-left-CQZBDCiR.js +13 -0
  121. package/dist/widget/chevron-right-Dhg4zeZM.js +13 -0
  122. package/dist/widget/chevron-top-CDQmfJef.js +13 -0
  123. package/dist/widget/chrome-store-BNaC_b6w.js +66 -0
  124. package/dist/widget/circle-BC_GBj91.js +9 -0
  125. package/dist/widget/clock-BmF8-4a0.js +13 -0
  126. package/dist/widget/close-Bf61nZ8o.js +13 -0
  127. package/dist/widget/coinPlaceholder-7cZW2058.js +13 -0
  128. package/dist/widget/compass-CFC3yhnW.js +13 -0
  129. package/dist/widget/components/ChainImage.d.ts +8 -0
  130. package/dist/widget/components/ChainImage.d.ts.map +1 -0
  131. package/dist/widget/components/ChainImage.js +6 -0
  132. package/dist/widget/components/ConnectWallet.d.ts +18 -0
  133. package/dist/widget/components/ConnectWallet.d.ts.map +1 -0
  134. package/dist/widget/components/ConnectWallet.js +66 -0
  135. package/dist/widget/components/DebugScreensDropdown.d.ts +9 -0
  136. package/dist/widget/components/DebugScreensDropdown.d.ts.map +1 -0
  137. package/dist/widget/components/DebugScreensDropdown.js +40 -0
  138. package/dist/widget/components/FeeOptions.d.ts +17 -0
  139. package/dist/widget/components/FeeOptions.d.ts.map +1 -0
  140. package/dist/widget/components/FeeOptions.js +65 -0
  141. package/dist/widget/components/Footer.d.ts +9 -0
  142. package/dist/widget/components/Footer.d.ts.map +1 -0
  143. package/dist/widget/components/Footer.js +13 -0
  144. package/dist/widget/components/GreenCheckAnimation.d.ts +2 -0
  145. package/dist/widget/components/GreenCheckAnimation.d.ts.map +1 -0
  146. package/dist/widget/components/GreenCheckAnimation.js +74 -0
  147. package/dist/widget/components/Modal.d.ts +11 -0
  148. package/dist/widget/components/Modal.d.ts.map +1 -0
  149. package/dist/widget/components/Modal.js +36 -0
  150. package/dist/widget/components/Receipt.d.ts +13 -0
  151. package/dist/widget/components/Receipt.d.ts.map +1 -0
  152. package/dist/widget/components/Receipt.js +36 -0
  153. package/dist/widget/components/SendForm.d.ts +44 -0
  154. package/dist/widget/components/SendForm.d.ts.map +1 -0
  155. package/dist/widget/components/SendForm.js +177 -0
  156. package/dist/widget/components/TokenImage.d.ts +10 -0
  157. package/dist/widget/components/TokenImage.d.ts.map +1 -0
  158. package/dist/widget/components/TokenImage.js +8 -0
  159. package/dist/widget/components/TokenList.d.ts +16 -0
  160. package/dist/widget/components/TokenList.d.ts.map +1 -0
  161. package/dist/widget/components/TokenList.js +39 -0
  162. package/dist/widget/components/TransferPending.d.ts +11 -0
  163. package/dist/widget/components/TransferPending.d.ts.map +1 -0
  164. package/dist/widget/components/TransferPending.js +77 -0
  165. package/dist/widget/components/TransferPendingVertical.d.ts +18 -0
  166. package/dist/widget/components/TransferPendingVertical.d.ts.map +1 -0
  167. package/dist/widget/components/TransferPendingVertical.js +183 -0
  168. package/dist/widget/components/WalletConfirmation.d.ts +18 -0
  169. package/dist/widget/components/WalletConfirmation.d.ts.map +1 -0
  170. package/dist/widget/components/WalletConfirmation.js +22 -0
  171. package/dist/widget/config.d.ts +4 -0
  172. package/dist/widget/config.d.ts.map +1 -0
  173. package/dist/widget/config.js +3 -0
  174. package/dist/widget/copy-e0xXvKN0.js +20 -0
  175. package/dist/widget/cursor-CqM3v0xJ.js +8 -0
  176. package/dist/widget/cursor-transparent-CUQpdsCG.js +17 -0
  177. package/dist/widget/desktop-DUDGIRpM.js +14 -0
  178. package/dist/widget/disconnect-DUFST9QQ.js +13 -0
  179. package/dist/widget/discord-C1cj365Z.js +22 -0
  180. package/dist/widget/email-BHhmb_lX.js +703 -0
  181. package/dist/widget/embedded-wallet-CuuC4eah.js +467 -0
  182. package/dist/widget/ethereum-CfmBVfeB.js +15 -0
  183. package/dist/widget/etherscan-BSiynDhW.js +11 -0
  184. package/dist/widget/exclamation-triangle-DEiFNpHw.js +9 -0
  185. package/dist/widget/extension-mRmfCDxo.js +13 -0
  186. package/dist/widget/external-link-B4xMIVnW.js +13 -0
  187. package/dist/widget/facebook-CBAZStBR.js +31 -0
  188. package/dist/widget/farcaster-LHDEDf5S.js +17 -0
  189. package/dist/widget/filters-CBijuvFv.js +13 -0
  190. package/dist/widget/github-C3ILD420.js +23 -0
  191. package/dist/widget/google-CSj73POX.js +23 -0
  192. package/dist/widget/help-circle-2hdG5IdB.js +17 -0
  193. package/dist/widget/hooks/useAmountUsd.d.ts +13 -0
  194. package/dist/widget/hooks/useAmountUsd.d.ts.map +1 -0
  195. package/dist/widget/hooks/useAmountUsd.js +35 -0
  196. package/dist/widget/hooks/useSendForm.d.ts +125 -0
  197. package/dist/widget/hooks/useSendForm.d.ts.map +1 -0
  198. package/dist/widget/hooks/useSendForm.js +450 -0
  199. package/dist/widget/hooks/useTokenList.d.ts +52 -0
  200. package/dist/widget/hooks/useTokenList.d.ts.map +1 -0
  201. package/dist/widget/hooks/useTokenList.js +252 -0
  202. package/dist/widget/id-ByYSrwsd.js +17 -0
  203. package/dist/widget/if-defined-DRXJEhv7.js +752 -0
  204. package/dist/widget/image-C90L4Rf6.js +9 -0
  205. package/dist/widget/index-B3SlQ9v3.js +46 -0
  206. package/dist/widget/index-B8LPuLXQ.js +78 -0
  207. package/dist/widget/index-BDbworWA.js +171 -0
  208. package/dist/widget/index-BTlDgFSK.js +98 -0
  209. package/dist/widget/index-BUCcjXbd.js +306 -0
  210. package/dist/widget/index-BZ34edi2.js +1055 -0
  211. package/dist/widget/index-BiCU29wK.js +147 -0
  212. package/dist/widget/index-BlmqIKsY.js +266 -0
  213. package/dist/widget/index-BlviH5nG.js +55 -0
  214. package/dist/widget/index-Bwd5X3fS.js +8306 -0
  215. package/dist/widget/index-C5gmknHK.js +78 -0
  216. package/dist/widget/index-CD6dBcRj.js +76 -0
  217. package/dist/widget/index-CDlhy529.js +63 -0
  218. package/dist/widget/index-CHXa5ke-.js +59 -0
  219. package/dist/widget/index-CK94R-H7.js +22498 -0
  220. package/dist/widget/index-CQzo3m3x.js +182 -0
  221. package/dist/widget/index-CRT8cAwG.js +325 -0
  222. package/dist/widget/index-CY7Lt2Yu.js +310 -0
  223. package/dist/widget/index-CiKfAu1E.js +79 -0
  224. package/dist/widget/index-CkCu6rMi.js +258 -0
  225. package/dist/widget/index-CngLTu_R.js +517 -0
  226. package/dist/widget/index-CsMV8-em.js +2577 -0
  227. package/dist/widget/index-Cu2Wva8v.js +200 -0
  228. package/dist/widget/index-DKBxLTEF.js +240 -0
  229. package/dist/widget/index-DQEVT3dx.js +511 -0
  230. package/dist/widget/index-DU2HcCis.js +200 -0
  231. package/dist/widget/index-DutZGWNW.js +321 -0
  232. package/dist/widget/index-O0glArmc.js +182 -0
  233. package/dist/widget/index-O8FmRjKe.js +63719 -0
  234. package/dist/widget/index-RtKXrB6I.js +576 -0
  235. package/dist/widget/index-TIYtS0gE.js +88 -0
  236. package/dist/widget/index-dQNJvWHs.js +66 -0
  237. package/dist/widget/index-wmEwdsq7.js +909 -0
  238. package/dist/widget/index.d.ts +3 -0
  239. package/dist/widget/index.d.ts.map +1 -0
  240. package/dist/widget/index.js +2 -0
  241. package/dist/widget/info-DMPChDjV.js +8 -0
  242. package/dist/widget/info-circle-DAvS_7nY.js +17 -0
  243. package/dist/widget/lightbulb-DnZ9mNEs.js +8 -0
  244. package/dist/widget/lit-html-BRjl1r6K.js +243 -0
  245. package/dist/widget/mail-DpaVSOP8.js +13 -0
  246. package/dist/widget/mobile-CRvdyu7I.js +14 -0
  247. package/dist/widget/more-C5VqW9PR.js +16 -0
  248. package/dist/widget/network-placeholder-CZ0vApma.js +19 -0
  249. package/dist/widget/nftPlaceholder-7jjIK2bT.js +13 -0
  250. package/dist/widget/off-4mHjJLLX.js +9 -0
  251. package/dist/widget/onramp-Bc0ozVsw.js +929 -0
  252. package/dist/widget/play-store-Uocul8nC.js +37 -0
  253. package/dist/widget/plus-DrYF7siO.js +18 -0
  254. package/dist/widget/prepareSend-BQJmzM5B.js +54987 -0
  255. package/dist/widget/qr-code-DcnGMUB3.js +11 -0
  256. package/dist/widget/receive-fvIVd7R_.js +184 -0
  257. package/dist/widget/recycle-horizontal-DrDwXC4D.js +14 -0
  258. package/dist/widget/ref-CXNmEjML.js +41 -0
  259. package/dist/widget/refresh-OK9lIPLS.js +13 -0
  260. package/dist/widget/reown-logo-C-Qn7mS3.js +17 -0
  261. package/dist/widget/search-DZqv1oKg.js +13 -0
  262. package/dist/widget/send-CJlmI-xe.js +1039 -0
  263. package/dist/widget/send-otoEC8uU.js +20 -0
  264. package/dist/widget/socials-BJciurWF.js +599 -0
  265. package/dist/widget/solana-Bv5Hs_0T.js +18 -0
  266. package/dist/widget/swapHorizontal-BzOPGV37.js +13 -0
  267. package/dist/widget/swapHorizontalBold-axyHnSmj.js +13 -0
  268. package/dist/widget/swapHorizontalMedium-C6YOPfPz.js +21 -0
  269. package/dist/widget/swapHorizontalRoundedBold-yVcLbWNT.js +13 -0
  270. package/dist/widget/swapVertical-BDjxt9pE.js +13 -0
  271. package/dist/widget/swaps-DEWNj4kd.js +1637 -0
  272. package/dist/widget/telegram-BQJD7dlP.js +21 -0
  273. package/dist/widget/three-dots-DW9jmSMG.js +10 -0
  274. package/dist/widget/transactions-uCseGQQt.js +38 -0
  275. package/dist/widget/twitch-XugxDfOE.js +23 -0
  276. package/dist/widget/twitterIcon-DQVObQUL.js +11 -0
  277. package/dist/widget/types.d.ts +51 -0
  278. package/dist/widget/types.d.ts.map +1 -0
  279. package/dist/widget/types.js +1 -0
  280. package/dist/widget/verify-DpMYHxLf.js +13 -0
  281. package/dist/widget/verify-filled-KpEL6ZJ_.js +13 -0
  282. package/dist/widget/w3m-modal-C8e-6Kba.js +1047 -0
  283. package/dist/widget/wallet-D8ssEB0o.js +13 -0
  284. package/dist/widget/wallet-placeholder-HtAy21Wc.js +19 -0
  285. package/dist/widget/walletconnect-Bp_4XfrY.js +37 -0
  286. package/dist/widget/warning-circle-FgYS7P7n.js +17 -0
  287. package/dist/widget/widget/index.js +7 -0
  288. package/dist/widget/widget.d.ts +47 -0
  289. package/dist/widget/widget.d.ts.map +1 -0
  290. package/dist/widget/widget.js +932 -0
  291. package/dist/widget/x-DlZBoP9k.js +17 -0
  292. package/dist/widget/x-mark-Ba9pt-_h.js +8 -0
  293. package/package.json +102 -8
  294. package/src/abi.ts +38 -0
  295. package/src/apiClient.ts +32 -0
  296. package/src/buffer.ts +10 -0
  297. package/src/cctp.ts +579 -0
  298. package/src/chainSwitch.ts +55 -0
  299. package/src/chains.ts +124 -0
  300. package/src/constants.ts +26 -0
  301. package/src/encoders.ts +20 -0
  302. package/src/error.ts +15 -0
  303. package/src/explorer.ts +37 -0
  304. package/src/gasless.ts +545 -0
  305. package/src/index.ts +48 -0
  306. package/src/indexerClient.ts +36 -0
  307. package/src/intents.ts +537 -0
  308. package/src/metaTxnMonitor.ts +163 -0
  309. package/src/metaTxns.ts +21 -0
  310. package/src/paymasterSend.ts +503 -0
  311. package/src/preconditions.ts +52 -0
  312. package/src/prepareSend.ts +1849 -0
  313. package/src/prices.ts +186 -0
  314. package/src/queryParams.ts +80 -0
  315. package/src/relaySdk.ts +481 -0
  316. package/src/relayer.ts +255 -0
  317. package/src/sendUserOp.ts +570 -0
  318. package/src/sequenceWallet.ts +579 -0
  319. package/src/theme.ts +2 -0
  320. package/src/toSimpleSmartAccount.ts +567 -0
  321. package/src/tokenBalances.ts +760 -0
  322. package/src/tokens.ts +471 -0
  323. package/src/trails.ts +1591 -0
  324. package/src/types.d.ts +11 -0
  325. package/src/umd.tsx +49 -0
  326. package/src/utils.ts +16 -0
  327. package/src/vite-env.d.ts +4 -0
  328. package/src/widget/assets/MetaMask-icon-fox-with-margins.svg +31 -0
  329. package/src/widget/assets/MetaMask-icon-fox.svg +26 -0
  330. package/src/widget/assets/MetaMask-logo-black.svg +3 -0
  331. package/src/widget/assets/MetaMask-logo-white.svg +16 -0
  332. package/src/widget/assets/Privy_Brandmark_Black.svg +9 -0
  333. package/src/widget/assets/Privy_Brandmark_White.svg +9 -0
  334. package/src/widget/assets/Trails-logo-black.svg +11 -0
  335. package/src/widget/assets/Trails-logo-white.svg +11 -0
  336. package/src/widget/components/ChainImage.tsx +28 -0
  337. package/src/widget/components/ConnectWallet.tsx +206 -0
  338. package/src/widget/components/DebugScreensDropdown.tsx +88 -0
  339. package/src/widget/components/FeeOptions.tsx +199 -0
  340. package/src/widget/components/Footer.tsx +51 -0
  341. package/src/widget/components/GreenCheckAnimation.tsx +119 -0
  342. package/src/widget/components/Modal.tsx +97 -0
  343. package/src/widget/components/Receipt.tsx +237 -0
  344. package/src/widget/components/SendForm.tsx +695 -0
  345. package/src/widget/components/TokenImage.tsx +37 -0
  346. package/src/widget/components/TokenList.tsx +287 -0
  347. package/src/widget/components/TransferPending.tsx +204 -0
  348. package/src/widget/components/TransferPendingVertical.tsx +412 -0
  349. package/src/widget/components/WalletConfirmation.tsx +172 -0
  350. package/src/widget/config.ts +5 -0
  351. package/src/widget/hooks/useAmountUsd.ts +59 -0
  352. package/src/widget/hooks/useSendForm.ts +715 -0
  353. package/src/widget/hooks/useTokenList.ts +397 -0
  354. package/src/widget/index.css +2 -0
  355. package/src/widget/index.tsx +8 -0
  356. package/src/widget/types/svg.d.ts +8 -0
  357. package/src/widget/types.ts +59 -0
  358. package/src/widget/widget.tsx +1438 -0
  359. package/index.js +0 -1
@@ -0,0 +1,1039 @@
1
+ import { i as f, a as w, d as I, h as x, l as H, t as l, r as z, j as W, R as g, N as L, u as q, S as B, e as F, f as M, W as Y } from "./index-CK94R-H7.js";
2
+ import { x as u } from "./lit-html-BRjl1r6K.js";
3
+ import { n as d, r as c, c as m, U as b, o as K } from "./if-defined-DRXJEhv7.js";
4
+ import "./index-CRT8cAwG.js";
5
+ import "./index-CD6dBcRj.js";
6
+ import { e as O, n as D } from "./ref-CXNmEjML.js";
7
+ import { n as G, s as J } from "./ConstantsUtil-B-_-u8aQ.js";
8
+ import "./index-BlviH5nG.js";
9
+ import { S as Q } from "./index-DQEVT3dx.js";
10
+ import "./index-BlmqIKsY.js";
11
+ import "./index-DU2HcCis.js";
12
+ import "./index-B3SlQ9v3.js";
13
+ import "./index-CDlhy529.js";
14
+ const X = f`
15
+ :host {
16
+ width: 100%;
17
+ height: 100px;
18
+ border-radius: var(--wui-border-radius-s);
19
+ border: 1px solid var(--wui-color-gray-glass-002);
20
+ background-color: var(--wui-color-gray-glass-002);
21
+ transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
22
+ will-change: background-color;
23
+ position: relative;
24
+ }
25
+
26
+ :host(:hover) {
27
+ background-color: var(--wui-color-gray-glass-005);
28
+ }
29
+
30
+ wui-flex {
31
+ width: 100%;
32
+ height: fit-content;
33
+ }
34
+
35
+ wui-button {
36
+ display: ruby;
37
+ color: var(--wui-color-fg-100);
38
+ margin: 0 var(--wui-spacing-xs);
39
+ }
40
+
41
+ .instruction {
42
+ position: absolute;
43
+ top: 50%;
44
+ transform: translateY(-50%);
45
+ z-index: 2;
46
+ }
47
+
48
+ .paste {
49
+ display: inline-flex;
50
+ }
51
+
52
+ textarea {
53
+ background: transparent;
54
+ width: 100%;
55
+ font-family: var(--w3m-font-family);
56
+ font-size: var(--wui-font-size-medium);
57
+ font-style: normal;
58
+ font-weight: var(--wui-font-weight-light);
59
+ line-height: 130%;
60
+ letter-spacing: var(--wui-letter-spacing-medium);
61
+ color: var(--wui-color-fg-100);
62
+ caret-color: var(--wui-color-accent-100);
63
+ box-sizing: border-box;
64
+ -webkit-appearance: none;
65
+ -moz-appearance: textfield;
66
+ padding: 0px;
67
+ border: none;
68
+ outline: none;
69
+ appearance: none;
70
+ resize: none;
71
+ overflow: hidden;
72
+ }
73
+ `;
74
+ var E = function(o, e, i, n) {
75
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
76
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
77
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
78
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
79
+ };
80
+ let A = class extends w {
81
+ constructor() {
82
+ super(...arguments), this.inputElementRef = O(), this.instructionElementRef = O(), this.instructionHidden = !!this.value, this.pasting = !1, this.onDebouncedSearch = I.debounce(async (e) => {
83
+ if (!e.length) {
84
+ this.setReceiverAddress("");
85
+ return;
86
+ }
87
+ const i = x.state.activeChain;
88
+ if (I.isAddress(e, i)) {
89
+ this.setReceiverAddress(e);
90
+ return;
91
+ }
92
+ try {
93
+ const r = await H.getEnsAddress(e);
94
+ if (r) {
95
+ l.setReceiverProfileName(e), l.setReceiverAddress(r);
96
+ const t = await H.getEnsAvatar(e);
97
+ l.setReceiverProfileImageUrl(t || void 0);
98
+ }
99
+ } catch {
100
+ this.setReceiverAddress(e);
101
+ } finally {
102
+ l.setLoading(!1);
103
+ }
104
+ });
105
+ }
106
+ firstUpdated() {
107
+ this.value && (this.instructionHidden = !0), this.checkHidden();
108
+ }
109
+ render() {
110
+ return u` <wui-flex
111
+ @click=${this.onBoxClick.bind(this)}
112
+ flexDirection="column"
113
+ justifyContent="center"
114
+ gap="4xs"
115
+ .padding=${["2xl", "l", "xl", "l"]}
116
+ >
117
+ <wui-text
118
+ ${D(this.instructionElementRef)}
119
+ class="instruction"
120
+ color="fg-300"
121
+ variant="medium-400"
122
+ >
123
+ Type or
124
+ <wui-button
125
+ class="paste"
126
+ size="md"
127
+ variant="neutral"
128
+ iconLeft="copy"
129
+ @click=${this.onPasteClick.bind(this)}
130
+ >
131
+ <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
132
+ Paste
133
+ </wui-button>
134
+ address
135
+ </wui-text>
136
+ <textarea
137
+ spellcheck="false"
138
+ ?disabled=${!this.instructionHidden}
139
+ ${D(this.inputElementRef)}
140
+ @input=${this.onInputChange.bind(this)}
141
+ @blur=${this.onBlur.bind(this)}
142
+ .value=${this.value ?? ""}
143
+ autocomplete="off"
144
+ >
145
+ ${this.value ?? ""}</textarea
146
+ >
147
+ </wui-flex>`;
148
+ }
149
+ async focusInput() {
150
+ var e;
151
+ this.instructionElementRef.value && (this.instructionHidden = !0, await this.toggleInstructionFocus(!1), this.instructionElementRef.value.style.pointerEvents = "none", (e = this.inputElementRef.value) == null || e.focus(), this.inputElementRef.value && (this.inputElementRef.value.selectionStart = this.inputElementRef.value.selectionEnd = this.inputElementRef.value.value.length));
152
+ }
153
+ async focusInstruction() {
154
+ var e;
155
+ this.instructionElementRef.value && (this.instructionHidden = !1, await this.toggleInstructionFocus(!0), this.instructionElementRef.value.style.pointerEvents = "auto", (e = this.inputElementRef.value) == null || e.blur());
156
+ }
157
+ async toggleInstructionFocus(e) {
158
+ this.instructionElementRef.value && await this.instructionElementRef.value.animate([{ opacity: e ? 0 : 1 }, { opacity: e ? 1 : 0 }], {
159
+ duration: 100,
160
+ easing: "ease",
161
+ fill: "forwards"
162
+ }).finished;
163
+ }
164
+ onBoxClick() {
165
+ !this.value && !this.instructionHidden && this.focusInput();
166
+ }
167
+ onBlur() {
168
+ !this.value && this.instructionHidden && !this.pasting && this.focusInstruction();
169
+ }
170
+ checkHidden() {
171
+ this.instructionHidden && this.focusInput();
172
+ }
173
+ async onPasteClick() {
174
+ this.pasting = !0;
175
+ const e = await navigator.clipboard.readText();
176
+ l.setReceiverAddress(e), this.focusInput();
177
+ }
178
+ onInputChange(e) {
179
+ var n;
180
+ const i = e.target;
181
+ this.pasting = !1, this.value = (n = e.target) == null ? void 0 : n.value, i.value && !this.instructionHidden && this.focusInput(), l.setLoading(!0), this.onDebouncedSearch(i.value);
182
+ }
183
+ setReceiverAddress(e) {
184
+ l.setReceiverAddress(e), l.setReceiverProfileName(void 0), l.setReceiverProfileImageUrl(void 0), l.setLoading(!1);
185
+ }
186
+ };
187
+ A.styles = X;
188
+ E([
189
+ d()
190
+ ], A.prototype, "value", void 0);
191
+ E([
192
+ c()
193
+ ], A.prototype, "instructionHidden", void 0);
194
+ E([
195
+ c()
196
+ ], A.prototype, "pasting", void 0);
197
+ A = E([
198
+ m("w3m-input-address")
199
+ ], A);
200
+ const Z = f`
201
+ :host {
202
+ position: relative;
203
+ display: inline-block;
204
+ }
205
+
206
+ input {
207
+ background: transparent;
208
+ width: 100%;
209
+ height: auto;
210
+ font-family: var(--wui-font-family);
211
+ color: var(--wui-color-fg-100);
212
+
213
+ font-feature-settings: 'case' on;
214
+ font-size: 32px;
215
+ font-weight: var(--wui-font-weight-light);
216
+ caret-color: var(--wui-color-accent-100);
217
+ line-height: 130%;
218
+ letter-spacing: -1.28px;
219
+ box-sizing: border-box;
220
+ -webkit-appearance: none;
221
+ -moz-appearance: textfield;
222
+ padding: 0px;
223
+ }
224
+
225
+ input::-webkit-outer-spin-button,
226
+ input::-webkit-inner-spin-button {
227
+ -webkit-appearance: none;
228
+ margin: 0;
229
+ }
230
+
231
+ input::placeholder {
232
+ color: var(--wui-color-fg-275);
233
+ }
234
+ `;
235
+ var j = function(o, e, i, n) {
236
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
237
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
238
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
239
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
240
+ };
241
+ let C = class extends w {
242
+ constructor() {
243
+ super(...arguments), this.inputElementRef = O(), this.disabled = !1, this.value = "", this.placeholder = "0";
244
+ }
245
+ render() {
246
+ var e;
247
+ return (e = this.inputElementRef) != null && e.value && this.value && (this.inputElementRef.value.value = this.value), u`<input
248
+ ${D(this.inputElementRef)}
249
+ type="text"
250
+ inputmode="decimal"
251
+ pattern="[0-9,.]*"
252
+ placeholder=${this.placeholder}
253
+ ?disabled=${this.disabled}
254
+ autofocus
255
+ value=${this.value ?? ""}
256
+ @input=${this.dispatchInputChangeEvent.bind(this)}
257
+ /> `;
258
+ }
259
+ dispatchInputChangeEvent(e) {
260
+ var n, r;
261
+ const i = e.data;
262
+ if (i && ((n = this.inputElementRef) != null && n.value))
263
+ if (i === ",") {
264
+ const t = this.inputElementRef.value.value.replace(",", ".");
265
+ this.inputElementRef.value.value = t, this.value = `${this.value}${t}`;
266
+ } else G.test(i) || (this.inputElementRef.value.value = this.value.replace(new RegExp(i.replace(J, "\\$&"), "gu"), ""));
267
+ this.dispatchEvent(new CustomEvent("inputChange", {
268
+ detail: (r = this.inputElementRef.value) == null ? void 0 : r.value,
269
+ bubbles: !0,
270
+ composed: !0
271
+ }));
272
+ }
273
+ };
274
+ C.styles = [z, W, Z];
275
+ j([
276
+ d({ type: Boolean })
277
+ ], C.prototype, "disabled", void 0);
278
+ j([
279
+ d({ type: String })
280
+ ], C.prototype, "value", void 0);
281
+ j([
282
+ d({ type: String })
283
+ ], C.prototype, "placeholder", void 0);
284
+ C = j([
285
+ m("wui-input-amount")
286
+ ], C);
287
+ const ee = f`
288
+ :host {
289
+ width: 100%;
290
+ height: 100px;
291
+ border-radius: var(--wui-border-radius-s);
292
+ border: 1px solid var(--wui-color-gray-glass-002);
293
+ background-color: var(--wui-color-gray-glass-002);
294
+ transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
295
+ will-change: background-color;
296
+ }
297
+
298
+ :host(:hover) {
299
+ background-color: var(--wui-color-gray-glass-005);
300
+ }
301
+
302
+ wui-flex {
303
+ width: 100%;
304
+ height: fit-content;
305
+ }
306
+
307
+ wui-button {
308
+ width: 100%;
309
+ display: flex;
310
+ justify-content: flex-end;
311
+ }
312
+
313
+ wui-input-amount {
314
+ mask-image: linear-gradient(
315
+ 270deg,
316
+ transparent 0px,
317
+ transparent 8px,
318
+ black 24px,
319
+ black 25px,
320
+ black 32px,
321
+ black 100%
322
+ );
323
+ }
324
+
325
+ .totalValue {
326
+ width: 100%;
327
+ }
328
+ `;
329
+ var V = function(o, e, i, n) {
330
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
331
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
332
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
333
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
334
+ };
335
+ let R = class extends w {
336
+ render() {
337
+ return u` <wui-flex
338
+ flexDirection="column"
339
+ gap="4xs"
340
+ .padding=${["xl", "s", "l", "l"]}
341
+ >
342
+ <wui-flex alignItems="center">
343
+ <wui-input-amount
344
+ @inputChange=${this.onInputChange.bind(this)}
345
+ ?disabled=${!this.token && !0}
346
+ .value=${this.sendTokenAmount ? String(this.sendTokenAmount) : ""}
347
+ ></wui-input-amount>
348
+ ${this.buttonTemplate()}
349
+ </wui-flex>
350
+ <wui-flex alignItems="center" justifyContent="space-between">
351
+ ${this.sendValueTemplate()}
352
+ <wui-flex alignItems="center" gap="4xs" justifyContent="flex-end">
353
+ ${this.maxAmountTemplate()} ${this.actionTemplate()}
354
+ </wui-flex>
355
+ </wui-flex>
356
+ </wui-flex>`;
357
+ }
358
+ buttonTemplate() {
359
+ return this.token ? u`<wui-token-button
360
+ text=${this.token.symbol}
361
+ imageSrc=${this.token.iconUrl}
362
+ @click=${this.handleSelectButtonClick.bind(this)}
363
+ >
364
+ </wui-token-button>` : u`<wui-button
365
+ size="md"
366
+ variant="accent"
367
+ @click=${this.handleSelectButtonClick.bind(this)}
368
+ >Select token</wui-button
369
+ >`;
370
+ }
371
+ handleSelectButtonClick() {
372
+ g.push("WalletSendSelectToken");
373
+ }
374
+ sendValueTemplate() {
375
+ if (this.token && this.sendTokenAmount) {
376
+ const i = this.token.price * this.sendTokenAmount;
377
+ return u`<wui-text class="totalValue" variant="small-400" color="fg-200"
378
+ >${i ? `$${b.formatNumberToLocalString(i, 2)}` : "Incorrect value"}</wui-text
379
+ >`;
380
+ }
381
+ return null;
382
+ }
383
+ maxAmountTemplate() {
384
+ return this.token ? this.sendTokenAmount && this.sendTokenAmount > Number(this.token.quantity.numeric) ? u` <wui-text variant="small-400" color="error-100">
385
+ ${b.roundNumber(Number(this.token.quantity.numeric), 6, 5)}
386
+ </wui-text>` : u` <wui-text variant="small-400" color="fg-200">
387
+ ${b.roundNumber(Number(this.token.quantity.numeric), 6, 5)}
388
+ </wui-text>` : null;
389
+ }
390
+ actionTemplate() {
391
+ return this.token ? this.sendTokenAmount && this.sendTokenAmount > Number(this.token.quantity.numeric) ? u`<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>` : u`<wui-link @click=${this.onMaxClick.bind(this)}>Max</wui-link>` : null;
392
+ }
393
+ onInputChange(e) {
394
+ l.setTokenAmount(e.detail);
395
+ }
396
+ onMaxClick() {
397
+ if (this.token) {
398
+ const e = L.bigNumber(this.token.quantity.numeric);
399
+ l.setTokenAmount(Number(e.toFixed(20)));
400
+ }
401
+ }
402
+ onBuyClick() {
403
+ g.push("OnRampProviders");
404
+ }
405
+ };
406
+ R.styles = ee;
407
+ V([
408
+ d({ type: Object })
409
+ ], R.prototype, "token", void 0);
410
+ V([
411
+ d({ type: Number })
412
+ ], R.prototype, "sendTokenAmount", void 0);
413
+ R = V([
414
+ m("w3m-input-token")
415
+ ], R);
416
+ const te = f`
417
+ :host {
418
+ display: block;
419
+ }
420
+
421
+ wui-flex {
422
+ position: relative;
423
+ }
424
+
425
+ wui-icon-box {
426
+ width: 40px;
427
+ height: 40px;
428
+ border-radius: var(--wui-border-radius-xs) !important;
429
+ border: 5px solid var(--wui-color-bg-125);
430
+ background: var(--wui-color-bg-175);
431
+ position: absolute;
432
+ top: 50%;
433
+ left: 50%;
434
+ transform: translate(-50%, -50%);
435
+ z-index: 3;
436
+ }
437
+
438
+ wui-button {
439
+ --local-border-radius: var(--wui-border-radius-xs) !important;
440
+ }
441
+
442
+ .inputContainer {
443
+ height: fit-content;
444
+ }
445
+ `;
446
+ var $ = function(o, e, i, n) {
447
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
448
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
449
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
450
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
451
+ };
452
+ let h = class extends w {
453
+ constructor() {
454
+ super(), this.unsubscribe = [], this.token = l.state.token, this.sendTokenAmount = l.state.sendTokenAmount, this.receiverAddress = l.state.receiverAddress, this.receiverProfileName = l.state.receiverProfileName, this.loading = l.state.loading, this.message = "Preview Send", this.fetchNetworkPrice(), this.fetchBalances(), this.unsubscribe.push(l.subscribe((e) => {
455
+ this.token = e.token, this.sendTokenAmount = e.sendTokenAmount, this.receiverAddress = e.receiverAddress, this.receiverProfileName = e.receiverProfileName, this.loading = e.loading;
456
+ }));
457
+ }
458
+ disconnectedCallback() {
459
+ this.unsubscribe.forEach((e) => e());
460
+ }
461
+ render() {
462
+ return this.getMessage(), u` <wui-flex flexDirection="column" .padding=${["0", "l", "l", "l"]}>
463
+ <wui-flex class="inputContainer" gap="xs" flexDirection="column">
464
+ <w3m-input-token
465
+ .token=${this.token}
466
+ .sendTokenAmount=${this.sendTokenAmount}
467
+ ></w3m-input-token>
468
+ <wui-icon-box
469
+ size="inherit"
470
+ backgroundColor="fg-300"
471
+ iconSize="lg"
472
+ iconColor="fg-250"
473
+ background="opaque"
474
+ icon="arrowBottom"
475
+ ></wui-icon-box>
476
+ <w3m-input-address
477
+ .value=${this.receiverProfileName ? this.receiverProfileName : this.receiverAddress}
478
+ ></w3m-input-address>
479
+ </wui-flex>
480
+ <wui-flex .margin=${["l", "0", "0", "0"]}>
481
+ <wui-button
482
+ @click=${this.onButtonClick.bind(this)}
483
+ ?disabled=${!this.message.startsWith("Preview Send")}
484
+ size="lg"
485
+ variant="main"
486
+ ?loading=${this.loading}
487
+ fullWidth
488
+ >
489
+ ${this.message}
490
+ </wui-button>
491
+ </wui-flex>
492
+ </wui-flex>`;
493
+ }
494
+ async fetchBalances() {
495
+ await l.fetchTokenBalance(), l.fetchNetworkBalance();
496
+ }
497
+ async fetchNetworkPrice() {
498
+ await Q.getNetworkTokenPrice();
499
+ }
500
+ onButtonClick() {
501
+ g.push("WalletSendPreview");
502
+ }
503
+ getMessage() {
504
+ var e;
505
+ this.message = "Preview Send", this.receiverAddress && !I.isAddress(this.receiverAddress, x.state.activeChain) && (this.message = "Invalid Address"), this.receiverAddress || (this.message = "Add Address"), this.sendTokenAmount && this.token && this.sendTokenAmount > Number(this.token.quantity.numeric) && (this.message = "Insufficient Funds"), this.sendTokenAmount || (this.message = "Add Amount"), this.sendTokenAmount && ((e = this.token) != null && e.price) && (this.sendTokenAmount * this.token.price || (this.message = "Incorrect Value")), this.token || (this.message = "Select Token");
506
+ }
507
+ };
508
+ h.styles = te;
509
+ $([
510
+ c()
511
+ ], h.prototype, "token", void 0);
512
+ $([
513
+ c()
514
+ ], h.prototype, "sendTokenAmount", void 0);
515
+ $([
516
+ c()
517
+ ], h.prototype, "receiverAddress", void 0);
518
+ $([
519
+ c()
520
+ ], h.prototype, "receiverProfileName", void 0);
521
+ $([
522
+ c()
523
+ ], h.prototype, "loading", void 0);
524
+ $([
525
+ c()
526
+ ], h.prototype, "message", void 0);
527
+ h = $([
528
+ m("w3m-wallet-send-view")
529
+ ], h);
530
+ const ie = f`
531
+ .contentContainer {
532
+ height: 440px;
533
+ overflow: scroll;
534
+ scrollbar-width: none;
535
+ }
536
+
537
+ .contentContainer::-webkit-scrollbar {
538
+ display: none;
539
+ }
540
+
541
+ wui-icon-box {
542
+ width: 40px;
543
+ height: 40px;
544
+ border-radius: var(--wui-border-radius-xxs);
545
+ }
546
+ `;
547
+ var P = function(o, e, i, n) {
548
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
549
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
550
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
551
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
552
+ };
553
+ let k = class extends w {
554
+ constructor() {
555
+ super(), this.unsubscribe = [], this.tokenBalances = l.state.tokenBalances, this.search = "", this.onDebouncedSearch = I.debounce((e) => {
556
+ this.search = e;
557
+ }), this.unsubscribe.push(l.subscribe((e) => {
558
+ this.tokenBalances = e.tokenBalances;
559
+ }));
560
+ }
561
+ disconnectedCallback() {
562
+ this.unsubscribe.forEach((e) => e());
563
+ }
564
+ render() {
565
+ return u`
566
+ <wui-flex flexDirection="column">
567
+ ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
568
+ </wui-flex>
569
+ `;
570
+ }
571
+ templateSearchInput() {
572
+ return u`
573
+ <wui-flex gap="xs" padding="s">
574
+ <wui-input-text
575
+ @inputChange=${this.onInputChange.bind(this)}
576
+ class="network-search-input"
577
+ size="sm"
578
+ placeholder="Search token"
579
+ icon="search"
580
+ ></wui-input-text>
581
+ </wui-flex>
582
+ `;
583
+ }
584
+ templateTokens() {
585
+ var e, i;
586
+ return this.tokens = (e = this.tokenBalances) == null ? void 0 : e.filter((n) => {
587
+ var r;
588
+ return n.chainId === ((r = x.state.activeCaipNetwork) == null ? void 0 : r.caipNetworkId);
589
+ }), this.search ? this.filteredTokens = (i = this.tokenBalances) == null ? void 0 : i.filter((n) => n.name.toLowerCase().includes(this.search.toLowerCase())) : this.filteredTokens = this.tokens, u`
590
+ <wui-flex
591
+ class="contentContainer"
592
+ flexDirection="column"
593
+ .padding=${["0", "s", "0", "s"]}
594
+ >
595
+ <wui-flex justifyContent="flex-start" .padding=${["m", "s", "s", "s"]}>
596
+ <wui-text variant="paragraph-500" color="fg-200">Your tokens</wui-text>
597
+ </wui-flex>
598
+ <wui-flex flexDirection="column" gap="xs">
599
+ ${this.filteredTokens && this.filteredTokens.length > 0 ? this.filteredTokens.map((n) => u`<wui-list-token
600
+ @click=${this.handleTokenClick.bind(this, n)}
601
+ ?clickable=${!0}
602
+ tokenName=${n.name}
603
+ tokenImageUrl=${n.iconUrl}
604
+ tokenAmount=${n.quantity.numeric}
605
+ tokenValue=${n.value}
606
+ tokenCurrency=${n.symbol}
607
+ ></wui-list-token>`) : u`<wui-flex
608
+ .padding=${["4xl", "0", "0", "0"]}
609
+ alignItems="center"
610
+ flexDirection="column"
611
+ gap="l"
612
+ >
613
+ <wui-icon-box
614
+ icon="coinPlaceholder"
615
+ size="inherit"
616
+ iconColor="fg-200"
617
+ backgroundColor="fg-200"
618
+ iconSize="lg"
619
+ ></wui-icon-box>
620
+ <wui-flex
621
+ class="textContent"
622
+ gap="xs"
623
+ flexDirection="column"
624
+ justifyContent="center"
625
+ flexDirection="column"
626
+ >
627
+ <wui-text variant="paragraph-500" align="center" color="fg-100"
628
+ >No tokens found</wui-text
629
+ >
630
+ <wui-text variant="small-400" align="center" color="fg-200"
631
+ >Your tokens will appear here</wui-text
632
+ >
633
+ </wui-flex>
634
+ <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
635
+ </wui-flex>`}
636
+ </wui-flex>
637
+ </wui-flex>
638
+ `;
639
+ }
640
+ onBuyClick() {
641
+ g.push("OnRampProviders");
642
+ }
643
+ onInputChange(e) {
644
+ this.onDebouncedSearch(e.detail);
645
+ }
646
+ handleTokenClick(e) {
647
+ l.setToken(e), l.setTokenAmount(void 0), g.goBack();
648
+ }
649
+ };
650
+ k.styles = ie;
651
+ P([
652
+ c()
653
+ ], k.prototype, "tokenBalances", void 0);
654
+ P([
655
+ c()
656
+ ], k.prototype, "tokens", void 0);
657
+ P([
658
+ c()
659
+ ], k.prototype, "filteredTokens", void 0);
660
+ P([
661
+ c()
662
+ ], k.prototype, "search", void 0);
663
+ k = P([
664
+ m("w3m-wallet-send-select-token-view")
665
+ ], k);
666
+ const ne = f`
667
+ :host {
668
+ display: flex;
669
+ gap: var(--wui-spacing-xs);
670
+ border-radius: var(--wui-border-radius-3xl);
671
+ border: 1px solid var(--wui-color-gray-glass-002);
672
+ background: var(--wui-color-gray-glass-002);
673
+ padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs)
674
+ var(--wui-spacing-s);
675
+ align-items: center;
676
+ }
677
+
678
+ wui-avatar,
679
+ wui-icon,
680
+ wui-image {
681
+ width: 32px;
682
+ height: 32px;
683
+ border: 1px solid var(--wui-color-gray-glass-002);
684
+ border-radius: var(--wui-border-radius-3xl);
685
+ box-shadow: 0 0 0 2px var(--wui-color-gray-glass-002);
686
+ }
687
+ `;
688
+ var N = function(o, e, i, n) {
689
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
690
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
691
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
692
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
693
+ };
694
+ let y = class extends w {
695
+ constructor() {
696
+ super(...arguments), this.text = "", this.address = "", this.isAddress = !1;
697
+ }
698
+ render() {
699
+ return u`<wui-text variant="large-500" color="fg-100">${this.text}</wui-text>
700
+ ${this.imageTemplate()}`;
701
+ }
702
+ imageTemplate() {
703
+ return this.isAddress ? u`<wui-avatar address=${this.address} .imageSrc=${this.imageSrc}></wui-avatar>` : this.imageSrc ? u`<wui-image src=${this.imageSrc}></wui-image>` : u`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`;
704
+ }
705
+ };
706
+ y.styles = [z, W, ne];
707
+ N([
708
+ d()
709
+ ], y.prototype, "text", void 0);
710
+ N([
711
+ d()
712
+ ], y.prototype, "address", void 0);
713
+ N([
714
+ d()
715
+ ], y.prototype, "imageSrc", void 0);
716
+ N([
717
+ d({ type: Boolean })
718
+ ], y.prototype, "isAddress", void 0);
719
+ y = N([
720
+ m("wui-preview-item")
721
+ ], y);
722
+ const re = f`
723
+ :host {
724
+ display: flex;
725
+ column-gap: var(--wui-spacing-s);
726
+ padding: 17px 18px 17px var(--wui-spacing-m);
727
+ width: 100%;
728
+ background-color: var(--wui-color-gray-glass-002);
729
+ border-radius: var(--wui-border-radius-xs);
730
+ color: var(--wui-color-fg-250);
731
+ }
732
+
733
+ wui-image {
734
+ width: var(--wui-icon-size-lg);
735
+ height: var(--wui-icon-size-lg);
736
+ border-radius: var(--wui-border-radius-3xl);
737
+ }
738
+
739
+ wui-icon {
740
+ width: var(--wui-icon-size-lg);
741
+ height: var(--wui-icon-size-lg);
742
+ }
743
+ `;
744
+ var _ = function(o, e, i, n) {
745
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
746
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
747
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
748
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
749
+ };
750
+ let T = class extends w {
751
+ constructor() {
752
+ super(...arguments), this.imageSrc = void 0, this.textTitle = "", this.textValue = void 0;
753
+ }
754
+ render() {
755
+ return u`
756
+ <wui-flex justifyContent="space-between" alignItems="center">
757
+ <wui-text variant="paragraph-500" color=${this.textValue ? "fg-200" : "fg-100"}>
758
+ ${this.textTitle}
759
+ </wui-text>
760
+ ${this.templateContent()}
761
+ </wui-flex>
762
+ `;
763
+ }
764
+ templateContent() {
765
+ return this.imageSrc ? u`<wui-image src=${this.imageSrc} alt=${this.textTitle}></wui-image>` : this.textValue ? u` <wui-text variant="paragraph-400" color="fg-100"> ${this.textValue} </wui-text>` : u`<wui-icon size="inherit" color="fg-200" name="networkPlaceholder"></wui-icon>`;
766
+ }
767
+ };
768
+ T.styles = [z, W, re];
769
+ _([
770
+ d()
771
+ ], T.prototype, "imageSrc", void 0);
772
+ _([
773
+ d()
774
+ ], T.prototype, "textTitle", void 0);
775
+ _([
776
+ d()
777
+ ], T.prototype, "textValue", void 0);
778
+ T = _([
779
+ m("wui-list-content")
780
+ ], T);
781
+ const oe = f`
782
+ :host {
783
+ display: flex;
784
+ width: auto;
785
+ flex-direction: column;
786
+ gap: var(--wui-border-radius-1xs);
787
+ border-radius: var(--wui-border-radius-s);
788
+ background: var(--wui-color-gray-glass-002);
789
+ padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs)
790
+ var(--wui-spacing-1xs);
791
+ }
792
+
793
+ wui-text {
794
+ padding: 0 var(--wui-spacing-1xs);
795
+ }
796
+
797
+ wui-flex {
798
+ margin-top: var(--wui-spacing-1xs);
799
+ }
800
+
801
+ .network {
802
+ cursor: pointer;
803
+ transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
804
+ will-change: background-color;
805
+ }
806
+
807
+ .network:focus-visible {
808
+ border: 1px solid var(--wui-color-accent-100);
809
+ background-color: var(--wui-color-gray-glass-005);
810
+ -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
811
+ -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
812
+ box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
813
+ }
814
+
815
+ .network:hover {
816
+ background-color: var(--wui-color-gray-glass-005);
817
+ }
818
+
819
+ .network:active {
820
+ background-color: var(--wui-color-gray-glass-010);
821
+ }
822
+ `;
823
+ var U = function(o, e, i, n) {
824
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
825
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
826
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
827
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
828
+ };
829
+ let S = class extends w {
830
+ render() {
831
+ return u` <wui-text variant="small-400" color="fg-200">Details</wui-text>
832
+ <wui-flex flexDirection="column" gap="xxs">
833
+ <wui-list-content
834
+ textTitle="Address"
835
+ textValue=${b.getTruncateString({
836
+ string: this.receiverAddress ?? "",
837
+ charsStart: 4,
838
+ charsEnd: 4,
839
+ truncate: "middle"
840
+ })}
841
+ >
842
+ </wui-list-content>
843
+ ${this.networkTemplate()}
844
+ </wui-flex>`;
845
+ }
846
+ networkTemplate() {
847
+ var e;
848
+ return (e = this.caipNetwork) != null && e.name ? u` <wui-list-content
849
+ @click=${() => this.onNetworkClick(this.caipNetwork)}
850
+ class="network"
851
+ textTitle="Network"
852
+ imageSrc=${K(q.getNetworkImage(this.caipNetwork))}
853
+ ></wui-list-content>` : null;
854
+ }
855
+ onNetworkClick(e) {
856
+ e && g.push("Networks", { network: e });
857
+ }
858
+ };
859
+ S.styles = oe;
860
+ U([
861
+ d()
862
+ ], S.prototype, "receiverAddress", void 0);
863
+ U([
864
+ d({ type: Object })
865
+ ], S.prototype, "caipNetwork", void 0);
866
+ S = U([
867
+ m("w3m-wallet-send-details")
868
+ ], S);
869
+ const se = f`
870
+ wui-avatar,
871
+ wui-image {
872
+ display: ruby;
873
+ width: 32px;
874
+ height: 32px;
875
+ border-radius: var(--wui-border-radius-3xl);
876
+ }
877
+
878
+ .sendButton {
879
+ width: 70%;
880
+ --local-width: 100% !important;
881
+ --local-border-radius: var(--wui-border-radius-xs) !important;
882
+ }
883
+
884
+ .cancelButton {
885
+ width: 30%;
886
+ --local-width: 100% !important;
887
+ --local-border-radius: var(--wui-border-radius-xs) !important;
888
+ }
889
+ `;
890
+ var v = function(o, e, i, n) {
891
+ var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
892
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(o, e, i, n);
893
+ else for (var a = o.length - 1; a >= 0; a--) (s = o[a]) && (t = (r < 3 ? s(t) : r > 3 ? s(e, i, t) : s(e, i)) || t);
894
+ return r > 3 && t && Object.defineProperty(e, i, t), t;
895
+ };
896
+ let p = class extends w {
897
+ constructor() {
898
+ super(), this.unsubscribe = [], this.token = l.state.token, this.sendTokenAmount = l.state.sendTokenAmount, this.receiverAddress = l.state.receiverAddress, this.receiverProfileName = l.state.receiverProfileName, this.receiverProfileImageUrl = l.state.receiverProfileImageUrl, this.caipNetwork = x.state.activeCaipNetwork, this.loading = l.state.loading, this.unsubscribe.push(l.subscribe((e) => {
899
+ this.token = e.token, this.sendTokenAmount = e.sendTokenAmount, this.receiverAddress = e.receiverAddress, this.receiverProfileName = e.receiverProfileName, this.receiverProfileImageUrl = e.receiverProfileImageUrl, this.loading = e.loading;
900
+ }), x.subscribeKey("activeCaipNetwork", (e) => this.caipNetwork = e));
901
+ }
902
+ disconnectedCallback() {
903
+ this.unsubscribe.forEach((e) => e());
904
+ }
905
+ render() {
906
+ var e, i;
907
+ return u` <wui-flex flexDirection="column" .padding=${["0", "l", "l", "l"]}>
908
+ <wui-flex gap="xs" flexDirection="column" .padding=${["0", "xs", "0", "xs"]}>
909
+ <wui-flex alignItems="center" justifyContent="space-between">
910
+ <wui-flex flexDirection="column" gap="4xs">
911
+ <wui-text variant="small-400" color="fg-150">Send</wui-text>
912
+ ${this.sendValueTemplate()}
913
+ </wui-flex>
914
+ <wui-preview-item
915
+ text="${this.sendTokenAmount ? b.roundNumber(this.sendTokenAmount, 6, 5) : "unknown"} ${(e = this.token) == null ? void 0 : e.symbol}"
916
+ .imageSrc=${(i = this.token) == null ? void 0 : i.iconUrl}
917
+ ></wui-preview-item>
918
+ </wui-flex>
919
+ <wui-flex>
920
+ <wui-icon color="fg-200" size="md" name="arrowBottom"></wui-icon>
921
+ </wui-flex>
922
+ <wui-flex alignItems="center" justifyContent="space-between">
923
+ <wui-text variant="small-400" color="fg-150">To</wui-text>
924
+ <wui-preview-item
925
+ text="${this.receiverProfileName ? b.getTruncateString({
926
+ string: this.receiverProfileName,
927
+ charsStart: 20,
928
+ charsEnd: 0,
929
+ truncate: "end"
930
+ }) : b.getTruncateString({
931
+ string: this.receiverAddress ? this.receiverAddress : "",
932
+ charsStart: 4,
933
+ charsEnd: 4,
934
+ truncate: "middle"
935
+ })}"
936
+ address=${this.receiverAddress ?? ""}
937
+ .imageSrc=${this.receiverProfileImageUrl ?? void 0}
938
+ .isAddress=${!0}
939
+ ></wui-preview-item>
940
+ </wui-flex>
941
+ </wui-flex>
942
+ <wui-flex flexDirection="column" .padding=${["xxl", "0", "0", "0"]}>
943
+ <w3m-wallet-send-details
944
+ .caipNetwork=${this.caipNetwork}
945
+ .receiverAddress=${this.receiverAddress}
946
+ ></w3m-wallet-send-details>
947
+ <wui-flex justifyContent="center" gap="xxs" .padding=${["s", "0", "0", "0"]}>
948
+ <wui-icon size="sm" color="fg-200" name="warningCircle"></wui-icon>
949
+ <wui-text variant="small-400" color="fg-200">Review transaction carefully</wui-text>
950
+ </wui-flex>
951
+ <wui-flex justifyContent="center" gap="s" .padding=${["l", "0", "0", "0"]}>
952
+ <wui-button
953
+ class="cancelButton"
954
+ @click=${this.onCancelClick.bind(this)}
955
+ size="lg"
956
+ variant="neutral"
957
+ >
958
+ Cancel
959
+ </wui-button>
960
+ <wui-button
961
+ class="sendButton"
962
+ @click=${this.onSendClick.bind(this)}
963
+ size="lg"
964
+ variant="main"
965
+ .loading=${this.loading}
966
+ >
967
+ Send
968
+ </wui-button>
969
+ </wui-flex>
970
+ </wui-flex></wui-flex
971
+ >`;
972
+ }
973
+ sendValueTemplate() {
974
+ if (this.token && this.sendTokenAmount) {
975
+ const i = this.token.price * this.sendTokenAmount;
976
+ return u`<wui-text variant="paragraph-400" color="fg-100"
977
+ >$${i.toFixed(2)}</wui-text
978
+ >`;
979
+ }
980
+ return null;
981
+ }
982
+ async onSendClick() {
983
+ var e, i;
984
+ if (!this.sendTokenAmount || !this.receiverAddress) {
985
+ B.showError("Please enter a valid amount and receiver address");
986
+ return;
987
+ }
988
+ try {
989
+ await l.sendToken(), B.showSuccess("Transaction started"), g.replace("Account");
990
+ } catch (n) {
991
+ B.showError("Failed to send transaction. Please try again."), console.error("SendController:sendToken - failed to send transaction", n);
992
+ const r = n instanceof Error ? n.message : "Unknown error";
993
+ F.sendEvent({
994
+ type: "track",
995
+ event: "SEND_ERROR",
996
+ properties: {
997
+ message: r,
998
+ isSmartAccount: M(x.state.activeChain) === Y.ACCOUNT_TYPES.SMART_ACCOUNT,
999
+ token: ((e = this.token) == null ? void 0 : e.symbol) || "",
1000
+ amount: this.sendTokenAmount,
1001
+ network: ((i = x.state.activeCaipNetwork) == null ? void 0 : i.caipNetworkId) || ""
1002
+ }
1003
+ });
1004
+ }
1005
+ }
1006
+ onCancelClick() {
1007
+ g.goBack();
1008
+ }
1009
+ };
1010
+ p.styles = se;
1011
+ v([
1012
+ c()
1013
+ ], p.prototype, "token", void 0);
1014
+ v([
1015
+ c()
1016
+ ], p.prototype, "sendTokenAmount", void 0);
1017
+ v([
1018
+ c()
1019
+ ], p.prototype, "receiverAddress", void 0);
1020
+ v([
1021
+ c()
1022
+ ], p.prototype, "receiverProfileName", void 0);
1023
+ v([
1024
+ c()
1025
+ ], p.prototype, "receiverProfileImageUrl", void 0);
1026
+ v([
1027
+ c()
1028
+ ], p.prototype, "caipNetwork", void 0);
1029
+ v([
1030
+ c()
1031
+ ], p.prototype, "loading", void 0);
1032
+ p = v([
1033
+ m("w3m-wallet-send-preview-view")
1034
+ ], p);
1035
+ export {
1036
+ k as W3mSendSelectTokenView,
1037
+ p as W3mWalletSendPreviewView,
1038
+ h as W3mWalletSendView
1039
+ };