@web3auth/no-modal 11.0.0-beta.0 → 11.0.0-beta.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/lib.cjs/account-linking/index.js +8 -0
- package/dist/lib.cjs/account-linking/react.js +95 -0
- package/dist/lib.cjs/account-linking/rest.js +54 -0
- package/dist/lib.cjs/account-linking/vue.js +98 -0
- package/dist/lib.cjs/base/analytics.js +17 -2
- package/dist/lib.cjs/base/connector/constants.js +2 -0
- package/dist/lib.cjs/base/errors/index.js +48 -0
- package/dist/lib.cjs/base/utils.js +15 -3
- package/dist/lib.cjs/connectors/auth-connector/authConnector.js +501 -70
- package/dist/lib.cjs/connectors/base-evm-connector/baseEvmConnector.js +42 -23
- package/dist/lib.cjs/connectors/base-solana-connector/baseSolanaConnector.js +41 -24
- package/dist/lib.cjs/connectors/metamask-connector/metamaskConnector.js +76 -45
- package/dist/lib.cjs/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +41 -13
- package/dist/lib.cjs/index.js +20 -13
- package/dist/lib.cjs/noModal.js +834 -117
- package/dist/lib.cjs/plugins/wallet-services-plugin/plugin.js +1 -1
- package/dist/lib.cjs/providers/base-provider/baseProvider.js +65 -33
- package/dist/lib.cjs/react/context/useWeb3AuthInnerContextValue.js +43 -20
- package/dist/lib.cjs/react/hooks/useWallets.js +51 -0
- package/dist/lib.cjs/react/hooks/useWeb3AuthConnect.js +2 -2
- package/dist/lib.cjs/react/index.js +2 -0
- package/dist/lib.cjs/react/solana/hooks/useSolanaWallet.js +2 -2
- package/dist/lib.cjs/react/solana/provider.js +7 -1
- package/dist/lib.cjs/react/wagmi/provider.js +37 -5
- package/dist/lib.cjs/types/account-linking/index.d.ts +2 -0
- package/dist/lib.cjs/types/account-linking/interfaces.d.ts +90 -0
- package/dist/lib.cjs/types/account-linking/react.d.ts +19 -0
- package/dist/lib.cjs/types/account-linking/rest.d.ts +9 -0
- package/dist/lib.cjs/types/account-linking/vue.d.ts +20 -0
- package/dist/lib.cjs/types/base/analytics.d.ts +9 -0
- package/dist/lib.cjs/types/base/connector/baseConnector.d.ts +5 -0
- package/dist/lib.cjs/types/base/connector/constants.d.ts +2 -0
- package/dist/lib.cjs/types/base/connector/interfaces.d.ts +51 -6
- package/dist/lib.cjs/types/base/core/IWeb3Auth.d.ts +39 -2
- package/dist/lib.cjs/types/base/errors/index.d.ts +13 -0
- package/dist/lib.cjs/types/base/interfaces.d.ts +3 -1
- package/dist/lib.cjs/types/base/utils.d.ts +7 -1
- package/dist/lib.cjs/types/connectors/auth-connector/authConnector.d.ts +33 -3
- package/dist/lib.cjs/types/connectors/auth-connector/interface.d.ts +77 -2
- package/dist/lib.cjs/types/connectors/base-evm-connector/baseEvmConnector.d.ts +6 -0
- package/dist/lib.cjs/types/connectors/base-solana-connector/baseSolanaConnector.d.ts +6 -0
- package/dist/lib.cjs/types/index.d.ts +1 -0
- package/dist/lib.cjs/types/noModal.d.ts +104 -5
- package/dist/lib.cjs/types/providers/base-provider/baseProvider.d.ts +7 -0
- package/dist/lib.cjs/types/react/hooks/index.d.ts +1 -0
- package/dist/lib.cjs/types/react/hooks/useWallets.d.ts +8 -0
- package/dist/lib.cjs/types/vue/composables/index.d.ts +1 -0
- package/dist/lib.cjs/types/vue/composables/useWallets.d.ts +9 -0
- package/dist/lib.cjs/vue/composables/useWallets.js +52 -0
- package/dist/lib.cjs/vue/composables/useWeb3AuthConnect.js +2 -2
- package/dist/lib.cjs/vue/index.js +2 -0
- package/dist/lib.cjs/vue/solana/composables/useSolanaWallet.js +2 -2
- package/dist/lib.cjs/vue/solana/provider.js +50 -23
- package/dist/lib.cjs/vue/useWeb3AuthInnerContextValue.js +13 -4
- package/dist/lib.cjs/vue/wagmi/provider.js +35 -7
- package/dist/lib.esm/account-linking/index.js +1 -0
- package/dist/lib.esm/account-linking/react.js +74 -0
- package/dist/lib.esm/account-linking/rest.js +51 -0
- package/dist/lib.esm/account-linking/vue.js +78 -0
- package/dist/lib.esm/base/analytics.js +17 -2
- package/dist/lib.esm/base/connector/constants.js +2 -0
- package/dist/lib.esm/base/errors/index.js +48 -1
- package/dist/lib.esm/base/utils.js +16 -4
- package/dist/lib.esm/connectors/auth-connector/authConnector.js +462 -31
- package/dist/lib.esm/connectors/base-evm-connector/baseEvmConnector.js +43 -24
- package/dist/lib.esm/connectors/base-solana-connector/baseSolanaConnector.js +43 -26
- package/dist/lib.esm/connectors/coinbase-connector/coinbaseConnector.js +2 -2
- package/dist/lib.esm/connectors/injected-evm-connector/injectedEvmConnector.js +2 -2
- package/dist/lib.esm/connectors/injected-solana-connector/walletStandardConnector.js +3 -3
- package/dist/lib.esm/connectors/metamask-connector/metamaskConnector.js +80 -49
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/WalletConnectV2Provider.js +2 -2
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/walletConnectV2Connector.js +43 -15
- package/dist/lib.esm/connectors/wallet-connect-v2-connector/wcSolanaWallet.js +1 -1
- package/dist/lib.esm/index.js +4 -3
- package/dist/lib.esm/noModal.js +851 -126
- package/dist/lib.esm/plugins/wallet-services-plugin/plugin.js +3 -3
- package/dist/lib.esm/providers/base-provider/baseProvider.js +68 -38
- package/dist/lib.esm/react/context/useWeb3AuthInnerContextValue.js +45 -21
- package/dist/lib.esm/react/hooks/useWallets.js +33 -0
- package/dist/lib.esm/react/hooks/useWeb3AuthConnect.js +2 -2
- package/dist/lib.esm/react/index.js +1 -0
- package/dist/lib.esm/react/solana/hooks/useSolanaWallet.js +2 -2
- package/dist/lib.esm/react/solana/provider.js +9 -2
- package/dist/lib.esm/react/wagmi/provider.js +39 -7
- package/dist/lib.esm/vue/composables/useCheckout.js +1 -1
- package/dist/lib.esm/vue/composables/useFunding.js +1 -1
- package/dist/lib.esm/vue/composables/useReceive.js +1 -1
- package/dist/lib.esm/vue/composables/useSwap.js +1 -1
- package/dist/lib.esm/vue/composables/useWalletConnectScanner.js +1 -1
- package/dist/lib.esm/vue/composables/useWalletUI.js +1 -1
- package/dist/lib.esm/vue/composables/useWallets.js +35 -0
- package/dist/lib.esm/vue/composables/useWeb3AuthConnect.js +2 -2
- package/dist/lib.esm/vue/index.js +1 -0
- package/dist/lib.esm/vue/solana/composables/useSignAndSendTransaction.js +1 -1
- package/dist/lib.esm/vue/solana/composables/useSignMessage.js +1 -1
- package/dist/lib.esm/vue/solana/composables/useSignTransaction.js +1 -1
- package/dist/lib.esm/vue/solana/composables/useSolanaWallet.js +2 -2
- package/dist/lib.esm/vue/solana/provider.js +51 -24
- package/dist/lib.esm/vue/useWeb3AuthInnerContextValue.js +12 -3
- package/dist/lib.esm/vue/wagmi/provider.js +36 -8
- package/package.json +44 -20
|
@@ -18,6 +18,8 @@ const CONNECTOR_EVENTS = _objectSpread(_objectSpread({}, CONNECTOR_STATUS), {},
|
|
|
18
18
|
CONNECTORS_UPDATED: "connectors_updated",
|
|
19
19
|
MFA_ENABLED: "mfa_enabled",
|
|
20
20
|
REHYDRATION_ERROR: "rehydration_error",
|
|
21
|
+
/** Emitted when the active public `connection` changes without a full reconnect (e.g. account switch). */
|
|
22
|
+
CONNECTION_UPDATED: "connection_updated",
|
|
21
23
|
CONSENT_ACCEPTED: "consent_accepted"
|
|
22
24
|
});
|
|
23
25
|
const CONNECTOR_CATEGORY = {
|
|
@@ -207,6 +207,53 @@ _defineProperty(WalletOperationsError, "messages", {
|
|
|
207
207
|
5201: "Provided chainId is not allowed",
|
|
208
208
|
5202: "This operation is not allowed"
|
|
209
209
|
});
|
|
210
|
+
class AccountLinkingError extends Web3AuthError {
|
|
211
|
+
constructor(code, message, cause) {
|
|
212
|
+
super(code, message, cause);
|
|
213
|
+
Object.defineProperty(this, "name", {
|
|
214
|
+
value: "AccountLinkingError",
|
|
215
|
+
configurable: true
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
static fromCode(code, extraMessage = "", cause) {
|
|
219
|
+
return new AccountLinkingError(code, `${AccountLinkingError.messages[code]}. ${extraMessage}`, cause);
|
|
220
|
+
}
|
|
221
|
+
static requestFailed(extraMessage = "", cause) {
|
|
222
|
+
return AccountLinkingError.fromCode(5401, extraMessage, cause);
|
|
223
|
+
}
|
|
224
|
+
static serverNotConfigured(extraMessage = "", cause) {
|
|
225
|
+
return AccountLinkingError.fromCode(5402, extraMessage, cause);
|
|
226
|
+
}
|
|
227
|
+
static primaryTokenNotAvailable(extraMessage = "", cause) {
|
|
228
|
+
return AccountLinkingError.fromCode(5403, extraMessage, cause);
|
|
229
|
+
}
|
|
230
|
+
static walletProofFailed(extraMessage = "", cause) {
|
|
231
|
+
return AccountLinkingError.fromCode(5404, extraMessage, cause);
|
|
232
|
+
}
|
|
233
|
+
static unsupportedConnector(extraMessage = "", cause) {
|
|
234
|
+
return AccountLinkingError.fromCode(5405, extraMessage, cause);
|
|
235
|
+
}
|
|
236
|
+
static cannotUnlinkActiveAccount() {
|
|
237
|
+
return AccountLinkingError.fromCode(5406);
|
|
238
|
+
}
|
|
239
|
+
static accountNotLinked(message = "", cause) {
|
|
240
|
+
return AccountLinkingError.fromCode(5407, message, cause);
|
|
241
|
+
}
|
|
242
|
+
static cannotUnlinkPrimaryAccount() {
|
|
243
|
+
return AccountLinkingError.fromCode(5408);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
_defineProperty(AccountLinkingError, "messages", {
|
|
247
|
+
5000: "Custom",
|
|
248
|
+
5401: "Account linking request failed",
|
|
249
|
+
5402: "Citadel server URL is not configured",
|
|
250
|
+
5403: "Primary identity token is not available",
|
|
251
|
+
5404: "Failed to obtain wallet proof token",
|
|
252
|
+
5405: "Connector is not supported for wallet linking",
|
|
253
|
+
5406: "Cannot unlink active account",
|
|
254
|
+
5407: "Account not linked",
|
|
255
|
+
5408: "Cannot unlink primary account"
|
|
256
|
+
});
|
|
210
257
|
class WalletProviderError extends Web3AuthError {
|
|
211
258
|
constructor(code, message, cause) {
|
|
212
259
|
// takes care of stack and proto
|
|
@@ -240,4 +287,4 @@ _defineProperty(WalletProviderError, "messages", {
|
|
|
240
287
|
5303: "'args.params' must be an object or array if provided."
|
|
241
288
|
});
|
|
242
289
|
|
|
243
|
-
export { WalletInitializationError, WalletLoginError, WalletOperationsError, WalletProviderError, Web3AuthError };
|
|
290
|
+
export { AccountLinkingError, WalletInitializationError, WalletLoginError, WalletOperationsError, WalletProviderError, Web3AuthError };
|
|
@@ -12,8 +12,8 @@ const isHexStrict = hex => {
|
|
|
12
12
|
const dashboardPublicApiUrl = buildEnv => {
|
|
13
13
|
return DASHBOARD_PUBLIC_API_MAP[buildEnv];
|
|
14
14
|
};
|
|
15
|
-
const citadelServerUrl = buildEnv => {
|
|
16
|
-
return CITADEL_SERVER_MAP[buildEnv
|
|
15
|
+
const citadelServerUrl = (buildEnv = BUILD_ENV.PRODUCTION) => {
|
|
16
|
+
return CITADEL_SERVER_MAP[buildEnv];
|
|
17
17
|
};
|
|
18
18
|
const fetchProjectConfig = async ({
|
|
19
19
|
clientId,
|
|
@@ -149,7 +149,7 @@ const getWalletServicesAnalyticsProperties = walletServicesConfig => {
|
|
|
149
149
|
ws_default_portfolio: walletServicesConfig === null || walletServicesConfig === void 0 || (_walletServicesConfig10 = walletServicesConfig.whiteLabel) === null || _walletServicesConfig10 === void 0 ? void 0 : _walletServicesConfig10.defaultPortfolio
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
|
-
const sdkVersion = "11.0.0-beta.
|
|
152
|
+
const sdkVersion = "11.0.0-beta.2";
|
|
153
153
|
const getErrorAnalyticsProperties = error => {
|
|
154
154
|
try {
|
|
155
155
|
const code = error instanceof Web3AuthError ? error.code : error === null || error === void 0 ? void 0 : error.code;
|
|
@@ -184,4 +184,16 @@ const getCaipChainId = chain => {
|
|
|
184
184
|
return `${chain.chainNamespace}:${chain.chainId}`;
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Parse the chain namespace from the citadel response
|
|
189
|
+
* @param chainNamespace - The chain namespace from the citadel response
|
|
190
|
+
* @returns The parsed chain namespace
|
|
191
|
+
*/
|
|
192
|
+
const parseChainNamespaceFromCitadelResponse = chainNamespace => {
|
|
193
|
+
if (chainNamespace === "evm") {
|
|
194
|
+
return CHAIN_NAMESPACES.EIP155;
|
|
195
|
+
}
|
|
196
|
+
return chainNamespace;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export { citadelServerUrl, dashboardPublicApiUrl, fetchProjectConfig, fetchWalletRegistry, fromViemChain, fromWagmiChain, getAaAnalyticsProperties, getCaipChainId, getErrorAnalyticsProperties, getHostname, getWalletServicesAnalyticsProperties, getWhitelabelAnalyticsProperties, isBrowser, isHexStrict, normalizeWalletName, parseChainNamespaceFromCitadelResponse, sdkVersion, withAbort };
|