Skip to content
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

TypeScript modelsv2 interfaces are incorrect #533

Closed
joe-p opened this issue Mar 4, 2022 · 2 comments
Closed

TypeScript modelsv2 interfaces are incorrect #533

joe-p opened this issue Mar 4, 2022 · 2 comments
Labels
new-bug Bug report that needs triage Team Lamprey

Comments

@joe-p
Copy link
Contributor

joe-p commented Mar 4, 2022

Subject of the issue

I noticed that the TypeScript interface for algosdk.modelsv2.Account is incorrect. The interface uses camel-case keys (createdApps) but the actual object uses hyphenated keys (created-apps).

I haven't thoroughly looked (yet), but I assume this also affects some other algosdk.modelsv2 interfaces. I know for sure there are multiple incorrect keys for algosdk.modelsv2.Account

Your environment

This was seen with 1.13.1 but it appears to be the same in develop

Steps to reproduce

  1. Attempt to get createdApps parameter

Expected behaviour

Following the TypeScript interface (thus documentation/IntelliSense), you'd expect to the get the created apps for that account.

Actual behavior

createdApps property is always undefined

// @ts-ignore must be used followed by the usage of the created-apps key

What do we want the desired behavior to be? I assume we want the actual object to be transformed to use came-case keys to conform with common JavaScript practices.

@joe-p joe-p added the new-bug Bug report that needs triage label Mar 4, 2022
@SilentRhetoric
Copy link

I would like to bump this issue so that the SDK can be more fully utilized to provide typed data responses out of the box for API calls.

@Eric-Warehime
Copy link
Contributor

Yes I agree this is an issue. I think it's going to be resolved when we implement #771 I have an initial PR open working on returning typed responses for all of the client calls. One of the problems (not yet solved in the PR) is converting from the returned keys (with hyphens) to the camel case keys like you're calling out here.

The changes for this will probably end up going into a 3.0.0 version of the SDK since changing return types for client calls can break people not expecting it.

I'm going to close this issue in favor of tracking these in #771 for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-bug Bug report that needs triage Team Lamprey
Projects
None yet
Development

No branches or pull requests

4 participants