npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

winto-sdk

v1.4.1

Published

Winto SDK for TypeScript

Readme

winto-sdk

Installation

npm install winto-sdk

BackOffice

Load Winto wrappers

import { WintoSDK, AdminWrapper } from "winto-sdk";
import { SolanaProvider } from "@saberhq/solana-contrib";

const wallet = useWallet();
const { connection } = useConnection();

const provider = SolanaProvider.init({
  connection,
  wallet: wallet as any,
  opts: {
    preflightCommitment: "finalized",
    commitment: "finalized",
  },
});
const wintoSDK = WintoSDK.load({ provider });
const adminWrapper = new AdminWrapper(wintoSDK, wallet.publickKey); // wallet.publickKey should be String

initialize

try {
  const tx = await adminWrapper.initialize({
    botWallet: botWalletAddress,
    devWallet: devWalletAddress,
    fundWallet: fundWalletAddress,
    wingsCreator: wingsCreatorAddress,
    freelyTicketNftCreators, // 3 array string [String, String, String]
    winTokenAddress
  });
  const result = await tx.confirm();
  await connection.confirmTransaction(result.signature, "finalized");
} catch (error: any) {
  console.log(error);
  toast.success(<div>{error.name}</div>);
}

update by admin

  const tx = await adminWrapper.updateByAdmin({
    fundWallet: fundWalletAddress,
    wingsCreator: wingsCreatorAddress,
    solAmountForBonusTickets, // sol amount
    tokenAmountForBonusTickets,
    gameBonusTicketAmount,
    freelyTicketNftCreators, // 3 Pubkey array
    freelyTicketAmount, // 3 number array
    freelyTicketNftStakingLockPeriod, // 3 number array
    communityFee, // 1000 = 100%, 255 = 25.5%
    isEmergencyFlag: isEmergency ? true : false
  });

update by dev

  const tx = await adminWrapper.updateByDev({
    botWallet: botWalletAddress,
    wingsCreator: wingsCreatorAddress,
    isEmergencyFlag: isEmergency ? true : false,
    freelyTicketNftCreators, // 3 Pubkey array
  });

update organizer merkle whitelist

  const tx = await adminWrapper.updateOrganizerMerkleWhitelist({
    organizerWhitelistMerkleRoot: organizer_hash,
  });

withdraw $SOL from community PDA

  const tx = await adminWrapper.withdrawPdaSol({
    withdrawAmount, // SOL amount; ex: 2.12
  });

withdraw SPL-Token from community PDA

  const tx = await adminWrapper.withdrawPdaToken({
    withdrawAmount, // token amount; ex: 3.412
  });

get balance of communit pda

  const balance = await adminWrapper.getCommunityPdaInfo();

distribution $WIN to PDAs

  let vaultType; // enum PdaType; Contributors = 0, Airdrop = 1, Dao = 2, P2e = 3,
  const tx = await adminWrapper.assetsDistribution({
    amount,
    vaultType
  });

get global info

  const globalInfo = await adminWrapper.getGlobalInfo(type); // type should be "admin" or "dev"
  /*
  *  there are 3 elements for freely tickets
  *  globalInfo['freelyTicketNftCreators'] = winInfo['freelyTicketNftCreators'];
  *  globalInfo['freelyTicketAmount'] = winInfo['freelyTicketAmount'];
  *  globalInfo['freelyTicketNftStakingPeriod'] = winInfo['freelyTicketNftStakingLockPeriod'];
  *  index 0 is Red, index 1 is white, index 2 is black
  */

withdraw from pda

  let pdaType; // enum PdaType; Contributors = 0, Airdrop = 1, Dao = 2, P2e = 3,
  const tx = await adminWrapper.withdrawFromPda({
    withdrawAmount,
    pdaType
  });

Organizer

import { WintoSDK, OrganizerWrapper } from "winto-sdk";
import { SolanaProvider } from "@saberhq/solana-contrib";

const wallet = useWallet();
const { connection } = useConnection();

const provider = SolanaProvider.init({
  connection,
  wallet: wallet as any,
  opts: {
    preflightCommitment: "finalized",
    commitment: "finalized",
  },
});
const wintoSDK = WintoSDK.load({ provider });
const organizerWrapper = new OrganizerWrapper(wintoSDK, wallet.publickKey);

Create game

  const gameNftAddressList: String[] = ["NFT address for game"]
  const tx = await organizerWrapper.createGame({
    ticketTokenAddress, // Token address to buy tickets
    ticketPrice, // Price per ticket; type - number
    minimumCost, // Minimum cost to end game; type-number
    proof, // Proof of organizer whitelist
    gameTimeStamp,  //Current timestamp in seconds
    duration, // Game duration in seconds
    coinType, // 0 or 1, enum CoinType: SOL or TOKEN
    gameNftAddressList, // array of string address
    wingsType, // wings type; 0: None, 1: Gold, 2: Silver, 3: Bronze
    wingsNftMintAddress
  });

End game

  const gamePda: String = "Game PDA address";
  const tx = await organizerWrapper.endGame({
    randomNumber: [u32;6],// Random 6 numbers in array
    gamePda
  });

Lock Wings NFT

  const mintNft: String = "Wings NFT mint address";
  const tx = await organizerWrapper.lockWingsNft(mintNft);

Unlock Wings NFT

  const mintNft: String = "Wings NFT mint address";
  const tx = await organizerWrapper.unlockWingsNft(mintNft);

Recreate game

  const oldGamePda: String = "Old game PDA address";
  const tx = await organizerWrapper.recreateGame({
    proof, // Proof of organizer whitelist,
    gameTimeStamp, // timestamp in seconds
    oldGamePda, 
    wingsType, // wings type; 0: None, 1: Gold, 2: Silver, 3: Bronze
    wingsNftMintAddress
  });

Organizer get back NFT in cancelled game

  const gamePda: String = "Game PDA address";
  const tx = await organizerWrapper.organizerGetBackNft(gamePda);

Organizer claim game SOL in ended game

  const gamePda: String = "Game PDA address";
  const tx = await organizerWrapper.organizerProcessGameSol(gamePda);

Organizer claim game TOKEN in ended game

  const gamePda: String = "Game PDA address";
  const tx = await organizerWrapper.organizerProcessGameToken(gamePda);

Organizer get game info

  const gamePda: String = "Game PDA address";
  const tx = await organizerWrapper.getGameInfo(gamePda);

User

import { WintoSDK, UserWrapper } from "winto-sdk";
import { SolanaProvider } from "@saberhq/solana-contrib";

const wallet = useWallet();
const { connection } = useConnection();

const provider = SolanaProvider.init({
  connection,
  wallet: wallet as any,
  opts: {
    preflightCommitment: "finalized",
    commitment: "finalized",
  },
});
const wintoSDK = WintoSDK.load({ provider });
const userWrapper = new UserWrapper(wintoSDK, wallet.publickKey);

User claim airdrop $WIN

  const tx = await userWrapper.userClaimAirdropWin({
    rewardType: type // enum RewardType: 0: ClaimAirdrop, 1: GameRewardAirdrop, 2: Dao, 3: Contributors
  });

User bid first on game

  const gamePda = "Game PDA address";
  const tx = await userWrapper.createUserGlobalBidPda({
    ticketAmount: ticketAmount, //Amount that user buy on this bid
    bonusTicketAmount,
    randomNumber, // Random 6 numbers in array
  }, gamePda);

User bid on game

  const gamePda = "Game PDA address";
  const tx = await userWrapper.userGameBid({
    ticketAmount: ticketAmount, //Amount that user buy on this bid
    bonusTicketAmount,
    randomNumber, // Random 6 numbers in array
    bidNumber //Next bid number on game
  }, gamePda);

User withdraw fund from ended game

  const gamePda = "Game PDA address";
  const tx = await userWrapper.userWithdrawFunds(gamePda);

Winner claim NFT from ended game

  const gamePda = "Game PDA address";
  const tx = await userWrapper.winnerClaimNft(gamePda);

stake freely nft

  const freelyNftAddress = "Freely NFT address";
  const tx = await userWrapper.stakeFreelyNft(freelyNftAddress);

unstake freely nft

  const tx = await userWrapper.unstakeFreelyNft();

Get user details

  const userWallet = "User wallet addres address";
  const tx = await userWrapper.getUserInfo(userWallet);

Get My Bid list on specific game

  const tx = await userWrapper.getMyGameBidList(userWallet, gamePda);

Get all bid list on specific game

  const tx = await userWrapper.getGameBidList(gamePda);