@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,228 @@
|
|
|
1
|
+
import { bR as k, bS as v, bT as N, bU as x, bV as $, bW as C, bX as u, ca as c, c4 as h, cs as m, ct as f, b$ as R, cu as A, c8 as S, c9 as I, c3 as T, cc as O, cv as b } from "./index-B6Mg114Z.mjs";
|
|
2
|
+
const _ = k`
|
|
3
|
+
button {
|
|
4
|
+
width: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
gap: ${({ spacing: e }) => e[4]};
|
|
9
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
10
|
+
border-radius: ${({ borderRadius: e }) => e[3]};
|
|
11
|
+
border: none;
|
|
12
|
+
padding: ${({ spacing: e }) => e[3]};
|
|
13
|
+
transition: background-color ${({ durations: e }) => e.lg}
|
|
14
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
15
|
+
will-change: background-color;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
19
|
+
button:hover:enabled,
|
|
20
|
+
button:active:enabled {
|
|
21
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
wui-text {
|
|
25
|
+
flex: 1;
|
|
26
|
+
color: ${({ tokens: e }) => e.theme.textSecondary};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
wui-flex {
|
|
30
|
+
width: auto;
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: ${({ spacing: e }) => e["01"]};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
wui-icon {
|
|
37
|
+
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.network-icon {
|
|
41
|
+
position: relative;
|
|
42
|
+
width: 20px;
|
|
43
|
+
height: 20px;
|
|
44
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
margin-left: -8px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.network-icon:first-child {
|
|
50
|
+
margin-left: 0px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.network-icon:after {
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
content: '';
|
|
57
|
+
display: block;
|
|
58
|
+
height: 100%;
|
|
59
|
+
width: 100%;
|
|
60
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
61
|
+
box-shadow: inset 0 0 0 1px ${({ tokens: e }) => e.core.glass010};
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
var g = function(e, t, o, i) {
|
|
65
|
+
var s = arguments.length, r = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, n;
|
|
66
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(e, t, o, i);
|
|
67
|
+
else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) && (r = (s < 3 ? n(r) : s > 3 ? n(t, o, r) : n(t, o)) || r);
|
|
68
|
+
return s > 3 && r && Object.defineProperty(t, o, r), r;
|
|
69
|
+
};
|
|
70
|
+
let p = class extends C {
|
|
71
|
+
constructor() {
|
|
72
|
+
super(...arguments), this.networkImages = [""], this.text = "";
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
return u`
|
|
76
|
+
<button>
|
|
77
|
+
<wui-text variant="md-regular" color="inherit">${this.text}</wui-text>
|
|
78
|
+
<wui-flex>
|
|
79
|
+
${this.networksTemplate()}
|
|
80
|
+
<wui-icon name="chevronRight" size="sm" color="inherit"></wui-icon>
|
|
81
|
+
</wui-flex>
|
|
82
|
+
</button>
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
networksTemplate() {
|
|
86
|
+
const t = this.networkImages.slice(0, 5);
|
|
87
|
+
return u` <wui-flex class="networks">
|
|
88
|
+
${t == null ? void 0 : t.map((o) => u` <wui-flex class="network-icon"> <wui-image src=${o}></wui-image> </wui-flex>`)}
|
|
89
|
+
</wui-flex>`;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
p.styles = [v, N, _];
|
|
93
|
+
g([
|
|
94
|
+
x({ type: Array })
|
|
95
|
+
], p.prototype, "networkImages", void 0);
|
|
96
|
+
g([
|
|
97
|
+
x()
|
|
98
|
+
], p.prototype, "text", void 0);
|
|
99
|
+
p = g([
|
|
100
|
+
$("wui-compatible-network")
|
|
101
|
+
], p);
|
|
102
|
+
const E = k`
|
|
103
|
+
wui-compatible-network {
|
|
104
|
+
margin-top: ${({ spacing: e }) => e[4]};
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
wui-qr-code {
|
|
109
|
+
width: unset !important;
|
|
110
|
+
height: unset !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
wui-icon {
|
|
114
|
+
align-items: normal;
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
var w = function(e, t, o, i) {
|
|
118
|
+
var s = arguments.length, r = s < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, n;
|
|
119
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(e, t, o, i);
|
|
120
|
+
else for (var a = e.length - 1; a >= 0; a--) (n = e[a]) && (r = (s < 3 ? n(r) : s > 3 ? n(t, o, r) : n(t, o)) || r);
|
|
121
|
+
return s > 3 && r && Object.defineProperty(t, o, r), r;
|
|
122
|
+
};
|
|
123
|
+
let d = class extends C {
|
|
124
|
+
constructor() {
|
|
125
|
+
var t, o;
|
|
126
|
+
super(), this.unsubscribe = [], this.address = (t = c.getAccountData()) == null ? void 0 : t.address, this.profileName = (o = c.getAccountData()) == null ? void 0 : o.profileName, this.network = c.state.activeCaipNetwork, this.unsubscribe.push(c.subscribeChainProp("accountState", (i) => {
|
|
127
|
+
i ? (this.address = i.address, this.profileName = i.profileName) : h.showError("Account not found");
|
|
128
|
+
}), c.subscribeKey("activeCaipNetwork", (i) => {
|
|
129
|
+
i != null && i.id && (this.network = i);
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
disconnectedCallback() {
|
|
133
|
+
this.unsubscribe.forEach((t) => t());
|
|
134
|
+
}
|
|
135
|
+
render() {
|
|
136
|
+
if (!this.address)
|
|
137
|
+
throw new Error("w3m-wallet-receive-view: No account provided");
|
|
138
|
+
const t = m.getNetworkImage(this.network);
|
|
139
|
+
return u` <wui-flex
|
|
140
|
+
flexDirection="column"
|
|
141
|
+
.padding=${["0", "4", "4", "4"]}
|
|
142
|
+
alignItems="center"
|
|
143
|
+
>
|
|
144
|
+
<wui-chip-button
|
|
145
|
+
data-testid="receive-address-copy-button"
|
|
146
|
+
@click=${this.onCopyClick.bind(this)}
|
|
147
|
+
text=${R.getTruncateString({
|
|
148
|
+
string: this.profileName || this.address || "",
|
|
149
|
+
charsStart: this.profileName ? 18 : 4,
|
|
150
|
+
charsEnd: this.profileName ? 0 : 4,
|
|
151
|
+
truncate: this.profileName ? "end" : "middle"
|
|
152
|
+
})}
|
|
153
|
+
icon="copy"
|
|
154
|
+
size="sm"
|
|
155
|
+
imageSrc=${t || ""}
|
|
156
|
+
variant="gray"
|
|
157
|
+
></wui-chip-button>
|
|
158
|
+
<wui-flex
|
|
159
|
+
flexDirection="column"
|
|
160
|
+
.padding=${["4", "0", "0", "0"]}
|
|
161
|
+
alignItems="center"
|
|
162
|
+
gap="4"
|
|
163
|
+
>
|
|
164
|
+
<wui-qr-code
|
|
165
|
+
size=${232}
|
|
166
|
+
theme=${f.state.themeMode}
|
|
167
|
+
uri=${this.address}
|
|
168
|
+
?arenaClear=${!0}
|
|
169
|
+
color=${A(f.state.themeVariables["--apkt-qr-color"] ?? f.state.themeVariables["--w3m-qr-color"])}
|
|
170
|
+
data-testid="wui-qr-code"
|
|
171
|
+
></wui-qr-code>
|
|
172
|
+
<wui-text variant="lg-regular" color="primary" align="center">
|
|
173
|
+
Copy your address or scan this QR code
|
|
174
|
+
</wui-text>
|
|
175
|
+
<wui-button @click=${this.onCopyClick.bind(this)} size="sm" variant="neutral-secondary">
|
|
176
|
+
<wui-icon slot="iconLeft" size="sm" color="inherit" name="copy"></wui-icon>
|
|
177
|
+
<wui-text variant="md-regular" color="inherit">Copy address</wui-text>
|
|
178
|
+
</wui-button>
|
|
179
|
+
</wui-flex>
|
|
180
|
+
${this.networkTemplate()}
|
|
181
|
+
</wui-flex>`;
|
|
182
|
+
}
|
|
183
|
+
networkTemplate() {
|
|
184
|
+
var a;
|
|
185
|
+
const t = c.getAllRequestedCaipNetworks(), o = c.checkIfSmartAccountEnabled(), i = c.state.activeCaipNetwork, s = t.filter((l) => (l == null ? void 0 : l.chainNamespace) === (i == null ? void 0 : i.chainNamespace));
|
|
186
|
+
if (S(i == null ? void 0 : i.chainNamespace) === I.ACCOUNT_TYPES.SMART_ACCOUNT && o)
|
|
187
|
+
return i ? u`<wui-compatible-network
|
|
188
|
+
@click=${this.onReceiveClick.bind(this)}
|
|
189
|
+
text="Only receive assets on this network"
|
|
190
|
+
.networkImages=${[m.getNetworkImage(i) ?? ""]}
|
|
191
|
+
></wui-compatible-network>` : null;
|
|
192
|
+
const n = ((a = s == null ? void 0 : s.filter((l) => {
|
|
193
|
+
var y;
|
|
194
|
+
return (y = l == null ? void 0 : l.assets) == null ? void 0 : y.imageId;
|
|
195
|
+
})) == null ? void 0 : a.slice(0, 5)).map(m.getNetworkImage).filter(Boolean);
|
|
196
|
+
return u`<wui-compatible-network
|
|
197
|
+
@click=${this.onReceiveClick.bind(this)}
|
|
198
|
+
text="Only receive assets on these networks"
|
|
199
|
+
.networkImages=${n}
|
|
200
|
+
></wui-compatible-network>`;
|
|
201
|
+
}
|
|
202
|
+
onReceiveClick() {
|
|
203
|
+
T.push("WalletCompatibleNetworks");
|
|
204
|
+
}
|
|
205
|
+
onCopyClick() {
|
|
206
|
+
try {
|
|
207
|
+
this.address && (O.copyToClopboard(this.address), h.showSuccess("Address copied"));
|
|
208
|
+
} catch {
|
|
209
|
+
h.showError("Failed to copy");
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
d.styles = E;
|
|
214
|
+
w([
|
|
215
|
+
b()
|
|
216
|
+
], d.prototype, "address", void 0);
|
|
217
|
+
w([
|
|
218
|
+
b()
|
|
219
|
+
], d.prototype, "profileName", void 0);
|
|
220
|
+
w([
|
|
221
|
+
b()
|
|
222
|
+
], d.prototype, "network", void 0);
|
|
223
|
+
d = w([
|
|
224
|
+
$("w3m-wallet-receive-view")
|
|
225
|
+
], d);
|
|
226
|
+
export {
|
|
227
|
+
d as W3mWalletReceiveView
|
|
228
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CjZQCcwG.js"),m=e.css`
|
|
2
|
+
button {
|
|
3
|
+
width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
gap: ${({spacing:t})=>t[4]};
|
|
8
|
+
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
|
|
9
|
+
border-radius: ${({borderRadius:t})=>t[3]};
|
|
10
|
+
border: none;
|
|
11
|
+
padding: ${({spacing:t})=>t[3]};
|
|
12
|
+
transition: background-color ${({durations:t})=>t.lg}
|
|
13
|
+
${({easings:t})=>t["ease-out-power-2"]};
|
|
14
|
+
will-change: background-color;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
18
|
+
button:hover:enabled,
|
|
19
|
+
button:active:enabled {
|
|
20
|
+
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
wui-text {
|
|
24
|
+
flex: 1;
|
|
25
|
+
color: ${({tokens:t})=>t.theme.textSecondary};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
wui-flex {
|
|
29
|
+
width: auto;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: ${({spacing:t})=>t["01"]};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
wui-icon {
|
|
36
|
+
color: ${({tokens:t})=>t.theme.iconDefault};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.network-icon {
|
|
40
|
+
position: relative;
|
|
41
|
+
width: 20px;
|
|
42
|
+
height: 20px;
|
|
43
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
margin-left: -8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.network-icon:first-child {
|
|
49
|
+
margin-left: 0px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.network-icon:after {
|
|
53
|
+
position: absolute;
|
|
54
|
+
inset: 0;
|
|
55
|
+
content: '';
|
|
56
|
+
display: block;
|
|
57
|
+
height: 100%;
|
|
58
|
+
width: 100%;
|
|
59
|
+
border-radius: ${({borderRadius:t})=>t[4]};
|
|
60
|
+
box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.core.glass010};
|
|
61
|
+
}
|
|
62
|
+
`;var w=function(t,i,r,o){var s=arguments.length,n=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,r):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,i,r,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(n=(s<3?l(n):s>3?l(i,r,n):l(i,r))||n);return s>3&&n&&Object.defineProperty(i,r,n),n};let u=class extends e.i{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return e.b`
|
|
63
|
+
<button>
|
|
64
|
+
<wui-text variant="md-regular" color="inherit">${this.text}</wui-text>
|
|
65
|
+
<wui-flex>
|
|
66
|
+
${this.networksTemplate()}
|
|
67
|
+
<wui-icon name="chevronRight" size="sm" color="inherit"></wui-icon>
|
|
68
|
+
</wui-flex>
|
|
69
|
+
</button>
|
|
70
|
+
`}networksTemplate(){const i=this.networkImages.slice(0,5);return e.b` <wui-flex class="networks">
|
|
71
|
+
${i==null?void 0:i.map(r=>e.b` <wui-flex class="network-icon"> <wui-image src=${r}></wui-image> </wui-flex>`)}
|
|
72
|
+
</wui-flex>`}};u.styles=[e.resetStyles,e.elementStyles,m];w([e.n({type:Array})],u.prototype,"networkImages",void 0);w([e.n()],u.prototype,"text",void 0);u=w([e.customElement("wui-compatible-network")],u);const p=e.css`
|
|
73
|
+
wui-compatible-network {
|
|
74
|
+
margin-top: ${({spacing:t})=>t[4]};
|
|
75
|
+
width: 100%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
wui-qr-code {
|
|
79
|
+
width: unset !important;
|
|
80
|
+
height: unset !important;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
wui-icon {
|
|
84
|
+
align-items: normal;
|
|
85
|
+
}
|
|
86
|
+
`;var d=function(t,i,r,o){var s=arguments.length,n=s<3?i:o===null?o=Object.getOwnPropertyDescriptor(i,r):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,i,r,o);else for(var a=t.length-1;a>=0;a--)(l=t[a])&&(n=(s<3?l(n):s>3?l(i,r,n):l(i,r))||n);return s>3&&n&&Object.defineProperty(i,r,n),n};exports.W3mWalletReceiveView=class extends e.i{constructor(){var i,r;super(),this.unsubscribe=[],this.address=(i=e.ChainController.getAccountData())==null?void 0:i.address,this.profileName=(r=e.ChainController.getAccountData())==null?void 0:r.profileName,this.network=e.ChainController.state.activeCaipNetwork,this.unsubscribe.push(e.ChainController.subscribeChainProp("accountState",o=>{o?(this.address=o.address,this.profileName=o.profileName):e.SnackController.showError("Account not found")}),e.ChainController.subscribeKey("activeCaipNetwork",o=>{o!=null&&o.id&&(this.network=o)}))}disconnectedCallback(){this.unsubscribe.forEach(i=>i())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const i=e.AssetUtil.getNetworkImage(this.network);return e.b` <wui-flex
|
|
87
|
+
flexDirection="column"
|
|
88
|
+
.padding=${["0","4","4","4"]}
|
|
89
|
+
alignItems="center"
|
|
90
|
+
>
|
|
91
|
+
<wui-chip-button
|
|
92
|
+
data-testid="receive-address-copy-button"
|
|
93
|
+
@click=${this.onCopyClick.bind(this)}
|
|
94
|
+
text=${e.UiHelperUtil.getTruncateString({string:this.profileName||this.address||"",charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
|
|
95
|
+
icon="copy"
|
|
96
|
+
size="sm"
|
|
97
|
+
imageSrc=${i||""}
|
|
98
|
+
variant="gray"
|
|
99
|
+
></wui-chip-button>
|
|
100
|
+
<wui-flex
|
|
101
|
+
flexDirection="column"
|
|
102
|
+
.padding=${["4","0","0","0"]}
|
|
103
|
+
alignItems="center"
|
|
104
|
+
gap="4"
|
|
105
|
+
>
|
|
106
|
+
<wui-qr-code
|
|
107
|
+
size=${232}
|
|
108
|
+
theme=${e.ThemeController.state.themeMode}
|
|
109
|
+
uri=${this.address}
|
|
110
|
+
?arenaClear=${!0}
|
|
111
|
+
color=${e.o(e.ThemeController.state.themeVariables["--apkt-qr-color"]??e.ThemeController.state.themeVariables["--w3m-qr-color"])}
|
|
112
|
+
data-testid="wui-qr-code"
|
|
113
|
+
></wui-qr-code>
|
|
114
|
+
<wui-text variant="lg-regular" color="primary" align="center">
|
|
115
|
+
Copy your address or scan this QR code
|
|
116
|
+
</wui-text>
|
|
117
|
+
<wui-button @click=${this.onCopyClick.bind(this)} size="sm" variant="neutral-secondary">
|
|
118
|
+
<wui-icon slot="iconLeft" size="sm" color="inherit" name="copy"></wui-icon>
|
|
119
|
+
<wui-text variant="md-regular" color="inherit">Copy address</wui-text>
|
|
120
|
+
</wui-button>
|
|
121
|
+
</wui-flex>
|
|
122
|
+
${this.networkTemplate()}
|
|
123
|
+
</wui-flex>`}networkTemplate(){var a;const i=e.ChainController.getAllRequestedCaipNetworks(),r=e.ChainController.checkIfSmartAccountEnabled(),o=e.ChainController.state.activeCaipNetwork,s=i.filter(c=>(c==null?void 0:c.chainNamespace)===(o==null?void 0:o.chainNamespace));if(e.getPreferredAccountType(o==null?void 0:o.chainNamespace)===e.W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT&&r)return o?e.b`<wui-compatible-network
|
|
124
|
+
@click=${this.onReceiveClick.bind(this)}
|
|
125
|
+
text="Only receive assets on this network"
|
|
126
|
+
.networkImages=${[e.AssetUtil.getNetworkImage(o)??""]}
|
|
127
|
+
></wui-compatible-network>`:null;const l=((a=s==null?void 0:s.filter(c=>{var h;return(h=c==null?void 0:c.assets)==null?void 0:h.imageId}))==null?void 0:a.slice(0,5)).map(e.AssetUtil.getNetworkImage).filter(Boolean);return e.b`<wui-compatible-network
|
|
128
|
+
@click=${this.onReceiveClick.bind(this)}
|
|
129
|
+
text="Only receive assets on these networks"
|
|
130
|
+
.networkImages=${l}
|
|
131
|
+
></wui-compatible-network>`}onReceiveClick(){e.RouterController.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(e.CoreHelperUtil.copyToClopboard(this.address),e.SnackController.showSuccess("Address copied"))}catch{e.SnackController.showError("Failed to copy")}}};exports.W3mWalletReceiveView.styles=p;d([e.r()],exports.W3mWalletReceiveView.prototype,"address",void 0);d([e.r()],exports.W3mWalletReceiveView.prototype,"profileName",void 0);d([e.r()],exports.W3mWalletReceiveView.prototype,"network",void 0);exports.W3mWalletReceiveView=d([e.customElement("w3m-wallet-receive-view")],exports.W3mWalletReceiveView);
|