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
  2. Dispatch

Complete Milestone

Player Milestone Completion and Reward Claim.

PreviousMilestone Eligibility CheckNextKinora Player Wrapper

Last updated 1 year ago

To complete a Milestone, players "Act On" the same Lens publication, where the KinoraOpenAction Contract assesses their eligibility to complete and claim the next Milestone on the Quest.

If eligible, it automatically withdraws their ERC20 rewards from your Kinora Escrow Contract instance and/or mints to their wallet any reward ERC721 NFTs, marks the Milestone as complete, and, if there are remaining Milestones in the Quest, allows them to continue with their progress.

Players can only claim their rewards and complete a milestone if they have met all token gated and video metric conditions. See more on how eligibility is verified .

If the Player is completing the final Milestone in a Quest, the contract will also verify the Player as having finished the Quest.

const { txHash, error, errorMessage } = await newDispatch.playerCompleteQuestMilestone("0x012d-0x0106", new ethers.Wallet(process.env.PLAYER_PRIVATE_KEY, polygonProvider));

Player Join Quest Props:

/* The pubId of the invoked Quest. */
pubId: string;

/* Wallet instance for the Player on Polygon Network. */
wallet: ethers.Wallet;

Result Object:

/* The txHash for acting on the Publication and completing the milestone and/or Quest. */
txHash?: `0x${string}`;

/* Boolean to indicate whether an error was encountered during completion and rewards claim. */
error: boolean;

/* Message of the encountered error. */
errorMessage?: string;
here