Skip to content
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

Add NFT query api: ListNftApprove #74

Open
elonkusk opened this issue Mar 3, 2022 · 0 comments
Open

Add NFT query api: ListNftApprove #74

elonkusk opened this issue Mar 3, 2022 · 0 comments

Comments

@elonkusk
Copy link
Member

elonkusk commented Mar 3, 2022

Support ListNftApprove:

  • Because some account don't know that it's delegated to approve some of NFT token, so we should support this listing api

  • Input:

          message NftTokenApproveQuery{
            bytes owner_address = 1;
            int32 page_size = 2;
            int32 page_index = 3;
          }
    
  • Output:

          message NftTokenApproveResult{
            bytes owner_address = 1;
            int32 page_size = 2;
            int32 page_index = 3;
            int64 total = 4;
            repeated NftToken tokens= 5;
          }
    
  • How to implement ?

    • In account-token relation, add indexing field for token approve list:

          message NftAccountTokenRelation{
                          bytes approve_head = 7; //point to head of tokenapprove
                          bytes approve_tail = 8;//point to tail of tokenapprove
                          int64 approve_total = 9; //total token
                      }
      
    • Add new account-tokenapprove indexing store with this structure that link to real nft token:

            message NftTokenApproveRelation{
                bytes owner_address = 1;
                bytes token_id = 3;
                bytes next = 8;
                bytes prev = 9;
          }
      
    • when approve/disapprove: modify these structure

    • when listing: load, paging data

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

No branches or pull requests

1 participant