We've started rolling out display nodes (#26, #27) across the hand-written IDLs of the solana-program org — e.g. token#171 and token-2022#1383 — and real-world usage is starting to surface small gaps in the spec.
Rather than patching the spec one gap at a time, I'd like to use this issue as an umbrella to collect that feedback and batch the changes in a future wave once we have a fuller picture. If you hit a display limitation whilst adding clear-signing metadata to an IDL, please add it below.
Feedback so far
No way to customise the branches of an option type
Option types currently have no display customisation, which makes them awkward to use in interpolated intents. For instance, unwrapLamports on token-2022 takes an Option<u64> amount where None means "the entire balance". If we included the amount in the interpolated intent today, we would end up with:
// Some(1.5 SOL)
Unwrap 1.5 SOL from ...
// None
Unwrap none from ...
The Some branch is fine (the inner number type already carries its own display node) but the None branch renders a lowercase "none" mid-sentence. A custom display value for None — e.g. "all SOL" here — would fix this use-case, but it means extending the spec again so it's probably best batched with whatever else this issue gathers. See the original discussion on token-2022#1383.
More items to be added as comments below as feedback comes in. 🙏
We've started rolling out display nodes (#26, #27) across the hand-written IDLs of the
solana-programorg — e.g. token#171 and token-2022#1383 — and real-world usage is starting to surface small gaps in the spec.Rather than patching the spec one gap at a time, I'd like to use this issue as an umbrella to collect that feedback and batch the changes in a future wave once we have a fuller picture. If you hit a display limitation whilst adding clear-signing metadata to an IDL, please add it below.
Feedback so far
No way to customise the branches of an option type
Option types currently have no display customisation, which makes them awkward to use in interpolated intents. For instance,
unwrapLamportson token-2022 takes anOption<u64>amount whereNonemeans "the entire balance". If we included the amount in the interpolated intent today, we would end up with:The
Somebranch is fine (the inner number type already carries its own display node) but theNonebranch renders a lowercase "none" mid-sentence. A custom display value forNone— e.g. "all SOL" here — would fix this use-case, but it means extending the spec again so it's probably best batched with whatever else this issue gathers. See the original discussion on token-2022#1383.More items to be added as comments below as feedback comes in. 🙏