Typechain and GraphQL types for all the Aavegotchi contracts and subgraphs! Import into your dapp for an effortless Aavegotchi dev experience.
- Ready for regular Javacript and browser environments
- Convienient bundle of official addresses / subgraphs
- No-frills setup with
ethers
orweb3
- GraphQL client for querying Aavegotchi subgraphs
- Full developer-friendly TypeScript support
Add to a Node.js project with npm
or yarn
- Browser demo on Codesandbox
$ npm install @pixelcraftstudios/aavegotchi-types
# or
$ yarn add @pixelcraftstudios/aavegotchi-types
import { graphql } from "@pixelcraftstudios/aavegotchi-types";
const chainId = 137;
const urls = graphql.urls.diamond[chainId];
const client = graphql.client();
const main = () => {
const userAddress = "0xfffffffffffffffffffffffffffffff";
const res = await client(`{
aavegotchis(first: 500, where: {
owner: ${userAdd}
}) {
id
name
}
}`);
console.log(res);
};
main();
Token information of a user.
import {
AavegotchiFacet__factory,
getDefaultProvider,
contracts,
} from "@pixelcraftstudios/aavegotchi-types";
const chainId = 137;
const diamond = contracts.addresses[chainId];
const provider = getDefaultProvider();
const aavegotchiFacet = AavegotchiFacet__factory.connect(diamond, provider);
const main = () => {
console.log(aavegotchiFacet);
const tokensOfOwner = await;
};
main();
To add new contracts, simply add the contract info to the .gitmodules file and recompile using npx hardhat compile
. If there are no errors during compilation, the contract is ready to be added.
- For support reach out in Discord
- For issues in the package open an issue on GitHub
https://louper.dev/?address=0x86935F11C86623deC8a25696E1C19a8659CbF95d&network=polygon
https://thegraph.com/explorer/subgraph/aavegotchi/aavegotchi-core-matic?version=current