@directcryptopay/sdk 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ExchangeController-CbO41bcH.js +217 -0
- package/dist/HelpersUtil-DHm6EVSE.js +120 -0
- package/dist/NavigationUtil-kj9LEOOd.js +8 -0
- package/dist/PhArrowCircleDown-lsK25DCk.js +73 -0
- package/dist/PhArrowClockwise-NeKHZ1co.js +73 -0
- package/dist/PhArrowDown-C9AkNvLs.js +73 -0
- package/dist/PhArrowLeft-RNfIQP1X.js +73 -0
- package/dist/PhArrowRight-DM1tna0G.js +73 -0
- package/dist/PhArrowSquareOut-S5XYbAZj.js +73 -0
- package/dist/PhArrowUp-DmktzOWy.js +73 -0
- package/dist/PhArrowUpRight-BkNeW_5i.js +73 -0
- package/dist/PhArrowsClockwise-CQ4pG76b.js +73 -0
- package/dist/PhArrowsDownUp-H6gxaNM6.js +73 -0
- package/dist/PhArrowsLeftRight-DZSsfMR6.js +73 -0
- package/dist/PhBank-4_9QzqIB.js +73 -0
- package/dist/PhBrowser-B-JSznId.js +73 -0
- package/dist/PhCaretDown-vV5oHMNi.js +73 -0
- package/dist/PhCaretLeft-BLo6Y_f4.js +73 -0
- package/dist/PhCaretRight-CqQN4TT3.js +73 -0
- package/dist/PhCaretUp-Df7UCAHy.js +73 -0
- package/dist/PhCheck-gtpfK4ed.js +73 -0
- package/dist/PhCircleHalf-Uq7dwDYw.js +73 -0
- package/dist/PhClock-SDCW-NmF.js +73 -0
- package/dist/PhCompass-B7hgtdx-.js +73 -0
- package/dist/PhCopy-BcnhyXCy.js +73 -0
- package/dist/PhCreditCard-BJjByVgu.js +73 -0
- package/dist/PhCurrencyDollar-B7ZXqXBy.js +73 -0
- package/dist/PhDesktop-B3VKPuJx.js +73 -0
- package/dist/PhDeviceMobile-Bnd0TYEH.js +73 -0
- package/dist/PhDotsThree-yyMWyZ-R.js +73 -0
- package/dist/PhEnvelope-67uzHbI9.js +73 -0
- package/dist/PhFunnelSimple-B-DCsloI.js +73 -0
- package/dist/PhGlobe-TMm_6qGk.js +73 -0
- package/dist/PhIdentificationCard-CePPD2xc.js +73 -0
- package/dist/PhImage-gY96WtHR.js +73 -0
- package/dist/PhInfo-DRQM_ZDP.js +73 -0
- package/dist/PhLightbulb-B0TxPfZ1.js +73 -0
- package/dist/PhMagnifyingGlass-B8si5_6W.js +73 -0
- package/dist/PhPaperPlaneRight-DVu5PLYd.js +73 -0
- package/dist/PhPlus-BfTsQnUz.js +73 -0
- package/dist/PhPower-CxYUGOWn.js +73 -0
- package/dist/PhPuzzlePiece-CQ4wh0gV.js +73 -0
- package/dist/PhQrCode-BuJ97NYJ.js +73 -0
- package/dist/PhQuestion-kJoP8Mja.js +73 -0
- package/dist/PhQuestionMark-C46ZkFpu.js +73 -0
- package/dist/PhSealCheck-Eh8jVqSN.js +73 -0
- package/dist/PhSignOut-jk97OSVt.js +73 -0
- package/dist/PhSpinner-CiYOhwMg.js +73 -0
- package/dist/PhTrash-pxerMqzd.js +73 -0
- package/dist/PhUser-BMg0VV4A.js +73 -0
- package/dist/PhVault-DYQvx5A-.js +73 -0
- package/dist/PhWarning-NLC5Mj87.js +73 -0
- package/dist/PhWarningCircle-Ch2jU9fA.js +73 -0
- package/dist/PhX-Bx4wpwm3.js +73 -0
- package/dist/SwapController-Ch0FFTEt.js +457 -0
- package/dist/{ccip-BIGqktC1.js → ccip-BrGhNXIM.js} +4 -4
- package/dist/data-capture-CpafmuCb.js +490 -0
- package/dist/dcp-sdk.umd.js +7400 -6589
- package/dist/email-Dcg4jlai.js +344 -0
- package/dist/embedded-wallet-DeoRdAPw.js +820 -0
- package/dist/features-B9Nde43h.js +274 -0
- package/dist/{hashTypedData-ZH9ZnWu3.js → hashTypedData-a7b8tdkO.js} +6 -6
- package/dist/if-defined-k21LutCn.js +10 -0
- package/dist/index-9vLw53Xl.js +228 -0
- package/dist/index-B5wUyynz.js +107 -0
- package/dist/index-B8LkUrww.js +86 -0
- package/dist/{index-CPTcEPbD.js → index-BA0VwKg0.js} +296 -298
- package/dist/index-BB9JJ24N.js +125 -0
- package/dist/index-BCkEvPQ6.js +172 -0
- package/dist/index-BDeO_csr.js +171 -0
- package/dist/index-Bb7babLF.js +1281 -0
- package/dist/index-BjOhprVS.js +199 -0
- package/dist/{index-Dy4NyE6l.js → index-BjyMgZsf.js} +7 -7
- package/dist/index-BkThIDLX.js +159 -0
- package/dist/index-BmFs6nb7.js +209 -0
- package/dist/{index-5mp7WkhV.js → index-C4qc4PdD.js} +2 -2
- package/dist/{index-BdSIrl-R.js → index-CAPvUh14.js} +578 -570
- package/dist/index-CBMU3PTE.js +65 -0
- package/dist/index-CGwPkJLF.js +355 -0
- package/dist/index-CNGEqX3D.js +153 -0
- package/dist/index-CRlCq6IB.js +7981 -0
- package/dist/index-Cg_o-i9X.js +118 -0
- package/dist/index-D1BvhCbI.js +62 -0
- package/dist/index-DFi8TiHc.js +128 -0
- package/dist/index-DLwuveL9.js +555 -0
- package/dist/index-DMn7ktUQ.js +56 -0
- package/dist/index-DOXwtuwa.js +117 -0
- package/dist/index-DPPOW_Tp.js +118 -0
- package/dist/{index-f3LXSfM5.js → index-DQpzHpW-.js} +56 -142
- package/dist/{index-D6h-qfpt.js → index-DXHg5C-W.js} +5 -5
- package/dist/index-DcYjZV4H.js +110 -0
- package/dist/{index-BJ7cbG3N.js → index-DeL88Lwc.js} +36769 -40177
- package/dist/index-DrWVlf8b.js +46 -0
- package/dist/index-Dsfuc4rB.js +123 -0
- package/dist/index-DuTny38n.js +1175 -0
- package/dist/{index-D5r0iSq4.js → index-Nfjb6bV0.js} +1 -1
- package/dist/index-WwwdQSN2.js +85 -0
- package/dist/index-Yha9Afch.js +174 -0
- package/dist/index-cbQHN7GC.js +100 -0
- package/dist/{index-DobBVPe4.js → index-hyG3cYsv.js} +481 -236
- package/dist/index-qLxmmPaL.js +257 -0
- package/dist/index.js +1 -1
- package/dist/{localBatchGatewayRequest-CjGcn5nM.js → localBatchGatewayRequest-vfcvRH0G.js} +1 -1
- package/dist/onramp-BSiyOX4L.js +855 -0
- package/dist/{parseSignature-S8VEpRHC.js → parseSignature-CdCMAPZN.js} +2312 -2313
- package/dist/pay-with-exchange-CduNoMEz.js +525 -0
- package/dist/property-Bd8U3_QP.js +618 -0
- package/dist/receive-CrmptJlq.js +232 -0
- package/dist/ref-SOwYtCZb.js +107 -0
- package/dist/send-oMcHMEr6.js +1166 -0
- package/dist/socials-C0A4-FbY.js +620 -0
- package/dist/swaps-CbJJ9Ciu.js +1760 -0
- package/dist/{transactions-DujFkB-M.js → transactions-BDfCoBS5.js} +10 -10
- package/dist/w3m-modal-BjsTkny7.js +1706 -0
- package/package.json +3 -3
- package/dist/ConstantsUtil-B-_-u8aQ.js +0 -6
- package/dist/add-sji6scSD.js +0 -19
- package/dist/all-wallets-B4H-890E.js +0 -10
- package/dist/app-store-Z433s97G.js +0 -21
- package/dist/apple-b8Lxj7nb.js +0 -22
- package/dist/arrow-bottom-M9oWWo_9.js +0 -12
- package/dist/arrow-bottom-circle-N9c4CXY1.js +0 -15
- package/dist/arrow-left-Dw8AKfwf.js +0 -12
- package/dist/arrow-right-DwLQZSC_.js +0 -12
- package/dist/arrow-top-zhUjkBe1.js +0 -12
- package/dist/bank-CbQdnILK.js +0 -18
- package/dist/browser-xAqNwt7z.js +0 -18
- package/dist/card-Dr1QBmWp.js +0 -18
- package/dist/checkmark-BhT1dTgG.js +0 -15
- package/dist/checkmark-bold-CPB29wqQ.js +0 -12
- package/dist/chevron-bottom-BhNyx2II.js +0 -12
- package/dist/chevron-left-CGuEjQlY.js +0 -12
- package/dist/chevron-right-CvIRRsqZ.js +0 -12
- package/dist/chevron-top-RSzCqjBd.js +0 -12
- package/dist/chrome-store-Cs8dAgs0.js +0 -65
- package/dist/clock-fhZO5otC.js +0 -12
- package/dist/close-BPuztrdR.js +0 -12
- package/dist/coinPlaceholder-C8X2i7Kh.js +0 -12
- package/dist/compass-WMc5huk0.js +0 -12
- package/dist/copy-DVAeT17y.js +0 -19
- package/dist/cursor-BJ4YLXfy.js +0 -7
- package/dist/cursor-transparent-DN2fLQN4.js +0 -16
- package/dist/desktop-6avxisBw.js +0 -13
- package/dist/disconnect-AReVI8Gk.js +0 -12
- package/dist/discord-CxrI30BZ.js +0 -21
- package/dist/email-B8dIIaay.js +0 -696
- package/dist/embedded-wallet-C_5hF7rM.js +0 -468
- package/dist/etherscan-BnAy8cIF.js +0 -10
- package/dist/exclamation-triangle-Bu7nHwx9.js +0 -8
- package/dist/extension-F0LIhvcf.js +0 -12
- package/dist/external-link-CP6phyaM.js +0 -12
- package/dist/facebook-BtQ-Io2y.js +0 -30
- package/dist/farcaster-BmaN1ugd.js +0 -16
- package/dist/filters-DpEwoOmy.js +0 -12
- package/dist/github-q7qO9V-b.js +0 -22
- package/dist/google-DH_ZE8bW.js +0 -22
- package/dist/help-circle-BAQVmKas.js +0 -16
- package/dist/id-Cj68Zwgo.js +0 -16
- package/dist/if-defined-CNte9B3N.js +0 -744
- package/dist/image-BKJDw6N-.js +0 -8
- package/dist/index-7toZMdtG.js +0 -573
- package/dist/index-B1uKzdvN.js +0 -170
- package/dist/index-BHFZVF-b.js +0 -257
- package/dist/index-BKwa5JSA.js +0 -559
- package/dist/index-BP4B9VUt.js +0 -54
- package/dist/index-BVdzXHpO.js +0 -181
- package/dist/index-BYND0GJ9.js +0 -146
- package/dist/index-BaJ0zEbh.js +0 -97
- package/dist/index-Bh0MPFwP.js +0 -58
- package/dist/index-Bsh7_qTp.js +0 -511
- package/dist/index-BwnXTNNg.js +0 -199
- package/dist/index-C0kPDbg_.js +0 -77
- package/dist/index-CKikVKe2.js +0 -75
- package/dist/index-ChVh0Hkp.js +0 -243
- package/dist/index-Cle_NnnS.js +0 -305
- package/dist/index-CmWdvIFT.js +0 -51
- package/dist/index-D2AMA8Bu.js +0 -65
- package/dist/index-DAUM8CO4.js +0 -65
- package/dist/index-DGjZW6uR.js +0 -78
- package/dist/index-DQe94z7X.js +0 -265
- package/dist/index-DTo6w99t.js +0 -7864
- package/dist/index-DYdXjap2.js +0 -320
- package/dist/index-DceCxNV5.js +0 -181
- package/dist/index-Uw9cSw0q.js +0 -294
- package/dist/index-qiuyrukh.js +0 -45
- package/dist/index-zddvaohA.js +0 -78
- package/dist/info-RfPsmroW.js +0 -7
- package/dist/info-circle-DFKHB_ZN.js +0 -16
- package/dist/lightbulb-B-Bykj9X.js +0 -7
- package/dist/mail-mBAgGuw5.js +0 -12
- package/dist/mobile-Dhh3ndkf.js +0 -13
- package/dist/more-D1h7UTvg.js +0 -15
- package/dist/network-placeholder-Dqynvc-t.js +0 -18
- package/dist/nftPlaceholder-Df7MW4MM.js +0 -12
- package/dist/off-BmG3cHTX.js +0 -12
- package/dist/onramp-C401Aenb.js +0 -1279
- package/dist/play-store-4q1fzL_P.js +0 -36
- package/dist/plus-603Gs3yG.js +0 -17
- package/dist/qr-code-Dgwhf6M1.js +0 -10
- package/dist/receive-CYXbbEUR.js +0 -186
- package/dist/recycle-horizontal-Bu8zZ563.js +0 -13
- package/dist/ref-DpmKRWBK.js +0 -41
- package/dist/refresh-BMZFu0mu.js +0 -12
- package/dist/reown-logo-BXph7ThY.js +0 -16
- package/dist/search-Cm_V42Y_.js +0 -12
- package/dist/secp256k1-C0iX1TUr.js +0 -1510
- package/dist/secp256k1-DOQBqE4Z.js +0 -1302
- package/dist/send-BSMYxDuP.js +0 -19
- package/dist/send-C8EeIzRB.js +0 -1038
- package/dist/socials-DQrHQajs.js +0 -574
- package/dist/swapHorizontal-98rnJewS.js +0 -12
- package/dist/swapHorizontalBold-C299FjEt.js +0 -12
- package/dist/swapHorizontalMedium-Cqm6i4WJ.js +0 -20
- package/dist/swapHorizontalRoundedBold-De7hFfqZ.js +0 -12
- package/dist/swapVertical-DSL75l8L.js +0 -12
- package/dist/swaps-BuTNp65Y.js +0 -1637
- package/dist/telegram-cJP7hgUb.js +0 -20
- package/dist/three-dots-DHnEh28O.js +0 -9
- package/dist/twitch-CR2iGcBo.js +0 -22
- package/dist/twitterIcon-E5TAQjOn.js +0 -10
- package/dist/verify-DEukUJp0.js +0 -12
- package/dist/verify-filled-BXsx1i_p.js +0 -12
- package/dist/w3m-modal-Bm7BqVng.js +0 -1037
- package/dist/wallet-CzyyvdrT.js +0 -12
- package/dist/wallet-placeholder-BrcmyGEe.js +0 -18
- package/dist/walletconnect-BSYogWiE.js +0 -36
- package/dist/warning-circle-Cgp2BW3m.js +0 -16
- package/dist/x-BJinLpTw.js +0 -16
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import { c_ as y, cX as $, cY as l, cM as m, d0 as p, cE as f, cH as h, dt as E, du as C } from "./index-DeL88Lwc.js";
|
|
2
|
+
import { n as S, c as x, r as u, U as _ } from "./index-DuTny38n.js";
|
|
3
|
+
import { W as R } from "./index-CGwPkJLF.js";
|
|
4
|
+
import { ReownAuthentication as v } from "./features-B9Nde43h.js";
|
|
5
|
+
const D = y`
|
|
6
|
+
.email-sufixes {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
gap: var(--wui-spacing-3xs);
|
|
10
|
+
overflow-x: auto;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
margin-top: var(--wui-spacing-s);
|
|
13
|
+
margin-bottom: calc(-1 * var(--wui-spacing-m));
|
|
14
|
+
padding-bottom: var(--wui-spacing-m);
|
|
15
|
+
margin-left: calc(-1 * var(--wui-spacing-m));
|
|
16
|
+
margin-right: calc(-1 * var(--wui-spacing-m));
|
|
17
|
+
padding-left: var(--wui-spacing-m);
|
|
18
|
+
padding-right: var(--wui-spacing-m);
|
|
19
|
+
|
|
20
|
+
&::-webkit-scrollbar {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
var O = function(o, t, i, a) {
|
|
26
|
+
var n = arguments.length, e = n < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, i) : a, r;
|
|
27
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(o, t, i, a);
|
|
28
|
+
else for (var s = o.length - 1; s >= 0; s--) (r = o[s]) && (e = (n < 3 ? r(e) : n > 3 ? r(t, i, e) : r(t, i)) || e);
|
|
29
|
+
return n > 3 && e && Object.defineProperty(t, i, e), e;
|
|
30
|
+
};
|
|
31
|
+
const I = [
|
|
32
|
+
"@gmail.com",
|
|
33
|
+
"@outlook.com",
|
|
34
|
+
"@yahoo.com",
|
|
35
|
+
"@hotmail.com",
|
|
36
|
+
"@aol.com",
|
|
37
|
+
"@icloud.com",
|
|
38
|
+
"@zoho.com"
|
|
39
|
+
];
|
|
40
|
+
let g = class extends $ {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments), this.email = "";
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
const t = I.filter(this.filter.bind(this)).map(this.item.bind(this));
|
|
46
|
+
return t.length === 0 ? null : l`<div class="email-sufixes">${t}</div>`;
|
|
47
|
+
}
|
|
48
|
+
filter(t) {
|
|
49
|
+
if (!this.email)
|
|
50
|
+
return !1;
|
|
51
|
+
const i = this.email.split("@");
|
|
52
|
+
if (i.length < 2)
|
|
53
|
+
return !0;
|
|
54
|
+
const a = i.pop();
|
|
55
|
+
return t.includes(a) && t !== `@${a}`;
|
|
56
|
+
}
|
|
57
|
+
item(t) {
|
|
58
|
+
return l`<wui-button variant="neutral" size="sm" @click=${() => {
|
|
59
|
+
const a = this.email.split("@");
|
|
60
|
+
a.length > 1 && a.pop();
|
|
61
|
+
const n = a[0] + t;
|
|
62
|
+
this.dispatchEvent(new CustomEvent("change", {
|
|
63
|
+
detail: n,
|
|
64
|
+
bubbles: !0,
|
|
65
|
+
composed: !0
|
|
66
|
+
}));
|
|
67
|
+
}}
|
|
68
|
+
>${t}</wui-button
|
|
69
|
+
>`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
g.styles = [D];
|
|
73
|
+
O([
|
|
74
|
+
S()
|
|
75
|
+
], g.prototype, "email", void 0);
|
|
76
|
+
g = O([
|
|
77
|
+
x("w3m-email-suffixes-widget")
|
|
78
|
+
], g);
|
|
79
|
+
const j = y`
|
|
80
|
+
.recent-emails {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
padding: var(--wui-spacing-s) 0;
|
|
84
|
+
border-top: 1px solid var(--wui-color-gray-glass-005);
|
|
85
|
+
border-bottom: 1px solid var(--wui-color-gray-glass-005);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.recent-emails-heading {
|
|
89
|
+
margin-bottom: var(--wui-spacing-s);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.recent-emails-list-item {
|
|
93
|
+
--wui-color-gray-glass-002: transparent;
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
var W = function(o, t, i, a) {
|
|
97
|
+
var n = arguments.length, e = n < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, i) : a, r;
|
|
98
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(o, t, i, a);
|
|
99
|
+
else for (var s = o.length - 1; s >= 0; s--) (r = o[s]) && (e = (n < 3 ? r(e) : n > 3 ? r(t, i, e) : r(t, i)) || e);
|
|
100
|
+
return n > 3 && e && Object.defineProperty(t, i, e), e;
|
|
101
|
+
};
|
|
102
|
+
let w = class extends $ {
|
|
103
|
+
constructor() {
|
|
104
|
+
super(...arguments), this.emails = [];
|
|
105
|
+
}
|
|
106
|
+
render() {
|
|
107
|
+
return this.emails.length === 0 ? null : l`<div class="recent-emails">
|
|
108
|
+
<wui-text variant="micro-600" color="fg-200" class="recent-emails-heading"
|
|
109
|
+
>Recently used emails</wui-text
|
|
110
|
+
>
|
|
111
|
+
${this.emails.map(this.item.bind(this))}
|
|
112
|
+
</div>`;
|
|
113
|
+
}
|
|
114
|
+
item(t) {
|
|
115
|
+
return l`<wui-list-item
|
|
116
|
+
@click=${() => {
|
|
117
|
+
this.dispatchEvent(new CustomEvent("select", {
|
|
118
|
+
detail: t,
|
|
119
|
+
bubbles: !0,
|
|
120
|
+
composed: !0
|
|
121
|
+
}));
|
|
122
|
+
}}
|
|
123
|
+
?chevron=${!0}
|
|
124
|
+
icon="mail"
|
|
125
|
+
iconVariant="overlay"
|
|
126
|
+
class="recent-emails-list-item"
|
|
127
|
+
>
|
|
128
|
+
<wui-text variant="paragraph-500" color="fg-100">${t}</wui-text>
|
|
129
|
+
</wui-list-item>`;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
w.styles = [j];
|
|
133
|
+
W([
|
|
134
|
+
S()
|
|
135
|
+
], w.prototype, "emails", void 0);
|
|
136
|
+
w = W([
|
|
137
|
+
x("w3m-recent-emails-widget")
|
|
138
|
+
], w);
|
|
139
|
+
var A = function(o, t, i, a) {
|
|
140
|
+
var n = arguments.length, e = n < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, i) : a, r;
|
|
141
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(o, t, i, a);
|
|
142
|
+
else for (var s = o.length - 1; s >= 0; s--) (r = o[s]) && (e = (n < 3 ? r(e) : n > 3 ? r(t, i, e) : r(t, i)) || e);
|
|
143
|
+
return n > 3 && e && Object.defineProperty(t, i, e), e;
|
|
144
|
+
};
|
|
145
|
+
let b = class extends R {
|
|
146
|
+
constructor() {
|
|
147
|
+
super(...arguments), this.siwx = m.state.siwx, this.onOtpSubmit = async (t) => {
|
|
148
|
+
await this.siwx.confirmEmailOtp({ code: t }), p.replace("SIWXSignMessage");
|
|
149
|
+
}, this.onOtpResend = async (t) => {
|
|
150
|
+
const i = f.getAccountData();
|
|
151
|
+
if (!(i != null && i.caipAddress))
|
|
152
|
+
throw new Error("No account data found");
|
|
153
|
+
await this.siwx.requestEmailOtp({
|
|
154
|
+
email: t,
|
|
155
|
+
account: i.caipAddress
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
connectedCallback() {
|
|
160
|
+
(!this.siwx || !(this.siwx instanceof v)) && h.showError("ReownAuthentication is not initialized."), super.connectedCallback();
|
|
161
|
+
}
|
|
162
|
+
shouldSubmitOnOtpChange() {
|
|
163
|
+
return this.otp.length === R.OTP_LENGTH;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
A([
|
|
167
|
+
u()
|
|
168
|
+
], b.prototype, "siwx", void 0);
|
|
169
|
+
b = A([
|
|
170
|
+
x("w3m-data-capture-otp-confirm-view")
|
|
171
|
+
], b);
|
|
172
|
+
const P = y`
|
|
173
|
+
.hero {
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-direction: column;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
gap: var(--wui-spacing-3xs);
|
|
179
|
+
|
|
180
|
+
transition-property: margin, height;
|
|
181
|
+
transition-duration: var(--wui-duration-md);
|
|
182
|
+
transition-timing-function: var(--wui-ease-out-power-1);
|
|
183
|
+
margin-top: -100px;
|
|
184
|
+
|
|
185
|
+
&[data-state='loading'] {
|
|
186
|
+
margin-top: 0px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
position: relative;
|
|
190
|
+
&:after {
|
|
191
|
+
content: '';
|
|
192
|
+
position: absolute;
|
|
193
|
+
bottom: 0;
|
|
194
|
+
height: 252px;
|
|
195
|
+
width: 360px;
|
|
196
|
+
background: radial-gradient(
|
|
197
|
+
96.11% 53.95% at 50% 51.28%,
|
|
198
|
+
transparent 0%,
|
|
199
|
+
color-mix(in srgb, var(--wui-color-bg-100) 5%, transparent) 49%,
|
|
200
|
+
color-mix(in srgb, var(--wui-color-bg-100) 65%, transparent) 99.43%
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.hero-main-icon {
|
|
206
|
+
width: 176px;
|
|
207
|
+
transition-property: background-color;
|
|
208
|
+
transition-duration: var(--wui-duration-lg);
|
|
209
|
+
transition-timing-function: var(--wui-ease-out-power-1);
|
|
210
|
+
|
|
211
|
+
&[data-state='loading'] {
|
|
212
|
+
width: 56px;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.hero-row {
|
|
217
|
+
display: flex;
|
|
218
|
+
flex-direction: row;
|
|
219
|
+
align-items: center;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
gap: var(--wui-spacing-3xs);
|
|
222
|
+
flex-wrap: nowrap;
|
|
223
|
+
min-width: fit-content;
|
|
224
|
+
|
|
225
|
+
&:nth-child(1) {
|
|
226
|
+
transform: translateX(-30px);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&:nth-child(2) {
|
|
230
|
+
transform: translateX(30px);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&:nth-child(4) {
|
|
234
|
+
transform: translateX(40px);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
transition-property: height;
|
|
238
|
+
transition-duration: var(--wui-duration-md);
|
|
239
|
+
transition-timing-function: var(--wui-ease-out-power-1);
|
|
240
|
+
height: 68px;
|
|
241
|
+
|
|
242
|
+
&[data-state='loading'] {
|
|
243
|
+
height: 0px;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.hero-row-icon {
|
|
248
|
+
opacity: 0.1;
|
|
249
|
+
transition-property: opacity;
|
|
250
|
+
transition-duration: var(--wui-duration-md);
|
|
251
|
+
transition-timing-function: var(--wui-ease-out-power-1);
|
|
252
|
+
|
|
253
|
+
&[data-state='loading'] {
|
|
254
|
+
opacity: 0;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
`;
|
|
258
|
+
var d = function(o, t, i, a) {
|
|
259
|
+
var n = arguments.length, e = n < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, i) : a, r;
|
|
260
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(o, t, i, a);
|
|
261
|
+
else for (var s = o.length - 1; s >= 0; s--) (r = o[s]) && (e = (n < 3 ? r(e) : n > 3 ? r(t, i, e) : r(t, i)) || e);
|
|
262
|
+
return n > 3 && e && Object.defineProperty(t, i, e), e;
|
|
263
|
+
};
|
|
264
|
+
let c = class extends $ {
|
|
265
|
+
constructor() {
|
|
266
|
+
var t, i, a, n, e, r, s;
|
|
267
|
+
super(...arguments), this.email = ((t = p.state.data) == null ? void 0 : t.email) ?? ((a = (i = f.getAccountData()) == null ? void 0 : i.user) == null ? void 0 : a.email) ?? "", this.address = ((n = f.getAccountData()) == null ? void 0 : n.address) ?? "", this.loading = !1, this.appName = ((e = m.state.metadata) == null ? void 0 : e.name) ?? "AppKit", this.siwx = m.state.siwx, this.isRequired = Array.isArray((r = m.state.remoteFeatures) == null ? void 0 : r.emailCapture) && ((s = m.state.remoteFeatures) == null ? void 0 : s.emailCapture.includes("required")), this.recentEmails = this.getRecentEmails();
|
|
268
|
+
}
|
|
269
|
+
connectedCallback() {
|
|
270
|
+
(!this.siwx || !(this.siwx instanceof v)) && h.showError("ReownAuthentication is not initialized. Please contact support."), super.connectedCallback();
|
|
271
|
+
}
|
|
272
|
+
firstUpdated() {
|
|
273
|
+
this.loading = !1, this.recentEmails = this.getRecentEmails(), this.email && this.onSubmit();
|
|
274
|
+
}
|
|
275
|
+
render() {
|
|
276
|
+
return l`
|
|
277
|
+
<wui-flex flexDirection="column" .padding=${["3xs", "m", "m", "m"]} gap="l">
|
|
278
|
+
${this.hero()} ${this.paragraph()} ${this.emailInput()} ${this.recentEmailsWidget()}
|
|
279
|
+
${this.footerActions()}
|
|
280
|
+
</wui-flex>
|
|
281
|
+
`;
|
|
282
|
+
}
|
|
283
|
+
hero() {
|
|
284
|
+
return l`
|
|
285
|
+
<div class="hero" data-state=${this.loading ? "loading" : "default"}>
|
|
286
|
+
${this.heroRow(["id", "mail", "wallet", "x", "solana", "qrCode"])}
|
|
287
|
+
${this.heroRow(["mail", "farcaster", "wallet", "discord", "mobile", "qrCode"])}
|
|
288
|
+
<div class="hero-row">
|
|
289
|
+
${this.heroIcon("github")} ${this.heroIcon("bank")}
|
|
290
|
+
<wui-icon-box
|
|
291
|
+
size="xl"
|
|
292
|
+
iconSize="xxl"
|
|
293
|
+
iconColor=${this.loading ? "fg-100" : "accent-100"}
|
|
294
|
+
backgroundColor=${this.loading ? "fg-100" : "accent-100"}
|
|
295
|
+
icon=${this.loading ? "id" : "user"}
|
|
296
|
+
isOpaque
|
|
297
|
+
class="hero-main-icon"
|
|
298
|
+
data-state=${this.loading ? "loading" : "default"}
|
|
299
|
+
>
|
|
300
|
+
</wui-icon-box>
|
|
301
|
+
${this.heroIcon("id")} ${this.heroIcon("card")}
|
|
302
|
+
</div>
|
|
303
|
+
${this.heroRow(["google", "id", "github", "verify", "apple", "mobile"])}
|
|
304
|
+
</div>
|
|
305
|
+
`;
|
|
306
|
+
}
|
|
307
|
+
heroRow(t) {
|
|
308
|
+
return l`
|
|
309
|
+
<div class="hero-row" data-state=${this.loading ? "loading" : "default"}>
|
|
310
|
+
${t.map(this.heroIcon.bind(this))}
|
|
311
|
+
</div>
|
|
312
|
+
`;
|
|
313
|
+
}
|
|
314
|
+
heroIcon(t) {
|
|
315
|
+
return l`
|
|
316
|
+
<wui-icon-box
|
|
317
|
+
size="xl"
|
|
318
|
+
iconSize="xxl"
|
|
319
|
+
iconColor="fg-100"
|
|
320
|
+
backgroundColor="fg-100"
|
|
321
|
+
icon=${t}
|
|
322
|
+
data-state=${this.loading ? "loading" : "default"}
|
|
323
|
+
isOpaque
|
|
324
|
+
class="hero-row-icon"
|
|
325
|
+
>
|
|
326
|
+
</wui-icon-box>
|
|
327
|
+
`;
|
|
328
|
+
}
|
|
329
|
+
paragraph() {
|
|
330
|
+
return this.loading ? l`
|
|
331
|
+
<wui-text variant="paragraph-400" color="fg-200" align="center"
|
|
332
|
+
>We are verifying your account with email
|
|
333
|
+
<wui-text variant="paragraph-600" color="accent-100">${this.email}</wui-text> and address
|
|
334
|
+
<wui-text variant="paragraph-600" color="fg-100">
|
|
335
|
+
${_.getTruncateString({
|
|
336
|
+
string: this.address,
|
|
337
|
+
charsEnd: 4,
|
|
338
|
+
charsStart: 4,
|
|
339
|
+
truncate: "middle"
|
|
340
|
+
})} </wui-text
|
|
341
|
+
>, please wait a moment.</wui-text
|
|
342
|
+
>
|
|
343
|
+
` : this.isRequired ? l`
|
|
344
|
+
<wui-text variant="paragraph-600" color="fg-100" align="center">
|
|
345
|
+
${this.appName} requires your email for authentication.
|
|
346
|
+
</wui-text>
|
|
347
|
+
` : l`
|
|
348
|
+
<wui-flex flexDirection="column" gap="xs" alignItems="center">
|
|
349
|
+
<wui-text variant="paragraph-600" color="fg-100" align="center" size>
|
|
350
|
+
${this.appName} would like to collect your email.
|
|
351
|
+
</wui-text>
|
|
352
|
+
|
|
353
|
+
<wui-text variant="small-400" color="fg-200" align="center">
|
|
354
|
+
Don't worry, it's optional—you can skip this step.
|
|
355
|
+
</wui-text>
|
|
356
|
+
</wui-flex>
|
|
357
|
+
`;
|
|
358
|
+
}
|
|
359
|
+
emailInput() {
|
|
360
|
+
if (this.loading)
|
|
361
|
+
return null;
|
|
362
|
+
const t = (a) => {
|
|
363
|
+
a.key === "Enter" && this.onSubmit();
|
|
364
|
+
}, i = (a) => {
|
|
365
|
+
this.email = a.detail;
|
|
366
|
+
};
|
|
367
|
+
return l`
|
|
368
|
+
<wui-flex flexDirection="column">
|
|
369
|
+
<wui-email-input
|
|
370
|
+
.value=${this.email}
|
|
371
|
+
.disabled=${this.loading}
|
|
372
|
+
@inputChange=${i}
|
|
373
|
+
@keydown=${t}
|
|
374
|
+
></wui-email-input>
|
|
375
|
+
|
|
376
|
+
<w3m-email-suffixes-widget
|
|
377
|
+
.email=${this.email}
|
|
378
|
+
@change=${i}
|
|
379
|
+
></w3m-email-suffixes-widget>
|
|
380
|
+
</wui-flex>
|
|
381
|
+
`;
|
|
382
|
+
}
|
|
383
|
+
recentEmailsWidget() {
|
|
384
|
+
if (this.recentEmails.length === 0 || this.loading)
|
|
385
|
+
return null;
|
|
386
|
+
const t = (i) => {
|
|
387
|
+
this.email = i.detail, this.onSubmit();
|
|
388
|
+
};
|
|
389
|
+
return l`
|
|
390
|
+
<w3m-recent-emails-widget
|
|
391
|
+
.emails=${this.recentEmails}
|
|
392
|
+
@select=${t}
|
|
393
|
+
></w3m-recent-emails-widget>
|
|
394
|
+
`;
|
|
395
|
+
}
|
|
396
|
+
footerActions() {
|
|
397
|
+
return l`
|
|
398
|
+
<wui-flex flexDirection="row" fullWidth gap="s">
|
|
399
|
+
${this.isRequired ? null : l`<wui-button
|
|
400
|
+
size="lg"
|
|
401
|
+
variant="neutral"
|
|
402
|
+
fullWidth
|
|
403
|
+
.disabled=${this.loading}
|
|
404
|
+
@click=${this.onSkip.bind(this)}
|
|
405
|
+
>Skip this step</wui-button
|
|
406
|
+
>`}
|
|
407
|
+
|
|
408
|
+
<wui-button
|
|
409
|
+
size="lg"
|
|
410
|
+
variant="main"
|
|
411
|
+
type="submit"
|
|
412
|
+
fullWidth
|
|
413
|
+
.disabled=${!this.email || !this.isValidEmail(this.email)}
|
|
414
|
+
.loading=${this.loading}
|
|
415
|
+
@click=${this.onSubmit.bind(this)}
|
|
416
|
+
>
|
|
417
|
+
Continue
|
|
418
|
+
</wui-button>
|
|
419
|
+
</wui-flex>
|
|
420
|
+
`;
|
|
421
|
+
}
|
|
422
|
+
async onSubmit() {
|
|
423
|
+
if (!(this.siwx instanceof v)) {
|
|
424
|
+
h.showError("ReownAuthentication is not initialized. Please contact support.");
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
const t = f.getActiveCaipAddress();
|
|
428
|
+
if (!t)
|
|
429
|
+
throw new Error("Account is not connected.");
|
|
430
|
+
if (!this.isValidEmail(this.email)) {
|
|
431
|
+
h.showError("Please provide a valid email.");
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
try {
|
|
435
|
+
this.loading = !0;
|
|
436
|
+
const i = await this.siwx.requestEmailOtp({
|
|
437
|
+
email: this.email,
|
|
438
|
+
account: t
|
|
439
|
+
});
|
|
440
|
+
this.pushRecentEmail(this.email), i.uuid === null ? p.replace("SIWXSignMessage") : p.replace("DataCaptureOtpConfirm", { email: this.email });
|
|
441
|
+
} catch {
|
|
442
|
+
h.showError("Failed to send email OTP"), this.loading = !1;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
onSkip() {
|
|
446
|
+
p.replace("SIWXSignMessage");
|
|
447
|
+
}
|
|
448
|
+
getRecentEmails() {
|
|
449
|
+
const t = E.getItem(C.RECENT_EMAILS);
|
|
450
|
+
return (t ? t.split(",") : []).filter(this.isValidEmail.bind(this)).slice(0, 3);
|
|
451
|
+
}
|
|
452
|
+
pushRecentEmail(t) {
|
|
453
|
+
const i = this.getRecentEmails(), a = Array.from(/* @__PURE__ */ new Set([t, ...i])).slice(0, 3);
|
|
454
|
+
E.setItem(C.RECENT_EMAILS, a.join(","));
|
|
455
|
+
}
|
|
456
|
+
isValidEmail(t) {
|
|
457
|
+
return /^\S+@\S+\.\S+$/u.test(t);
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
c.styles = [P];
|
|
461
|
+
d([
|
|
462
|
+
u()
|
|
463
|
+
], c.prototype, "email", void 0);
|
|
464
|
+
d([
|
|
465
|
+
u()
|
|
466
|
+
], c.prototype, "address", void 0);
|
|
467
|
+
d([
|
|
468
|
+
u()
|
|
469
|
+
], c.prototype, "loading", void 0);
|
|
470
|
+
d([
|
|
471
|
+
u()
|
|
472
|
+
], c.prototype, "appName", void 0);
|
|
473
|
+
d([
|
|
474
|
+
u()
|
|
475
|
+
], c.prototype, "siwx", void 0);
|
|
476
|
+
d([
|
|
477
|
+
u()
|
|
478
|
+
], c.prototype, "isRequired", void 0);
|
|
479
|
+
d([
|
|
480
|
+
u()
|
|
481
|
+
], c.prototype, "recentEmails", void 0);
|
|
482
|
+
c = d([
|
|
483
|
+
x("w3m-data-capture-view")
|
|
484
|
+
], c);
|
|
485
|
+
export {
|
|
486
|
+
b as W3mDataCaptureOtpConfirmView,
|
|
487
|
+
c as W3mDataCaptureView,
|
|
488
|
+
g as W3mEmailSuffixesWidget,
|
|
489
|
+
w as W3mRecentEmailsWidget
|
|
490
|
+
};
|