@getpara/cosmos-wallet-connectors 2.0.0-alpha.33 → 2.0.0-alpha.35

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.
@@ -15,7 +15,8 @@ import {
15
15
  useDisconnect,
16
16
  useSuggestChainAndConnect,
17
17
  getChainInfo,
18
- getWallet as grazGetWallet
18
+ getWallet as grazGetWallet,
19
+ WALLET_TYPES
19
20
  } from "@getpara/graz";
20
21
  import { useExternalWalletStore } from "../stores/useStore.js";
21
22
  import { rawSecp256k1PubkeyToRawAddress } from "@getpara/web-sdk";
@@ -159,7 +160,7 @@ function CosmosExternalWalletProvider({
159
160
  const signMessage = (_0) => __async(this, [_0], function* ({ message, externalWallet }) {
160
161
  let wallet, signAddress, signEthAddress;
161
162
  if (externalWallet) {
162
- const commonWallet = wallets.find((w) => w.internalId === externalWallet.providerId);
163
+ const commonWallet = wallets.find((w) => w.id === externalWallet.providerId);
163
164
  wallet = grazGetWallet(commonWallet == null ? void 0 : commonWallet.grazType);
164
165
  signAddress = externalWallet.addressBech32;
165
166
  signEthAddress = externalWallet.address;
@@ -271,21 +272,38 @@ function CosmosExternalWalletProvider({
271
272
  updateExternalWalletState({ isConnecting: false });
272
273
  }
273
274
  });
274
- const getWallet = (walletType2) => incompleteWallets.find((w) => w.grazType === walletType2 || w.grazMobileType === walletType2);
275
+ const injectedWallets = WALLET_TYPES.filter((w) => !incompleteWallets.some((iw) => iw.grazType === w) && checkWallet(w)).map((w) => {
276
+ const wallet = grazGetWallet(w);
277
+ if (!wallet.eip6963ProviderInfo) {
278
+ return void 0;
279
+ }
280
+ const eipInfo = wallet.eip6963ProviderInfo;
281
+ return __spreadValues({
282
+ grazType: w,
283
+ // Using name here for the injected connector since that's the only common id across the networks
284
+ id: eipInfo.name,
285
+ internalId: eipInfo.name,
286
+ iconUrl: eipInfo.icon
287
+ }, eipInfo);
288
+ }).filter((w) => !!w);
289
+ const allWallets = [...incompleteWallets, ...injectedWallets];
290
+ const getWallet = (walletType2) => allWallets.find((w) => w.grazType === walletType2 || w.grazMobileType === walletType2);
275
291
  const getProvider = (walletType2) => {
276
292
  const wallet = getWallet(walletType2);
277
293
  return {
278
294
  provider: wallet == null ? void 0 : wallet.name,
279
- providerId: wallet == null ? void 0 : wallet.internalId
295
+ providerId: wallet == null ? void 0 : wallet.id
280
296
  };
281
297
  };
282
- const wallets = incompleteWallets.map((wallet) => {
298
+ const wallets = allWallets.map((wallet) => {
283
299
  return __spreadProps(__spreadValues({
284
300
  connect: () => connect(wallet.grazType),
285
301
  connectMobile: () => connect(wallet.grazType),
286
302
  getQrUri: () => "",
287
303
  type: "COSMOS"
288
304
  }, wallet), {
305
+ // Using name here since that's the only common id across the networks
306
+ id: wallet.name,
289
307
  installed: checkWallet(wallet.grazType)
290
308
  });
291
309
  }).filter((w) => !!w);
@@ -310,7 +328,7 @@ function CosmosExternalWalletProvider({
310
328
  }), [para, multiChain, chains, selectedChainId]);
311
329
  const requestInfo = (providerId) => __async(this, null, function* () {
312
330
  var _a2;
313
- const wallet = wallets.find((w) => w.internalId === providerId);
331
+ const wallet = wallets.find((w) => w.id === providerId);
314
332
  if (!wallet) {
315
333
  throw new Error(`Wallet for provider ${providerId} not found`);
316
334
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@getpara/cosmos-wallet-connectors",
3
- "version": "2.0.0-alpha.33",
3
+ "version": "2.0.0-alpha.35",
4
4
  "dependencies": {
5
5
  "@getpara/graz": "2.0.0-alpha.3",
6
- "@getpara/react-common": "2.0.0-alpha.33",
7
- "@getpara/web-sdk": "2.0.0-alpha.33",
6
+ "@getpara/react-common": "2.0.0-alpha.35",
7
+ "@getpara/web-sdk": "2.0.0-alpha.35",
8
8
  "@leapwallet/cosmos-social-login-capsule-provider": "^0.0.41",
9
9
  "starknet": "^6.11.0",
10
10
  "zustand": "^4.5.2",
@@ -24,7 +24,7 @@
24
24
  "dist",
25
25
  "package.json"
26
26
  ],
27
- "gitHead": "f338306fa30497d2190f8da2ff72ddd8d9d9032f",
27
+ "gitHead": "abfec8cf9931f7a8469b09b67b5d48eee6f4cfd5",
28
28
  "main": "dist/index.js",
29
29
  "peerDependencies": {
30
30
  "@getpara/graz": "2.0.0-alpha.3",