@prohetamine/redstone 0.0.1
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/PhArrowCircleDown-BR-zH4LC.js +14 -0
- package/dist/PhArrowCircleDown-Sb38khBy.mjs +73 -0
- package/dist/PhArrowClockwise-BE5j9P0Z.mjs +73 -0
- package/dist/PhArrowClockwise-BRaehQGe.js +14 -0
- package/dist/PhArrowDown-B_WmmmY9.js +14 -0
- package/dist/PhArrowDown-CFEyR2dR.mjs +73 -0
- package/dist/PhArrowLeft-CYfU7NZj.mjs +73 -0
- package/dist/PhArrowLeft-CkEd70hm.js +14 -0
- package/dist/PhArrowRight-C07Qkx86.js +14 -0
- package/dist/PhArrowRight-EermNu0V.mjs +73 -0
- package/dist/PhArrowSquareOut-BjTBfzOP.js +14 -0
- package/dist/PhArrowSquareOut-DZwTtw54.mjs +73 -0
- package/dist/PhArrowUp-DB4CCSss.js +14 -0
- package/dist/PhArrowUp-xTpLFQkg.mjs +73 -0
- package/dist/PhArrowUpRight-CQbvn6NO.mjs +73 -0
- package/dist/PhArrowUpRight-GpCIMsAh.js +14 -0
- package/dist/PhArrowsClockwise-BgcIUg-Z.js +14 -0
- package/dist/PhArrowsClockwise-DnUYZTVx.mjs +73 -0
- package/dist/PhArrowsDownUp-C8KXUqtu.js +14 -0
- package/dist/PhArrowsDownUp-DgoprEe2.mjs +73 -0
- package/dist/PhArrowsLeftRight-CahChzCj.js +14 -0
- package/dist/PhArrowsLeftRight-FD4AZiLh.mjs +73 -0
- package/dist/PhBank-DIqIL4x_.js +14 -0
- package/dist/PhBank-DbQOQ9zJ.mjs +73 -0
- package/dist/PhBrowser-BCBXK2IM.mjs +73 -0
- package/dist/PhBrowser-laCKtn7T.js +14 -0
- package/dist/PhCaretDown-CnjP-QjZ.mjs +73 -0
- package/dist/PhCaretDown-DDe42xDU.js +14 -0
- package/dist/PhCaretLeft-Cskc5OY9.js +14 -0
- package/dist/PhCaretLeft-DkuXxjf_.mjs +73 -0
- package/dist/PhCaretRight-CBWpghxt.mjs +73 -0
- package/dist/PhCaretRight-DNgI5w_B.js +14 -0
- package/dist/PhCaretUp-CQ-OztBV.mjs +73 -0
- package/dist/PhCaretUp-CUZ4g_Me.js +14 -0
- package/dist/PhCheck-BVV_Dwfo.js +14 -0
- package/dist/PhCheck-t515emYS.mjs +73 -0
- package/dist/PhCircleHalf-BuQTmrKW.mjs +73 -0
- package/dist/PhCircleHalf-DDC7rige.js +14 -0
- package/dist/PhClock-BqynEKWl.js +14 -0
- package/dist/PhClock-D6XkTmM_.mjs +73 -0
- package/dist/PhCompass-2QeeX5Ad.mjs +73 -0
- package/dist/PhCompass-BsuJwXAE.js +14 -0
- package/dist/PhCopy-CO34-_xD.mjs +73 -0
- package/dist/PhCopy-MVqtRS6X.js +14 -0
- package/dist/PhCreditCard-Dq4kdjCw.js +14 -0
- package/dist/PhCreditCard-bfnqYflD.mjs +73 -0
- package/dist/PhCurrencyDollar-6k8UWxal.js +14 -0
- package/dist/PhCurrencyDollar-BekVYPtC.mjs +73 -0
- package/dist/PhDesktop-BkNzf3rT.mjs +73 -0
- package/dist/PhDesktop-CfsXQ0vC.js +14 -0
- package/dist/PhDeviceMobile-BT3Mg_b0.mjs +73 -0
- package/dist/PhDeviceMobile-BnrrDrwf.js +14 -0
- package/dist/PhDotsThree-6LRvhAcL.js +14 -0
- package/dist/PhDotsThree-kpf2OKxJ.mjs +73 -0
- package/dist/PhEnvelope-CHsfC2e0.js +14 -0
- package/dist/PhEnvelope-UFKpKtwf.mjs +73 -0
- package/dist/PhFunnelSimple-CdAqSIhK.mjs +73 -0
- package/dist/PhFunnelSimple-JAk7X9Wo.js +14 -0
- package/dist/PhGlobe-B3RYXl8h.mjs +73 -0
- package/dist/PhGlobe-Tfs4MfpG.js +14 -0
- package/dist/PhIdentificationCard-Dqmd6eY1.js +14 -0
- package/dist/PhIdentificationCard-rSq59Czm.mjs +73 -0
- package/dist/PhImage-aEryzfCi.js +14 -0
- package/dist/PhImage-ynsEnFd_.mjs +73 -0
- package/dist/PhInfo-B7lsWl6m.mjs +73 -0
- package/dist/PhInfo-D6oUrWpA.js +14 -0
- package/dist/PhLightbulb-FQDaMMqu.mjs +73 -0
- package/dist/PhLightbulb-qbEduhPa.js +14 -0
- package/dist/PhMagnifyingGlass-COdRH2k5.js +14 -0
- package/dist/PhMagnifyingGlass-_NXk13-0.mjs +73 -0
- package/dist/PhPaperPlaneRight-BYi7SorW.mjs +73 -0
- package/dist/PhPaperPlaneRight-DrpVAQOZ.js +14 -0
- package/dist/PhPlus-25KQTPHG.mjs +73 -0
- package/dist/PhPlus-BhUXef08.js +14 -0
- package/dist/PhPower-BKl7gzsB.mjs +73 -0
- package/dist/PhPower-BNJf1AGQ.js +14 -0
- package/dist/PhPuzzlePiece-BkZeF8CX.js +14 -0
- package/dist/PhPuzzlePiece-BqUI4GRs.mjs +73 -0
- package/dist/PhQrCode-C-tqZKPP.mjs +73 -0
- package/dist/PhQrCode-C0v0iXQN.js +14 -0
- package/dist/PhQuestion-BBAiRWgt.js +14 -0
- package/dist/PhQuestion-CtYvffyD.mjs +73 -0
- package/dist/PhQuestionMark-BNbtL2yx.mjs +73 -0
- package/dist/PhQuestionMark-BvGUBZ1h.js +14 -0
- package/dist/PhSealCheck-B0TEqWpq.mjs +73 -0
- package/dist/PhSealCheck-BwNkuF7G.js +14 -0
- package/dist/PhSignOut-C1rMSNaS.js +14 -0
- package/dist/PhSignOut-HX2_BVsD.mjs +73 -0
- package/dist/PhSpinner-CoDYLYOX.mjs +73 -0
- package/dist/PhSpinner-nmsGWDQl.js +14 -0
- package/dist/PhTrash-CALlKx3e.js +14 -0
- package/dist/PhTrash-DeQHS8ZP.mjs +73 -0
- package/dist/PhUser-CA0e5OPI.js +14 -0
- package/dist/PhUser-Cy5EY3vX.mjs +73 -0
- package/dist/PhVault-DdXjVOO9.mjs +73 -0
- package/dist/PhVault-DqxV75cz.js +14 -0
- package/dist/PhWallet-CeQrfGYc.mjs +73 -0
- package/dist/PhWallet-CyCuEs2U.js +14 -0
- package/dist/PhWarning-BKaHv_wT.mjs +73 -0
- package/dist/PhWarning-C7oj86bY.js +14 -0
- package/dist/PhWarningCircle-8MWw-QgE.mjs +73 -0
- package/dist/PhWarningCircle-CrNPXGj4.js +14 -0
- package/dist/PhX-9lsrXjyl.js +14 -0
- package/dist/PhX-DgXr_Fb0.mjs +73 -0
- package/dist/ReownAuthentication-Bfv31LzI.mjs +274 -0
- package/dist/ReownAuthentication-d8aYgGOq.js +5 -0
- package/dist/SwapController-4lzoYsYr.js +1 -0
- package/dist/SwapController-DjzUWRyQ.mjs +462 -0
- package/dist/ccip-CvwbEhki.js +1 -0
- package/dist/ccip-TuO68NeE.mjs +150 -0
- package/dist/data-capture-BwdjH2vc.mjs +489 -0
- package/dist/data-capture-xVUNZJ2T.js +242 -0
- package/dist/email-BCZObJCY.js +90 -0
- package/dist/email-m-wo60fN.mjs +338 -0
- package/dist/embedded-wallet-CGSri-4g.js +410 -0
- package/dist/embedded-wallet-DdZmv5qP.mjs +808 -0
- package/dist/features-BJ8kNaE8.js +1 -0
- package/dist/features-CJ34oImB.mjs +6 -0
- package/dist/index-4lfXeo30.js +132 -0
- package/dist/index-B6Mg114Z.mjs +69182 -0
- package/dist/index-BX7gAgT3.mjs +35 -0
- package/dist/index-BYQqNbCe.js +1 -0
- package/dist/index-BmdHwtJo.js +1 -0
- package/dist/index-BvUx3ULC.js +78 -0
- package/dist/index-CD-QGO70.mjs +196 -0
- package/dist/index-CJtXfdoM.mjs +29621 -0
- package/dist/index-CMzdgE-y.mjs +215 -0
- package/dist/index-CjZQCcwG.js +7203 -0
- package/dist/index-D7VuOaCI.js +19 -0
- package/dist/index-DV7SQwgn.mjs +2688 -0
- package/dist/index-DVf4BnNh.mjs +352 -0
- package/dist/index-DhN9vL4k.js +138 -0
- package/dist/index-DvllakY0.mjs +274 -0
- package/dist/index-Ho06VKh2.mjs +151 -0
- package/dist/index-a8mS2Eh1.js +1062 -0
- package/dist/index-aamBi9Tu.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.es.js +14 -0
- package/dist/onramp-DLlhSPQg.js +422 -0
- package/dist/onramp-k-EAEepC.mjs +842 -0
- package/dist/parseSignature-D1tZHglo.js +16 -0
- package/dist/parseSignature-DM0lwcDr.mjs +8883 -0
- package/dist/pay-with-exchange---G2M1Ag.js +280 -0
- package/dist/pay-with-exchange-CFIcUXUe.mjs +512 -0
- package/dist/property-Bd8U3_QP.mjs +618 -0
- package/dist/property-DissjCbZ.js +27 -0
- package/dist/receive-B9LCljO6.mjs +228 -0
- package/dist/receive-E8H6GDOX.js +131 -0
- package/dist/send-B-AooLph.js +554 -0
- package/dist/send-DZd_xhsd.mjs +1155 -0
- package/dist/socials-ChWFLEFe.mjs +611 -0
- package/dist/socials-YSUYSh8o.js +250 -0
- package/dist/swaps-DpR9W9Ld.js +1050 -0
- package/dist/swaps-Du7-Ui_V.mjs +1752 -0
- package/dist/transactions-DhsK5-QJ.mjs +35 -0
- package/dist/transactions-VPsz2OLe.js +16 -0
- package/dist/w3m-modal-DhomfjKU.js +891 -0
- package/dist/w3m-modal-KuYD-zqQ.mjs +1759 -0
- package/package.json +51 -0
- package/readme.md +1 -0
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
import { bR as O, bW as b, cN as c, cO as C, cD as T, cy as j, cu as m, bX as u, cz as $, cv as l, bV as g, bU as p, ca as I, cs as E, c3 as D, cc as B, c7 as z, c8 as V, c9 as K, c5 as M, ct as N, c4 as W } from "./index-B6Mg114Z.mjs";
|
|
2
|
+
const F = O`
|
|
3
|
+
:host > wui-grid {
|
|
4
|
+
max-height: 360px;
|
|
5
|
+
overflow: auto;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
wui-flex {
|
|
9
|
+
transition: opacity ${({ easings: t }) => t["ease-out-power-1"]}
|
|
10
|
+
${({ durations: t }) => t.md};
|
|
11
|
+
will-change: opacity;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
wui-grid::-webkit-scrollbar {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
wui-flex.disabled {
|
|
19
|
+
opacity: 0.3;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
user-select: none;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
var A = function(t, e, i, n) {
|
|
25
|
+
var o = arguments.length, r = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
|
|
26
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, n);
|
|
27
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (o < 3 ? s(r) : o > 3 ? s(e, i, r) : s(e, i)) || r);
|
|
28
|
+
return o > 3 && r && Object.defineProperty(e, i, r), r;
|
|
29
|
+
};
|
|
30
|
+
let P = class extends b {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(), this.unsubscribe = [], this.selectedCurrency = c.state.paymentCurrency, this.currencies = c.state.paymentCurrencies, this.currencyImages = C.state.currencyImages, this.checked = T.state.isLegalCheckboxChecked, this.unsubscribe.push(c.subscribe((e) => {
|
|
33
|
+
this.selectedCurrency = e.paymentCurrency, this.currencies = e.paymentCurrencies;
|
|
34
|
+
}), C.subscribeKey("currencyImages", (e) => this.currencyImages = e), T.subscribeKey("isLegalCheckboxChecked", (e) => {
|
|
35
|
+
this.checked = e;
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
this.unsubscribe.forEach((e) => e());
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
var a;
|
|
43
|
+
const { termsConditionsUrl: e, privacyPolicyUrl: i } = j.state, n = (a = j.state.features) == null ? void 0 : a.legalCheckbox, s = !!(e || i) && !!n && !this.checked;
|
|
44
|
+
return u`
|
|
45
|
+
<w3m-legal-checkbox></w3m-legal-checkbox>
|
|
46
|
+
<wui-flex
|
|
47
|
+
flexDirection="column"
|
|
48
|
+
.padding=${["0", "3", "3", "3"]}
|
|
49
|
+
gap="2"
|
|
50
|
+
class=${m(s ? "disabled" : void 0)}
|
|
51
|
+
>
|
|
52
|
+
${this.currenciesTemplate(s)}
|
|
53
|
+
</wui-flex>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
currenciesTemplate(e = !1) {
|
|
57
|
+
return this.currencies.map((i) => {
|
|
58
|
+
var n;
|
|
59
|
+
return u`
|
|
60
|
+
<wui-list-item
|
|
61
|
+
imageSrc=${m((n = this.currencyImages) == null ? void 0 : n[i.id])}
|
|
62
|
+
@click=${() => this.selectCurrency(i)}
|
|
63
|
+
variant="image"
|
|
64
|
+
tabIdx=${m(e ? -1 : void 0)}
|
|
65
|
+
>
|
|
66
|
+
<wui-text variant="md-medium" color="primary">${i.id}</wui-text>
|
|
67
|
+
</wui-list-item>
|
|
68
|
+
`;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
selectCurrency(e) {
|
|
72
|
+
e && (c.setPaymentCurrency(e), $.close());
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
P.styles = F;
|
|
76
|
+
A([
|
|
77
|
+
l()
|
|
78
|
+
], P.prototype, "selectedCurrency", void 0);
|
|
79
|
+
A([
|
|
80
|
+
l()
|
|
81
|
+
], P.prototype, "currencies", void 0);
|
|
82
|
+
A([
|
|
83
|
+
l()
|
|
84
|
+
], P.prototype, "currencyImages", void 0);
|
|
85
|
+
A([
|
|
86
|
+
l()
|
|
87
|
+
], P.prototype, "checked", void 0);
|
|
88
|
+
P = A([
|
|
89
|
+
g("w3m-onramp-fiat-select-view")
|
|
90
|
+
], P);
|
|
91
|
+
const Y = O`
|
|
92
|
+
button {
|
|
93
|
+
padding: ${({ spacing: t }) => t[3]};
|
|
94
|
+
border-radius: ${({ borderRadius: t }) => t[4]};
|
|
95
|
+
border: none;
|
|
96
|
+
outline: none;
|
|
97
|
+
background-color: ${({ tokens: t }) => t.core.glass010};
|
|
98
|
+
width: 100%;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: flex-start;
|
|
102
|
+
gap: ${({ spacing: t }) => t[3]};
|
|
103
|
+
transition: background-color ${({ easings: t }) => t["ease-out-power-1"]}
|
|
104
|
+
${({ durations: t }) => t.md};
|
|
105
|
+
will-change: background-color;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
button:hover {
|
|
110
|
+
background-color: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.provider-image {
|
|
114
|
+
width: ${({ spacing: t }) => t[10]};
|
|
115
|
+
min-width: ${({ spacing: t }) => t[10]};
|
|
116
|
+
height: ${({ spacing: t }) => t[10]};
|
|
117
|
+
border-radius: calc(
|
|
118
|
+
${({ borderRadius: t }) => t[4]} - calc(${({ spacing: t }) => t[3]} / 2)
|
|
119
|
+
);
|
|
120
|
+
position: relative;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.network-icon {
|
|
125
|
+
width: ${({ spacing: t }) => t[3]};
|
|
126
|
+
height: ${({ spacing: t }) => t[3]};
|
|
127
|
+
border-radius: calc(${({ spacing: t }) => t[3]} / 2);
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
box-shadow:
|
|
130
|
+
0 0 0 3px ${({ tokens: t }) => t.theme.foregroundPrimary},
|
|
131
|
+
0 0 0 3px ${({ tokens: t }) => t.theme.backgroundPrimary};
|
|
132
|
+
transition: box-shadow ${({ easings: t }) => t["ease-out-power-1"]}
|
|
133
|
+
${({ durations: t }) => t.md};
|
|
134
|
+
will-change: box-shadow;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
button:hover .network-icon {
|
|
138
|
+
box-shadow:
|
|
139
|
+
0 0 0 3px ${({ tokens: t }) => t.core.glass010},
|
|
140
|
+
0 0 0 3px ${({ tokens: t }) => t.theme.backgroundPrimary};
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
var v = function(t, e, i, n) {
|
|
144
|
+
var o = arguments.length, r = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
|
|
145
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, n);
|
|
146
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (o < 3 ? s(r) : o > 3 ? s(e, i, r) : s(e, i)) || r);
|
|
147
|
+
return o > 3 && r && Object.defineProperty(e, i, r), r;
|
|
148
|
+
};
|
|
149
|
+
let h = class extends b {
|
|
150
|
+
constructor() {
|
|
151
|
+
super(...arguments), this.disabled = !1, this.color = "inherit", this.label = "", this.feeRange = "", this.loading = !1, this.onClick = null;
|
|
152
|
+
}
|
|
153
|
+
render() {
|
|
154
|
+
return u`
|
|
155
|
+
<button ?disabled=${this.disabled} @click=${this.onClick} ontouchstart>
|
|
156
|
+
<wui-visual name=${m(this.name)} class="provider-image"></wui-visual>
|
|
157
|
+
<wui-flex flexDirection="column" gap="01">
|
|
158
|
+
<wui-text variant="md-regular" color="primary">${this.label}</wui-text>
|
|
159
|
+
<wui-flex alignItems="center" justifyContent="flex-start" gap="4">
|
|
160
|
+
<wui-text variant="sm-medium" color="primary">
|
|
161
|
+
<wui-text variant="sm-regular" color="secondary">Fees</wui-text>
|
|
162
|
+
${this.feeRange}
|
|
163
|
+
</wui-text>
|
|
164
|
+
<wui-flex gap="2">
|
|
165
|
+
<wui-icon name="bank" size="sm" color="default"></wui-icon>
|
|
166
|
+
<wui-icon name="card" size="sm" color="default"></wui-icon>
|
|
167
|
+
</wui-flex>
|
|
168
|
+
${this.networksTemplate()}
|
|
169
|
+
</wui-flex>
|
|
170
|
+
</wui-flex>
|
|
171
|
+
${this.loading ? u`<wui-loading-spinner color="secondary" size="md"></wui-loading-spinner>` : u`<wui-icon name="chevronRight" color="default" size="sm"></wui-icon>`}
|
|
172
|
+
</button>
|
|
173
|
+
`;
|
|
174
|
+
}
|
|
175
|
+
networksTemplate() {
|
|
176
|
+
var n;
|
|
177
|
+
const e = I.getAllRequestedCaipNetworks(), i = (n = e == null ? void 0 : e.filter((o) => {
|
|
178
|
+
var r;
|
|
179
|
+
return (r = o == null ? void 0 : o.assets) == null ? void 0 : r.imageId;
|
|
180
|
+
})) == null ? void 0 : n.slice(0, 5);
|
|
181
|
+
return u`
|
|
182
|
+
<wui-flex class="networks">
|
|
183
|
+
${i == null ? void 0 : i.map((o) => u`
|
|
184
|
+
<wui-flex class="network-icon">
|
|
185
|
+
<wui-image src=${m(E.getNetworkImage(o))}></wui-image>
|
|
186
|
+
</wui-flex>
|
|
187
|
+
`)}
|
|
188
|
+
</wui-flex>
|
|
189
|
+
`;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
h.styles = [Y];
|
|
193
|
+
v([
|
|
194
|
+
p({ type: Boolean })
|
|
195
|
+
], h.prototype, "disabled", void 0);
|
|
196
|
+
v([
|
|
197
|
+
p()
|
|
198
|
+
], h.prototype, "color", void 0);
|
|
199
|
+
v([
|
|
200
|
+
p()
|
|
201
|
+
], h.prototype, "name", void 0);
|
|
202
|
+
v([
|
|
203
|
+
p()
|
|
204
|
+
], h.prototype, "label", void 0);
|
|
205
|
+
v([
|
|
206
|
+
p()
|
|
207
|
+
], h.prototype, "feeRange", void 0);
|
|
208
|
+
v([
|
|
209
|
+
p({ type: Boolean })
|
|
210
|
+
], h.prototype, "loading", void 0);
|
|
211
|
+
v([
|
|
212
|
+
p()
|
|
213
|
+
], h.prototype, "onClick", void 0);
|
|
214
|
+
h = v([
|
|
215
|
+
g("w3m-onramp-provider-item")
|
|
216
|
+
], h);
|
|
217
|
+
var S = function(t, e, i, n) {
|
|
218
|
+
var o = arguments.length, r = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
|
|
219
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, n);
|
|
220
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (o < 3 ? s(r) : o > 3 ? s(e, i, r) : s(e, i)) || r);
|
|
221
|
+
return o > 3 && r && Object.defineProperty(e, i, r), r;
|
|
222
|
+
};
|
|
223
|
+
let U = class extends b {
|
|
224
|
+
constructor() {
|
|
225
|
+
super(), this.unsubscribe = [], this.providers = c.state.providers, this.unsubscribe.push(c.subscribeKey("providers", (e) => {
|
|
226
|
+
this.providers = e;
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
render() {
|
|
230
|
+
return u`
|
|
231
|
+
<wui-flex flexDirection="column" .padding=${["0", "3", "3", "3"]} gap="2">
|
|
232
|
+
${this.onRampProvidersTemplate()}
|
|
233
|
+
</wui-flex>
|
|
234
|
+
`;
|
|
235
|
+
}
|
|
236
|
+
onRampProvidersTemplate() {
|
|
237
|
+
return this.providers.filter((e) => e.supportedChains.includes(I.state.activeChain ?? "eip155")).map((e) => u`
|
|
238
|
+
<w3m-onramp-provider-item
|
|
239
|
+
label=${e.label}
|
|
240
|
+
name=${e.name}
|
|
241
|
+
feeRange=${e.feeRange}
|
|
242
|
+
@click=${() => {
|
|
243
|
+
this.onClickProvider(e);
|
|
244
|
+
}}
|
|
245
|
+
?disabled=${!e.url}
|
|
246
|
+
data-testid=${`onramp-provider-${e.name}`}
|
|
247
|
+
></w3m-onramp-provider-item>
|
|
248
|
+
`);
|
|
249
|
+
}
|
|
250
|
+
onClickProvider(e) {
|
|
251
|
+
var i;
|
|
252
|
+
c.setSelectedProvider(e), D.push("BuyInProgress"), B.openHref(((i = c.state.selectedProvider) == null ? void 0 : i.url) || e.url, "popupWindow", "width=600,height=800,scrollbars=yes"), z.sendEvent({
|
|
253
|
+
type: "track",
|
|
254
|
+
event: "SELECT_BUY_PROVIDER",
|
|
255
|
+
properties: {
|
|
256
|
+
provider: e.name,
|
|
257
|
+
isSmartAccount: V(I.state.activeChain) === K.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
S([
|
|
263
|
+
l()
|
|
264
|
+
], U.prototype, "providers", void 0);
|
|
265
|
+
U = S([
|
|
266
|
+
g("w3m-onramp-providers-view")
|
|
267
|
+
], U);
|
|
268
|
+
const q = O`
|
|
269
|
+
:host > wui-grid {
|
|
270
|
+
max-height: 360px;
|
|
271
|
+
overflow: auto;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
wui-flex {
|
|
275
|
+
transition: opacity ${({ easings: t }) => t["ease-out-power-1"]}
|
|
276
|
+
${({ durations: t }) => t.md};
|
|
277
|
+
will-change: opacity;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
wui-grid::-webkit-scrollbar {
|
|
281
|
+
display: none;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
wui-flex.disabled {
|
|
285
|
+
opacity: 0.3;
|
|
286
|
+
pointer-events: none;
|
|
287
|
+
user-select: none;
|
|
288
|
+
}
|
|
289
|
+
`;
|
|
290
|
+
var _ = function(t, e, i, n) {
|
|
291
|
+
var o = arguments.length, r = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
|
|
292
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, n);
|
|
293
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (o < 3 ? s(r) : o > 3 ? s(e, i, r) : s(e, i)) || r);
|
|
294
|
+
return o > 3 && r && Object.defineProperty(e, i, r), r;
|
|
295
|
+
};
|
|
296
|
+
let R = class extends b {
|
|
297
|
+
constructor() {
|
|
298
|
+
super(), this.unsubscribe = [], this.selectedCurrency = c.state.purchaseCurrencies, this.tokens = c.state.purchaseCurrencies, this.tokenImages = C.state.tokenImages, this.checked = T.state.isLegalCheckboxChecked, this.unsubscribe.push(c.subscribe((e) => {
|
|
299
|
+
this.selectedCurrency = e.purchaseCurrencies, this.tokens = e.purchaseCurrencies;
|
|
300
|
+
}), C.subscribeKey("tokenImages", (e) => this.tokenImages = e), T.subscribeKey("isLegalCheckboxChecked", (e) => {
|
|
301
|
+
this.checked = e;
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
304
|
+
disconnectedCallback() {
|
|
305
|
+
this.unsubscribe.forEach((e) => e());
|
|
306
|
+
}
|
|
307
|
+
render() {
|
|
308
|
+
var a;
|
|
309
|
+
const { termsConditionsUrl: e, privacyPolicyUrl: i } = j.state, n = (a = j.state.features) == null ? void 0 : a.legalCheckbox, s = !!(e || i) && !!n && !this.checked;
|
|
310
|
+
return u`
|
|
311
|
+
<w3m-legal-checkbox></w3m-legal-checkbox>
|
|
312
|
+
<wui-flex
|
|
313
|
+
flexDirection="column"
|
|
314
|
+
.padding=${["0", "3", "3", "3"]}
|
|
315
|
+
gap="2"
|
|
316
|
+
class=${m(s ? "disabled" : void 0)}
|
|
317
|
+
>
|
|
318
|
+
${this.currenciesTemplate(s)}
|
|
319
|
+
</wui-flex>
|
|
320
|
+
`;
|
|
321
|
+
}
|
|
322
|
+
currenciesTemplate(e = !1) {
|
|
323
|
+
return this.tokens.map((i) => {
|
|
324
|
+
var n;
|
|
325
|
+
return u`
|
|
326
|
+
<wui-list-item
|
|
327
|
+
imageSrc=${m((n = this.tokenImages) == null ? void 0 : n[i.symbol])}
|
|
328
|
+
@click=${() => this.selectToken(i)}
|
|
329
|
+
variant="image"
|
|
330
|
+
tabIdx=${m(e ? -1 : void 0)}
|
|
331
|
+
>
|
|
332
|
+
<wui-flex gap="1" alignItems="center">
|
|
333
|
+
<wui-text variant="md-medium" color="primary">${i.name}</wui-text>
|
|
334
|
+
<wui-text variant="sm-regular" color="secondary">${i.symbol}</wui-text>
|
|
335
|
+
</wui-flex>
|
|
336
|
+
</wui-list-item>
|
|
337
|
+
`;
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
selectToken(e) {
|
|
341
|
+
e && (c.setPurchaseCurrency(e), $.close());
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
R.styles = q;
|
|
345
|
+
_([
|
|
346
|
+
l()
|
|
347
|
+
], R.prototype, "selectedCurrency", void 0);
|
|
348
|
+
_([
|
|
349
|
+
l()
|
|
350
|
+
], R.prototype, "tokens", void 0);
|
|
351
|
+
_([
|
|
352
|
+
l()
|
|
353
|
+
], R.prototype, "tokenImages", void 0);
|
|
354
|
+
_([
|
|
355
|
+
l()
|
|
356
|
+
], R.prototype, "checked", void 0);
|
|
357
|
+
R = _([
|
|
358
|
+
g("w3m-onramp-token-select-view")
|
|
359
|
+
], R);
|
|
360
|
+
const X = O`
|
|
361
|
+
@keyframes shake {
|
|
362
|
+
0% {
|
|
363
|
+
transform: translateX(0);
|
|
364
|
+
}
|
|
365
|
+
25% {
|
|
366
|
+
transform: translateX(3px);
|
|
367
|
+
}
|
|
368
|
+
50% {
|
|
369
|
+
transform: translateX(-3px);
|
|
370
|
+
}
|
|
371
|
+
75% {
|
|
372
|
+
transform: translateX(3px);
|
|
373
|
+
}
|
|
374
|
+
100% {
|
|
375
|
+
transform: translateX(0);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
wui-flex:first-child:not(:only-child) {
|
|
380
|
+
position: relative;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
wui-loading-thumbnail {
|
|
384
|
+
position: absolute;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
wui-visual {
|
|
388
|
+
border-radius: calc(
|
|
389
|
+
${({ borderRadius: t }) => t[1]} * 9 - ${({ borderRadius: t }) => t[3]}
|
|
390
|
+
);
|
|
391
|
+
position: relative;
|
|
392
|
+
overflow: hidden;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
wui-icon-box {
|
|
396
|
+
position: absolute;
|
|
397
|
+
right: calc(${({ spacing: t }) => t[1]} * -1);
|
|
398
|
+
bottom: calc(${({ spacing: t }) => t[1]} * -1);
|
|
399
|
+
opacity: 0;
|
|
400
|
+
transform: scale(0.5);
|
|
401
|
+
transition:
|
|
402
|
+
opacity ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
403
|
+
transform ${({ durations: t }) => t.lg}
|
|
404
|
+
${({ easings: t }) => t["ease-out-power-2"]};
|
|
405
|
+
will-change: opacity, transform;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
wui-text[align='center'] {
|
|
409
|
+
width: 100%;
|
|
410
|
+
padding: 0px ${({ spacing: t }) => t[4]};
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
[data-error='true'] wui-icon-box {
|
|
414
|
+
opacity: 1;
|
|
415
|
+
transform: scale(1);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
[data-error='true'] > wui-flex:first-child {
|
|
419
|
+
animation: shake 250ms ${({ easings: t }) => t["ease-out-power-2"]} both;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
[data-retry='false'] wui-link {
|
|
423
|
+
display: none;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
[data-retry='true'] wui-link {
|
|
427
|
+
display: block;
|
|
428
|
+
opacity: 1;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
wui-link {
|
|
432
|
+
padding: ${({ spacing: t }) => t["01"]} ${({ spacing: t }) => t[2]};
|
|
433
|
+
}
|
|
434
|
+
`;
|
|
435
|
+
var y = function(t, e, i, n) {
|
|
436
|
+
var o = arguments.length, r = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
|
|
437
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, n);
|
|
438
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (o < 3 ? s(r) : o > 3 ? s(e, i, r) : s(e, i)) || r);
|
|
439
|
+
return o > 3 && r && Object.defineProperty(e, i, r), r;
|
|
440
|
+
};
|
|
441
|
+
let d = class extends b {
|
|
442
|
+
constructor() {
|
|
443
|
+
super(), this.unsubscribe = [], this.selectedOnRampProvider = c.state.selectedProvider, this.uri = M.state.wcUri, this.ready = !1, this.showRetry = !1, this.buffering = !1, this.error = !1, this.isMobile = !1, this.onRetry = void 0, this.unsubscribe.push(c.subscribeKey("selectedProvider", (e) => {
|
|
444
|
+
this.selectedOnRampProvider = e;
|
|
445
|
+
}));
|
|
446
|
+
}
|
|
447
|
+
disconnectedCallback() {
|
|
448
|
+
this.intervalId && clearInterval(this.intervalId);
|
|
449
|
+
}
|
|
450
|
+
render() {
|
|
451
|
+
var n, o;
|
|
452
|
+
let e = "Continue in external window";
|
|
453
|
+
this.error ? e = "Buy failed" : this.selectedOnRampProvider && (e = `Buy in ${(n = this.selectedOnRampProvider) == null ? void 0 : n.label}`);
|
|
454
|
+
const i = this.error ? "Buy can be declined from your side or due to and error on the provider app" : "We’ll notify you once your Buy is processed";
|
|
455
|
+
return u`
|
|
456
|
+
<wui-flex
|
|
457
|
+
data-error=${m(this.error)}
|
|
458
|
+
data-retry=${this.showRetry}
|
|
459
|
+
flexDirection="column"
|
|
460
|
+
alignItems="center"
|
|
461
|
+
.padding=${["10", "5", "5", "5"]}
|
|
462
|
+
gap="5"
|
|
463
|
+
>
|
|
464
|
+
<wui-flex justifyContent="center" alignItems="center">
|
|
465
|
+
<wui-visual
|
|
466
|
+
name=${m((o = this.selectedOnRampProvider) == null ? void 0 : o.name)}
|
|
467
|
+
size="lg"
|
|
468
|
+
class="provider-image"
|
|
469
|
+
>
|
|
470
|
+
</wui-visual>
|
|
471
|
+
|
|
472
|
+
${this.error ? null : this.loaderTemplate()}
|
|
473
|
+
|
|
474
|
+
<wui-icon-box
|
|
475
|
+
color="error"
|
|
476
|
+
icon="close"
|
|
477
|
+
size="sm"
|
|
478
|
+
border
|
|
479
|
+
borderColor="wui-color-bg-125"
|
|
480
|
+
></wui-icon-box>
|
|
481
|
+
</wui-flex>
|
|
482
|
+
|
|
483
|
+
<wui-flex
|
|
484
|
+
flexDirection="column"
|
|
485
|
+
alignItems="center"
|
|
486
|
+
gap="2"
|
|
487
|
+
.padding=${["4", "0", "0", "0"]}
|
|
488
|
+
>
|
|
489
|
+
<wui-text variant="md-medium" color=${this.error ? "error" : "primary"}>
|
|
490
|
+
${e}
|
|
491
|
+
</wui-text>
|
|
492
|
+
<wui-text align="center" variant="sm-medium" color="secondary">${i}</wui-text>
|
|
493
|
+
</wui-flex>
|
|
494
|
+
|
|
495
|
+
${this.error ? this.tryAgainTemplate() : null}
|
|
496
|
+
</wui-flex>
|
|
497
|
+
|
|
498
|
+
<wui-flex .padding=${["0", "5", "5", "5"]} justifyContent="center">
|
|
499
|
+
<wui-link @click=${this.onCopyUri} color="secondary">
|
|
500
|
+
<wui-icon size="sm" color="default" slot="iconLeft" name="copy"></wui-icon>
|
|
501
|
+
Copy link
|
|
502
|
+
</wui-link>
|
|
503
|
+
</wui-flex>
|
|
504
|
+
`;
|
|
505
|
+
}
|
|
506
|
+
onTryAgain() {
|
|
507
|
+
this.selectedOnRampProvider && (this.error = !1, B.openHref(this.selectedOnRampProvider.url, "popupWindow", "width=600,height=800,scrollbars=yes"));
|
|
508
|
+
}
|
|
509
|
+
tryAgainTemplate() {
|
|
510
|
+
var e;
|
|
511
|
+
return (e = this.selectedOnRampProvider) != null && e.url ? u`<wui-button size="md" variant="accent" @click=${this.onTryAgain.bind(this)}>
|
|
512
|
+
<wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
|
|
513
|
+
Try again
|
|
514
|
+
</wui-button>` : null;
|
|
515
|
+
}
|
|
516
|
+
loaderTemplate() {
|
|
517
|
+
const e = N.state.themeVariables["--w3m-border-radius-master"], i = e ? parseInt(e.replace("px", ""), 10) : 4;
|
|
518
|
+
return u`<wui-loading-thumbnail radius=${i * 9}></wui-loading-thumbnail>`;
|
|
519
|
+
}
|
|
520
|
+
onCopyUri() {
|
|
521
|
+
var e;
|
|
522
|
+
if (!((e = this.selectedOnRampProvider) != null && e.url)) {
|
|
523
|
+
W.showError("No link found"), D.goBack();
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
try {
|
|
527
|
+
B.copyToClopboard(this.selectedOnRampProvider.url), W.showSuccess("Link copied");
|
|
528
|
+
} catch {
|
|
529
|
+
W.showError("Failed to copy");
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
d.styles = X;
|
|
534
|
+
y([
|
|
535
|
+
l()
|
|
536
|
+
], d.prototype, "intervalId", void 0);
|
|
537
|
+
y([
|
|
538
|
+
l()
|
|
539
|
+
], d.prototype, "selectedOnRampProvider", void 0);
|
|
540
|
+
y([
|
|
541
|
+
l()
|
|
542
|
+
], d.prototype, "uri", void 0);
|
|
543
|
+
y([
|
|
544
|
+
l()
|
|
545
|
+
], d.prototype, "ready", void 0);
|
|
546
|
+
y([
|
|
547
|
+
l()
|
|
548
|
+
], d.prototype, "showRetry", void 0);
|
|
549
|
+
y([
|
|
550
|
+
l()
|
|
551
|
+
], d.prototype, "buffering", void 0);
|
|
552
|
+
y([
|
|
553
|
+
l()
|
|
554
|
+
], d.prototype, "error", void 0);
|
|
555
|
+
y([
|
|
556
|
+
p({ type: Boolean })
|
|
557
|
+
], d.prototype, "isMobile", void 0);
|
|
558
|
+
y([
|
|
559
|
+
p()
|
|
560
|
+
], d.prototype, "onRetry", void 0);
|
|
561
|
+
d = y([
|
|
562
|
+
g("w3m-buy-in-progress-view")
|
|
563
|
+
], d);
|
|
564
|
+
var Q = function(t, e, i, n) {
|
|
565
|
+
var o = arguments.length, r = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
|
|
566
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, n);
|
|
567
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (o < 3 ? s(r) : o > 3 ? s(e, i, r) : s(e, i)) || r);
|
|
568
|
+
return o > 3 && r && Object.defineProperty(e, i, r), r;
|
|
569
|
+
};
|
|
570
|
+
let L = class extends b {
|
|
571
|
+
render() {
|
|
572
|
+
return u`
|
|
573
|
+
<wui-flex
|
|
574
|
+
flexDirection="column"
|
|
575
|
+
.padding=${["6", "10", "5", "10"]}
|
|
576
|
+
alignItems="center"
|
|
577
|
+
gap="5"
|
|
578
|
+
>
|
|
579
|
+
<wui-visual name="onrampCard"></wui-visual>
|
|
580
|
+
<wui-flex flexDirection="column" gap="2" alignItems="center">
|
|
581
|
+
<wui-text align="center" variant="md-medium" color="primary">
|
|
582
|
+
Quickly and easily buy digital assets!
|
|
583
|
+
</wui-text>
|
|
584
|
+
<wui-text align="center" variant="sm-regular" color="secondary">
|
|
585
|
+
Simply select your preferred onramp provider and add digital assets to your account
|
|
586
|
+
using your credit card or bank transfer
|
|
587
|
+
</wui-text>
|
|
588
|
+
</wui-flex>
|
|
589
|
+
<wui-button @click=${D.goBack}>
|
|
590
|
+
<wui-icon size="sm" color="inherit" name="add" slot="iconLeft"></wui-icon>
|
|
591
|
+
Buy
|
|
592
|
+
</wui-button>
|
|
593
|
+
</wui-flex>
|
|
594
|
+
`;
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
L = Q([
|
|
598
|
+
g("w3m-what-is-a-buy-view")
|
|
599
|
+
], L);
|
|
600
|
+
const H = O`
|
|
601
|
+
:host {
|
|
602
|
+
width: 100%;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
wui-loading-spinner {
|
|
606
|
+
position: absolute;
|
|
607
|
+
top: 50%;
|
|
608
|
+
right: 20px;
|
|
609
|
+
transform: translateY(-50%);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.currency-container {
|
|
613
|
+
position: absolute;
|
|
614
|
+
top: 50%;
|
|
615
|
+
transform: translateY(-50%);
|
|
616
|
+
right: ${({ spacing: t }) => t[2]};
|
|
617
|
+
height: 40px;
|
|
618
|
+
padding: ${({ spacing: t }) => t[2]} ${({ spacing: t }) => t[2]}
|
|
619
|
+
${({ spacing: t }) => t[2]} ${({ spacing: t }) => t[2]};
|
|
620
|
+
min-width: 95px;
|
|
621
|
+
border-radius: ${({ borderRadius: t }) => t.round};
|
|
622
|
+
border: 1px solid ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
623
|
+
background: ${({ tokens: t }) => t.theme.foregroundPrimary};
|
|
624
|
+
cursor: pointer;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.currency-container > wui-image {
|
|
628
|
+
height: 24px;
|
|
629
|
+
width: 24px;
|
|
630
|
+
border-radius: 50%;
|
|
631
|
+
}
|
|
632
|
+
`;
|
|
633
|
+
var k = function(t, e, i, n) {
|
|
634
|
+
var o = arguments.length, r = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
|
|
635
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, n);
|
|
636
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (o < 3 ? s(r) : o > 3 ? s(e, i, r) : s(e, i)) || r);
|
|
637
|
+
return o > 3 && r && Object.defineProperty(e, i, r), r;
|
|
638
|
+
};
|
|
639
|
+
let w = class extends b {
|
|
640
|
+
constructor() {
|
|
641
|
+
var e;
|
|
642
|
+
super(), this.unsubscribe = [], this.type = "Token", this.value = 0, this.currencies = [], this.selectedCurrency = (e = this.currencies) == null ? void 0 : e[0], this.currencyImages = C.state.currencyImages, this.tokenImages = C.state.tokenImages, this.unsubscribe.push(c.subscribeKey("purchaseCurrency", (i) => {
|
|
643
|
+
!i || this.type === "Fiat" || (this.selectedCurrency = this.formatPurchaseCurrency(i));
|
|
644
|
+
}), c.subscribeKey("paymentCurrency", (i) => {
|
|
645
|
+
!i || this.type === "Token" || (this.selectedCurrency = this.formatPaymentCurrency(i));
|
|
646
|
+
}), c.subscribe((i) => {
|
|
647
|
+
this.type === "Fiat" ? this.currencies = i.purchaseCurrencies.map(this.formatPurchaseCurrency) : this.currencies = i.paymentCurrencies.map(this.formatPaymentCurrency);
|
|
648
|
+
}), C.subscribe((i) => {
|
|
649
|
+
this.currencyImages = { ...i.currencyImages }, this.tokenImages = { ...i.tokenImages };
|
|
650
|
+
}));
|
|
651
|
+
}
|
|
652
|
+
firstUpdated() {
|
|
653
|
+
c.getAvailableCurrencies();
|
|
654
|
+
}
|
|
655
|
+
disconnectedCallback() {
|
|
656
|
+
this.unsubscribe.forEach((e) => e());
|
|
657
|
+
}
|
|
658
|
+
render() {
|
|
659
|
+
var n;
|
|
660
|
+
const e = ((n = this.selectedCurrency) == null ? void 0 : n.symbol) || "", i = this.currencyImages[e] || this.tokenImages[e];
|
|
661
|
+
return u`<wui-input-text type="number" size="lg" value=${this.value}>
|
|
662
|
+
${this.selectedCurrency ? u` <wui-flex
|
|
663
|
+
class="currency-container"
|
|
664
|
+
justifyContent="space-between"
|
|
665
|
+
alignItems="center"
|
|
666
|
+
gap="1"
|
|
667
|
+
@click=${() => $.open({ view: `OnRamp${this.type}Select` })}
|
|
668
|
+
>
|
|
669
|
+
<wui-image src=${m(i)}></wui-image>
|
|
670
|
+
<wui-text color="primary">${this.selectedCurrency.symbol}</wui-text>
|
|
671
|
+
</wui-flex>` : u`<wui-loading-spinner></wui-loading-spinner>`}
|
|
672
|
+
</wui-input-text>`;
|
|
673
|
+
}
|
|
674
|
+
formatPaymentCurrency(e) {
|
|
675
|
+
return {
|
|
676
|
+
name: e.id,
|
|
677
|
+
symbol: e.id
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
formatPurchaseCurrency(e) {
|
|
681
|
+
return {
|
|
682
|
+
name: e.name,
|
|
683
|
+
symbol: e.symbol
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
w.styles = H;
|
|
688
|
+
k([
|
|
689
|
+
p({ type: String })
|
|
690
|
+
], w.prototype, "type", void 0);
|
|
691
|
+
k([
|
|
692
|
+
p({ type: Number })
|
|
693
|
+
], w.prototype, "value", void 0);
|
|
694
|
+
k([
|
|
695
|
+
l()
|
|
696
|
+
], w.prototype, "currencies", void 0);
|
|
697
|
+
k([
|
|
698
|
+
l()
|
|
699
|
+
], w.prototype, "selectedCurrency", void 0);
|
|
700
|
+
k([
|
|
701
|
+
l()
|
|
702
|
+
], w.prototype, "currencyImages", void 0);
|
|
703
|
+
k([
|
|
704
|
+
l()
|
|
705
|
+
], w.prototype, "tokenImages", void 0);
|
|
706
|
+
w = k([
|
|
707
|
+
g("w3m-onramp-input")
|
|
708
|
+
], w);
|
|
709
|
+
const G = O`
|
|
710
|
+
:host > wui-flex {
|
|
711
|
+
width: 100%;
|
|
712
|
+
max-width: 360px;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
:host > wui-flex > wui-flex {
|
|
716
|
+
border-radius: ${({ borderRadius: t }) => t[8]};
|
|
717
|
+
width: 100%;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
.amounts-container {
|
|
721
|
+
width: 100%;
|
|
722
|
+
}
|
|
723
|
+
`;
|
|
724
|
+
var x = function(t, e, i, n) {
|
|
725
|
+
var o = arguments.length, r = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, i) : n, s;
|
|
726
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, e, i, n);
|
|
727
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (r = (o < 3 ? s(r) : o > 3 ? s(e, i, r) : s(e, i)) || r);
|
|
728
|
+
return o > 3 && r && Object.defineProperty(e, i, r), r;
|
|
729
|
+
};
|
|
730
|
+
const J = {
|
|
731
|
+
USD: "$",
|
|
732
|
+
EUR: "€",
|
|
733
|
+
GBP: "£"
|
|
734
|
+
}, Z = [100, 250, 500, 1e3];
|
|
735
|
+
let f = class extends b {
|
|
736
|
+
constructor() {
|
|
737
|
+
super(), this.unsubscribe = [], this.disabled = !1, this.caipAddress = I.state.activeCaipAddress, this.loading = $.state.loading, this.paymentCurrency = c.state.paymentCurrency, this.paymentAmount = c.state.paymentAmount, this.purchaseAmount = c.state.purchaseAmount, this.quoteLoading = c.state.quotesLoading, this.unsubscribe.push(I.subscribeKey("activeCaipAddress", (e) => this.caipAddress = e), $.subscribeKey("loading", (e) => {
|
|
738
|
+
this.loading = e;
|
|
739
|
+
}), c.subscribe((e) => {
|
|
740
|
+
this.paymentCurrency = e.paymentCurrency, this.paymentAmount = e.paymentAmount, this.purchaseAmount = e.purchaseAmount, this.quoteLoading = e.quotesLoading;
|
|
741
|
+
}));
|
|
742
|
+
}
|
|
743
|
+
disconnectedCallback() {
|
|
744
|
+
this.unsubscribe.forEach((e) => e());
|
|
745
|
+
}
|
|
746
|
+
render() {
|
|
747
|
+
return u`
|
|
748
|
+
<wui-flex flexDirection="column" justifyContent="center" alignItems="center">
|
|
749
|
+
<wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
750
|
+
<w3m-onramp-input
|
|
751
|
+
type="Fiat"
|
|
752
|
+
@inputChange=${this.onPaymentAmountChange.bind(this)}
|
|
753
|
+
.value=${this.paymentAmount || 0}
|
|
754
|
+
></w3m-onramp-input>
|
|
755
|
+
<w3m-onramp-input
|
|
756
|
+
type="Token"
|
|
757
|
+
.value=${this.purchaseAmount || 0}
|
|
758
|
+
.loading=${this.quoteLoading}
|
|
759
|
+
></w3m-onramp-input>
|
|
760
|
+
<wui-flex justifyContent="space-evenly" class="amounts-container" gap="2">
|
|
761
|
+
${Z.map((e) => {
|
|
762
|
+
var i;
|
|
763
|
+
return u`<wui-button
|
|
764
|
+
variant=${this.paymentAmount === e ? "accent-secondary" : "neutral-secondary"}
|
|
765
|
+
size="md"
|
|
766
|
+
textVariant="md-medium"
|
|
767
|
+
fullWidth
|
|
768
|
+
@click=${() => this.selectPresetAmount(e)}
|
|
769
|
+
>${`${J[((i = this.paymentCurrency) == null ? void 0 : i.id) || "USD"]} ${e}`}</wui-button
|
|
770
|
+
>`;
|
|
771
|
+
})}
|
|
772
|
+
</wui-flex>
|
|
773
|
+
${this.templateButton()}
|
|
774
|
+
</wui-flex>
|
|
775
|
+
</wui-flex>
|
|
776
|
+
`;
|
|
777
|
+
}
|
|
778
|
+
templateButton() {
|
|
779
|
+
return this.caipAddress ? u`<wui-button
|
|
780
|
+
@click=${this.getQuotes.bind(this)}
|
|
781
|
+
variant="accent-primary"
|
|
782
|
+
fullWidth
|
|
783
|
+
size="lg"
|
|
784
|
+
borderRadius="xs"
|
|
785
|
+
>
|
|
786
|
+
Get quotes
|
|
787
|
+
</wui-button>` : u`<wui-button
|
|
788
|
+
@click=${this.openModal.bind(this)}
|
|
789
|
+
variant="accent"
|
|
790
|
+
fullWidth
|
|
791
|
+
size="lg"
|
|
792
|
+
borderRadius="xs"
|
|
793
|
+
>
|
|
794
|
+
Connect wallet
|
|
795
|
+
</wui-button>`;
|
|
796
|
+
}
|
|
797
|
+
getQuotes() {
|
|
798
|
+
this.loading || $.open({ view: "OnRampProviders" });
|
|
799
|
+
}
|
|
800
|
+
openModal() {
|
|
801
|
+
$.open({ view: "Connect" });
|
|
802
|
+
}
|
|
803
|
+
async onPaymentAmountChange(e) {
|
|
804
|
+
c.setPaymentAmount(Number(e.detail)), await c.getQuote();
|
|
805
|
+
}
|
|
806
|
+
async selectPresetAmount(e) {
|
|
807
|
+
c.setPaymentAmount(e), await c.getQuote();
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
f.styles = G;
|
|
811
|
+
x([
|
|
812
|
+
p({ type: Boolean })
|
|
813
|
+
], f.prototype, "disabled", void 0);
|
|
814
|
+
x([
|
|
815
|
+
l()
|
|
816
|
+
], f.prototype, "caipAddress", void 0);
|
|
817
|
+
x([
|
|
818
|
+
l()
|
|
819
|
+
], f.prototype, "loading", void 0);
|
|
820
|
+
x([
|
|
821
|
+
l()
|
|
822
|
+
], f.prototype, "paymentCurrency", void 0);
|
|
823
|
+
x([
|
|
824
|
+
l()
|
|
825
|
+
], f.prototype, "paymentAmount", void 0);
|
|
826
|
+
x([
|
|
827
|
+
l()
|
|
828
|
+
], f.prototype, "purchaseAmount", void 0);
|
|
829
|
+
x([
|
|
830
|
+
l()
|
|
831
|
+
], f.prototype, "quoteLoading", void 0);
|
|
832
|
+
f = x([
|
|
833
|
+
g("w3m-onramp-widget")
|
|
834
|
+
], f);
|
|
835
|
+
export {
|
|
836
|
+
d as W3mBuyInProgressView,
|
|
837
|
+
U as W3mOnRampProvidersView,
|
|
838
|
+
P as W3mOnrampFiatSelectView,
|
|
839
|
+
R as W3mOnrampTokensView,
|
|
840
|
+
f as W3mOnrampWidget,
|
|
841
|
+
L as W3mWhatIsABuyView
|
|
842
|
+
};
|