eluv-io / elv-live-js

Eluvio Live JavaScript SDK
MIT License
4 stars 3 forks source link

speed up nft_show --show_owners #136

Closed elv-todd closed 1 year ago

elv-todd commented 1 year ago

elv-live performance update:

re: authd endpoint, /nft/info/:addr just shows total

so, we'll need a change there that retrieves owners from the indexer, such as a public api /nft/owners/:contract

here's the format

tokens:
  - warns: []
    tokenId: '1'
    owner: '0x798d20f9ebBE0762752aa7A78B6B53dfC5BB99b2'
    ordinal: '0'
    tokenURI: >-
      https://demov3.net955210.contentfabric.io/s/demov3/q/hq__AzhWCFno6gMkqYA5MFbr3nTnNscYjgTQcMtVDctyXgbB5GJm7wbyejkxSmZcXd1vtnMyWKpBFm/meta/public/nft
    holdSecs: '1686718034'
    holdEnd: 2023-06-14T04:47:14.000Z
  - warns: []
    tokenId: '2'
    owner: '0x798d20f9ebBE0762752aa7A78B6B53dfC5BB99b2'
    ordinal: '1'
    tokenURI: >-
      https://demov3.net955210.contentfabric.io/s/demov3/q/hq__AzhWCFno6gMkqYA5MFbr3nTnNscYjgTQcMtVDctyXgbB5GJm7wbyejkxSmZcXd1vtnMyWKpBFm/meta/public/nft
    holdSecs: '1686718034'
    holdEnd: 2023-06-14T04:47:14.000Z
firstTokenUri: >-
  https://demov3.net955210.contentfabric.io/s/demov3/q/hq__AzhWCFno6gMkqYA5MFbr3nTnNscYjgTQcMtVDctyXgbB5GJm7wbyejkxSmZcXd1vtnMyWKpBFm/meta/public/nft
elv-todd commented 1 year ago

/nft/owners/:contract

the slow command is:

< something something globo >
elv-todd commented 1 year ago

new authd api PR: https://github.com/qluvio/elv-master/pull/1009

elv-live-js PR: https://github.com/eluv-io/elv-live-js/pull/137

 nft_show <addr> [options]

Show info on this NFT

Positionals:
  addr  NFT address (hex)                                    [string] [required]

Options:
      --version                   Show version number                  [boolean]
  -v, --verbose                   Verbose mode                         [boolean]
      --as_url                    Alternate authority service URL (include
                                  '/as/' route if necessary)            [string]
      --help                      Show help                            [boolean]
      --check_minter              Check that all NFTs use this mint helper
      --show_owners               Show up to these many owners (default 0),
                                  loaded from an index. Only used when token_id
                                  is not specified.
      --show_owners_via_contract  Show up to these many owners (default 0),
                                  parsed directly from the contract. Only used
                                  when token_id is not specified.
      --token_id                  External token ID. This will take precedence
                                  over show_owners.                     [string]
elv-todd commented 1 year ago

close as done, reopen after deploy and test with any issues