NUT-29: add method field for mint and melt quotes, web socket notifications #378
Labels
No labels
breaking change
bug
documentation
enhancement
needs discussion
needs implementation
new nut
ready
wallet-only
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo-admin/nuts#378
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I think this issue is not Nut29, but is related to the to the the NUT04/NUT05 request and response structs not having the method within the struct. This means that the type can only be know by the the shape or the the endpoint that is being used. The shape fails to be a good way to differentiate in the case of the shape being the same for multiple methods, for example onchain, bolt12 and if we add custom methods the shapes are all the same.
This is specifically an issue for websocket notifications where there is not even the endpoint, so the only option is the shape, so since this is not an option wallets must track what methods map to what subscription ids.
So the suggestion is to add the method name to the struct of the Mint/Melt Quote request and response types.
Ok, I understand the issue in context of WS notifications. Though the wallet would have requested a quote ID using a specific method, it then needs to track that method <--> ID mapping so it can figure out how to complete an operation if the update comes via WS.
Yes it is possible to track this, and is what cdk does now. However, I think it is better to make it more explicit what method the struct is for within the struct itself.