Skip to content

registry/display: JSONRPC-alt integration#25359

Merged
amnn merged 2 commits intomainfrom
amnn/disp-jsonrpc-alt
Mar 10, 2026
Merged

registry/display: JSONRPC-alt integration#25359
amnn merged 2 commits intomainfrom
amnn/disp-jsonrpc-alt

Conversation

@amnn
Copy link
Copy Markdown
Contributor

@amnn amnn commented Feb 9, 2026

Description

Replicate the GraphQL alt integration for JSONRPC-alt.

Test plan

New E2E tests:

cargo nextest run              \
  -p sui-indexer-alt-e2e-tests \
  --test transactional_tests   \
  -- jsonrpc/objects/display/display_v2

Stack


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@amnn amnn self-assigned this Feb 9, 2026
@amnn amnn requested a review from a team as a code owner February 9, 2026 14:33
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env February 9, 2026 14:33 — with GitHub Actions Inactive
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Mar 10, 2026 8:55pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Mar 10, 2026 8:55pm
sui-kiosk Ignored Ignored Preview Mar 10, 2026 8:55pm

Request Review

@amnn amnn mentioned this pull request Feb 9, 2026
8 tasks
@amnn amnn force-pushed the amnn/disp-jsonrpc-alt branch from 3c2f1a9 to 957c6f4 Compare March 10, 2026 16:49
@amnn amnn force-pushed the amnn/disp-jsonrpc-prep branch from c4b5c6c to b2f6b0c Compare March 10, 2026 16:49
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env March 10, 2026 16:49 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env March 10, 2026 16:49 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/disp-jsonrpc-prep branch from b2f6b0c to 0b4c7a2 Compare March 10, 2026 17:47
@amnn amnn force-pushed the amnn/disp-jsonrpc-alt branch from 957c6f4 to 183e158 Compare March 10, 2026 17:52
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env March 10, 2026 17:52 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@emmazzz emmazzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a clarifying comment. LGTM!

display.set(&cap, "qux", "{bar.baz.qux:json}");
display.set(&cap, "quy", "quy is {bar.baz.qux.quy.val}.");
display.set(&cap, "qu_", "x({bar.baz.qux.val}) y({bar.baz.qux.quy.val}), z({bar.baz.qux.quy.quz.val})?!");
display.set(&cap, "f42", "[42] is {id->[42u64] | 0x00420042u32 :hex}");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff! I didn't know about this syntax and how you can specify df as well as a default fallback value.

public struct Foo has key, store {
id: UID,
deep: Deep<Deep<Deep<Deep<Deep<Deep<Deep<Deep<Deep<Deep<Deep<u8>>>>>>>>>>>,
deep: Deep<Deep<Deep<Deep<
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoa what kind of formatting is this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my way of making it easier to count the number of opening and closing angle braces 😅

"bar": "bar is 42!",
"baz": "baz is true?",
"f42": "[42] is 42004200",
"qu_": null,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice testing that if some part evaluates to None the entire thing becomes None

@amnn amnn force-pushed the amnn/disp-jsonrpc-alt branch from 183e158 to 885b512 Compare March 10, 2026 20:43
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env March 10, 2026 20:43 — with GitHub Actions Inactive
@amnn amnn force-pushed the amnn/disp-jsonrpc-alt branch from 885b512 to b44a52e Compare March 10, 2026 20:46
@amnn amnn requested a review from jessiemongeon1 as a code owner March 10, 2026 20:46
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env March 10, 2026 20:46 — with GitHub Actions Inactive
@github-actions github-actions bot added the Type: Documentation Improvements or additions to documentation label Mar 10, 2026
@amnn amnn force-pushed the amnn/disp-jsonrpc-prep branch from 0b4c7a2 to 36c96ff Compare March 10, 2026 20:46
amnn added 2 commits March 10, 2026 20:47
## Description

Relax the type of `DisplayFieldsResponse` to allow values to be
arbitrary JSON, instead of just strings, so it can support Display v2
fields.

## Test plan

CI
## Description
Replicate the GraphQL alt integration for JSONRPC-alt.

## Test plan

New E2E tests:

```
cargo nextest run              \
  -p sui-indexer-alt-e2e-tests \
  --test transactional_tests   \
  -- jsonrpc/objects/display/display_v2
```
@amnn amnn force-pushed the amnn/disp-jsonrpc-prep branch from 36c96ff to 6cf585d Compare March 10, 2026 20:47
@amnn amnn force-pushed the amnn/disp-jsonrpc-alt branch from b44a52e to 7b15547 Compare March 10, 2026 20:47
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env March 10, 2026 20:47 — with GitHub Actions Inactive
@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env March 10, 2026 20:47 — with GitHub Actions Inactive
@github-actions github-actions bot removed the Type: Documentation Improvements or additions to documentation label Mar 10, 2026
Base automatically changed from amnn/disp-jsonrpc-prep to main March 10, 2026 21:13
@amnn amnn merged commit 056596f into main Mar 10, 2026
77 of 86 checks passed
@amnn amnn deleted the amnn/disp-jsonrpc-alt branch March 10, 2026 21:16
ebmifa added a commit that referenced this pull request Mar 10, 2026
`display_fields` now returns `Json` values (not `String`) after the
Display v2 integration in #25359, but the call site still wrapped the
value in `Json::String(...)`, causing a build failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ebmifa added a commit that referenced this pull request Mar 10, 2026
## Summary

- Fixes build failure introduced by #25359 (Display v2 JSONRPC-alt
integration)
- `display_fields` return type changed from `BTreeMap<String,
Result<String>>` to `BTreeMap<String, Result<Json>>`, but line 194 still
wrapped the value in `Json::String(value)` causing a `mismatched types`
compiler error
- Fix: use `value` directly instead of wrapping in `Json::String()`

## Test plan

- [x] `cargo check -p sui-indexer-alt-jsonrpc` passes
- Build failure:
https://github.com/MystenLabs/sui-operations/actions/runs/22924670856/job/66531926292

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
amnn added a commit that referenced this pull request Mar 11, 2026
## Description

Add support to legacy JSONRPC for Display v2.

## Test plan

New E2E tests:

```
$ cargo nextest run -p sui-json-rpc-tests --test rpc_server_tests
```

## Stack

- #23710 
- #25242
- #25358 
- #25359 

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [x] JSON-RPC: Adds support for Display Registry to JSONRPC: When
`showDisplay` is set, the RPC will look for a `Display<T>` stored in the
Display Registry and will use that as the source of truth for its type's
format. This takes precedence over any Display v1 formats that exist for
this type.
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants