@springmicro/auth 0.1.9 → 0.2.0-alpha.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.
Files changed (135) hide show
  1. package/dist/Index-652aeb8c-BTQ1rBi7.js +2818 -0
  2. package/dist/Index-c419311f-BOZhAAW3.js +1054 -0
  3. package/dist/Web3Auth-hACKSouN.js +32769 -0
  4. package/dist/alphawallet-B7eovdf-.js +26 -0
  5. package/dist/apexwallet-ysP20G9D.js +93 -0
  6. package/dist/atoken-BBnNTzcz.js +27 -0
  7. package/dist/bifrostwallet-CNNBO92h.js +11 -0
  8. package/dist/binance-DvPgAzCw.js +14 -0
  9. package/dist/bitget-DZOUrwgy.js +4 -0
  10. package/dist/bitpie-C_uxmEzw.js +25 -0
  11. package/dist/bitski-DpzkHNkv.js +4 -0
  12. package/dist/blockwallet-BL69cqkA.js +8 -0
  13. package/dist/brave-DnRzMQYW.js +35 -0
  14. package/dist/ccip-c78d2f16-DLcRlwod.js +165 -0
  15. package/dist/coin98wallet-CkFdOvXt.js +4 -0
  16. package/dist/coinbase-CaGNx5if.js +9 -0
  17. package/dist/core-9rK8tWud.js +7 -0
  18. package/dist/defiwallet-0AsgJBSy.js +10 -0
  19. package/dist/detected-CX_JZaUk.js +6 -0
  20. package/dist/echooo-CmaetT_Z.js +14 -0
  21. package/dist/enkrypt-BibtwvK7.js +20 -0
  22. package/dist/exodus-BxzkDWWP.js +4 -0
  23. package/dist/fordefi-CvKyVwhI.js +6 -0
  24. package/dist/foxwallet-D7c_LDTf.js +4 -0
  25. package/dist/frame-CDfNmjUy.js +7 -0
  26. package/dist/frontier-DqKNSj2z.js +8 -0
  27. package/dist/huobiwallet-CxSwqa5L.js +14 -0
  28. package/dist/hyperpay-nmHE3WqM.js +7 -0
  29. package/dist/icon-2Zqy7pqQ.js +8 -0
  30. package/dist/icon-CGWI1Ies.js +43 -0
  31. package/dist/icon-C_O4nprO.js +9 -0
  32. package/dist/icon-DbgmZCnU.js +9 -0
  33. package/dist/icon-cAd7RhSC.js +9 -0
  34. package/dist/icon-duCa3gfT.js +11 -0
  35. package/dist/imtoken-yENtOTS3.js +17 -0
  36. package/dist/index-021f6a62-Zz543EDB.js +2583 -0
  37. package/dist/index-40a497ea-Bn2mC0r7.js +1010 -0
  38. package/dist/index-BHkXn9Ss.js +4010 -0
  39. package/dist/index-BaYEABY7.js +7089 -0
  40. package/dist/index-BtLU53lm.js +6023 -0
  41. package/dist/index-CynP9H3X.js +6188 -0
  42. package/dist/index-Dg8m-Szw.js +31 -0
  43. package/dist/index-Dt6M8ha9.js +161 -0
  44. package/dist/index-DtJfAdfq.js +5822 -0
  45. package/dist/index-klU8YB0c.js +1983 -0
  46. package/dist/index.d.ts +124 -0
  47. package/dist/index.js +5 -43
  48. package/dist/index.umd.cjs +1937 -1
  49. package/dist/infinitywallet-C8J4FUYw.js +42 -0
  50. package/dist/kayros-AIrUK1za.js +27 -0
  51. package/dist/lif3wallet-C5D6r8pg.js +41 -0
  52. package/dist/liquality-nbCtErVq.js +16 -0
  53. package/dist/mathwallet-CWkivCXo.js +50 -0
  54. package/dist/meetone-kKmvI8md.js +13 -0
  55. package/dist/metamask-BN7yiDV1.js +64 -0
  56. package/dist/mykey-CQZ6UcLH.js +13 -0
  57. package/dist/number-BXHWhlom.js +1529 -0
  58. package/dist/okxwallet-CJLVogh2.js +8 -0
  59. package/dist/oneInch-CciyZ4Pz.js +72 -0
  60. package/dist/onekey-Dal8kYjU.js +9 -0
  61. package/dist/opera-DnKg-TJU.js +24 -0
  62. package/dist/ownbit-BshJUVuW.js +18 -0
  63. package/dist/phantom-CJ8dIcov.js +35 -0
  64. package/dist/rabby-D4thTcd6.js +27 -0
  65. package/dist/rainbow-mXld6yWV.js +69 -0
  66. package/dist/roninwallet-ZyYrd-D1.js +9 -0
  67. package/dist/safeheron-Eg1Jb29V.js +23 -0
  68. package/dist/safepal-DVIKy94N.js +105 -0
  69. package/dist/sequence-BS2IbtDg.js +70 -0
  70. package/dist/stablewallet-jyB079Wb.js +20 -0
  71. package/dist/status-FrAvQjfn.js +4 -0
  72. package/dist/subwallet-DMvFqKyY.js +25 -0
  73. package/dist/talisman-Bp8zUXqB.js +16 -0
  74. package/dist/tallywallet-B4OS9nIr.js +16 -0
  75. package/dist/tokenary-C7jjcbQa.js +18 -0
  76. package/dist/tokenpocket-9ZRPmAFA.js +28 -0
  77. package/dist/tp-V2em5bdl.js +13 -0
  78. package/dist/transactionRequest-be6a8ea9-CUKWo5mx.js +1117 -0
  79. package/dist/trust-gPypS1O7.js +11 -0
  80. package/dist/xdefi-COVIyGz4.js +38 -0
  81. package/dist/zeal-DxHbDqm0.js +9 -0
  82. package/dist/zerion-BfW0UElc.js +8 -0
  83. package/dist/zodiacpilot-CrId6F4w.js +6 -0
  84. package/package.json +35 -15
  85. package/src/auth/config.ts +0 -2
  86. package/src/components/SignUp.tsx +442 -0
  87. package/src/components/forms/AgreementModal.tsx +88 -0
  88. package/src/components/forms/CaptchaController.tsx +94 -0
  89. package/src/components/forms/CaptchaModal.jsx +171 -0
  90. package/src/components/forms/CaptchaWidget.jsx +146 -0
  91. package/src/components/forms/PasswordChecker.ts +88 -0
  92. package/src/components/forms/SendCodeInput.tsx +149 -0
  93. package/src/components/forms/SignUpFormItem.tsx +704 -0
  94. package/src/components/forms/util/application-api.ts +155 -0
  95. package/src/components/forms/util/auth-api.ts +198 -0
  96. package/src/components/forms/util/auth-util.tsx +346 -0
  97. package/src/components/forms/util/core.ts +493 -0
  98. package/src/components/forms/util/invitation-api.ts +132 -0
  99. package/src/components/forms/util/provider.tsx +603 -0
  100. package/src/components/forms/util/user-api.ts +303 -0
  101. package/src/components/provider/AdfsLoginButton.jsx +38 -0
  102. package/src/components/provider/AlipayLoginButton.jsx +38 -0
  103. package/src/components/provider/AppleLoginButton.jsx +38 -0
  104. package/src/components/provider/AzureADB2CLoginButton.jsx +38 -0
  105. package/src/components/provider/AzureADLoginButton.jsx +38 -0
  106. package/src/components/provider/BaiduLoginButton.jsx +38 -0
  107. package/src/components/provider/BilibiliLoginButton.jsx +37 -0
  108. package/src/components/provider/CasdoorLoginButton.jsx +38 -0
  109. package/src/components/provider/DingTalkLoginButton.jsx +37 -0
  110. package/src/components/provider/DouyinLoginButton.jsx +38 -0
  111. package/src/components/provider/FacebookLoginButton.jsx +37 -0
  112. package/src/components/provider/GitHubLoginButton.jsx +37 -0
  113. package/src/components/provider/GitLabLoginButton.jsx +38 -0
  114. package/src/components/provider/GiteeLoginButton.jsx +34 -0
  115. package/src/components/provider/GoogleLoginButton.jsx +68 -0
  116. package/src/components/provider/InfoflowLoginButton.jsx +38 -0
  117. package/src/components/provider/LarkLoginButton.jsx +38 -0
  118. package/src/components/provider/LinkedInLoginButton.jsx +37 -0
  119. package/src/components/provider/LoginButton.jsx +33 -0
  120. package/src/components/provider/OktaLoginButton.jsx +38 -0
  121. package/src/components/provider/Provider.jsx +3 -0
  122. package/src/components/provider/ProviderButton.jsx +327 -0
  123. package/src/components/provider/QqLoginButton.jsx +31 -0
  124. package/src/components/provider/SelfLoginButton.jsx +47 -0
  125. package/src/components/provider/SlackLoginButton.jsx +38 -0
  126. package/src/components/provider/SteamLoginButton.jsx +38 -0
  127. package/src/components/provider/WeComLoginButton.jsx +34 -0
  128. package/src/components/provider/Web3Auth.jsx +365 -0
  129. package/src/components/provider/WechatLoginButton.jsx +37 -0
  130. package/src/components/provider/WeiboLoginButton.jsx +34 -0
  131. package/src/components/util.tsx +173 -0
  132. package/src/i18n/en/signup.json +48 -0
  133. package/src/i18n/index.ts +17 -0
  134. package/src/index.tsx +6 -1
  135. package/vite.config.ts +33 -25
@@ -0,0 +1,31 @@
1
+ import { by as o, b4 as r, bu as t, bF as i, bH as n, bI as b, bJ as f, bE as d, bz as c, bD as l, D as h, bC as m, i as p, J as I, q as w, bG as x, bA as E, bB as H } from "./Web3Auth-hACKSouN.js";
2
+ const a = `
3
+ @font-face {
4
+ font-family: 'Inter';
5
+ font-style: normal;
6
+ font-weight: 300 600;
7
+ font-display: swap;
8
+ src: url("https://rsms.me/inter/font-files/InterVariable.woff2") format("woff2-variations");
9
+ }
10
+ `;
11
+ export {
12
+ a as InterVar,
13
+ o as ProviderRpcError,
14
+ r as ProviderRpcErrorCode,
15
+ t as bigIntToHex,
16
+ i as chainIdToViemImport,
17
+ n as chainIdValidation,
18
+ b as chainNamespaceValidation,
19
+ f as chainValidation,
20
+ d as createDownloadMessage,
21
+ c as createEIP1193Provider,
22
+ l as ethToWeiBigInt,
23
+ h as fromHex,
24
+ m as isAddress,
25
+ p as isHex,
26
+ I as parseEther,
27
+ w as toHex,
28
+ x as validate,
29
+ E as weiHexToEth,
30
+ H as weiToEth
31
+ };
@@ -0,0 +1,161 @@
1
+ import { bK as p } from "./Web3Auth-hACKSouN.js";
2
+ function _(n, r) {
3
+ for (var i = 0; i < r.length; i++) {
4
+ const e = r[i];
5
+ if (typeof e != "string" && !Array.isArray(e)) {
6
+ for (const s in e)
7
+ if (s !== "default" && !(s in n)) {
8
+ const o = Object.getOwnPropertyDescriptor(e, s);
9
+ o && Object.defineProperty(n, s, o.get ? o : {
10
+ enumerable: !0,
11
+ get: () => e[s]
12
+ });
13
+ }
14
+ }
15
+ }
16
+ return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
17
+ }
18
+ var l = {}, g = {}, f = {};
19
+ Object.defineProperty(f, "__esModule", { value: !0 });
20
+ f.getLowerCase = void 0;
21
+ function m(n) {
22
+ return n && n.toLowerCase();
23
+ }
24
+ f.getLowerCase = m;
25
+ Object.defineProperty(g, "__esModule", { value: !0 });
26
+ g.SafeAppProvider = void 0;
27
+ const w = p, u = f;
28
+ class k extends w.EventEmitter {
29
+ constructor(r, i) {
30
+ super(), this.submittedTxs = /* @__PURE__ */ new Map(), this.safe = r, this.sdk = i;
31
+ }
32
+ async connect() {
33
+ this.emit("connect", { chainId: this.chainId });
34
+ }
35
+ async disconnect() {
36
+ }
37
+ get chainId() {
38
+ return this.safe.chainId;
39
+ }
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ async request(r) {
42
+ const { method: i, params: e = [] } = r;
43
+ switch (i) {
44
+ case "eth_accounts":
45
+ return [this.safe.safeAddress];
46
+ case "net_version":
47
+ case "eth_chainId":
48
+ return `0x${this.chainId.toString(16)}`;
49
+ case "personal_sign": {
50
+ const [t, a] = e;
51
+ if (this.safe.safeAddress.toLowerCase() !== a.toLowerCase())
52
+ throw new Error("The address or message hash is invalid");
53
+ const h = await this.sdk.txs.signMessage(t);
54
+ return ("signature" in h ? h.signature : void 0) || "0x";
55
+ }
56
+ case "eth_sign": {
57
+ const [t, a] = e;
58
+ if (this.safe.safeAddress.toLowerCase() !== t.toLowerCase() || !a.startsWith("0x"))
59
+ throw new Error("The address or message hash is invalid");
60
+ const h = await this.sdk.txs.signMessage(a);
61
+ return ("signature" in h ? h.signature : void 0) || "0x";
62
+ }
63
+ case "eth_signTypedData":
64
+ case "eth_signTypedData_v4": {
65
+ const [t, a] = e, h = typeof a == "string" ? JSON.parse(a) : a;
66
+ if (this.safe.safeAddress.toLowerCase() !== t.toLowerCase())
67
+ throw new Error("The address is invalid");
68
+ const c = await this.sdk.txs.signTypedMessage(h);
69
+ return ("signature" in c ? c.signature : void 0) || "0x";
70
+ }
71
+ case "eth_sendTransaction":
72
+ const s = {
73
+ ...e[0],
74
+ value: e[0].value || "0",
75
+ data: e[0].data || "0x"
76
+ };
77
+ typeof s.gas == "string" && s.gas.startsWith("0x") && (s.gas = parseInt(s.gas, 16));
78
+ const o = await this.sdk.txs.send({
79
+ txs: [s],
80
+ params: { safeTxGas: s.gas }
81
+ });
82
+ return this.submittedTxs.set(o.safeTxHash, {
83
+ from: this.safe.safeAddress,
84
+ hash: o.safeTxHash,
85
+ gas: 0,
86
+ gasPrice: "0x00",
87
+ nonce: 0,
88
+ input: s.data,
89
+ value: s.value,
90
+ to: s.to,
91
+ blockHash: null,
92
+ blockNumber: null,
93
+ transactionIndex: null
94
+ }), o.safeTxHash;
95
+ case "eth_blockNumber":
96
+ return (await this.sdk.eth.getBlockByNumber(["latest"])).number;
97
+ case "eth_getBalance":
98
+ return this.sdk.eth.getBalance([(0, u.getLowerCase)(e[0]), e[1]]);
99
+ case "eth_getCode":
100
+ return this.sdk.eth.getCode([(0, u.getLowerCase)(e[0]), e[1]]);
101
+ case "eth_getTransactionCount":
102
+ return this.sdk.eth.getTransactionCount([(0, u.getLowerCase)(e[0]), e[1]]);
103
+ case "eth_getStorageAt":
104
+ return this.sdk.eth.getStorageAt([(0, u.getLowerCase)(e[0]), e[1], e[2]]);
105
+ case "eth_getBlockByNumber":
106
+ return this.sdk.eth.getBlockByNumber([e[0], e[1]]);
107
+ case "eth_getBlockByHash":
108
+ return this.sdk.eth.getBlockByHash([e[0], e[1]]);
109
+ case "eth_getTransactionByHash":
110
+ let d = e[0];
111
+ try {
112
+ d = (await this.sdk.txs.getBySafeTxHash(d)).txHash || d;
113
+ } catch {
114
+ }
115
+ return this.submittedTxs.has(d) ? this.submittedTxs.get(d) : this.sdk.eth.getTransactionByHash([d]).then((t) => (t && (t.hash = e[0]), t));
116
+ case "eth_getTransactionReceipt": {
117
+ let t = e[0];
118
+ try {
119
+ t = (await this.sdk.txs.getBySafeTxHash(t)).txHash || t;
120
+ } catch {
121
+ }
122
+ return this.sdk.eth.getTransactionReceipt([t]).then((a) => (a && (a.transactionHash = e[0]), a));
123
+ }
124
+ case "eth_estimateGas":
125
+ return this.sdk.eth.getEstimateGas(e[0]);
126
+ case "eth_call":
127
+ return this.sdk.eth.call([e[0], e[1]]);
128
+ case "eth_getLogs":
129
+ return this.sdk.eth.getPastLogs([e[0]]);
130
+ case "eth_gasPrice":
131
+ return this.sdk.eth.getGasPrice();
132
+ case "wallet_getPermissions":
133
+ return this.sdk.wallet.getPermissions();
134
+ case "wallet_requestPermissions":
135
+ return this.sdk.wallet.requestPermissions(e[0]);
136
+ case "safe_setSettings":
137
+ return this.sdk.eth.setSafeSettings([e[0]]);
138
+ default:
139
+ throw Error(`"${r.method}" not implemented`);
140
+ }
141
+ }
142
+ // this method is needed for ethers v4
143
+ // https://github.com/ethers-io/ethers.js/blob/427e16826eb15d52d25c4f01027f8db22b74b76c/src.ts/providers/web3-provider.ts#L41-L55
144
+ send(r, i) {
145
+ r || i("Undefined request"), this.request(r).then((e) => i(null, { jsonrpc: "2.0", id: r.id, result: e })).catch((e) => i(e, null));
146
+ }
147
+ }
148
+ g.SafeAppProvider = k;
149
+ (function(n) {
150
+ Object.defineProperty(n, "__esModule", { value: !0 }), n.SafeAppProvider = void 0;
151
+ var r = g;
152
+ Object.defineProperty(n, "SafeAppProvider", { enumerable: !0, get: function() {
153
+ return r.SafeAppProvider;
154
+ } });
155
+ })(l);
156
+ const b = /* @__PURE__ */ _({
157
+ __proto__: null
158
+ }, [l]);
159
+ export {
160
+ b as i
161
+ };