@cometh/connect-react-hooks 0.0.5 → 0.0.6-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.cjs CHANGED
@@ -13,7 +13,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
13
13
 
14
14
 
15
15
 
16
-
17
16
  var _connectsdk4337 = require('@cometh/connect-sdk-4337');
18
17
  var _wagmi = require('wagmi');
19
18
  async function createSmartAccount(config) {
@@ -21,6 +20,7 @@ async function createSmartAccount(config) {
21
20
  bundlerUrl,
22
21
  paymasterUrl,
23
22
  apiKey,
23
+ chain,
24
24
  rpcUrl,
25
25
  baseUrl,
26
26
  comethSignerConfig,
@@ -29,6 +29,7 @@ async function createSmartAccount(config) {
29
29
  } = config;
30
30
  const account = await _connectsdk4337.createSafeSmartAccount.call(void 0, {
31
31
  apiKey,
32
+ chain,
32
33
  rpcUrl,
33
34
  baseUrl,
34
35
  smartAccountAddress,
@@ -36,7 +37,6 @@ async function createSmartAccount(config) {
36
37
  comethSignerConfig,
37
38
  safeContractConfig
38
39
  });
39
- const chain = await _connectsdk4337.getNetwork.call(void 0, account.getConnectApi());
40
40
  let client;
41
41
  if (paymasterUrl) {
42
42
  const paymasterClient = await _connectsdk4337.createComethPaymasterClient.call(void 0, {
@@ -1797,6 +1797,7 @@ var useGetGasPrice = (rpcUrl, queryProps) => {
1797
1797
 
1798
1798
  var useRetrieveAccountAddressFromPasskeys = ({
1799
1799
  apiKey,
1800
+ chain,
1800
1801
  baseUrl
1801
1802
  }) => {
1802
1803
  const [isPending, setIsPending] = _react.useState.call(void 0, false);
@@ -1807,6 +1808,7 @@ var useRetrieveAccountAddressFromPasskeys = ({
1807
1808
  try {
1808
1809
  const result = await _connectsdk4337.retrieveAccountAddressFromPasskeys.call(void 0,
1809
1810
  apiKey,
1811
+ chain,
1810
1812
  baseUrl
1811
1813
  );
1812
1814
  const address = result;
@@ -1827,6 +1829,7 @@ var useRetrieveAccountAddressFromPasskeys = ({
1827
1829
  };
1828
1830
  var useRetrieveAccountAddressFromPasskeyId = ({
1829
1831
  apiKey,
1832
+ chain,
1830
1833
  baseUrl
1831
1834
  }) => {
1832
1835
  const [isPending, setIsPending] = _react.useState.call(void 0, false);
@@ -1838,6 +1841,7 @@ var useRetrieveAccountAddressFromPasskeyId = ({
1838
1841
  try {
1839
1842
  const result = await _connectsdk4337.retrieveAccountAddressFromPasskeyId.call(void 0, {
1840
1843
  apiKey,
1844
+ chain,
1841
1845
  id,
1842
1846
  baseUrl
1843
1847
  });
package/dist/index.d.cts CHANGED
@@ -596,15 +596,16 @@ declare const useGetGasPrice: (rpcUrl?: string, queryProps?: Omit<UseQueryOption
596
596
 
597
597
  type UseRetrieveAccountAddressFromPasskeyOptions = {
598
598
  apiKey: string;
599
+ chain: Chain;
599
600
  baseUrl?: string;
600
601
  queryProps?: UseQueryParameters;
601
602
  };
602
- declare const useRetrieveAccountAddressFromPasskeys: ({ apiKey, baseUrl, }: UseRetrieveAccountAddressFromPasskeyOptions) => {
603
+ declare const useRetrieveAccountAddressFromPasskeys: ({ apiKey, chain, baseUrl, }: UseRetrieveAccountAddressFromPasskeyOptions) => {
603
604
  retrieveAddress: () => Promise<`0x${string}`>;
604
605
  isPending: boolean;
605
606
  error: Error | null;
606
607
  };
607
- declare const useRetrieveAccountAddressFromPasskeyId: ({ apiKey, baseUrl, }: UseRetrieveAccountAddressFromPasskeyOptions) => {
608
+ declare const useRetrieveAccountAddressFromPasskeyId: ({ apiKey, chain, baseUrl, }: UseRetrieveAccountAddressFromPasskeyOptions) => {
608
609
  retrieveAddress: (id: string) => Promise<`0x${string}`>;
609
610
  isPending: boolean;
610
611
  error: Error | null;
@@ -893,7 +894,6 @@ type UseCancelRecoveryRequestReturn = QueryResultType & {
893
894
  * const handleCancel = async () => {
894
895
  * try {
895
896
  * const result = await cancelRecoveryRequestAsync({
896
- * passKeyName: 'myPassKey',
897
897
  * rpcUrl: 'https://my-rpc-url.com',
898
898
  * // other necessary parameters
899
899
  * });
package/dist/index.d.ts CHANGED
@@ -596,15 +596,16 @@ declare const useGetGasPrice: (rpcUrl?: string, queryProps?: Omit<UseQueryOption
596
596
 
597
597
  type UseRetrieveAccountAddressFromPasskeyOptions = {
598
598
  apiKey: string;
599
+ chain: Chain;
599
600
  baseUrl?: string;
600
601
  queryProps?: UseQueryParameters;
601
602
  };
602
- declare const useRetrieveAccountAddressFromPasskeys: ({ apiKey, baseUrl, }: UseRetrieveAccountAddressFromPasskeyOptions) => {
603
+ declare const useRetrieveAccountAddressFromPasskeys: ({ apiKey, chain, baseUrl, }: UseRetrieveAccountAddressFromPasskeyOptions) => {
603
604
  retrieveAddress: () => Promise<`0x${string}`>;
604
605
  isPending: boolean;
605
606
  error: Error | null;
606
607
  };
607
- declare const useRetrieveAccountAddressFromPasskeyId: ({ apiKey, baseUrl, }: UseRetrieveAccountAddressFromPasskeyOptions) => {
608
+ declare const useRetrieveAccountAddressFromPasskeyId: ({ apiKey, chain, baseUrl, }: UseRetrieveAccountAddressFromPasskeyOptions) => {
608
609
  retrieveAddress: (id: string) => Promise<`0x${string}`>;
609
610
  isPending: boolean;
610
611
  error: Error | null;
@@ -893,7 +894,6 @@ type UseCancelRecoveryRequestReturn = QueryResultType & {
893
894
  * const handleCancel = async () => {
894
895
  * try {
895
896
  * const result = await cancelRecoveryRequestAsync({
896
- * passKeyName: 'myPassKey',
897
897
  * rpcUrl: 'https://my-rpc-url.com',
898
898
  * // other necessary parameters
899
899
  * });
package/dist/index.js CHANGED
@@ -12,8 +12,7 @@ import {
12
12
  ENTRYPOINT_ADDRESS_V07,
13
13
  createComethPaymasterClient,
14
14
  createSafeSmartAccount,
15
- createSmartAccountClient,
16
- getNetwork
15
+ createSmartAccountClient
17
16
  } from "@cometh/connect-sdk-4337";
18
17
  import { http } from "wagmi";
19
18
  async function createSmartAccount(config) {
@@ -21,6 +20,7 @@ async function createSmartAccount(config) {
21
20
  bundlerUrl,
22
21
  paymasterUrl,
23
22
  apiKey,
23
+ chain,
24
24
  rpcUrl,
25
25
  baseUrl,
26
26
  comethSignerConfig,
@@ -29,6 +29,7 @@ async function createSmartAccount(config) {
29
29
  } = config;
30
30
  const account = await createSafeSmartAccount({
31
31
  apiKey,
32
+ chain,
32
33
  rpcUrl,
33
34
  baseUrl,
34
35
  smartAccountAddress,
@@ -36,7 +37,6 @@ async function createSmartAccount(config) {
36
37
  comethSignerConfig,
37
38
  safeContractConfig
38
39
  });
39
- const chain = await getNetwork(account.getConnectApi());
40
40
  let client;
41
41
  if (paymasterUrl) {
42
42
  const paymasterClient = await createComethPaymasterClient({
@@ -1797,6 +1797,7 @@ import {
1797
1797
  import { useCallback as useCallback6, useState as useState7 } from "react";
1798
1798
  var useRetrieveAccountAddressFromPasskeys = ({
1799
1799
  apiKey,
1800
+ chain,
1800
1801
  baseUrl
1801
1802
  }) => {
1802
1803
  const [isPending, setIsPending] = useState7(false);
@@ -1807,6 +1808,7 @@ var useRetrieveAccountAddressFromPasskeys = ({
1807
1808
  try {
1808
1809
  const result = await retrieveAccountAddressFromPasskeys(
1809
1810
  apiKey,
1811
+ chain,
1810
1812
  baseUrl
1811
1813
  );
1812
1814
  const address = result;
@@ -1827,6 +1829,7 @@ var useRetrieveAccountAddressFromPasskeys = ({
1827
1829
  };
1828
1830
  var useRetrieveAccountAddressFromPasskeyId = ({
1829
1831
  apiKey,
1832
+ chain,
1830
1833
  baseUrl
1831
1834
  }) => {
1832
1835
  const [isPending, setIsPending] = useState7(false);
@@ -1838,6 +1841,7 @@ var useRetrieveAccountAddressFromPasskeyId = ({
1838
1841
  try {
1839
1842
  const result = await retrieveAccountAddressFromPasskeyId({
1840
1843
  apiKey,
1844
+ chain,
1841
1845
  id,
1842
1846
  baseUrl
1843
1847
  });
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://twitter.com/slovaye"
8
8
  }
9
9
  ],
10
- "version": "0.0.5",
10
+ "version": "0.0.6-dev.1",
11
11
  "description": "React hooks Connect 4337",
12
12
  "repository": "https://github.com/cometh-game/connect-sdk-4337.git",
13
13
  "keywords": [
@@ -58,7 +58,7 @@
58
58
  "typescript": "^5"
59
59
  },
60
60
  "dependencies": {
61
- "@cometh/connect-sdk-4337": "0.1.5",
61
+ "@cometh/connect-sdk-4337": "0.1.6-dev.1",
62
62
  "permissionless": "0.1.31"
63
63
  }
64
64
  }