Skip to content

[Bug]: useAccount returns incomplete account data (missing owner, executable, data) #111

@resourcefulmind

Description

@resourcefulmind

Steps to Reproduce

import { useAccount } from "@solana/react-hooks";

// Fetch Token Program account
const account = useAccount("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");

console.log(account);
// Result:
// {
// lamports: 8468205194,
// owner: null, // ❌ Should be BPFLoaderUpgradeab1e...
// executable: null, // ❌ Should be true
// data: null // ❌ Should contain program bytecode
// }## Expected Behavior

For the Token Program, useAccount should return:

  • lamports: 8468205194 ✅
  • owner: BPFLoaderUpgradeab1e11111111111111111111111
  • executable: true
  • data: program bytecode (or at least data length)

Actual behavior

Actual Behavior

Only lamports is populated. All other fields are null.

Test Results

Account lamports owner executable data
System Program 1 null null null
Token Program 8468205194 null null null

Environment

  • @solana/react-hooks: latest
  • Endpoint: devnet
import { useAccount } from "@solana/react-hooks";
// Fetch Token Program account
const account = useAccount("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
console.log(account);
// Result:
// {
// lamports: 8468205194,
// owner: null, // ❌ Should be BPFLoaderUpgradeab1e...
// executable: null, // ❌ Should be true
// data: null // ❌ Should contain program bytecode
// }

Expected behavior

Expected Behavior

For the Token Program, useAccount should return:

  • lamports: 8468205194 ✅
  • owner: BPFLoaderUpgradeab1e11111111111111111111111
  • executable: true
  • data: program bytecode (or at least data length)

Actual Behavior

Only lamports is populated. All other fields are null.

Test Results

Account lamports owner executable data
System Program 1 null null null
Token Program 8468205194 null null null

Environment

Environment

  • @solana/react-hooks: latest
  • Endpoint: devnet

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions