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 support for superrare NFT #5496

Closed
jeluard opened this Issue Aug 14, 2018 · 10 comments

Comments

4 participants
@jeluard
Copy link
Member

commented Aug 14, 2018

User Story

As a user, I want to have access to my SuperRare digital art in my Status wallet.

Description

Type: Feature

Pixura/SuperRare is the next participant in Status' incubator program. SuperRare will have a public chat inside Status and will be added to the list of curated DApps.

If a user owns SuperRare NFTs, he should be able to see them in his wallet and have access to basic details for each.

Expected behavior

I purchase digital art on SuperRare, and the next time I open my wallet, I can see a count of my SuperRare tokens alongside my other collectibles.

When I click in, I can view my full SuperRare collection with basic metadata for each piece, e.g. name and description.

Actual behavior

SuperRare tokens aren't supported by the Status wallet.

Additional Information

SuperRare solidity file

https://api.pixura.io/graphql can be used to get all collectibles

Example metadata

Mainnet contract address: 0x41a322b28d0ff354040e2cbc676f0320d8c8850d

Ropsten contract address: 0xa42e14b40bb22bc3daaf8ecad9d73bdf44056959

@jeluard jeluard added the wallet label Aug 14, 2018

@jeluard jeluard added this to Next in Core DApps Aug 14, 2018

@jeluard

This comment has been minimized.

Copy link
Member Author

commented Aug 14, 2018

Contract source: https://github.com/Pixura/smart-contracts/blob/master/contracts/SupeRare.sol
Mainnet address: 0x41a322b28d0ff354040e2cbc676f0320d8c8850d
Ropsten address: 0xa42e14b40bb22bc3daaf8ecad9d73bdf44056959

@jeluard

This comment has been minimized.

Copy link
Member Author

commented Aug 14, 2018

NFT MetaData are returned by tokenUri.

An example of returned data is:

{"name":"Barn swallow with attitude",
 "description":"Oil, Canvas",
 "tags":["art"," coo"," test"],
 "image":"https://ipfs.pixura.io/ipfs/QmYMyg1o72odf1C29wxbkeWbcuBeKDT1NwFKai9277RuBD"}

(from https://ipfs.pixura.io/ipfs/QmWVDR4xYaoXpusB5qrj54E4nptoP7EbcKbaM5GrTkx4CB)

@charlescrain

This comment has been minimized.

Copy link

commented Aug 15, 2018

Querying SuperRare's api to get all the collectibles can be done via the graph api endpoint https://api.pixura.io/graphql

Below is an example of querying all the tokens by the owner's ether address.

To explore the available graphql queries, feel free to use https://api.pixura.io/graphiql which is an interactive place to build the queries.

const axios = require('axios');

const collectiblesByAddress = (address) => {
  return {
    query:`{
      collectiblesByOwner: allErc721Tokens(condition: {owner: "${address}"}) {
        collectibles: nodes {
          owner
          tokenId
         tokenImages: superRareSizedImageByTokenId {	
            standard
            thumbnail
          }
          metadata: erc721MetadatumByTokenId {
            metadataUri
            description
            name
            imageUri
          }
          creator: superRareTokenCreatorByTokenId {
            address
          }
          auctionDetails: superRareAuctionDetailByTokenId {
            currentBidder
            currentBid
          }
          marketDetails: superRareMarketDetailByTokenId {
            currentPrice
          }
        }
      }
    }`
  };
}

async function main() {
  // Notice :: The address does not have `0x` and is completely lowercase.
  const address = "ec8c1050b45789f9ee4d09dcc7d64aaf9e233338";
  // Building the query object.
  const gqlQuery = collectiblesByAddress(address);

  const GRAPHQL_ENDPOINT = `https://api.pixura.io/graphql`;
  try {
    const cRes = await axios.post(GRAPHQL_ENDPOINT, gqlQuery);
    console.log(JSON.stringify(cRes.data, null, 2));
  } catch(e) {
    console.log('Oh no an error!', e);
  }

}

main();
@charlescrain

This comment has been minimized.

Copy link

commented Aug 15, 2018

Let me know if there are any questions 😄

@rachelhamlin rachelhamlin moved this from Next to To Do / Features in Core DApps Aug 17, 2018

@flexsurfer flexsurfer self-assigned this Aug 23, 2018

@jeluard jeluard moved this from To Do / Features to In progress in Core DApps Aug 27, 2018

@jeluard jeluard assigned jeluard and unassigned flexsurfer Aug 27, 2018

@charlescrain

This comment has been minimized.

Copy link

commented Aug 27, 2018

@jeluard I updated the example to have a tokenImages property so you can get images not served from IPFS

jeluard added a commit that referenced this issue Aug 29, 2018

jeluard added a commit that referenced this issue Aug 29, 2018

jeluard added a commit that referenced this issue Aug 29, 2018

jeluard added a commit that referenced this issue Aug 29, 2018

jeluard added a commit that referenced this issue Aug 29, 2018

@jeluard jeluard moved this from In progress to Done in Core DApps Aug 29, 2018

jeluard added a commit that referenced this issue Aug 30, 2018

jeluard added a commit that referenced this issue Aug 30, 2018

[Fixes #5496] Added SuperRare NFT support
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>

@jeluard jeluard added this to Done in Wallet Maintenance via automation Aug 30, 2018

@alwx

This comment has been minimized.

Copy link
Contributor

commented Nov 5, 2018

@charlescrain it now gives us the following error:

Field \"owner\" is not defined by type Erc721TokenCondition.

Were there any breaking changes made recently?

@charlescrain

This comment has been minimized.

Copy link

commented Nov 7, 2018

Hi @alwx,
it shouldn't have changed, investigating now.

@charlescrain

This comment has been minimized.

Copy link

commented Nov 7, 2018

@alwx @jeluard Can you guys check now? The VM we used ran out of space. My apologies for that.

@charlescrain

This comment has been minimized.

Copy link

commented Nov 7, 2018

@alwx @jeluard I just double checked the graphql in the example i posted and it is working now.

@jeluard

This comment has been minimized.

Copy link
Member Author

commented Nov 8, 2018

Looks like the vm restart fixed it. @charlescrain please reopen if you see any other issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.