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

subscribeUtxosChanged Method Invalid Types Issue: Throws RuntimeError with Account Object #443

Open
emochka2007 opened this issue Mar 26, 2024 · 1 comment

Comments

@emochka2007
Copy link

emochka2007 commented Mar 26, 2024

Describe the bug
When attempting to use the subscribeUtxosChanged method with an Account object, despite the documentation suggesting it accepts either an account object or a string, a runtime error is thrown indicating a memory access out of bounds. This issue occurs when running the method with a new Account(string) as an argument.

To Reproduce
Instantiate an Account object using a string identifier.
derivedAddresses.push(new Address(address))
Call the subscribeUtxosChanged method with the newly created Account object.
await this.wsRpc.subscribeUtxosChanged(addresses)
Error:

RuntimeError: memory access out of bounds
    at null.<anonymous> (wasm://wasm/01be8a16:1:2782986)
    at null.<anonymous> (wasm://wasm/01be8a16:1:4883531)

Expected behavior
The subscribeUtxosChanged method should accept an Account object as its documentation indicates, without throwing a runtime error.

Desktop (please complete the following information):
OS: macOS M2
Environment: WebAssembly version 0.13.5

@aspect
Copy link
Collaborator

aspect commented Apr 22, 2024

Please refer to and use examples from #459. (examples are available in the development WASM SDK release archive at https://kaspa.aspectron.org/nightly/downloads/ source at https://github.com/aspectron/rusty-kaspa/tree/typescript/wasm/examples)

Please note that the Account class is a part of the Wallet API, not Wallet SDK (it only functions with the integrated Wallet class implementation, not with RPC). OTOH while you mention this, your code example subscribes to addresses correctly.

If you still encounter an issue after switching to the updated SDK please cc me here or get help on Discord#development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants