kaspanet/rusty-kaspa

subscribeUtxosChanged Method Invalid Types Issue: Throws RuntimeError with Account Object

emochka2007 opened this issue · 1 comments

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

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.