fedimint-web-sdk icon indicating copy to clipboard operation
fedimint-web-sdk copied to clipboard

Feature Request: ID key-value based approach for interacting with multiple federations

Open IroncladDev opened this issue 8 months ago • 2 comments

You can use the joinFederation method to join a federation

The method allows you to pass an optional second parameter (the client name)

joinFederation(inviteCode: string, clientName?: string): Promise<void>

Instead of allowing an arbitrary client name, it would be better to automatically set the clientName to the federation's ID after joining.

An additional listClients method will be needed, to list the IDs of the clients the wasm instance is joined to.

For reference, the fedimint-clientd's typescript library (not to be confused with the Fedimint Web SDK) uses an approach like this.

IroncladDev avatar Mar 31 '25 20:03 IroncladDev

Instead of allowing an arbitrary client name, it would be better to automatically set the clientName to the federation's ID after joining.

this prevents joining the same federation twice 🤷

maan2003 avatar Apr 01 '25 07:04 maan2003

Instead of allowing an arbitrary client name, it would be better to automatically set the clientName to the federation's ID after joining.

this prevents joining the same federation twice 🤷

agree with @IroncladDev this would be better. It's not great that the developer needs to track the mapping from clientName to federation details.

For the default behavior of the library, it doesn't seem like joining the same federation multiple times is that important. The vast majority of use cases involve managing a single user's wallet. We can leave in the clientName for anyone that needs multiple wallets for a single federation

alexlwn123 avatar Apr 04 '25 17:04 alexlwn123