/** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ import { assertIsInstructionWithAccounts, containsBytes, extendClient, fixEncoderSize, getBytesEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, SolanaError, type Address, type ClientWithPayer, type ClientWithRpc, type ClientWithTransactionPlanning, type ClientWithTransactionSending, type ExtendedClient, type GetAccountInfoApi, type GetMultipleAccountsApi, type Instruction, type InstructionWithData, type ReadonlyUint8Array, } from "@solana/kit"; import { addSelfFetchFunctions, addSelfPlanAndSendFunctions, type SelfFetchFunctions, type SelfPlanAndSendFunctions, } from "@solana/program-client-core"; import { getBundleCodec, getBundleCreatorAccountCodec, getBundleMasterAccountCodec, getBundleTempDataCodec, getOracleDataCodec, getReferrerAccountCodec, getStrategyCodec, getTokenizedBundleDepositorCodec, getUserBundleAccountCodec, type Bundle, type BundleArgs, type BundleCreatorAccount, type BundleCreatorAccountArgs, type BundleMasterAccount, type BundleMasterAccountArgs, type BundleTempData, type BundleTempDataArgs, type OracleData, type OracleDataArgs, type ReferrerAccount, type ReferrerAccountArgs, type Strategy, type StrategyArgs, type TokenizedBundleDepositor, type TokenizedBundleDepositorArgs, type UserBundleAccount, type UserBundleAccountArgs, } from "../accounts"; import { getAddStrategyInstructionAsync, getApplyFeesToTokenizedDepositorInstructionAsync, getApplyFeesToUserInstructionAsync, getChangeBundleMasterAdminInstructionAsync, getChangeManagerInstruction, getClearUserFeeOverrideInstructionAsync, getClearUserWithdrawalTimingOverrideInstructionAsync, getCloseUserBundleAccountInstructionAsync, getDistributeToReceiversInstructionAsync, getEnableStrategyInstructionAsync, getEndDistributionInstructionAsync, getInitializeBundleDepositorInstructionAsync, getInitializeBundleInstructionAsync, getInitializeBundleMasterAccountInstructionAsync, getInitializePermissionedBundleDepositorInstructionAsync, getInitializeTokenizedBundleDepositorInstructionAsync, getInstantMintBundleTokensInstructionAsync, getManagerWithdrawInstructionAsync, getManagerWithdrawWithSplitInstructionAsync, getNetPendingTransactionsInstructionAsync, getPauseDepositsWithdrawalsInstructionAsync, getPerformRefillInstructionAsync, getProcessDepositInstructionAsync, getProcessReferrerWithdrawalInstructionAsync, getProcessSwitchInstructionAsync, getProcessWithdrawalInstructionAsync, getReferrerRequestWithdrawInstructionAsync, getRefundDepositInstructionAsync, getRegisterReferrerInstructionAsync, getRemoveStrategyInstructionAsync, getRequestBundleSwitchInstructionAsync, getRequestDepositInstructionAsync, getRequestTokenWithdrawalInstructionAsync, getRequestWithdrawalInstructionAsync, getSetBundleCreatorInstructionAsync, getSetDelaysInstruction, getSetFeesInstruction, getSetIssuanceFeeInstruction, getSetKeeperInstruction, getSetMaxDepositAmountInstruction, getSetMinDepositAmountInstruction, getSetMintCapPerCycleInstructionAsync, getSetOracleBufferInstruction, getSetOracleMaxAgeInstruction, getSetOracleUpdateTimeLimitInstruction, getSetReferralTierConfigInstruction, getSetReferrerActiveInstruction, getSetReferrerConfigInstruction, getSetReferrerRateOverrideInstruction, getSetUserFeeOverrideInstructionAsync, getSetUserReferrerInstructionAsync, getSetUserWithdrawalTimingOverrideInstructionAsync, getSetWithdrawalRedemptionScheduleInstruction, getStartDistributionInstructionAsync, getUpdateAllocationsInstructionAsync, getUpdateOracleInstructionAsync, parseAddStrategyInstruction, parseApplyFeesToTokenizedDepositorInstruction, parseApplyFeesToUserInstruction, parseChangeBundleMasterAdminInstruction, parseChangeManagerInstruction, parseClearUserFeeOverrideInstruction, parseClearUserWithdrawalTimingOverrideInstruction, parseCloseUserBundleAccountInstruction, parseDistributeToReceiversInstruction, parseEnableStrategyInstruction, parseEndDistributionInstruction, parseInitializeBundleDepositorInstruction, parseInitializeBundleInstruction, parseInitializeBundleMasterAccountInstruction, parseInitializePermissionedBundleDepositorInstruction, parseInitializeTokenizedBundleDepositorInstruction, parseInstantMintBundleTokensInstruction, parseManagerWithdrawInstruction, parseManagerWithdrawWithSplitInstruction, parseNetPendingTransactionsInstruction, parsePauseDepositsWithdrawalsInstruction, parsePerformRefillInstruction, parseProcessDepositInstruction, parseProcessReferrerWithdrawalInstruction, parseProcessSwitchInstruction, parseProcessWithdrawalInstruction, parseReferrerRequestWithdrawInstruction, parseRefundDepositInstruction, parseRegisterReferrerInstruction, parseRemoveStrategyInstruction, parseRequestBundleSwitchInstruction, parseRequestDepositInstruction, parseRequestTokenWithdrawalInstruction, parseRequestWithdrawalInstruction, parseSetBundleCreatorInstruction, parseSetDelaysInstruction, parseSetFeesInstruction, parseSetIssuanceFeeInstruction, parseSetKeeperInstruction, parseSetMaxDepositAmountInstruction, parseSetMinDepositAmountInstruction, parseSetMintCapPerCycleInstruction, parseSetOracleBufferInstruction, parseSetOracleMaxAgeInstruction, parseSetOracleUpdateTimeLimitInstruction, parseSetReferralTierConfigInstruction, parseSetReferrerActiveInstruction, parseSetReferrerConfigInstruction, parseSetReferrerRateOverrideInstruction, parseSetUserFeeOverrideInstruction, parseSetUserReferrerInstruction, parseSetUserWithdrawalTimingOverrideInstruction, parseSetWithdrawalRedemptionScheduleInstruction, parseStartDistributionInstruction, parseUpdateAllocationsInstruction, parseUpdateOracleInstruction, type AddStrategyAsyncInput, type ApplyFeesToTokenizedDepositorAsyncInput, type ApplyFeesToUserAsyncInput, type ChangeBundleMasterAdminAsyncInput, type ChangeManagerInput, type ClearUserFeeOverrideAsyncInput, type ClearUserWithdrawalTimingOverrideAsyncInput, type CloseUserBundleAccountAsyncInput, type DistributeToReceiversAsyncInput, type EnableStrategyAsyncInput, type EndDistributionAsyncInput, type InitializeBundleAsyncInput, type InitializeBundleDepositorAsyncInput, type InitializeBundleMasterAccountAsyncInput, type InitializePermissionedBundleDepositorAsyncInput, type InitializeTokenizedBundleDepositorAsyncInput, type InstantMintBundleTokensAsyncInput, type ManagerWithdrawAsyncInput, type ManagerWithdrawWithSplitAsyncInput, type NetPendingTransactionsAsyncInput, type ParsedAddStrategyInstruction, type ParsedApplyFeesToTokenizedDepositorInstruction, type ParsedApplyFeesToUserInstruction, type ParsedChangeBundleMasterAdminInstruction, type ParsedChangeManagerInstruction, type ParsedClearUserFeeOverrideInstruction, type ParsedClearUserWithdrawalTimingOverrideInstruction, type ParsedCloseUserBundleAccountInstruction, type ParsedDistributeToReceiversInstruction, type ParsedEnableStrategyInstruction, type ParsedEndDistributionInstruction, type ParsedInitializeBundleDepositorInstruction, type ParsedInitializeBundleInstruction, type ParsedInitializeBundleMasterAccountInstruction, type ParsedInitializePermissionedBundleDepositorInstruction, type ParsedInitializeTokenizedBundleDepositorInstruction, type ParsedInstantMintBundleTokensInstruction, type ParsedManagerWithdrawInstruction, type ParsedManagerWithdrawWithSplitInstruction, type ParsedNetPendingTransactionsInstruction, type ParsedPauseDepositsWithdrawalsInstruction, type ParsedPerformRefillInstruction, type ParsedProcessDepositInstruction, type ParsedProcessReferrerWithdrawalInstruction, type ParsedProcessSwitchInstruction, type ParsedProcessWithdrawalInstruction, type ParsedReferrerRequestWithdrawInstruction, type ParsedRefundDepositInstruction, type ParsedRegisterReferrerInstruction, type ParsedRemoveStrategyInstruction, type ParsedRequestBundleSwitchInstruction, type ParsedRequestDepositInstruction, type ParsedRequestTokenWithdrawalInstruction, type ParsedRequestWithdrawalInstruction, type ParsedSetBundleCreatorInstruction, type ParsedSetDelaysInstruction, type ParsedSetFeesInstruction, type ParsedSetIssuanceFeeInstruction, type ParsedSetKeeperInstruction, type ParsedSetMaxDepositAmountInstruction, type ParsedSetMinDepositAmountInstruction, type ParsedSetMintCapPerCycleInstruction, type ParsedSetOracleBufferInstruction, type ParsedSetOracleMaxAgeInstruction, type ParsedSetOracleUpdateTimeLimitInstruction, type ParsedSetReferralTierConfigInstruction, type ParsedSetReferrerActiveInstruction, type ParsedSetReferrerConfigInstruction, type ParsedSetReferrerRateOverrideInstruction, type ParsedSetUserFeeOverrideInstruction, type ParsedSetUserReferrerInstruction, type ParsedSetUserWithdrawalTimingOverrideInstruction, type ParsedSetWithdrawalRedemptionScheduleInstruction, type ParsedStartDistributionInstruction, type ParsedUpdateAllocationsInstruction, type ParsedUpdateOracleInstruction, type PauseDepositsWithdrawalsAsyncInput, type PerformRefillAsyncInput, type ProcessDepositAsyncInput, type ProcessReferrerWithdrawalAsyncInput, type ProcessSwitchAsyncInput, type ProcessWithdrawalAsyncInput, type ReferrerRequestWithdrawAsyncInput, type RefundDepositAsyncInput, type RegisterReferrerAsyncInput, type RemoveStrategyAsyncInput, type RequestBundleSwitchAsyncInput, type RequestDepositAsyncInput, type RequestTokenWithdrawalAsyncInput, type RequestWithdrawalAsyncInput, type SetBundleCreatorAsyncInput, type SetDelaysInput, type SetFeesInput, type SetIssuanceFeeInput, type SetKeeperInput, type SetMaxDepositAmountInput, type SetMinDepositAmountInput, type SetMintCapPerCycleAsyncInput, type SetOracleBufferInput, type SetOracleMaxAgeInput, type SetOracleUpdateTimeLimitInput, type SetReferralTierConfigInput, type SetReferrerActiveInput, type SetReferrerConfigInput, type SetReferrerRateOverrideInput, type SetUserFeeOverrideAsyncInput, type SetUserReferrerAsyncInput, type SetUserWithdrawalTimingOverrideAsyncInput, type SetWithdrawalRedemptionScheduleInput, type StartDistributionAsyncInput, type UpdateAllocationsAsyncInput, type UpdateOracleAsyncInput, } from "../instructions"; import { findBundleAccountPda, findBundleAssetAuthorityPda, findBundleCreatorAccountPda, findBundleMasterAccountPda, findBundleTempDataPda, findCloseUserBundleAccountUserBundleAccountPda, findMintPda, findOracleDataPda, findPendingBundleAssetAuthorityPda, findReferrerAccountPda, findReferrerUserBundleAccountPda, findRequestBundleSwitchUserBundleAccountPda, findSourceBundleAssetAuthorityPda, findSourceBundleTempDataPda, findSourceOracleDataPda, findSourceUserBundleAccountPda, findStrategyAccountPda, findTargetBundleTempDataPda, findTargetOracleDataPda, findTargetPendingBundleAssetAuthorityPda, findTargetUserBundleAccountPda, findTokenAuthorityPda, findTokenizedBundleDepositorPda, findUserBundleAccountPda, } from "../pdas"; export const NTBUNDLE_PROGRAM_ADDRESS = "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU" as Address<"BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU">; export enum NtbundleAccount { Bundle, BundleCreatorAccount, BundleMasterAccount, BundleTempData, OracleData, ReferrerAccount, Strategy, TokenizedBundleDepositor, UserBundleAccount, } export function identifyNtbundleAccount( account: { data: ReadonlyUint8Array } | ReadonlyUint8Array, ): NtbundleAccount { const data = "data" in account ? account.data : account; if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([15, 82, 167, 230, 37, 214, 82, 80]), ), 0, ) ) { return NtbundleAccount.Bundle; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([210, 168, 93, 196, 184, 35, 210, 101]), ), 0, ) ) { return NtbundleAccount.BundleCreatorAccount; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([252, 50, 148, 252, 178, 231, 4, 149]), ), 0, ) ) { return NtbundleAccount.BundleMasterAccount; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([3, 137, 171, 33, 191, 15, 54, 4]), ), 0, ) ) { return NtbundleAccount.BundleTempData; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([26, 131, 25, 110, 6, 141, 10, 37]), ), 0, ) ) { return NtbundleAccount.OracleData; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([48, 19, 160, 54, 76, 220, 70, 9]), ), 0, ) ) { return NtbundleAccount.ReferrerAccount; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([174, 110, 39, 119, 82, 106, 169, 102]), ), 0, ) ) { return NtbundleAccount.Strategy; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([76, 78, 8, 31, 121, 235, 87, 100]), ), 0, ) ) { return NtbundleAccount.TokenizedBundleDepositor; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([32, 181, 106, 26, 67, 130, 185, 241]), ), 0, ) ) { return NtbundleAccount.UserBundleAccount; } throw new SolanaError( SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, { accountData: data, programName: "ntbundle" }, ); } export enum NtbundleInstruction { AddStrategy, ApplyFeesToTokenizedDepositor, ApplyFeesToUser, ChangeBundleMasterAdmin, ChangeManager, ClearUserFeeOverride, ClearUserWithdrawalTimingOverride, CloseUserBundleAccount, DistributeToReceivers, EnableStrategy, EndDistribution, InitializeBundle, InitializeBundleDepositor, InitializeBundleMasterAccount, InitializePermissionedBundleDepositor, InitializeTokenizedBundleDepositor, InstantMintBundleTokens, ManagerWithdraw, ManagerWithdrawWithSplit, NetPendingTransactions, PauseDepositsWithdrawals, PerformRefill, ProcessDeposit, ProcessReferrerWithdrawal, ProcessSwitch, ProcessWithdrawal, ReferrerRequestWithdraw, RefundDeposit, RegisterReferrer, RemoveStrategy, RequestBundleSwitch, RequestDeposit, RequestTokenWithdrawal, RequestWithdrawal, SetBundleCreator, SetDelays, SetFees, SetIssuanceFee, SetKeeper, SetMaxDepositAmount, SetMinDepositAmount, SetMintCapPerCycle, SetOracleBuffer, SetOracleMaxAge, SetOracleUpdateTimeLimit, SetReferralTierConfig, SetReferrerActive, SetReferrerConfig, SetReferrerRateOverride, SetUserFeeOverride, SetUserReferrer, SetUserWithdrawalTimingOverride, SetWithdrawalRedemptionSchedule, StartDistribution, UpdateAllocations, UpdateOracle, } export function identifyNtbundleInstruction( instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array, ): NtbundleInstruction { const data = "data" in instruction ? instruction.data : instruction; if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([64, 123, 127, 227, 192, 234, 198, 20]), ), 0, ) ) { return NtbundleInstruction.AddStrategy; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([237, 243, 229, 36, 146, 77, 86, 168]), ), 0, ) ) { return NtbundleInstruction.ApplyFeesToTokenizedDepositor; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([26, 41, 103, 167, 61, 147, 141, 30]), ), 0, ) ) { return NtbundleInstruction.ApplyFeesToUser; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([255, 41, 246, 82, 7, 81, 174, 112]), ), 0, ) ) { return NtbundleInstruction.ChangeBundleMasterAdmin; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([97, 44, 74, 213, 119, 243, 203, 8]), ), 0, ) ) { return NtbundleInstruction.ChangeManager; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([97, 227, 92, 191, 205, 0, 154, 77]), ), 0, ) ) { return NtbundleInstruction.ClearUserFeeOverride; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([203, 96, 230, 216, 217, 104, 244, 74]), ), 0, ) ) { return NtbundleInstruction.ClearUserWithdrawalTimingOverride; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([201, 195, 126, 228, 9, 173, 79, 215]), ), 0, ) ) { return NtbundleInstruction.CloseUserBundleAccount; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([123, 169, 151, 143, 0, 82, 209, 145]), ), 0, ) ) { return NtbundleInstruction.DistributeToReceivers; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([245, 37, 61, 122, 99, 92, 182, 30]), ), 0, ) ) { return NtbundleInstruction.EnableStrategy; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([201, 74, 167, 103, 102, 125, 0, 236]), ), 0, ) ) { return NtbundleInstruction.EndDistribution; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([93, 76, 148, 51, 99, 41, 179, 234]), ), 0, ) ) { return NtbundleInstruction.InitializeBundle; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([126, 6, 242, 36, 22, 209, 35, 2]), ), 0, ) ) { return NtbundleInstruction.InitializeBundleDepositor; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([125, 166, 190, 35, 73, 169, 140, 206]), ), 0, ) ) { return NtbundleInstruction.InitializeBundleMasterAccount; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([157, 162, 213, 42, 205, 201, 37, 255]), ), 0, ) ) { return NtbundleInstruction.InitializePermissionedBundleDepositor; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([56, 137, 71, 110, 14, 153, 246, 241]), ), 0, ) ) { return NtbundleInstruction.InitializeTokenizedBundleDepositor; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([56, 192, 88, 145, 75, 250, 148, 33]), ), 0, ) ) { return NtbundleInstruction.InstantMintBundleTokens; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([201, 248, 190, 143, 86, 43, 183, 254]), ), 0, ) ) { return NtbundleInstruction.ManagerWithdraw; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([225, 117, 84, 162, 37, 169, 153, 89]), ), 0, ) ) { return NtbundleInstruction.ManagerWithdrawWithSplit; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([44, 219, 50, 19, 246, 252, 37, 163]), ), 0, ) ) { return NtbundleInstruction.NetPendingTransactions; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([106, 171, 198, 31, 183, 219, 159, 80]), ), 0, ) ) { return NtbundleInstruction.PauseDepositsWithdrawals; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([241, 64, 6, 52, 58, 169, 15, 12]), ), 0, ) ) { return NtbundleInstruction.PerformRefill; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([136, 162, 64, 35, 84, 200, 254, 136]), ), 0, ) ) { return NtbundleInstruction.ProcessDeposit; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([78, 133, 153, 202, 251, 151, 146, 227]), ), 0, ) ) { return NtbundleInstruction.ProcessReferrerWithdrawal; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([186, 170, 0, 66, 104, 81, 57, 195]), ), 0, ) ) { return NtbundleInstruction.ProcessSwitch; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([51, 97, 236, 17, 37, 33, 196, 64]), ), 0, ) ) { return NtbundleInstruction.ProcessWithdrawal; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([14, 246, 94, 153, 127, 117, 147, 31]), ), 0, ) ) { return NtbundleInstruction.ReferrerRequestWithdraw; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([19, 19, 78, 50, 187, 10, 162, 229]), ), 0, ) ) { return NtbundleInstruction.RefundDeposit; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([122, 229, 215, 169, 100, 145, 198, 120]), ), 0, ) ) { return NtbundleInstruction.RegisterReferrer; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([185, 238, 33, 91, 134, 210, 97, 26]), ), 0, ) ) { return NtbundleInstruction.RemoveStrategy; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([66, 9, 104, 111, 227, 251, 51, 176]), ), 0, ) ) { return NtbundleInstruction.RequestBundleSwitch; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([243, 202, 197, 215, 135, 97, 213, 109]), ), 0, ) ) { return NtbundleInstruction.RequestDeposit; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([138, 108, 216, 213, 7, 119, 182, 63]), ), 0, ) ) { return NtbundleInstruction.RequestTokenWithdrawal; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([251, 85, 121, 205, 56, 201, 12, 177]), ), 0, ) ) { return NtbundleInstruction.RequestWithdrawal; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([190, 144, 93, 89, 14, 138, 195, 166]), ), 0, ) ) { return NtbundleInstruction.SetBundleCreator; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([18, 56, 143, 125, 147, 15, 199, 108]), ), 0, ) ) { return NtbundleInstruction.SetDelays; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([137, 178, 49, 58, 0, 245, 242, 190]), ), 0, ) ) { return NtbundleInstruction.SetFees; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([44, 117, 252, 159, 144, 198, 56, 169]), ), 0, ) ) { return NtbundleInstruction.SetIssuanceFee; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([102, 94, 23, 78, 157, 222, 243, 214]), ), 0, ) ) { return NtbundleInstruction.SetKeeper; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([29, 66, 217, 12, 80, 248, 214, 9]), ), 0, ) ) { return NtbundleInstruction.SetMaxDepositAmount; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([224, 153, 215, 211, 233, 14, 124, 128]), ), 0, ) ) { return NtbundleInstruction.SetMinDepositAmount; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([114, 75, 182, 13, 172, 126, 102, 237]), ), 0, ) ) { return NtbundleInstruction.SetMintCapPerCycle; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([7, 196, 14, 82, 110, 244, 46, 33]), ), 0, ) ) { return NtbundleInstruction.SetOracleBuffer; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([75, 127, 254, 84, 122, 23, 122, 82]), ), 0, ) ) { return NtbundleInstruction.SetOracleMaxAge; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([114, 2, 35, 146, 19, 99, 67, 202]), ), 0, ) ) { return NtbundleInstruction.SetOracleUpdateTimeLimit; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([9, 78, 137, 136, 182, 116, 76, 138]), ), 0, ) ) { return NtbundleInstruction.SetReferralTierConfig; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([173, 21, 130, 158, 15, 1, 83, 24]), ), 0, ) ) { return NtbundleInstruction.SetReferrerActive; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([85, 90, 76, 126, 69, 34, 205, 22]), ), 0, ) ) { return NtbundleInstruction.SetReferrerConfig; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([117, 110, 164, 192, 156, 211, 27, 46]), ), 0, ) ) { return NtbundleInstruction.SetReferrerRateOverride; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([207, 40, 210, 198, 66, 33, 153, 209]), ), 0, ) ) { return NtbundleInstruction.SetUserFeeOverride; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([71, 167, 153, 60, 26, 30, 50, 114]), ), 0, ) ) { return NtbundleInstruction.SetUserReferrer; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([21, 31, 116, 121, 140, 237, 174, 244]), ), 0, ) ) { return NtbundleInstruction.SetUserWithdrawalTimingOverride; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([134, 108, 237, 103, 185, 13, 177, 105]), ), 0, ) ) { return NtbundleInstruction.SetWithdrawalRedemptionSchedule; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([118, 230, 215, 75, 83, 2, 163, 35]), ), 0, ) ) { return NtbundleInstruction.StartDistribution; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([229, 242, 146, 124, 44, 15, 130, 95]), ), 0, ) ) { return NtbundleInstruction.UpdateAllocations; } if ( containsBytes( data, fixEncoderSize(getBytesEncoder(), 8).encode( new Uint8Array([112, 41, 209, 18, 248, 226, 252, 188]), ), 0, ) ) { return NtbundleInstruction.UpdateOracle; } throw new SolanaError( SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, { instructionData: data, programName: "ntbundle" }, ); } export type ParsedNtbundleInstruction< TProgram extends string = "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU", > = | ({ instructionType: NtbundleInstruction.AddStrategy; } & ParsedAddStrategyInstruction) | ({ instructionType: NtbundleInstruction.ApplyFeesToTokenizedDepositor; } & ParsedApplyFeesToTokenizedDepositorInstruction) | ({ instructionType: NtbundleInstruction.ApplyFeesToUser; } & ParsedApplyFeesToUserInstruction) | ({ instructionType: NtbundleInstruction.ChangeBundleMasterAdmin; } & ParsedChangeBundleMasterAdminInstruction) | ({ instructionType: NtbundleInstruction.ChangeManager; } & ParsedChangeManagerInstruction) | ({ instructionType: NtbundleInstruction.ClearUserFeeOverride; } & ParsedClearUserFeeOverrideInstruction) | ({ instructionType: NtbundleInstruction.ClearUserWithdrawalTimingOverride; } & ParsedClearUserWithdrawalTimingOverrideInstruction) | ({ instructionType: NtbundleInstruction.CloseUserBundleAccount; } & ParsedCloseUserBundleAccountInstruction) | ({ instructionType: NtbundleInstruction.DistributeToReceivers; } & ParsedDistributeToReceiversInstruction) | ({ instructionType: NtbundleInstruction.EnableStrategy; } & ParsedEnableStrategyInstruction) | ({ instructionType: NtbundleInstruction.EndDistribution; } & ParsedEndDistributionInstruction) | ({ instructionType: NtbundleInstruction.InitializeBundle; } & ParsedInitializeBundleInstruction) | ({ instructionType: NtbundleInstruction.InitializeBundleDepositor; } & ParsedInitializeBundleDepositorInstruction) | ({ instructionType: NtbundleInstruction.InitializeBundleMasterAccount; } & ParsedInitializeBundleMasterAccountInstruction) | ({ instructionType: NtbundleInstruction.InitializePermissionedBundleDepositor; } & ParsedInitializePermissionedBundleDepositorInstruction) | ({ instructionType: NtbundleInstruction.InitializeTokenizedBundleDepositor; } & ParsedInitializeTokenizedBundleDepositorInstruction) | ({ instructionType: NtbundleInstruction.InstantMintBundleTokens; } & ParsedInstantMintBundleTokensInstruction) | ({ instructionType: NtbundleInstruction.ManagerWithdraw; } & ParsedManagerWithdrawInstruction) | ({ instructionType: NtbundleInstruction.ManagerWithdrawWithSplit; } & ParsedManagerWithdrawWithSplitInstruction) | ({ instructionType: NtbundleInstruction.NetPendingTransactions; } & ParsedNetPendingTransactionsInstruction) | ({ instructionType: NtbundleInstruction.PauseDepositsWithdrawals; } & ParsedPauseDepositsWithdrawalsInstruction) | ({ instructionType: NtbundleInstruction.PerformRefill; } & ParsedPerformRefillInstruction) | ({ instructionType: NtbundleInstruction.ProcessDeposit; } & ParsedProcessDepositInstruction) | ({ instructionType: NtbundleInstruction.ProcessReferrerWithdrawal; } & ParsedProcessReferrerWithdrawalInstruction) | ({ instructionType: NtbundleInstruction.ProcessSwitch; } & ParsedProcessSwitchInstruction) | ({ instructionType: NtbundleInstruction.ProcessWithdrawal; } & ParsedProcessWithdrawalInstruction) | ({ instructionType: NtbundleInstruction.ReferrerRequestWithdraw; } & ParsedReferrerRequestWithdrawInstruction) | ({ instructionType: NtbundleInstruction.RefundDeposit; } & ParsedRefundDepositInstruction) | ({ instructionType: NtbundleInstruction.RegisterReferrer; } & ParsedRegisterReferrerInstruction) | ({ instructionType: NtbundleInstruction.RemoveStrategy; } & ParsedRemoveStrategyInstruction) | ({ instructionType: NtbundleInstruction.RequestBundleSwitch; } & ParsedRequestBundleSwitchInstruction) | ({ instructionType: NtbundleInstruction.RequestDeposit; } & ParsedRequestDepositInstruction) | ({ instructionType: NtbundleInstruction.RequestTokenWithdrawal; } & ParsedRequestTokenWithdrawalInstruction) | ({ instructionType: NtbundleInstruction.RequestWithdrawal; } & ParsedRequestWithdrawalInstruction) | ({ instructionType: NtbundleInstruction.SetBundleCreator; } & ParsedSetBundleCreatorInstruction) | ({ instructionType: NtbundleInstruction.SetDelays; } & ParsedSetDelaysInstruction) | ({ instructionType: NtbundleInstruction.SetFees; } & ParsedSetFeesInstruction) | ({ instructionType: NtbundleInstruction.SetIssuanceFee; } & ParsedSetIssuanceFeeInstruction) | ({ instructionType: NtbundleInstruction.SetKeeper; } & ParsedSetKeeperInstruction) | ({ instructionType: NtbundleInstruction.SetMaxDepositAmount; } & ParsedSetMaxDepositAmountInstruction) | ({ instructionType: NtbundleInstruction.SetMinDepositAmount; } & ParsedSetMinDepositAmountInstruction) | ({ instructionType: NtbundleInstruction.SetMintCapPerCycle; } & ParsedSetMintCapPerCycleInstruction) | ({ instructionType: NtbundleInstruction.SetOracleBuffer; } & ParsedSetOracleBufferInstruction) | ({ instructionType: NtbundleInstruction.SetOracleMaxAge; } & ParsedSetOracleMaxAgeInstruction) | ({ instructionType: NtbundleInstruction.SetOracleUpdateTimeLimit; } & ParsedSetOracleUpdateTimeLimitInstruction) | ({ instructionType: NtbundleInstruction.SetReferralTierConfig; } & ParsedSetReferralTierConfigInstruction) | ({ instructionType: NtbundleInstruction.SetReferrerActive; } & ParsedSetReferrerActiveInstruction) | ({ instructionType: NtbundleInstruction.SetReferrerConfig; } & ParsedSetReferrerConfigInstruction) | ({ instructionType: NtbundleInstruction.SetReferrerRateOverride; } & ParsedSetReferrerRateOverrideInstruction) | ({ instructionType: NtbundleInstruction.SetUserFeeOverride; } & ParsedSetUserFeeOverrideInstruction) | ({ instructionType: NtbundleInstruction.SetUserReferrer; } & ParsedSetUserReferrerInstruction) | ({ instructionType: NtbundleInstruction.SetUserWithdrawalTimingOverride; } & ParsedSetUserWithdrawalTimingOverrideInstruction) | ({ instructionType: NtbundleInstruction.SetWithdrawalRedemptionSchedule; } & ParsedSetWithdrawalRedemptionScheduleInstruction) | ({ instructionType: NtbundleInstruction.StartDistribution; } & ParsedStartDistributionInstruction) | ({ instructionType: NtbundleInstruction.UpdateAllocations; } & ParsedUpdateAllocationsInstruction) | ({ instructionType: NtbundleInstruction.UpdateOracle; } & ParsedUpdateOracleInstruction); export function parseNtbundleInstruction( instruction: Instruction & InstructionWithData, ): ParsedNtbundleInstruction { const instructionType = identifyNtbundleInstruction(instruction); switch (instructionType) { case NtbundleInstruction.AddStrategy: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.AddStrategy, ...parseAddStrategyInstruction(instruction), }; } case NtbundleInstruction.ApplyFeesToTokenizedDepositor: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ApplyFeesToTokenizedDepositor, ...parseApplyFeesToTokenizedDepositorInstruction(instruction), }; } case NtbundleInstruction.ApplyFeesToUser: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ApplyFeesToUser, ...parseApplyFeesToUserInstruction(instruction), }; } case NtbundleInstruction.ChangeBundleMasterAdmin: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ChangeBundleMasterAdmin, ...parseChangeBundleMasterAdminInstruction(instruction), }; } case NtbundleInstruction.ChangeManager: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ChangeManager, ...parseChangeManagerInstruction(instruction), }; } case NtbundleInstruction.ClearUserFeeOverride: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ClearUserFeeOverride, ...parseClearUserFeeOverrideInstruction(instruction), }; } case NtbundleInstruction.ClearUserWithdrawalTimingOverride: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ClearUserWithdrawalTimingOverride, ...parseClearUserWithdrawalTimingOverrideInstruction(instruction), }; } case NtbundleInstruction.CloseUserBundleAccount: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.CloseUserBundleAccount, ...parseCloseUserBundleAccountInstruction(instruction), }; } case NtbundleInstruction.DistributeToReceivers: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.DistributeToReceivers, ...parseDistributeToReceiversInstruction(instruction), }; } case NtbundleInstruction.EnableStrategy: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.EnableStrategy, ...parseEnableStrategyInstruction(instruction), }; } case NtbundleInstruction.EndDistribution: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.EndDistribution, ...parseEndDistributionInstruction(instruction), }; } case NtbundleInstruction.InitializeBundle: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.InitializeBundle, ...parseInitializeBundleInstruction(instruction), }; } case NtbundleInstruction.InitializeBundleDepositor: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.InitializeBundleDepositor, ...parseInitializeBundleDepositorInstruction(instruction), }; } case NtbundleInstruction.InitializeBundleMasterAccount: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.InitializeBundleMasterAccount, ...parseInitializeBundleMasterAccountInstruction(instruction), }; } case NtbundleInstruction.InitializePermissionedBundleDepositor: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.InitializePermissionedBundleDepositor, ...parseInitializePermissionedBundleDepositorInstruction(instruction), }; } case NtbundleInstruction.InitializeTokenizedBundleDepositor: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.InitializeTokenizedBundleDepositor, ...parseInitializeTokenizedBundleDepositorInstruction(instruction), }; } case NtbundleInstruction.InstantMintBundleTokens: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.InstantMintBundleTokens, ...parseInstantMintBundleTokensInstruction(instruction), }; } case NtbundleInstruction.ManagerWithdraw: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ManagerWithdraw, ...parseManagerWithdrawInstruction(instruction), }; } case NtbundleInstruction.ManagerWithdrawWithSplit: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ManagerWithdrawWithSplit, ...parseManagerWithdrawWithSplitInstruction(instruction), }; } case NtbundleInstruction.NetPendingTransactions: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.NetPendingTransactions, ...parseNetPendingTransactionsInstruction(instruction), }; } case NtbundleInstruction.PauseDepositsWithdrawals: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.PauseDepositsWithdrawals, ...parsePauseDepositsWithdrawalsInstruction(instruction), }; } case NtbundleInstruction.PerformRefill: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.PerformRefill, ...parsePerformRefillInstruction(instruction), }; } case NtbundleInstruction.ProcessDeposit: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ProcessDeposit, ...parseProcessDepositInstruction(instruction), }; } case NtbundleInstruction.ProcessReferrerWithdrawal: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ProcessReferrerWithdrawal, ...parseProcessReferrerWithdrawalInstruction(instruction), }; } case NtbundleInstruction.ProcessSwitch: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ProcessSwitch, ...parseProcessSwitchInstruction(instruction), }; } case NtbundleInstruction.ProcessWithdrawal: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ProcessWithdrawal, ...parseProcessWithdrawalInstruction(instruction), }; } case NtbundleInstruction.ReferrerRequestWithdraw: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.ReferrerRequestWithdraw, ...parseReferrerRequestWithdrawInstruction(instruction), }; } case NtbundleInstruction.RefundDeposit: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.RefundDeposit, ...parseRefundDepositInstruction(instruction), }; } case NtbundleInstruction.RegisterReferrer: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.RegisterReferrer, ...parseRegisterReferrerInstruction(instruction), }; } case NtbundleInstruction.RemoveStrategy: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.RemoveStrategy, ...parseRemoveStrategyInstruction(instruction), }; } case NtbundleInstruction.RequestBundleSwitch: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.RequestBundleSwitch, ...parseRequestBundleSwitchInstruction(instruction), }; } case NtbundleInstruction.RequestDeposit: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.RequestDeposit, ...parseRequestDepositInstruction(instruction), }; } case NtbundleInstruction.RequestTokenWithdrawal: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.RequestTokenWithdrawal, ...parseRequestTokenWithdrawalInstruction(instruction), }; } case NtbundleInstruction.RequestWithdrawal: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.RequestWithdrawal, ...parseRequestWithdrawalInstruction(instruction), }; } case NtbundleInstruction.SetBundleCreator: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetBundleCreator, ...parseSetBundleCreatorInstruction(instruction), }; } case NtbundleInstruction.SetDelays: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetDelays, ...parseSetDelaysInstruction(instruction), }; } case NtbundleInstruction.SetFees: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetFees, ...parseSetFeesInstruction(instruction), }; } case NtbundleInstruction.SetIssuanceFee: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetIssuanceFee, ...parseSetIssuanceFeeInstruction(instruction), }; } case NtbundleInstruction.SetKeeper: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetKeeper, ...parseSetKeeperInstruction(instruction), }; } case NtbundleInstruction.SetMaxDepositAmount: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetMaxDepositAmount, ...parseSetMaxDepositAmountInstruction(instruction), }; } case NtbundleInstruction.SetMinDepositAmount: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetMinDepositAmount, ...parseSetMinDepositAmountInstruction(instruction), }; } case NtbundleInstruction.SetMintCapPerCycle: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetMintCapPerCycle, ...parseSetMintCapPerCycleInstruction(instruction), }; } case NtbundleInstruction.SetOracleBuffer: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetOracleBuffer, ...parseSetOracleBufferInstruction(instruction), }; } case NtbundleInstruction.SetOracleMaxAge: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetOracleMaxAge, ...parseSetOracleMaxAgeInstruction(instruction), }; } case NtbundleInstruction.SetOracleUpdateTimeLimit: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetOracleUpdateTimeLimit, ...parseSetOracleUpdateTimeLimitInstruction(instruction), }; } case NtbundleInstruction.SetReferralTierConfig: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetReferralTierConfig, ...parseSetReferralTierConfigInstruction(instruction), }; } case NtbundleInstruction.SetReferrerActive: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetReferrerActive, ...parseSetReferrerActiveInstruction(instruction), }; } case NtbundleInstruction.SetReferrerConfig: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetReferrerConfig, ...parseSetReferrerConfigInstruction(instruction), }; } case NtbundleInstruction.SetReferrerRateOverride: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetReferrerRateOverride, ...parseSetReferrerRateOverrideInstruction(instruction), }; } case NtbundleInstruction.SetUserFeeOverride: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetUserFeeOverride, ...parseSetUserFeeOverrideInstruction(instruction), }; } case NtbundleInstruction.SetUserReferrer: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetUserReferrer, ...parseSetUserReferrerInstruction(instruction), }; } case NtbundleInstruction.SetUserWithdrawalTimingOverride: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetUserWithdrawalTimingOverride, ...parseSetUserWithdrawalTimingOverrideInstruction(instruction), }; } case NtbundleInstruction.SetWithdrawalRedemptionSchedule: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.SetWithdrawalRedemptionSchedule, ...parseSetWithdrawalRedemptionScheduleInstruction(instruction), }; } case NtbundleInstruction.StartDistribution: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.StartDistribution, ...parseStartDistributionInstruction(instruction), }; } case NtbundleInstruction.UpdateAllocations: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.UpdateAllocations, ...parseUpdateAllocationsInstruction(instruction), }; } case NtbundleInstruction.UpdateOracle: { assertIsInstructionWithAccounts(instruction); return { instructionType: NtbundleInstruction.UpdateOracle, ...parseUpdateOracleInstruction(instruction), }; } default: throw new SolanaError( SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, { instructionType: instructionType as string, programName: "ntbundle" }, ); } } export type NtbundlePlugin = { accounts: NtbundlePluginAccounts; instructions: NtbundlePluginInstructions; pdas: NtbundlePluginPdas; identifyAccount: typeof identifyNtbundleAccount; identifyInstruction: typeof identifyNtbundleInstruction; parseInstruction: typeof parseNtbundleInstruction; }; export type NtbundlePluginAccounts = { bundle: ReturnType & SelfFetchFunctions; bundleCreatorAccount: ReturnType & SelfFetchFunctions; bundleMasterAccount: ReturnType & SelfFetchFunctions; bundleTempData: ReturnType & SelfFetchFunctions; oracleData: ReturnType & SelfFetchFunctions; referrerAccount: ReturnType & SelfFetchFunctions; strategy: ReturnType & SelfFetchFunctions; tokenizedBundleDepositor: ReturnType< typeof getTokenizedBundleDepositorCodec > & SelfFetchFunctions; userBundleAccount: ReturnType & SelfFetchFunctions; }; export type NtbundlePluginInstructions = { addStrategy: ( input: AddStrategyAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; applyFeesToTokenizedDepositor: ( input: ApplyFeesToTokenizedDepositorAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; applyFeesToUser: ( input: ApplyFeesToUserAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; changeBundleMasterAdmin: ( input: ChangeBundleMasterAdminAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; changeManager: ( input: ChangeManagerInput, ) => ReturnType & SelfPlanAndSendFunctions; clearUserFeeOverride: ( input: ClearUserFeeOverrideAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; clearUserWithdrawalTimingOverride: ( input: ClearUserWithdrawalTimingOverrideAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; closeUserBundleAccount: ( input: CloseUserBundleAccountAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; distributeToReceivers: ( input: DistributeToReceiversAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; enableStrategy: ( input: EnableStrategyAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; endDistribution: ( input: EndDistributionAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; initializeBundle: ( input: InitializeBundleAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; initializeBundleDepositor: ( input: MakeOptional, ) => ReturnType & SelfPlanAndSendFunctions; initializeBundleMasterAccount: ( input: InitializeBundleMasterAccountAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; initializePermissionedBundleDepositor: ( input: MakeOptional< InitializePermissionedBundleDepositorAsyncInput, "payer" >, ) => ReturnType< typeof getInitializePermissionedBundleDepositorInstructionAsync > & SelfPlanAndSendFunctions; initializeTokenizedBundleDepositor: ( input: InitializeTokenizedBundleDepositorAsyncInput, ) => ReturnType< typeof getInitializeTokenizedBundleDepositorInstructionAsync > & SelfPlanAndSendFunctions; instantMintBundleTokens: ( input: InstantMintBundleTokensAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; managerWithdraw: ( input: ManagerWithdrawAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; managerWithdrawWithSplit: ( input: ManagerWithdrawWithSplitAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; netPendingTransactions: ( input: NetPendingTransactionsAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; pauseDepositsWithdrawals: ( input: PauseDepositsWithdrawalsAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; performRefill: ( input: PerformRefillAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; processDeposit: ( input: ProcessDepositAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; processReferrerWithdrawal: ( input: ProcessReferrerWithdrawalAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; processSwitch: ( input: ProcessSwitchAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; processWithdrawal: ( input: ProcessWithdrawalAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; referrerRequestWithdraw: ( input: ReferrerRequestWithdrawAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; refundDeposit: ( input: RefundDepositAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; registerReferrer: ( input: RegisterReferrerAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; removeStrategy: ( input: RemoveStrategyAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; requestBundleSwitch: ( input: RequestBundleSwitchAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; requestDeposit: ( input: RequestDepositAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; requestTokenWithdrawal: ( input: RequestTokenWithdrawalAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; requestWithdrawal: ( input: RequestWithdrawalAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; setBundleCreator: ( input: SetBundleCreatorAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; setDelays: ( input: SetDelaysInput, ) => ReturnType & SelfPlanAndSendFunctions; setFees: ( input: SetFeesInput, ) => ReturnType & SelfPlanAndSendFunctions; setIssuanceFee: ( input: SetIssuanceFeeInput, ) => ReturnType & SelfPlanAndSendFunctions; setKeeper: ( input: SetKeeperInput, ) => ReturnType & SelfPlanAndSendFunctions; setMaxDepositAmount: ( input: SetMaxDepositAmountInput, ) => ReturnType & SelfPlanAndSendFunctions; setMinDepositAmount: ( input: SetMinDepositAmountInput, ) => ReturnType & SelfPlanAndSendFunctions; setMintCapPerCycle: ( input: SetMintCapPerCycleAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; setOracleBuffer: ( input: SetOracleBufferInput, ) => ReturnType & SelfPlanAndSendFunctions; setOracleMaxAge: ( input: SetOracleMaxAgeInput, ) => ReturnType & SelfPlanAndSendFunctions; setOracleUpdateTimeLimit: ( input: SetOracleUpdateTimeLimitInput, ) => ReturnType & SelfPlanAndSendFunctions; setReferralTierConfig: ( input: SetReferralTierConfigInput, ) => ReturnType & SelfPlanAndSendFunctions; setReferrerActive: ( input: SetReferrerActiveInput, ) => ReturnType & SelfPlanAndSendFunctions; setReferrerConfig: ( input: SetReferrerConfigInput, ) => ReturnType & SelfPlanAndSendFunctions; setReferrerRateOverride: ( input: SetReferrerRateOverrideInput, ) => ReturnType & SelfPlanAndSendFunctions; setUserFeeOverride: ( input: SetUserFeeOverrideAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; setUserReferrer: ( input: SetUserReferrerAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; setUserWithdrawalTimingOverride: ( input: SetUserWithdrawalTimingOverrideAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; setWithdrawalRedemptionSchedule: ( input: SetWithdrawalRedemptionScheduleInput, ) => ReturnType & SelfPlanAndSendFunctions; startDistribution: ( input: StartDistributionAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; updateAllocations: ( input: UpdateAllocationsAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; updateOracle: ( input: UpdateOracleAsyncInput, ) => ReturnType & SelfPlanAndSendFunctions; }; export type NtbundlePluginPdas = { strategyAccount: typeof findStrategyAccountPda; bundleTempData: typeof findBundleTempDataPda; oracleData: typeof findOracleDataPda; tokenizedBundleDepositor: typeof findTokenizedBundleDepositorPda; userBundleAccount: typeof findUserBundleAccountPda; bundleAssetAuthority: typeof findBundleAssetAuthorityPda; bundleMasterAccount: typeof findBundleMasterAccountPda; closeUserBundleAccountUserBundleAccount: typeof findCloseUserBundleAccountUserBundleAccountPda; bundleCreatorAccount: typeof findBundleCreatorAccountPda; bundleAccount: typeof findBundleAccountPda; tokenAuthority: typeof findTokenAuthorityPda; mint: typeof findMintPda; pendingBundleAssetAuthority: typeof findPendingBundleAssetAuthorityPda; sourceUserBundleAccount: typeof findSourceUserBundleAccountPda; sourceBundleAssetAuthority: typeof findSourceBundleAssetAuthorityPda; sourceBundleTempData: typeof findSourceBundleTempDataPda; sourceOracleData: typeof findSourceOracleDataPda; targetUserBundleAccount: typeof findTargetUserBundleAccountPda; targetBundleTempData: typeof findTargetBundleTempDataPda; targetPendingBundleAssetAuthority: typeof findTargetPendingBundleAssetAuthorityPda; targetOracleData: typeof findTargetOracleDataPda; referrerAccount: typeof findReferrerAccountPda; referrerUserBundleAccount: typeof findReferrerUserBundleAccountPda; requestBundleSwitchUserBundleAccount: typeof findRequestBundleSwitchUserBundleAccountPda; }; export type NtbundlePluginRequirements = ClientWithRpc< GetAccountInfoApi & GetMultipleAccountsApi > & ClientWithPayer & ClientWithTransactionPlanning & ClientWithTransactionSending; export function ntbundleProgram() { return ( client: T, ): ExtendedClient => { return extendClient(client, { ntbundle: { accounts: { bundle: addSelfFetchFunctions(client, getBundleCodec()), bundleCreatorAccount: addSelfFetchFunctions( client, getBundleCreatorAccountCodec(), ), bundleMasterAccount: addSelfFetchFunctions( client, getBundleMasterAccountCodec(), ), bundleTempData: addSelfFetchFunctions( client, getBundleTempDataCodec(), ), oracleData: addSelfFetchFunctions(client, getOracleDataCodec()), referrerAccount: addSelfFetchFunctions( client, getReferrerAccountCodec(), ), strategy: addSelfFetchFunctions(client, getStrategyCodec()), tokenizedBundleDepositor: addSelfFetchFunctions( client, getTokenizedBundleDepositorCodec(), ), userBundleAccount: addSelfFetchFunctions( client, getUserBundleAccountCodec(), ), }, instructions: { addStrategy: (input) => addSelfPlanAndSendFunctions( client, getAddStrategyInstructionAsync(input), ), applyFeesToTokenizedDepositor: (input) => addSelfPlanAndSendFunctions( client, getApplyFeesToTokenizedDepositorInstructionAsync(input), ), applyFeesToUser: (input) => addSelfPlanAndSendFunctions( client, getApplyFeesToUserInstructionAsync(input), ), changeBundleMasterAdmin: (input) => addSelfPlanAndSendFunctions( client, getChangeBundleMasterAdminInstructionAsync(input), ), changeManager: (input) => addSelfPlanAndSendFunctions( client, getChangeManagerInstruction(input), ), clearUserFeeOverride: (input) => addSelfPlanAndSendFunctions( client, getClearUserFeeOverrideInstructionAsync(input), ), clearUserWithdrawalTimingOverride: (input) => addSelfPlanAndSendFunctions( client, getClearUserWithdrawalTimingOverrideInstructionAsync(input), ), closeUserBundleAccount: (input) => addSelfPlanAndSendFunctions( client, getCloseUserBundleAccountInstructionAsync(input), ), distributeToReceivers: (input) => addSelfPlanAndSendFunctions( client, getDistributeToReceiversInstructionAsync(input), ), enableStrategy: (input) => addSelfPlanAndSendFunctions( client, getEnableStrategyInstructionAsync(input), ), endDistribution: (input) => addSelfPlanAndSendFunctions( client, getEndDistributionInstructionAsync(input), ), initializeBundle: (input) => addSelfPlanAndSendFunctions( client, getInitializeBundleInstructionAsync(input), ), initializeBundleDepositor: (input) => addSelfPlanAndSendFunctions( client, getInitializeBundleDepositorInstructionAsync({ ...input, payer: input.payer ?? client.payer, }), ), initializeBundleMasterAccount: (input) => addSelfPlanAndSendFunctions( client, getInitializeBundleMasterAccountInstructionAsync(input), ), initializePermissionedBundleDepositor: (input) => addSelfPlanAndSendFunctions( client, getInitializePermissionedBundleDepositorInstructionAsync({ ...input, payer: input.payer ?? client.payer, }), ), initializeTokenizedBundleDepositor: (input) => addSelfPlanAndSendFunctions( client, getInitializeTokenizedBundleDepositorInstructionAsync(input), ), instantMintBundleTokens: (input) => addSelfPlanAndSendFunctions( client, getInstantMintBundleTokensInstructionAsync(input), ), managerWithdraw: (input) => addSelfPlanAndSendFunctions( client, getManagerWithdrawInstructionAsync(input), ), managerWithdrawWithSplit: (input) => addSelfPlanAndSendFunctions( client, getManagerWithdrawWithSplitInstructionAsync(input), ), netPendingTransactions: (input) => addSelfPlanAndSendFunctions( client, getNetPendingTransactionsInstructionAsync(input), ), pauseDepositsWithdrawals: (input) => addSelfPlanAndSendFunctions( client, getPauseDepositsWithdrawalsInstructionAsync(input), ), performRefill: (input) => addSelfPlanAndSendFunctions( client, getPerformRefillInstructionAsync(input), ), processDeposit: (input) => addSelfPlanAndSendFunctions( client, getProcessDepositInstructionAsync(input), ), processReferrerWithdrawal: (input) => addSelfPlanAndSendFunctions( client, getProcessReferrerWithdrawalInstructionAsync(input), ), processSwitch: (input) => addSelfPlanAndSendFunctions( client, getProcessSwitchInstructionAsync(input), ), processWithdrawal: (input) => addSelfPlanAndSendFunctions( client, getProcessWithdrawalInstructionAsync(input), ), referrerRequestWithdraw: (input) => addSelfPlanAndSendFunctions( client, getReferrerRequestWithdrawInstructionAsync(input), ), refundDeposit: (input) => addSelfPlanAndSendFunctions( client, getRefundDepositInstructionAsync(input), ), registerReferrer: (input) => addSelfPlanAndSendFunctions( client, getRegisterReferrerInstructionAsync(input), ), removeStrategy: (input) => addSelfPlanAndSendFunctions( client, getRemoveStrategyInstructionAsync(input), ), requestBundleSwitch: (input) => addSelfPlanAndSendFunctions( client, getRequestBundleSwitchInstructionAsync(input), ), requestDeposit: (input) => addSelfPlanAndSendFunctions( client, getRequestDepositInstructionAsync(input), ), requestTokenWithdrawal: (input) => addSelfPlanAndSendFunctions( client, getRequestTokenWithdrawalInstructionAsync(input), ), requestWithdrawal: (input) => addSelfPlanAndSendFunctions( client, getRequestWithdrawalInstructionAsync(input), ), setBundleCreator: (input) => addSelfPlanAndSendFunctions( client, getSetBundleCreatorInstructionAsync(input), ), setDelays: (input) => addSelfPlanAndSendFunctions(client, getSetDelaysInstruction(input)), setFees: (input) => addSelfPlanAndSendFunctions(client, getSetFeesInstruction(input)), setIssuanceFee: (input) => addSelfPlanAndSendFunctions( client, getSetIssuanceFeeInstruction(input), ), setKeeper: (input) => addSelfPlanAndSendFunctions(client, getSetKeeperInstruction(input)), setMaxDepositAmount: (input) => addSelfPlanAndSendFunctions( client, getSetMaxDepositAmountInstruction(input), ), setMinDepositAmount: (input) => addSelfPlanAndSendFunctions( client, getSetMinDepositAmountInstruction(input), ), setMintCapPerCycle: (input) => addSelfPlanAndSendFunctions( client, getSetMintCapPerCycleInstructionAsync(input), ), setOracleBuffer: (input) => addSelfPlanAndSendFunctions( client, getSetOracleBufferInstruction(input), ), setOracleMaxAge: (input) => addSelfPlanAndSendFunctions( client, getSetOracleMaxAgeInstruction(input), ), setOracleUpdateTimeLimit: (input) => addSelfPlanAndSendFunctions( client, getSetOracleUpdateTimeLimitInstruction(input), ), setReferralTierConfig: (input) => addSelfPlanAndSendFunctions( client, getSetReferralTierConfigInstruction(input), ), setReferrerActive: (input) => addSelfPlanAndSendFunctions( client, getSetReferrerActiveInstruction(input), ), setReferrerConfig: (input) => addSelfPlanAndSendFunctions( client, getSetReferrerConfigInstruction(input), ), setReferrerRateOverride: (input) => addSelfPlanAndSendFunctions( client, getSetReferrerRateOverrideInstruction(input), ), setUserFeeOverride: (input) => addSelfPlanAndSendFunctions( client, getSetUserFeeOverrideInstructionAsync(input), ), setUserReferrer: (input) => addSelfPlanAndSendFunctions( client, getSetUserReferrerInstructionAsync(input), ), setUserWithdrawalTimingOverride: (input) => addSelfPlanAndSendFunctions( client, getSetUserWithdrawalTimingOverrideInstructionAsync(input), ), setWithdrawalRedemptionSchedule: (input) => addSelfPlanAndSendFunctions( client, getSetWithdrawalRedemptionScheduleInstruction(input), ), startDistribution: (input) => addSelfPlanAndSendFunctions( client, getStartDistributionInstructionAsync(input), ), updateAllocations: (input) => addSelfPlanAndSendFunctions( client, getUpdateAllocationsInstructionAsync(input), ), updateOracle: (input) => addSelfPlanAndSendFunctions( client, getUpdateOracleInstructionAsync(input), ), }, pdas: { strategyAccount: findStrategyAccountPda, bundleTempData: findBundleTempDataPda, oracleData: findOracleDataPda, tokenizedBundleDepositor: findTokenizedBundleDepositorPda, userBundleAccount: findUserBundleAccountPda, bundleAssetAuthority: findBundleAssetAuthorityPda, bundleMasterAccount: findBundleMasterAccountPda, closeUserBundleAccountUserBundleAccount: findCloseUserBundleAccountUserBundleAccountPda, bundleCreatorAccount: findBundleCreatorAccountPda, bundleAccount: findBundleAccountPda, tokenAuthority: findTokenAuthorityPda, mint: findMintPda, pendingBundleAssetAuthority: findPendingBundleAssetAuthorityPda, sourceUserBundleAccount: findSourceUserBundleAccountPda, sourceBundleAssetAuthority: findSourceBundleAssetAuthorityPda, sourceBundleTempData: findSourceBundleTempDataPda, sourceOracleData: findSourceOracleDataPda, targetUserBundleAccount: findTargetUserBundleAccountPda, targetBundleTempData: findTargetBundleTempDataPda, targetPendingBundleAssetAuthority: findTargetPendingBundleAssetAuthorityPda, targetOracleData: findTargetOracleDataPda, referrerAccount: findReferrerAccountPda, referrerUserBundleAccount: findReferrerUserBundleAccountPda, requestBundleSwitchUserBundleAccount: findRequestBundleSwitchUserBundleAccountPda, }, identifyAccount: identifyNtbundleAccount, identifyInstruction: identifyNtbundleInstruction, parseInstruction: parseNtbundleInstruction, }, }); }; } type MakeOptional = Omit & Partial>;