Utility Integration
To integrate the SDK with your repository, follow the steps below. The following code snippets provide examples of how to use the SDK functions to interact with the smart contract.
Testnet SDK: streamnft-utility-test Mainnet SDK: streamnft-evm (TBA)
const stream = require('streamnft-utility-test');
//for browser wallets
signer = stream.getWalletSigner();
//for signer using private key
signer= stream.getSigner(chainId, privateKey, rpcUrl); 1. Create Utility Create Utility on any NFT collection
create utility schema with UtilitySchema
const stream = require('streamnft-utility-test');
stream.createUtility(utility, chainId, signer)
.then((result) => {
// Handle the result
})
.catch((error) => {
// Handle the error
});This shall return index of utility created: utilityId
Get All Utility By Collection
Get Utilities present on a collection
Get All Utility By User
Get all Utilities accessible to a wallet
Join Raffle
Join Raffle Type Utility
Claim Reward
Claim reward for giveaways utilities
Claim Utility On NFT
Claim NFT benefit utility
Redeem Utility On NFT
Redeem NFT benefit utility
Check NFT utility
Check if NFT is valid for any utility
Last updated
Was this helpful?