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. Envoker

Instantiate Envoker

Create the Envoker Instance.

Initiate the Envoker instance to create a new Quest. These functions eliminate the need for manual encoding of the correct Quest data for the Kinora Open Action, although these operations can also be performed outside the SDK if it aligns better with your Lens App architecture.

import { Envoker } from "kinora-sdk";

const apolloClient = new ApolloClient({
  link: new HttpLink({ uri: 'https://api-v2.lens.dev/' }),
  headers: {
    "x-access-token": `Bearer ${authToken}`,
  },
  cache: new InMemoryCache(),
});

const polygonProvider = new ethers.providers.JsonRpcProvider(
    "https://polygonprovider.com",
    137,
  );

const newEnvoker = new Envoker({
    authedApolloClient: client,
    wallet: new ethers.Wallet(process.env.ENVOKER_PRIVATE_KEY, polygonProvider)
});

Envoker Props:

/* Lens authenticated Apollo Client. This can be the same client used for other Lens interactions within your App. It is used for publishing the Quest to your Lens feed through the SDK.*/
authedApolloClient: ApolloClient<NormalizedCacheObject>;

/* (Optional) Wallet instance for Polygon Network. You can also pass the wallet instance later when calling individual functions. */
wallet?: ethers.Wallet;

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

/* (Optional) Existing Kinora Metrics Contract from a previously  Factory instantiation. */
kinoraMetricsContract?: `0x${string}`;
PreviousEnvokerNextInstantiate New Quest

Last updated 1 year ago