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

aptos.getAccountModules() #576

Open
RosalinaLuma620 opened this issue Nov 12, 2024 · 1 comment · May be fixed by #581
Open

aptos.getAccountModules() #576

RosalinaLuma620 opened this issue Nov 12, 2024 · 1 comment · May be fixed by #581
Labels
bug Something isn't working

Comments

@RosalinaLuma620
Copy link

RosalinaLuma620 commented Nov 12, 2024

🐛 Bug Description

When I use this SDK to build React Front-end , I invoked the function below .

How to reproduce

Code snippet to reproduce

export const getAccountModulesWrapper = async (accountAddress: string) => {
    return await aptos.getAccountModules({
        accountAddress: accountAddress,
        options: {
            limit: 10,
            offset: 1
        }
    })
}

Stack trace / error message
image

So I checked network records .

The api request payload is like ( This is how the SDK translates the aptos.getAccountModules() api to do )
https://api.testnet.aptoslabs.com/v1/accounts/0xf4fd53f1334877ef7aae3241ba87708bf38c618aaa2a22f09e84720fab3328ee/modules?start=11&limit=10

Notice the query params, is start , not offset

so I change the link like this to try
https://api.testnet.aptoslabs.com/v1/accounts/0xf4fd53f1334877ef7aae3241ba87708bf38c618aaa2a22f09e84720fab3328ee/modules?offset=11&limit=10

it worked.

System information

System details:

  • Typescript SDK Version : Version 5.0.4
  • Aptos SDK Version : Version 1.27.1
  • Platform : Mac OS M2

Basically , it's a query params convert issue.

@gregnazario
Copy link
Collaborator

gregnazario commented Nov 14, 2024

Yeah, looks like a bug. Actually amazed it hadn't been hit until now.

Offset is actually a long input, and not just a number to start with, so the PR attached will fix this and the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants