Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
token-2022: Show all extensions (#315)
#### Problem Although the explorer has some support of token-2022, it doesn't show any mint or account extensions, which leads to a lot of confusion for people who create mints. #### Solution Everything is provided with JSON-parsed encoding, so: * create types for all of the JSON-parsed returns * show each extension For the most part, each commit corresponds to an extension, except otherwise noted. I wasn't sure about the best way to display all of these, especially those with many fields, so I went with a little header line before showing each field. Let me know what you think of that. Here are some screenshots of a mint with every extension (minus token group, group member, group pointer, and member pointer): ![image](https://github.com/solana-labs/explorer/assets/934662/7a1e46b5-acb7-49c4-ac50-5a1e647197c3) ![image](https://github.com/solana-labs/explorer/assets/934662/b5a4fb6f-1de1-4708-892f-dc7a2dd1feb2) ![image](https://github.com/solana-labs/explorer/assets/934662/b956f391-3665-4e57-9ba3-4a7a2e69afc1) And an account with all extensions: ![image](https://github.com/solana-labs/explorer/assets/934662/62d738ec-1aa8-4d14-b41e-acd462e9020e) ![image](https://github.com/solana-labs/explorer/assets/934662/9967e50e-5bd4-43a3-947c-c79ee112d920) And in case you care, here's how you can create your own mega-token: ``` set -ex solana-keygen -o mint.json --no-passphrase mint=$(solana-keygen pubkey mint.json) solana-keygen -o source.json --no-passphrase source_pubkey=$(solana-keygen pubkey source.json) spl-token -ul \ create-token \ --enable-close \ --enable-freeze \ --enable-metadata \ --enable-non-transferable \ --enable-permanent-delegate \ --enable-confidential-transfers auto \ --default-account-state initialized \ --interest-rate 5 \ --transfer-fee 10 11 \ --transfer-hook $mint \ --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \ mint.json spl-token -ul initialize-metadata $mint MegaToken MT https://spl.solana.com/token-2022 spl-token -ul update-metadata $mint Mega Token spl-token -ul create-account --immutable $mint source.json spl-token -ul enable-required-transfer-memos "$source_pubkey" spl-token -ul enable-cpi-guard "$source_pubkey" spl-token -ul configure-confidential-transfer-account --address "$source_pubkey" ```
- Loading branch information