@directcryptopay/sdk 0.2.2 → 0.2.3

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 (228) hide show
  1. package/dist/ExchangeController-CPMQq6Q-.js +217 -0
  2. package/dist/HelpersUtil-DfMFC7Bf.js +120 -0
  3. package/dist/NavigationUtil-kj9LEOOd.js +8 -0
  4. package/dist/PhArrowCircleDown-lsK25DCk.js +73 -0
  5. package/dist/PhArrowClockwise-NeKHZ1co.js +73 -0
  6. package/dist/PhArrowDown-C9AkNvLs.js +73 -0
  7. package/dist/PhArrowLeft-RNfIQP1X.js +73 -0
  8. package/dist/PhArrowRight-DM1tna0G.js +73 -0
  9. package/dist/PhArrowSquareOut-S5XYbAZj.js +73 -0
  10. package/dist/PhArrowUp-DmktzOWy.js +73 -0
  11. package/dist/PhArrowUpRight-BkNeW_5i.js +73 -0
  12. package/dist/PhArrowsClockwise-CQ4pG76b.js +73 -0
  13. package/dist/PhArrowsDownUp-H6gxaNM6.js +73 -0
  14. package/dist/PhArrowsLeftRight-DZSsfMR6.js +73 -0
  15. package/dist/PhBank-4_9QzqIB.js +73 -0
  16. package/dist/PhBrowser-B-JSznId.js +73 -0
  17. package/dist/PhCaretDown-vV5oHMNi.js +73 -0
  18. package/dist/PhCaretLeft-BLo6Y_f4.js +73 -0
  19. package/dist/PhCaretRight-CqQN4TT3.js +73 -0
  20. package/dist/PhCaretUp-Df7UCAHy.js +73 -0
  21. package/dist/PhCheck-gtpfK4ed.js +73 -0
  22. package/dist/PhCircleHalf-Uq7dwDYw.js +73 -0
  23. package/dist/PhClock-SDCW-NmF.js +73 -0
  24. package/dist/PhCompass-B7hgtdx-.js +73 -0
  25. package/dist/PhCopy-BcnhyXCy.js +73 -0
  26. package/dist/PhCreditCard-BJjByVgu.js +73 -0
  27. package/dist/PhCurrencyDollar-B7ZXqXBy.js +73 -0
  28. package/dist/PhDesktop-B3VKPuJx.js +73 -0
  29. package/dist/PhDeviceMobile-Bnd0TYEH.js +73 -0
  30. package/dist/PhDotsThree-yyMWyZ-R.js +73 -0
  31. package/dist/PhEnvelope-67uzHbI9.js +73 -0
  32. package/dist/PhFunnelSimple-B-DCsloI.js +73 -0
  33. package/dist/PhGlobe-TMm_6qGk.js +73 -0
  34. package/dist/PhIdentificationCard-CePPD2xc.js +73 -0
  35. package/dist/PhImage-gY96WtHR.js +73 -0
  36. package/dist/PhInfo-DRQM_ZDP.js +73 -0
  37. package/dist/PhLightbulb-B0TxPfZ1.js +73 -0
  38. package/dist/PhMagnifyingGlass-B8si5_6W.js +73 -0
  39. package/dist/PhPaperPlaneRight-DVu5PLYd.js +73 -0
  40. package/dist/PhPlus-BfTsQnUz.js +73 -0
  41. package/dist/PhPower-CxYUGOWn.js +73 -0
  42. package/dist/PhPuzzlePiece-CQ4wh0gV.js +73 -0
  43. package/dist/PhQrCode-BuJ97NYJ.js +73 -0
  44. package/dist/PhQuestion-kJoP8Mja.js +73 -0
  45. package/dist/PhQuestionMark-C46ZkFpu.js +73 -0
  46. package/dist/PhSealCheck-Eh8jVqSN.js +73 -0
  47. package/dist/PhSignOut-jk97OSVt.js +73 -0
  48. package/dist/PhSpinner-CiYOhwMg.js +73 -0
  49. package/dist/PhTrash-pxerMqzd.js +73 -0
  50. package/dist/PhUser-BMg0VV4A.js +73 -0
  51. package/dist/PhVault-DYQvx5A-.js +73 -0
  52. package/dist/PhWarning-NLC5Mj87.js +73 -0
  53. package/dist/PhWarningCircle-Ch2jU9fA.js +73 -0
  54. package/dist/PhX-Bx4wpwm3.js +73 -0
  55. package/dist/SwapController-Cti0Cyxa.js +457 -0
  56. package/dist/{ccip-BIGqktC1.js → ccip-CKZd2XJ7.js} +4 -4
  57. package/dist/data-capture-7D5CL385.js +490 -0
  58. package/dist/dcp-sdk.umd.js +7400 -6589
  59. package/dist/email-AmK0INbZ.js +344 -0
  60. package/dist/embedded-wallet-Pn0I_XLn.js +820 -0
  61. package/dist/features-x8XNprEe.js +274 -0
  62. package/dist/{hashTypedData-ZH9ZnWu3.js → hashTypedData-B50-z0AA.js} +6 -6
  63. package/dist/if-defined-CdZSZ6UL.js +10 -0
  64. package/dist/index-4ewUtPPp.js +7981 -0
  65. package/dist/{index-D6h-qfpt.js → index-51l86yqx.js} +5 -5
  66. package/dist/index-B6K56LF_.js +85 -0
  67. package/dist/index-BAmv9PxJ.js +257 -0
  68. package/dist/index-BEswjY9r.js +117 -0
  69. package/dist/index-BSKRq56S.js +355 -0
  70. package/dist/index-BaygXQxx.js +172 -0
  71. package/dist/index-BcPxaHr5.js +118 -0
  72. package/dist/index-Bjt7nGaJ.js +199 -0
  73. package/dist/{index-D5r0iSq4.js → index-BkTSyAJb.js} +1 -1
  74. package/dist/index-Bmnl7l2U.js +555 -0
  75. package/dist/index-BvPvouSq.js +56 -0
  76. package/dist/index-C-6iznUO.js +174 -0
  77. package/dist/index-C4M5s_AM.js +228 -0
  78. package/dist/index-CEqcN8QP.js +1175 -0
  79. package/dist/{index-CPTcEPbD.js → index-CM3YaYca.js} +296 -298
  80. package/dist/{index-f3LXSfM5.js → index-CclBLA5r.js} +56 -142
  81. package/dist/index-ChTxJOiF.js +46 -0
  82. package/dist/index-CmAv0Tzr.js +86 -0
  83. package/dist/index-CmvoKY4x.js +125 -0
  84. package/dist/{index-BdSIrl-R.js → index-D7PmdQ9B.js} +578 -570
  85. package/dist/{index-DobBVPe4.js → index-D7k2Pc4e.js} +481 -236
  86. package/dist/index-D7lmgqUR.js +153 -0
  87. package/dist/index-DG_-qYze.js +107 -0
  88. package/dist/{index-Dy4NyE6l.js → index-DHot9Fdb.js} +7 -7
  89. package/dist/index-DV2LrPtU.js +123 -0
  90. package/dist/index-DYBaJQ2W.js +65 -0
  91. package/dist/{index-BJ7cbG3N.js → index-D_8VUmn1.js} +36688 -40208
  92. package/dist/index-D_gLn3rT.js +100 -0
  93. package/dist/index-DqcVUSC9.js +62 -0
  94. package/dist/index-I7VDqINw.js +128 -0
  95. package/dist/index-Oz72I9VP.js +209 -0
  96. package/dist/index-UclsHkJ0.js +118 -0
  97. package/dist/index-X8zir_1j.js +110 -0
  98. package/dist/index-XvlWKGCu.js +1281 -0
  99. package/dist/index-dO97xPlt.js +171 -0
  100. package/dist/{index-5mp7WkhV.js → index-uBeF6OAB.js} +2 -2
  101. package/dist/index-zeA_RiCV.js +159 -0
  102. package/dist/index.js +1 -1
  103. package/dist/{localBatchGatewayRequest-CjGcn5nM.js → localBatchGatewayRequest-BUZHGdjw.js} +1 -1
  104. package/dist/onramp-CdnBuF0r.js +855 -0
  105. package/dist/{parseSignature-S8VEpRHC.js → parseSignature-CcyTNGr4.js} +2312 -2313
  106. package/dist/pay-with-exchange-CSM6WCOV.js +525 -0
  107. package/dist/property-Bd8U3_QP.js +618 -0
  108. package/dist/receive-DooMu4Dx.js +232 -0
  109. package/dist/ref-CpgjXAw7.js +107 -0
  110. package/dist/send-3T7CyYic.js +1166 -0
  111. package/dist/socials-Dt-iHL17.js +620 -0
  112. package/dist/swaps-CjA9Es42.js +1760 -0
  113. package/dist/{transactions-DujFkB-M.js → transactions-nRm9DVzn.js} +10 -10
  114. package/dist/w3m-modal-NV25AXhM.js +1706 -0
  115. package/package.json +3 -3
  116. package/dist/ConstantsUtil-B-_-u8aQ.js +0 -6
  117. package/dist/add-sji6scSD.js +0 -19
  118. package/dist/all-wallets-B4H-890E.js +0 -10
  119. package/dist/app-store-Z433s97G.js +0 -21
  120. package/dist/apple-b8Lxj7nb.js +0 -22
  121. package/dist/arrow-bottom-M9oWWo_9.js +0 -12
  122. package/dist/arrow-bottom-circle-N9c4CXY1.js +0 -15
  123. package/dist/arrow-left-Dw8AKfwf.js +0 -12
  124. package/dist/arrow-right-DwLQZSC_.js +0 -12
  125. package/dist/arrow-top-zhUjkBe1.js +0 -12
  126. package/dist/bank-CbQdnILK.js +0 -18
  127. package/dist/browser-xAqNwt7z.js +0 -18
  128. package/dist/card-Dr1QBmWp.js +0 -18
  129. package/dist/checkmark-BhT1dTgG.js +0 -15
  130. package/dist/checkmark-bold-CPB29wqQ.js +0 -12
  131. package/dist/chevron-bottom-BhNyx2II.js +0 -12
  132. package/dist/chevron-left-CGuEjQlY.js +0 -12
  133. package/dist/chevron-right-CvIRRsqZ.js +0 -12
  134. package/dist/chevron-top-RSzCqjBd.js +0 -12
  135. package/dist/chrome-store-Cs8dAgs0.js +0 -65
  136. package/dist/clock-fhZO5otC.js +0 -12
  137. package/dist/close-BPuztrdR.js +0 -12
  138. package/dist/coinPlaceholder-C8X2i7Kh.js +0 -12
  139. package/dist/compass-WMc5huk0.js +0 -12
  140. package/dist/copy-DVAeT17y.js +0 -19
  141. package/dist/cursor-BJ4YLXfy.js +0 -7
  142. package/dist/cursor-transparent-DN2fLQN4.js +0 -16
  143. package/dist/desktop-6avxisBw.js +0 -13
  144. package/dist/disconnect-AReVI8Gk.js +0 -12
  145. package/dist/discord-CxrI30BZ.js +0 -21
  146. package/dist/email-B8dIIaay.js +0 -696
  147. package/dist/embedded-wallet-C_5hF7rM.js +0 -468
  148. package/dist/etherscan-BnAy8cIF.js +0 -10
  149. package/dist/exclamation-triangle-Bu7nHwx9.js +0 -8
  150. package/dist/extension-F0LIhvcf.js +0 -12
  151. package/dist/external-link-CP6phyaM.js +0 -12
  152. package/dist/facebook-BtQ-Io2y.js +0 -30
  153. package/dist/farcaster-BmaN1ugd.js +0 -16
  154. package/dist/filters-DpEwoOmy.js +0 -12
  155. package/dist/github-q7qO9V-b.js +0 -22
  156. package/dist/google-DH_ZE8bW.js +0 -22
  157. package/dist/help-circle-BAQVmKas.js +0 -16
  158. package/dist/id-Cj68Zwgo.js +0 -16
  159. package/dist/if-defined-CNte9B3N.js +0 -744
  160. package/dist/image-BKJDw6N-.js +0 -8
  161. package/dist/index-7toZMdtG.js +0 -573
  162. package/dist/index-B1uKzdvN.js +0 -170
  163. package/dist/index-BHFZVF-b.js +0 -257
  164. package/dist/index-BKwa5JSA.js +0 -559
  165. package/dist/index-BP4B9VUt.js +0 -54
  166. package/dist/index-BVdzXHpO.js +0 -181
  167. package/dist/index-BYND0GJ9.js +0 -146
  168. package/dist/index-BaJ0zEbh.js +0 -97
  169. package/dist/index-Bh0MPFwP.js +0 -58
  170. package/dist/index-Bsh7_qTp.js +0 -511
  171. package/dist/index-BwnXTNNg.js +0 -199
  172. package/dist/index-C0kPDbg_.js +0 -77
  173. package/dist/index-CKikVKe2.js +0 -75
  174. package/dist/index-ChVh0Hkp.js +0 -243
  175. package/dist/index-Cle_NnnS.js +0 -305
  176. package/dist/index-CmWdvIFT.js +0 -51
  177. package/dist/index-D2AMA8Bu.js +0 -65
  178. package/dist/index-DAUM8CO4.js +0 -65
  179. package/dist/index-DGjZW6uR.js +0 -78
  180. package/dist/index-DQe94z7X.js +0 -265
  181. package/dist/index-DTo6w99t.js +0 -7864
  182. package/dist/index-DYdXjap2.js +0 -320
  183. package/dist/index-DceCxNV5.js +0 -181
  184. package/dist/index-Uw9cSw0q.js +0 -294
  185. package/dist/index-qiuyrukh.js +0 -45
  186. package/dist/index-zddvaohA.js +0 -78
  187. package/dist/info-RfPsmroW.js +0 -7
  188. package/dist/info-circle-DFKHB_ZN.js +0 -16
  189. package/dist/lightbulb-B-Bykj9X.js +0 -7
  190. package/dist/mail-mBAgGuw5.js +0 -12
  191. package/dist/mobile-Dhh3ndkf.js +0 -13
  192. package/dist/more-D1h7UTvg.js +0 -15
  193. package/dist/network-placeholder-Dqynvc-t.js +0 -18
  194. package/dist/nftPlaceholder-Df7MW4MM.js +0 -12
  195. package/dist/off-BmG3cHTX.js +0 -12
  196. package/dist/onramp-C401Aenb.js +0 -1279
  197. package/dist/play-store-4q1fzL_P.js +0 -36
  198. package/dist/plus-603Gs3yG.js +0 -17
  199. package/dist/qr-code-Dgwhf6M1.js +0 -10
  200. package/dist/receive-CYXbbEUR.js +0 -186
  201. package/dist/recycle-horizontal-Bu8zZ563.js +0 -13
  202. package/dist/ref-DpmKRWBK.js +0 -41
  203. package/dist/refresh-BMZFu0mu.js +0 -12
  204. package/dist/reown-logo-BXph7ThY.js +0 -16
  205. package/dist/search-Cm_V42Y_.js +0 -12
  206. package/dist/secp256k1-C0iX1TUr.js +0 -1510
  207. package/dist/secp256k1-DOQBqE4Z.js +0 -1302
  208. package/dist/send-BSMYxDuP.js +0 -19
  209. package/dist/send-C8EeIzRB.js +0 -1038
  210. package/dist/socials-DQrHQajs.js +0 -574
  211. package/dist/swapHorizontal-98rnJewS.js +0 -12
  212. package/dist/swapHorizontalBold-C299FjEt.js +0 -12
  213. package/dist/swapHorizontalMedium-Cqm6i4WJ.js +0 -20
  214. package/dist/swapHorizontalRoundedBold-De7hFfqZ.js +0 -12
  215. package/dist/swapVertical-DSL75l8L.js +0 -12
  216. package/dist/swaps-BuTNp65Y.js +0 -1637
  217. package/dist/telegram-cJP7hgUb.js +0 -20
  218. package/dist/three-dots-DHnEh28O.js +0 -9
  219. package/dist/twitch-CR2iGcBo.js +0 -22
  220. package/dist/twitterIcon-E5TAQjOn.js +0 -10
  221. package/dist/verify-DEukUJp0.js +0 -12
  222. package/dist/verify-filled-BXsx1i_p.js +0 -12
  223. package/dist/w3m-modal-Bm7BqVng.js +0 -1037
  224. package/dist/wallet-CzyyvdrT.js +0 -12
  225. package/dist/wallet-placeholder-BrcmyGEe.js +0 -18
  226. package/dist/walletconnect-BSYogWiE.js +0 -36
  227. package/dist/warning-circle-Cgp2BW3m.js +0 -16
  228. package/dist/x-BJinLpTw.js +0 -16
@@ -1,1038 +0,0 @@
1
- import { cE as f, cF as w, d1 as I, cY as x, d6 as H, dT as l, cG as u, cH as z, cI as W, cJ as g, d7 as L, c_ as F, cZ as B, d8 as q, cX as M, d0 as Y } from "./index-BJ7cbG3N.js";
2
- import { n as d, r as c, c as m, U as b, o as G } from "./if-defined-CNte9B3N.js";
3
- import "./index-Uw9cSw0q.js";
4
- import "./index-CKikVKe2.js";
5
- import { e as O, n as D } from "./ref-DpmKRWBK.js";
6
- import { n as J, s as K } from "./ConstantsUtil-B-_-u8aQ.js";
7
- import "./index-BP4B9VUt.js";
8
- import { S as X } from "./index-7toZMdtG.js";
9
- import "./index-DQe94z7X.js";
10
- import "./index-BwnXTNNg.js";
11
- import "./index-qiuyrukh.js";
12
- import "./index-CmWdvIFT.js";
13
- const Z = f`
14
- :host {
15
- width: 100%;
16
- height: 100px;
17
- border-radius: var(--wui-border-radius-s);
18
- border: 1px solid var(--wui-color-gray-glass-002);
19
- background-color: var(--wui-color-gray-glass-002);
20
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
21
- will-change: background-color;
22
- position: relative;
23
- }
24
-
25
- :host(:hover) {
26
- background-color: var(--wui-color-gray-glass-005);
27
- }
28
-
29
- wui-flex {
30
- width: 100%;
31
- height: fit-content;
32
- }
33
-
34
- wui-button {
35
- display: ruby;
36
- color: var(--wui-color-fg-100);
37
- margin: 0 var(--wui-spacing-xs);
38
- }
39
-
40
- .instruction {
41
- position: absolute;
42
- top: 50%;
43
- transform: translateY(-50%);
44
- z-index: 2;
45
- }
46
-
47
- .paste {
48
- display: inline-flex;
49
- }
50
-
51
- textarea {
52
- background: transparent;
53
- width: 100%;
54
- font-family: var(--w3m-font-family);
55
- font-size: var(--wui-font-size-medium);
56
- font-style: normal;
57
- font-weight: var(--wui-font-weight-light);
58
- line-height: 130%;
59
- letter-spacing: var(--wui-letter-spacing-medium);
60
- color: var(--wui-color-fg-100);
61
- caret-color: var(--wui-color-accent-100);
62
- box-sizing: border-box;
63
- -webkit-appearance: none;
64
- -moz-appearance: textfield;
65
- padding: 0px;
66
- border: none;
67
- outline: none;
68
- appearance: none;
69
- resize: none;
70
- overflow: hidden;
71
- }
72
- `;
73
- var E = function(s, e, i, n) {
74
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
75
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
76
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
77
- return r > 3 && t && Object.defineProperty(e, i, t), t;
78
- };
79
- let C = class extends w {
80
- constructor() {
81
- super(...arguments), this.inputElementRef = O(), this.instructionElementRef = O(), this.instructionHidden = !!this.value, this.pasting = !1, this.onDebouncedSearch = I.debounce(async (e) => {
82
- if (!e.length) {
83
- this.setReceiverAddress("");
84
- return;
85
- }
86
- const i = x.state.activeChain;
87
- if (I.isAddress(e, i)) {
88
- this.setReceiverAddress(e);
89
- return;
90
- }
91
- try {
92
- const r = await H.getEnsAddress(e);
93
- if (r) {
94
- l.setReceiverProfileName(e), l.setReceiverAddress(r);
95
- const t = await H.getEnsAvatar(e);
96
- l.setReceiverProfileImageUrl(t || void 0);
97
- }
98
- } catch {
99
- this.setReceiverAddress(e);
100
- } finally {
101
- l.setLoading(!1);
102
- }
103
- });
104
- }
105
- firstUpdated() {
106
- this.value && (this.instructionHidden = !0), this.checkHidden();
107
- }
108
- render() {
109
- return u` <wui-flex
110
- @click=${this.onBoxClick.bind(this)}
111
- flexDirection="column"
112
- justifyContent="center"
113
- gap="4xs"
114
- .padding=${["2xl", "l", "xl", "l"]}
115
- >
116
- <wui-text
117
- ${D(this.instructionElementRef)}
118
- class="instruction"
119
- color="fg-300"
120
- variant="medium-400"
121
- >
122
- Type or
123
- <wui-button
124
- class="paste"
125
- size="md"
126
- variant="neutral"
127
- iconLeft="copy"
128
- @click=${this.onPasteClick.bind(this)}
129
- >
130
- <wui-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wui-icon>
131
- Paste
132
- </wui-button>
133
- address
134
- </wui-text>
135
- <textarea
136
- spellcheck="false"
137
- ?disabled=${!this.instructionHidden}
138
- ${D(this.inputElementRef)}
139
- @input=${this.onInputChange.bind(this)}
140
- @blur=${this.onBlur.bind(this)}
141
- .value=${this.value ?? ""}
142
- autocomplete="off"
143
- >
144
- ${this.value ?? ""}</textarea
145
- >
146
- </wui-flex>`;
147
- }
148
- async focusInput() {
149
- var e;
150
- 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));
151
- }
152
- async focusInstruction() {
153
- var e;
154
- this.instructionElementRef.value && (this.instructionHidden = !1, await this.toggleInstructionFocus(!0), this.instructionElementRef.value.style.pointerEvents = "auto", (e = this.inputElementRef.value) == null || e.blur());
155
- }
156
- async toggleInstructionFocus(e) {
157
- this.instructionElementRef.value && await this.instructionElementRef.value.animate([{ opacity: e ? 0 : 1 }, { opacity: e ? 1 : 0 }], {
158
- duration: 100,
159
- easing: "ease",
160
- fill: "forwards"
161
- }).finished;
162
- }
163
- onBoxClick() {
164
- !this.value && !this.instructionHidden && this.focusInput();
165
- }
166
- onBlur() {
167
- !this.value && this.instructionHidden && !this.pasting && this.focusInstruction();
168
- }
169
- checkHidden() {
170
- this.instructionHidden && this.focusInput();
171
- }
172
- async onPasteClick() {
173
- this.pasting = !0;
174
- const e = await navigator.clipboard.readText();
175
- l.setReceiverAddress(e), this.focusInput();
176
- }
177
- onInputChange(e) {
178
- var n;
179
- const i = e.target;
180
- 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);
181
- }
182
- setReceiverAddress(e) {
183
- l.setReceiverAddress(e), l.setReceiverProfileName(void 0), l.setReceiverProfileImageUrl(void 0), l.setLoading(!1);
184
- }
185
- };
186
- C.styles = Z;
187
- E([
188
- d()
189
- ], C.prototype, "value", void 0);
190
- E([
191
- c()
192
- ], C.prototype, "instructionHidden", void 0);
193
- E([
194
- c()
195
- ], C.prototype, "pasting", void 0);
196
- C = E([
197
- m("w3m-input-address")
198
- ], C);
199
- const Q = f`
200
- :host {
201
- position: relative;
202
- display: inline-block;
203
- }
204
-
205
- input {
206
- background: transparent;
207
- width: 100%;
208
- height: auto;
209
- font-family: var(--wui-font-family);
210
- color: var(--wui-color-fg-100);
211
-
212
- font-feature-settings: 'case' on;
213
- font-size: 32px;
214
- font-weight: var(--wui-font-weight-light);
215
- caret-color: var(--wui-color-accent-100);
216
- line-height: 130%;
217
- letter-spacing: -1.28px;
218
- box-sizing: border-box;
219
- -webkit-appearance: none;
220
- -moz-appearance: textfield;
221
- padding: 0px;
222
- }
223
-
224
- input::-webkit-outer-spin-button,
225
- input::-webkit-inner-spin-button {
226
- -webkit-appearance: none;
227
- margin: 0;
228
- }
229
-
230
- input::placeholder {
231
- color: var(--wui-color-fg-275);
232
- }
233
- `;
234
- var j = function(s, e, i, n) {
235
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
236
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
237
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
238
- return r > 3 && t && Object.defineProperty(e, i, t), t;
239
- };
240
- let A = class extends w {
241
- constructor() {
242
- super(...arguments), this.inputElementRef = O(), this.disabled = !1, this.value = "", this.placeholder = "0";
243
- }
244
- render() {
245
- var e;
246
- return (e = this.inputElementRef) != null && e.value && this.value && (this.inputElementRef.value.value = this.value), u`<input
247
- ${D(this.inputElementRef)}
248
- type="text"
249
- inputmode="decimal"
250
- pattern="[0-9,.]*"
251
- placeholder=${this.placeholder}
252
- ?disabled=${this.disabled}
253
- autofocus
254
- value=${this.value ?? ""}
255
- @input=${this.dispatchInputChangeEvent.bind(this)}
256
- /> `;
257
- }
258
- dispatchInputChangeEvent(e) {
259
- var n, r;
260
- const i = e.data;
261
- if (i && ((n = this.inputElementRef) != null && n.value))
262
- if (i === ",") {
263
- const t = this.inputElementRef.value.value.replace(",", ".");
264
- this.inputElementRef.value.value = t, this.value = `${this.value}${t}`;
265
- } else J.test(i) || (this.inputElementRef.value.value = this.value.replace(new RegExp(i.replace(K, "\\$&"), "gu"), ""));
266
- this.dispatchEvent(new CustomEvent("inputChange", {
267
- detail: (r = this.inputElementRef.value) == null ? void 0 : r.value,
268
- bubbles: !0,
269
- composed: !0
270
- }));
271
- }
272
- };
273
- A.styles = [z, W, Q];
274
- j([
275
- d({ type: Boolean })
276
- ], A.prototype, "disabled", void 0);
277
- j([
278
- d({ type: String })
279
- ], A.prototype, "value", void 0);
280
- j([
281
- d({ type: String })
282
- ], A.prototype, "placeholder", void 0);
283
- A = j([
284
- m("wui-input-amount")
285
- ], A);
286
- const ee = f`
287
- :host {
288
- width: 100%;
289
- height: 100px;
290
- border-radius: var(--wui-border-radius-s);
291
- border: 1px solid var(--wui-color-gray-glass-002);
292
- background-color: var(--wui-color-gray-glass-002);
293
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
294
- will-change: background-color;
295
- }
296
-
297
- :host(:hover) {
298
- background-color: var(--wui-color-gray-glass-005);
299
- }
300
-
301
- wui-flex {
302
- width: 100%;
303
- height: fit-content;
304
- }
305
-
306
- wui-button {
307
- width: 100%;
308
- display: flex;
309
- justify-content: flex-end;
310
- }
311
-
312
- wui-input-amount {
313
- mask-image: linear-gradient(
314
- 270deg,
315
- transparent 0px,
316
- transparent 8px,
317
- black 24px,
318
- black 25px,
319
- black 32px,
320
- black 100%
321
- );
322
- }
323
-
324
- .totalValue {
325
- width: 100%;
326
- }
327
- `;
328
- var V = function(s, e, i, n) {
329
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
330
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
331
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
332
- return r > 3 && t && Object.defineProperty(e, i, t), t;
333
- };
334
- let R = class extends w {
335
- render() {
336
- return u` <wui-flex
337
- flexDirection="column"
338
- gap="4xs"
339
- .padding=${["xl", "s", "l", "l"]}
340
- >
341
- <wui-flex alignItems="center">
342
- <wui-input-amount
343
- @inputChange=${this.onInputChange.bind(this)}
344
- ?disabled=${!this.token && !0}
345
- .value=${this.sendTokenAmount ? String(this.sendTokenAmount) : ""}
346
- ></wui-input-amount>
347
- ${this.buttonTemplate()}
348
- </wui-flex>
349
- <wui-flex alignItems="center" justifyContent="space-between">
350
- ${this.sendValueTemplate()}
351
- <wui-flex alignItems="center" gap="4xs" justifyContent="flex-end">
352
- ${this.maxAmountTemplate()} ${this.actionTemplate()}
353
- </wui-flex>
354
- </wui-flex>
355
- </wui-flex>`;
356
- }
357
- buttonTemplate() {
358
- return this.token ? u`<wui-token-button
359
- text=${this.token.symbol}
360
- imageSrc=${this.token.iconUrl}
361
- @click=${this.handleSelectButtonClick.bind(this)}
362
- >
363
- </wui-token-button>` : u`<wui-button
364
- size="md"
365
- variant="accent"
366
- @click=${this.handleSelectButtonClick.bind(this)}
367
- >Select token</wui-button
368
- >`;
369
- }
370
- handleSelectButtonClick() {
371
- g.push("WalletSendSelectToken");
372
- }
373
- sendValueTemplate() {
374
- if (this.token && this.sendTokenAmount) {
375
- const i = this.token.price * this.sendTokenAmount;
376
- return u`<wui-text class="totalValue" variant="small-400" color="fg-200"
377
- >${i ? `$${b.formatNumberToLocalString(i, 2)}` : "Incorrect value"}</wui-text
378
- >`;
379
- }
380
- return null;
381
- }
382
- maxAmountTemplate() {
383
- return this.token ? this.sendTokenAmount && this.sendTokenAmount > Number(this.token.quantity.numeric) ? u` <wui-text variant="small-400" color="error-100">
384
- ${b.roundNumber(Number(this.token.quantity.numeric), 6, 5)}
385
- </wui-text>` : u` <wui-text variant="small-400" color="fg-200">
386
- ${b.roundNumber(Number(this.token.quantity.numeric), 6, 5)}
387
- </wui-text>` : null;
388
- }
389
- actionTemplate() {
390
- 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;
391
- }
392
- onInputChange(e) {
393
- l.setTokenAmount(e.detail);
394
- }
395
- onMaxClick() {
396
- if (this.token) {
397
- const e = L.bigNumber(this.token.quantity.numeric);
398
- l.setTokenAmount(Number(e.toFixed(20)));
399
- }
400
- }
401
- onBuyClick() {
402
- g.push("OnRampProviders");
403
- }
404
- };
405
- R.styles = ee;
406
- V([
407
- d({ type: Object })
408
- ], R.prototype, "token", void 0);
409
- V([
410
- d({ type: Number })
411
- ], R.prototype, "sendTokenAmount", void 0);
412
- R = V([
413
- m("w3m-input-token")
414
- ], R);
415
- const te = f`
416
- :host {
417
- display: block;
418
- }
419
-
420
- wui-flex {
421
- position: relative;
422
- }
423
-
424
- wui-icon-box {
425
- width: 40px;
426
- height: 40px;
427
- border-radius: var(--wui-border-radius-xs) !important;
428
- border: 5px solid var(--wui-color-bg-125);
429
- background: var(--wui-color-bg-175);
430
- position: absolute;
431
- top: 50%;
432
- left: 50%;
433
- transform: translate(-50%, -50%);
434
- z-index: 3;
435
- }
436
-
437
- wui-button {
438
- --local-border-radius: var(--wui-border-radius-xs) !important;
439
- }
440
-
441
- .inputContainer {
442
- height: fit-content;
443
- }
444
- `;
445
- var $ = function(s, e, i, n) {
446
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
447
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
448
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
449
- return r > 3 && t && Object.defineProperty(e, i, t), t;
450
- };
451
- let h = class extends w {
452
- constructor() {
453
- 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) => {
454
- this.token = e.token, this.sendTokenAmount = e.sendTokenAmount, this.receiverAddress = e.receiverAddress, this.receiverProfileName = e.receiverProfileName, this.loading = e.loading;
455
- }));
456
- }
457
- disconnectedCallback() {
458
- this.unsubscribe.forEach((e) => e());
459
- }
460
- render() {
461
- return this.getMessage(), u` <wui-flex flexDirection="column" .padding=${["0", "l", "l", "l"]}>
462
- <wui-flex class="inputContainer" gap="xs" flexDirection="column">
463
- <w3m-input-token
464
- .token=${this.token}
465
- .sendTokenAmount=${this.sendTokenAmount}
466
- ></w3m-input-token>
467
- <wui-icon-box
468
- size="inherit"
469
- backgroundColor="fg-300"
470
- iconSize="lg"
471
- iconColor="fg-250"
472
- background="opaque"
473
- icon="arrowBottom"
474
- ></wui-icon-box>
475
- <w3m-input-address
476
- .value=${this.receiverProfileName ? this.receiverProfileName : this.receiverAddress}
477
- ></w3m-input-address>
478
- </wui-flex>
479
- <wui-flex .margin=${["l", "0", "0", "0"]}>
480
- <wui-button
481
- @click=${this.onButtonClick.bind(this)}
482
- ?disabled=${!this.message.startsWith("Preview Send")}
483
- size="lg"
484
- variant="main"
485
- ?loading=${this.loading}
486
- fullWidth
487
- >
488
- ${this.message}
489
- </wui-button>
490
- </wui-flex>
491
- </wui-flex>`;
492
- }
493
- async fetchBalances() {
494
- await l.fetchTokenBalance(), l.fetchNetworkBalance();
495
- }
496
- async fetchNetworkPrice() {
497
- await X.getNetworkTokenPrice();
498
- }
499
- onButtonClick() {
500
- g.push("WalletSendPreview");
501
- }
502
- getMessage() {
503
- var e;
504
- 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");
505
- }
506
- };
507
- h.styles = te;
508
- $([
509
- c()
510
- ], h.prototype, "token", void 0);
511
- $([
512
- c()
513
- ], h.prototype, "sendTokenAmount", void 0);
514
- $([
515
- c()
516
- ], h.prototype, "receiverAddress", void 0);
517
- $([
518
- c()
519
- ], h.prototype, "receiverProfileName", void 0);
520
- $([
521
- c()
522
- ], h.prototype, "loading", void 0);
523
- $([
524
- c()
525
- ], h.prototype, "message", void 0);
526
- h = $([
527
- m("w3m-wallet-send-view")
528
- ], h);
529
- const ie = f`
530
- .contentContainer {
531
- height: 440px;
532
- overflow: scroll;
533
- scrollbar-width: none;
534
- }
535
-
536
- .contentContainer::-webkit-scrollbar {
537
- display: none;
538
- }
539
-
540
- wui-icon-box {
541
- width: 40px;
542
- height: 40px;
543
- border-radius: var(--wui-border-radius-xxs);
544
- }
545
- `;
546
- var P = function(s, e, i, n) {
547
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
548
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
549
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
550
- return r > 3 && t && Object.defineProperty(e, i, t), t;
551
- };
552
- let k = class extends w {
553
- constructor() {
554
- super(), this.unsubscribe = [], this.tokenBalances = l.state.tokenBalances, this.search = "", this.onDebouncedSearch = I.debounce((e) => {
555
- this.search = e;
556
- }), this.unsubscribe.push(l.subscribe((e) => {
557
- this.tokenBalances = e.tokenBalances;
558
- }));
559
- }
560
- disconnectedCallback() {
561
- this.unsubscribe.forEach((e) => e());
562
- }
563
- render() {
564
- return u`
565
- <wui-flex flexDirection="column">
566
- ${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
567
- </wui-flex>
568
- `;
569
- }
570
- templateSearchInput() {
571
- return u`
572
- <wui-flex gap="xs" padding="s">
573
- <wui-input-text
574
- @inputChange=${this.onInputChange.bind(this)}
575
- class="network-search-input"
576
- size="sm"
577
- placeholder="Search token"
578
- icon="search"
579
- ></wui-input-text>
580
- </wui-flex>
581
- `;
582
- }
583
- templateTokens() {
584
- var e, i;
585
- return this.tokens = (e = this.tokenBalances) == null ? void 0 : e.filter((n) => {
586
- var r;
587
- return n.chainId === ((r = x.state.activeCaipNetwork) == null ? void 0 : r.caipNetworkId);
588
- }), 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`
589
- <wui-flex
590
- class="contentContainer"
591
- flexDirection="column"
592
- .padding=${["0", "s", "0", "s"]}
593
- >
594
- <wui-flex justifyContent="flex-start" .padding=${["m", "s", "s", "s"]}>
595
- <wui-text variant="paragraph-500" color="fg-200">Your tokens</wui-text>
596
- </wui-flex>
597
- <wui-flex flexDirection="column" gap="xs">
598
- ${this.filteredTokens && this.filteredTokens.length > 0 ? this.filteredTokens.map((n) => u`<wui-list-token
599
- @click=${this.handleTokenClick.bind(this, n)}
600
- ?clickable=${!0}
601
- tokenName=${n.name}
602
- tokenImageUrl=${n.iconUrl}
603
- tokenAmount=${n.quantity.numeric}
604
- tokenValue=${n.value}
605
- tokenCurrency=${n.symbol}
606
- ></wui-list-token>`) : u`<wui-flex
607
- .padding=${["4xl", "0", "0", "0"]}
608
- alignItems="center"
609
- flexDirection="column"
610
- gap="l"
611
- >
612
- <wui-icon-box
613
- icon="coinPlaceholder"
614
- size="inherit"
615
- iconColor="fg-200"
616
- backgroundColor="fg-200"
617
- iconSize="lg"
618
- ></wui-icon-box>
619
- <wui-flex
620
- class="textContent"
621
- gap="xs"
622
- flexDirection="column"
623
- justifyContent="center"
624
- flexDirection="column"
625
- >
626
- <wui-text variant="paragraph-500" align="center" color="fg-100"
627
- >No tokens found</wui-text
628
- >
629
- <wui-text variant="small-400" align="center" color="fg-200"
630
- >Your tokens will appear here</wui-text
631
- >
632
- </wui-flex>
633
- <wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
634
- </wui-flex>`}
635
- </wui-flex>
636
- </wui-flex>
637
- `;
638
- }
639
- onBuyClick() {
640
- g.push("OnRampProviders");
641
- }
642
- onInputChange(e) {
643
- this.onDebouncedSearch(e.detail);
644
- }
645
- handleTokenClick(e) {
646
- l.setToken(e), l.setTokenAmount(void 0), g.goBack();
647
- }
648
- };
649
- k.styles = ie;
650
- P([
651
- c()
652
- ], k.prototype, "tokenBalances", void 0);
653
- P([
654
- c()
655
- ], k.prototype, "tokens", void 0);
656
- P([
657
- c()
658
- ], k.prototype, "filteredTokens", void 0);
659
- P([
660
- c()
661
- ], k.prototype, "search", void 0);
662
- k = P([
663
- m("w3m-wallet-send-select-token-view")
664
- ], k);
665
- const ne = f`
666
- :host {
667
- display: flex;
668
- gap: var(--wui-spacing-xs);
669
- border-radius: var(--wui-border-radius-3xl);
670
- border: 1px solid var(--wui-color-gray-glass-002);
671
- background: var(--wui-color-gray-glass-002);
672
- padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs)
673
- var(--wui-spacing-s);
674
- align-items: center;
675
- }
676
-
677
- wui-avatar,
678
- wui-icon,
679
- wui-image {
680
- width: 32px;
681
- height: 32px;
682
- border: 1px solid var(--wui-color-gray-glass-002);
683
- border-radius: var(--wui-border-radius-3xl);
684
- box-shadow: 0 0 0 2px var(--wui-color-gray-glass-002);
685
- }
686
- `;
687
- var N = function(s, e, i, n) {
688
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
689
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
690
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
691
- return r > 3 && t && Object.defineProperty(e, i, t), t;
692
- };
693
- let y = class extends w {
694
- constructor() {
695
- super(...arguments), this.text = "", this.address = "", this.isAddress = !1;
696
- }
697
- render() {
698
- return u`<wui-text variant="large-500" color="fg-100">${this.text}</wui-text>
699
- ${this.imageTemplate()}`;
700
- }
701
- imageTemplate() {
702
- 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>`;
703
- }
704
- };
705
- y.styles = [z, W, ne];
706
- N([
707
- d()
708
- ], y.prototype, "text", void 0);
709
- N([
710
- d()
711
- ], y.prototype, "address", void 0);
712
- N([
713
- d()
714
- ], y.prototype, "imageSrc", void 0);
715
- N([
716
- d({ type: Boolean })
717
- ], y.prototype, "isAddress", void 0);
718
- y = N([
719
- m("wui-preview-item")
720
- ], y);
721
- const re = f`
722
- :host {
723
- display: flex;
724
- column-gap: var(--wui-spacing-s);
725
- padding: 17px 18px 17px var(--wui-spacing-m);
726
- width: 100%;
727
- background-color: var(--wui-color-gray-glass-002);
728
- border-radius: var(--wui-border-radius-xs);
729
- color: var(--wui-color-fg-250);
730
- }
731
-
732
- wui-image {
733
- width: var(--wui-icon-size-lg);
734
- height: var(--wui-icon-size-lg);
735
- border-radius: var(--wui-border-radius-3xl);
736
- }
737
-
738
- wui-icon {
739
- width: var(--wui-icon-size-lg);
740
- height: var(--wui-icon-size-lg);
741
- }
742
- `;
743
- var _ = function(s, e, i, n) {
744
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
745
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
746
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
747
- return r > 3 && t && Object.defineProperty(e, i, t), t;
748
- };
749
- let T = class extends w {
750
- constructor() {
751
- super(...arguments), this.imageSrc = void 0, this.textTitle = "", this.textValue = void 0;
752
- }
753
- render() {
754
- return u`
755
- <wui-flex justifyContent="space-between" alignItems="center">
756
- <wui-text variant="paragraph-500" color=${this.textValue ? "fg-200" : "fg-100"}>
757
- ${this.textTitle}
758
- </wui-text>
759
- ${this.templateContent()}
760
- </wui-flex>
761
- `;
762
- }
763
- templateContent() {
764
- 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>`;
765
- }
766
- };
767
- T.styles = [z, W, re];
768
- _([
769
- d()
770
- ], T.prototype, "imageSrc", void 0);
771
- _([
772
- d()
773
- ], T.prototype, "textTitle", void 0);
774
- _([
775
- d()
776
- ], T.prototype, "textValue", void 0);
777
- T = _([
778
- m("wui-list-content")
779
- ], T);
780
- const oe = f`
781
- :host {
782
- display: flex;
783
- width: auto;
784
- flex-direction: column;
785
- gap: var(--wui-border-radius-1xs);
786
- border-radius: var(--wui-border-radius-s);
787
- background: var(--wui-color-gray-glass-002);
788
- padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs)
789
- var(--wui-spacing-1xs);
790
- }
791
-
792
- wui-text {
793
- padding: 0 var(--wui-spacing-1xs);
794
- }
795
-
796
- wui-flex {
797
- margin-top: var(--wui-spacing-1xs);
798
- }
799
-
800
- .network {
801
- cursor: pointer;
802
- transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg);
803
- will-change: background-color;
804
- }
805
-
806
- .network:focus-visible {
807
- border: 1px solid var(--wui-color-accent-100);
808
- background-color: var(--wui-color-gray-glass-005);
809
- -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
810
- -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
811
- box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue);
812
- }
813
-
814
- .network:hover {
815
- background-color: var(--wui-color-gray-glass-005);
816
- }
817
-
818
- .network:active {
819
- background-color: var(--wui-color-gray-glass-010);
820
- }
821
- `;
822
- var U = function(s, e, i, n) {
823
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
824
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
825
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
826
- return r > 3 && t && Object.defineProperty(e, i, t), t;
827
- };
828
- let S = class extends w {
829
- render() {
830
- return u` <wui-text variant="small-400" color="fg-200">Details</wui-text>
831
- <wui-flex flexDirection="column" gap="xxs">
832
- <wui-list-content
833
- textTitle="Address"
834
- textValue=${b.getTruncateString({
835
- string: this.receiverAddress ?? "",
836
- charsStart: 4,
837
- charsEnd: 4,
838
- truncate: "middle"
839
- })}
840
- >
841
- </wui-list-content>
842
- ${this.networkTemplate()}
843
- </wui-flex>`;
844
- }
845
- networkTemplate() {
846
- var e;
847
- return (e = this.caipNetwork) != null && e.name ? u` <wui-list-content
848
- @click=${() => this.onNetworkClick(this.caipNetwork)}
849
- class="network"
850
- textTitle="Network"
851
- imageSrc=${G(F.getNetworkImage(this.caipNetwork))}
852
- ></wui-list-content>` : null;
853
- }
854
- onNetworkClick(e) {
855
- e && g.push("Networks", { network: e });
856
- }
857
- };
858
- S.styles = oe;
859
- U([
860
- d()
861
- ], S.prototype, "receiverAddress", void 0);
862
- U([
863
- d({ type: Object })
864
- ], S.prototype, "caipNetwork", void 0);
865
- S = U([
866
- m("w3m-wallet-send-details")
867
- ], S);
868
- const se = f`
869
- wui-avatar,
870
- wui-image {
871
- display: ruby;
872
- width: 32px;
873
- height: 32px;
874
- border-radius: var(--wui-border-radius-3xl);
875
- }
876
-
877
- .sendButton {
878
- width: 70%;
879
- --local-width: 100% !important;
880
- --local-border-radius: var(--wui-border-radius-xs) !important;
881
- }
882
-
883
- .cancelButton {
884
- width: 30%;
885
- --local-width: 100% !important;
886
- --local-border-radius: var(--wui-border-radius-xs) !important;
887
- }
888
- `;
889
- var v = function(s, e, i, n) {
890
- var r = arguments.length, t = r < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, o;
891
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") t = Reflect.decorate(s, e, i, n);
892
- else for (var a = s.length - 1; a >= 0; a--) (o = s[a]) && (t = (r < 3 ? o(t) : r > 3 ? o(e, i, t) : o(e, i)) || t);
893
- return r > 3 && t && Object.defineProperty(e, i, t), t;
894
- };
895
- let p = class extends w {
896
- constructor() {
897
- 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) => {
898
- this.token = e.token, this.sendTokenAmount = e.sendTokenAmount, this.receiverAddress = e.receiverAddress, this.receiverProfileName = e.receiverProfileName, this.receiverProfileImageUrl = e.receiverProfileImageUrl, this.loading = e.loading;
899
- }), x.subscribeKey("activeCaipNetwork", (e) => this.caipNetwork = e));
900
- }
901
- disconnectedCallback() {
902
- this.unsubscribe.forEach((e) => e());
903
- }
904
- render() {
905
- var e, i;
906
- return u` <wui-flex flexDirection="column" .padding=${["0", "l", "l", "l"]}>
907
- <wui-flex gap="xs" flexDirection="column" .padding=${["0", "xs", "0", "xs"]}>
908
- <wui-flex alignItems="center" justifyContent="space-between">
909
- <wui-flex flexDirection="column" gap="4xs">
910
- <wui-text variant="small-400" color="fg-150">Send</wui-text>
911
- ${this.sendValueTemplate()}
912
- </wui-flex>
913
- <wui-preview-item
914
- text="${this.sendTokenAmount ? b.roundNumber(this.sendTokenAmount, 6, 5) : "unknown"} ${(e = this.token) == null ? void 0 : e.symbol}"
915
- .imageSrc=${(i = this.token) == null ? void 0 : i.iconUrl}
916
- ></wui-preview-item>
917
- </wui-flex>
918
- <wui-flex>
919
- <wui-icon color="fg-200" size="md" name="arrowBottom"></wui-icon>
920
- </wui-flex>
921
- <wui-flex alignItems="center" justifyContent="space-between">
922
- <wui-text variant="small-400" color="fg-150">To</wui-text>
923
- <wui-preview-item
924
- text="${this.receiverProfileName ? b.getTruncateString({
925
- string: this.receiverProfileName,
926
- charsStart: 20,
927
- charsEnd: 0,
928
- truncate: "end"
929
- }) : b.getTruncateString({
930
- string: this.receiverAddress ? this.receiverAddress : "",
931
- charsStart: 4,
932
- charsEnd: 4,
933
- truncate: "middle"
934
- })}"
935
- address=${this.receiverAddress ?? ""}
936
- .imageSrc=${this.receiverProfileImageUrl ?? void 0}
937
- .isAddress=${!0}
938
- ></wui-preview-item>
939
- </wui-flex>
940
- </wui-flex>
941
- <wui-flex flexDirection="column" .padding=${["xxl", "0", "0", "0"]}>
942
- <w3m-wallet-send-details
943
- .caipNetwork=${this.caipNetwork}
944
- .receiverAddress=${this.receiverAddress}
945
- ></w3m-wallet-send-details>
946
- <wui-flex justifyContent="center" gap="xxs" .padding=${["s", "0", "0", "0"]}>
947
- <wui-icon size="sm" color="fg-200" name="warningCircle"></wui-icon>
948
- <wui-text variant="small-400" color="fg-200">Review transaction carefully</wui-text>
949
- </wui-flex>
950
- <wui-flex justifyContent="center" gap="s" .padding=${["l", "0", "0", "0"]}>
951
- <wui-button
952
- class="cancelButton"
953
- @click=${this.onCancelClick.bind(this)}
954
- size="lg"
955
- variant="neutral"
956
- >
957
- Cancel
958
- </wui-button>
959
- <wui-button
960
- class="sendButton"
961
- @click=${this.onSendClick.bind(this)}
962
- size="lg"
963
- variant="main"
964
- .loading=${this.loading}
965
- >
966
- Send
967
- </wui-button>
968
- </wui-flex>
969
- </wui-flex></wui-flex
970
- >`;
971
- }
972
- sendValueTemplate() {
973
- if (this.token && this.sendTokenAmount) {
974
- const i = this.token.price * this.sendTokenAmount;
975
- return u`<wui-text variant="paragraph-400" color="fg-100"
976
- >$${i.toFixed(2)}</wui-text
977
- >`;
978
- }
979
- return null;
980
- }
981
- async onSendClick() {
982
- var e, i, n;
983
- if (!this.sendTokenAmount || !this.receiverAddress) {
984
- B.showError("Please enter a valid amount and receiver address");
985
- return;
986
- }
987
- try {
988
- await l.sendToken(), B.showSuccess("Transaction started"), g.replace("Account");
989
- } catch (r) {
990
- B.showError("Failed to send transaction. Please try again."), console.error("SendController:sendToken - failed to send transaction", r);
991
- const t = x.state.activeChain, o = r instanceof Error ? r.message : "Unknown error";
992
- q.sendEvent({
993
- type: "track",
994
- event: "SEND_ERROR",
995
- properties: {
996
- message: o,
997
- isSmartAccount: ((e = M.state.preferredAccountTypes) == null ? void 0 : e[t]) === Y.ACCOUNT_TYPES.SMART_ACCOUNT,
998
- token: ((i = this.token) == null ? void 0 : i.symbol) || "",
999
- amount: this.sendTokenAmount,
1000
- network: ((n = x.state.activeCaipNetwork) == null ? void 0 : n.caipNetworkId) || ""
1001
- }
1002
- });
1003
- }
1004
- }
1005
- onCancelClick() {
1006
- g.goBack();
1007
- }
1008
- };
1009
- p.styles = se;
1010
- v([
1011
- c()
1012
- ], p.prototype, "token", void 0);
1013
- v([
1014
- c()
1015
- ], p.prototype, "sendTokenAmount", void 0);
1016
- v([
1017
- c()
1018
- ], p.prototype, "receiverAddress", void 0);
1019
- v([
1020
- c()
1021
- ], p.prototype, "receiverProfileName", void 0);
1022
- v([
1023
- c()
1024
- ], p.prototype, "receiverProfileImageUrl", void 0);
1025
- v([
1026
- c()
1027
- ], p.prototype, "caipNetwork", void 0);
1028
- v([
1029
- c()
1030
- ], p.prototype, "loading", void 0);
1031
- p = v([
1032
- m("w3m-wallet-send-preview-view")
1033
- ], p);
1034
- export {
1035
- k as W3mSendSelectTokenView,
1036
- p as W3mWalletSendPreviewView,
1037
- h as W3mWalletSendView
1038
- };