aeternity / aepp-sdk-js

JavaScript SDK for the æternity blockchain
http://docs.aeternity.com/aepp-sdk-js/
ISC License
120 stars 59 forks source link

Still fetching from `nodes` when using wallet #1676

Open nikita-fuchs opened 2 years ago

nikita-fuchs commented 2 years ago

When leaving out nodes from the SDK params, I get an error fetching the chain height, although the wallet was initialised.

This can be reproduced in this branch, I've set debugger points which show how the address is being fetched, plus the balance (testnet node url is hardcoded in there, my bad), but when the height is to be fetched, an error is thrown. Whereas if you uncomment the disabled nodes code in https://github.com/nikita-fuchs/nftminter/blob/still_fetching_from_nodeURL/src/app/services/aeternity.service.ts#L74, everything works fine.

davidyuk commented 2 years ago

This would work if you pass connectNode option to connectToWallet https://github.com/nikita-fuchs/nftminter/blob/2e5c0580618dda710ae2bd097e6fc38f6a140501/src/app/services/aeternity.service.ts#L98 https://docs.aeternity.com/aepp-sdk-js/v12.1.3/api/classes/AeSdkAepp.html#connectToWallet

nikita-fuchs commented 2 years ago

But this should not be necessary? The wallet has a connection to a node, it doesn't need to get one passed in order to work.

davidyuk commented 2 years ago

This is how it is implemented now, proxying requests through wallet a bit more difficult to implement, but we will consider this