KinoraSDK
  • Overview
  • Quickstart
  • Contracts
  • Subgraphs
  • Open Source Code
  • SDK Reference
    • Envoker
      • Instantiate Envoker
      • Instantiate New Quest
      • Terminate & Withdraw
      • Delete Quest
      • Verify Player Milestone
    • Dispatch
      • Instantiate Dispatch
      • Join Quest
      • Milestone Eligibility Check
      • Complete Milestone
    • Kinora Player Wrapper
      • Kinora Provider
      • Kinora Player Wrapper
      • Send Metrics On-Chain
    • Helpers
  • Live
    • Quest No Code
    • Cypher Search
    • Chromadin
  • Architecture
    • Data Corruption Mitigation
  • Resources
    • Issues
    • Testing
    • Contributors
    • About the Devs
    • Storefront
  • Github
  • Livepeer Developer Docs
Powered by GitBook
On this page
  1. SDK Reference

Helpers

Helper Functions for Quest Data Query.

PreviousSend Metrics On-ChainNextQuest No Code

Last updated 1 year ago

The SDK provides a series of helper functions for querying Quest data, however, for more complex and comprehensive queries, it's suggested to create your own from the available .

/* Call all helper functions through the Kinora Instance and have the Kinora Provider set in the router of your app.*/
import { Kinora } from "kinora-sdk";

const kinora = Kinora.getInstance(apolloClient);

/* Get the Live Video Metrics for each video. Pass the same post Id passed to the KinoraPlayerWrapper of the video metrics you'd like to retrieve. It returns the current live session playcount, avd, total duration, total interactions and the most replayed areas as a list of 1 second string segments (in order of most replayed). */
await kinora.getLiveVideoMetrics(postId);

/* Used to retrieve the secondary data interactions of the player with a video post to check if they've met secondary comment / quote metrics on a video. */
await kinora.getPlayerVideoSecondaryData(playerProfileId, postId);

/* Get the Quest Id from it's Lens Publication id and Kinora Quest Data Address from factory instance. */
await kinora.getQuestIdFromPublication(postId, kinoraQuestDataContractAddress);

/* Get all quests completed by a Player and Kinora Quest Data Address from factory instance. */
await kinora.getPlayerCompletedQuests(playerProfileId, kinoraQuestDataContractAddress);

/* Get list of Quests a Player has joined and Kinora Quest Data Address from factory instance. */
await kinora.getPlayerJoinedQuests(playerProfileId, kinoraQuestDataContractAddress);

/* Get all Milestones a Player has completed within a quest and Kinora Quest Data Address from factory instance. */
await kinora.getPlayerQuestMilestonesCompleted(playerProfileId, questId, kinoraQuestDataContractAddress);

/* Get all Video Metric activity of a Player across all videos they've logged metrics for and Kinora Quest Data Address from factory instance. */
await kinora.getPlayerVideoMetricActivity(playerProfileId, kinoraQuestDataContractAddress);

/* Get all details associated with a Player including video and quest history and Kinora Quest Data Address from factory instance. */
await kinora.getPlayerDetails(playerProfileId, kinoraQuestDataContractAddress);

/* Get all the players for a quest and Kinora Quest Data Address from factory instance. */
await kinora.getAllQuestPlayers(questId, kinoraQuestDataContractAddress);

/* Get all quests created by an envoker and Kinora Quest Data Address from factory instance. */
await kinora.getQuestsByEnvoker(envokerProfileId, kinoraQuestDataContractAddress);

/* Get all Kinora created quests. */
await kinora.getAllQuests();

/* Get all Kinora video metrics logged by all Players. */
await kinora.getAllVideoMetrics();

/* Get all Quests that include a Livepeer PlaybackId and Kinora Quest Data Address from factory instance. */
await kinora.getQuestsByPlaybackId(playbackId, kinoraQuestDataContractAddress);

/* Get all Quests that include a Lens Video Post and Kinora Quest Data Address from factory instance. */
await kinora.getQuestsByVideoPost(videoPostId, kinoraQuestDataContractAddress);

/* Get Video activity associated with a Livepeer PlaybackId and Kinora Quest Data Address from factory instance. */
await kinora.getVideoActivityByPlaybackId(playbackId, kinoraQuestDataContractAddress);

/* Get Video activity associated with a Video Post Id and Kinora Quest Data Address from factory instance. */
await kinora.getVideoActivityByVideoPost(videoPostId, kinoraQuestDataContractAddress);

Subgraph schema