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.lens.xyz/graphql' }),
headers: {
"x-access-token": `Bearer ${authToken}`,
},
cache: new InMemoryCache(),
});
const lensProvider = new ethers.providers.JsonRpcProvider(
"https://lensprovider.com",
232,
);
const newEnvoker = new Envoker({
authedApolloClient: client,
envokerLensAddress: "0xlensprofileaddress",
wallet: new ethers.Wallet(process.env.ENVOKER_PRIVATE_KEY, lensProvider)
});
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) Lens Profile Address of the envoker. You can also pass the profile address later when calling individual functions. */
envokerLensAddress: `0x${string}`;
/* (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