-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts: AccountClient
isn't properly typed
#1706
Comments
It is because of: which are saying that the type if an arbitrary index of the accounts array in the IDL, allow the type definition to become the union of all available. |
probably for the same reason, |
the |
it it fixed for you? its not working for me |
ahhh, it works as expected as a chain onto the instruction, e.g.: program
.methods
.initAccount()
.accounts({ ... })
// ... but using it prior to the instruction would cause issues because the typings don't know which instruction has been selected yet to pull the account names for. |
Fixed in #2440 |
Querying for accounts like
program.account.myAccount.fetch(addr)
should return an object that is strictly typed for themyAccount
account type definition.However, the client currently types the object as being the union of properties between all IDL defined account structs.
As seen in the screenshot, the typing on the
listing
account client includes the properties of other account types.The text was updated successfully, but these errors were encountered: