gainlings-sdk
v1.0.22
Published
sdk for thegainlings.io
Readme
Gainlings SDK
Usage
First install the SDK:
npm install gainlings-sdkThen use the SDK:
import { GainlingsSDK, getLatestSeasonContractAddress } from "gainlings-sdk";
// Define the contract addresses
const marketPlaceContractAddress = "0xD0aAfa6B497048EEBC262169a47Ea7c031abDfd0";
const trophyAddress = "0xbDF385aF064503662E27621B0bE37Be21B81bD17";
const RPC = "wss://arb-sepolia.g.alchemy.com/v2/YOUR_ALCHEMY_APIKEY";
async function main() {
// Get the latest season contract address
const latestSeasonContractAddress = await getLatestSeasonContractAddress();
console.log("Latest Season Contract Address: ", latestSeasonContractAddress);
// Create a new GainlingsSDK instance
const gainlingsSdk = new GainlingsSDK(
latestSeasonContractAddress,
trophyAddress,
marketPlaceContractAddress,
RPC
);
// Get the total supply of gainlings
let supply = await gainlingsSdk.gainlingsFactory.getTotalSupply();
console.log("Gainlings Supply: ", supply.toString());
}
main();
