Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example given in Rewardable Entities does not compile; missing PublicKey import #1273

Open
ke6jjj opened this issue Apr 22, 2023 · 0 comments
Assignees

Comments

@ke6jjj
Copy link
Contributor

ke6jjj commented Apr 22, 2023

Summary

Example code for retrieving rewards for a Rewardable Entity in slug /solana/rewardable-entites/ is broken due to incomplete import list. Example needs to be updated with proper imports.

Details

The example snippet given to retrieve the retrievable rewards for a Rewardable Entity the slug solana/rewardable-entites/ gives the following snippet:

import { init, lazyDistributorKey } from "@helium/lazy-distributor-sdk";
import { getCurrentRewards } from "@helium/distributor-oracle";
import * as anchor from "@coral-xyz/anchor";

anchor.setProvider(anchor.AnchorProvider.local("...rpc url..."));
const provider = anchor.getProvider() as anchor.AnchorProvider;
const program = await init(provider)

const iotMint = new PublicKey("...iot mint...")

In this snippet, the class PublicKey is referenced in the last line, but it is not imported from any module in the header. Thus, it produces a compilation error:

example.ts:9:21 - error TS2304: Cannot find name 'PublicKey'.

9 const iotMint = new PublicKey("iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants