Skip to content

Commit 880a249

Browse files
committed
fix(ui): use viem function names for overloaded getters
1 parent 5b85e23 commit 880a249

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

  • packages/templates/next-export-ui

packages/templates/next-export-ui/src/lib/app.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ export function fnListIds(collectionName: string): string {
1515
}
1616

1717
export function fnGet(collectionName: string): string {
18-
// The generated contract overloads getC(uint256,bool) and getC(uint256).
19-
// Use the full signature to disambiguate for viem encoding/decoding.
20-
return `get${collectionName}(uint256)`;
18+
// viem expects the function name (not full signature) and resolves overloads from args.
19+
return `get${collectionName}`;
2120
}
2221

2322
export function fnCreate(collectionName: string): string {

packages/templates/next-export-ui/test-scaffold/tests/ui/smoke.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ async function assertRoute200(baseUrl, route) {
2626
const u = `${baseUrl}${route}`;
2727
const out = await fetchOrThrow(u);
2828
assert.equal(out.status, 200, `Expected ${u} to return 200, got ${out.status}`);
29+
assert.equal(
30+
out.text.includes('not found on ABI'),
31+
false,
32+
`Route ${u} rendered an ABI lookup error. Check generated UI function names vs ABI overload handling.`
33+
);
2934
}
3035

3136
async function runLiveChecks(root, baseUrl, ths) {

0 commit comments

Comments
 (0)