@getpara/evm-wallet-connectors 2.0.0-alpha.3 → 2.0.0-dev.1

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { EvmExternalWalletContext } from './providers/EvmExternalWalletContext.js';
2
- export type { EvmExternalWalletContextType, EvmExternalWalletProviderConfig } from './providers/EvmExternalWalletContext.js';
2
+ export type { EvmExternalWalletContextType } from './providers/EvmExternalWalletContext.js';
3
3
  export { ParaEvmProvider } from './providers/ParaEvmContext.js';
4
4
  export type { ParaEvmProviderProps, ParaEvmProviderConfig, ParaWagmiProviderProps } from './providers/ParaEvmContext.js';
5
5
  export * from './wallets/connectors/index.js';
package/dist/index.js CHANGED
@@ -206,10 +206,7 @@ function EvmExternalWalletProvider({
206
206
  message,
207
207
  account: wagmiAddress
208
208
  });
209
- return {
210
- address: wagmiAddress,
211
- signature
212
- };
209
+ return { address: wagmiAddress, signature };
213
210
  } catch (e) {
214
211
  switch (e.name) {
215
212
  case "UserRejectedRequestError": {
@@ -259,13 +256,11 @@ function EvmExternalWalletProvider({
259
256
  }) {
260
257
  var _a;
261
258
  try {
262
- return yield para.loginExternalWallet({
263
- externalWallet: {
264
- address,
265
- type: WalletType.EVM,
266
- provider: connectorName,
267
- withFullParaAuth: walletsWithFullAuth == null ? void 0 : walletsWithFullAuth.includes((_a = walletId == null ? void 0 : walletId.toUpperCase()) != null ? _a : "")
268
- }
259
+ return yield para.externalWalletLogin({
260
+ address,
261
+ type: WalletType.EVM,
262
+ provider: connectorName,
263
+ withFullParaAuth: walletsWithFullAuth == null ? void 0 : walletsWithFullAuth.includes((_a = walletId == null ? void 0 : walletId.toUpperCase()) != null ? _a : "")
269
264
  });
270
265
  } catch (err) {
271
266
  yield disconnectAsync();
@@ -302,9 +297,10 @@ function EvmExternalWalletProvider({
302
297
  updateExternalWalletState({ isConnecting: true });
303
298
  yield disconnectAsync();
304
299
  const walletChainId = yield connector.getChainId();
305
- let authState;
306
300
  let address;
307
301
  let error;
302
+ let userExists = false;
303
+ let isVerified = false;
308
304
  try {
309
305
  const data = yield connectAsync({
310
306
  // If the wallet is already on a supported chain, use that to avoid a chain switch prompt.
@@ -317,8 +313,10 @@ function EvmExternalWalletProvider({
317
313
  address = (_d = data.accounts) == null ? void 0 : _d[0];
318
314
  if (address) {
319
315
  try {
320
- authState = yield login({ address, connectorName: connector.name, walletId: connector.paraDetails.id });
321
- verificationMessage.current = authState.stage === "verify" ? authState.signatureVerificationMessage : void 0;
316
+ const loginResp = yield login({ address, connectorName: connector.name, walletId: connector.paraDetails.id });
317
+ userExists = loginResp.userExists;
318
+ isVerified = loginResp.isVerified;
319
+ verificationMessage.current = loginResp.signatureVerificationMessage;
322
320
  } catch (err) {
323
321
  address = void 0;
324
322
  error = err;
@@ -341,7 +339,7 @@ function EvmExternalWalletProvider({
341
339
  }
342
340
  }
343
341
  updateExternalWalletState({ isConnecting: false });
344
- return { address, authState, error };
342
+ return { address, error, userExists, isVerified };
345
343
  });
346
344
  const connectMobile = (connector, isManualWalletConnect) => __async(this, null, function* () {
347
345
  const _isMobile = isManualWalletConnect !== void 0 ? isManualWalletConnect : isMobile();
package/dist/index.js.br CHANGED
Binary file
package/dist/index.js.gz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/evm-wallet-connectors",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-dev.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,8 +10,8 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@coinbase/wallet-sdk": "4.3.0",
13
- "@getpara/wagmi-v2-connector": "2.0.0-alpha.3",
14
- "@getpara/web-sdk": "2.0.0-alpha.3",
13
+ "@getpara/wagmi-v2-connector": "2.0.0-dev.1",
14
+ "@getpara/web-sdk": "^2.0.0-dev.1",
15
15
  "viem": "2.x",
16
16
  "wagmi": "2.x",
17
17
  "zustand": "^4.5.2",
@@ -23,7 +23,7 @@
23
23
  "test": "vitest run --coverage"
24
24
  },
25
25
  "devDependencies": {
26
- "@getpara/react-common": "2.0.0-alpha.3",
26
+ "@getpara/react-common": "^2.0.0-dev.1",
27
27
  "@types/react": "^18.0.31",
28
28
  "@types/react-dom": "^18.2.7",
29
29
  "typescript": "^5.4.3"
@@ -36,5 +36,5 @@
36
36
  "dist",
37
37
  "package.json"
38
38
  ],
39
- "gitHead": "77a1e04b06258842ca9c81e3db2a2b0092517659"
39
+ "gitHead": "426e843bd6084fb2e5f30ab87b02c79fc2f52832"
40
40
  }