@ton/appkit-react 0.0.5-alpha.0 → 0.0.5
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/esm/features/network/hooks/use-block-number.js +18 -0
- package/dist/esm/features/network/hooks/use-block-number.js.map +1 -0
- package/dist/esm/features/network/index.js +1 -0
- package/dist/esm/features/network/index.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/features/network/hooks/use-block-number.d.ts +16 -0
- package/dist/types/features/network/hooks/use-block-number.d.ts.map +1 -0
- package/dist/types/features/network/index.d.ts +1 -0
- package/dist/types/features/network/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/network/hooks/use-block-number.ts +32 -0
- package/src/features/network/index.ts +1 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { GetBlockNumberData, GetBlockNumberErrorType, GetBlockNumberQueryConfig } from '@ton/appkit/queries';
|
|
9
|
+
import type { UseQueryReturnType } from '../../../libs/query';
|
|
10
|
+
export type UseBlockNumberParameters<selectData = GetBlockNumberData> = GetBlockNumberQueryConfig<selectData>;
|
|
11
|
+
export type UseBlockNumberReturnType<selectData = GetBlockNumberData> = UseQueryReturnType<selectData, GetBlockNumberErrorType>;
|
|
12
|
+
/**
|
|
13
|
+
* Hook to get the current masterchain block number
|
|
14
|
+
*/
|
|
15
|
+
export declare const useBlockNumber: <selectData = GetBlockNumberData>(parameters?: UseBlockNumberParameters<selectData>) => UseBlockNumberReturnType<selectData>;
|
|
16
|
+
//# sourceMappingURL=use-block-number.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-block-number.d.ts","sourceRoot":"","sources":["../../../../../src/features/network/hooks/use-block-number.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAIlH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,MAAM,wBAAwB,CAAC,UAAU,GAAG,kBAAkB,IAAI,yBAAyB,CAAC,UAAU,CAAC,CAAC;AAE9G,MAAM,MAAM,wBAAwB,CAAC,UAAU,GAAG,kBAAkB,IAAI,kBAAkB,CACtF,UAAU,EACV,uBAAuB,CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,GAAG,kBAAkB,EAC1D,aAAY,wBAAwB,CAAC,UAAU,CAAM,KACtD,wBAAwB,CAAC,UAAU,CAIrC,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
+
export { useBlockNumber, type UseBlockNumberParameters, type UseBlockNumberReturnType } from './hooks/use-block-number';
|
|
8
9
|
export { useNetworks, type UseNetworksReturnType } from './hooks/use-networks';
|
|
9
10
|
export { useNetwork, type UseNetworkReturnType } from './hooks/use-network';
|
|
10
11
|
export { useDefaultNetwork, type UseDefaultNetworkReturnType } from './hooks/use-default-network';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/network/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,WAAW,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/network/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,cAAc,EAAE,KAAK,wBAAwB,EAAE,KAAK,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,WAAW,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,KAAK,2BAA2B,EAAE,MAAM,6BAA6B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ton/appkit-react",
|
|
3
|
-
"version": "0.0.5
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"clsx": "2.1.1",
|
|
37
37
|
"radix-ui": "^1.4.3",
|
|
38
38
|
"rosetta": "1.1.0",
|
|
39
|
-
"@ton/appkit": "0.0.4
|
|
39
|
+
"@ton/appkit": "0.0.4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@storybook/addon-docs": "10.2.8",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) TonTech.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { getBlockNumberQueryOptions } from '@ton/appkit/queries';
|
|
10
|
+
import type { GetBlockNumberData, GetBlockNumberErrorType, GetBlockNumberQueryConfig } from '@ton/appkit/queries';
|
|
11
|
+
|
|
12
|
+
import { useAppKit } from '../../../hooks/use-app-kit';
|
|
13
|
+
import { useQuery } from '../../../libs/query';
|
|
14
|
+
import type { UseQueryReturnType } from '../../../libs/query';
|
|
15
|
+
|
|
16
|
+
export type UseBlockNumberParameters<selectData = GetBlockNumberData> = GetBlockNumberQueryConfig<selectData>;
|
|
17
|
+
|
|
18
|
+
export type UseBlockNumberReturnType<selectData = GetBlockNumberData> = UseQueryReturnType<
|
|
19
|
+
selectData,
|
|
20
|
+
GetBlockNumberErrorType
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Hook to get the current masterchain block number
|
|
25
|
+
*/
|
|
26
|
+
export const useBlockNumber = <selectData = GetBlockNumberData>(
|
|
27
|
+
parameters: UseBlockNumberParameters<selectData> = {},
|
|
28
|
+
): UseBlockNumberReturnType<selectData> => {
|
|
29
|
+
const appKit = useAppKit();
|
|
30
|
+
|
|
31
|
+
return useQuery(getBlockNumberQueryOptions(appKit, parameters));
|
|
32
|
+
};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
// Hooks
|
|
10
|
+
export { useBlockNumber, type UseBlockNumberParameters, type UseBlockNumberReturnType } from './hooks/use-block-number';
|
|
10
11
|
export { useNetworks, type UseNetworksReturnType } from './hooks/use-networks';
|
|
11
12
|
export { useNetwork, type UseNetworkReturnType } from './hooks/use-network';
|
|
12
13
|
export { useDefaultNetwork, type UseDefaultNetworkReturnType } from './hooks/use-default-network';
|