This Subsquid processor tracks Decentraland Credits activity on the blockchain. It indexes and provides easy access to information about credit grants, consumption, transfers, and validations.
Decentraland Credits are a mechanism to grant users credits that can be used within the Decentraland ecosystem. This squid tracks:
- Credit Grants: When credits are granted to users, including amount and expiration date
- Credit Consumption: How credits are consumed, including partial consumption and the reason
- Credit Transfers: Transfer of credits between users
- Credit Validations: Validation events that verify credit validity
The squid tracks the following entities:
-
CreditGrant
: Records when credits are granted to users- Includes amount, expiration date, and remaining balance
- Tracks status (ACTIVE, EXPIRED, CONSUMED)
-
CreditConsumption
: Tracks credit usage- Links to the original grant
- Records amount consumed and reason
-
CreditValidation
: Records credit validation events- Verifies if credits are still valid
- Includes validation reason if applicable
-
CreditTransfer
: Tracks credit transfers between users- Records from/to addresses
- Links to the original grant
-
Install dependencies:
npm ci
-
Build the project:
npm run build
-
Start the processor:
npm start
After starting the processor, you can query the indexed data using GraphQL at http://localhost:4350/graphql
.
Example query:
query {
creditGrants(where: { status_eq: "ACTIVE" }) {
id
user
amount
remainingAmount
expirationDate
consumptions {
amount
reason
}
}
}
This squid is built using Subsquid framework. For more information about squid development, refer to the Subsquid documentation.
This project is licensed under the MIT License.