Skip to content

Commit

Permalink
fix: useAccount and useConnection hooks ts type bug (#1294)
Browse files Browse the repository at this point in the history
Co-authored-by: tingzhao.ytz <tingzhao.ytz@antgroup.com>
  • Loading branch information
yutingzhao1991 and tingzhao.ytz authored Dec 24, 2024
1 parent 74f9e96 commit 703f16a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-poets-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ant-design/web3': patch
---

fix: useAccount and useConnection hooks ts type bug
4 changes: 3 additions & 1 deletion packages/web3/src/hooks/useAccount.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { ConfigConsumerProps } from '@ant-design/web3-common';

import useProvider from './useProvider';

export default function useAccount() {
export default function useAccount(): Pick<ConfigConsumerProps, 'account'> {
const { account } = useProvider();

return {
Expand Down
4 changes: 3 additions & 1 deletion packages/web3/src/hooks/useConnection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { ConfigConsumerProps } from '@ant-design/web3-common';

import useProvider from './useProvider';

export default function useConnection() {
export default function useConnection(): Pick<ConfigConsumerProps, 'connect' | 'disconnect'> {
const { connect, disconnect } = useProvider();

return {
Expand Down

0 comments on commit 703f16a

Please sign in to comment.