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
  • Terminate & Withdraw Props
  • Response Object
  1. SDK Reference
  2. Envoker

Terminate & Withdraw

Emergency Terminate Quest & Withdraw Escrowed Rewards.

This function serves as an emergency measure to retrieve deposited ERC20 rewards from your Kinora Escrow Instance Contract.

Upon activation of this function, your Quest will transition to a Closed status. This cessation prohibits new player entries and halts ongoing milestone completions for existing participants.

const {txHash, error, errorMessage } = await newEnvoker.terminateQuestAndWithdraw(
    1,
);

Terminate & Withdraw Props

/* The Quest Id to close. If you need to find the Quest Id from the Lens Publication Id, you can call getQuestIdFromPublication from the Helpers functions or call getQuestIdFromLensData directly to the KinoraQuestData contract. */
questId: number;

/* (Optional) Existing Kinora Escrow Contract from a previously  Factory instantiation. */
kinoraEscrowContract?: `0x${string}`;

/* (Optional) Wallet instance for Polygon Network. If you have passed the wallet object to the constructor, it is not necessary here. */
wallet?: ethers.Wallet;

Response Object

/* Transaction hash for Quest termination. */
txHash?: string;

/* Boolean to indicate whether an error was encountered during termination. */
error: boolean;

/* Message of the encountered error. */
errorMessage?: string;
PreviousInstantiate New QuestNextDelete Quest

Last updated 1 year ago