Skip to content

Commit a31c126

Browse files
author
tingzhao.ytz
committed
fix: useAccount and useConnection hooks ts type bug
1 parent 74f9e96 commit a31c126

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.changeset/swift-poets-tell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ant-design/web3': patch
3+
---
4+
5+
fix: useAccount and useConnection hooks ts type bug

packages/web3/src/hooks/useAccount.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import type { ConfigConsumerProps } from '@ant-design/web3-common';
2+
13
import useProvider from './useProvider';
24

3-
export default function useAccount() {
5+
export default function useAccount(): Pick<ConfigConsumerProps, 'account'> {
46
const { account } = useProvider();
57

68
return {

packages/web3/src/hooks/useConnection.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import type { ConfigConsumerProps } from '@ant-design/web3-common';
2+
13
import useProvider from './useProvider';
24

3-
export default function useConnection() {
5+
export default function useConnection(): Pick<ConfigConsumerProps, 'connect' | 'disconnect'> {
46
const { connect, disconnect } = useProvider();
57

68
return {

0 commit comments

Comments
 (0)