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