@directcryptopay/sdk 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -87
- package/dist/core/config.d.ts +9 -46
- package/dist/core/iframe.d.ts +16 -0
- package/dist/dcp-sdk.umd.js +1 -12811
- package/dist/dcp.d.ts +12 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +219 -2
- package/dist/types.d.ts +26 -164
- package/package.json +3 -13
- package/dist/ExchangeController-CPMQq6Q-.js +0 -217
- package/dist/HelpersUtil-DfMFC7Bf.js +0 -120
- package/dist/NavigationUtil-kj9LEOOd.js +0 -8
- package/dist/PhArrowCircleDown-lsK25DCk.js +0 -73
- package/dist/PhArrowClockwise-NeKHZ1co.js +0 -73
- package/dist/PhArrowDown-C9AkNvLs.js +0 -73
- package/dist/PhArrowLeft-RNfIQP1X.js +0 -73
- package/dist/PhArrowRight-DM1tna0G.js +0 -73
- package/dist/PhArrowSquareOut-S5XYbAZj.js +0 -73
- package/dist/PhArrowUp-DmktzOWy.js +0 -73
- package/dist/PhArrowUpRight-BkNeW_5i.js +0 -73
- package/dist/PhArrowsClockwise-CQ4pG76b.js +0 -73
- package/dist/PhArrowsDownUp-H6gxaNM6.js +0 -73
- package/dist/PhArrowsLeftRight-DZSsfMR6.js +0 -73
- package/dist/PhBank-4_9QzqIB.js +0 -73
- package/dist/PhBrowser-B-JSznId.js +0 -73
- package/dist/PhCaretDown-vV5oHMNi.js +0 -73
- package/dist/PhCaretLeft-BLo6Y_f4.js +0 -73
- package/dist/PhCaretRight-CqQN4TT3.js +0 -73
- package/dist/PhCaretUp-Df7UCAHy.js +0 -73
- package/dist/PhCheck-gtpfK4ed.js +0 -73
- package/dist/PhCircleHalf-Uq7dwDYw.js +0 -73
- package/dist/PhClock-SDCW-NmF.js +0 -73
- package/dist/PhCompass-B7hgtdx-.js +0 -73
- package/dist/PhCopy-BcnhyXCy.js +0 -73
- package/dist/PhCreditCard-BJjByVgu.js +0 -73
- package/dist/PhCurrencyDollar-B7ZXqXBy.js +0 -73
- package/dist/PhDesktop-B3VKPuJx.js +0 -73
- package/dist/PhDeviceMobile-Bnd0TYEH.js +0 -73
- package/dist/PhDotsThree-yyMWyZ-R.js +0 -73
- package/dist/PhEnvelope-67uzHbI9.js +0 -73
- package/dist/PhFunnelSimple-B-DCsloI.js +0 -73
- package/dist/PhGlobe-TMm_6qGk.js +0 -73
- package/dist/PhIdentificationCard-CePPD2xc.js +0 -73
- package/dist/PhImage-gY96WtHR.js +0 -73
- package/dist/PhInfo-DRQM_ZDP.js +0 -73
- package/dist/PhLightbulb-B0TxPfZ1.js +0 -73
- package/dist/PhMagnifyingGlass-B8si5_6W.js +0 -73
- package/dist/PhPaperPlaneRight-DVu5PLYd.js +0 -73
- package/dist/PhPlus-BfTsQnUz.js +0 -73
- package/dist/PhPower-CxYUGOWn.js +0 -73
- package/dist/PhPuzzlePiece-CQ4wh0gV.js +0 -73
- package/dist/PhQrCode-BuJ97NYJ.js +0 -73
- package/dist/PhQuestion-kJoP8Mja.js +0 -73
- package/dist/PhQuestionMark-C46ZkFpu.js +0 -73
- package/dist/PhSealCheck-Eh8jVqSN.js +0 -73
- package/dist/PhSignOut-jk97OSVt.js +0 -73
- package/dist/PhSpinner-CiYOhwMg.js +0 -73
- package/dist/PhTrash-pxerMqzd.js +0 -73
- package/dist/PhUser-BMg0VV4A.js +0 -73
- package/dist/PhVault-DYQvx5A-.js +0 -73
- package/dist/PhWarning-NLC5Mj87.js +0 -73
- package/dist/PhWarningCircle-Ch2jU9fA.js +0 -73
- package/dist/PhX-Bx4wpwm3.js +0 -73
- package/dist/SwapController-Cti0Cyxa.js +0 -457
- package/dist/ccip-CKZd2XJ7.js +0 -150
- package/dist/core/api.d.ts +0 -39
- package/dist/core/logic.d.ts +0 -2
- package/dist/core/wallet.d.ts +0 -55
- package/dist/data-capture-7D5CL385.js +0 -490
- package/dist/email-AmK0INbZ.js +0 -344
- package/dist/embedded-wallet-Pn0I_XLn.js +0 -820
- package/dist/features-x8XNprEe.js +0 -274
- package/dist/hashTypedData-B50-z0AA.js +0 -197
- package/dist/if-defined-CdZSZ6UL.js +0 -10
- package/dist/index-4ewUtPPp.js +0 -7981
- package/dist/index-51l86yqx.js +0 -276
- package/dist/index-B6K56LF_.js +0 -85
- package/dist/index-BAmv9PxJ.js +0 -257
- package/dist/index-BEswjY9r.js +0 -117
- package/dist/index-BSKRq56S.js +0 -355
- package/dist/index-BaygXQxx.js +0 -172
- package/dist/index-BcPxaHr5.js +0 -118
- package/dist/index-Bjt7nGaJ.js +0 -199
- package/dist/index-BkTSyAJb.js +0 -21991
- package/dist/index-Bmnl7l2U.js +0 -555
- package/dist/index-BvPvouSq.js +0 -56
- package/dist/index-C-6iznUO.js +0 -174
- package/dist/index-C1QEJL-2.js +0 -572
- package/dist/index-C4M5s_AM.js +0 -228
- package/dist/index-CEqcN8QP.js +0 -1175
- package/dist/index-CM3YaYca.js +0 -8189
- package/dist/index-CclBLA5r.js +0 -517
- package/dist/index-ChTxJOiF.js +0 -46
- package/dist/index-CmAv0Tzr.js +0 -86
- package/dist/index-CmvoKY4x.js +0 -125
- package/dist/index-D7PmdQ9B.js +0 -1750
- package/dist/index-D7k2Pc4e.js +0 -1083
- package/dist/index-D7lmgqUR.js +0 -153
- package/dist/index-DG_-qYze.js +0 -107
- package/dist/index-DHot9Fdb.js +0 -218
- package/dist/index-DV2LrPtU.js +0 -123
- package/dist/index-DYBaJQ2W.js +0 -65
- package/dist/index-D_8VUmn1.js +0 -41543
- package/dist/index-D_gLn3rT.js +0 -100
- package/dist/index-DqcVUSC9.js +0 -62
- package/dist/index-I7VDqINw.js +0 -128
- package/dist/index-Oz72I9VP.js +0 -209
- package/dist/index-UclsHkJ0.js +0 -118
- package/dist/index-X8zir_1j.js +0 -110
- package/dist/index-XvlWKGCu.js +0 -1281
- package/dist/index-dO97xPlt.js +0 -171
- package/dist/index-uBeF6OAB.js +0 -387
- package/dist/index-zeA_RiCV.js +0 -159
- package/dist/localBatchGatewayRequest-BUZHGdjw.js +0 -91
- package/dist/onramp-CdnBuF0r.js +0 -855
- package/dist/parseSignature-CcyTNGr4.js +0 -3304
- package/dist/pay-with-exchange-CSM6WCOV.js +0 -525
- package/dist/property-Bd8U3_QP.js +0 -618
- package/dist/receive-DooMu4Dx.js +0 -232
- package/dist/ref-CpgjXAw7.js +0 -107
- package/dist/send-3T7CyYic.js +0 -1166
- package/dist/socials-Dt-iHL17.js +0 -620
- package/dist/swaps-CjA9Es42.js +0 -1760
- package/dist/transactions-nRm9DVzn.js +0 -37
- package/dist/ui/Modal.d.ts +0 -9
- package/dist/ui/index.d.ts +0 -6
- package/dist/w3m-modal-NV25AXhM.js +0 -1706
package/dist/email-AmK0INbZ.js
DELETED
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
import { cE as S, d1 as g, cM as p, cF as c, df as _, d0 as s, cH as f, cG as C, cU as D, cX as y, d8 as d, cY as m, c_ as $, dv as W, d2 as P } from "./index-D_8VUmn1.js";
|
|
2
|
-
import { c as u, r as E } from "./index-CEqcN8QP.js";
|
|
3
|
-
import { W as b } from "./index-BSKRq56S.js";
|
|
4
|
-
import "./index-UclsHkJ0.js";
|
|
5
|
-
import "./index-X8zir_1j.js";
|
|
6
|
-
import { e as N, n as T } from "./ref-CpgjXAw7.js";
|
|
7
|
-
import "./index-Oz72I9VP.js";
|
|
8
|
-
import "./index-BvPvouSq.js";
|
|
9
|
-
var F = function(a, e, t, r) {
|
|
10
|
-
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
11
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
12
|
-
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
13
|
-
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
14
|
-
};
|
|
15
|
-
let I = class extends b {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments), this.onOtpSubmit = async (e) => {
|
|
18
|
-
var t, r;
|
|
19
|
-
try {
|
|
20
|
-
if (this.authConnector) {
|
|
21
|
-
const n = S.state.activeChain, i = g.getConnections(n), o = (t = p.state.remoteFeatures) == null ? void 0 : t.multiWallet, l = i.length > 0;
|
|
22
|
-
if (await this.authConnector.provider.connectOtp({ otp: e }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_PASS" }), n)
|
|
23
|
-
await g.connectExternal(this.authConnector, n);
|
|
24
|
-
else
|
|
25
|
-
throw new Error("Active chain is not set on ChainController");
|
|
26
|
-
if ((r = p.state.remoteFeatures) != null && r.emailCapture)
|
|
27
|
-
return;
|
|
28
|
-
if (p.state.siwx) {
|
|
29
|
-
_.close();
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (l && o) {
|
|
33
|
-
s.replace("ProfileWallets"), f.showSuccess("New Wallet Added");
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
_.close();
|
|
37
|
-
}
|
|
38
|
-
} catch (n) {
|
|
39
|
-
throw c.sendEvent({
|
|
40
|
-
type: "track",
|
|
41
|
-
event: "EMAIL_VERIFICATION_CODE_FAIL",
|
|
42
|
-
properties: { message: C.parseError(n) }
|
|
43
|
-
}), n;
|
|
44
|
-
}
|
|
45
|
-
}, this.onOtpResend = async (e) => {
|
|
46
|
-
this.authConnector && (await this.authConnector.provider.connectEmail({ email: e }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_SENT" }));
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
I = F([
|
|
51
|
-
u("w3m-email-verify-otp-view")
|
|
52
|
-
], I);
|
|
53
|
-
const U = D`
|
|
54
|
-
wui-icon-box {
|
|
55
|
-
height: ${({ spacing: a }) => a[16]};
|
|
56
|
-
width: ${({ spacing: a }) => a[16]};
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
var R = function(a, e, t, r) {
|
|
60
|
-
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
61
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
62
|
-
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
63
|
-
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
64
|
-
};
|
|
65
|
-
let w = class extends y {
|
|
66
|
-
constructor() {
|
|
67
|
-
var e;
|
|
68
|
-
super(), this.email = (e = s.state.data) == null ? void 0 : e.email, this.authConnector = d.getAuthConnector(), this.loading = !1, this.listenForDeviceApproval();
|
|
69
|
-
}
|
|
70
|
-
render() {
|
|
71
|
-
if (!this.email)
|
|
72
|
-
throw new Error("w3m-email-verify-device-view: No email provided");
|
|
73
|
-
if (!this.authConnector)
|
|
74
|
-
throw new Error("w3m-email-verify-device-view: No auth connector provided");
|
|
75
|
-
return m`
|
|
76
|
-
<wui-flex
|
|
77
|
-
flexDirection="column"
|
|
78
|
-
alignItems="center"
|
|
79
|
-
.padding=${["6", "3", "6", "3"]}
|
|
80
|
-
gap="4"
|
|
81
|
-
>
|
|
82
|
-
<wui-icon-box size="xl" color="accent-primary" icon="sealCheck"></wui-icon-box>
|
|
83
|
-
|
|
84
|
-
<wui-flex flexDirection="column" alignItems="center" gap="3">
|
|
85
|
-
<wui-flex flexDirection="column" alignItems="center">
|
|
86
|
-
<wui-text variant="md-regular" color="primary">
|
|
87
|
-
Approve the login link we sent to
|
|
88
|
-
</wui-text>
|
|
89
|
-
<wui-text variant="md-regular" color="primary"><b>${this.email}</b></wui-text>
|
|
90
|
-
</wui-flex>
|
|
91
|
-
|
|
92
|
-
<wui-text variant="sm-regular" color="secondary" align="center">
|
|
93
|
-
The code expires in 20 minutes
|
|
94
|
-
</wui-text>
|
|
95
|
-
|
|
96
|
-
<wui-flex alignItems="center" id="w3m-resend-section" gap="2">
|
|
97
|
-
<wui-text variant="sm-regular" color="primary" align="center">
|
|
98
|
-
Didn't receive it?
|
|
99
|
-
</wui-text>
|
|
100
|
-
<wui-link @click=${this.onResendCode.bind(this)} .disabled=${this.loading}>
|
|
101
|
-
Resend email
|
|
102
|
-
</wui-link>
|
|
103
|
-
</wui-flex>
|
|
104
|
-
</wui-flex>
|
|
105
|
-
</wui-flex>
|
|
106
|
-
`;
|
|
107
|
-
}
|
|
108
|
-
async listenForDeviceApproval() {
|
|
109
|
-
if (this.authConnector)
|
|
110
|
-
try {
|
|
111
|
-
await this.authConnector.provider.connectDevice(), c.sendEvent({ type: "track", event: "DEVICE_REGISTERED_FOR_EMAIL" }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_SENT" }), s.replace("EmailVerifyOtp", { email: this.email });
|
|
112
|
-
} catch {
|
|
113
|
-
s.goBack();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
async onResendCode() {
|
|
117
|
-
try {
|
|
118
|
-
if (!this.loading) {
|
|
119
|
-
if (!this.authConnector || !this.email)
|
|
120
|
-
throw new Error("w3m-email-login-widget: Unable to resend email");
|
|
121
|
-
this.loading = !0, await this.authConnector.provider.connectEmail({ email: this.email }), this.listenForDeviceApproval(), f.showSuccess("Code email resent");
|
|
122
|
-
}
|
|
123
|
-
} catch (e) {
|
|
124
|
-
f.showError(e);
|
|
125
|
-
} finally {
|
|
126
|
-
this.loading = !1;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
w.styles = U;
|
|
131
|
-
R([
|
|
132
|
-
E()
|
|
133
|
-
], w.prototype, "loading", void 0);
|
|
134
|
-
w = R([
|
|
135
|
-
u("w3m-email-verify-device-view")
|
|
136
|
-
], w);
|
|
137
|
-
const j = $`
|
|
138
|
-
wui-email-input {
|
|
139
|
-
width: 100%;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
form {
|
|
143
|
-
width: 100%;
|
|
144
|
-
display: block;
|
|
145
|
-
position: relative;
|
|
146
|
-
}
|
|
147
|
-
`;
|
|
148
|
-
var O = function(a, e, t, r) {
|
|
149
|
-
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
150
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
151
|
-
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
152
|
-
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
153
|
-
};
|
|
154
|
-
let h = class extends y {
|
|
155
|
-
constructor() {
|
|
156
|
-
var e, t;
|
|
157
|
-
super(...arguments), this.formRef = N(), this.initialEmail = ((e = s.state.data) == null ? void 0 : e.email) ?? "", this.redirectView = (t = s.state.data) == null ? void 0 : t.redirectView, this.email = "", this.loading = !1;
|
|
158
|
-
}
|
|
159
|
-
firstUpdated() {
|
|
160
|
-
var e;
|
|
161
|
-
(e = this.formRef.value) == null || e.addEventListener("keydown", (t) => {
|
|
162
|
-
t.key === "Enter" && this.onSubmitEmail(t);
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
render() {
|
|
166
|
-
return m`
|
|
167
|
-
<wui-flex flexDirection="column" padding="4" gap="4">
|
|
168
|
-
<form ${T(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
|
|
169
|
-
<wui-email-input
|
|
170
|
-
value=${this.initialEmail}
|
|
171
|
-
.disabled=${this.loading}
|
|
172
|
-
@inputChange=${this.onEmailInputChange.bind(this)}
|
|
173
|
-
>
|
|
174
|
-
</wui-email-input>
|
|
175
|
-
<input type="submit" hidden />
|
|
176
|
-
</form>
|
|
177
|
-
${this.buttonsTemplate()}
|
|
178
|
-
</wui-flex>
|
|
179
|
-
`;
|
|
180
|
-
}
|
|
181
|
-
onEmailInputChange(e) {
|
|
182
|
-
this.email = e.detail;
|
|
183
|
-
}
|
|
184
|
-
async onSubmitEmail(e) {
|
|
185
|
-
try {
|
|
186
|
-
if (this.loading)
|
|
187
|
-
return;
|
|
188
|
-
this.loading = !0, e.preventDefault();
|
|
189
|
-
const t = d.getAuthConnector();
|
|
190
|
-
if (!t)
|
|
191
|
-
throw new Error("w3m-update-email-wallet: Auth connector not found");
|
|
192
|
-
const r = await t.provider.updateEmail({ email: this.email });
|
|
193
|
-
c.sendEvent({ type: "track", event: "EMAIL_EDIT" }), r.action === "VERIFY_SECONDARY_OTP" ? s.push("UpdateEmailSecondaryOtp", {
|
|
194
|
-
email: this.initialEmail,
|
|
195
|
-
newEmail: this.email,
|
|
196
|
-
redirectView: this.redirectView
|
|
197
|
-
}) : s.push("UpdateEmailPrimaryOtp", {
|
|
198
|
-
email: this.initialEmail,
|
|
199
|
-
newEmail: this.email,
|
|
200
|
-
redirectView: this.redirectView
|
|
201
|
-
});
|
|
202
|
-
} catch (t) {
|
|
203
|
-
f.showError(t), this.loading = !1;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
buttonsTemplate() {
|
|
207
|
-
const e = !this.loading && this.email.length > 3 && this.email !== this.initialEmail;
|
|
208
|
-
return this.redirectView ? m`
|
|
209
|
-
<wui-flex gap="3">
|
|
210
|
-
<wui-button size="md" variant="neutral" fullWidth @click=${s.goBack}>
|
|
211
|
-
Cancel
|
|
212
|
-
</wui-button>
|
|
213
|
-
|
|
214
|
-
<wui-button
|
|
215
|
-
size="md"
|
|
216
|
-
variant="accent-primary"
|
|
217
|
-
fullWidth
|
|
218
|
-
@click=${this.onSubmitEmail.bind(this)}
|
|
219
|
-
.disabled=${!e}
|
|
220
|
-
.loading=${this.loading}
|
|
221
|
-
>
|
|
222
|
-
Save
|
|
223
|
-
</wui-button>
|
|
224
|
-
</wui-flex>
|
|
225
|
-
` : m`
|
|
226
|
-
<wui-button
|
|
227
|
-
size="md"
|
|
228
|
-
variant="accent-primary"
|
|
229
|
-
fullWidth
|
|
230
|
-
@click=${this.onSubmitEmail.bind(this)}
|
|
231
|
-
.disabled=${!e}
|
|
232
|
-
.loading=${this.loading}
|
|
233
|
-
>
|
|
234
|
-
Save
|
|
235
|
-
</wui-button>
|
|
236
|
-
`;
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
h.styles = j;
|
|
240
|
-
O([
|
|
241
|
-
E()
|
|
242
|
-
], h.prototype, "email", void 0);
|
|
243
|
-
O([
|
|
244
|
-
E()
|
|
245
|
-
], h.prototype, "loading", void 0);
|
|
246
|
-
h = O([
|
|
247
|
-
u("w3m-update-email-wallet-view")
|
|
248
|
-
], h);
|
|
249
|
-
var L = function(a, e, t, r) {
|
|
250
|
-
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
251
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
252
|
-
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
253
|
-
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
254
|
-
};
|
|
255
|
-
let A = class extends b {
|
|
256
|
-
constructor() {
|
|
257
|
-
var e;
|
|
258
|
-
super(), this.email = (e = s.state.data) == null ? void 0 : e.email, this.onOtpSubmit = async (t) => {
|
|
259
|
-
try {
|
|
260
|
-
this.authConnector && (await this.authConnector.provider.updateEmailPrimaryOtp({ otp: t }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_PASS" }), s.replace("UpdateEmailSecondaryOtp", s.state.data));
|
|
261
|
-
} catch (r) {
|
|
262
|
-
throw c.sendEvent({
|
|
263
|
-
type: "track",
|
|
264
|
-
event: "EMAIL_VERIFICATION_CODE_FAIL",
|
|
265
|
-
properties: { message: C.parseError(r) }
|
|
266
|
-
}), r;
|
|
267
|
-
}
|
|
268
|
-
}, this.onStartOver = () => {
|
|
269
|
-
s.replace("UpdateEmailWallet", s.state.data);
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
A = L([
|
|
274
|
-
u("w3m-update-email-primary-otp-view")
|
|
275
|
-
], A);
|
|
276
|
-
var M = function(a, e, t, r) {
|
|
277
|
-
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
278
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
279
|
-
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
280
|
-
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
281
|
-
};
|
|
282
|
-
let x = class extends b {
|
|
283
|
-
constructor() {
|
|
284
|
-
var e, t;
|
|
285
|
-
super(), this.email = (e = s.state.data) == null ? void 0 : e.newEmail, this.redirectView = (t = s.state.data) == null ? void 0 : t.redirectView, this.onOtpSubmit = async (r) => {
|
|
286
|
-
try {
|
|
287
|
-
this.authConnector && (await this.authConnector.provider.updateEmailSecondaryOtp({ otp: r }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_PASS" }), this.redirectView && s.reset(this.redirectView));
|
|
288
|
-
} catch (n) {
|
|
289
|
-
throw c.sendEvent({
|
|
290
|
-
type: "track",
|
|
291
|
-
event: "EMAIL_VERIFICATION_CODE_FAIL",
|
|
292
|
-
properties: { message: C.parseError(n) }
|
|
293
|
-
}), n;
|
|
294
|
-
}
|
|
295
|
-
}, this.onStartOver = () => {
|
|
296
|
-
s.replace("UpdateEmailWallet", s.state.data);
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
x = M([
|
|
301
|
-
u("w3m-update-email-secondary-otp-view")
|
|
302
|
-
], x);
|
|
303
|
-
var V = function(a, e, t, r) {
|
|
304
|
-
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
305
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
306
|
-
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
307
|
-
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
308
|
-
};
|
|
309
|
-
let v = class extends y {
|
|
310
|
-
constructor() {
|
|
311
|
-
var e;
|
|
312
|
-
super(), this.authConnector = d.getAuthConnector(), this.isEmailEnabled = (e = p.state.remoteFeatures) == null ? void 0 : e.email, this.isAuthEnabled = this.checkIfAuthEnabled(d.state.connectors), this.connectors = d.state.connectors, d.subscribeKey("connectors", (t) => {
|
|
313
|
-
this.connectors = t, this.isAuthEnabled = this.checkIfAuthEnabled(this.connectors);
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
render() {
|
|
317
|
-
if (!this.isEmailEnabled)
|
|
318
|
-
throw new Error("w3m-email-login-view: Email is not enabled");
|
|
319
|
-
if (!this.isAuthEnabled)
|
|
320
|
-
throw new Error("w3m-email-login-view: No auth connector provided");
|
|
321
|
-
return m`<wui-flex flexDirection="column" .padding=${["1", "3", "3", "3"]} gap="4">
|
|
322
|
-
<w3m-email-login-widget></w3m-email-login-widget>
|
|
323
|
-
</wui-flex> `;
|
|
324
|
-
}
|
|
325
|
-
checkIfAuthEnabled(e) {
|
|
326
|
-
const t = e.filter((n) => n.type === W.CONNECTOR_TYPE_AUTH).map((n) => n.chain);
|
|
327
|
-
return P.AUTH_CONNECTOR_SUPPORTED_CHAINS.some((n) => t.includes(n));
|
|
328
|
-
}
|
|
329
|
-
};
|
|
330
|
-
V([
|
|
331
|
-
E()
|
|
332
|
-
], v.prototype, "connectors", void 0);
|
|
333
|
-
v = V([
|
|
334
|
-
u("w3m-email-login-view")
|
|
335
|
-
], v);
|
|
336
|
-
export {
|
|
337
|
-
v as W3mEmailLoginView,
|
|
338
|
-
b as W3mEmailOtpWidget,
|
|
339
|
-
w as W3mEmailVerifyDeviceView,
|
|
340
|
-
I as W3mEmailVerifyOtpView,
|
|
341
|
-
A as W3mUpdateEmailPrimaryOtpView,
|
|
342
|
-
x as W3mUpdateEmailSecondaryOtpView,
|
|
343
|
-
h as W3mUpdateEmailWalletView
|
|
344
|
-
};
|