0

I am trying to read the data on an pda account like so

let pdaData = awaitprogram.account.PdaAccount.fetch(pdaAccount);

But I am getting this error

TypeError: Cannot read properties of undefined (reading 'fetch')
    at /home/jimii/Documents/crew/testProject/instructions/init.ts:106:60
    at Generator.next (<anonymous>)
    at fulfilled (/home/jimii/Documents/crew/testProject/instructions/init.ts:28:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Is this a node error? I am on v18.16.0

2
  • Error means program.account.PdaAccount is undefined. Maybe you meant program.account.pdaAccount.fetch()? With a lowercase p.
    – Serban
    Commented Aug 25, 2023 at 9:49
  • @Serban, you were correct, that was the problem
    – Jimii
    Commented Aug 25, 2023 at 10:31

1 Answer 1

0

Serban pointed out that it should have been a lowercase p.

this error arose when I was importing the IDL and ended up importing the second object, which is the types I think.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.