@lnfi-network/nodeflow-sdk 1.0.0-alpha.0 → 1.0.0-alpha.2
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/build-info.json +1 -1
- package/dist/nodeflow-sdk.es.js +12608 -13
- package/package.json +10 -8
- package/dist/SwapController-C-2g6oSP.js +0 -447
- package/dist/add-DDBnz1-Q.js +0 -19
- package/dist/all-wallets-XTwjZKGg.js +0 -10
- package/dist/app-store-sCzhkWOo.js +0 -21
- package/dist/apple-C4IG4u61.js +0 -22
- package/dist/arrow-bottom-D5KjiSxX.js +0 -12
- package/dist/arrow-bottom-circle-BwWTHJky.js +0 -15
- package/dist/arrow-left-hn1Ftfvb.js +0 -12
- package/dist/arrow-right-CkV03q5Q.js +0 -12
- package/dist/arrow-top-BFm9X5g1.js +0 -12
- package/dist/bank-BUCrVHdo.js +0 -18
- package/dist/bin-BKleaahE.js +0 -8
- package/dist/bitcoin-C7iWQVuy.js +0 -17
- package/dist/browser-CpOtTIku.js +0 -18
- package/dist/card-CJ3tg2Ri.js +0 -18
- package/dist/ccip-DyUNuvL1.js +0 -239
- package/dist/checkmark-CvSC6zeV.js +0 -15
- package/dist/checkmark-bold-DyZJqlJ7.js +0 -12
- package/dist/chevron-bottom-T9v1OvPA.js +0 -12
- package/dist/chevron-left-B4I8A8BR.js +0 -12
- package/dist/chevron-right-DGcVStvL.js +0 -12
- package/dist/chevron-top-BtD7BPVB.js +0 -12
- package/dist/chrome-store-BTKxY14m.js +0 -65
- package/dist/circle-DLLZtCBf.js +0 -8
- package/dist/clock-BNIDUPYZ.js +0 -12
- package/dist/close-BscNWH3j.js +0 -12
- package/dist/coinPlaceholder-JCYCAADZ.js +0 -12
- package/dist/compass-D7B-kHmZ.js +0 -12
- package/dist/copy-DHBc9gJO.js +0 -19
- package/dist/cursor-DKduK293.js +0 -7
- package/dist/cursor-transparent-8DkjrHTm.js +0 -16
- package/dist/desktop-ChlWl7Ma.js +0 -13
- package/dist/disconnect-CML_GEin.js +0 -12
- package/dist/discord-CgAM6i7H.js +0 -21
- package/dist/email-8mepCwp-.js +0 -10
- package/dist/embedded-wallet-scU49N5X.js +0 -464
- package/dist/ethereum-CA-_7cWX.js +0 -14
- package/dist/etherscan-B4h2i8Uc.js +0 -10
- package/dist/exclamation-triangle-ftOWMqSf.js +0 -8
- package/dist/extension-7iqlSonF.js +0 -12
- package/dist/external-link-DAvuMfW6.js +0 -12
- package/dist/facebook-CsyBIxMB.js +0 -30
- package/dist/farcaster-DfetCk1r.js +0 -16
- package/dist/filters-CsU-LYSd.js +0 -12
- package/dist/github-DjxwfOOF.js +0 -22
- package/dist/google--g4VSi6h.js +0 -22
- package/dist/help-circle-BPA985E7.js +0 -16
- package/dist/id-BCUBMri8.js +0 -16
- package/dist/image-gYCDO7su.js +0 -8
- package/dist/index-B9q3HG5u.js +0 -709
- package/dist/index-BEm1bPeX.js +0 -63547
- package/dist/index-CCgAY-U4.js +0 -70
- package/dist/index-CRbuhHbe.js +0 -33
- package/dist/index-DYL5OPkx.js +0 -1060
- package/dist/info-CIaFQJ_e.js +0 -7
- package/dist/info-circle-BPz5hFQa.js +0 -16
- package/dist/lightbulb-BDmHvdbq.js +0 -7
- package/dist/mail-DQiXQ-4_.js +0 -12
- package/dist/mobile-CG_8sNWZ.js +0 -13
- package/dist/more-B1H_I3-I.js +0 -15
- package/dist/network-placeholder-1RWeD7Yp.js +0 -18
- package/dist/nftPlaceholder-Cg-f-eaw.js +0 -12
- package/dist/off-DB-2L-AT.js +0 -8
- package/dist/onramp-DI5eQmAC.js +0 -917
- package/dist/play-store-DKJRWbqp.js +0 -36
- package/dist/plus-By1Ef8nV.js +0 -17
- package/dist/qr-code-DGuZgP-9.js +0 -10
- package/dist/receive-BEsZr88v.js +0 -179
- package/dist/recycle-horizontal-DubwRDbc.js +0 -13
- package/dist/refresh-Dwfvwy6t.js +0 -12
- package/dist/reown-logo-oDEjOrqY.js +0 -16
- package/dist/search-DX_QdW9h.js +0 -12
- package/dist/send-Bd5bwLNJ.js +0 -1039
- package/dist/send-Dq4B7ftm.js +0 -19
- package/dist/socials-BnnwB5_t.js +0 -589
- package/dist/solana-B7Ds9KBT.js +0 -17
- package/dist/swapHorizontal-CF6_7qU-.js +0 -12
- package/dist/swapHorizontalBold-C-YFgVbc.js +0 -12
- package/dist/swapHorizontalMedium-BGOdc8_e.js +0 -20
- package/dist/swapHorizontalRoundedBold-D_vYgwwO.js +0 -12
- package/dist/swapVertical-j2pWqia1.js +0 -12
- package/dist/swaps-Bh2kuHjL.js +0 -1713
- package/dist/telegram-bh_htnzP.js +0 -20
- package/dist/three-dots-B31D_Ocu.js +0 -9
- package/dist/transactions-Ch56TR3p.js +0 -35
- package/dist/twitch-DUloatpE.js +0 -22
- package/dist/twitterIcon-CNo6b91J.js +0 -10
- package/dist/ui-C7PJmqHY.js +0 -812
- package/dist/user-DqFnAlKR.js +0 -7
- package/dist/verify-BmaaygAV.js +0 -12
- package/dist/verify-filled-BwLeEdJj.js +0 -12
- package/dist/w3m-modal-BijXCMl6.js +0 -1041
- package/dist/wallet-DyP6_6JN.js +0 -12
- package/dist/wallet-placeholder-BZC82rR0.js +0 -18
- package/dist/walletconnect-DT69luRK.js +0 -36
- package/dist/warning-circle-CGbg6QZn.js +0 -16
- package/dist/x-BfEtqtAc.js +0 -16
- package/dist/x-mark-CSmIdhvb.js +0 -7
package/dist/ui-C7PJmqHY.js
DELETED
|
@@ -1,812 +0,0 @@
|
|
|
1
|
-
import { V as g, aI as j, aJ as b, aK as K, P as R, aL as m, X as U, _ as L, aM as M, aN as x, E as z, J as N, K as c, H as T, I as $, R as f, aA as w, S as v, a7 as V, aa as u } from "./index-BEm1bPeX.js";
|
|
2
|
-
import { f as O } from "./index-B9q3HG5u.js";
|
|
3
|
-
class X {
|
|
4
|
-
constructor(e) {
|
|
5
|
-
this.expiration = e.expiration, this.getNonce = e.getNonce, this.getRequestId = e.getRequestId, this.domain = e.domain, this.uri = e.uri, this.statement = e.statement, this.resources = e.resources;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* This is the default method to create a SIWXMessage object.
|
|
9
|
-
* It will call the `getNonce`, `getRequestId`, `getExpirationTime`, `getIssuedAt`, and `getNotBefore` methods.
|
|
10
|
-
* It appends the `stringify` method to the object as `toString`.
|
|
11
|
-
*
|
|
12
|
-
* @param input SIWXMessage.Input
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
async createMessage(e) {
|
|
16
|
-
var s;
|
|
17
|
-
const t = {
|
|
18
|
-
accountAddress: e.accountAddress,
|
|
19
|
-
chainId: e.chainId,
|
|
20
|
-
version: this.version,
|
|
21
|
-
domain: this.domain,
|
|
22
|
-
uri: this.uri,
|
|
23
|
-
statement: this.statement,
|
|
24
|
-
resources: this.resources,
|
|
25
|
-
nonce: await this.getNonce(e),
|
|
26
|
-
requestId: await ((s = this.getRequestId) == null ? void 0 : s.call(this)),
|
|
27
|
-
expirationTime: this.getExpirationTime(e),
|
|
28
|
-
issuedAt: this.getIssuedAt(),
|
|
29
|
-
notBefore: this.getNotBefore(e)
|
|
30
|
-
};
|
|
31
|
-
return Object.assign(t, {
|
|
32
|
-
toString: () => this.stringify(t)
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* This method generates the expiration time based on the `notBefore` value and the `expiration` value.
|
|
37
|
-
* You may override this method to provide a custom expiration time.
|
|
38
|
-
*
|
|
39
|
-
* @param Pick<SIWXMessage.Input, 'notBefore'>
|
|
40
|
-
* @returns string | undefined - The expiration time in `stringifyDate` format or undefined if not available
|
|
41
|
-
*/
|
|
42
|
-
getExpirationTime({ notBefore: e }) {
|
|
43
|
-
if (typeof this.expiration > "u")
|
|
44
|
-
return;
|
|
45
|
-
const t = e ? new Date(e).getTime() : Date.now();
|
|
46
|
-
return this.stringifyDate(new Date(t + this.expiration));
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* This method generates the `notBefore` formatted value based on the `notBefore` input.
|
|
50
|
-
* You may override this method to provide a custom `notBefore` value.
|
|
51
|
-
*
|
|
52
|
-
* @param Pick<SIWXMessage.Input, 'notBefore'>
|
|
53
|
-
* @returns string | undefined - The `notBefore` value in `stringifyDate` format or undefined if not available
|
|
54
|
-
*/
|
|
55
|
-
getNotBefore({ notBefore: e }) {
|
|
56
|
-
return e ? this.stringifyDate(new Date(e)) : void 0;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* This method generates the `issuedAt` formatted value based on the current date.
|
|
60
|
-
* You may override this method to provide a custom `issuedAt` value.
|
|
61
|
-
*
|
|
62
|
-
* @returns string - The `issuedAt` value in `stringifyDate` format
|
|
63
|
-
*/
|
|
64
|
-
getIssuedAt() {
|
|
65
|
-
return this.stringifyDate(/* @__PURE__ */ new Date());
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* This method converts a date object to a formatted string.
|
|
69
|
-
* You may override this method to provide a custom date format.
|
|
70
|
-
*
|
|
71
|
-
* @param date Date
|
|
72
|
-
* @returns string - The date in ISO format
|
|
73
|
-
*/
|
|
74
|
-
stringifyDate(e) {
|
|
75
|
-
return e.toISOString();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
class B extends X {
|
|
79
|
-
constructor({ clearChainIdNamespace: e, ...t }) {
|
|
80
|
-
super(t), this.version = "1", this.clearChainIdNamespace = e || !1;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Get the blockchain name for a given chain ID
|
|
84
|
-
* @param chainId The chain ID to get the blockchain name for
|
|
85
|
-
* @returns The blockchain name
|
|
86
|
-
*/
|
|
87
|
-
getNetworkName(e) {
|
|
88
|
-
const t = g.getAllRequestedCaipNetworks();
|
|
89
|
-
return j.getNetworkNameByCaipNetworkId(t, e);
|
|
90
|
-
}
|
|
91
|
-
stringify(e) {
|
|
92
|
-
var s;
|
|
93
|
-
const t = this.clearChainIdNamespace ? e.chainId.split(":")[1] : e.chainId, i = this.getNetworkName(e.chainId);
|
|
94
|
-
return [
|
|
95
|
-
`${e.domain} wants you to sign in with your ${i} account:`,
|
|
96
|
-
e.accountAddress,
|
|
97
|
-
e.statement ? `
|
|
98
|
-
${e.statement}
|
|
99
|
-
` : "",
|
|
100
|
-
`URI: ${e.uri}`,
|
|
101
|
-
`Version: ${e.version}`,
|
|
102
|
-
`Chain ID: ${t}`,
|
|
103
|
-
`Nonce: ${e.nonce}`,
|
|
104
|
-
e.issuedAt && `Issued At: ${e.issuedAt}`,
|
|
105
|
-
e.expirationTime && `Expiration Time: ${e.expirationTime}`,
|
|
106
|
-
e.notBefore && `Not Before: ${e.notBefore}`,
|
|
107
|
-
e.requestId && `Request ID: ${e.requestId}`,
|
|
108
|
-
((s = e.resources) == null ? void 0 : s.length) && e.resources.reduce((n, a) => `${n}
|
|
109
|
-
- ${a}`, "Resources:")
|
|
110
|
-
].filter((n) => typeof n == "string").join(`
|
|
111
|
-
`).trim();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
class _ {
|
|
115
|
-
constructor(e = {}) {
|
|
116
|
-
this.otpUuid = null, this.listeners = {
|
|
117
|
-
sessionChanged: []
|
|
118
|
-
}, this.localAuthStorageKey = e.localAuthStorageKey || b.SIWX_AUTH_TOKEN, this.localNonceStorageKey = e.localNonceStorageKey || b.SIWX_NONCE_TOKEN, this.required = e.required ?? !0, this.messenger = new B({
|
|
119
|
-
domain: typeof document > "u" ? "Unknown Domain" : document.location.host,
|
|
120
|
-
uri: typeof document > "u" ? "Unknown URI" : document.location.href,
|
|
121
|
-
getNonce: this.getNonce.bind(this),
|
|
122
|
-
clearChainIdNamespace: !1
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
async createMessage(e) {
|
|
126
|
-
return this.messenger.createMessage(e);
|
|
127
|
-
}
|
|
128
|
-
async addSession(e) {
|
|
129
|
-
const t = await this.request({
|
|
130
|
-
method: "POST",
|
|
131
|
-
key: "authenticate",
|
|
132
|
-
body: {
|
|
133
|
-
data: e.data,
|
|
134
|
-
message: e.message,
|
|
135
|
-
signature: e.signature,
|
|
136
|
-
clientId: this.getClientId(),
|
|
137
|
-
walletInfo: this.getWalletInfo()
|
|
138
|
-
},
|
|
139
|
-
headers: ["nonce", "otp"]
|
|
140
|
-
});
|
|
141
|
-
this.setStorageToken(t.token, this.localAuthStorageKey), this.emit("sessionChanged", e), this.setAppKitAccountUser(H(t.token)), this.otpUuid = null;
|
|
142
|
-
}
|
|
143
|
-
async getSessions(e, t) {
|
|
144
|
-
try {
|
|
145
|
-
if (!this.getStorageToken(this.localAuthStorageKey))
|
|
146
|
-
return [];
|
|
147
|
-
const i = await this.request({
|
|
148
|
-
method: "GET",
|
|
149
|
-
key: "me",
|
|
150
|
-
query: {},
|
|
151
|
-
headers: ["auth"]
|
|
152
|
-
});
|
|
153
|
-
if (!i)
|
|
154
|
-
return [];
|
|
155
|
-
const s = i.address.toLowerCase() === t.toLowerCase(), n = i.caip2Network === e;
|
|
156
|
-
if (!s || !n)
|
|
157
|
-
return [];
|
|
158
|
-
const a = {
|
|
159
|
-
data: {
|
|
160
|
-
accountAddress: i.address,
|
|
161
|
-
chainId: i.caip2Network
|
|
162
|
-
},
|
|
163
|
-
message: "",
|
|
164
|
-
signature: ""
|
|
165
|
-
};
|
|
166
|
-
return this.emit("sessionChanged", a), this.setAppKitAccountUser(i), [a];
|
|
167
|
-
} catch {
|
|
168
|
-
return [];
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
async revokeSession(e, t) {
|
|
172
|
-
return Promise.resolve(this.clearStorageTokens());
|
|
173
|
-
}
|
|
174
|
-
async setSessions(e) {
|
|
175
|
-
if (e.length === 0)
|
|
176
|
-
this.clearStorageTokens();
|
|
177
|
-
else {
|
|
178
|
-
const t = e.find((i) => {
|
|
179
|
-
var s;
|
|
180
|
-
return i.data.chainId === ((s = K()) == null ? void 0 : s.caipNetworkId);
|
|
181
|
-
}) || e[0];
|
|
182
|
-
await this.addSession(t);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
getRequired() {
|
|
186
|
-
return this.required;
|
|
187
|
-
}
|
|
188
|
-
async getSessionAccount() {
|
|
189
|
-
if (!this.getStorageToken(this.localAuthStorageKey))
|
|
190
|
-
throw new Error("Not authenticated");
|
|
191
|
-
return this.request({
|
|
192
|
-
method: "GET",
|
|
193
|
-
key: "me",
|
|
194
|
-
body: void 0,
|
|
195
|
-
query: {
|
|
196
|
-
includeAppKitAccount: !0
|
|
197
|
-
},
|
|
198
|
-
headers: ["auth"]
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
async setSessionAccountMetadata(e = null) {
|
|
202
|
-
if (!this.getStorageToken(this.localAuthStorageKey))
|
|
203
|
-
throw new Error("Not authenticated");
|
|
204
|
-
return this.request({
|
|
205
|
-
method: "PUT",
|
|
206
|
-
key: "account-metadata",
|
|
207
|
-
body: { metadata: e },
|
|
208
|
-
headers: ["auth"]
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
on(e, t) {
|
|
212
|
-
return this.listeners[e].push(t), () => {
|
|
213
|
-
this.listeners[e] = this.listeners[e].filter((i) => i !== t);
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
removeAllListeners() {
|
|
217
|
-
Object.keys(this.listeners).forEach((t) => {
|
|
218
|
-
this.listeners[t] = [];
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
async requestEmailOtp({ email: e, account: t }) {
|
|
222
|
-
const i = await this.request({
|
|
223
|
-
method: "POST",
|
|
224
|
-
key: "otp",
|
|
225
|
-
body: { email: e, account: t }
|
|
226
|
-
});
|
|
227
|
-
return this.otpUuid = i.uuid, this.messenger.resources = [`email:${e}`], i;
|
|
228
|
-
}
|
|
229
|
-
confirmEmailOtp({ code: e }) {
|
|
230
|
-
return this.request({
|
|
231
|
-
method: "PUT",
|
|
232
|
-
key: "otp",
|
|
233
|
-
body: { code: e },
|
|
234
|
-
headers: ["otp"]
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
async request({ method: e, key: t, query: i, body: s, headers: n }) {
|
|
238
|
-
var k;
|
|
239
|
-
const { projectId: a, st: o, sv: P } = this.getSDKProperties(), p = new URL(`${R.W3M_API_URL}/auth/v1/${String(t)}`);
|
|
240
|
-
p.searchParams.set("projectId", a), p.searchParams.set("st", o), p.searchParams.set("sv", P), i && Object.entries(i).forEach(([h, C]) => p.searchParams.set(h, String(C)));
|
|
241
|
-
const y = await fetch(p, {
|
|
242
|
-
method: e,
|
|
243
|
-
body: s ? JSON.stringify(s) : void 0,
|
|
244
|
-
headers: Array.isArray(n) ? n.reduce((h, C) => {
|
|
245
|
-
switch (C) {
|
|
246
|
-
case "nonce":
|
|
247
|
-
h["x-nonce-jwt"] = `Bearer ${this.getStorageToken(this.localNonceStorageKey)}`;
|
|
248
|
-
break;
|
|
249
|
-
case "auth":
|
|
250
|
-
h.Authorization = `Bearer ${this.getStorageToken(this.localAuthStorageKey)}`;
|
|
251
|
-
break;
|
|
252
|
-
case "otp":
|
|
253
|
-
this.otpUuid && (h["x-otp"] = this.otpUuid);
|
|
254
|
-
break;
|
|
255
|
-
}
|
|
256
|
-
return h;
|
|
257
|
-
}, {}) : void 0
|
|
258
|
-
});
|
|
259
|
-
if (!y.ok)
|
|
260
|
-
throw new Error(await y.text());
|
|
261
|
-
return (k = y.headers.get("content-type")) != null && k.includes("application/json") ? y.json() : null;
|
|
262
|
-
}
|
|
263
|
-
getStorageToken(e) {
|
|
264
|
-
return m.getItem(e);
|
|
265
|
-
}
|
|
266
|
-
setStorageToken(e, t) {
|
|
267
|
-
m.setItem(t, e);
|
|
268
|
-
}
|
|
269
|
-
clearStorageTokens() {
|
|
270
|
-
this.otpUuid = null, m.removeItem(this.localAuthStorageKey), m.removeItem(this.localNonceStorageKey), this.emit("sessionChanged", void 0);
|
|
271
|
-
}
|
|
272
|
-
async getNonce() {
|
|
273
|
-
const { nonce: e, token: t } = await this.request({
|
|
274
|
-
method: "GET",
|
|
275
|
-
key: "nonce"
|
|
276
|
-
});
|
|
277
|
-
return this.setStorageToken(t, this.localNonceStorageKey), e;
|
|
278
|
-
}
|
|
279
|
-
getClientId() {
|
|
280
|
-
return U.state.clientId;
|
|
281
|
-
}
|
|
282
|
-
getWalletInfo() {
|
|
283
|
-
const { connectedWalletInfo: e } = L.state;
|
|
284
|
-
if (!e)
|
|
285
|
-
return;
|
|
286
|
-
if ("social" in e) {
|
|
287
|
-
const n = e.social, a = e.identifier;
|
|
288
|
-
return { type: "social", social: n, identifier: a };
|
|
289
|
-
}
|
|
290
|
-
const { name: t, icon: i } = e;
|
|
291
|
-
let s = "unknown";
|
|
292
|
-
switch (e.type) {
|
|
293
|
-
case x.CONNECTOR_TYPE_EXTERNAL:
|
|
294
|
-
case x.CONNECTOR_TYPE_INJECTED:
|
|
295
|
-
case x.CONNECTOR_TYPE_ANNOUNCED:
|
|
296
|
-
s = "extension";
|
|
297
|
-
break;
|
|
298
|
-
case x.CONNECTOR_TYPE_WALLET_CONNECT:
|
|
299
|
-
s = "walletconnect";
|
|
300
|
-
break;
|
|
301
|
-
default:
|
|
302
|
-
s = "unknown";
|
|
303
|
-
}
|
|
304
|
-
return {
|
|
305
|
-
type: s,
|
|
306
|
-
name: t,
|
|
307
|
-
icon: i
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
getSDKProperties() {
|
|
311
|
-
return M._getSdkProperties();
|
|
312
|
-
}
|
|
313
|
-
emit(e, t) {
|
|
314
|
-
this.listeners[e].forEach((i) => i(t));
|
|
315
|
-
}
|
|
316
|
-
setAppKitAccountUser(e) {
|
|
317
|
-
const { email: t } = e;
|
|
318
|
-
t && Object.values(R.CHAIN).forEach((i) => {
|
|
319
|
-
g.setAccountProp("user", { email: t }, i);
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function H(r) {
|
|
324
|
-
const e = r.split(".");
|
|
325
|
-
if (e.length !== 3)
|
|
326
|
-
throw new Error("Invalid token");
|
|
327
|
-
const t = e[1];
|
|
328
|
-
if (typeof t != "string")
|
|
329
|
-
throw new Error("Invalid token");
|
|
330
|
-
const i = t.replace(/-/gu, "+").replace(/_/gu, "/"), s = i.padEnd(i.length + (4 - i.length % 4) % 4, "=");
|
|
331
|
-
return JSON.parse(atob(s));
|
|
332
|
-
}
|
|
333
|
-
const A = z`
|
|
334
|
-
.hero {
|
|
335
|
-
display: flex;
|
|
336
|
-
flex-direction: column;
|
|
337
|
-
align-items: center;
|
|
338
|
-
justify-content: center;
|
|
339
|
-
gap: var(--wui-spacing-3xs);
|
|
340
|
-
|
|
341
|
-
transition-property: margin, height;
|
|
342
|
-
transition-duration: var(--wui-duration-md);
|
|
343
|
-
transition-timing-function: var(--wui-ease-out-power-1);
|
|
344
|
-
margin-top: -100px;
|
|
345
|
-
|
|
346
|
-
&[data-state='loading'] {
|
|
347
|
-
margin-top: 0px;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
position: relative;
|
|
351
|
-
&:after {
|
|
352
|
-
content: '';
|
|
353
|
-
position: absolute;
|
|
354
|
-
bottom: 0;
|
|
355
|
-
height: 252px;
|
|
356
|
-
width: 360px;
|
|
357
|
-
background: radial-gradient(
|
|
358
|
-
96.11% 53.95% at 50% 51.28%,
|
|
359
|
-
transparent 0%,
|
|
360
|
-
color-mix(in srgb, var(--wui-color-bg-100) 5%, transparent) 49%,
|
|
361
|
-
color-mix(in srgb, var(--wui-color-bg-100) 65%, transparent) 99.43%
|
|
362
|
-
);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.hero-main-icon {
|
|
367
|
-
width: 176px;
|
|
368
|
-
transition-property: background-color;
|
|
369
|
-
transition-duration: var(--wui-duration-lg);
|
|
370
|
-
transition-timing-function: var(--wui-ease-out-power-1);
|
|
371
|
-
|
|
372
|
-
&[data-state='loading'] {
|
|
373
|
-
width: 56px;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
.hero-row {
|
|
378
|
-
display: flex;
|
|
379
|
-
flex-direction: row;
|
|
380
|
-
align-items: center;
|
|
381
|
-
justify-content: center;
|
|
382
|
-
gap: var(--wui-spacing-3xs);
|
|
383
|
-
flex-wrap: nowrap;
|
|
384
|
-
min-width: fit-content;
|
|
385
|
-
|
|
386
|
-
&:nth-child(1) {
|
|
387
|
-
transform: translateX(-30px);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
&:nth-child(2) {
|
|
391
|
-
transform: translateX(30px);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
&:nth-child(4) {
|
|
395
|
-
transform: translateX(40px);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
transition-property: height;
|
|
399
|
-
transition-duration: var(--wui-duration-md);
|
|
400
|
-
transition-timing-function: var(--wui-ease-out-power-1);
|
|
401
|
-
height: 68px;
|
|
402
|
-
|
|
403
|
-
&[data-state='loading'] {
|
|
404
|
-
height: 0px;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.hero-row-icon {
|
|
409
|
-
opacity: 0.1;
|
|
410
|
-
transition-property: opacity;
|
|
411
|
-
transition-duration: var(--wui-duration-md);
|
|
412
|
-
transition-timing-function: var(--wui-ease-out-power-1);
|
|
413
|
-
|
|
414
|
-
&[data-state='loading'] {
|
|
415
|
-
opacity: 0;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.email-sufixes {
|
|
420
|
-
display: flex;
|
|
421
|
-
flex-direction: row;
|
|
422
|
-
gap: var(--wui-spacing-3xs);
|
|
423
|
-
overflow-x: auto;
|
|
424
|
-
max-width: 100%;
|
|
425
|
-
margin-top: var(--wui-spacing-s);
|
|
426
|
-
margin-bottom: calc(-1 * var(--wui-spacing-m));
|
|
427
|
-
padding-bottom: var(--wui-spacing-m);
|
|
428
|
-
margin-left: calc(-1 * var(--wui-spacing-m));
|
|
429
|
-
margin-right: calc(-1 * var(--wui-spacing-m));
|
|
430
|
-
padding-left: var(--wui-spacing-m);
|
|
431
|
-
padding-right: var(--wui-spacing-m);
|
|
432
|
-
|
|
433
|
-
&::-webkit-scrollbar {
|
|
434
|
-
display: none;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.recent-emails {
|
|
439
|
-
display: flex;
|
|
440
|
-
flex-direction: column;
|
|
441
|
-
padding: var(--wui-spacing-s) 0;
|
|
442
|
-
border-top: 1px solid var(--wui-color-gray-glass-005);
|
|
443
|
-
border-bottom: 1px solid var(--wui-color-gray-glass-005);
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
.recent-emails-heading {
|
|
447
|
-
margin-bottom: var(--wui-spacing-s);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
.recent-emails-list-item {
|
|
451
|
-
--wui-color-gray-glass-002: transparent;
|
|
452
|
-
}
|
|
453
|
-
`;
|
|
454
|
-
var q = function(r, e, t, i) {
|
|
455
|
-
var s = arguments.length, n = s < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, a;
|
|
456
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(r, e, t, i);
|
|
457
|
-
else for (var o = r.length - 1; o >= 0; o--) (a = r[o]) && (n = (s < 3 ? a(n) : s > 3 ? a(e, t, n) : a(e, t)) || n);
|
|
458
|
-
return s > 3 && n && Object.defineProperty(e, t, n), n;
|
|
459
|
-
};
|
|
460
|
-
const J = [
|
|
461
|
-
"@gmail.com",
|
|
462
|
-
"@outlook.com",
|
|
463
|
-
"@yahoo.com",
|
|
464
|
-
"@hotmail.com",
|
|
465
|
-
"@aol.com",
|
|
466
|
-
"@icloud.com",
|
|
467
|
-
"@zoho.com"
|
|
468
|
-
];
|
|
469
|
-
let E = class extends N {
|
|
470
|
-
constructor() {
|
|
471
|
-
super(...arguments), this.email = "";
|
|
472
|
-
}
|
|
473
|
-
render() {
|
|
474
|
-
const e = J.filter(this.filter.bind(this)).map(this.item.bind(this));
|
|
475
|
-
return e.length === 0 ? null : c`<div class="email-sufixes">${e}</div>`;
|
|
476
|
-
}
|
|
477
|
-
filter(e) {
|
|
478
|
-
if (!this.email)
|
|
479
|
-
return !1;
|
|
480
|
-
const t = this.email.split("@");
|
|
481
|
-
if (t.length < 2)
|
|
482
|
-
return !0;
|
|
483
|
-
const i = t.pop();
|
|
484
|
-
return e.includes(i) && e !== `@${i}`;
|
|
485
|
-
}
|
|
486
|
-
item(e) {
|
|
487
|
-
return c`<wui-button variant="neutral" size="sm" @click=${() => {
|
|
488
|
-
const i = this.email.split("@");
|
|
489
|
-
i.length > 1 && i.pop();
|
|
490
|
-
const s = i[0] + e;
|
|
491
|
-
this.dispatchEvent(new CustomEvent("change", {
|
|
492
|
-
detail: s,
|
|
493
|
-
bubbles: !0,
|
|
494
|
-
composed: !0
|
|
495
|
-
}));
|
|
496
|
-
}}
|
|
497
|
-
>${e}</wui-button
|
|
498
|
-
>`;
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
E.styles = [A];
|
|
502
|
-
q([
|
|
503
|
-
T()
|
|
504
|
-
], E.prototype, "email", void 0);
|
|
505
|
-
E = q([
|
|
506
|
-
$("w3m-email-suffixes-widget")
|
|
507
|
-
], E);
|
|
508
|
-
var D = function(r, e, t, i) {
|
|
509
|
-
var s = arguments.length, n = s < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, a;
|
|
510
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(r, e, t, i);
|
|
511
|
-
else for (var o = r.length - 1; o >= 0; o--) (a = r[o]) && (n = (s < 3 ? a(n) : s > 3 ? a(e, t, n) : a(e, t)) || n);
|
|
512
|
-
return s > 3 && n && Object.defineProperty(e, t, n), n;
|
|
513
|
-
};
|
|
514
|
-
let S = class extends N {
|
|
515
|
-
constructor() {
|
|
516
|
-
super(...arguments), this.emails = [];
|
|
517
|
-
}
|
|
518
|
-
render() {
|
|
519
|
-
return this.emails.length === 0 ? null : c`<div class="recent-emails">
|
|
520
|
-
<wui-text variant="micro-600" color="fg-200" class="recent-emails-heading"
|
|
521
|
-
>Recently used emails</wui-text
|
|
522
|
-
>
|
|
523
|
-
${this.emails.map(this.item.bind(this))}
|
|
524
|
-
</div>`;
|
|
525
|
-
}
|
|
526
|
-
item(e) {
|
|
527
|
-
return c`<wui-list-item
|
|
528
|
-
@click=${() => {
|
|
529
|
-
this.dispatchEvent(new CustomEvent("select", {
|
|
530
|
-
detail: e,
|
|
531
|
-
bubbles: !0,
|
|
532
|
-
composed: !0
|
|
533
|
-
}));
|
|
534
|
-
}}
|
|
535
|
-
?chevron=${!0}
|
|
536
|
-
icon="mail"
|
|
537
|
-
iconVariant="overlay"
|
|
538
|
-
class="recent-emails-list-item"
|
|
539
|
-
>
|
|
540
|
-
<wui-text variant="paragraph-500" color="fg-100">${e}</wui-text>
|
|
541
|
-
</wui-list-item>`;
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
S.styles = [A];
|
|
545
|
-
D([
|
|
546
|
-
T()
|
|
547
|
-
], S.prototype, "emails", void 0);
|
|
548
|
-
S = D([
|
|
549
|
-
$("w3m-recent-emails-widget")
|
|
550
|
-
], S);
|
|
551
|
-
var d = function(r, e, t, i) {
|
|
552
|
-
var s = arguments.length, n = s < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, a;
|
|
553
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(r, e, t, i);
|
|
554
|
-
else for (var o = r.length - 1; o >= 0; o--) (a = r[o]) && (n = (s < 3 ? a(n) : s > 3 ? a(e, t, n) : a(e, t)) || n);
|
|
555
|
-
return s > 3 && n && Object.defineProperty(e, t, n), n;
|
|
556
|
-
};
|
|
557
|
-
let l = class extends N {
|
|
558
|
-
constructor() {
|
|
559
|
-
var e, t, i, s, n, a, o;
|
|
560
|
-
super(...arguments), this.email = ((e = f.state.data) == null ? void 0 : e.email) ?? ((i = (t = g.getAccountData()) == null ? void 0 : t.user) == null ? void 0 : i.email) ?? "", this.address = ((s = g.getAccountData()) == null ? void 0 : s.address) ?? "", this.loading = !1, this.appName = ((n = w.state.metadata) == null ? void 0 : n.name) ?? "AppKit", this.siwx = w.state.siwx, this.isRequired = Array.isArray((a = w.state.remoteFeatures) == null ? void 0 : a.emailCapture) && ((o = w.state.remoteFeatures) == null ? void 0 : o.emailCapture.includes("required")), this.recentEmails = this.getRecentEmails();
|
|
561
|
-
}
|
|
562
|
-
connectedCallback() {
|
|
563
|
-
(!this.siwx || !(this.siwx instanceof _)) && v.showError("ReownAuthentication is not initialized."), super.connectedCallback();
|
|
564
|
-
}
|
|
565
|
-
firstUpdated() {
|
|
566
|
-
this.loading = !1, this.recentEmails = this.getRecentEmails(), this.email && this.onSubmit();
|
|
567
|
-
}
|
|
568
|
-
render() {
|
|
569
|
-
return c`
|
|
570
|
-
<wui-flex flexDirection="column" .padding=${["3xs", "m", "m", "m"]} gap="l">
|
|
571
|
-
${this.hero()} ${this.paragraph()} ${this.emailInput()} ${this.recentEmailsWidget()}
|
|
572
|
-
${this.footerActions()}
|
|
573
|
-
</wui-flex>
|
|
574
|
-
`;
|
|
575
|
-
}
|
|
576
|
-
hero() {
|
|
577
|
-
return c`
|
|
578
|
-
<div class="hero" data-state=${this.loading ? "loading" : "default"}>
|
|
579
|
-
${this.heroRow(["id", "mail", "wallet", "x", "solana", "qrCode"])}
|
|
580
|
-
${this.heroRow(["mail", "farcaster", "wallet", "discord", "mobile", "qrCode"])}
|
|
581
|
-
<div class="hero-row">
|
|
582
|
-
${this.heroIcon("github")} ${this.heroIcon("bank")}
|
|
583
|
-
<wui-icon-box
|
|
584
|
-
size="xl"
|
|
585
|
-
iconSize="xxl"
|
|
586
|
-
iconColor=${this.loading ? "fg-100" : "accent-100"}
|
|
587
|
-
backgroundColor=${this.loading ? "fg-100" : "accent-100"}
|
|
588
|
-
icon=${this.loading ? "id" : "user"}
|
|
589
|
-
isOpaque
|
|
590
|
-
class="hero-main-icon"
|
|
591
|
-
data-state=${this.loading ? "loading" : "default"}
|
|
592
|
-
>
|
|
593
|
-
</wui-icon-box>
|
|
594
|
-
${this.heroIcon("id")} ${this.heroIcon("card")}
|
|
595
|
-
</div>
|
|
596
|
-
${this.heroRow(["google", "id", "github", "verify", "apple", "mobile"])}
|
|
597
|
-
</div>
|
|
598
|
-
`;
|
|
599
|
-
}
|
|
600
|
-
heroRow(e) {
|
|
601
|
-
return c`
|
|
602
|
-
<div class="hero-row" data-state=${this.loading ? "loading" : "default"}>
|
|
603
|
-
${e.map(this.heroIcon.bind(this))}
|
|
604
|
-
</div>
|
|
605
|
-
`;
|
|
606
|
-
}
|
|
607
|
-
heroIcon(e) {
|
|
608
|
-
return c`
|
|
609
|
-
<wui-icon-box
|
|
610
|
-
size="xl"
|
|
611
|
-
iconSize="xxl"
|
|
612
|
-
iconColor="fg-100"
|
|
613
|
-
backgroundColor="fg-100"
|
|
614
|
-
icon=${e}
|
|
615
|
-
data-state=${this.loading ? "loading" : "default"}
|
|
616
|
-
isOpaque
|
|
617
|
-
class="hero-row-icon"
|
|
618
|
-
>
|
|
619
|
-
</wui-icon-box>
|
|
620
|
-
`;
|
|
621
|
-
}
|
|
622
|
-
paragraph() {
|
|
623
|
-
return this.loading ? c`
|
|
624
|
-
<wui-text variant="paragraph-400" color="fg-200" align="center"
|
|
625
|
-
>We are verifying your account with email
|
|
626
|
-
<wui-text variant="paragraph-600" color="accent-100">${this.email}</wui-text> and address
|
|
627
|
-
<wui-text variant="paragraph-600" color="fg-100">
|
|
628
|
-
${V.getTruncateString({
|
|
629
|
-
string: this.address,
|
|
630
|
-
charsEnd: 4,
|
|
631
|
-
charsStart: 4,
|
|
632
|
-
truncate: "middle"
|
|
633
|
-
})} </wui-text
|
|
634
|
-
>, please wait a moment.</wui-text
|
|
635
|
-
>
|
|
636
|
-
` : this.isRequired ? c`
|
|
637
|
-
<wui-text variant="paragraph-600" color="fg-100" align="center">
|
|
638
|
-
${this.appName} requires your email for authentication.
|
|
639
|
-
</wui-text>
|
|
640
|
-
` : c`
|
|
641
|
-
<wui-flex flexDirection="column" gap="xs" alignItems="center">
|
|
642
|
-
<wui-text variant="paragraph-600" color="fg-100" align="center" size>
|
|
643
|
-
${this.appName} would like to collect your email.
|
|
644
|
-
</wui-text>
|
|
645
|
-
|
|
646
|
-
<wui-text variant="small-400" color="fg-200" align="center">
|
|
647
|
-
Don't worry, it's optional—you can skip this step.
|
|
648
|
-
</wui-text>
|
|
649
|
-
</wui-flex>
|
|
650
|
-
`;
|
|
651
|
-
}
|
|
652
|
-
emailInput() {
|
|
653
|
-
if (this.loading)
|
|
654
|
-
return null;
|
|
655
|
-
const e = (i) => {
|
|
656
|
-
i.key === "Enter" && this.onSubmit();
|
|
657
|
-
}, t = (i) => {
|
|
658
|
-
this.email = i.detail;
|
|
659
|
-
};
|
|
660
|
-
return c`
|
|
661
|
-
<wui-flex flexDirection="column">
|
|
662
|
-
<wui-email-input
|
|
663
|
-
.value=${this.email}
|
|
664
|
-
.disabled=${this.loading}
|
|
665
|
-
@inputChange=${t}
|
|
666
|
-
@keydown=${e}
|
|
667
|
-
></wui-email-input>
|
|
668
|
-
|
|
669
|
-
<w3m-email-suffixes-widget
|
|
670
|
-
.email=${this.email}
|
|
671
|
-
@change=${t}
|
|
672
|
-
></w3m-email-suffixes-widget>
|
|
673
|
-
</wui-flex>
|
|
674
|
-
`;
|
|
675
|
-
}
|
|
676
|
-
recentEmailsWidget() {
|
|
677
|
-
if (this.recentEmails.length === 0 || this.loading)
|
|
678
|
-
return null;
|
|
679
|
-
const e = (t) => {
|
|
680
|
-
this.email = t.detail, this.onSubmit();
|
|
681
|
-
};
|
|
682
|
-
return c`
|
|
683
|
-
<w3m-recent-emails-widget
|
|
684
|
-
.emails=${this.recentEmails}
|
|
685
|
-
@select=${e}
|
|
686
|
-
></w3m-recent-emails-widget>
|
|
687
|
-
`;
|
|
688
|
-
}
|
|
689
|
-
footerActions() {
|
|
690
|
-
return c`
|
|
691
|
-
<wui-flex flexDirection="row" fullWidth gap="s">
|
|
692
|
-
${this.isRequired ? null : c`<wui-button
|
|
693
|
-
size="lg"
|
|
694
|
-
variant="neutral"
|
|
695
|
-
fullWidth
|
|
696
|
-
.disabled=${this.loading}
|
|
697
|
-
@click=${this.onSkip.bind(this)}
|
|
698
|
-
>Skip this step</wui-button
|
|
699
|
-
>`}
|
|
700
|
-
|
|
701
|
-
<wui-button
|
|
702
|
-
size="lg"
|
|
703
|
-
variant="main"
|
|
704
|
-
type="submit"
|
|
705
|
-
fullWidth
|
|
706
|
-
.disabled=${!this.email || !this.isValidEmail(this.email)}
|
|
707
|
-
.loading=${this.loading}
|
|
708
|
-
@click=${this.onSubmit.bind(this)}
|
|
709
|
-
>
|
|
710
|
-
Continue
|
|
711
|
-
</wui-button>
|
|
712
|
-
</wui-flex>
|
|
713
|
-
`;
|
|
714
|
-
}
|
|
715
|
-
async onSubmit() {
|
|
716
|
-
const e = g.getActiveCaipAddress();
|
|
717
|
-
if (!e)
|
|
718
|
-
throw new Error("Account is not connected.");
|
|
719
|
-
if (!this.isValidEmail(this.email)) {
|
|
720
|
-
v.showError("Please provide a valid email.");
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
|
-
try {
|
|
724
|
-
this.loading = !0;
|
|
725
|
-
const t = await this.siwx.requestEmailOtp({
|
|
726
|
-
email: this.email,
|
|
727
|
-
account: e
|
|
728
|
-
});
|
|
729
|
-
this.pushRecentEmail(this.email), t.uuid === null ? f.replace("SIWXSignMessage") : f.replace("DataCaptureOtpConfirm", { email: this.email });
|
|
730
|
-
} catch {
|
|
731
|
-
v.showError("Failed to send email OTP"), this.loading = !1;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
onSkip() {
|
|
735
|
-
f.replace("SIWXSignMessage");
|
|
736
|
-
}
|
|
737
|
-
getRecentEmails() {
|
|
738
|
-
const e = m.getItem(b.RECENT_EMAILS);
|
|
739
|
-
return (e ? e.split(",") : []).filter(this.isValidEmail.bind(this)).slice(0, 3);
|
|
740
|
-
}
|
|
741
|
-
pushRecentEmail(e) {
|
|
742
|
-
const t = this.getRecentEmails(), i = Array.from(/* @__PURE__ */ new Set([e, ...t])).slice(0, 3);
|
|
743
|
-
m.setItem(b.RECENT_EMAILS, i.join(","));
|
|
744
|
-
}
|
|
745
|
-
isValidEmail(e) {
|
|
746
|
-
return /^\S+@\S+\.\S+$/u.test(e);
|
|
747
|
-
}
|
|
748
|
-
};
|
|
749
|
-
l.styles = [A];
|
|
750
|
-
d([
|
|
751
|
-
u()
|
|
752
|
-
], l.prototype, "email", void 0);
|
|
753
|
-
d([
|
|
754
|
-
u()
|
|
755
|
-
], l.prototype, "address", void 0);
|
|
756
|
-
d([
|
|
757
|
-
u()
|
|
758
|
-
], l.prototype, "loading", void 0);
|
|
759
|
-
d([
|
|
760
|
-
u()
|
|
761
|
-
], l.prototype, "appName", void 0);
|
|
762
|
-
d([
|
|
763
|
-
u()
|
|
764
|
-
], l.prototype, "siwx", void 0);
|
|
765
|
-
d([
|
|
766
|
-
u()
|
|
767
|
-
], l.prototype, "isRequired", void 0);
|
|
768
|
-
d([
|
|
769
|
-
u()
|
|
770
|
-
], l.prototype, "recentEmails", void 0);
|
|
771
|
-
l = d([
|
|
772
|
-
$("w3m-data-capture-view")
|
|
773
|
-
], l);
|
|
774
|
-
var W = function(r, e, t, i) {
|
|
775
|
-
var s = arguments.length, n = s < 3 ? e : i === null ? i = Object.getOwnPropertyDescriptor(e, t) : i, a;
|
|
776
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(r, e, t, i);
|
|
777
|
-
else for (var o = r.length - 1; o >= 0; o--) (a = r[o]) && (n = (s < 3 ? a(n) : s > 3 ? a(e, t, n) : a(e, t)) || n);
|
|
778
|
-
return s > 3 && n && Object.defineProperty(e, t, n), n;
|
|
779
|
-
};
|
|
780
|
-
let I = class extends O {
|
|
781
|
-
constructor() {
|
|
782
|
-
super(...arguments), this.siwx = w.state.siwx, this.onOtpSubmit = async (e) => {
|
|
783
|
-
await this.siwx.confirmEmailOtp({ code: e }), f.replace("SIWXSignMessage");
|
|
784
|
-
}, this.onOtpResend = async (e) => {
|
|
785
|
-
const t = g.getAccountData();
|
|
786
|
-
if (!(t != null && t.caipAddress))
|
|
787
|
-
throw new Error("No account data found");
|
|
788
|
-
await this.siwx.requestEmailOtp({
|
|
789
|
-
email: e,
|
|
790
|
-
account: t.caipAddress
|
|
791
|
-
});
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
connectedCallback() {
|
|
795
|
-
(!this.siwx || !(this.siwx instanceof _)) && v.showError("ReownAuthentication is not initialized."), super.connectedCallback();
|
|
796
|
-
}
|
|
797
|
-
shouldSubmitOnOtpChange() {
|
|
798
|
-
return this.otp.length === O.OTP_LENGTH;
|
|
799
|
-
}
|
|
800
|
-
};
|
|
801
|
-
W([
|
|
802
|
-
u()
|
|
803
|
-
], I.prototype, "siwx", void 0);
|
|
804
|
-
I = W([
|
|
805
|
-
$("w3m-data-capture-otp-confirm-view")
|
|
806
|
-
], I);
|
|
807
|
-
export {
|
|
808
|
-
I as W3mDataCaptureOtpConfirmView,
|
|
809
|
-
l as W3mDataCaptureView,
|
|
810
|
-
E as W3mEmailSuffixesWidget,
|
|
811
|
-
S as W3mRecentEmailsWidget
|
|
812
|
-
};
|