Felippo001 / nami-wallet-api

28 stars 16 forks source link

API deprecated #12

Closed ghost closed 2 years ago

ghost commented 2 years ago

This Nami API implementation is deprecated soon. Please follow the API under the window.cardano.nami namespace. For more information check out CIP-30: https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030

rgordon95 commented 2 years ago

this doesnt fix the problem just updates the readme.

ghost commented 2 years ago

it is working fine. the update is that the cardano object has to be used as window.cardano.selectedWallet instead of window.cardano

gglucass commented 2 years ago

I must be daft, but my window.cardano object does not have a selectedWallet method so this wouldn't work @augustineashal ?

Edit: I figured it out for if one wants to implement this just for nami. Then instead of passing window.cardano one should pass a returned object of window.cardano.nami.enable(). This returned object of the Nami library doesn't implement the "isEnabled()" method itself, that's only available on the top level window.cardano.nami object. As such, remove any calls to isEnabled() and enable() from nami-wallet-api and everything should work again fine.

We would probably need to update the library to reflect this.

CyberCyclone commented 2 years ago

Some other aspects have changed, such as getRewardAddress is now getRewardAddresses. This I know breaks the delegate function.

CyberCyclone commented 2 years ago

I've forked and working on fixing based on the CIP:30 changes that I know of relating to the delegate function: https://github.com/CyberCyclone/nami-wallet-api