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

Error: senderId.replace is not a function #1836

Closed
bogdan-manole opened this issue May 30, 2023 · 3 comments
Closed

Error: senderId.replace is not a function #1836

bogdan-manole opened this issue May 30, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@bogdan-manole
Copy link

Describe the bug
I'm trying to update the SDK to 13 version for DEX-UI. For the desktop everything seems good now.
But I get this error for the mobile workflow: senderId.replace is not a function when trying to call a contract entry point, at line
https://github.com/aeternity/dex-ui/blob/4d62932f1eaf723f056440b6a9af4885a5761cfc/src/store/modules/aeternity.js#L56 .

I had to modify const result = await (isWae ? wae : router)[method].get(...methodArgs); to const result = await (isWae ? wae : router)[method](...methodArgs);

I replaced the old Universal with AeSdk . But more than that I don't know what to do

To Reproduce
Open on your Android phone the dex app served by chore/sdk-13 branch (Also you could use https://pr-497-dex-ui.stg.aepps.com/ , but you will get a slightly different error i.replace instead of senderId.replace might be because of production compiled javascript.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

@bogdan-manole bogdan-manole added the bug Something isn't working label May 30, 2023
@davidyuk
Copy link
Member

In onAccount on options of contract.$call is not right. Its address should be a string property or a getter. In your case it is a functions, sdk pick it, treads as a string, and fails.

@davidyuk
Copy link
Member

at least address: () => address should be replaced with address: address
in general createOnAccountObject should return an instance of AccountBase
https://github.com/aeternity/dex-ui/blob/4d62932f1eaf723f056440b6a9af4885a5761cfc/src/lib/utils.js#L77

@davidyuk
Copy link
Member

This one seems to be solved

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

No branches or pull requests

2 participants