@getpara/cosmos-wallet-connectors 2.0.0-alpha.64 → 2.0.0-alpha.66

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.
@@ -17,7 +17,7 @@ import {
17
17
  getChainInfo,
18
18
  getWallet as grazGetWallet,
19
19
  WALLET_TYPES
20
- } from "@getpara/graz";
20
+ } from "graz";
21
21
  import { useExternalWalletStore } from "../stores/useStore.js";
22
22
  import { rawSecp256k1PubkeyToRawAddress } from "@getpara/web-sdk";
23
23
  import {
@@ -41,17 +41,20 @@ function CosmosExternalWalletProvider({
41
41
  includeWalletVerification,
42
42
  connectionOnly
43
43
  }) {
44
- var _a, _b, _c, _d;
44
+ var _a, _b, _c;
45
45
  const { suggestAndConnectAsync } = useSuggestChainAndConnect();
46
46
  const {
47
47
  data: account,
48
48
  isConnecting,
49
49
  isReconnecting,
50
50
  isConnected
51
- } = useAccount({
52
- chainId: multiChain ? chains.map((c) => c.chainId) : selectedChainId != null ? selectedChainId : "",
53
- multiChain
54
- });
51
+ } = useAccount(
52
+ multiChain ? {
53
+ chainId: chains.map((c) => c.chainId)
54
+ } : selectedChainId ? {
55
+ chainId: [selectedChainId]
56
+ } : void 0
57
+ );
55
58
  const { connectAsync } = useConnect();
56
59
  const { disconnectAsync } = useDisconnect();
57
60
  const { walletType } = useActiveWalletType();
@@ -59,8 +62,8 @@ function CosmosExternalWalletProvider({
59
62
  const updateExternalWalletState = useExternalWalletStore((state) => state.updateState);
60
63
  const isConnectError = useRef(false);
61
64
  const connectedWallet = connectedWalletProp ? para.findWallet(connectedWalletProp.id, connectedWalletProp.type) : null;
62
- const ethAddress = multiChain ? (_b = (_a = account == null ? void 0 : account[selectedChainId]) == null ? void 0 : _a.ethereumHexAddress) == null ? void 0 : _b.toLowerCase() : (_c = account == null ? void 0 : account.ethereumHexAddress) == null ? void 0 : _c.toLowerCase();
63
- const address = multiChain ? (_d = account == null ? void 0 : account[selectedChainId]) == null ? void 0 : _d.bech32Address : account == null ? void 0 : account.bech32Address;
65
+ const ethAddress = (_b = (_a = account == null ? void 0 : account[selectedChainId]) == null ? void 0 : _a.ethereumHexAddress) == null ? void 0 : _b.toLowerCase();
66
+ const address = (_c = account == null ? void 0 : account[selectedChainId]) == null ? void 0 : _c.bech32Address;
64
67
  const isLinkingAccount = useRef(false);
65
68
  const verificationMessage = useRef();
66
69
  const reset = () => __async(this, null, function* () {
@@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
2
2
  import { WalletList } from '../types/Wallet.js';
3
3
  import { CosmosExternalWalletProviderConfig } from './CosmosExternalWalletContext.js';
4
4
  import { ChainInfo } from '@keplr-wallet/types';
5
- import { ConfigureGrazArgs } from '@getpara/graz';
5
+ import { ConfigureGrazArgs } from 'graz';
6
6
  export type ParaCosmosProviderConfig = {
7
7
  wallets: WalletList;
8
8
  chains: ChainInfo[];
@@ -6,7 +6,8 @@ import {
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  import { useMemo } from "react";
8
8
  import { CosmosExternalWalletProvider } from "./CosmosExternalWalletContext.js";
9
- import { GrazProvider } from "@getpara/graz";
9
+ import { ParaGrazConnector } from "@getpara/graz-connector";
10
+ import { GrazProvider } from "graz";
10
11
  function ParaCosmosProvider({
11
12
  children,
12
13
  config,
@@ -26,10 +27,26 @@ function ParaCosmosProvider({
26
27
  }),
27
28
  [walletsWithType, config, internalConfig]
28
29
  );
30
+ const paraConfig = useMemo(
31
+ () => ({
32
+ paraWeb: para
33
+ }),
34
+ [para]
35
+ );
29
36
  return (
30
37
  // Casting Para as any here to avoid ts errors due to the graz version being behind.
31
38
  // TODO: update graz para sdk to current version
32
- /* @__PURE__ */ jsx(GrazProvider, { grazOptions: __spreadValues({ chains, autoReconnect: true, para }, grazProviderProps), children: /* @__PURE__ */ jsx(CosmosExternalWalletProvider, __spreadProps(__spreadValues({}, cosmosExternalWalletProviderProps), { children })) })
39
+ /* @__PURE__ */ jsx(
40
+ GrazProvider,
41
+ {
42
+ grazOptions: __spreadValues({
43
+ chains,
44
+ autoReconnect: true,
45
+ paraConfig: __spreadProps(__spreadValues({}, paraConfig), { connectorClass: ParaGrazConnector })
46
+ }, grazProviderProps),
47
+ children: /* @__PURE__ */ jsx(CosmosExternalWalletProvider, __spreadProps(__spreadValues({}, cosmosExternalWalletProviderProps), { children }))
48
+ }
49
+ )
33
50
  );
34
51
  }
35
52
  export {
@@ -1,7 +1,6 @@
1
- import { useAccount } from '@getpara/graz';
2
- import { MultiChainHookArgs } from '../types/ExternalHooks.js';
1
+ import { useAccount } from 'graz';
3
2
  export type TExternalHooks = {
4
- useAccount: typeof useAccount<MultiChainHookArgs>;
3
+ useAccount: typeof useAccount;
5
4
  };
6
5
  export declare const externalHooks: {
7
6
  useAccount: typeof useAccount;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "../chunk-IV3L3JVM.js";
3
- import { useAccount } from "@getpara/graz";
3
+ import { useAccount } from "graz";
4
4
  const externalHooks = { useAccount };
5
5
  export {
6
6
  externalHooks
@@ -1,4 +1,4 @@
1
- import { UseAccountArgs } from '@getpara/graz';
1
+ import { UseAccountArgs } from 'graz';
2
2
  type ChainId$1 = string | string[];
3
3
  export interface MultiChainHookArgs {
4
4
  chainId?: ChainId$1;
@@ -1,4 +1,4 @@
1
- import { WalletType } from '@getpara/graz';
1
+ import { WalletType } from 'graz';
2
2
  import { type WalletMetadata } from '@getpara/react-common';
3
3
  export type WalletList = (() => WalletWithType)[];
4
4
  export type WalletWithType = {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "../../../chunk-IV3L3JVM.js";
3
3
  import { icon } from "./cosmostationIcon.js";
4
- import { WalletType } from "@getpara/graz";
4
+ import { WalletType } from "graz";
5
5
  import { isMobile } from "@getpara/web-sdk";
6
6
  const cosmostationWallet = () => {
7
7
  return {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "../../../chunk-IV3L3JVM.js";
3
3
  import { icon } from "./keplrIcon.js";
4
- import { WalletType } from "@getpara/graz";
4
+ import { WalletType } from "graz";
5
5
  import { isMobile } from "@getpara/web-sdk";
6
6
  const keplrWallet = () => {
7
7
  return {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "../../../chunk-IV3L3JVM.js";
3
3
  import { icon } from "./leapIcon.js";
4
- import { WalletType } from "@getpara/graz";
4
+ import { WalletType } from "graz";
5
5
  import { isMobile } from "@getpara/web-sdk";
6
6
  const leapWallet = () => {
7
7
  return {
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@getpara/cosmos-wallet-connectors",
3
- "version": "2.0.0-alpha.64",
3
+ "version": "2.0.0-alpha.66",
4
4
  "dependencies": {
5
- "@getpara/react-common": "2.0.0-alpha.64",
6
- "@getpara/web-sdk": "2.0.0-alpha.64",
5
+ "@getpara/graz-connector": "2.0.0-alpha.66",
6
+ "@getpara/react-common": "2.0.0-alpha.66",
7
+ "@getpara/web-sdk": "2.0.0-alpha.66",
7
8
  "@leapwallet/cosmos-social-login-capsule-provider": "^0.0.41",
8
- "starknet": "^6.11.0",
9
9
  "zustand": "^4.5.2",
10
10
  "zustand-sync-tabs": "^0.2.2"
11
11
  },
12
12
  "devDependencies": {
13
- "@getpara/graz": "2.0.0-alpha.5",
14
13
  "@types/react": "^18.0.31",
15
14
  "@types/react-dom": "^18.2.7",
15
+ "graz": "^0.4.1",
16
16
  "typescript": "^5.8.3"
17
17
  },
18
18
  "exports": {
@@ -23,10 +23,10 @@
23
23
  "dist",
24
24
  "package.json"
25
25
  ],
26
- "gitHead": "c55ecfbbd200053ddb78d88c93c597c0f781a6bb",
26
+ "gitHead": "07c8b7b68aa36dec6071e3b3b3a66de2870312c8",
27
27
  "main": "dist/index.js",
28
28
  "peerDependencies": {
29
- "@getpara/graz": ">=2.0.0-alpha.5",
29
+ "graz": ">=0.4.1",
30
30
  "react": ">=18",
31
31
  "react-dom": ">=18"
32
32
  },