ttt-ts-bindings
v0.1.3
Published
TypeScript bindings for Tales and Tokens smart contracts.
Readme
ttt-ts-bindings
TypeScript bindings of T&T's Smart Contracts for ethers.js v6.
Generated by TypeChain Hardhat plugin.
https://github.com/dethcrypto/TypeChain/tree/master/packages/hardhat
Installation
$ npm install ttt-ts-bindingsUsage
import { IGameAccess__factory, IL1NFT__factory, IWorldStore__factory } from "ttt-ts-bindings";
// Game contract
const game = IGameAccess__factory.connect(GAME_ADDRESS, provider);
// WorldStore contract
const worldStoreAddress = await game.getInterfaceAddress("WorldStore");
const worldStore = IWorldStore__factory.connect(worldStoreAddress, provider);
// Base NFT
const baseNftAddress = await worldStore.getTokenContract(WORLD_ID, "BaseNFT");
const baseNft = IL1NFT__factory.connect(baseNftAddress, provider);
// Fetch
const tokenIds = await baseNft.getTokens(ETHEREUM_ACCOUNT_ADDRESS);
console.log(tokenIds);Examples
- https://github.com/TalesAndTokens/ttt-ts-bindings-example
Doc
- Coming soon
- Technical White Paper(Japanese Only)
- https://tales-and-tokens.gitbook.io/technical-whitepaper-vega/introduction/hajimeni
License
MIT License
This repository contains code generated from the interfaces included in OpenZeppelin Contracts and ERC721A.
OpenZeppelin Contracts
https://github.com/OpenZeppelin/openzeppelin-contracts
ERC721A
https://github.com/chiru-labs/ERC721A
