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}`;

Last updated