WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"sherif": "^1.0.0",
"simple-git-hooks": "^2.11.1",
"typescript": "5.9.2",
"viem": "2.38.0",
"viem": "https://pkg.pr.new/viem@3a62d00",
"vite-plugin-react-fallback-throttle": "^0.1.1",
"vitest": "^4.0.8",
"vitest-browser-react": "^2.0.2"
Expand Down
18 changes: 16 additions & 2 deletions packages/register-tests/react/src/useReadContract.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { abi } from '@wagmi/test'
import { abi } from '@wagmi/test'
import type { Address } from 'viem'
import { expectTypeOf, test } from 'vitest'
import type { useReadContract } from 'wagmi'
import { useReadContract } from 'wagmi'

import type { ChainId } from './config.js'

Expand All @@ -21,4 +21,18 @@ test('UseReadContractParameters', () => {
args?: readonly [Address] | undefined
chainId?: ChainId | undefined
}>()

const result = useReadContract({
address: '0x',
abi: abi.erc20,
functionName: 'balanceOf',
args: ['0x'],
query: {
select(data) {
expectTypeOf(data).toEqualTypeOf<bigint>()
return data?.toString()
},
},
})
expectTypeOf(result.data).toEqualTypeOf<string | undefined>()
})
4 changes: 2 additions & 2 deletions packages/test/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ export const abi = {
]),
viewOverloads: parseAbi([
'function foo() view returns (int8)',
'function foo(address) view returns (string)',
'function foo(address, address) view returns ((address foo, address bar))',
'function foo(address account) view returns (string)',
'function foo(address a, address b) view returns ((address foo, address bar))',
'function bar() view returns (int8)',
]),
writeOverloads: parseAbi([
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@next/bundle-analyzer": "^14.2.3",
"@tanstack/react-query": "catalog:",
"next": "^16.0.3",
"next": "^16.0.7",
"react": "catalog:",
"react-dom": "catalog:",
"viem": "2.*",
Expand Down
Loading
Loading