-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve add(Re)Issuance API #88
Comments
I would go for the second approach: is a bit counter-intuitive the fact the addIn(Re)Issuance methods also add outputs: better to let the user add the asset & token output, eventually if user forgots, we should throw an instructive errore message |
The API is designed like this to prevent the user to make mistakes when adding outputs. This stands ONLY for issuances: I personally prefer the first approach, because I consider adding an issuance/resissuance to a tx not just adding stuff to inputs, but also adding some new output. Now that we are discussing this, I think the correct name for these APIs are |
What if we give some convenience method out of the Pset class that introspect the input and generates the right asset? some pseudocode? const updater = new Updater(ptx)
updater.addInput({ reissuanceOpts: { tokenBlinder, entropy, intialBlindedIssuance }})
updater.addOutput({ asset: ptx.issuance.asset })
updater.addOutput({ asset: ptx.issuance.token }) |
Don't really like this solution mostly because there's no asset filed in the input issuance. Another option could be to have convenience methods AddIssuance/AddReissuance (those already existing), and AddInIssuance/AddInReissuance to add only the input part of the issuance, leaving the output one to the user, like experienced users, what do you think? |
Let's go for updater.addReissuance({
assetOutputs,
tokenOutputs
}) |
Agreed. |
cc @louisinger TLDR: let's rename |
At the moment we force uset to specify one address/amount for each asset issued and token. We should allow to issue and reissue asset to multiple outputs in the same tx.
the API could either change:
addInIssuance
&addInReissuance
addInIssuance
&addInReissuance
only care about adding entropy & assetAssetBlinder?Toughts @altafan @louisinger
The text was updated successfully, but these errors were encountered: