@directcryptopay/sdk 0.1.0

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 (141) hide show
  1. package/README.md +357 -0
  2. package/dist/ConstantsUtil-B-_-u8aQ.js +6 -0
  3. package/dist/add-KF4m4jFK.js +19 -0
  4. package/dist/all-wallets-D6NAjQgX.js +10 -0
  5. package/dist/app-store-D7TTn-EO.js +21 -0
  6. package/dist/apple-DjX2E2hE.js +22 -0
  7. package/dist/arrow-bottom-C0YrNJYB.js +12 -0
  8. package/dist/arrow-bottom-circle-Dlxvx_XG.js +15 -0
  9. package/dist/arrow-left-x8_-lUyK.js +12 -0
  10. package/dist/arrow-right-BTZybj80.js +12 -0
  11. package/dist/arrow-top-LzH7iLCp.js +12 -0
  12. package/dist/bank-23jp-IV_.js +18 -0
  13. package/dist/browser-EjoorDid.js +18 -0
  14. package/dist/card-DGgWwtwC.js +18 -0
  15. package/dist/ccip-BMANewTU.js +150 -0
  16. package/dist/checkmark-B1qcQhBo.js +15 -0
  17. package/dist/checkmark-bold-Cyc4IEEJ.js +12 -0
  18. package/dist/chevron-bottom-ClHs08rB.js +12 -0
  19. package/dist/chevron-left-O8h_551_.js +12 -0
  20. package/dist/chevron-right-DP3xpyIA.js +12 -0
  21. package/dist/chevron-top-CuwkBUs9.js +12 -0
  22. package/dist/chrome-store-zfT_aJ3R.js +65 -0
  23. package/dist/clock-DHZqivIS.js +12 -0
  24. package/dist/close-Cp9rNAw4.js +12 -0
  25. package/dist/coinPlaceholder-U7-T1KKQ.js +12 -0
  26. package/dist/compass-Ds5-PRSR.js +12 -0
  27. package/dist/copy-Jg4HdIMf.js +19 -0
  28. package/dist/core/api.d.ts +30 -0
  29. package/dist/core/config.d.ts +59 -0
  30. package/dist/core/logic.d.ts +2 -0
  31. package/dist/core/wallet.d.ts +34 -0
  32. package/dist/cursor-DmMevduB.js +7 -0
  33. package/dist/cursor-transparent-Dn9-1SV8.js +16 -0
  34. package/dist/dcp-sdk.umd.js +12000 -0
  35. package/dist/dcp.d.ts +10 -0
  36. package/dist/desktop-C4udXXlZ.js +13 -0
  37. package/dist/disconnect-wd1BYLxt.js +12 -0
  38. package/dist/discord-DthxuCAP.js +21 -0
  39. package/dist/email-B3jSnUFE.js +696 -0
  40. package/dist/embedded-wallet-CJHmoBI2.js +468 -0
  41. package/dist/etherscan-Cjp4xfMW.js +10 -0
  42. package/dist/exclamation-triangle-CRNR5WOy.js +8 -0
  43. package/dist/extension-Cydk0mZt.js +12 -0
  44. package/dist/external-link-CuPTAoq9.js +12 -0
  45. package/dist/facebook-CghqXmdf.js +30 -0
  46. package/dist/farcaster-BREqMX4y.js +16 -0
  47. package/dist/filters-Dn_Ys7ew.js +12 -0
  48. package/dist/github-C-A7JmIY.js +22 -0
  49. package/dist/google-CCdM_naE.js +22 -0
  50. package/dist/hashTypedData-D2Qmzscs.js +197 -0
  51. package/dist/help-circle-DIH4vyj3.js +16 -0
  52. package/dist/id-DkJ0gBuy.js +16 -0
  53. package/dist/if-defined-BciplFKz.js +744 -0
  54. package/dist/image-qMjyiXM0.js +8 -0
  55. package/dist/index--3Zp0jAb.js +45 -0
  56. package/dist/index-1adX-Fit.js +65 -0
  57. package/dist/index-AvC0IGDl.js +7864 -0
  58. package/dist/index-B2-vKLd8.js +276 -0
  59. package/dist/index-B2iDt0TJ.js +146 -0
  60. package/dist/index-B5zkXsLJ.js +320 -0
  61. package/dist/index-B7K86vWu.js +1742 -0
  62. package/dist/index-BBkcvSiY.js +511 -0
  63. package/dist/index-BdjxQs66.js +181 -0
  64. package/dist/index-Bijd4_Ns.js +294 -0
  65. package/dist/index-BpXOsxzU.js +387 -0
  66. package/dist/index-C1QEJL-2.js +572 -0
  67. package/dist/index-C27dwOyE.js +243 -0
  68. package/dist/index-C4BX3QW8.js +58 -0
  69. package/dist/index-CMPIqsB1.js +170 -0
  70. package/dist/index-CTYngdl0.js +21991 -0
  71. package/dist/index-CUdQyyFn.js +51 -0
  72. package/dist/index-CX60z_g2.js +573 -0
  73. package/dist/index-CppCc1n8.js +65 -0
  74. package/dist/index-CqVegmN4.js +559 -0
  75. package/dist/index-CuiyMA8F.js +78 -0
  76. package/dist/index-CwB_qRfM.js +305 -0
  77. package/dist/index-CxOF7GqE.js +265 -0
  78. package/dist/index-D-IzHD_8.js +54 -0
  79. package/dist/index-DRNiFv9I.js +218 -0
  80. package/dist/index-Da8oZh8H.js +838 -0
  81. package/dist/index-DiHImG4L.js +44236 -0
  82. package/dist/index-DmOMXRG1.js +181 -0
  83. package/dist/index-DoSYqTQg.js +199 -0
  84. package/dist/index-DpHXq5_E.js +603 -0
  85. package/dist/index-DtCsAVBg.js +78 -0
  86. package/dist/index-Ij6XA6_4.js +77 -0
  87. package/dist/index-SzyBYfzA.js +8490 -0
  88. package/dist/index-eW8y-mXH.js +257 -0
  89. package/dist/index-fxzIDZsb.js +75 -0
  90. package/dist/index-lbhz9evJ.js +97 -0
  91. package/dist/index.d.ts +3 -0
  92. package/dist/index.js +4 -0
  93. package/dist/info-DMIGgjkL.js +7 -0
  94. package/dist/info-circle-CJuIKZSx.js +16 -0
  95. package/dist/lightbulb-qFT6WEWV.js +7 -0
  96. package/dist/localBatchGatewayRequest-CsMVMFBc.js +91 -0
  97. package/dist/mail-DoYgQvOt.js +12 -0
  98. package/dist/mobile-URtsh7o-.js +13 -0
  99. package/dist/more-DoQd10TF.js +15 -0
  100. package/dist/network-placeholder-BBA2Ue6C.js +18 -0
  101. package/dist/nftPlaceholder-C9RXWz9k.js +12 -0
  102. package/dist/off-YcuDQczT.js +12 -0
  103. package/dist/onramp-BfqDIx4o.js +1279 -0
  104. package/dist/parseSignature-280HB24T.js +3560 -0
  105. package/dist/play-store-sFaloG_r.js +36 -0
  106. package/dist/plus-l0wekSht.js +17 -0
  107. package/dist/qr-code-CihrUU4G.js +10 -0
  108. package/dist/receive-dfY1Cu-g.js +186 -0
  109. package/dist/recycle-horizontal-nXu6YaPw.js +13 -0
  110. package/dist/ref-huAzXCX0.js +41 -0
  111. package/dist/refresh-D2ZbVeNC.js +12 -0
  112. package/dist/reown-logo-BMaTMJmc.js +16 -0
  113. package/dist/search-YVM9q3J-.js +12 -0
  114. package/dist/secp256k1-BrysY3Sv.js +1302 -0
  115. package/dist/secp256k1-DPQgTBwQ.js +1510 -0
  116. package/dist/send-BwQZPKxI.js +19 -0
  117. package/dist/send-GyetMVu1.js +1038 -0
  118. package/dist/socials-B0W91J9k.js +574 -0
  119. package/dist/swapHorizontal-Dy_oQEkp.js +12 -0
  120. package/dist/swapHorizontalBold-C4JpaMpc.js +12 -0
  121. package/dist/swapHorizontalMedium-D5NuVZFh.js +20 -0
  122. package/dist/swapHorizontalRoundedBold-Bq4P2MCj.js +12 -0
  123. package/dist/swapVertical-CVQ8Mg03.js +12 -0
  124. package/dist/swaps-CA04SSdK.js +1637 -0
  125. package/dist/telegram-BP4SgW_L.js +20 -0
  126. package/dist/three-dots-BJYGJ-dQ.js +9 -0
  127. package/dist/transactions-Bq-98Tsg.js +37 -0
  128. package/dist/twitch-DTATWo9M.js +22 -0
  129. package/dist/twitterIcon-D5UWPInb.js +10 -0
  130. package/dist/types.d.ts +128 -0
  131. package/dist/ui/Modal.d.ts +9 -0
  132. package/dist/ui/index.d.ts +6 -0
  133. package/dist/verify-Byvj8Wi1.js +12 -0
  134. package/dist/verify-filled-B40taNm0.js +12 -0
  135. package/dist/w3m-modal-HV6SE74G.js +1037 -0
  136. package/dist/wallet-Cp-6Kk88.js +12 -0
  137. package/dist/wallet-placeholder-C3juwA9o.js +18 -0
  138. package/dist/walletconnect-CRkIiLCx.js +36 -0
  139. package/dist/warning-circle-DtvCLwG4.js +16 -0
  140. package/dist/x-Cqyx5eCt.js +16 -0
  141. package/package.json +70 -0
@@ -0,0 +1,1038 @@
1
+ import { cz as f, cA as w, cY as I, cT as x, d1 as H, dO as l, cB as u, cC as z, cD as W, cE as g, d2 as L, cV as q, cU as B, d3 as F, cS as M, cX as Y } from "./index-DiHImG4L.js";
2
+ import { n as d, r as c, c as m, U as b, o as K } from "./if-defined-BciplFKz.js";
3
+ import "./index-Bijd4_Ns.js";
4
+ import "./index-fxzIDZsb.js";
5
+ import { e as O, n as D } from "./ref-huAzXCX0.js";
6
+ import { n as X, s as G } from "./ConstantsUtil-B-_-u8aQ.js";
7
+ import "./index-D-IzHD_8.js";
8
+ import { S as J } from "./index-CX60z_g2.js";
9
+ import "./index-CxOF7GqE.js";
10
+ import "./index-DoSYqTQg.js";
11
+ import "./index--3Zp0jAb.js";
12
+ import "./index-CUdQyyFn.js";
13
+ const Q = 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 = Q;
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 Z = 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 X.test(i) || (this.inputElementRef.value.value = this.value.replace(new RegExp(i.replace(G, "\\$&"), "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, Z];
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 J.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=${K(q.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
+ F.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
+ };