It uses thegraph
Deploy
npm run codegen
npm run deploy:ropsten # or deploy:mainnet
If a new collection in Ethereum is added you will need to add it as following
npx ts-node scripts/importWearableCollection.ts --collection ../../wearable-api/data/collections/{collection_name}/index.json > src/data/wearables/{collection_name}.ts
checkout the docs https://thegraph.com/docs/quick-start
The collection's id
is the smart contract address of the collection.
The item's id
is {collection_contract_address}-{item_blochain_id}
. The item_blockchain_id
is the index of the item in the collection. E.g: if you have a collection with 2 items, the first is 0
and the second one is 1
. Therefore, the id of the first item will be: {contract_address}-0
Ethereum addresses should be passed lowercased:
0xB549B2442b2BD0a53795BC5cDcBFE0cAF7ACA9f8
❌0xb549b2442b2bd0a53795bc5cdcbfe0caf7aca9f8
✅
{
parcels(first: 5) {
id
x
y
owner {
id
}
}
estates(first: 5) {
id
parcels {
id
}
owner {
id
}
}
enss(first: 5) {
id
subdomain
owner {
id
}
}
wearables(first: 5) {
id
owner {
id
}
}
}
Owner's id
is the owner's Ethereum address.
Category could be: parcel
, estate
, ens
, wearable
{
nfts(first: 5) {
id
category
tokenId
owner {
id
}
}
}
{
orders(first: 5) {
id
category
nftAddress
price
buyer
status
nft {
id
}
}
}