Skip to content

feat(wallet): Advanced Solana NFT gallery support (frontend desktop changes) #16276

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

Closed
wants to merge 17 commits into from

Conversation

muliswilliam
Copy link
Contributor

@muliswilliam muliswilliam commented Dec 7, 2022

Resolves brave/brave-browser#27129

Submitter Checklist:

  • I confirm that no security/privacy review is needed, or that I have requested one
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Solana.NFT.Metadata.mov

nvonpentz and others added 17 commits December 6, 2022 10:25
…ion_decoder to new solana_data_decoder_utils
Also:

* Add missing return JsonRpcService::GetMetaplexMetadata

* Add addition test to solana data decoder utils unittest
Instead of constantly casing on an CoinType argument to choose the
correct error (ProviderError or SolanaProviderError), use an integer
value and cast at the end.
* Make it clear which function is for SOL and ETH by reading the function
name alone

* Rename FetchMetadataToken to FetchMetadata which is slightly more
intuitive
* Revert "Address feedback: Separate some decode functions from
  solana_instruction_decoder to new solana_data_decoder_utils"
  (af24b30).

* Guards against out of bounds access in DecodeMetadataUri and add a
  test for that case

* Do not use reinterpret_cast
* Remove unused solana_instruction_data_decoder.h heade in
  json_rpc_service.cc

* Rename functions
  - JsonRpcService::OnGetTokenUri2 -> JsonRpcService::OnGetEthTokenUri
  - NftMetadataFetcher::OnGetTokenUriTokenMetadata
    -> NftMetadataFetcher::JsonRpcService::OnGetEthTokenUri
  - NftMetadataFetcher::OnGetSupportsInterfaceTokenMetadata
    -> NftMetadataFetcher::OnGetSupportsInterface

* Reorganize functions in nft_metadata_fetcher.h

* Remove VLOG(0) debug line in json_rpc_service_unittest.cc

* Revert change to SetInterceptor() in json_rpc_service_unittest.cc that
  is no longer relevant

* Add comment explaining GetTokenMetadataIntermediateCallback purpose

* Remove commented code in nft_metadata_fetcher_unittest.cc

* Remove unused import added to solana_instruction_data_decoder_unittest.cc

* Resolve TODO comment by adding missing GetEthTokenUri test case
* Rename nft_account_address -> token_mint_address

* Add comment with link to documentation for deriving nft metadata
  accounts

* Revert change: continue using kInvalidParams instead of kInternalError
  in the case that the network URL is invalid for JsonRpcService::GetEthTokenUri

* Do not call std::move() on when passing error type

* Do not use a const reference for metadata seed constant string

* Make sure the int error value is valid before sending via mojo

* Use "base::Base64Decode(account_info->data)" syntax since it's easier
  to read

* Use const reference for vector of bytes input to
  NftMetadataFetcher::DecodeMetadataUri function

* Move DecodeUint32 in anonymous namespace in c++ instead of a member
  function
@github-actions github-actions bot added the CI/storybook-url Deploy storybook and provide a unique URL for each build label Dec 7, 2022
@bsclifton bsclifton deleted the feat-solana-nft-metadata-frontend branch February 27, 2025 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Advanced Solana NFT gallery support (frontend desktop changes)
2 participants