0.1.3 • Published 23 days ago

ttt-ts-bindings v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
23 days ago

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-bindings

Usage

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

Doc

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

0.1.3

23 days ago

0.1.2

24 days ago

0.1.1

10 months ago

0.1.0

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago