@directcryptopay/sdk 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,525 @@
|
|
|
1
|
+
import { cU as A, cV as D, cW as E, cX as $, cY as u, cE as y, d0 as f, dh as z, cH as b, d1 as _, cG as S } from "./index-D_8VUmn1.js";
|
|
2
|
+
import { n as h, c as v, r as d } from "./index-CEqcN8QP.js";
|
|
3
|
+
import { o as P } from "./if-defined-CdZSZ6UL.js";
|
|
4
|
+
import "./index-I7VDqINw.js";
|
|
5
|
+
import "./index-BEswjY9r.js";
|
|
6
|
+
import "./index-BcPxaHr5.js";
|
|
7
|
+
import "./index-DqcVUSC9.js";
|
|
8
|
+
import "./index-Oz72I9VP.js";
|
|
9
|
+
import "./index-D7lmgqUR.js";
|
|
10
|
+
import "./index-X8zir_1j.js";
|
|
11
|
+
import { E as r } from "./ExchangeController-CPMQq6Q-.js";
|
|
12
|
+
import "./index-UclsHkJ0.js";
|
|
13
|
+
import "./index-C4M5s_AM.js";
|
|
14
|
+
import "./index-DG_-qYze.js";
|
|
15
|
+
import "./index-ChTxJOiF.js";
|
|
16
|
+
const T = A`
|
|
17
|
+
button {
|
|
18
|
+
border: none;
|
|
19
|
+
border-radius: ${({ borderRadius: t }) => t[20]};
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
align-items: center;
|
|
23
|
+
padding: ${({ spacing: t }) => t[1]};
|
|
24
|
+
transition:
|
|
25
|
+
background-color ${({ durations: t }) => t.lg}
|
|
26
|
+
${({ easings: t }) => t["ease-out-power-2"]},
|
|
27
|
+
box-shadow ${({ durations: t }) => t.lg}
|
|
28
|
+
${({ easings: t }) => t["ease-out-power-2"]};
|
|
29
|
+
will-change: background-color, box-shadow;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* -- Variants --------------------------------------------------------------- */
|
|
33
|
+
button[data-type='accent'] {
|
|
34
|
+
background-color: ${({ tokens: t }) => t.core.backgroundAccentPrimary};
|
|
35
|
+
color: ${({ tokens: t }) => t.theme.textPrimary};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
button[data-type='neutral'] {
|
|
39
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundSecondary};
|
|
40
|
+
color: ${({ tokens: t }) => t.theme.textPrimary};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* -- Sizes --------------------------------------------------------------- */
|
|
44
|
+
button[data-size='sm'] {
|
|
45
|
+
height: 24px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
button[data-size='md'] {
|
|
49
|
+
height: 28px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
button[data-size='lg'] {
|
|
53
|
+
height: 32px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
button[data-size='sm'] > wui-image,
|
|
57
|
+
button[data-size='sm'] > wui-icon {
|
|
58
|
+
width: 16px;
|
|
59
|
+
height: 16px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
button[data-size='md'] > wui-image,
|
|
63
|
+
button[data-size='md'] > wui-icon {
|
|
64
|
+
width: 20px;
|
|
65
|
+
height: 20px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
button[data-size='lg'] > wui-image,
|
|
69
|
+
button[data-size='lg'] > wui-icon {
|
|
70
|
+
width: 24px;
|
|
71
|
+
height: 24px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
wui-text {
|
|
75
|
+
padding-left: ${({ spacing: t }) => t[1]};
|
|
76
|
+
padding-right: ${({ spacing: t }) => t[1]};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
wui-image {
|
|
80
|
+
border-radius: ${({ borderRadius: t }) => t[3]};
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
user-drag: none;
|
|
83
|
+
user-select: none;
|
|
84
|
+
-moz-user-select: none;
|
|
85
|
+
-webkit-user-drag: none;
|
|
86
|
+
-webkit-user-select: none;
|
|
87
|
+
-ms-user-select: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* -- States --------------------------------------------------------------- */
|
|
91
|
+
@media (hover: hover) and (pointer: fine) {
|
|
92
|
+
button[data-type='accent']:not(:disabled):hover {
|
|
93
|
+
background-color: ${({ tokens: t }) => t.core.foregroundAccent060};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
button[data-type='neutral']:not(:disabled):hover {
|
|
97
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundTertiary};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
button[data-type='accent']:not(:disabled):focus-visible,
|
|
102
|
+
button[data-type='accent']:not(:disabled):active {
|
|
103
|
+
box-shadow: 0 0 0 4px ${({ tokens: t }) => t.core.foregroundAccent020};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
button[data-type='neutral']:not(:disabled):focus-visible,
|
|
107
|
+
button[data-type='neutral']:not(:disabled):active {
|
|
108
|
+
box-shadow: 0 0 0 4px ${({ tokens: t }) => t.core.foregroundAccent020};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
button:disabled {
|
|
112
|
+
opacity: 0.5;
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
var g = function(t, e, o, n) {
|
|
116
|
+
var s = arguments.length, i = s < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, o) : n, a;
|
|
117
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, n);
|
|
118
|
+
else for (var c = t.length - 1; c >= 0; c--) (a = t[c]) && (i = (s < 3 ? a(i) : s > 3 ? a(e, o, i) : a(e, o)) || i);
|
|
119
|
+
return s > 3 && i && Object.defineProperty(e, o, i), i;
|
|
120
|
+
};
|
|
121
|
+
const L = {
|
|
122
|
+
sm: "sm-regular",
|
|
123
|
+
md: "md-regular",
|
|
124
|
+
lg: "lg-regular"
|
|
125
|
+
};
|
|
126
|
+
let p = class extends $ {
|
|
127
|
+
constructor() {
|
|
128
|
+
super(...arguments), this.type = "accent", this.size = "md", this.imageSrc = "", this.disabled = !1, this.leftIcon = void 0, this.rightIcon = void 0, this.text = "";
|
|
129
|
+
}
|
|
130
|
+
render() {
|
|
131
|
+
return u`
|
|
132
|
+
<button ?disabled=${this.disabled} data-type=${this.type} data-size=${this.size}>
|
|
133
|
+
${this.imageSrc ? u`<wui-image src=${this.imageSrc}></wui-image>` : null}
|
|
134
|
+
${this.leftIcon ? u`<wui-icon name=${this.leftIcon} color="inherit" size="inherit"></wui-icon>` : null}
|
|
135
|
+
<wui-text variant=${L[this.size]} color="inherit">${this.text}</wui-text>
|
|
136
|
+
${this.rightIcon ? u`<wui-icon name=${this.rightIcon} color="inherit" size="inherit"></wui-icon>` : null}
|
|
137
|
+
</button>
|
|
138
|
+
`;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
p.styles = [D, E, T];
|
|
142
|
+
g([
|
|
143
|
+
h()
|
|
144
|
+
], p.prototype, "type", void 0);
|
|
145
|
+
g([
|
|
146
|
+
h()
|
|
147
|
+
], p.prototype, "size", void 0);
|
|
148
|
+
g([
|
|
149
|
+
h()
|
|
150
|
+
], p.prototype, "imageSrc", void 0);
|
|
151
|
+
g([
|
|
152
|
+
h({ type: Boolean })
|
|
153
|
+
], p.prototype, "disabled", void 0);
|
|
154
|
+
g([
|
|
155
|
+
h()
|
|
156
|
+
], p.prototype, "leftIcon", void 0);
|
|
157
|
+
g([
|
|
158
|
+
h()
|
|
159
|
+
], p.prototype, "rightIcon", void 0);
|
|
160
|
+
g([
|
|
161
|
+
h()
|
|
162
|
+
], p.prototype, "text", void 0);
|
|
163
|
+
p = g([
|
|
164
|
+
v("wui-chip-button")
|
|
165
|
+
], p);
|
|
166
|
+
var I = function(t, e, o, n) {
|
|
167
|
+
var s = arguments.length, i = s < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, o) : n, a;
|
|
168
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, n);
|
|
169
|
+
else for (var c = t.length - 1; c >= 0; c--) (a = t[c]) && (i = (s < 3 ? a(i) : s > 3 ? a(e, o, i) : a(e, o)) || i);
|
|
170
|
+
return s > 3 && i && Object.defineProperty(e, o, i), i;
|
|
171
|
+
};
|
|
172
|
+
let w = class extends $ {
|
|
173
|
+
constructor() {
|
|
174
|
+
super(...arguments), this.maxDecimals = void 0, this.maxIntegers = void 0;
|
|
175
|
+
}
|
|
176
|
+
render() {
|
|
177
|
+
return u`
|
|
178
|
+
<wui-flex alignItems="center" gap="1">
|
|
179
|
+
<wui-input-amount
|
|
180
|
+
widthVariant="fit"
|
|
181
|
+
fontSize="h2"
|
|
182
|
+
.maxDecimals=${P(this.maxDecimals)}
|
|
183
|
+
.maxIntegers=${P(this.maxIntegers)}
|
|
184
|
+
.value=${this.amount ? String(this.amount) : ""}
|
|
185
|
+
></wui-input-amount>
|
|
186
|
+
<wui-text variant="md-regular" color="secondary">USD</wui-text>
|
|
187
|
+
</wui-flex>
|
|
188
|
+
`;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
I([
|
|
192
|
+
h({ type: Number })
|
|
193
|
+
], w.prototype, "amount", void 0);
|
|
194
|
+
I([
|
|
195
|
+
h({ type: Number })
|
|
196
|
+
], w.prototype, "maxDecimals", void 0);
|
|
197
|
+
I([
|
|
198
|
+
h({ type: Number })
|
|
199
|
+
], w.prototype, "maxIntegers", void 0);
|
|
200
|
+
w = I([
|
|
201
|
+
v("w3m-fund-input")
|
|
202
|
+
], w);
|
|
203
|
+
const R = A`
|
|
204
|
+
.amount-input-container {
|
|
205
|
+
border-radius: ${({ borderRadius: t }) => t[6]};
|
|
206
|
+
border-top-right-radius: 0;
|
|
207
|
+
border-top-left-radius: 0;
|
|
208
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
209
|
+
padding: ${({ spacing: t }) => t[1]};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.container {
|
|
213
|
+
border-radius: 30px;
|
|
214
|
+
}
|
|
215
|
+
`;
|
|
216
|
+
var m = function(t, e, o, n) {
|
|
217
|
+
var s = arguments.length, i = s < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, o) : n, a;
|
|
218
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, n);
|
|
219
|
+
else for (var c = t.length - 1; c >= 0; c--) (a = t[c]) && (i = (s < 3 ? a(i) : s > 3 ? a(e, o, i) : a(e, o)) || i);
|
|
220
|
+
return s > 3 && i && Object.defineProperty(e, o, i), i;
|
|
221
|
+
};
|
|
222
|
+
const C = [10, 50, 100], j = 6, N = 10;
|
|
223
|
+
let l = class extends $ {
|
|
224
|
+
constructor() {
|
|
225
|
+
super(), this.unsubscribe = [], this.network = y.state.activeCaipNetwork, this.exchanges = r.state.exchanges, this.isLoading = r.state.isLoading, this.amount = r.state.amount, this.tokenAmount = r.state.tokenAmount, this.priceLoading = r.state.priceLoading, this.isPaymentInProgress = r.state.isPaymentInProgress, this.currentPayment = r.state.currentPayment, this.paymentId = r.state.paymentId, this.paymentAsset = r.state.paymentAsset, this.unsubscribe.push(y.subscribeKey("activeCaipNetwork", (e) => {
|
|
226
|
+
this.network = e, this.setDefaultPaymentAsset();
|
|
227
|
+
}), r.subscribe((e) => {
|
|
228
|
+
var n, s;
|
|
229
|
+
this.exchanges = e.exchanges, this.isLoading = e.isLoading, this.amount = e.amount, this.tokenAmount = e.tokenAmount, this.priceLoading = e.priceLoading, this.paymentId = e.paymentId, this.isPaymentInProgress = e.isPaymentInProgress, this.currentPayment = e.currentPayment, this.paymentAsset = e.paymentAsset, e.isPaymentInProgress && ((n = e.currentPayment) == null ? void 0 : n.exchangeId) && ((s = e.currentPayment) == null ? void 0 : s.sessionId) && e.paymentId && this.handlePaymentInProgress();
|
|
230
|
+
}));
|
|
231
|
+
}
|
|
232
|
+
disconnectedCallback() {
|
|
233
|
+
this.unsubscribe.forEach((o) => o()), r.state.isPaymentInProgress || r.reset();
|
|
234
|
+
}
|
|
235
|
+
async firstUpdated() {
|
|
236
|
+
await this.getPaymentAssets(), this.paymentAsset || await this.setDefaultPaymentAsset(), r.setAmount(C[0]), await r.fetchExchanges();
|
|
237
|
+
}
|
|
238
|
+
render() {
|
|
239
|
+
return u`
|
|
240
|
+
<wui-flex flexDirection="column" class="container">
|
|
241
|
+
${this.amountInputTemplate()} ${this.exchangesTemplate()}
|
|
242
|
+
</wui-flex>
|
|
243
|
+
`;
|
|
244
|
+
}
|
|
245
|
+
exchangesLoadingTemplate() {
|
|
246
|
+
return Array.from({ length: 2 }).map(() => u`<wui-shimmer width="100%" height="65px" borderRadius="xxs"></wui-shimmer>`);
|
|
247
|
+
}
|
|
248
|
+
_exchangesTemplate() {
|
|
249
|
+
return this.exchanges.length > 0 ? this.exchanges.map((e) => u`<wui-list-item
|
|
250
|
+
@click=${() => this.onExchangeClick(e)}
|
|
251
|
+
chevron
|
|
252
|
+
variant="image"
|
|
253
|
+
imageSrc=${e.imageUrl}
|
|
254
|
+
?loading=${this.isLoading}
|
|
255
|
+
>
|
|
256
|
+
<wui-text variant="md-regular" color="primary">
|
|
257
|
+
Deposit from ${e.name}
|
|
258
|
+
</wui-text>
|
|
259
|
+
</wui-list-item>`) : u`<wui-flex flexDirection="column" alignItems="center" gap="4" padding="4">
|
|
260
|
+
<wui-text variant="lg-medium" align="center" color="primary">
|
|
261
|
+
No exchanges support this asset on this network
|
|
262
|
+
</wui-text>
|
|
263
|
+
</wui-flex>`;
|
|
264
|
+
}
|
|
265
|
+
exchangesTemplate() {
|
|
266
|
+
return u`<wui-flex
|
|
267
|
+
flexDirection="column"
|
|
268
|
+
gap="2"
|
|
269
|
+
.padding=${["3", "3", "3", "3"]}
|
|
270
|
+
class="exchanges-container"
|
|
271
|
+
>
|
|
272
|
+
${this.isLoading ? this.exchangesLoadingTemplate() : this._exchangesTemplate()}
|
|
273
|
+
</wui-flex>`;
|
|
274
|
+
}
|
|
275
|
+
amountInputTemplate() {
|
|
276
|
+
var e, o;
|
|
277
|
+
return u`
|
|
278
|
+
<wui-flex
|
|
279
|
+
flexDirection="column"
|
|
280
|
+
.padding=${["0", "3", "3", "3"]}
|
|
281
|
+
class="amount-input-container"
|
|
282
|
+
>
|
|
283
|
+
<wui-flex
|
|
284
|
+
justifyContent="space-between"
|
|
285
|
+
alignItems="center"
|
|
286
|
+
.margin=${["0", "0", "6", "0"]}
|
|
287
|
+
>
|
|
288
|
+
<wui-text variant="md-medium" color="secondary">Asset</wui-text>
|
|
289
|
+
<wui-token-button
|
|
290
|
+
data-testid="deposit-from-exchange-asset-button"
|
|
291
|
+
flexDirection="row-reverse"
|
|
292
|
+
text=${((e = this.paymentAsset) == null ? void 0 : e.metadata.symbol) || ""}
|
|
293
|
+
imageSrc=${((o = this.paymentAsset) == null ? void 0 : o.metadata.iconUrl) || ""}
|
|
294
|
+
@click=${() => f.push("PayWithExchangeSelectAsset")}
|
|
295
|
+
size="lg"
|
|
296
|
+
.chainImageSrc=${P(z.getNetworkImage(this.network))}
|
|
297
|
+
>
|
|
298
|
+
</wui-token-button>
|
|
299
|
+
</wui-flex>
|
|
300
|
+
<wui-flex
|
|
301
|
+
flexDirection="column"
|
|
302
|
+
alignItems="center"
|
|
303
|
+
justifyContent="center"
|
|
304
|
+
.margin=${["0", "0", "4", "0"]}
|
|
305
|
+
>
|
|
306
|
+
<w3m-fund-input
|
|
307
|
+
@inputChange=${this.onAmountChange.bind(this)}
|
|
308
|
+
.amount=${this.amount}
|
|
309
|
+
.maxDecimals=${j}
|
|
310
|
+
.maxIntegers=${N}
|
|
311
|
+
>
|
|
312
|
+
</w3m-fund-input>
|
|
313
|
+
${this.tokenAmountTemplate()}
|
|
314
|
+
</wui-flex>
|
|
315
|
+
<wui-flex justifyContent="center" gap="2">
|
|
316
|
+
${C.map((n) => u`<wui-chip-button
|
|
317
|
+
@click=${() => r.setAmount(n)}
|
|
318
|
+
type="neutral"
|
|
319
|
+
size="lg"
|
|
320
|
+
text=${`$${n}`}
|
|
321
|
+
></wui-chip-button>`)}
|
|
322
|
+
</wui-flex>
|
|
323
|
+
</wui-flex>
|
|
324
|
+
`;
|
|
325
|
+
}
|
|
326
|
+
tokenAmountTemplate() {
|
|
327
|
+
var e;
|
|
328
|
+
return this.priceLoading ? u`<wui-shimmer
|
|
329
|
+
width="65px"
|
|
330
|
+
height="20px"
|
|
331
|
+
borderRadius="xxs"
|
|
332
|
+
variant="light"
|
|
333
|
+
></wui-shimmer>` : u`
|
|
334
|
+
<wui-text variant="md-regular" color="secondary">
|
|
335
|
+
${this.tokenAmount.toFixed(4)} ${(e = this.paymentAsset) == null ? void 0 : e.metadata.symbol}
|
|
336
|
+
</wui-text>
|
|
337
|
+
`;
|
|
338
|
+
}
|
|
339
|
+
async onExchangeClick(e) {
|
|
340
|
+
if (!this.amount) {
|
|
341
|
+
b.showError("Please enter an amount");
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
await r.handlePayWithExchange(e.id);
|
|
345
|
+
}
|
|
346
|
+
handlePaymentInProgress() {
|
|
347
|
+
var n, s;
|
|
348
|
+
const e = y.state.activeChain, { redirectView: o = "Account" } = f.state.data ?? {};
|
|
349
|
+
this.isPaymentInProgress && ((n = this.currentPayment) != null && n.exchangeId) && ((s = this.currentPayment) != null && s.sessionId) && this.paymentId && (r.waitUntilComplete({
|
|
350
|
+
exchangeId: this.currentPayment.exchangeId,
|
|
351
|
+
sessionId: this.currentPayment.sessionId,
|
|
352
|
+
paymentId: this.paymentId
|
|
353
|
+
}).then((i) => {
|
|
354
|
+
i.status === "SUCCESS" ? (b.showSuccess("Deposit completed"), r.reset(), e && (y.fetchTokenBalance(), _.updateBalance(e)), f.replace("Transactions")) : i.status === "FAILED" && b.showError("Deposit failed");
|
|
355
|
+
}), b.showLoading("Deposit in progress..."), f.replace(o));
|
|
356
|
+
}
|
|
357
|
+
onAmountChange({ detail: e }) {
|
|
358
|
+
r.setAmount(e ? Number(e) : null);
|
|
359
|
+
}
|
|
360
|
+
async getPaymentAssets() {
|
|
361
|
+
this.network && await r.getAssetsForNetwork(this.network.caipNetworkId);
|
|
362
|
+
}
|
|
363
|
+
async setDefaultPaymentAsset() {
|
|
364
|
+
if (this.network) {
|
|
365
|
+
const e = await r.getAssetsForNetwork(this.network.caipNetworkId);
|
|
366
|
+
e[0] && r.setPaymentAsset(e[0]);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
l.styles = R;
|
|
371
|
+
m([
|
|
372
|
+
d()
|
|
373
|
+
], l.prototype, "network", void 0);
|
|
374
|
+
m([
|
|
375
|
+
d()
|
|
376
|
+
], l.prototype, "exchanges", void 0);
|
|
377
|
+
m([
|
|
378
|
+
d()
|
|
379
|
+
], l.prototype, "isLoading", void 0);
|
|
380
|
+
m([
|
|
381
|
+
d()
|
|
382
|
+
], l.prototype, "amount", void 0);
|
|
383
|
+
m([
|
|
384
|
+
d()
|
|
385
|
+
], l.prototype, "tokenAmount", void 0);
|
|
386
|
+
m([
|
|
387
|
+
d()
|
|
388
|
+
], l.prototype, "priceLoading", void 0);
|
|
389
|
+
m([
|
|
390
|
+
d()
|
|
391
|
+
], l.prototype, "isPaymentInProgress", void 0);
|
|
392
|
+
m([
|
|
393
|
+
d()
|
|
394
|
+
], l.prototype, "currentPayment", void 0);
|
|
395
|
+
m([
|
|
396
|
+
d()
|
|
397
|
+
], l.prototype, "paymentId", void 0);
|
|
398
|
+
m([
|
|
399
|
+
d()
|
|
400
|
+
], l.prototype, "paymentAsset", void 0);
|
|
401
|
+
l = m([
|
|
402
|
+
v("w3m-deposit-from-exchange-view")
|
|
403
|
+
], l);
|
|
404
|
+
const O = A`
|
|
405
|
+
.contentContainer {
|
|
406
|
+
height: 440px;
|
|
407
|
+
overflow: scroll;
|
|
408
|
+
scrollbar-width: none;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.contentContainer::-webkit-scrollbar {
|
|
412
|
+
display: none;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
wui-icon-box {
|
|
416
|
+
width: 40px;
|
|
417
|
+
height: 40px;
|
|
418
|
+
border-radius: ${({ borderRadius: t }) => t[3]};
|
|
419
|
+
}
|
|
420
|
+
`;
|
|
421
|
+
var k = function(t, e, o, n) {
|
|
422
|
+
var s = arguments.length, i = s < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, o) : n, a;
|
|
423
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, n);
|
|
424
|
+
else for (var c = t.length - 1; c >= 0; c--) (a = t[c]) && (i = (s < 3 ? a(i) : s > 3 ? a(e, o, i) : a(e, o)) || i);
|
|
425
|
+
return s > 3 && i && Object.defineProperty(e, o, i), i;
|
|
426
|
+
};
|
|
427
|
+
let x = class extends $ {
|
|
428
|
+
constructor() {
|
|
429
|
+
super(), this.unsubscribe = [], this.assets = r.state.assets, this.search = "", this.onDebouncedSearch = S.debounce((e) => {
|
|
430
|
+
this.search = e;
|
|
431
|
+
}), this.unsubscribe.push(r.subscribe((e) => {
|
|
432
|
+
this.assets = e.assets;
|
|
433
|
+
}));
|
|
434
|
+
}
|
|
435
|
+
disconnectedCallback() {
|
|
436
|
+
this.unsubscribe.forEach((e) => e());
|
|
437
|
+
}
|
|
438
|
+
render() {
|
|
439
|
+
return u`
|
|
440
|
+
<wui-flex flexDirection="column">
|
|
441
|
+
${this.templateSearchInput()} <wui-separator></wui-separator> ${this.templateTokens()}
|
|
442
|
+
</wui-flex>
|
|
443
|
+
`;
|
|
444
|
+
}
|
|
445
|
+
templateSearchInput() {
|
|
446
|
+
return u`
|
|
447
|
+
<wui-flex gap="2" padding="3">
|
|
448
|
+
<wui-input-text
|
|
449
|
+
@inputChange=${this.onInputChange.bind(this)}
|
|
450
|
+
class="network-search-input"
|
|
451
|
+
size="sm"
|
|
452
|
+
placeholder="Search token"
|
|
453
|
+
icon="search"
|
|
454
|
+
></wui-input-text>
|
|
455
|
+
</wui-flex>
|
|
456
|
+
`;
|
|
457
|
+
}
|
|
458
|
+
templateTokens() {
|
|
459
|
+
const e = this.assets.filter((n) => n.metadata.name.toLowerCase().includes(this.search.toLowerCase())), o = e.length > 0;
|
|
460
|
+
return u`
|
|
461
|
+
<wui-flex
|
|
462
|
+
class="contentContainer"
|
|
463
|
+
flexDirection="column"
|
|
464
|
+
.padding=${["0", "3", "0", "3"]}
|
|
465
|
+
>
|
|
466
|
+
<wui-flex justifyContent="flex-start" .padding=${["4", "3", "3", "3"]}>
|
|
467
|
+
<wui-text variant="md-medium" color="secondary">Available tokens</wui-text>
|
|
468
|
+
</wui-flex>
|
|
469
|
+
<wui-flex flexDirection="column" gap="2">
|
|
470
|
+
${o ? e.map((n) => u`<wui-list-item
|
|
471
|
+
.imageSrc=${n.metadata.iconUrl}
|
|
472
|
+
?clickable=${!0}
|
|
473
|
+
@click=${this.handleTokenClick.bind(this, n)}
|
|
474
|
+
>
|
|
475
|
+
<wui-text variant="md-medium" color="primary">${n.metadata.name}</wui-text>
|
|
476
|
+
<wui-text variant="md-regular" color="secondary"
|
|
477
|
+
>${n.metadata.symbol}</wui-text
|
|
478
|
+
>
|
|
479
|
+
</wui-list-item>`) : u`<wui-flex
|
|
480
|
+
.padding=${["20", "0", "0", "0"]}
|
|
481
|
+
alignItems="center"
|
|
482
|
+
flexDirection="column"
|
|
483
|
+
gap="4"
|
|
484
|
+
>
|
|
485
|
+
<wui-icon-box icon="coinPlaceholder" color="default" size="lg"></wui-icon-box>
|
|
486
|
+
<wui-flex
|
|
487
|
+
class="textContent"
|
|
488
|
+
gap="2"
|
|
489
|
+
flexDirection="column"
|
|
490
|
+
justifyContent="center"
|
|
491
|
+
>
|
|
492
|
+
<wui-text variant="lg-medium" align="center" color="primary">
|
|
493
|
+
No tokens found
|
|
494
|
+
</wui-text>
|
|
495
|
+
</wui-flex>
|
|
496
|
+
<wui-link @click=${this.onBuyClick.bind(this)}>Buy</wui-link>
|
|
497
|
+
</wui-flex>`}
|
|
498
|
+
</wui-flex>
|
|
499
|
+
</wui-flex>
|
|
500
|
+
`;
|
|
501
|
+
}
|
|
502
|
+
onBuyClick() {
|
|
503
|
+
f.push("OnRampProviders");
|
|
504
|
+
}
|
|
505
|
+
onInputChange(e) {
|
|
506
|
+
this.onDebouncedSearch(e.detail);
|
|
507
|
+
}
|
|
508
|
+
handleTokenClick(e) {
|
|
509
|
+
r.setPaymentAsset(e), f.goBack();
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
x.styles = O;
|
|
513
|
+
k([
|
|
514
|
+
d()
|
|
515
|
+
], x.prototype, "assets", void 0);
|
|
516
|
+
k([
|
|
517
|
+
d()
|
|
518
|
+
], x.prototype, "search", void 0);
|
|
519
|
+
x = k([
|
|
520
|
+
v("w3m-deposit-from-exchange-select-asset-view")
|
|
521
|
+
], x);
|
|
522
|
+
export {
|
|
523
|
+
x as W3mDepositFromExchangeSelectAssetView,
|
|
524
|
+
l as W3mDepositFromExchangeView
|
|
525
|
+
};
|