@strandgeek/chestbox-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

ChestBox NodeJS SDK

Quick Start

Installing

npm i @strandgeek/chestbox-sdk

Example

Usage

const chestbox = new ChestBoxSDK({
  algodClient: <YOUR_ALGO_CLIENT>,
  apiToken: <YOUR_CHESTBOX_PROJECT_TOKEN>,
  minterAccount: algosdk.mnemonicToSecretKey(<MINTER_MNEMONIC>)
})

Note: Make sure your minter account has enough algorands to pay the fees

Claim an Asset to a Player

When you want to give an asset to the player in the game, you call this command

const { assetID } = await chestbox.claimAsset({
  slug: 'super-sword',
  to: <PLAYER_WALLET_ADDRESS>,
})

Complete Claim

After the player opt-in step, you can complete the claim (transfer the token from minter to player wallet)

const result = await chestbox.completeClaimAsset({
  assetID,
})

Package Sidebar

Install

npm i @strandgeek/chestbox-sdk

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

12.2 kB

Total Files

8

Last publish

Collaborators

  • strandgeek