@@ -27,7 +27,7 @@ import {
2727 Transaction ,
2828 type TransactionInstruction ,
2929} from "@solana/web3.js" ;
30- import type WorldProgram from "../generated" ;
30+ import type { World as WorldProgram } from "../generated/types/world " ;
3131import {
3232 createInitializeRegistryInstruction ,
3333 PROGRAM_ID ,
@@ -155,9 +155,7 @@ export async function AddAuthority({
155155 instruction : TransactionInstruction ;
156156 transaction : Transaction ;
157157} > {
158- const program = new Program (
159- worldIdl as Idl ,
160- ) as unknown as Program < WorldProgram > ;
158+ const program = new Program ( worldIdl as Idl ) as unknown as Program ;
161159 const worldInstance = await World . fromAccountAddress ( connection , world ) ;
162160 const worldId = new BN ( worldInstance . id ) ;
163161 const instruction = await program . methods
@@ -197,9 +195,7 @@ export async function RemoveAuthority({
197195 instruction : TransactionInstruction ;
198196 transaction : Transaction ;
199197} > {
200- const program = new Program (
201- worldIdl as Idl ,
202- ) as unknown as Program < WorldProgram > ;
198+ const program = new Program ( worldIdl as Idl ) as unknown as Program ;
203199 const worldInstance = await World . fromAccountAddress ( connection , world ) ;
204200 const worldId = new BN ( worldInstance . id ) ;
205201 const instruction = await program . methods
@@ -236,9 +232,7 @@ export async function ApproveSystem({
236232 instruction : TransactionInstruction ;
237233 transaction : Transaction ;
238234} > {
239- const program = new Program (
240- worldIdl as Idl ,
241- ) as unknown as Program < WorldProgram > ;
235+ const program = new Program ( worldIdl as Idl ) as unknown as Program ;
242236 const instruction = await program . methods
243237 . approveSystem ( )
244238 . accounts ( {
@@ -273,9 +267,7 @@ export async function RemoveSystem({
273267 instruction : TransactionInstruction ;
274268 transaction : Transaction ;
275269} > {
276- const program = new Program (
277- worldIdl as Idl ,
278- ) as unknown as Program < WorldProgram > ;
270+ const program = new Program ( worldIdl as Idl ) as unknown as Program ;
279271 const instruction = await program . methods
280272 . removeSystem ( )
281273 . accounts ( {
@@ -359,9 +351,7 @@ export async function DestroyComponent({
359351 instruction : TransactionInstruction ;
360352 transaction : Transaction ;
361353} > {
362- const program = new Program (
363- worldIdl as Idl ,
364- ) as unknown as Program < WorldProgram > ;
354+ const program = new Program ( worldIdl as Idl ) as unknown as Program ;
365355 const componentProgramData = FindComponentProgramDataPda ( {
366356 programId : componentId ,
367357 } ) ;
@@ -450,9 +440,7 @@ async function createApplySystemInstruction({
450440 extraAccounts,
451441 args,
452442} : ApplySystemInstruction ) : Promise < web3 . TransactionInstruction > {
453- const program = new Program (
454- worldIdl as Idl ,
455- ) as unknown as Program < WorldProgram > ;
443+ const program = new Program ( worldIdl as Idl ) as unknown as Program ;
456444 let componentCount = 0 ;
457445 entities . forEach ( function ( entity ) {
458446 componentCount += entity . components . length ;
0 commit comments