Add clear signing display metadata to the IDL - #409
Conversation
|
Retrofit: labels identical to the renderer's derived |
Rendered output for reviewTo make this JSON diff easier to review, every instruction below is rendered end-to-end through
|
| "display": { | ||
| "kind": "instructionDisplayNode", | ||
| "intent": "Add memo", | ||
| "interpolatedIntent": "Add memo \"${data.memo}\"" |
There was a problem hiding this comment.
For my own information, how do the signers get shown?
There was a problem hiding this comment.
They don't in the interpolatedIntent which is supposed to be this dynamic one-liner summary that doesn't contain all the information.
They should in the intent + fields version which is a static title with some dynamic fields in case the one-liner can't be safely displayed (e.g. the decimals can't be resolved and therefore the sentence can appear ambiguous). This is currently not working because the @codama/dynamic-instructions currently doesn't support it but I'm fixing this here: codama-idl/codama#1065.
There was a problem hiding this comment.
ah gotcha that makes sense, thanks!
This PR enriches the Codama IDL with display metadata for clear signing, per sRFC 39. The
addMemoinstruction gains an intent (Add memo), an interpolated intent quoting the memo text, and labels for the memo argument and the signer remaining accounts.This allows wallets (including hardware wallets such as Ledger) to render human-readable messages for memo instructions via
@codama/dynamic-instructions:Clients were regenerated and are unaffected: renderers pass display metadata through untouched.