@b3dotfun/sdk 0.0.5-alpha.5 → 0.0.5-alpha.6
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/cjs/global-account/react/hooks/index.d.ts +2 -1
- package/dist/cjs/global-account/react/hooks/index.js +3 -1
- package/dist/cjs/global-account/react/hooks/useB3EnsName.js +2 -2
- package/dist/esm/global-account/react/hooks/index.d.ts +2 -1
- package/dist/esm/global-account/react/hooks/index.js +1 -0
- package/dist/esm/global-account/react/hooks/useB3EnsName.js +3 -3
- package/dist/types/global-account/react/hooks/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/global-account/react/hooks/index.ts +2 -1
- package/src/global-account/react/hooks/useB3EnsName.ts +9 -5
|
@@ -3,13 +3,14 @@ export { useAccountWallet } from "./useAccountWallet";
|
|
|
3
3
|
export { useAddTWSessionKey } from "./useAddTWSessionKey";
|
|
4
4
|
export { useAuthentication } from "./useAuthentication";
|
|
5
5
|
export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses";
|
|
6
|
+
export { useB3EnsName } from "./useB3EnsName";
|
|
6
7
|
export { useBestTransactionPath } from "./useBestTransactionPath";
|
|
7
8
|
export { useBsmntProfile } from "./useBsmntProfile";
|
|
8
9
|
export { useChainSwitchWithAction } from "./useChainSwitchWithAction";
|
|
9
10
|
export { useClaim } from "./useClaim";
|
|
10
11
|
export { useConnect } from "./useConnect";
|
|
11
12
|
export { useExchangeRate } from "./useExchangeRate";
|
|
12
|
-
export { type TWSignerWithMetadata
|
|
13
|
+
export { useGetAllTWSigners, type TWSignerWithMetadata } from "./useGetAllTWSigners";
|
|
13
14
|
export { useGetGeo } from "./useGetGeo";
|
|
14
15
|
export { useHandleConnectWithPrivy } from "./useHandleConnectWithPrivy";
|
|
15
16
|
export { useHasMounted } from "./useHasMounted";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useURLParams = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalance = exports.useSiwe = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.useOneBalance = exports.useOnchainName = exports.useNativeBalanceFromRPC = exports.useNativeBalance = exports.useMediaQuery = exports.useIsomorphicLayoutEffect = exports.useIsMobile = exports.useHasMounted = exports.useHandleConnectWithPrivy = exports.useGetGeo = exports.useGetAllTWSigners = exports.useExchangeRate = exports.useConnect = exports.useClaim = exports.useChainSwitchWithAction = exports.useBsmntProfile = exports.useBestTransactionPath = exports.useB3BalanceFromAddresses = exports.useAuthentication = exports.useAddTWSessionKey = exports.useAccountWallet = exports.useAccountAssets = void 0;
|
|
3
|
+
exports.useURLParams = exports.useTokensFromAddress = exports.useTokenPriceWithFallback = exports.useTokenPrice = exports.useTokenFromUrl = exports.useTokenData = exports.useTokenBalancesByChain = exports.useTokenBalance = exports.useSiwe = exports.useSearchParamsSSR = exports.useRouter = exports.useRemoveSessionKey = exports.useQueryBSMNT = exports.useQueryB3 = exports.useOneBalance = exports.useOnchainName = exports.useNativeBalanceFromRPC = exports.useNativeBalance = exports.useMediaQuery = exports.useIsomorphicLayoutEffect = exports.useIsMobile = exports.useHasMounted = exports.useHandleConnectWithPrivy = exports.useGetGeo = exports.useGetAllTWSigners = exports.useExchangeRate = exports.useConnect = exports.useClaim = exports.useChainSwitchWithAction = exports.useBsmntProfile = exports.useBestTransactionPath = exports.useB3EnsName = exports.useB3BalanceFromAddresses = exports.useAuthentication = exports.useAddTWSessionKey = exports.useAccountWallet = exports.useAccountAssets = void 0;
|
|
4
4
|
var useAccountAssets_1 = require("./useAccountAssets");
|
|
5
5
|
Object.defineProperty(exports, "useAccountAssets", { enumerable: true, get: function () { return useAccountAssets_1.useAccountAssets; } });
|
|
6
6
|
var useAccountWallet_1 = require("./useAccountWallet");
|
|
@@ -11,6 +11,8 @@ var useAuthentication_1 = require("./useAuthentication");
|
|
|
11
11
|
Object.defineProperty(exports, "useAuthentication", { enumerable: true, get: function () { return useAuthentication_1.useAuthentication; } });
|
|
12
12
|
var useB3BalanceFromAddresses_1 = require("./useB3BalanceFromAddresses");
|
|
13
13
|
Object.defineProperty(exports, "useB3BalanceFromAddresses", { enumerable: true, get: function () { return useB3BalanceFromAddresses_1.useB3BalanceFromAddresses; } });
|
|
14
|
+
var useB3EnsName_1 = require("./useB3EnsName");
|
|
15
|
+
Object.defineProperty(exports, "useB3EnsName", { enumerable: true, get: function () { return useB3EnsName_1.useB3EnsName; } });
|
|
14
16
|
var useBestTransactionPath_1 = require("./useBestTransactionPath");
|
|
15
17
|
Object.defineProperty(exports, "useBestTransactionPath", { enumerable: true, get: function () { return useBestTransactionPath_1.useBestTransactionPath; } });
|
|
16
18
|
var useBsmntProfile_1 = require("./useBsmntProfile");
|
|
@@ -31,9 +31,9 @@ const useB3EnsName = () => {
|
|
|
31
31
|
const data = await response.json();
|
|
32
32
|
return data;
|
|
33
33
|
}, []);
|
|
34
|
-
return {
|
|
34
|
+
return (0, react_1.useMemo)(() => ({
|
|
35
35
|
registerEns,
|
|
36
36
|
getEns
|
|
37
|
-
};
|
|
37
|
+
}), [registerEns, getEns]);
|
|
38
38
|
};
|
|
39
39
|
exports.useB3EnsName = useB3EnsName;
|
|
@@ -3,13 +3,14 @@ export { useAccountWallet } from "./useAccountWallet";
|
|
|
3
3
|
export { useAddTWSessionKey } from "./useAddTWSessionKey";
|
|
4
4
|
export { useAuthentication } from "./useAuthentication";
|
|
5
5
|
export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses";
|
|
6
|
+
export { useB3EnsName } from "./useB3EnsName";
|
|
6
7
|
export { useBestTransactionPath } from "./useBestTransactionPath";
|
|
7
8
|
export { useBsmntProfile } from "./useBsmntProfile";
|
|
8
9
|
export { useChainSwitchWithAction } from "./useChainSwitchWithAction";
|
|
9
10
|
export { useClaim } from "./useClaim";
|
|
10
11
|
export { useConnect } from "./useConnect";
|
|
11
12
|
export { useExchangeRate } from "./useExchangeRate";
|
|
12
|
-
export { type TWSignerWithMetadata
|
|
13
|
+
export { useGetAllTWSigners, type TWSignerWithMetadata } from "./useGetAllTWSigners";
|
|
13
14
|
export { useGetGeo } from "./useGetGeo";
|
|
14
15
|
export { useHandleConnectWithPrivy } from "./useHandleConnectWithPrivy";
|
|
15
16
|
export { useHasMounted } from "./useHasMounted";
|
|
@@ -3,6 +3,7 @@ export { useAccountWallet } from "./useAccountWallet.js";
|
|
|
3
3
|
export { useAddTWSessionKey } from "./useAddTWSessionKey.js";
|
|
4
4
|
export { useAuthentication } from "./useAuthentication.js";
|
|
5
5
|
export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses.js";
|
|
6
|
+
export { useB3EnsName } from "./useB3EnsName.js";
|
|
6
7
|
export { useBestTransactionPath } from "./useBestTransactionPath.js";
|
|
7
8
|
export { useBsmntProfile } from "./useBsmntProfile.js";
|
|
8
9
|
export { useChainSwitchWithAction } from "./useChainSwitchWithAction.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import bsmntApp from "../../../global-account/bsmnt.js";
|
|
2
2
|
import { B3_AUTH_COOKIE_NAME } from "../../../shared/constants/index.js";
|
|
3
3
|
import Cookies from "js-cookie";
|
|
4
|
-
import { useCallback } from "react";
|
|
4
|
+
import { useCallback, useMemo } from "react";
|
|
5
5
|
export const useB3EnsName = () => {
|
|
6
6
|
const registerEns = useCallback(async (username, message, hash) => {
|
|
7
7
|
if (!bsmntApp.authentication.authenticated) {
|
|
@@ -25,8 +25,8 @@ export const useB3EnsName = () => {
|
|
|
25
25
|
const data = await response.json();
|
|
26
26
|
return data;
|
|
27
27
|
}, []);
|
|
28
|
-
return {
|
|
28
|
+
return useMemo(() => ({
|
|
29
29
|
registerEns,
|
|
30
30
|
getEns
|
|
31
|
-
};
|
|
31
|
+
}), [registerEns, getEns]);
|
|
32
32
|
};
|
|
@@ -3,13 +3,14 @@ export { useAccountWallet } from "./useAccountWallet";
|
|
|
3
3
|
export { useAddTWSessionKey } from "./useAddTWSessionKey";
|
|
4
4
|
export { useAuthentication } from "./useAuthentication";
|
|
5
5
|
export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses";
|
|
6
|
+
export { useB3EnsName } from "./useB3EnsName";
|
|
6
7
|
export { useBestTransactionPath } from "./useBestTransactionPath";
|
|
7
8
|
export { useBsmntProfile } from "./useBsmntProfile";
|
|
8
9
|
export { useChainSwitchWithAction } from "./useChainSwitchWithAction";
|
|
9
10
|
export { useClaim } from "./useClaim";
|
|
10
11
|
export { useConnect } from "./useConnect";
|
|
11
12
|
export { useExchangeRate } from "./useExchangeRate";
|
|
12
|
-
export { type TWSignerWithMetadata
|
|
13
|
+
export { useGetAllTWSigners, type TWSignerWithMetadata } from "./useGetAllTWSigners";
|
|
13
14
|
export { useGetGeo } from "./useGetGeo";
|
|
14
15
|
export { useHandleConnectWithPrivy } from "./useHandleConnectWithPrivy";
|
|
15
16
|
export { useHasMounted } from "./useHasMounted";
|
package/package.json
CHANGED
|
@@ -3,13 +3,14 @@ export { useAccountWallet } from "./useAccountWallet";
|
|
|
3
3
|
export { useAddTWSessionKey } from "./useAddTWSessionKey";
|
|
4
4
|
export { useAuthentication } from "./useAuthentication";
|
|
5
5
|
export { useB3BalanceFromAddresses } from "./useB3BalanceFromAddresses";
|
|
6
|
+
export { useB3EnsName } from "./useB3EnsName";
|
|
6
7
|
export { useBestTransactionPath } from "./useBestTransactionPath";
|
|
7
8
|
export { useBsmntProfile } from "./useBsmntProfile";
|
|
8
9
|
export { useChainSwitchWithAction } from "./useChainSwitchWithAction";
|
|
9
10
|
export { useClaim } from "./useClaim";
|
|
10
11
|
export { useConnect } from "./useConnect";
|
|
11
12
|
export { useExchangeRate } from "./useExchangeRate";
|
|
12
|
-
export { type TWSignerWithMetadata
|
|
13
|
+
export { useGetAllTWSigners, type TWSignerWithMetadata } from "./useGetAllTWSigners";
|
|
13
14
|
export { useGetGeo } from "./useGetGeo";
|
|
14
15
|
export { useHandleConnectWithPrivy } from "./useHandleConnectWithPrivy";
|
|
15
16
|
export { useHasMounted } from "./useHasMounted";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import bsmntApp from "@b3dotfun/sdk/global-account/bsmnt";
|
|
2
2
|
import { B3_AUTH_COOKIE_NAME } from "@b3dotfun/sdk/shared/constants";
|
|
3
3
|
import Cookies from "js-cookie";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import { useCallback, useMemo } from "react";
|
|
5
6
|
|
|
6
7
|
export const useB3EnsName = () => {
|
|
7
8
|
const registerEns = useCallback(
|
|
@@ -38,8 +39,11 @@ export const useB3EnsName = () => {
|
|
|
38
39
|
return data as { name: string };
|
|
39
40
|
}, []);
|
|
40
41
|
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
return useMemo(
|
|
43
|
+
() => ({
|
|
44
|
+
registerEns,
|
|
45
|
+
getEns
|
|
46
|
+
}),
|
|
47
|
+
[registerEns, getEns]
|
|
48
|
+
);
|
|
45
49
|
};
|