thencc / algonautjs

A front end friendly Algorand utility
MIT License
10 stars 1 forks source link

idea: change aw .connect api #82

Closed spencercap closed 11 months ago

spencercap commented 1 year ago

any-wallet thinks of ENABLING and CONNECTING wallets as 2 separate things.

spencercap commented 1 year ago

ideas:

enable

enableWallet('inkey');
enableWallet(WALLET_ID.Pera);
enableWallet(WALLET_ID.Mnemonic, 'twenty five words ...');

connect

let accts = await algonaut.connect('inkey', { 
  src: 'localhost:5200'
});

? should .connect also enable the wallet if its not enabled? what enable really does it sets init params IF connect is called w/out a 2nd init params arg. so... there should only be 1 method for ease for devs and better overall api. thus, get rid of .enable

thus...

setInitParams('inkey', {
  src: 'http://localhost:5200/',
  align: 'center'
});

await a.connect('inkey');
spencercap commented 1 year ago

did most of this work here: https://github.com/thencc/any-wallet/pull/25

left TODO... update algjs to use the latest aw + remove the .connect() api complexity in algjs

spencercap commented 11 months ago

this happened. https://github.com/thencc/algonautjs/commit/b56d59225a92f5662a29a4a9a81824ef28794319