Socket
Book a DemoInstallSign in
Socket

dracula-game-sdk

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

dracula-game-sdk

## Installation

unpublished
latest
npmnpm
Version
0.4.1
Version published
Maintainers
1
Created
Source

dracula-game-sdk

Installation

npm install dracula-game-sdk

Load Dracula Game adapter

const { connection } = useConnection();
const { publicKey, sendTransaction } = useWallet();

const provider = new Provider(connection, useWallet() as any, {
  preflightCommitment: "confirmed",
});

const config: GameConfig = {
  mint: new PublicKey(process.env.MINT_PUBKEY)
}

// initialize Game adapter
const adapter = new GameAdapter(provider, config);
await adapter.build();

// initialize player
const player = new Player(adapter);
const playerState = await player.getState();
const gameItems = await player.getGameItems();

Sign & send transaction w/ connected wallet

try {
  const tx = await player.stakeHuman(mint);
  let signature = await sendTransaction(tx, connection);
  await connection.confirmTransaction(signature, "confirmed");
} catch (err) {
  // handle custom program error code
}

Player APIs

await player.stakeHuman(mint);
await player.unstakeHuman(mint);
await player.gambleHuman(mint);
await player.harvestHuman(mint);
await player.stakeVampire(mint);
await player.unstakeVampire(mint);
await player.gambleVampire(mint);
await player.harvestVampire(mint);
await player.claimRewards();

FAQs

Package last updated on 22 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts