Before proceeding ensure you’ve instantiated the SDK and created an App.
See the Quickstart to get setup.
See the Quickstart to get setup.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Reward Badge
Requires gas
import { ActivityType, RewardType } from "@openformat/sdk";
const params = [
{
// The address of the user who is receiving the badge
receiver: "0x03755352654D73DA06756077Dd7f040ADcE3Fd58",
// A given ID for mission a user completes in your application
id: "complete_quiz",
// The smart contract address of the BADGE you want to reward
address: "0x36db942d490f8091b91e020a8a934040ca426968",
// The amount of badges the receiver address will receive
amount: 1,
// The type of transaction to trigger e.g mint or transfer
actionType: RewardActionType.MINT,
// The type of reward
rewardType: RewardType.BADGE,
// The URI of the badge metadata
uri: "ipfs://",
},
];
await sdk.Reward.trigger(params);