cashubtc/cashu-ts

`CashuWallet()` wants `keys` and `mint`, `keys` seems redundant

callebtc opened this issue · 6 comments

CashuWallet() wants keys and mint as arguments. Isn'tkeys argument not redundant?

I think it would be nicer to have only one and get the keys, either in the constructor of the CashuMint or (maybe better) when they are needed in CashuWallet (right after step3_Alice afaik).

const mint = new CashuMint(MINTURL);
const keys = await mint.getKeys();
const wallet = new CashuWallet(keys, mint);

I agree

what do you think @gandlafbtc ?

hmm do we still have the option to set the keys from outside the class? I think that's a must.

For now keys is public. I like to make it private soon but i will add a public setter bc we have to recalc the keysetId If we set new keys

why is this closed?

sorry, fat fingers.