This subgraph indexes for v2 architecture (using graph for all data storage)
- To generate the subgraph.yaml file
# requires mustache to be install
$ npm install -g mustache
# for mainnet
$ npm run prepare:mainnet
# for testnet
$ npm run prepare:testnet
- Generate types for current contract
$ graph codegen
- To compile the mappings
$ graph build
- Add auth token
$ graph auth --product hosted-service <access-token>
- Deploy
$ graph deploy --product hosted-service <username/subgraph name>
- Get all request order by timestamp
{
requests(
orderBy: timestamp
orderDirection: desc
) {
id
requestId
requester
creator {
id
}
amount
description
delivered
}
}
- To get all transfer history for particular token
{
transfers(
where: {
nftContract: "0x123....."
tokenId: 0
}) {
id
from
to
tokenId
cliptoToken {
currentOwner
}
nftContract
eventType
blockNumber
timestamp
}
)
}