{"version":3,"sources":["../../src/generated/programs/loaderV3.ts","../../src/generated/instructions/close.ts","../../src/generated/instructions/deployWithMaxDataLen.ts","../../src/generated/instructions/extendProgram.ts","../../src/generated/instructions/initializeBuffer.ts","../../src/generated/instructions/setAuthority.ts","../../src/generated/instructions/setAuthorityChecked.ts","../../src/generated/instructions/upgrade.ts","../../src/generated/instructions/write.ts"],"names":["LoaderV3Instruction","getU32Encoder","SolanaError","transformEncoder","getStructEncoder","getStructDecoder","getU32Decoder","combineCodec","getAccountMetaFactory","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","getU64Encoder","getU64Decoder"],"mappings":";;;;AA4DO,IAAM,yBAAA,GACT;AAEG,IAAK,mBAAA,qBAAAA,oBAAAA,KAAL;AACH,EAAAA,oBAAAA,CAAAA,oBAAAA,CAAA,kBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,kBAAA;AACA,EAAAA,oBAAAA,CAAAA,oBAAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AACA,EAAAA,oBAAAA,CAAAA,oBAAAA,CAAA,sBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,sBAAA;AACA,EAAAA,oBAAAA,CAAAA,oBAAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AACA,EAAAA,oBAAAA,CAAAA,oBAAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAA;AACA,EAAAA,oBAAAA,CAAAA,oBAAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AACA,EAAAA,oBAAAA,CAAAA,oBAAAA,CAAA,eAAA,CAAA,GAAA,CAAA,CAAA,GAAA,eAAA;AACA,EAAAA,oBAAAA,CAAAA,oBAAAA,CAAA,qBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,qBAAA;AARQ,EAAA,OAAAA,oBAAAA;AAAA,CAAA,EAAA,mBAAA,IAAA,EAAA;AAWL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Ae,gBAAe,EAAG,eAAA,EAAiB,gBAAe,EAAE;AAAA,IAC/E,IAAA,EAAM,8BAAA,EAA+B,CAAE,MAAA,CAAO,YAAY,IAAI;AAAA,GAClE;AACJ","file":"index.mjs","sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    assertIsInstructionWithAccounts,\n    containsBytes,\n    extendClient,\n    getU32Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n    SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n    SolanaError,\n    type Address,\n    type ClientWithTransactionPlanning,\n    type ClientWithTransactionSending,\n    type ExtendedClient,\n    type Instruction,\n    type InstructionWithData,\n    type ReadonlyUint8Array,\n} from '@solana/kit';\nimport { addSelfPlanAndSendFunctions, type SelfPlanAndSendFunctions } from '@solana/kit/program-client-core';\nimport {\n    getCloseInstruction,\n    getDeployWithMaxDataLenInstruction,\n    getExtendProgramInstruction,\n    getInitializeBufferInstruction,\n    getSetAuthorityCheckedInstruction,\n    getSetAuthorityInstruction,\n    getUpgradeInstruction,\n    getWriteInstruction,\n    parseCloseInstruction,\n    parseDeployWithMaxDataLenInstruction,\n    parseExtendProgramInstruction,\n    parseInitializeBufferInstruction,\n    parseSetAuthorityCheckedInstruction,\n    parseSetAuthorityInstruction,\n    parseUpgradeInstruction,\n    parseWriteInstruction,\n    type CloseInput,\n    type DeployWithMaxDataLenInput,\n    type ExtendProgramInput,\n    type InitializeBufferInput,\n    type ParsedCloseInstruction,\n    type ParsedDeployWithMaxDataLenInstruction,\n    type ParsedExtendProgramInstruction,\n    type ParsedInitializeBufferInstruction,\n    type ParsedSetAuthorityCheckedInstruction,\n    type ParsedSetAuthorityInstruction,\n    type ParsedUpgradeInstruction,\n    type ParsedWriteInstruction,\n    type SetAuthorityCheckedInput,\n    type SetAuthorityInput,\n    type UpgradeInput,\n    type WriteInput,\n} from '../instructions';\n\nexport const LOADER_V3_PROGRAM_ADDRESS =\n    'BPFLoaderUpgradeab1e11111111111111111111111' as Address<'BPFLoaderUpgradeab1e11111111111111111111111'>;\n\nexport enum LoaderV3Instruction {\n    InitializeBuffer,\n    Write,\n    DeployWithMaxDataLen,\n    Upgrade,\n    SetAuthority,\n    Close,\n    ExtendProgram,\n    SetAuthorityChecked,\n}\n\nexport function identifyLoaderV3Instruction(\n    instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): LoaderV3Instruction {\n    const data = 'data' in instruction ? instruction.data : instruction;\n    if (containsBytes(data, getU32Encoder().encode(0), 0)) {\n        return LoaderV3Instruction.InitializeBuffer;\n    }\n    if (containsBytes(data, getU32Encoder().encode(1), 0)) {\n        return LoaderV3Instruction.Write;\n    }\n    if (containsBytes(data, getU32Encoder().encode(2), 0)) {\n        return LoaderV3Instruction.DeployWithMaxDataLen;\n    }\n    if (containsBytes(data, getU32Encoder().encode(3), 0)) {\n        return LoaderV3Instruction.Upgrade;\n    }\n    if (containsBytes(data, getU32Encoder().encode(4), 0)) {\n        return LoaderV3Instruction.SetAuthority;\n    }\n    if (containsBytes(data, getU32Encoder().encode(5), 0)) {\n        return LoaderV3Instruction.Close;\n    }\n    if (containsBytes(data, getU32Encoder().encode(6), 0)) {\n        return LoaderV3Instruction.ExtendProgram;\n    }\n    if (containsBytes(data, getU32Encoder().encode(7), 0)) {\n        return LoaderV3Instruction.SetAuthorityChecked;\n    }\n    throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {\n        instructionData: data,\n        programName: 'loaderV3',\n    });\n}\n\nexport type ParsedLoaderV3Instruction<TProgram extends string = 'BPFLoaderUpgradeab1e11111111111111111111111'> =\n    | ({ instructionType: LoaderV3Instruction.InitializeBuffer } & ParsedInitializeBufferInstruction<TProgram>)\n    | ({ instructionType: LoaderV3Instruction.Write } & ParsedWriteInstruction<TProgram>)\n    | ({ instructionType: LoaderV3Instruction.DeployWithMaxDataLen } & ParsedDeployWithMaxDataLenInstruction<TProgram>)\n    | ({ instructionType: LoaderV3Instruction.Upgrade } & ParsedUpgradeInstruction<TProgram>)\n    | ({ instructionType: LoaderV3Instruction.SetAuthority } & ParsedSetAuthorityInstruction<TProgram>)\n    | ({ instructionType: LoaderV3Instruction.Close } & ParsedCloseInstruction<TProgram>)\n    | ({ instructionType: LoaderV3Instruction.ExtendProgram } & ParsedExtendProgramInstruction<TProgram>)\n    | ({ instructionType: LoaderV3Instruction.SetAuthorityChecked } & ParsedSetAuthorityCheckedInstruction<TProgram>);\n\nexport function parseLoaderV3Instruction<TProgram extends string>(\n    instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,\n): ParsedLoaderV3Instruction<TProgram> {\n    const instructionType = identifyLoaderV3Instruction(instruction);\n    switch (instructionType) {\n        case LoaderV3Instruction.InitializeBuffer: {\n            assertIsInstructionWithAccounts(instruction);\n            return {\n                instructionType: LoaderV3Instruction.InitializeBuffer,\n                ...parseInitializeBufferInstruction(instruction),\n            };\n        }\n        case LoaderV3Instruction.Write: {\n            assertIsInstructionWithAccounts(instruction);\n            return { instructionType: LoaderV3Instruction.Write, ...parseWriteInstruction(instruction) };\n        }\n        case LoaderV3Instruction.DeployWithMaxDataLen: {\n            assertIsInstructionWithAccounts(instruction);\n            return {\n                instructionType: LoaderV3Instruction.DeployWithMaxDataLen,\n                ...parseDeployWithMaxDataLenInstruction(instruction),\n            };\n        }\n        case LoaderV3Instruction.Upgrade: {\n            assertIsInstructionWithAccounts(instruction);\n            return { instructionType: LoaderV3Instruction.Upgrade, ...parseUpgradeInstruction(instruction) };\n        }\n        case LoaderV3Instruction.SetAuthority: {\n            assertIsInstructionWithAccounts(instruction);\n            return { instructionType: LoaderV3Instruction.SetAuthority, ...parseSetAuthorityInstruction(instruction) };\n        }\n        case LoaderV3Instruction.Close: {\n            assertIsInstructionWithAccounts(instruction);\n            return { instructionType: LoaderV3Instruction.Close, ...parseCloseInstruction(instruction) };\n        }\n        case LoaderV3Instruction.ExtendProgram: {\n            assertIsInstructionWithAccounts(instruction);\n            return {\n                instructionType: LoaderV3Instruction.ExtendProgram,\n                ...parseExtendProgramInstruction(instruction),\n            };\n        }\n        case LoaderV3Instruction.SetAuthorityChecked: {\n            assertIsInstructionWithAccounts(instruction);\n            return {\n                instructionType: LoaderV3Instruction.SetAuthorityChecked,\n                ...parseSetAuthorityCheckedInstruction(instruction),\n            };\n        }\n        default:\n            throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {\n                instructionType: instructionType as string,\n                programName: 'loaderV3',\n            });\n    }\n}\n\nexport type LoaderV3Plugin = {\n    instructions: LoaderV3PluginInstructions;\n    identifyInstruction: typeof identifyLoaderV3Instruction;\n    parseInstruction: typeof parseLoaderV3Instruction;\n};\n\nexport type LoaderV3PluginInstructions = {\n    initializeBuffer: (\n        input: InitializeBufferInput,\n    ) => ReturnType<typeof getInitializeBufferInstruction> & SelfPlanAndSendFunctions;\n    write: (input: WriteInput) => ReturnType<typeof getWriteInstruction> & SelfPlanAndSendFunctions;\n    deployWithMaxDataLen: (\n        input: DeployWithMaxDataLenInput,\n    ) => ReturnType<typeof getDeployWithMaxDataLenInstruction> & SelfPlanAndSendFunctions;\n    upgrade: (input: UpgradeInput) => ReturnType<typeof getUpgradeInstruction> & SelfPlanAndSendFunctions;\n    setAuthority: (\n        input: SetAuthorityInput,\n    ) => ReturnType<typeof getSetAuthorityInstruction> & SelfPlanAndSendFunctions;\n    close: (input: CloseInput) => ReturnType<typeof getCloseInstruction> & SelfPlanAndSendFunctions;\n    extendProgram: (\n        input: ExtendProgramInput,\n    ) => ReturnType<typeof getExtendProgramInstruction> & SelfPlanAndSendFunctions;\n    setAuthorityChecked: (\n        input: SetAuthorityCheckedInput,\n    ) => ReturnType<typeof getSetAuthorityCheckedInstruction> & SelfPlanAndSendFunctions;\n};\n\nexport type LoaderV3PluginRequirements = ClientWithTransactionPlanning & ClientWithTransactionSending;\n\nexport function loaderV3Program() {\n    return <T extends LoaderV3PluginRequirements>(client: T): ExtendedClient<T, { loaderV3: LoaderV3Plugin }> => {\n        return extendClient(client, {\n            loaderV3: <LoaderV3Plugin>{\n                instructions: {\n                    initializeBuffer: input =>\n                        addSelfPlanAndSendFunctions(client, getInitializeBufferInstruction(input)),\n                    write: input => addSelfPlanAndSendFunctions(client, getWriteInstruction(input)),\n                    deployWithMaxDataLen: input =>\n                        addSelfPlanAndSendFunctions(client, getDeployWithMaxDataLenInstruction(input)),\n                    upgrade: input => addSelfPlanAndSendFunctions(client, getUpgradeInstruction(input)),\n                    setAuthority: input => addSelfPlanAndSendFunctions(client, getSetAuthorityInstruction(input)),\n                    close: input => addSelfPlanAndSendFunctions(client, getCloseInstruction(input)),\n                    extendProgram: input => addSelfPlanAndSendFunctions(client, getExtendProgramInstruction(input)),\n                    setAuthorityChecked: input =>\n                        addSelfPlanAndSendFunctions(client, getSetAuthorityCheckedInstruction(input)),\n                },\n                identifyInstruction: identifyLoaderV3Instruction,\n                parseInstruction: parseLoaderV3Instruction,\n            },\n        });\n    };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    combineCodec,\n    getStructDecoder,\n    getStructEncoder,\n    getU32Decoder,\n    getU32Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n    SolanaError,\n    transformEncoder,\n    type AccountMeta,\n    type AccountSignerMeta,\n    type Address,\n    type FixedSizeCodec,\n    type FixedSizeDecoder,\n    type FixedSizeEncoder,\n    type Instruction,\n    type InstructionWithAccounts,\n    type InstructionWithData,\n    type ReadonlyAccount,\n    type ReadonlySignerAccount,\n    type ReadonlyUint8Array,\n    type TransactionSigner,\n    type WritableAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/kit/program-client-core';\nimport { LOADER_V3_PROGRAM_ADDRESS } from '../programs';\n\nexport const CLOSE_DISCRIMINATOR = 5;\n\nexport function getCloseDiscriminatorBytes(): ReadonlyUint8Array {\n    return getU32Encoder().encode(CLOSE_DISCRIMINATOR);\n}\n\nexport type CloseInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountBufferOrProgramDataAccount extends string | AccountMeta<string> = string,\n    TAccountDestinationAccount extends string | AccountMeta<string> = string,\n    TAccountAuthority extends string | AccountMeta<string> = string,\n    TAccountProgramAccount extends string | AccountMeta<string> = string,\n    TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n    InstructionWithData<ReadonlyUint8Array> &\n    InstructionWithAccounts<\n        [\n            TAccountBufferOrProgramDataAccount extends string\n                ? WritableAccount<TAccountBufferOrProgramDataAccount>\n                : TAccountBufferOrProgramDataAccount,\n            TAccountDestinationAccount extends string\n                ? WritableAccount<TAccountDestinationAccount>\n                : TAccountDestinationAccount,\n            TAccountAuthority extends string\n                ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority>\n                : TAccountAuthority,\n            TAccountProgramAccount extends string ? ReadonlyAccount<TAccountProgramAccount> : TAccountProgramAccount,\n            ...TRemainingAccounts,\n        ]\n    >;\n\nexport type CloseInstructionData = { discriminator: number };\n\nexport type CloseInstructionDataArgs = {};\n\nexport function getCloseInstructionDataEncoder(): FixedSizeEncoder<CloseInstructionDataArgs> {\n    return transformEncoder(getStructEncoder([['discriminator', getU32Encoder()]]), value => ({\n        ...value,\n        discriminator: CLOSE_DISCRIMINATOR,\n    }));\n}\n\nexport function getCloseInstructionDataDecoder(): FixedSizeDecoder<CloseInstructionData> {\n    return getStructDecoder([['discriminator', getU32Decoder()]]);\n}\n\nexport function getCloseInstructionDataCodec(): FixedSizeCodec<CloseInstructionDataArgs, CloseInstructionData> {\n    return combineCodec(getCloseInstructionDataEncoder(), getCloseInstructionDataDecoder());\n}\n\nexport type CloseInput<\n    TAccountBufferOrProgramDataAccount extends string = string,\n    TAccountDestinationAccount extends string = string,\n    TAccountAuthority extends string = string,\n    TAccountProgramAccount extends string = string,\n> = {\n    /** Buffer or ProgramData account to close. */\n    bufferOrProgramDataAccount: Address<TAccountBufferOrProgramDataAccount>;\n    /** Destination account for reclaimed lamports. */\n    destinationAccount: Address<TAccountDestinationAccount>;\n    /** Authority (optional). */\n    authority?: TransactionSigner<TAccountAuthority>;\n    /** Program account (optional). */\n    programAccount?: Address<TAccountProgramAccount>;\n};\n\nexport function getCloseInstruction<\n    TAccountBufferOrProgramDataAccount extends string,\n    TAccountDestinationAccount extends string,\n    TAccountAuthority extends string,\n    TAccountProgramAccount extends string,\n    TProgramAddress extends Address = typeof LOADER_V3_PROGRAM_ADDRESS,\n>(\n    input: CloseInput<\n        TAccountBufferOrProgramDataAccount,\n        TAccountDestinationAccount,\n        TAccountAuthority,\n        TAccountProgramAccount\n    >,\n    config?: { programAddress?: TProgramAddress },\n): CloseInstruction<\n    TProgramAddress,\n    TAccountBufferOrProgramDataAccount,\n    TAccountDestinationAccount,\n    TAccountAuthority,\n    TAccountProgramAccount\n> {\n    // Program address.\n    const programAddress = config?.programAddress ?? LOADER_V3_PROGRAM_ADDRESS;\n\n    // Original accounts.\n    const originalAccounts = {\n        bufferOrProgramDataAccount: { value: input.bufferOrProgramDataAccount ?? null, isWritable: true },\n        destinationAccount: { value: input.destinationAccount ?? null, isWritable: true },\n        authority: { value: input.authority ?? null, isWritable: false },\n        programAccount: { value: input.programAccount ?? null, isWritable: false },\n    };\n    const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n    const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n    return Object.freeze({\n        accounts: [\n            getAccountMeta('bufferOrProgramDataAccount', accounts.bufferOrProgramDataAccount),\n            getAccountMeta('destinationAccount', accounts.destinationAccount),\n            getAccountMeta('authority', accounts.authority),\n            getAccountMeta('programAccount', accounts.programAccount),\n        ],\n        data: getCloseInstructionDataEncoder().encode({}),\n        programAddress,\n    } as CloseInstruction<\n        TProgramAddress,\n        TAccountBufferOrProgramDataAccount,\n        TAccountDestinationAccount,\n        TAccountAuthority,\n        TAccountProgramAccount\n    >);\n}\n\nexport type ParsedCloseInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n    programAddress: Address<TProgram>;\n    accounts: {\n        /** Buffer or ProgramData account to close. */\n        bufferOrProgramDataAccount: TAccountMetas[0];\n        /** Destination account for reclaimed lamports. */\n        destinationAccount: TAccountMetas[1];\n        /** Authority (optional). */\n        authority?: TAccountMetas[2] | undefined;\n        /** Program account (optional). */\n        programAccount?: TAccountMetas[3] | undefined;\n    };\n    data: CloseInstructionData;\n};\n\nexport function parseCloseInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n    instruction: Instruction<TProgram> &\n        InstructionWithAccounts<TAccountMetas> &\n        InstructionWithData<ReadonlyUint8Array>,\n): ParsedCloseInstruction<TProgram, TAccountMetas> {\n    if (instruction.accounts.length < 4) {\n        throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n            actualAccountMetas: instruction.accounts.length,\n            expectedAccountMetas: 4,\n        });\n    }\n    let accountIndex = 0;\n    const getNextAccount = () => {\n        const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n        accountIndex += 1;\n        return accountMeta;\n    };\n    const getNextOptionalAccount = () => {\n        const accountMeta = getNextAccount();\n        return accountMeta.address === LOADER_V3_PROGRAM_ADDRESS ? undefined : accountMeta;\n    };\n    return {\n        programAddress: instruction.programAddress,\n        accounts: {\n            bufferOrProgramDataAccount: getNextAccount(),\n            destinationAccount: getNextAccount(),\n            authority: getNextOptionalAccount(),\n            programAccount: getNextOptionalAccount(),\n        },\n        data: getCloseInstructionDataDecoder().decode(instruction.data),\n    };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    combineCodec,\n    getStructDecoder,\n    getStructEncoder,\n    getU32Decoder,\n    getU32Encoder,\n    getU64Decoder,\n    getU64Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n    SolanaError,\n    transformEncoder,\n    type AccountMeta,\n    type AccountSignerMeta,\n    type Address,\n    type FixedSizeCodec,\n    type FixedSizeDecoder,\n    type FixedSizeEncoder,\n    type Instruction,\n    type InstructionWithAccounts,\n    type InstructionWithData,\n    type ReadonlyAccount,\n    type ReadonlySignerAccount,\n    type ReadonlyUint8Array,\n    type TransactionSigner,\n    type WritableAccount,\n    type WritableSignerAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/kit/program-client-core';\nimport { LOADER_V3_PROGRAM_ADDRESS } from '../programs';\n\nexport const DEPLOY_WITH_MAX_DATA_LEN_DISCRIMINATOR = 2;\n\nexport function getDeployWithMaxDataLenDiscriminatorBytes(): ReadonlyUint8Array {\n    return getU32Encoder().encode(DEPLOY_WITH_MAX_DATA_LEN_DISCRIMINATOR);\n}\n\nexport type DeployWithMaxDataLenInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountPayerAccount extends string | AccountMeta<string> = string,\n    TAccountProgramDataAccount extends string | AccountMeta<string> = string,\n    TAccountProgramAccount extends string | AccountMeta<string> = string,\n    TAccountBufferAccount extends string | AccountMeta<string> = string,\n    TAccountRentSysvar extends string | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111',\n    TAccountClockSysvar extends string | AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111',\n    TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n    TAccountAuthority extends string | AccountMeta<string> = string,\n    TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n    InstructionWithData<ReadonlyUint8Array> &\n    InstructionWithAccounts<\n        [\n            TAccountPayerAccount extends string\n                ? WritableSignerAccount<TAccountPayerAccount> & AccountSignerMeta<TAccountPayerAccount>\n                : TAccountPayerAccount,\n            TAccountProgramDataAccount extends string\n                ? WritableAccount<TAccountProgramDataAccount>\n                : TAccountProgramDataAccount,\n            TAccountProgramAccount extends string ? WritableAccount<TAccountProgramAccount> : TAccountProgramAccount,\n            TAccountBufferAccount extends string ? WritableAccount<TAccountBufferAccount> : TAccountBufferAccount,\n            TAccountRentSysvar extends string ? ReadonlyAccount<TAccountRentSysvar> : TAccountRentSysvar,\n            TAccountClockSysvar extends string ? ReadonlyAccount<TAccountClockSysvar> : TAccountClockSysvar,\n            TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n            TAccountAuthority extends string\n                ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority>\n                : TAccountAuthority,\n            ...TRemainingAccounts,\n        ]\n    >;\n\nexport type DeployWithMaxDataLenInstructionData = { discriminator: number; maxDataLen: bigint };\n\nexport type DeployWithMaxDataLenInstructionDataArgs = { maxDataLen: number | bigint };\n\nexport function getDeployWithMaxDataLenInstructionDataEncoder(): FixedSizeEncoder<DeployWithMaxDataLenInstructionDataArgs> {\n    return transformEncoder(\n        getStructEncoder([\n            ['discriminator', getU32Encoder()],\n            ['maxDataLen', getU64Encoder()],\n        ]),\n        value => ({ ...value, discriminator: DEPLOY_WITH_MAX_DATA_LEN_DISCRIMINATOR }),\n    );\n}\n\nexport function getDeployWithMaxDataLenInstructionDataDecoder(): FixedSizeDecoder<DeployWithMaxDataLenInstructionData> {\n    return getStructDecoder([\n        ['discriminator', getU32Decoder()],\n        ['maxDataLen', getU64Decoder()],\n    ]);\n}\n\nexport function getDeployWithMaxDataLenInstructionDataCodec(): FixedSizeCodec<\n    DeployWithMaxDataLenInstructionDataArgs,\n    DeployWithMaxDataLenInstructionData\n> {\n    return combineCodec(\n        getDeployWithMaxDataLenInstructionDataEncoder(),\n        getDeployWithMaxDataLenInstructionDataDecoder(),\n    );\n}\n\nexport type DeployWithMaxDataLenInput<\n    TAccountPayerAccount extends string = string,\n    TAccountProgramDataAccount extends string = string,\n    TAccountProgramAccount extends string = string,\n    TAccountBufferAccount extends string = string,\n    TAccountRentSysvar extends string = string,\n    TAccountClockSysvar extends string = string,\n    TAccountSystemProgram extends string = string,\n    TAccountAuthority extends string = string,\n> = {\n    /** Payer account that will pay to create the ProgramData account. */\n    payerAccount: TransactionSigner<TAccountPayerAccount>;\n    /** ProgramData account (uninitialized). */\n    programDataAccount: Address<TAccountProgramDataAccount>;\n    /** Program account (uninitialized). */\n    programAccount: Address<TAccountProgramAccount>;\n    /** Buffer account where the program data has been written. */\n    bufferAccount: Address<TAccountBufferAccount>;\n    /** Rent sysvar. */\n    rentSysvar?: Address<TAccountRentSysvar>;\n    /** Clock sysvar. */\n    clockSysvar?: Address<TAccountClockSysvar>;\n    /** System program. */\n    systemProgram?: Address<TAccountSystemProgram>;\n    /** Authority. */\n    authority: TransactionSigner<TAccountAuthority>;\n    maxDataLen: DeployWithMaxDataLenInstructionDataArgs['maxDataLen'];\n};\n\nexport function getDeployWithMaxDataLenInstruction<\n    TAccountPayerAccount extends string,\n    TAccountProgramDataAccount extends string,\n    TAccountProgramAccount extends string,\n    TAccountBufferAccount extends string,\n    TAccountRentSysvar extends string,\n    TAccountClockSysvar extends string,\n    TAccountSystemProgram extends string,\n    TAccountAuthority extends string,\n    TProgramAddress extends Address = typeof LOADER_V3_PROGRAM_ADDRESS,\n>(\n    input: DeployWithMaxDataLenInput<\n        TAccountPayerAccount,\n        TAccountProgramDataAccount,\n        TAccountProgramAccount,\n        TAccountBufferAccount,\n        TAccountRentSysvar,\n        TAccountClockSysvar,\n        TAccountSystemProgram,\n        TAccountAuthority\n    >,\n    config?: { programAddress?: TProgramAddress },\n): DeployWithMaxDataLenInstruction<\n    TProgramAddress,\n    TAccountPayerAccount,\n    TAccountProgramDataAccount,\n    TAccountProgramAccount,\n    TAccountBufferAccount,\n    TAccountRentSysvar,\n    TAccountClockSysvar,\n    TAccountSystemProgram,\n    TAccountAuthority\n> {\n    // Program address.\n    const programAddress = config?.programAddress ?? LOADER_V3_PROGRAM_ADDRESS;\n\n    // Original accounts.\n    const originalAccounts = {\n        payerAccount: { value: input.payerAccount ?? null, isWritable: true },\n        programDataAccount: { value: input.programDataAccount ?? null, isWritable: true },\n        programAccount: { value: input.programAccount ?? null, isWritable: true },\n        bufferAccount: { value: input.bufferAccount ?? null, isWritable: true },\n        rentSysvar: { value: input.rentSysvar ?? null, isWritable: false },\n        clockSysvar: { value: input.clockSysvar ?? null, isWritable: false },\n        systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n        authority: { value: input.authority ?? null, isWritable: false },\n    };\n    const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n    // Original args.\n    const args = { ...input };\n\n    // Resolve default values.\n    if (!accounts.rentSysvar.value) {\n        accounts.rentSysvar.value =\n            'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n    }\n    if (!accounts.clockSysvar.value) {\n        accounts.clockSysvar.value =\n            'SysvarC1ock11111111111111111111111111111111' as Address<'SysvarC1ock11111111111111111111111111111111'>;\n    }\n    if (!accounts.systemProgram.value) {\n        accounts.systemProgram.value =\n            '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n    }\n\n    const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n    return Object.freeze({\n        accounts: [\n            getAccountMeta('payerAccount', accounts.payerAccount),\n            getAccountMeta('programDataAccount', accounts.programDataAccount),\n            getAccountMeta('programAccount', accounts.programAccount),\n            getAccountMeta('bufferAccount', accounts.bufferAccount),\n            getAccountMeta('rentSysvar', accounts.rentSysvar),\n            getAccountMeta('clockSysvar', accounts.clockSysvar),\n            getAccountMeta('systemProgram', accounts.systemProgram),\n            getAccountMeta('authority', accounts.authority),\n        ],\n        data: getDeployWithMaxDataLenInstructionDataEncoder().encode(args as DeployWithMaxDataLenInstructionDataArgs),\n        programAddress,\n    } as DeployWithMaxDataLenInstruction<\n        TProgramAddress,\n        TAccountPayerAccount,\n        TAccountProgramDataAccount,\n        TAccountProgramAccount,\n        TAccountBufferAccount,\n        TAccountRentSysvar,\n        TAccountClockSysvar,\n        TAccountSystemProgram,\n        TAccountAuthority\n    >);\n}\n\nexport type ParsedDeployWithMaxDataLenInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n    programAddress: Address<TProgram>;\n    accounts: {\n        /** Payer account that will pay to create the ProgramData account. */\n        payerAccount: TAccountMetas[0];\n        /** ProgramData account (uninitialized). */\n        programDataAccount: TAccountMetas[1];\n        /** Program account (uninitialized). */\n        programAccount: TAccountMetas[2];\n        /** Buffer account where the program data has been written. */\n        bufferAccount: TAccountMetas[3];\n        /** Rent sysvar. */\n        rentSysvar: TAccountMetas[4];\n        /** Clock sysvar. */\n        clockSysvar: TAccountMetas[5];\n        /** System program. */\n        systemProgram: TAccountMetas[6];\n        /** Authority. */\n        authority: TAccountMetas[7];\n    };\n    data: DeployWithMaxDataLenInstructionData;\n};\n\nexport function parseDeployWithMaxDataLenInstruction<\n    TProgram extends string,\n    TAccountMetas extends readonly AccountMeta[],\n>(\n    instruction: Instruction<TProgram> &\n        InstructionWithAccounts<TAccountMetas> &\n        InstructionWithData<ReadonlyUint8Array>,\n): ParsedDeployWithMaxDataLenInstruction<TProgram, TAccountMetas> {\n    if (instruction.accounts.length < 8) {\n        throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n            actualAccountMetas: instruction.accounts.length,\n            expectedAccountMetas: 8,\n        });\n    }\n    let accountIndex = 0;\n    const getNextAccount = () => {\n        const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n        accountIndex += 1;\n        return accountMeta;\n    };\n    return {\n        programAddress: instruction.programAddress,\n        accounts: {\n            payerAccount: getNextAccount(),\n            programDataAccount: getNextAccount(),\n            programAccount: getNextAccount(),\n            bufferAccount: getNextAccount(),\n            rentSysvar: getNextAccount(),\n            clockSysvar: getNextAccount(),\n            systemProgram: getNextAccount(),\n            authority: getNextAccount(),\n        },\n        data: getDeployWithMaxDataLenInstructionDataDecoder().decode(instruction.data),\n    };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    combineCodec,\n    getStructDecoder,\n    getStructEncoder,\n    getU32Decoder,\n    getU32Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n    SolanaError,\n    transformEncoder,\n    type AccountMeta,\n    type AccountSignerMeta,\n    type Address,\n    type FixedSizeCodec,\n    type FixedSizeDecoder,\n    type FixedSizeEncoder,\n    type Instruction,\n    type InstructionWithAccounts,\n    type InstructionWithData,\n    type ReadonlyAccount,\n    type ReadonlyUint8Array,\n    type TransactionSigner,\n    type WritableAccount,\n    type WritableSignerAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/kit/program-client-core';\nimport { LOADER_V3_PROGRAM_ADDRESS } from '../programs';\n\nexport const EXTEND_PROGRAM_DISCRIMINATOR = 6;\n\nexport function getExtendProgramDiscriminatorBytes(): ReadonlyUint8Array {\n    return getU32Encoder().encode(EXTEND_PROGRAM_DISCRIMINATOR);\n}\n\nexport type ExtendProgramInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountProgramDataAccount extends string | AccountMeta<string> = string,\n    TAccountProgramAccount extends string | AccountMeta<string> = string,\n    TAccountSystemProgram extends string | AccountMeta<string> = string,\n    TAccountPayer extends string | AccountMeta<string> = string,\n    TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n    InstructionWithData<ReadonlyUint8Array> &\n    InstructionWithAccounts<\n        [\n            TAccountProgramDataAccount extends string\n                ? WritableAccount<TAccountProgramDataAccount>\n                : TAccountProgramDataAccount,\n            TAccountProgramAccount extends string ? WritableAccount<TAccountProgramAccount> : TAccountProgramAccount,\n            TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n            TAccountPayer extends string\n                ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n                : TAccountPayer,\n            ...TRemainingAccounts,\n        ]\n    >;\n\nexport type ExtendProgramInstructionData = { discriminator: number; additionalBytes: number };\n\nexport type ExtendProgramInstructionDataArgs = { additionalBytes: number };\n\nexport function getExtendProgramInstructionDataEncoder(): FixedSizeEncoder<ExtendProgramInstructionDataArgs> {\n    return transformEncoder(\n        getStructEncoder([\n            ['discriminator', getU32Encoder()],\n            ['additionalBytes', getU32Encoder()],\n        ]),\n        value => ({ ...value, discriminator: EXTEND_PROGRAM_DISCRIMINATOR }),\n    );\n}\n\nexport function getExtendProgramInstructionDataDecoder(): FixedSizeDecoder<ExtendProgramInstructionData> {\n    return getStructDecoder([\n        ['discriminator', getU32Decoder()],\n        ['additionalBytes', getU32Decoder()],\n    ]);\n}\n\nexport function getExtendProgramInstructionDataCodec(): FixedSizeCodec<\n    ExtendProgramInstructionDataArgs,\n    ExtendProgramInstructionData\n> {\n    return combineCodec(getExtendProgramInstructionDataEncoder(), getExtendProgramInstructionDataDecoder());\n}\n\nexport type ExtendProgramInput<\n    TAccountProgramDataAccount extends string = string,\n    TAccountProgramAccount extends string = string,\n    TAccountSystemProgram extends string = string,\n    TAccountPayer extends string = string,\n> = {\n    /** ProgramData account. */\n    programDataAccount: Address<TAccountProgramDataAccount>;\n    /** Program account. */\n    programAccount: Address<TAccountProgramAccount>;\n    /** System program (optional). */\n    systemProgram?: Address<TAccountSystemProgram>;\n    /** Payer. */\n    payer?: TransactionSigner<TAccountPayer>;\n    additionalBytes: ExtendProgramInstructionDataArgs['additionalBytes'];\n};\n\nexport function getExtendProgramInstruction<\n    TAccountProgramDataAccount extends string,\n    TAccountProgramAccount extends string,\n    TAccountSystemProgram extends string,\n    TAccountPayer extends string,\n    TProgramAddress extends Address = typeof LOADER_V3_PROGRAM_ADDRESS,\n>(\n    input: ExtendProgramInput<TAccountProgramDataAccount, TAccountProgramAccount, TAccountSystemProgram, TAccountPayer>,\n    config?: { programAddress?: TProgramAddress },\n): ExtendProgramInstruction<\n    TProgramAddress,\n    TAccountProgramDataAccount,\n    TAccountProgramAccount,\n    TAccountSystemProgram,\n    TAccountPayer\n> {\n    // Program address.\n    const programAddress = config?.programAddress ?? LOADER_V3_PROGRAM_ADDRESS;\n\n    // Original accounts.\n    const originalAccounts = {\n        programDataAccount: { value: input.programDataAccount ?? null, isWritable: true },\n        programAccount: { value: input.programAccount ?? null, isWritable: true },\n        systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n        payer: { value: input.payer ?? null, isWritable: true },\n    };\n    const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n    // Original args.\n    const args = { ...input };\n\n    const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n    return Object.freeze({\n        accounts: [\n            getAccountMeta('programDataAccount', accounts.programDataAccount),\n            getAccountMeta('programAccount', accounts.programAccount),\n            getAccountMeta('systemProgram', accounts.systemProgram),\n            getAccountMeta('payer', accounts.payer),\n        ],\n        data: getExtendProgramInstructionDataEncoder().encode(args as ExtendProgramInstructionDataArgs),\n        programAddress,\n    } as ExtendProgramInstruction<\n        TProgramAddress,\n        TAccountProgramDataAccount,\n        TAccountProgramAccount,\n        TAccountSystemProgram,\n        TAccountPayer\n    >);\n}\n\nexport type ParsedExtendProgramInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n    programAddress: Address<TProgram>;\n    accounts: {\n        /** ProgramData account. */\n        programDataAccount: TAccountMetas[0];\n        /** Program account. */\n        programAccount: TAccountMetas[1];\n        /** System program (optional). */\n        systemProgram?: TAccountMetas[2] | undefined;\n        /** Payer. */\n        payer?: TAccountMetas[3] | undefined;\n    };\n    data: ExtendProgramInstructionData;\n};\n\nexport function parseExtendProgramInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n    instruction: Instruction<TProgram> &\n        InstructionWithAccounts<TAccountMetas> &\n        InstructionWithData<ReadonlyUint8Array>,\n): ParsedExtendProgramInstruction<TProgram, TAccountMetas> {\n    if (instruction.accounts.length < 4) {\n        throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n            actualAccountMetas: instruction.accounts.length,\n            expectedAccountMetas: 4,\n        });\n    }\n    let accountIndex = 0;\n    const getNextAccount = () => {\n        const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n        accountIndex += 1;\n        return accountMeta;\n    };\n    const getNextOptionalAccount = () => {\n        const accountMeta = getNextAccount();\n        return accountMeta.address === LOADER_V3_PROGRAM_ADDRESS ? undefined : accountMeta;\n    };\n    return {\n        programAddress: instruction.programAddress,\n        accounts: {\n            programDataAccount: getNextAccount(),\n            programAccount: getNextAccount(),\n            systemProgram: getNextOptionalAccount(),\n            payer: getNextOptionalAccount(),\n        },\n        data: getExtendProgramInstructionDataDecoder().decode(instruction.data),\n    };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    combineCodec,\n    getStructDecoder,\n    getStructEncoder,\n    getU32Decoder,\n    getU32Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n    SolanaError,\n    transformEncoder,\n    type AccountMeta,\n    type Address,\n    type FixedSizeCodec,\n    type FixedSizeDecoder,\n    type FixedSizeEncoder,\n    type Instruction,\n    type InstructionWithAccounts,\n    type InstructionWithData,\n    type ReadonlyAccount,\n    type ReadonlyUint8Array,\n    type WritableAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/kit/program-client-core';\nimport { LOADER_V3_PROGRAM_ADDRESS } from '../programs';\n\nexport const INITIALIZE_BUFFER_DISCRIMINATOR = 0;\n\nexport function getInitializeBufferDiscriminatorBytes(): ReadonlyUint8Array {\n    return getU32Encoder().encode(INITIALIZE_BUFFER_DISCRIMINATOR);\n}\n\nexport type InitializeBufferInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountSourceAccount extends string | AccountMeta<string> = string,\n    TAccountBufferAuthority extends string | AccountMeta<string> = string,\n    TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n    InstructionWithData<ReadonlyUint8Array> &\n    InstructionWithAccounts<\n        [\n            TAccountSourceAccount extends string ? WritableAccount<TAccountSourceAccount> : TAccountSourceAccount,\n            TAccountBufferAuthority extends string ? ReadonlyAccount<TAccountBufferAuthority> : TAccountBufferAuthority,\n            ...TRemainingAccounts,\n        ]\n    >;\n\nexport type InitializeBufferInstructionData = { discriminator: number };\n\nexport type InitializeBufferInstructionDataArgs = {};\n\nexport function getInitializeBufferInstructionDataEncoder(): FixedSizeEncoder<InitializeBufferInstructionDataArgs> {\n    return transformEncoder(getStructEncoder([['discriminator', getU32Encoder()]]), value => ({\n        ...value,\n        discriminator: INITIALIZE_BUFFER_DISCRIMINATOR,\n    }));\n}\n\nexport function getInitializeBufferInstructionDataDecoder(): FixedSizeDecoder<InitializeBufferInstructionData> {\n    return getStructDecoder([['discriminator', getU32Decoder()]]);\n}\n\nexport function getInitializeBufferInstructionDataCodec(): FixedSizeCodec<\n    InitializeBufferInstructionDataArgs,\n    InitializeBufferInstructionData\n> {\n    return combineCodec(getInitializeBufferInstructionDataEncoder(), getInitializeBufferInstructionDataDecoder());\n}\n\nexport type InitializeBufferInput<\n    TAccountSourceAccount extends string = string,\n    TAccountBufferAuthority extends string = string,\n> = {\n    /** Source account to initialize. */\n    sourceAccount: Address<TAccountSourceAccount>;\n    /** Buffer authority. */\n    bufferAuthority: Address<TAccountBufferAuthority>;\n};\n\nexport function getInitializeBufferInstruction<\n    TAccountSourceAccount extends string,\n    TAccountBufferAuthority extends string,\n    TProgramAddress extends Address = typeof LOADER_V3_PROGRAM_ADDRESS,\n>(\n    input: InitializeBufferInput<TAccountSourceAccount, TAccountBufferAuthority>,\n    config?: { programAddress?: TProgramAddress },\n): InitializeBufferInstruction<TProgramAddress, TAccountSourceAccount, TAccountBufferAuthority> {\n    // Program address.\n    const programAddress = config?.programAddress ?? LOADER_V3_PROGRAM_ADDRESS;\n\n    // Original accounts.\n    const originalAccounts = {\n        sourceAccount: { value: input.sourceAccount ?? null, isWritable: true },\n        bufferAuthority: { value: input.bufferAuthority ?? null, isWritable: false },\n    };\n    const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n    const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n    return Object.freeze({\n        accounts: [\n            getAccountMeta('sourceAccount', accounts.sourceAccount),\n            getAccountMeta('bufferAuthority', accounts.bufferAuthority),\n        ],\n        data: getInitializeBufferInstructionDataEncoder().encode({}),\n        programAddress,\n    } as InitializeBufferInstruction<TProgramAddress, TAccountSourceAccount, TAccountBufferAuthority>);\n}\n\nexport type ParsedInitializeBufferInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n    programAddress: Address<TProgram>;\n    accounts: {\n        /** Source account to initialize. */\n        sourceAccount: TAccountMetas[0];\n        /** Buffer authority. */\n        bufferAuthority: TAccountMetas[1];\n    };\n    data: InitializeBufferInstructionData;\n};\n\nexport function parseInitializeBufferInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n    instruction: Instruction<TProgram> &\n        InstructionWithAccounts<TAccountMetas> &\n        InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitializeBufferInstruction<TProgram, TAccountMetas> {\n    if (instruction.accounts.length < 2) {\n        throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n            actualAccountMetas: instruction.accounts.length,\n            expectedAccountMetas: 2,\n        });\n    }\n    let accountIndex = 0;\n    const getNextAccount = () => {\n        const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n        accountIndex += 1;\n        return accountMeta;\n    };\n    return {\n        programAddress: instruction.programAddress,\n        accounts: { sourceAccount: getNextAccount(), bufferAuthority: getNextAccount() },\n        data: getInitializeBufferInstructionDataDecoder().decode(instruction.data),\n    };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    combineCodec,\n    getStructDecoder,\n    getStructEncoder,\n    getU32Decoder,\n    getU32Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n    SolanaError,\n    transformEncoder,\n    type AccountMeta,\n    type AccountSignerMeta,\n    type Address,\n    type FixedSizeCodec,\n    type FixedSizeDecoder,\n    type FixedSizeEncoder,\n    type Instruction,\n    type InstructionWithAccounts,\n    type InstructionWithData,\n    type ReadonlyAccount,\n    type ReadonlySignerAccount,\n    type ReadonlyUint8Array,\n    type TransactionSigner,\n    type WritableAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/kit/program-client-core';\nimport { LOADER_V3_PROGRAM_ADDRESS } from '../programs';\n\nexport const SET_AUTHORITY_DISCRIMINATOR = 4;\n\nexport function getSetAuthorityDiscriminatorBytes(): ReadonlyUint8Array {\n    return getU32Encoder().encode(SET_AUTHORITY_DISCRIMINATOR);\n}\n\nexport type SetAuthorityInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountBufferOrProgramDataAccount extends string | AccountMeta<string> = string,\n    TAccountCurrentAuthority extends string | AccountMeta<string> = string,\n    TAccountNewAuthority extends string | AccountMeta<string> = string,\n    TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n    InstructionWithData<ReadonlyUint8Array> &\n    InstructionWithAccounts<\n        [\n            TAccountBufferOrProgramDataAccount extends string\n                ? WritableAccount<TAccountBufferOrProgramDataAccount>\n                : TAccountBufferOrProgramDataAccount,\n            TAccountCurrentAuthority extends string\n                ? ReadonlySignerAccount<TAccountCurrentAuthority> & AccountSignerMeta<TAccountCurrentAuthority>\n                : TAccountCurrentAuthority,\n            TAccountNewAuthority extends string ? ReadonlyAccount<TAccountNewAuthority> : TAccountNewAuthority,\n            ...TRemainingAccounts,\n        ]\n    >;\n\nexport type SetAuthorityInstructionData = { discriminator: number };\n\nexport type SetAuthorityInstructionDataArgs = {};\n\nexport function getSetAuthorityInstructionDataEncoder(): FixedSizeEncoder<SetAuthorityInstructionDataArgs> {\n    return transformEncoder(getStructEncoder([['discriminator', getU32Encoder()]]), value => ({\n        ...value,\n        discriminator: SET_AUTHORITY_DISCRIMINATOR,\n    }));\n}\n\nexport function getSetAuthorityInstructionDataDecoder(): FixedSizeDecoder<SetAuthorityInstructionData> {\n    return getStructDecoder([['discriminator', getU32Decoder()]]);\n}\n\nexport function getSetAuthorityInstructionDataCodec(): FixedSizeCodec<\n    SetAuthorityInstructionDataArgs,\n    SetAuthorityInstructionData\n> {\n    return combineCodec(getSetAuthorityInstructionDataEncoder(), getSetAuthorityInstructionDataDecoder());\n}\n\nexport type SetAuthorityInput<\n    TAccountBufferOrProgramDataAccount extends string = string,\n    TAccountCurrentAuthority extends string = string,\n    TAccountNewAuthority extends string = string,\n> = {\n    /** Buffer or ProgramData account. */\n    bufferOrProgramDataAccount: Address<TAccountBufferOrProgramDataAccount>;\n    /** Current authority. */\n    currentAuthority: TransactionSigner<TAccountCurrentAuthority>;\n    /** New authority (optional). */\n    newAuthority?: Address<TAccountNewAuthority>;\n};\n\nexport function getSetAuthorityInstruction<\n    TAccountBufferOrProgramDataAccount extends string,\n    TAccountCurrentAuthority extends string,\n    TAccountNewAuthority extends string,\n    TProgramAddress extends Address = typeof LOADER_V3_PROGRAM_ADDRESS,\n>(\n    input: SetAuthorityInput<TAccountBufferOrProgramDataAccount, TAccountCurrentAuthority, TAccountNewAuthority>,\n    config?: { programAddress?: TProgramAddress },\n): SetAuthorityInstruction<\n    TProgramAddress,\n    TAccountBufferOrProgramDataAccount,\n    TAccountCurrentAuthority,\n    TAccountNewAuthority\n> {\n    // Program address.\n    const programAddress = config?.programAddress ?? LOADER_V3_PROGRAM_ADDRESS;\n\n    // Original accounts.\n    const originalAccounts = {\n        bufferOrProgramDataAccount: { value: input.bufferOrProgramDataAccount ?? null, isWritable: true },\n        currentAuthority: { value: input.currentAuthority ?? null, isWritable: false },\n        newAuthority: { value: input.newAuthority ?? null, isWritable: false },\n    };\n    const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n    const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n    return Object.freeze({\n        accounts: [\n            getAccountMeta('bufferOrProgramDataAccount', accounts.bufferOrProgramDataAccount),\n            getAccountMeta('currentAuthority', accounts.currentAuthority),\n            getAccountMeta('newAuthority', accounts.newAuthority),\n        ],\n        data: getSetAuthorityInstructionDataEncoder().encode({}),\n        programAddress,\n    } as SetAuthorityInstruction<\n        TProgramAddress,\n        TAccountBufferOrProgramDataAccount,\n        TAccountCurrentAuthority,\n        TAccountNewAuthority\n    >);\n}\n\nexport type ParsedSetAuthorityInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n    programAddress: Address<TProgram>;\n    accounts: {\n        /** Buffer or ProgramData account. */\n        bufferOrProgramDataAccount: TAccountMetas[0];\n        /** Current authority. */\n        currentAuthority: TAccountMetas[1];\n        /** New authority (optional). */\n        newAuthority?: TAccountMetas[2] | undefined;\n    };\n    data: SetAuthorityInstructionData;\n};\n\nexport function parseSetAuthorityInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n    instruction: Instruction<TProgram> &\n        InstructionWithAccounts<TAccountMetas> &\n        InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetAuthorityInstruction<TProgram, TAccountMetas> {\n    if (instruction.accounts.length < 3) {\n        throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n            actualAccountMetas: instruction.accounts.length,\n            expectedAccountMetas: 3,\n        });\n    }\n    let accountIndex = 0;\n    const getNextAccount = () => {\n        const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n        accountIndex += 1;\n        return accountMeta;\n    };\n    const getNextOptionalAccount = () => {\n        const accountMeta = getNextAccount();\n        return accountMeta.address === LOADER_V3_PROGRAM_ADDRESS ? undefined : accountMeta;\n    };\n    return {\n        programAddress: instruction.programAddress,\n        accounts: {\n            bufferOrProgramDataAccount: getNextAccount(),\n            currentAuthority: getNextAccount(),\n            newAuthority: getNextOptionalAccount(),\n        },\n        data: getSetAuthorityInstructionDataDecoder().decode(instruction.data),\n    };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    combineCodec,\n    getStructDecoder,\n    getStructEncoder,\n    getU32Decoder,\n    getU32Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n    SolanaError,\n    transformEncoder,\n    type AccountMeta,\n    type AccountSignerMeta,\n    type Address,\n    type FixedSizeCodec,\n    type FixedSizeDecoder,\n    type FixedSizeEncoder,\n    type Instruction,\n    type InstructionWithAccounts,\n    type InstructionWithData,\n    type ReadonlySignerAccount,\n    type ReadonlyUint8Array,\n    type TransactionSigner,\n    type WritableAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/kit/program-client-core';\nimport { LOADER_V3_PROGRAM_ADDRESS } from '../programs';\n\nexport const SET_AUTHORITY_CHECKED_DISCRIMINATOR = 7;\n\nexport function getSetAuthorityCheckedDiscriminatorBytes(): ReadonlyUint8Array {\n    return getU32Encoder().encode(SET_AUTHORITY_CHECKED_DISCRIMINATOR);\n}\n\nexport type SetAuthorityCheckedInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountBufferOrProgramDataAccount extends string | AccountMeta<string> = string,\n    TAccountCurrentAuthority extends string | AccountMeta<string> = string,\n    TAccountNewAuthority extends string | AccountMeta<string> = string,\n    TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n    InstructionWithData<ReadonlyUint8Array> &\n    InstructionWithAccounts<\n        [\n            TAccountBufferOrProgramDataAccount extends string\n                ? WritableAccount<TAccountBufferOrProgramDataAccount>\n                : TAccountBufferOrProgramDataAccount,\n            TAccountCurrentAuthority extends string\n                ? ReadonlySignerAccount<TAccountCurrentAuthority> & AccountSignerMeta<TAccountCurrentAuthority>\n                : TAccountCurrentAuthority,\n            TAccountNewAuthority extends string\n                ? ReadonlySignerAccount<TAccountNewAuthority> & AccountSignerMeta<TAccountNewAuthority>\n                : TAccountNewAuthority,\n            ...TRemainingAccounts,\n        ]\n    >;\n\nexport type SetAuthorityCheckedInstructionData = { discriminator: number };\n\nexport type SetAuthorityCheckedInstructionDataArgs = {};\n\nexport function getSetAuthorityCheckedInstructionDataEncoder(): FixedSizeEncoder<SetAuthorityCheckedInstructionDataArgs> {\n    return transformEncoder(getStructEncoder([['discriminator', getU32Encoder()]]), value => ({\n        ...value,\n        discriminator: SET_AUTHORITY_CHECKED_DISCRIMINATOR,\n    }));\n}\n\nexport function getSetAuthorityCheckedInstructionDataDecoder(): FixedSizeDecoder<SetAuthorityCheckedInstructionData> {\n    return getStructDecoder([['discriminator', getU32Decoder()]]);\n}\n\nexport function getSetAuthorityCheckedInstructionDataCodec(): FixedSizeCodec<\n    SetAuthorityCheckedInstructionDataArgs,\n    SetAuthorityCheckedInstructionData\n> {\n    return combineCodec(getSetAuthorityCheckedInstructionDataEncoder(), getSetAuthorityCheckedInstructionDataDecoder());\n}\n\nexport type SetAuthorityCheckedInput<\n    TAccountBufferOrProgramDataAccount extends string = string,\n    TAccountCurrentAuthority extends string = string,\n    TAccountNewAuthority extends string = string,\n> = {\n    /** Buffer or ProgramData account to change the authority of. */\n    bufferOrProgramDataAccount: Address<TAccountBufferOrProgramDataAccount>;\n    /** Current authority. */\n    currentAuthority: TransactionSigner<TAccountCurrentAuthority>;\n    /** New authority. */\n    newAuthority: TransactionSigner<TAccountNewAuthority>;\n};\n\nexport function getSetAuthorityCheckedInstruction<\n    TAccountBufferOrProgramDataAccount extends string,\n    TAccountCurrentAuthority extends string,\n    TAccountNewAuthority extends string,\n    TProgramAddress extends Address = typeof LOADER_V3_PROGRAM_ADDRESS,\n>(\n    input: SetAuthorityCheckedInput<TAccountBufferOrProgramDataAccount, TAccountCurrentAuthority, TAccountNewAuthority>,\n    config?: { programAddress?: TProgramAddress },\n): SetAuthorityCheckedInstruction<\n    TProgramAddress,\n    TAccountBufferOrProgramDataAccount,\n    TAccountCurrentAuthority,\n    TAccountNewAuthority\n> {\n    // Program address.\n    const programAddress = config?.programAddress ?? LOADER_V3_PROGRAM_ADDRESS;\n\n    // Original accounts.\n    const originalAccounts = {\n        bufferOrProgramDataAccount: { value: input.bufferOrProgramDataAccount ?? null, isWritable: true },\n        currentAuthority: { value: input.currentAuthority ?? null, isWritable: false },\n        newAuthority: { value: input.newAuthority ?? null, isWritable: false },\n    };\n    const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n    const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n    return Object.freeze({\n        accounts: [\n            getAccountMeta('bufferOrProgramDataAccount', accounts.bufferOrProgramDataAccount),\n            getAccountMeta('currentAuthority', accounts.currentAuthority),\n            getAccountMeta('newAuthority', accounts.newAuthority),\n        ],\n        data: getSetAuthorityCheckedInstructionDataEncoder().encode({}),\n        programAddress,\n    } as SetAuthorityCheckedInstruction<\n        TProgramAddress,\n        TAccountBufferOrProgramDataAccount,\n        TAccountCurrentAuthority,\n        TAccountNewAuthority\n    >);\n}\n\nexport type ParsedSetAuthorityCheckedInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n    programAddress: Address<TProgram>;\n    accounts: {\n        /** Buffer or ProgramData account to change the authority of. */\n        bufferOrProgramDataAccount: TAccountMetas[0];\n        /** Current authority. */\n        currentAuthority: TAccountMetas[1];\n        /** New authority. */\n        newAuthority: TAccountMetas[2];\n    };\n    data: SetAuthorityCheckedInstructionData;\n};\n\nexport function parseSetAuthorityCheckedInstruction<\n    TProgram extends string,\n    TAccountMetas extends readonly AccountMeta[],\n>(\n    instruction: Instruction<TProgram> &\n        InstructionWithAccounts<TAccountMetas> &\n        InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetAuthorityCheckedInstruction<TProgram, TAccountMetas> {\n    if (instruction.accounts.length < 3) {\n        throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n            actualAccountMetas: instruction.accounts.length,\n            expectedAccountMetas: 3,\n        });\n    }\n    let accountIndex = 0;\n    const getNextAccount = () => {\n        const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n        accountIndex += 1;\n        return accountMeta;\n    };\n    return {\n        programAddress: instruction.programAddress,\n        accounts: {\n            bufferOrProgramDataAccount: getNextAccount(),\n            currentAuthority: getNextAccount(),\n            newAuthority: getNextAccount(),\n        },\n        data: getSetAuthorityCheckedInstructionDataDecoder().decode(instruction.data),\n    };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    combineCodec,\n    getStructDecoder,\n    getStructEncoder,\n    getU32Decoder,\n    getU32Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n    SolanaError,\n    transformEncoder,\n    type AccountMeta,\n    type AccountSignerMeta,\n    type Address,\n    type FixedSizeCodec,\n    type FixedSizeDecoder,\n    type FixedSizeEncoder,\n    type Instruction,\n    type InstructionWithAccounts,\n    type InstructionWithData,\n    type ReadonlyAccount,\n    type ReadonlySignerAccount,\n    type ReadonlyUint8Array,\n    type TransactionSigner,\n    type WritableAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/kit/program-client-core';\nimport { LOADER_V3_PROGRAM_ADDRESS } from '../programs';\n\nexport const UPGRADE_DISCRIMINATOR = 3;\n\nexport function getUpgradeDiscriminatorBytes(): ReadonlyUint8Array {\n    return getU32Encoder().encode(UPGRADE_DISCRIMINATOR);\n}\n\nexport type UpgradeInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountProgramDataAccount extends string | AccountMeta<string> = string,\n    TAccountProgramAccount extends string | AccountMeta<string> = string,\n    TAccountBufferAccount extends string | AccountMeta<string> = string,\n    TAccountSpillAccount extends string | AccountMeta<string> = string,\n    TAccountRentSysvar extends string | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111',\n    TAccountClockSysvar extends string | AccountMeta<string> = 'SysvarC1ock11111111111111111111111111111111',\n    TAccountAuthority extends string | AccountMeta<string> = string,\n    TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n    InstructionWithData<ReadonlyUint8Array> &\n    InstructionWithAccounts<\n        [\n            TAccountProgramDataAccount extends string\n                ? WritableAccount<TAccountProgramDataAccount>\n                : TAccountProgramDataAccount,\n            TAccountProgramAccount extends string ? WritableAccount<TAccountProgramAccount> : TAccountProgramAccount,\n            TAccountBufferAccount extends string ? WritableAccount<TAccountBufferAccount> : TAccountBufferAccount,\n            TAccountSpillAccount extends string ? WritableAccount<TAccountSpillAccount> : TAccountSpillAccount,\n            TAccountRentSysvar extends string ? ReadonlyAccount<TAccountRentSysvar> : TAccountRentSysvar,\n            TAccountClockSysvar extends string ? ReadonlyAccount<TAccountClockSysvar> : TAccountClockSysvar,\n            TAccountAuthority extends string\n                ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority>\n                : TAccountAuthority,\n            ...TRemainingAccounts,\n        ]\n    >;\n\nexport type UpgradeInstructionData = { discriminator: number };\n\nexport type UpgradeInstructionDataArgs = {};\n\nexport function getUpgradeInstructionDataEncoder(): FixedSizeEncoder<UpgradeInstructionDataArgs> {\n    return transformEncoder(getStructEncoder([['discriminator', getU32Encoder()]]), value => ({\n        ...value,\n        discriminator: UPGRADE_DISCRIMINATOR,\n    }));\n}\n\nexport function getUpgradeInstructionDataDecoder(): FixedSizeDecoder<UpgradeInstructionData> {\n    return getStructDecoder([['discriminator', getU32Decoder()]]);\n}\n\nexport function getUpgradeInstructionDataCodec(): FixedSizeCodec<UpgradeInstructionDataArgs, UpgradeInstructionData> {\n    return combineCodec(getUpgradeInstructionDataEncoder(), getUpgradeInstructionDataDecoder());\n}\n\nexport type UpgradeInput<\n    TAccountProgramDataAccount extends string = string,\n    TAccountProgramAccount extends string = string,\n    TAccountBufferAccount extends string = string,\n    TAccountSpillAccount extends string = string,\n    TAccountRentSysvar extends string = string,\n    TAccountClockSysvar extends string = string,\n    TAccountAuthority extends string = string,\n> = {\n    /** ProgramData account. */\n    programDataAccount: Address<TAccountProgramDataAccount>;\n    /** Program account. */\n    programAccount: Address<TAccountProgramAccount>;\n    /** Buffer account where the new program data has been written. */\n    bufferAccount: Address<TAccountBufferAccount>;\n    /** Spill account. */\n    spillAccount: Address<TAccountSpillAccount>;\n    /** Rent sysvar. */\n    rentSysvar?: Address<TAccountRentSysvar>;\n    /** Clock sysvar. */\n    clockSysvar?: Address<TAccountClockSysvar>;\n    /** Authority. */\n    authority: TransactionSigner<TAccountAuthority>;\n};\n\nexport function getUpgradeInstruction<\n    TAccountProgramDataAccount extends string,\n    TAccountProgramAccount extends string,\n    TAccountBufferAccount extends string,\n    TAccountSpillAccount extends string,\n    TAccountRentSysvar extends string,\n    TAccountClockSysvar extends string,\n    TAccountAuthority extends string,\n    TProgramAddress extends Address = typeof LOADER_V3_PROGRAM_ADDRESS,\n>(\n    input: UpgradeInput<\n        TAccountProgramDataAccount,\n        TAccountProgramAccount,\n        TAccountBufferAccount,\n        TAccountSpillAccount,\n        TAccountRentSysvar,\n        TAccountClockSysvar,\n        TAccountAuthority\n    >,\n    config?: { programAddress?: TProgramAddress },\n): UpgradeInstruction<\n    TProgramAddress,\n    TAccountProgramDataAccount,\n    TAccountProgramAccount,\n    TAccountBufferAccount,\n    TAccountSpillAccount,\n    TAccountRentSysvar,\n    TAccountClockSysvar,\n    TAccountAuthority\n> {\n    // Program address.\n    const programAddress = config?.programAddress ?? LOADER_V3_PROGRAM_ADDRESS;\n\n    // Original accounts.\n    const originalAccounts = {\n        programDataAccount: { value: input.programDataAccount ?? null, isWritable: true },\n        programAccount: { value: input.programAccount ?? null, isWritable: true },\n        bufferAccount: { value: input.bufferAccount ?? null, isWritable: true },\n        spillAccount: { value: input.spillAccount ?? null, isWritable: true },\n        rentSysvar: { value: input.rentSysvar ?? null, isWritable: false },\n        clockSysvar: { value: input.clockSysvar ?? null, isWritable: false },\n        authority: { value: input.authority ?? null, isWritable: false },\n    };\n    const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n    // Resolve default values.\n    if (!accounts.rentSysvar.value) {\n        accounts.rentSysvar.value =\n            'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n    }\n    if (!accounts.clockSysvar.value) {\n        accounts.clockSysvar.value =\n            'SysvarC1ock11111111111111111111111111111111' as Address<'SysvarC1ock11111111111111111111111111111111'>;\n    }\n\n    const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n    return Object.freeze({\n        accounts: [\n            getAccountMeta('programDataAccount', accounts.programDataAccount),\n            getAccountMeta('programAccount', accounts.programAccount),\n            getAccountMeta('bufferAccount', accounts.bufferAccount),\n            getAccountMeta('spillAccount', accounts.spillAccount),\n            getAccountMeta('rentSysvar', accounts.rentSysvar),\n            getAccountMeta('clockSysvar', accounts.clockSysvar),\n            getAccountMeta('authority', accounts.authority),\n        ],\n        data: getUpgradeInstructionDataEncoder().encode({}),\n        programAddress,\n    } as UpgradeInstruction<\n        TProgramAddress,\n        TAccountProgramDataAccount,\n        TAccountProgramAccount,\n        TAccountBufferAccount,\n        TAccountSpillAccount,\n        TAccountRentSysvar,\n        TAccountClockSysvar,\n        TAccountAuthority\n    >);\n}\n\nexport type ParsedUpgradeInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n    programAddress: Address<TProgram>;\n    accounts: {\n        /** ProgramData account. */\n        programDataAccount: TAccountMetas[0];\n        /** Program account. */\n        programAccount: TAccountMetas[1];\n        /** Buffer account where the new program data has been written. */\n        bufferAccount: TAccountMetas[2];\n        /** Spill account. */\n        spillAccount: TAccountMetas[3];\n        /** Rent sysvar. */\n        rentSysvar: TAccountMetas[4];\n        /** Clock sysvar. */\n        clockSysvar: TAccountMetas[5];\n        /** Authority. */\n        authority: TAccountMetas[6];\n    };\n    data: UpgradeInstructionData;\n};\n\nexport function parseUpgradeInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n    instruction: Instruction<TProgram> &\n        InstructionWithAccounts<TAccountMetas> &\n        InstructionWithData<ReadonlyUint8Array>,\n): ParsedUpgradeInstruction<TProgram, TAccountMetas> {\n    if (instruction.accounts.length < 7) {\n        throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n            actualAccountMetas: instruction.accounts.length,\n            expectedAccountMetas: 7,\n        });\n    }\n    let accountIndex = 0;\n    const getNextAccount = () => {\n        const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n        accountIndex += 1;\n        return accountMeta;\n    };\n    return {\n        programAddress: instruction.programAddress,\n        accounts: {\n            programDataAccount: getNextAccount(),\n            programAccount: getNextAccount(),\n            bufferAccount: getNextAccount(),\n            spillAccount: getNextAccount(),\n            rentSysvar: getNextAccount(),\n            clockSysvar: getNextAccount(),\n            authority: getNextAccount(),\n        },\n        data: getUpgradeInstructionDataDecoder().decode(instruction.data),\n    };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n    addDecoderSizePrefix,\n    addEncoderSizePrefix,\n    combineCodec,\n    getBytesDecoder,\n    getBytesEncoder,\n    getStructDecoder,\n    getStructEncoder,\n    getU32Decoder,\n    getU32Encoder,\n    getU64Decoder,\n    getU64Encoder,\n    SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n    SolanaError,\n    transformEncoder,\n    type AccountMeta,\n    type AccountSignerMeta,\n    type Address,\n    type Codec,\n    type Decoder,\n    type Encoder,\n    type Instruction,\n    type InstructionWithAccounts,\n    type InstructionWithData,\n    type ReadonlySignerAccount,\n    type ReadonlyUint8Array,\n    type TransactionSigner,\n    type WritableAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/kit/program-client-core';\nimport { LOADER_V3_PROGRAM_ADDRESS } from '../programs';\n\nexport const WRITE_DISCRIMINATOR = 1;\n\nexport function getWriteDiscriminatorBytes(): ReadonlyUint8Array {\n    return getU32Encoder().encode(WRITE_DISCRIMINATOR);\n}\n\nexport type WriteInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountBufferAccount extends string | AccountMeta<string> = string,\n    TAccountBufferAuthority extends string | AccountMeta<string> = string,\n    TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n    InstructionWithData<ReadonlyUint8Array> &\n    InstructionWithAccounts<\n        [\n            TAccountBufferAccount extends string ? WritableAccount<TAccountBufferAccount> : TAccountBufferAccount,\n            TAccountBufferAuthority extends string\n                ? ReadonlySignerAccount<TAccountBufferAuthority> & AccountSignerMeta<TAccountBufferAuthority>\n                : TAccountBufferAuthority,\n            ...TRemainingAccounts,\n        ]\n    >;\n\nexport type WriteInstructionData = { discriminator: number; offset: number; bytes: ReadonlyUint8Array };\n\nexport type WriteInstructionDataArgs = { offset: number; bytes: ReadonlyUint8Array };\n\nexport function getWriteInstructionDataEncoder(): Encoder<WriteInstructionDataArgs> {\n    return transformEncoder(\n        getStructEncoder([\n            ['discriminator', getU32Encoder()],\n            ['offset', getU32Encoder()],\n            ['bytes', addEncoderSizePrefix(getBytesEncoder(), getU64Encoder())],\n        ]),\n        value => ({ ...value, discriminator: WRITE_DISCRIMINATOR }),\n    );\n}\n\nexport function getWriteInstructionDataDecoder(): Decoder<WriteInstructionData> {\n    return getStructDecoder([\n        ['discriminator', getU32Decoder()],\n        ['offset', getU32Decoder()],\n        ['bytes', addDecoderSizePrefix(getBytesDecoder(), getU64Decoder())],\n    ]);\n}\n\nexport function getWriteInstructionDataCodec(): Codec<WriteInstructionDataArgs, WriteInstructionData> {\n    return combineCodec(getWriteInstructionDataEncoder(), getWriteInstructionDataDecoder());\n}\n\nexport type WriteInput<\n    TAccountBufferAccount extends string = string,\n    TAccountBufferAuthority extends string = string,\n> = {\n    /** Buffer account. */\n    bufferAccount: Address<TAccountBufferAccount>;\n    /** Buffer authority. */\n    bufferAuthority: TransactionSigner<TAccountBufferAuthority>;\n    offset: WriteInstructionDataArgs['offset'];\n    bytes: WriteInstructionDataArgs['bytes'];\n};\n\nexport function getWriteInstruction<\n    TAccountBufferAccount extends string,\n    TAccountBufferAuthority extends string,\n    TProgramAddress extends Address = typeof LOADER_V3_PROGRAM_ADDRESS,\n>(\n    input: WriteInput<TAccountBufferAccount, TAccountBufferAuthority>,\n    config?: { programAddress?: TProgramAddress },\n): WriteInstruction<TProgramAddress, TAccountBufferAccount, TAccountBufferAuthority> {\n    // Program address.\n    const programAddress = config?.programAddress ?? LOADER_V3_PROGRAM_ADDRESS;\n\n    // Original accounts.\n    const originalAccounts = {\n        bufferAccount: { value: input.bufferAccount ?? null, isWritable: true },\n        bufferAuthority: { value: input.bufferAuthority ?? null, isWritable: false },\n    };\n    const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n    // Original args.\n    const args = { ...input };\n\n    const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n    return Object.freeze({\n        accounts: [\n            getAccountMeta('bufferAccount', accounts.bufferAccount),\n            getAccountMeta('bufferAuthority', accounts.bufferAuthority),\n        ],\n        data: getWriteInstructionDataEncoder().encode(args as WriteInstructionDataArgs),\n        programAddress,\n    } as WriteInstruction<TProgramAddress, TAccountBufferAccount, TAccountBufferAuthority>);\n}\n\nexport type ParsedWriteInstruction<\n    TProgram extends string = typeof LOADER_V3_PROGRAM_ADDRESS,\n    TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n    programAddress: Address<TProgram>;\n    accounts: {\n        /** Buffer account. */\n        bufferAccount: TAccountMetas[0];\n        /** Buffer authority. */\n        bufferAuthority: TAccountMetas[1];\n    };\n    data: WriteInstructionData;\n};\n\nexport function parseWriteInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n    instruction: Instruction<TProgram> &\n        InstructionWithAccounts<TAccountMetas> &\n        InstructionWithData<ReadonlyUint8Array>,\n): ParsedWriteInstruction<TProgram, TAccountMetas> {\n    if (instruction.accounts.length < 2) {\n        throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n            actualAccountMetas: instruction.accounts.length,\n            expectedAccountMetas: 2,\n        });\n    }\n    let accountIndex = 0;\n    const getNextAccount = () => {\n        const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n        accountIndex += 1;\n        return accountMeta;\n    };\n    return {\n        programAddress: instruction.programAddress,\n        accounts: { bufferAccount: getNextAccount(), bufferAuthority: getNextAccount() },\n        data: getWriteInstructionDataDecoder().decode(instruction.data),\n    };\n}\n"]}