Skip to content

Commit

Permalink
Fix: resolve type error in program initialization example (#577)
Browse files Browse the repository at this point in the history
Signed-off-by: alok8bb <[email protected]>
  • Loading branch information
alok8bb authored Oct 21, 2024
1 parent 91dbe8d commit f247c8b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ const wallet = useAnchorWallet();
const provider = new AnchorProvider(connection, wallet, {});
setProvider(provider);

const program = new Program(idl as Idl) as Program<CounterProgram>;
const program = new Program(idl as CounterProgram);

// we can also explicitly mention the provider
const program = new Program(idl as Idl, provider) as Program<CounterProgram>;
const program = new Program(idl as CounterProgram, provider);
```

### Anchor `MethodsBuilder`
Expand Down

0 comments on commit f247c8b

Please sign in to comment.