@solana/subscriptions 0.4.0-rc.2 → 0.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/accounts/decode.ts","../src/generated/accounts/eventAuthority.ts","../src/generated/pdas/eventAuthority.ts","../src/generated/pdas/fixedDelegation.ts","../src/generated/pdas/plan.ts","../src/generated/pdas/recurringDelegation.ts","../src/generated/pdas/subscriptionAuthority.ts","../src/generated/pdas/subscriptionDelegation.ts","../src/generated/accounts/fixedDelegation.ts","../src/generated/types/accountDiscriminator.ts","../src/generated/types/createFixedDelegationData.ts","../src/generated/types/createRecurringDelegationData.ts","../src/generated/types/header.ts","../src/generated/types/planData.ts","../src/generated/types/planStatus.ts","../src/generated/types/planTerms.ts","../src/generated/types/subscribeData.ts","../src/generated/types/transferData.ts","../src/generated/types/updatePlanData.ts","../src/generated/accounts/plan.ts","../src/generated/accounts/recurringDelegation.ts","../src/generated/accounts/subscriptionAuthority.ts","../src/generated/accounts/subscriptionDelegation.ts","../src/generated/errors/subscriptions.ts","../src/generated/programs/subscriptions.ts","../src/generated/instructions/cancelSubscription.ts","../src/generated/instructions/closeSubscriptionAuthority.ts","../src/generated/instructions/createFixedDelegation.ts","../src/generated/instructions/createPlan.ts","../src/generated/instructions/createRecurringDelegation.ts","../src/generated/instructions/deletePlan.ts","../src/generated/instructions/initSubscriptionAuthority.ts","../src/generated/instructions/resumeSubscription.ts","../src/generated/instructions/revokeAbandonedDelegation.ts","../src/generated/instructions/revokeAbandonedSubscription.ts","../src/generated/instructions/revokeDelegation.ts","../src/generated/instructions/revokeSubscriptionAuthority.ts","../src/generated/instructions/subscribe.ts","../src/generated/instructions/transferFixed.ts","../src/generated/instructions/transferRecurring.ts","../src/generated/instructions/transferSubscription.ts","../src/generated/instructions/updatePlan.ts","../src/constants.ts","../src/accounts/delegations.ts","../src/accounts/plans.ts","../src/accounts/subscriptions.ts","../src/plugin.ts","../src/transfer-hook.ts","../src/validators.ts"],"sourcesContent":["import type {\n AccountInfoBase,\n AccountInfoWithBase64EncodedData,\n AccountInfoWithPubkey,\n Address,\n EncodedAccount,\n} from '@solana/kit';\nimport { getBase64Encoder } from '@solana/kit';\n\nimport { DISCRIMINATOR_OFFSET } from '../constants.js';\nimport {\n AccountDiscriminator,\n decodeFixedDelegation,\n decodeRecurringDelegation,\n decodeSubscriptionDelegation,\n} from '../generated/index.js';\nimport type { Delegation } from '../types/delegation.js';\n\n/** Raw account shape returned by `getProgramAccounts` RPC calls. */\nexport type RawProgramAccount = AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>;\n\n/**\n * Converts a {@link RawProgramAccount} into Kit's `EncodedAccount` format for use with Codama decoders.\n *\n * @param raw - The raw account as returned by `getProgramAccounts`.\n * @param programAddress - The program address that owns the account.\n * @returns An `EncodedAccount` with base64-decoded data.\n */\nexport function toEncodedAccount(raw: RawProgramAccount, programAddress: Address): EncodedAccount {\n const base64Encoder = getBase64Encoder();\n const data = base64Encoder.encode(raw.account.data[0]);\n return {\n address: raw.pubkey,\n data,\n executable: raw.account.executable,\n lamports: raw.account.lamports,\n programAddress,\n space: raw.account.space,\n };\n}\n\n/**\n * Decodes a raw program account into a {@link Delegation} by inspecting the discriminator byte.\n *\n * @param raw - The raw account as returned by `getProgramAccounts`.\n * @param programAddress - The program address that owns the account.\n * @returns The decoded {@link Delegation}, or `null` if the discriminator is unrecognized.\n */\nexport function decodeDelegationAccount(raw: RawProgramAccount, programAddress: Address): Delegation | null {\n const encoded = toEncodedAccount(raw, programAddress);\n const kind = encoded.data[DISCRIMINATOR_OFFSET] as AccountDiscriminator | undefined;\n\n switch (kind) {\n case AccountDiscriminator.FixedDelegation: {\n const decoded = decodeFixedDelegation(encoded);\n return {\n address: raw.pubkey,\n data: decoded.data,\n kind: 'fixed',\n };\n }\n case AccountDiscriminator.RecurringDelegation: {\n const decoded = decodeRecurringDelegation(encoded);\n return {\n address: raw.pubkey,\n data: decoded.data,\n kind: 'recurring',\n };\n }\n case AccountDiscriminator.SubscriptionDelegation: {\n const decoded = decodeSubscriptionDelegation(encoded);\n return {\n address: raw.pubkey,\n data: decoded.data,\n kind: 'subscription',\n };\n }\n default:\n console.warn(`Unknown delegation discriminator: ${kind}`);\n return null;\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getStructDecoder,\n getStructEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findEventAuthorityPda } from '../pdas';\n\nexport type EventAuthority = {};\n\nexport type EventAuthorityArgs = EventAuthority;\n\n/** Gets the encoder for {@link EventAuthorityArgs} account data. */\nexport function getEventAuthorityEncoder(): FixedSizeEncoder<EventAuthorityArgs> {\n return getStructEncoder([]);\n}\n\n/** Gets the decoder for {@link EventAuthority} account data. */\nexport function getEventAuthorityDecoder(): FixedSizeDecoder<EventAuthority> {\n return getStructDecoder([]);\n}\n\n/** Gets the codec for {@link EventAuthority} account data. */\nexport function getEventAuthorityCodec(): FixedSizeCodec<EventAuthorityArgs, EventAuthority> {\n return combineCodec(getEventAuthorityEncoder(), getEventAuthorityDecoder());\n}\n\nexport function decodeEventAuthority<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<EventAuthority, TAddress>;\nexport function decodeEventAuthority<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<EventAuthority, TAddress>;\nexport function decodeEventAuthority<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<EventAuthority, TAddress> | MaybeAccount<EventAuthority, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getEventAuthorityDecoder());\n}\n\nexport async function fetchEventAuthority<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<EventAuthority, TAddress>> {\n const maybeAccount = await fetchMaybeEventAuthority(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeEventAuthority<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<EventAuthority, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeEventAuthority(maybeAccount);\n}\n\nexport async function fetchAllEventAuthority(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<EventAuthority>[]> {\n const maybeAccounts = await fetchAllMaybeEventAuthority(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeEventAuthority(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<EventAuthority>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeEventAuthority(maybeAccount));\n}\n\nexport async function fetchEventAuthorityFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<EventAuthority>> {\n const maybeAccount = await fetchMaybeEventAuthorityFromSeeds(rpc, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeEventAuthorityFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<EventAuthority>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findEventAuthorityPda({ programAddress });\n return await fetchMaybeEventAuthority(rpc, address, fetchConfig);\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 { getProgramDerivedAddress, getUtf8Encoder, type Address, type ProgramDerivedAddress } from '@solana/kit';\n\nexport async function findEventAuthorityPda(\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({ programAddress, seeds: [getUtf8Encoder().encode('event_authority')] });\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 getAddressEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type FixedDelegationSeeds = {\n subscriptionAuthority: Address;\n delegator: Address;\n delegatee: Address;\n nonce: number | bigint;\n};\n\nexport async function findFixedDelegationPda(\n seeds: FixedDelegationSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('delegation'),\n getAddressEncoder().encode(seeds.subscriptionAuthority),\n getAddressEncoder().encode(seeds.delegator),\n getAddressEncoder().encode(seeds.delegatee),\n getU64Encoder().encode(seeds.nonce),\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 getAddressEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type PlanSeeds = {\n owner: Address;\n planId: number | bigint;\n};\n\nexport async function findPlanPda(\n seeds: PlanSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('plan'),\n getAddressEncoder().encode(seeds.owner),\n getU64Encoder().encode(seeds.planId),\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 getAddressEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type RecurringDelegationSeeds = {\n subscriptionAuthority: Address;\n delegator: Address;\n delegatee: Address;\n nonce: number | bigint;\n};\n\nexport async function findRecurringDelegationPda(\n seeds: RecurringDelegationSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('delegation'),\n getAddressEncoder().encode(seeds.subscriptionAuthority),\n getAddressEncoder().encode(seeds.delegator),\n getAddressEncoder().encode(seeds.delegatee),\n getU64Encoder().encode(seeds.nonce),\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 getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type SubscriptionAuthoritySeeds = {\n user: Address;\n tokenMint: Address;\n};\n\nexport async function findSubscriptionAuthorityPda(\n seeds: SubscriptionAuthoritySeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('SubscriptionAuthority'),\n getAddressEncoder().encode(seeds.user),\n getAddressEncoder().encode(seeds.tokenMint),\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 getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type SubscriptionDelegationSeeds = {\n planPda: Address;\n subscriber: Address;\n};\n\nexport async function findSubscriptionDelegationPda(\n seeds: SubscriptionDelegationSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('subscription'),\n getAddressEncoder().encode(seeds.planPda),\n getAddressEncoder().encode(seeds.subscriber),\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findFixedDelegationPda, FixedDelegationSeeds } from '../pdas';\nimport { getHeaderDecoder, getHeaderEncoder, type Header, type HeaderArgs } from '../types';\n\nexport type FixedDelegation = {\n header: Header;\n subscriptionAuthority: Address;\n mint: Address;\n amount: bigint;\n expiryTs: bigint;\n};\n\nexport type FixedDelegationArgs = {\n header: HeaderArgs;\n subscriptionAuthority: Address;\n mint: Address;\n amount: number | bigint;\n expiryTs: number | bigint;\n};\n\n/** Gets the encoder for {@link FixedDelegationArgs} account data. */\nexport function getFixedDelegationEncoder(): FixedSizeEncoder<FixedDelegationArgs> {\n return getStructEncoder([\n ['header', getHeaderEncoder()],\n ['subscriptionAuthority', getAddressEncoder()],\n ['mint', getAddressEncoder()],\n ['amount', getU64Encoder()],\n ['expiryTs', getI64Encoder()],\n ]);\n}\n\n/** Gets the decoder for {@link FixedDelegation} account data. */\nexport function getFixedDelegationDecoder(): FixedSizeDecoder<FixedDelegation> {\n return getStructDecoder([\n ['header', getHeaderDecoder()],\n ['subscriptionAuthority', getAddressDecoder()],\n ['mint', getAddressDecoder()],\n ['amount', getU64Decoder()],\n ['expiryTs', getI64Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link FixedDelegation} account data. */\nexport function getFixedDelegationCodec(): FixedSizeCodec<FixedDelegationArgs, FixedDelegation> {\n return combineCodec(getFixedDelegationEncoder(), getFixedDelegationDecoder());\n}\n\nexport function decodeFixedDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<FixedDelegation, TAddress>;\nexport function decodeFixedDelegation<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<FixedDelegation, TAddress>;\nexport function decodeFixedDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<FixedDelegation, TAddress> | MaybeAccount<FixedDelegation, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getFixedDelegationDecoder());\n}\n\nexport async function fetchFixedDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<FixedDelegation, TAddress>> {\n const maybeAccount = await fetchMaybeFixedDelegation(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeFixedDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<FixedDelegation, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeFixedDelegation(maybeAccount);\n}\n\nexport async function fetchAllFixedDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<FixedDelegation>[]> {\n const maybeAccounts = await fetchAllMaybeFixedDelegation(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeFixedDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<FixedDelegation>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeFixedDelegation(maybeAccount));\n}\n\nexport async function fetchFixedDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: FixedDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<FixedDelegation>> {\n const maybeAccount = await fetchMaybeFixedDelegationFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeFixedDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: FixedDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<FixedDelegation>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findFixedDelegationPda(seeds, { programAddress });\n return await fetchMaybeFixedDelegation(rpc, address, fetchConfig);\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 getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport enum AccountDiscriminator {\n SubscriptionAuthority,\n Plan,\n FixedDelegation,\n RecurringDelegation,\n SubscriptionDelegation,\n}\n\nexport type AccountDiscriminatorArgs = AccountDiscriminator;\n\nexport function getAccountDiscriminatorEncoder(): FixedSizeEncoder<AccountDiscriminatorArgs> {\n return getEnumEncoder(AccountDiscriminator);\n}\n\nexport function getAccountDiscriminatorDecoder(): FixedSizeDecoder<AccountDiscriminator> {\n return getEnumDecoder(AccountDiscriminator);\n}\n\nexport function getAccountDiscriminatorCodec(): FixedSizeCodec<AccountDiscriminatorArgs, AccountDiscriminator> {\n return combineCodec(getAccountDiscriminatorEncoder(), getAccountDiscriminatorDecoder());\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 getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type CreateFixedDelegationData = {\n nonce: bigint;\n amount: bigint;\n expiryTs: bigint;\n expectedSubscriptionAuthorityInitId: bigint;\n};\n\nexport type CreateFixedDelegationDataArgs = {\n nonce: number | bigint;\n amount: number | bigint;\n expiryTs: number | bigint;\n expectedSubscriptionAuthorityInitId: number | bigint;\n};\n\nexport function getCreateFixedDelegationDataEncoder(): FixedSizeEncoder<CreateFixedDelegationDataArgs> {\n return getStructEncoder([\n ['nonce', getU64Encoder()],\n ['amount', getU64Encoder()],\n ['expiryTs', getI64Encoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Encoder()],\n ]);\n}\n\nexport function getCreateFixedDelegationDataDecoder(): FixedSizeDecoder<CreateFixedDelegationData> {\n return getStructDecoder([\n ['nonce', getU64Decoder()],\n ['amount', getU64Decoder()],\n ['expiryTs', getI64Decoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Decoder()],\n ]);\n}\n\nexport function getCreateFixedDelegationDataCodec(): FixedSizeCodec<\n CreateFixedDelegationDataArgs,\n CreateFixedDelegationData\n> {\n return combineCodec(getCreateFixedDelegationDataEncoder(), getCreateFixedDelegationDataDecoder());\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 getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type CreateRecurringDelegationData = {\n nonce: bigint;\n amountPerPeriod: bigint;\n periodLengthS: bigint;\n startTs: bigint;\n expiryTs: bigint;\n expectedSubscriptionAuthorityInitId: bigint;\n};\n\nexport type CreateRecurringDelegationDataArgs = {\n nonce: number | bigint;\n amountPerPeriod: number | bigint;\n periodLengthS: number | bigint;\n startTs: number | bigint;\n expiryTs: number | bigint;\n expectedSubscriptionAuthorityInitId: number | bigint;\n};\n\nexport function getCreateRecurringDelegationDataEncoder(): FixedSizeEncoder<CreateRecurringDelegationDataArgs> {\n return getStructEncoder([\n ['nonce', getU64Encoder()],\n ['amountPerPeriod', getU64Encoder()],\n ['periodLengthS', getU64Encoder()],\n ['startTs', getI64Encoder()],\n ['expiryTs', getI64Encoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Encoder()],\n ]);\n}\n\nexport function getCreateRecurringDelegationDataDecoder(): FixedSizeDecoder<CreateRecurringDelegationData> {\n return getStructDecoder([\n ['nonce', getU64Decoder()],\n ['amountPerPeriod', getU64Decoder()],\n ['periodLengthS', getU64Decoder()],\n ['startTs', getI64Decoder()],\n ['expiryTs', getI64Decoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Decoder()],\n ]);\n}\n\nexport function getCreateRecurringDelegationDataCodec(): FixedSizeCodec<\n CreateRecurringDelegationDataArgs,\n CreateRecurringDelegationData\n> {\n return combineCodec(getCreateRecurringDelegationDataEncoder(), getCreateRecurringDelegationDataDecoder());\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 getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type Header = {\n discriminator: number;\n version: number;\n bump: number;\n delegator: Address;\n delegatee: Address;\n payer: Address;\n initId: bigint;\n};\n\nexport type HeaderArgs = {\n discriminator: number;\n version: number;\n bump: number;\n delegator: Address;\n delegatee: Address;\n payer: Address;\n initId: number | bigint;\n};\n\nexport function getHeaderEncoder(): FixedSizeEncoder<HeaderArgs> {\n return getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['version', getU8Encoder()],\n ['bump', getU8Encoder()],\n ['delegator', getAddressEncoder()],\n ['delegatee', getAddressEncoder()],\n ['payer', getAddressEncoder()],\n ['initId', getI64Encoder()],\n ]);\n}\n\nexport function getHeaderDecoder(): FixedSizeDecoder<Header> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['version', getU8Decoder()],\n ['bump', getU8Decoder()],\n ['delegator', getAddressDecoder()],\n ['delegatee', getAddressDecoder()],\n ['payer', getAddressDecoder()],\n ['initId', getI64Decoder()],\n ]);\n}\n\nexport function getHeaderCodec(): FixedSizeCodec<HeaderArgs, Header> {\n return combineCodec(getHeaderEncoder(), getHeaderDecoder());\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 fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\nimport { getPlanTermsDecoder, getPlanTermsEncoder, type PlanTerms, type PlanTermsArgs } from '.';\n\nexport type PlanData = {\n planId: bigint;\n mint: Address;\n terms: PlanTerms;\n endTs: bigint;\n destinations: Array<Address>;\n pullers: Array<Address>;\n metadataUri: string;\n};\n\nexport type PlanDataArgs = {\n planId: number | bigint;\n mint: Address;\n terms: PlanTermsArgs;\n endTs: number | bigint;\n destinations: Array<Address>;\n pullers: Array<Address>;\n metadataUri: string;\n};\n\nexport function getPlanDataEncoder(): FixedSizeEncoder<PlanDataArgs> {\n return getStructEncoder([\n ['planId', getU64Encoder()],\n ['mint', getAddressEncoder()],\n ['terms', getPlanTermsEncoder()],\n ['endTs', getI64Encoder()],\n ['destinations', getArrayEncoder(getAddressEncoder(), { size: 4 })],\n ['pullers', getArrayEncoder(getAddressEncoder(), { size: 4 })],\n ['metadataUri', fixEncoderSize(getUtf8Encoder(), 128)],\n ]);\n}\n\nexport function getPlanDataDecoder(): FixedSizeDecoder<PlanData> {\n return getStructDecoder([\n ['planId', getU64Decoder()],\n ['mint', getAddressDecoder()],\n ['terms', getPlanTermsDecoder()],\n ['endTs', getI64Decoder()],\n ['destinations', getArrayDecoder(getAddressDecoder(), { size: 4 })],\n ['pullers', getArrayDecoder(getAddressDecoder(), { size: 4 })],\n ['metadataUri', fixDecoderSize(getUtf8Decoder(), 128)],\n ]);\n}\n\nexport function getPlanDataCodec(): FixedSizeCodec<PlanDataArgs, PlanData> {\n return combineCodec(getPlanDataEncoder(), getPlanDataDecoder());\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 getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport enum PlanStatus {\n Sunset,\n Active,\n}\n\nexport type PlanStatusArgs = PlanStatus;\n\nexport function getPlanStatusEncoder(): FixedSizeEncoder<PlanStatusArgs> {\n return getEnumEncoder(PlanStatus);\n}\n\nexport function getPlanStatusDecoder(): FixedSizeDecoder<PlanStatus> {\n return getEnumDecoder(PlanStatus);\n}\n\nexport function getPlanStatusCodec(): FixedSizeCodec<PlanStatusArgs, PlanStatus> {\n return combineCodec(getPlanStatusEncoder(), getPlanStatusDecoder());\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 getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type PlanTerms = { amount: bigint; periodHours: bigint; createdAt: bigint };\n\nexport type PlanTermsArgs = { amount: number | bigint; periodHours: number | bigint; createdAt: number | bigint };\n\nexport function getPlanTermsEncoder(): FixedSizeEncoder<PlanTermsArgs> {\n return getStructEncoder([\n ['amount', getU64Encoder()],\n ['periodHours', getU64Encoder()],\n ['createdAt', getI64Encoder()],\n ]);\n}\n\nexport function getPlanTermsDecoder(): FixedSizeDecoder<PlanTerms> {\n return getStructDecoder([\n ['amount', getU64Decoder()],\n ['periodHours', getU64Decoder()],\n ['createdAt', getI64Decoder()],\n ]);\n}\n\nexport function getPlanTermsCodec(): FixedSizeCodec<PlanTermsArgs, PlanTerms> {\n return combineCodec(getPlanTermsEncoder(), getPlanTermsDecoder());\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 getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type SubscribeData = {\n planId: bigint;\n planBump: number;\n expectedMint: Address;\n expectedAmount: bigint;\n expectedPeriodHours: bigint;\n expectedCreatedAt: bigint;\n expectedSubscriptionAuthorityInitId: bigint;\n};\n\nexport type SubscribeDataArgs = {\n planId: number | bigint;\n planBump: number;\n expectedMint: Address;\n expectedAmount: number | bigint;\n expectedPeriodHours: number | bigint;\n expectedCreatedAt: number | bigint;\n expectedSubscriptionAuthorityInitId: number | bigint;\n};\n\nexport function getSubscribeDataEncoder(): FixedSizeEncoder<SubscribeDataArgs> {\n return getStructEncoder([\n ['planId', getU64Encoder()],\n ['planBump', getU8Encoder()],\n ['expectedMint', getAddressEncoder()],\n ['expectedAmount', getU64Encoder()],\n ['expectedPeriodHours', getU64Encoder()],\n ['expectedCreatedAt', getI64Encoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Encoder()],\n ]);\n}\n\nexport function getSubscribeDataDecoder(): FixedSizeDecoder<SubscribeData> {\n return getStructDecoder([\n ['planId', getU64Decoder()],\n ['planBump', getU8Decoder()],\n ['expectedMint', getAddressDecoder()],\n ['expectedAmount', getU64Decoder()],\n ['expectedPeriodHours', getU64Decoder()],\n ['expectedCreatedAt', getI64Decoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Decoder()],\n ]);\n}\n\nexport function getSubscribeDataCodec(): FixedSizeCodec<SubscribeDataArgs, SubscribeData> {\n return combineCodec(getSubscribeDataEncoder(), getSubscribeDataDecoder());\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 getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type TransferData = { amount: bigint; delegator: Address; mint: Address };\n\nexport type TransferDataArgs = { amount: number | bigint; delegator: Address; mint: Address };\n\nexport function getTransferDataEncoder(): FixedSizeEncoder<TransferDataArgs> {\n return getStructEncoder([\n ['amount', getU64Encoder()],\n ['delegator', getAddressEncoder()],\n ['mint', getAddressEncoder()],\n ]);\n}\n\nexport function getTransferDataDecoder(): FixedSizeDecoder<TransferData> {\n return getStructDecoder([\n ['amount', getU64Decoder()],\n ['delegator', getAddressDecoder()],\n ['mint', getAddressDecoder()],\n ]);\n}\n\nexport function getTransferDataCodec(): FixedSizeCodec<TransferDataArgs, TransferData> {\n return combineCodec(getTransferDataEncoder(), getTransferDataDecoder());\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 fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type UpdatePlanData = { status: number; endTs: bigint; pullers: Array<Address>; metadataUri: string };\n\nexport type UpdatePlanDataArgs = {\n status: number;\n endTs: number | bigint;\n pullers: Array<Address>;\n metadataUri: string;\n};\n\nexport function getUpdatePlanDataEncoder(): FixedSizeEncoder<UpdatePlanDataArgs> {\n return getStructEncoder([\n ['status', getU8Encoder()],\n ['endTs', getI64Encoder()],\n ['pullers', getArrayEncoder(getAddressEncoder(), { size: 4 })],\n ['metadataUri', fixEncoderSize(getUtf8Encoder(), 128)],\n ]);\n}\n\nexport function getUpdatePlanDataDecoder(): FixedSizeDecoder<UpdatePlanData> {\n return getStructDecoder([\n ['status', getU8Decoder()],\n ['endTs', getI64Decoder()],\n ['pullers', getArrayDecoder(getAddressDecoder(), { size: 4 })],\n ['metadataUri', fixDecoderSize(getUtf8Decoder(), 128)],\n ]);\n}\n\nexport function getUpdatePlanDataCodec(): FixedSizeCodec<UpdatePlanDataArgs, UpdatePlanData> {\n return combineCodec(getUpdatePlanDataEncoder(), getUpdatePlanDataDecoder());\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findPlanPda, PlanSeeds } from '../pdas';\nimport { getPlanDataDecoder, getPlanDataEncoder, type PlanData, type PlanDataArgs } from '../types';\n\nexport type Plan = { discriminator: number; owner: Address; bump: number; status: number; data: PlanData };\n\nexport type PlanArgs = { discriminator: number; owner: Address; bump: number; status: number; data: PlanDataArgs };\n\n/** Gets the encoder for {@link PlanArgs} account data. */\nexport function getPlanEncoder(): FixedSizeEncoder<PlanArgs> {\n return getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['owner', getAddressEncoder()],\n ['bump', getU8Encoder()],\n ['status', getU8Encoder()],\n ['data', getPlanDataEncoder()],\n ]);\n}\n\n/** Gets the decoder for {@link Plan} account data. */\nexport function getPlanDecoder(): FixedSizeDecoder<Plan> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['owner', getAddressDecoder()],\n ['bump', getU8Decoder()],\n ['status', getU8Decoder()],\n ['data', getPlanDataDecoder()],\n ]);\n}\n\n/** Gets the codec for {@link Plan} account data. */\nexport function getPlanCodec(): FixedSizeCodec<PlanArgs, Plan> {\n return combineCodec(getPlanEncoder(), getPlanDecoder());\n}\n\nexport function decodePlan<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Plan, TAddress>;\nexport function decodePlan<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Plan, TAddress>;\nexport function decodePlan<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Plan, TAddress> | MaybeAccount<Plan, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getPlanDecoder());\n}\n\nexport async function fetchPlan<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Plan, TAddress>> {\n const maybeAccount = await fetchMaybePlan(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybePlan<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Plan, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodePlan(maybeAccount);\n}\n\nexport async function fetchAllPlan(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Plan>[]> {\n const maybeAccounts = await fetchAllMaybePlan(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybePlan(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Plan>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodePlan(maybeAccount));\n}\n\nexport async function fetchPlanFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: PlanSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<Plan>> {\n const maybeAccount = await fetchMaybePlanFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybePlanFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: PlanSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<Plan>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findPlanPda(seeds, { programAddress });\n return await fetchMaybePlan(rpc, address, fetchConfig);\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findRecurringDelegationPda, RecurringDelegationSeeds } from '../pdas';\nimport { getHeaderDecoder, getHeaderEncoder, type Header, type HeaderArgs } from '../types';\n\nexport type RecurringDelegation = {\n header: Header;\n subscriptionAuthority: Address;\n mint: Address;\n currentPeriodStartTs: bigint;\n periodLengthS: bigint;\n expiryTs: bigint;\n amountPerPeriod: bigint;\n amountPulledInPeriod: bigint;\n};\n\nexport type RecurringDelegationArgs = {\n header: HeaderArgs;\n subscriptionAuthority: Address;\n mint: Address;\n currentPeriodStartTs: number | bigint;\n periodLengthS: number | bigint;\n expiryTs: number | bigint;\n amountPerPeriod: number | bigint;\n amountPulledInPeriod: number | bigint;\n};\n\n/** Gets the encoder for {@link RecurringDelegationArgs} account data. */\nexport function getRecurringDelegationEncoder(): FixedSizeEncoder<RecurringDelegationArgs> {\n return getStructEncoder([\n ['header', getHeaderEncoder()],\n ['subscriptionAuthority', getAddressEncoder()],\n ['mint', getAddressEncoder()],\n ['currentPeriodStartTs', getI64Encoder()],\n ['periodLengthS', getU64Encoder()],\n ['expiryTs', getI64Encoder()],\n ['amountPerPeriod', getU64Encoder()],\n ['amountPulledInPeriod', getU64Encoder()],\n ]);\n}\n\n/** Gets the decoder for {@link RecurringDelegation} account data. */\nexport function getRecurringDelegationDecoder(): FixedSizeDecoder<RecurringDelegation> {\n return getStructDecoder([\n ['header', getHeaderDecoder()],\n ['subscriptionAuthority', getAddressDecoder()],\n ['mint', getAddressDecoder()],\n ['currentPeriodStartTs', getI64Decoder()],\n ['periodLengthS', getU64Decoder()],\n ['expiryTs', getI64Decoder()],\n ['amountPerPeriod', getU64Decoder()],\n ['amountPulledInPeriod', getU64Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link RecurringDelegation} account data. */\nexport function getRecurringDelegationCodec(): FixedSizeCodec<RecurringDelegationArgs, RecurringDelegation> {\n return combineCodec(getRecurringDelegationEncoder(), getRecurringDelegationDecoder());\n}\n\nexport function decodeRecurringDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<RecurringDelegation, TAddress>;\nexport function decodeRecurringDelegation<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<RecurringDelegation, TAddress>;\nexport function decodeRecurringDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<RecurringDelegation, TAddress> | MaybeAccount<RecurringDelegation, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getRecurringDelegationDecoder());\n}\n\nexport async function fetchRecurringDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<RecurringDelegation, TAddress>> {\n const maybeAccount = await fetchMaybeRecurringDelegation(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeRecurringDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<RecurringDelegation, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeRecurringDelegation(maybeAccount);\n}\n\nexport async function fetchAllRecurringDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<RecurringDelegation>[]> {\n const maybeAccounts = await fetchAllMaybeRecurringDelegation(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeRecurringDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<RecurringDelegation>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeRecurringDelegation(maybeAccount));\n}\n\nexport async function fetchRecurringDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: RecurringDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<RecurringDelegation>> {\n const maybeAccount = await fetchMaybeRecurringDelegationFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeRecurringDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: RecurringDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<RecurringDelegation>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findRecurringDelegationPda(seeds, { programAddress });\n return await fetchMaybeRecurringDelegation(rpc, address, fetchConfig);\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findSubscriptionAuthorityPda, SubscriptionAuthoritySeeds } from '../pdas';\n\nexport type SubscriptionAuthority = {\n discriminator: number;\n user: Address;\n tokenMint: Address;\n payer: Address;\n bump: number;\n initId: bigint;\n};\n\nexport type SubscriptionAuthorityArgs = {\n discriminator: number;\n user: Address;\n tokenMint: Address;\n payer: Address;\n bump: number;\n initId: number | bigint;\n};\n\n/** Gets the encoder for {@link SubscriptionAuthorityArgs} account data. */\nexport function getSubscriptionAuthorityEncoder(): FixedSizeEncoder<SubscriptionAuthorityArgs> {\n return getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['user', getAddressEncoder()],\n ['tokenMint', getAddressEncoder()],\n ['payer', getAddressEncoder()],\n ['bump', getU8Encoder()],\n ['initId', getI64Encoder()],\n ]);\n}\n\n/** Gets the decoder for {@link SubscriptionAuthority} account data. */\nexport function getSubscriptionAuthorityDecoder(): FixedSizeDecoder<SubscriptionAuthority> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['user', getAddressDecoder()],\n ['tokenMint', getAddressDecoder()],\n ['payer', getAddressDecoder()],\n ['bump', getU8Decoder()],\n ['initId', getI64Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link SubscriptionAuthority} account data. */\nexport function getSubscriptionAuthorityCodec(): FixedSizeCodec<SubscriptionAuthorityArgs, SubscriptionAuthority> {\n return combineCodec(getSubscriptionAuthorityEncoder(), getSubscriptionAuthorityDecoder());\n}\n\nexport function decodeSubscriptionAuthority<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<SubscriptionAuthority, TAddress>;\nexport function decodeSubscriptionAuthority<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<SubscriptionAuthority, TAddress>;\nexport function decodeSubscriptionAuthority<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<SubscriptionAuthority, TAddress> | MaybeAccount<SubscriptionAuthority, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getSubscriptionAuthorityDecoder());\n}\n\nexport async function fetchSubscriptionAuthority<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<SubscriptionAuthority, TAddress>> {\n const maybeAccount = await fetchMaybeSubscriptionAuthority(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubscriptionAuthority<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<SubscriptionAuthority, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeSubscriptionAuthority(maybeAccount);\n}\n\nexport async function fetchAllSubscriptionAuthority(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<SubscriptionAuthority>[]> {\n const maybeAccounts = await fetchAllMaybeSubscriptionAuthority(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeSubscriptionAuthority(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<SubscriptionAuthority>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeSubscriptionAuthority(maybeAccount));\n}\n\nexport async function fetchSubscriptionAuthorityFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: SubscriptionAuthoritySeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<SubscriptionAuthority>> {\n const maybeAccount = await fetchMaybeSubscriptionAuthorityFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubscriptionAuthorityFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: SubscriptionAuthoritySeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<SubscriptionAuthority>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findSubscriptionAuthorityPda(seeds, { programAddress });\n return await fetchMaybeSubscriptionAuthority(rpc, address, fetchConfig);\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findSubscriptionDelegationPda, SubscriptionDelegationSeeds } from '../pdas';\nimport {\n getHeaderDecoder,\n getHeaderEncoder,\n getPlanTermsDecoder,\n getPlanTermsEncoder,\n type Header,\n type HeaderArgs,\n type PlanTerms,\n type PlanTermsArgs,\n} from '../types';\n\nexport type SubscriptionDelegation = {\n header: Header;\n terms: PlanTerms;\n amountPulledInPeriod: bigint;\n currentPeriodStartTs: bigint;\n expiresAtTs: bigint;\n};\n\nexport type SubscriptionDelegationArgs = {\n header: HeaderArgs;\n terms: PlanTermsArgs;\n amountPulledInPeriod: number | bigint;\n currentPeriodStartTs: number | bigint;\n expiresAtTs: number | bigint;\n};\n\n/** Gets the encoder for {@link SubscriptionDelegationArgs} account data. */\nexport function getSubscriptionDelegationEncoder(): FixedSizeEncoder<SubscriptionDelegationArgs> {\n return getStructEncoder([\n ['header', getHeaderEncoder()],\n ['terms', getPlanTermsEncoder()],\n ['amountPulledInPeriod', getU64Encoder()],\n ['currentPeriodStartTs', getI64Encoder()],\n ['expiresAtTs', getI64Encoder()],\n ]);\n}\n\n/** Gets the decoder for {@link SubscriptionDelegation} account data. */\nexport function getSubscriptionDelegationDecoder(): FixedSizeDecoder<SubscriptionDelegation> {\n return getStructDecoder([\n ['header', getHeaderDecoder()],\n ['terms', getPlanTermsDecoder()],\n ['amountPulledInPeriod', getU64Decoder()],\n ['currentPeriodStartTs', getI64Decoder()],\n ['expiresAtTs', getI64Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link SubscriptionDelegation} account data. */\nexport function getSubscriptionDelegationCodec(): FixedSizeCodec<SubscriptionDelegationArgs, SubscriptionDelegation> {\n return combineCodec(getSubscriptionDelegationEncoder(), getSubscriptionDelegationDecoder());\n}\n\nexport function decodeSubscriptionDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<SubscriptionDelegation, TAddress>;\nexport function decodeSubscriptionDelegation<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<SubscriptionDelegation, TAddress>;\nexport function decodeSubscriptionDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<SubscriptionDelegation, TAddress> | MaybeAccount<SubscriptionDelegation, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getSubscriptionDelegationDecoder());\n}\n\nexport async function fetchSubscriptionDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<SubscriptionDelegation, TAddress>> {\n const maybeAccount = await fetchMaybeSubscriptionDelegation(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubscriptionDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<SubscriptionDelegation, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeSubscriptionDelegation(maybeAccount);\n}\n\nexport async function fetchAllSubscriptionDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<SubscriptionDelegation>[]> {\n const maybeAccounts = await fetchAllMaybeSubscriptionDelegation(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeSubscriptionDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<SubscriptionDelegation>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeSubscriptionDelegation(maybeAccount));\n}\n\nexport async function fetchSubscriptionDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: SubscriptionDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<SubscriptionDelegation>> {\n const maybeAccount = await fetchMaybeSubscriptionDelegationFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubscriptionDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: SubscriptionDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<SubscriptionDelegation>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findSubscriptionDelegationPda(seeds, { programAddress });\n return await fetchMaybeSubscriptionDelegation(rpc, address, fetchConfig);\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 isProgramError,\n type Address,\n type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,\n type SolanaError,\n} from '@solana/kit';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const SUBSCRIPTIONS_ERROR__NOT_SIGNER = 0x64; // 100\nexport const SUBSCRIPTIONS_ERROR__INVALID_ADDRESS = 0x65; // 101\nexport const SUBSCRIPTIONS_ERROR__INVALID_ESCROW_PDA = 0x66; // 102\nexport const SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_AUTHORITY_PDA = 0x67; // 103\nexport const SUBSCRIPTIONS_ERROR__NOT_SYSTEM_PROGRAM = 0x68; // 104\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN_PROGRAM = 0x69; // 105\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_MINT_ACCOUNT_DATA = 0x6a; // 106\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_TOKEN_ACCOUNT_DATA = 0x6b; // 107\nexport const SUBSCRIPTIONS_ERROR__INVALID_ASSOCIATED_TOKEN_ACCOUNT_DERIVED_ADDRESS = 0x6c; // 108\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_MINT_ACCOUNT_DATA = 0x6d; // 109\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_TOKEN_ACCOUNT_DATA = 0x6e; // 110\nexport const SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DATA = 0x6f; // 111\nexport const SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION_DATA = 0x70; // 112\nexport const SUBSCRIPTIONS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS = 0x71; // 113\nexport const SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION = 0x72; // 114\nexport const SUBSCRIPTIONS_ERROR__ARITHMETIC_OVERFLOW = 0x73; // 115\nexport const SUBSCRIPTIONS_ERROR__ARITHMETIC_UNDERFLOW = 0x74; // 116\nexport const SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DISCRIMINATOR = 0x75; // 117\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_CONFIDENTIAL_TRANSFER = 0x76; // 118\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_NON_TRANSFERABLE = 0x77; // 119\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_PERMANENT_DELEGATE = 0x78; // 120\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_HOOK = 0x79; // 121\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_FEE = 0x7a; // 122\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_MINT_CLOSE_AUTHORITY = 0x7b; // 123\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_PAUSABLE = 0x7c; // 124\nexport const SUBSCRIPTIONS_ERROR__MINT_MISMATCH = 0x7d; // 125\nexport const SUBSCRIPTIONS_ERROR__INVALID_DELEGATE_PDA = 0x7e; // 126\nexport const SUBSCRIPTIONS_ERROR__INVALID_HEADER_DATA = 0x7f; // 127\nexport const SUBSCRIPTIONS_ERROR__DELEGATION_EXPIRED = 0x80; // 128\nexport const SUBSCRIPTIONS_ERROR__INVALID_AMOUNT = 0x81; // 129\nexport const SUBSCRIPTIONS_ERROR__UNAUTHORIZED = 0x82; // 130\nexport const SUBSCRIPTIONS_ERROR__ACCOUNT_NOT_WRITABLE = 0x83; // 131\nexport const SUBSCRIPTIONS_ERROR__ATA_OWNER_MISMATCH = 0x84; // 132\nexport const SUBSCRIPTIONS_ERROR__DELEGATION_VERSION_MISMATCH = 0x85; // 133\nexport const SUBSCRIPTIONS_ERROR__MIGRATION_REQUIRED = 0x86; // 134\nexport const SUBSCRIPTIONS_ERROR__DELEGATION_ALREADY_EXISTS = 0x87; // 135\nexport const SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY = 0x88; // 136\nexport const SUBSCRIPTIONS_ERROR__TRANSFER_HOOK_TOO_MANY_ACCOUNTS = 0x89; // 137\nexport const SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_LIMIT = 0x12c; // 300\nexport const SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_EXPIRY_IN_PAST = 0x12d; // 301\nexport const SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_AMOUNT_ZERO = 0x12e; // 302\nexport const SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_PERIOD_LIMIT = 0x190; // 400\nexport const SUBSCRIPTIONS_ERROR__PERIOD_NOT_ELAPSED = 0x191; // 401\nexport const SUBSCRIPTIONS_ERROR__INVALID_PERIOD_LENGTH = 0x192; // 402\nexport const SUBSCRIPTIONS_ERROR__INVALID_PAYER_DATA = 0x193; // 403\nexport const SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST = 0x194; // 404\nexport const SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY = 0x195; // 405\nexport const SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_AMOUNT_ZERO = 0x196; // 406\nexport const SUBSCRIPTIONS_ERROR__DELEGATION_NOT_STARTED = 0x197; // 407\nexport const SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY = 0x198; // 408\nexport const SUBSCRIPTIONS_ERROR__PLAN_SUNSET = 0x1f4; // 500\nexport const SUBSCRIPTIONS_ERROR__PLAN_EXPIRED = 0x1f5; // 501\nexport const SUBSCRIPTIONS_ERROR__INVALID_PLAN_PDA = 0x1f6; // 502\nexport const SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_PDA = 0x1f7; // 503\nexport const SUBSCRIPTIONS_ERROR__NOT_PLAN_OWNER = 0x1f8; // 504\nexport const SUBSCRIPTIONS_ERROR__SUBSCRIPTION_PLAN_MISMATCH = 0x1f9; // 505\nexport const SUBSCRIPTIONS_ERROR__UNAUTHORIZED_DESTINATION = 0x1fa; // 506\nexport const SUBSCRIPTIONS_ERROR__INVALID_NUM_DESTINATIONS = 0x1fb; // 507\nexport const SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED = 0x1fc; // 508\nexport const SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED = 0x1fd; // 509\nexport const SUBSCRIPTIONS_ERROR__SUBSCRIPTION_NOT_CANCELLED = 0x1fe; // 510\nexport const SUBSCRIPTIONS_ERROR__INVALID_END_TS = 0x1ff; // 511\nexport const SUBSCRIPTIONS_ERROR__INVALID_PLAN_STATUS = 0x200; // 512\nexport const SUBSCRIPTIONS_ERROR__PLAN_IMMUTABLE_AFTER_SUNSET = 0x201; // 513\nexport const SUBSCRIPTIONS_ERROR__SUNSET_REQUIRES_END_TS = 0x202; // 514\nexport const SUBSCRIPTIONS_ERROR__PLAN_NOT_EXPIRED = 0x203; // 515\nexport const SUBSCRIPTIONS_ERROR__PLAN_CLOSED = 0x204; // 516\nexport const SUBSCRIPTIONS_ERROR__ALREADY_SUBSCRIBED = 0x205; // 517\nexport const SUBSCRIPTIONS_ERROR__PLAN_ALREADY_EXISTS = 0x206; // 518\nexport const SUBSCRIPTIONS_ERROR__PLAN_TERMS_MISMATCH = 0x207; // 519\nexport const SUBSCRIPTIONS_ERROR__PLAN_END_TS_CANNOT_EXTEND = 0x208; // 520\nexport const SUBSCRIPTIONS_ERROR__INVALID_EVENT_AUTHORITY = 0x258; // 600\nexport const SUBSCRIPTIONS_ERROR__INVALID_EVENT_DATA = 0x259; // 601\nexport const SUBSCRIPTIONS_ERROR__INVALID_EVENT_TAG = 0x25a; // 602\nexport const SUBSCRIPTIONS_ERROR__INVALID_EVENT_DISCRIMINATOR = 0x25b; // 603\nexport const SUBSCRIPTIONS_ERROR__INVALID_SELF_PROGRAM = 0x25c; // 604\n\nexport type SubscriptionsError =\n | typeof SUBSCRIPTIONS_ERROR__ACCOUNT_NOT_WRITABLE\n | typeof SUBSCRIPTIONS_ERROR__ALREADY_SUBSCRIBED\n | typeof SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_LIMIT\n | typeof SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_PERIOD_LIMIT\n | typeof SUBSCRIPTIONS_ERROR__ARITHMETIC_OVERFLOW\n | typeof SUBSCRIPTIONS_ERROR__ARITHMETIC_UNDERFLOW\n | typeof SUBSCRIPTIONS_ERROR__ATA_OWNER_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__DELEGATION_ALREADY_EXISTS\n | typeof SUBSCRIPTIONS_ERROR__DELEGATION_EXPIRED\n | typeof SUBSCRIPTIONS_ERROR__DELEGATION_NOT_STARTED\n | typeof SUBSCRIPTIONS_ERROR__DELEGATION_VERSION_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_AMOUNT_ZERO\n | typeof SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_EXPIRY_IN_PAST\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DISCRIMINATOR\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ADDRESS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_AMOUNT\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ASSOCIATED_TOKEN_ACCOUNT_DERIVED_ADDRESS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_DELEGATE_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_END_TS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ESCROW_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_EVENT_AUTHORITY\n | typeof SUBSCRIPTIONS_ERROR__INVALID_EVENT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_EVENT_DISCRIMINATOR\n | typeof SUBSCRIPTIONS_ERROR__INVALID_EVENT_TAG\n | typeof SUBSCRIPTIONS_ERROR__INVALID_HEADER_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION\n | typeof SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_NUM_DESTINATIONS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_PAYER_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_PERIOD_LENGTH\n | typeof SUBSCRIPTIONS_ERROR__INVALID_PLAN_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_PLAN_STATUS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_SELF_PROGRAM\n | typeof SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_AUTHORITY_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_MINT_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_TOKEN_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN_PROGRAM\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_MINT_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_TOKEN_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__MIGRATION_REQUIRED\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_CONFIDENTIAL_TRANSFER\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_MINT_CLOSE_AUTHORITY\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_NON_TRANSFERABLE\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_PAUSABLE\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_PERMANENT_DELEGATE\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_FEE\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_HOOK\n | typeof SUBSCRIPTIONS_ERROR__MINT_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS\n | typeof SUBSCRIPTIONS_ERROR__NOT_PLAN_OWNER\n | typeof SUBSCRIPTIONS_ERROR__NOT_SIGNER\n | typeof SUBSCRIPTIONS_ERROR__NOT_SYSTEM_PROGRAM\n | typeof SUBSCRIPTIONS_ERROR__PERIOD_NOT_ELAPSED\n | typeof SUBSCRIPTIONS_ERROR__PLAN_ALREADY_EXISTS\n | typeof SUBSCRIPTIONS_ERROR__PLAN_CLOSED\n | typeof SUBSCRIPTIONS_ERROR__PLAN_END_TS_CANNOT_EXTEND\n | typeof SUBSCRIPTIONS_ERROR__PLAN_EXPIRED\n | typeof SUBSCRIPTIONS_ERROR__PLAN_IMMUTABLE_AFTER_SUNSET\n | typeof SUBSCRIPTIONS_ERROR__PLAN_NOT_EXPIRED\n | typeof SUBSCRIPTIONS_ERROR__PLAN_SUNSET\n | typeof SUBSCRIPTIONS_ERROR__PLAN_TERMS_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_AMOUNT_ZERO\n | typeof SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY\n | typeof SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY\n | typeof SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST\n | typeof SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY\n | typeof SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED\n | typeof SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED\n | typeof SUBSCRIPTIONS_ERROR__SUBSCRIPTION_NOT_CANCELLED\n | typeof SUBSCRIPTIONS_ERROR__SUBSCRIPTION_PLAN_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__SUNSET_REQUIRES_END_TS\n | typeof SUBSCRIPTIONS_ERROR__TRANSFER_HOOK_TOO_MANY_ACCOUNTS\n | typeof SUBSCRIPTIONS_ERROR__UNAUTHORIZED\n | typeof SUBSCRIPTIONS_ERROR__UNAUTHORIZED_DESTINATION;\n\nlet subscriptionsErrorMessages: Record<SubscriptionsError, string> | undefined;\nif (process.env['NODE_ENV'] !== 'production') {\n subscriptionsErrorMessages = {\n [SUBSCRIPTIONS_ERROR__ACCOUNT_NOT_WRITABLE]: `Account must be writable`,\n [SUBSCRIPTIONS_ERROR__ALREADY_SUBSCRIBED]: `Already subscribed to this plan`,\n [SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_LIMIT]: `Transfer amount exceeds delegation limit`,\n [SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_PERIOD_LIMIT]: `Transfer amount exceeds period limit`,\n [SUBSCRIPTIONS_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic Overflow`,\n [SUBSCRIPTIONS_ERROR__ARITHMETIC_UNDERFLOW]: `Arithmetic Underflow`,\n [SUBSCRIPTIONS_ERROR__ATA_OWNER_MISMATCH]: `Token account owner does not match expected`,\n [SUBSCRIPTIONS_ERROR__DELEGATION_ALREADY_EXISTS]: `Delegation account already exists`,\n [SUBSCRIPTIONS_ERROR__DELEGATION_EXPIRED]: `Delegation has expired`,\n [SUBSCRIPTIONS_ERROR__DELEGATION_NOT_STARTED]: `Delegation period has not started yet`,\n [SUBSCRIPTIONS_ERROR__DELEGATION_VERSION_MISMATCH]: `Delegation header version is not compatible`,\n [SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_AMOUNT_ZERO]: `zero amount specified`,\n [SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_EXPIRY_IN_PAST]: `Expiry time specified is less than current time`,\n [SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DATA]: `Invalid account data`,\n [SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DISCRIMINATOR]: `Invalid account discriminator`,\n [SUBSCRIPTIONS_ERROR__INVALID_ADDRESS]: `Invalid account address`,\n [SUBSCRIPTIONS_ERROR__INVALID_AMOUNT]: `Invalid amount specified`,\n [SUBSCRIPTIONS_ERROR__INVALID_ASSOCIATED_TOKEN_ACCOUNT_DERIVED_ADDRESS]: `Invalid associated token account address`,\n [SUBSCRIPTIONS_ERROR__INVALID_DELEGATE_PDA]: `Invalid delegation PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_END_TS]: `End timestamp must be zero or in the future`,\n [SUBSCRIPTIONS_ERROR__INVALID_ESCROW_PDA]: `Invalid escrow PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_EVENT_AUTHORITY]: `Invalid event authority PDA`,\n [SUBSCRIPTIONS_ERROR__INVALID_EVENT_DATA]: `Invalid event data`,\n [SUBSCRIPTIONS_ERROR__INVALID_EVENT_DISCRIMINATOR]: `Unknown event discriminator`,\n [SUBSCRIPTIONS_ERROR__INVALID_EVENT_TAG]: `Invalid event tag prefix`,\n [SUBSCRIPTIONS_ERROR__INVALID_HEADER_DATA]: `Invalid header data`,\n [SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION]: `Invalid instruction`,\n [SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION_DATA]: `Invalid instruction data`,\n [SUBSCRIPTIONS_ERROR__INVALID_NUM_DESTINATIONS]: `No valid destinations provided`,\n [SUBSCRIPTIONS_ERROR__INVALID_PAYER_DATA]: `Payer provided does not match delegation`,\n [SUBSCRIPTIONS_ERROR__INVALID_PERIOD_LENGTH]: `Invalid Period length`,\n [SUBSCRIPTIONS_ERROR__INVALID_PLAN_PDA]: `Invalid Plan PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_PLAN_STATUS]: `Invalid plan status value`,\n [SUBSCRIPTIONS_ERROR__INVALID_SELF_PROGRAM]: `Self program account does not match this program`,\n [SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_AUTHORITY_PDA]: `Invalid subscription-authority PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_PDA]: `Invalid subscription PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_MINT_ACCOUNT_DATA]: `Invalid Token-2022 mint account data`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_TOKEN_ACCOUNT_DATA]: `Invalid Token-2022 token account data`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN_PROGRAM]: `Token Program does not match other accounts`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_MINT_ACCOUNT_DATA]: `Invalid SPL Token mint account data`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_TOKEN_ACCOUNT_DATA]: `Invalid SPL Token account data`,\n [SUBSCRIPTIONS_ERROR__MIGRATION_REQUIRED]: `Account requires explicit migration`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_CONFIDENTIAL_TRANSFER]: `Mint has ConfidentialTransfer extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_MINT_CLOSE_AUTHORITY]: `Mint has MintCloseAuthority extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_NON_TRANSFERABLE]: `Mint has NonTransferable extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_PAUSABLE]: `Mint has Pausable extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_PERMANENT_DELEGATE]: `Mint has PermanentDelegate extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_FEE]: `Mint has TransferFee extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_HOOK]: `Mint has TransferHook extension`,\n [SUBSCRIPTIONS_ERROR__MINT_MISMATCH]: `Token mint mismatch`,\n [SUBSCRIPTIONS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS]: `Not enough account keys provided`,\n [SUBSCRIPTIONS_ERROR__NOT_PLAN_OWNER]: `Caller is not the plan owner`,\n [SUBSCRIPTIONS_ERROR__NOT_SIGNER]: `Account must be a signer`,\n [SUBSCRIPTIONS_ERROR__NOT_SYSTEM_PROGRAM]: `Expected system program`,\n [SUBSCRIPTIONS_ERROR__PERIOD_NOT_ELAPSED]: `Period has not elapsed yet`,\n [SUBSCRIPTIONS_ERROR__PLAN_ALREADY_EXISTS]: `Plan account already exists`,\n [SUBSCRIPTIONS_ERROR__PLAN_CLOSED]: `Plan account has been closed`,\n [SUBSCRIPTIONS_ERROR__PLAN_END_TS_CANNOT_EXTEND]: `A finite plan end timestamp can only be shortened, not removed or extended`,\n [SUBSCRIPTIONS_ERROR__PLAN_EXPIRED]: `Plan has expired`,\n [SUBSCRIPTIONS_ERROR__PLAN_IMMUTABLE_AFTER_SUNSET]: `Plan cannot be updated after sunset`,\n [SUBSCRIPTIONS_ERROR__PLAN_NOT_EXPIRED]: `Plan must be expired to delete`,\n [SUBSCRIPTIONS_ERROR__PLAN_SUNSET]: `Plan is in sunset status`,\n [SUBSCRIPTIONS_ERROR__PLAN_TERMS_MISMATCH]: `Subscription plan terms do not match the current plan`,\n [SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_AMOUNT_ZERO]: `zero amount specified`,\n [SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY]: `start_ts of 0 (start on landing) requires a non-zero expiry`,\n [SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY]: `start time specified is greater than expiry`,\n [SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST]: `Past start time specified`,\n [SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY]: `Delegation init_id does not match current SubscriptionAuthority`,\n [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED]: `Subscription already cancelled`,\n [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED]: `Subscription cancelled and past valid period`,\n [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_NOT_CANCELLED]: `Subscription is not cancelled`,\n [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_PLAN_MISMATCH]: `Subscription does not belong to this plan`,\n [SUBSCRIPTIONS_ERROR__SUNSET_REQUIRES_END_TS]: `Sunset requires a non-zero end timestamp`,\n [SUBSCRIPTIONS_ERROR__TRANSFER_HOOK_TOO_MANY_ACCOUNTS]: `Too many transfer hook accounts provided`,\n [SUBSCRIPTIONS_ERROR__UNAUTHORIZED]: `Caller not authorized for this action`,\n [SUBSCRIPTIONS_ERROR__UNAUTHORIZED_DESTINATION]: `Destination not in plan whitelist`,\n };\n}\n\nexport function getSubscriptionsErrorMessage(code: SubscriptionsError): string {\n if (process.env['NODE_ENV'] !== 'production') {\n return (subscriptionsErrorMessages as Record<SubscriptionsError, string>)[code];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isSubscriptionsError<TProgramErrorCode extends SubscriptionsError>(\n error: unknown,\n transactionMessage: { instructions: Record<number, { programAddress: Address }> },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &\n Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(error, transactionMessage, SUBSCRIPTIONS_PROGRAM_ADDRESS, code);\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 assertIsInstructionWithAccounts,\n containsBytes,\n extendClient,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n SolanaError,\n type Address,\n type ClientWithRpc,\n type ClientWithTransactionPlanning,\n type ClientWithTransactionSending,\n type GetAccountInfoApi,\n type GetMultipleAccountsApi,\n type Instruction,\n type InstructionWithData,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n addSelfFetchFunctions,\n addSelfPlanAndSendFunctions,\n type SelfFetchFunctions,\n type SelfPlanAndSendFunctions,\n} from '@solana/program-client-core';\nimport {\n getEventAuthorityCodec,\n getFixedDelegationCodec,\n getPlanCodec,\n getRecurringDelegationCodec,\n getSubscriptionAuthorityCodec,\n getSubscriptionDelegationCodec,\n type EventAuthority,\n type EventAuthorityArgs,\n type FixedDelegation,\n type FixedDelegationArgs,\n type Plan,\n type PlanArgs,\n type RecurringDelegation,\n type RecurringDelegationArgs,\n type SubscriptionAuthority,\n type SubscriptionAuthorityArgs,\n type SubscriptionDelegation,\n type SubscriptionDelegationArgs,\n} from '../accounts';\nimport {\n getCancelSubscriptionInstructionAsync,\n getCloseSubscriptionAuthorityInstruction,\n getCreateFixedDelegationInstruction,\n getCreatePlanInstruction,\n getCreateRecurringDelegationInstruction,\n getDeletePlanInstruction,\n getInitSubscriptionAuthorityInstructionAsync,\n getResumeSubscriptionInstructionAsync,\n getRevokeAbandonedDelegationInstruction,\n getRevokeAbandonedSubscriptionInstruction,\n getRevokeDelegationInstruction,\n getRevokeSubscriptionAuthorityInstructionAsync,\n getSubscribeInstructionAsync,\n getTransferFixedInstructionAsync,\n getTransferRecurringInstructionAsync,\n getTransferSubscriptionInstructionAsync,\n getUpdatePlanInstructionAsync,\n parseCancelSubscriptionInstruction,\n parseCloseSubscriptionAuthorityInstruction,\n parseCreateFixedDelegationInstruction,\n parseCreatePlanInstruction,\n parseCreateRecurringDelegationInstruction,\n parseDeletePlanInstruction,\n parseInitSubscriptionAuthorityInstruction,\n parseResumeSubscriptionInstruction,\n parseRevokeAbandonedDelegationInstruction,\n parseRevokeAbandonedSubscriptionInstruction,\n parseRevokeDelegationInstruction,\n parseRevokeSubscriptionAuthorityInstruction,\n parseSubscribeInstruction,\n parseTransferFixedInstruction,\n parseTransferRecurringInstruction,\n parseTransferSubscriptionInstruction,\n parseUpdatePlanInstruction,\n type CancelSubscriptionAsyncInput,\n type CloseSubscriptionAuthorityInput,\n type CreateFixedDelegationInput,\n type CreatePlanInput,\n type CreateRecurringDelegationInput,\n type DeletePlanInput,\n type InitSubscriptionAuthorityAsyncInput,\n type ParsedCancelSubscriptionInstruction,\n type ParsedCloseSubscriptionAuthorityInstruction,\n type ParsedCreateFixedDelegationInstruction,\n type ParsedCreatePlanInstruction,\n type ParsedCreateRecurringDelegationInstruction,\n type ParsedDeletePlanInstruction,\n type ParsedInitSubscriptionAuthorityInstruction,\n type ParsedResumeSubscriptionInstruction,\n type ParsedRevokeAbandonedDelegationInstruction,\n type ParsedRevokeAbandonedSubscriptionInstruction,\n type ParsedRevokeDelegationInstruction,\n type ParsedRevokeSubscriptionAuthorityInstruction,\n type ParsedSubscribeInstruction,\n type ParsedTransferFixedInstruction,\n type ParsedTransferRecurringInstruction,\n type ParsedTransferSubscriptionInstruction,\n type ParsedUpdatePlanInstruction,\n type ResumeSubscriptionAsyncInput,\n type RevokeAbandonedDelegationInput,\n type RevokeAbandonedSubscriptionInput,\n type RevokeDelegationInput,\n type RevokeSubscriptionAuthorityAsyncInput,\n type SubscribeAsyncInput,\n type TransferFixedAsyncInput,\n type TransferRecurringAsyncInput,\n type TransferSubscriptionAsyncInput,\n type UpdatePlanAsyncInput,\n} from '../instructions';\nimport {\n findEventAuthorityPda,\n findFixedDelegationPda,\n findPlanPda,\n findRecurringDelegationPda,\n findSubscriptionAuthorityPda,\n findSubscriptionDelegationPda,\n} from '../pdas';\n\nexport const SUBSCRIPTIONS_PROGRAM_ADDRESS =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\n\nexport enum SubscriptionsAccount {\n FixedDelegation,\n Plan,\n RecurringDelegation,\n SubscriptionAuthority,\n SubscriptionDelegation,\n EventAuthority,\n}\n\nexport enum SubscriptionsInstruction {\n InitSubscriptionAuthority,\n CreateFixedDelegation,\n CreateRecurringDelegation,\n RevokeDelegation,\n TransferFixed,\n TransferRecurring,\n CloseSubscriptionAuthority,\n CreatePlan,\n UpdatePlan,\n DeletePlan,\n TransferSubscription,\n Subscribe,\n CancelSubscription,\n ResumeSubscription,\n RevokeSubscriptionAuthority,\n RevokeAbandonedDelegation,\n RevokeAbandonedSubscription,\n}\n\nexport function identifySubscriptionsInstruction(\n instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): SubscriptionsInstruction {\n const data = 'data' in instruction ? instruction.data : instruction;\n if (containsBytes(data, getU8Encoder().encode(0), 0)) {\n return SubscriptionsInstruction.InitSubscriptionAuthority;\n }\n if (containsBytes(data, getU8Encoder().encode(1), 0)) {\n return SubscriptionsInstruction.CreateFixedDelegation;\n }\n if (containsBytes(data, getU8Encoder().encode(2), 0)) {\n return SubscriptionsInstruction.CreateRecurringDelegation;\n }\n if (containsBytes(data, getU8Encoder().encode(3), 0)) {\n return SubscriptionsInstruction.RevokeDelegation;\n }\n if (containsBytes(data, getU8Encoder().encode(4), 0)) {\n return SubscriptionsInstruction.TransferFixed;\n }\n if (containsBytes(data, getU8Encoder().encode(5), 0)) {\n return SubscriptionsInstruction.TransferRecurring;\n }\n if (containsBytes(data, getU8Encoder().encode(6), 0)) {\n return SubscriptionsInstruction.CloseSubscriptionAuthority;\n }\n if (containsBytes(data, getU8Encoder().encode(7), 0)) {\n return SubscriptionsInstruction.CreatePlan;\n }\n if (containsBytes(data, getU8Encoder().encode(8), 0)) {\n return SubscriptionsInstruction.UpdatePlan;\n }\n if (containsBytes(data, getU8Encoder().encode(9), 0)) {\n return SubscriptionsInstruction.DeletePlan;\n }\n if (containsBytes(data, getU8Encoder().encode(10), 0)) {\n return SubscriptionsInstruction.TransferSubscription;\n }\n if (containsBytes(data, getU8Encoder().encode(11), 0)) {\n return SubscriptionsInstruction.Subscribe;\n }\n if (containsBytes(data, getU8Encoder().encode(12), 0)) {\n return SubscriptionsInstruction.CancelSubscription;\n }\n if (containsBytes(data, getU8Encoder().encode(13), 0)) {\n return SubscriptionsInstruction.ResumeSubscription;\n }\n if (containsBytes(data, getU8Encoder().encode(14), 0)) {\n return SubscriptionsInstruction.RevokeSubscriptionAuthority;\n }\n if (containsBytes(data, getU8Encoder().encode(15), 0)) {\n return SubscriptionsInstruction.RevokeAbandonedDelegation;\n }\n if (containsBytes(data, getU8Encoder().encode(16), 0)) {\n return SubscriptionsInstruction.RevokeAbandonedSubscription;\n }\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {\n instructionData: data,\n programName: 'subscriptions',\n });\n}\n\nexport type ParsedSubscriptionsInstruction<TProgram extends string = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'> =\n | ({\n instructionType: SubscriptionsInstruction.InitSubscriptionAuthority;\n } & ParsedInitSubscriptionAuthorityInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.CreateFixedDelegation;\n } & ParsedCreateFixedDelegationInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.CreateRecurringDelegation;\n } & ParsedCreateRecurringDelegationInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.RevokeDelegation } & ParsedRevokeDelegationInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.TransferFixed } & ParsedTransferFixedInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.TransferRecurring } & ParsedTransferRecurringInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.CloseSubscriptionAuthority;\n } & ParsedCloseSubscriptionAuthorityInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.CreatePlan } & ParsedCreatePlanInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.UpdatePlan } & ParsedUpdatePlanInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.DeletePlan } & ParsedDeletePlanInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.TransferSubscription;\n } & ParsedTransferSubscriptionInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.Subscribe } & ParsedSubscribeInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.CancelSubscription } & ParsedCancelSubscriptionInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.ResumeSubscription } & ParsedResumeSubscriptionInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.RevokeSubscriptionAuthority;\n } & ParsedRevokeSubscriptionAuthorityInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.RevokeAbandonedDelegation;\n } & ParsedRevokeAbandonedDelegationInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.RevokeAbandonedSubscription;\n } & ParsedRevokeAbandonedSubscriptionInstruction<TProgram>);\n\nexport function parseSubscriptionsInstruction<TProgram extends string>(\n instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,\n): ParsedSubscriptionsInstruction<TProgram> {\n const instructionType = identifySubscriptionsInstruction(instruction);\n switch (instructionType) {\n case SubscriptionsInstruction.InitSubscriptionAuthority: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.InitSubscriptionAuthority,\n ...parseInitSubscriptionAuthorityInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CreateFixedDelegation: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CreateFixedDelegation,\n ...parseCreateFixedDelegationInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CreateRecurringDelegation: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CreateRecurringDelegation,\n ...parseCreateRecurringDelegationInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.RevokeDelegation: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.RevokeDelegation,\n ...parseRevokeDelegationInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.TransferFixed: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.TransferFixed,\n ...parseTransferFixedInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.TransferRecurring: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.TransferRecurring,\n ...parseTransferRecurringInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CloseSubscriptionAuthority: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CloseSubscriptionAuthority,\n ...parseCloseSubscriptionAuthorityInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CreatePlan: {\n assertIsInstructionWithAccounts(instruction);\n return { instructionType: SubscriptionsInstruction.CreatePlan, ...parseCreatePlanInstruction(instruction) };\n }\n case SubscriptionsInstruction.UpdatePlan: {\n assertIsInstructionWithAccounts(instruction);\n return { instructionType: SubscriptionsInstruction.UpdatePlan, ...parseUpdatePlanInstruction(instruction) };\n }\n case SubscriptionsInstruction.DeletePlan: {\n assertIsInstructionWithAccounts(instruction);\n return { instructionType: SubscriptionsInstruction.DeletePlan, ...parseDeletePlanInstruction(instruction) };\n }\n case SubscriptionsInstruction.TransferSubscription: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.TransferSubscription,\n ...parseTransferSubscriptionInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.Subscribe: {\n assertIsInstructionWithAccounts(instruction);\n return { instructionType: SubscriptionsInstruction.Subscribe, ...parseSubscribeInstruction(instruction) };\n }\n case SubscriptionsInstruction.CancelSubscription: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CancelSubscription,\n ...parseCancelSubscriptionInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.ResumeSubscription: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.ResumeSubscription,\n ...parseResumeSubscriptionInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.RevokeSubscriptionAuthority: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.RevokeSubscriptionAuthority,\n ...parseRevokeSubscriptionAuthorityInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.RevokeAbandonedDelegation: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.RevokeAbandonedDelegation,\n ...parseRevokeAbandonedDelegationInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.RevokeAbandonedSubscription: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.RevokeAbandonedSubscription,\n ...parseRevokeAbandonedSubscriptionInstruction(instruction),\n };\n }\n default:\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {\n instructionType: instructionType as string,\n programName: 'subscriptions',\n });\n }\n}\n\nexport type SubscriptionsPlugin = {\n accounts: SubscriptionsPluginAccounts;\n instructions: SubscriptionsPluginInstructions;\n pdas: SubscriptionsPluginPdas;\n};\n\nexport type SubscriptionsPluginAccounts = {\n fixedDelegation: ReturnType<typeof getFixedDelegationCodec> &\n SelfFetchFunctions<FixedDelegationArgs, FixedDelegation>;\n plan: ReturnType<typeof getPlanCodec> & SelfFetchFunctions<PlanArgs, Plan>;\n recurringDelegation: ReturnType<typeof getRecurringDelegationCodec> &\n SelfFetchFunctions<RecurringDelegationArgs, RecurringDelegation>;\n subscriptionAuthority: ReturnType<typeof getSubscriptionAuthorityCodec> &\n SelfFetchFunctions<SubscriptionAuthorityArgs, SubscriptionAuthority>;\n subscriptionDelegation: ReturnType<typeof getSubscriptionDelegationCodec> &\n SelfFetchFunctions<SubscriptionDelegationArgs, SubscriptionDelegation>;\n eventAuthority: ReturnType<typeof getEventAuthorityCodec> & SelfFetchFunctions<EventAuthorityArgs, EventAuthority>;\n};\n\nexport type SubscriptionsPluginInstructions = {\n initSubscriptionAuthority: (\n input: InitSubscriptionAuthorityAsyncInput,\n ) => ReturnType<typeof getInitSubscriptionAuthorityInstructionAsync> & SelfPlanAndSendFunctions;\n createFixedDelegation: (\n input: CreateFixedDelegationInput,\n ) => ReturnType<typeof getCreateFixedDelegationInstruction> & SelfPlanAndSendFunctions;\n createRecurringDelegation: (\n input: CreateRecurringDelegationInput,\n ) => ReturnType<typeof getCreateRecurringDelegationInstruction> & SelfPlanAndSendFunctions;\n revokeDelegation: (\n input: RevokeDelegationInput,\n ) => ReturnType<typeof getRevokeDelegationInstruction> & SelfPlanAndSendFunctions;\n transferFixed: (\n input: TransferFixedAsyncInput,\n ) => ReturnType<typeof getTransferFixedInstructionAsync> & SelfPlanAndSendFunctions;\n transferRecurring: (\n input: TransferRecurringAsyncInput,\n ) => ReturnType<typeof getTransferRecurringInstructionAsync> & SelfPlanAndSendFunctions;\n closeSubscriptionAuthority: (\n input: CloseSubscriptionAuthorityInput,\n ) => ReturnType<typeof getCloseSubscriptionAuthorityInstruction> & SelfPlanAndSendFunctions;\n createPlan: (input: CreatePlanInput) => ReturnType<typeof getCreatePlanInstruction> & SelfPlanAndSendFunctions;\n updatePlan: (\n input: UpdatePlanAsyncInput,\n ) => ReturnType<typeof getUpdatePlanInstructionAsync> & SelfPlanAndSendFunctions;\n deletePlan: (input: DeletePlanInput) => ReturnType<typeof getDeletePlanInstruction> & SelfPlanAndSendFunctions;\n transferSubscription: (\n input: TransferSubscriptionAsyncInput,\n ) => ReturnType<typeof getTransferSubscriptionInstructionAsync> & SelfPlanAndSendFunctions;\n subscribe: (\n input: SubscribeAsyncInput,\n ) => ReturnType<typeof getSubscribeInstructionAsync> & SelfPlanAndSendFunctions;\n cancelSubscription: (\n input: CancelSubscriptionAsyncInput,\n ) => ReturnType<typeof getCancelSubscriptionInstructionAsync> & SelfPlanAndSendFunctions;\n resumeSubscription: (\n input: ResumeSubscriptionAsyncInput,\n ) => ReturnType<typeof getResumeSubscriptionInstructionAsync> & SelfPlanAndSendFunctions;\n revokeSubscriptionAuthority: (\n input: RevokeSubscriptionAuthorityAsyncInput,\n ) => ReturnType<typeof getRevokeSubscriptionAuthorityInstructionAsync> & SelfPlanAndSendFunctions;\n revokeAbandonedDelegation: (\n input: RevokeAbandonedDelegationInput,\n ) => ReturnType<typeof getRevokeAbandonedDelegationInstruction> & SelfPlanAndSendFunctions;\n revokeAbandonedSubscription: (\n input: RevokeAbandonedSubscriptionInput,\n ) => ReturnType<typeof getRevokeAbandonedSubscriptionInstruction> & SelfPlanAndSendFunctions;\n};\n\nexport type SubscriptionsPluginPdas = {\n fixedDelegation: typeof findFixedDelegationPda;\n plan: typeof findPlanPda;\n recurringDelegation: typeof findRecurringDelegationPda;\n subscriptionAuthority: typeof findSubscriptionAuthorityPda;\n subscriptionDelegation: typeof findSubscriptionDelegationPda;\n eventAuthority: typeof findEventAuthorityPda;\n};\n\nexport type SubscriptionsPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> &\n ClientWithTransactionPlanning &\n ClientWithTransactionSending;\n\nexport function subscriptionsProgram() {\n return <T extends SubscriptionsPluginRequirements>(\n client: T,\n ): Omit<T, 'subscriptions'> & { subscriptions: SubscriptionsPlugin } => {\n return extendClient(client, {\n subscriptions: <SubscriptionsPlugin>{\n accounts: {\n fixedDelegation: addSelfFetchFunctions(client, getFixedDelegationCodec()),\n plan: addSelfFetchFunctions(client, getPlanCodec()),\n recurringDelegation: addSelfFetchFunctions(client, getRecurringDelegationCodec()),\n subscriptionAuthority: addSelfFetchFunctions(client, getSubscriptionAuthorityCodec()),\n subscriptionDelegation: addSelfFetchFunctions(client, getSubscriptionDelegationCodec()),\n eventAuthority: addSelfFetchFunctions(client, getEventAuthorityCodec()),\n },\n instructions: {\n initSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(client, getInitSubscriptionAuthorityInstructionAsync(input)),\n createFixedDelegation: input =>\n addSelfPlanAndSendFunctions(client, getCreateFixedDelegationInstruction(input)),\n createRecurringDelegation: input =>\n addSelfPlanAndSendFunctions(client, getCreateRecurringDelegationInstruction(input)),\n revokeDelegation: input =>\n addSelfPlanAndSendFunctions(client, getRevokeDelegationInstruction(input)),\n transferFixed: input =>\n addSelfPlanAndSendFunctions(client, getTransferFixedInstructionAsync(input)),\n transferRecurring: input =>\n addSelfPlanAndSendFunctions(client, getTransferRecurringInstructionAsync(input)),\n closeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(client, getCloseSubscriptionAuthorityInstruction(input)),\n createPlan: input => addSelfPlanAndSendFunctions(client, getCreatePlanInstruction(input)),\n updatePlan: input => addSelfPlanAndSendFunctions(client, getUpdatePlanInstructionAsync(input)),\n deletePlan: input => addSelfPlanAndSendFunctions(client, getDeletePlanInstruction(input)),\n transferSubscription: input =>\n addSelfPlanAndSendFunctions(client, getTransferSubscriptionInstructionAsync(input)),\n subscribe: input => addSelfPlanAndSendFunctions(client, getSubscribeInstructionAsync(input)),\n cancelSubscription: input =>\n addSelfPlanAndSendFunctions(client, getCancelSubscriptionInstructionAsync(input)),\n resumeSubscription: input =>\n addSelfPlanAndSendFunctions(client, getResumeSubscriptionInstructionAsync(input)),\n revokeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(client, getRevokeSubscriptionAuthorityInstructionAsync(input)),\n revokeAbandonedDelegation: input =>\n addSelfPlanAndSendFunctions(client, getRevokeAbandonedDelegationInstruction(input)),\n revokeAbandonedSubscription: input =>\n addSelfPlanAndSendFunctions(client, getRevokeAbandonedSubscriptionInstruction(input)),\n },\n pdas: {\n fixedDelegation: findFixedDelegationPda,\n plan: findPlanPda,\n recurringDelegation: findRecurringDelegationPda,\n subscriptionAuthority: findSubscriptionAuthorityPda,\n subscriptionDelegation: findSubscriptionDelegationPda,\n eventAuthority: findEventAuthorityPda,\n },\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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionDelegationPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const CANCEL_SUBSCRIPTION_DISCRIMINATOR = 12;\n\nexport function getCancelSubscriptionDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CANCEL_SUBSCRIPTION_DISCRIMINATOR);\n}\n\nexport type CancelSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriber extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriber extends string\n ? ReadonlySignerAccount<TAccountSubscriber> & AccountSignerMeta<TAccountSubscriber>\n : TAccountSubscriber,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CancelSubscriptionInstructionData = { discriminator: number };\n\nexport type CancelSubscriptionInstructionDataArgs = {};\n\nexport function getCancelSubscriptionInstructionDataEncoder(): FixedSizeEncoder<CancelSubscriptionInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: CANCEL_SUBSCRIPTION_DISCRIMINATOR,\n }));\n}\n\nexport function getCancelSubscriptionInstructionDataDecoder(): FixedSizeDecoder<CancelSubscriptionInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getCancelSubscriptionInstructionDataCodec(): FixedSizeCodec<\n CancelSubscriptionInstructionDataArgs,\n CancelSubscriptionInstructionData\n> {\n return combineCodec(getCancelSubscriptionInstructionDataEncoder(), getCancelSubscriptionInstructionDataDecoder());\n}\n\nexport type CancelSubscriptionAsyncInput<\n TAccountSubscriber extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber cancelling the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being cancelled */\n subscriptionPda?: Address<TAccountSubscriptionPda>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n};\n\nexport async function getCancelSubscriptionInstructionAsync<\n TAccountSubscriber extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CancelSubscriptionAsyncInput<\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CancelSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.subscriptionPda.value) {\n accounts.subscriptionPda.value = await findSubscriptionDelegationPda({\n planPda: getAddressFromResolvedInstructionAccount('planPda', accounts.planPda.value),\n subscriber: getAddressFromResolvedInstructionAccount('subscriber', accounts.subscriber.value),\n });\n }\n if (!accounts.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getCancelSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as CancelSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type CancelSubscriptionInput<\n TAccountSubscriber extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber cancelling the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being cancelled */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n};\n\nexport function getCancelSubscriptionInstruction<\n TAccountSubscriber extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CancelSubscriptionInput<\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CancelSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getCancelSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as CancelSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedCancelSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscriber cancelling the subscription */\n subscriber: TAccountMetas[0];\n /** The plan PDA for the subscription */\n planPda: TAccountMetas[1];\n /** The subscription PDA being cancelled */\n subscriptionPda: TAccountMetas[2];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[3];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[4];\n };\n data: CancelSubscriptionInstructionData;\n};\n\nexport function parseCancelSubscriptionInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCancelSubscriptionInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 subscriber: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionPda: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getCancelSubscriptionInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 6;\n\nexport function getCloseSubscriptionAuthorityDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);\n}\n\nexport type CloseSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountUser extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountReceiver extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountUser extends string\n ? WritableSignerAccount<TAccountUser> & AccountSignerMeta<TAccountUser>\n : TAccountUser,\n TAccountSubscriptionAuthority extends string\n ? WritableAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n ...(TAccountReceiver extends undefined\n ? []\n : [TAccountReceiver extends string ? WritableAccount<TAccountReceiver> : TAccountReceiver]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CloseSubscriptionAuthorityInstructionData = { discriminator: number };\n\nexport type CloseSubscriptionAuthorityInstructionDataArgs = {};\n\nexport function getCloseSubscriptionAuthorityInstructionDataEncoder(): FixedSizeEncoder<CloseSubscriptionAuthorityInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,\n }));\n}\n\nexport function getCloseSubscriptionAuthorityInstructionDataDecoder(): FixedSizeDecoder<CloseSubscriptionAuthorityInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getCloseSubscriptionAuthorityInstructionDataCodec(): FixedSizeCodec<\n CloseSubscriptionAuthorityInstructionDataArgs,\n CloseSubscriptionAuthorityInstructionData\n> {\n return combineCodec(\n getCloseSubscriptionAuthorityInstructionDataEncoder(),\n getCloseSubscriptionAuthorityInstructionDataDecoder(),\n );\n}\n\nexport type CloseSubscriptionAuthorityInput<\n TAccountUser extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountReceiver extends string = string,\n> = {\n /** The user who owns the SubscriptionAuthority PDA (receives rent) */\n user: TransactionSigner<TAccountUser>;\n /** The SubscriptionAuthority PDA to close */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** Optional rent recipient, required when the recorded payer differs from the user. Must match the stored payer. */\n receiver?: Address<TAccountReceiver>;\n};\n\nexport function getCloseSubscriptionAuthorityInstruction<\n TAccountUser extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountReceiver extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CloseSubscriptionAuthorityInput<TAccountUser, TAccountSubscriptionAuthority, TAccountReceiver>,\n config?: { programAddress?: TProgramAddress },\n): CloseSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n user: { value: input.user ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n receiver: { value: input.receiver ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('user', accounts.user),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('receiver', accounts.receiver),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getCloseSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as CloseSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >);\n}\n\nexport type ParsedCloseSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The user who owns the SubscriptionAuthority PDA (receives rent) */\n user: TAccountMetas[0];\n /** The SubscriptionAuthority PDA to close */\n subscriptionAuthority: TAccountMetas[1];\n /** Optional rent recipient, required when the recorded payer differs from the user. Must match the stored payer. */\n receiver?: TAccountMetas[2] | undefined;\n };\n data: CloseSubscriptionAuthorityInstructionData;\n};\n\nexport function parseCloseSubscriptionAuthorityInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCloseSubscriptionAuthorityInstruction<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 let optionalAccountsRemaining = instruction.accounts.length - 2;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n user: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n receiver: getNextOptionalAccount(),\n },\n data: getCloseSubscriptionAuthorityInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport {\n getCreateFixedDelegationDataDecoder,\n getCreateFixedDelegationDataEncoder,\n type CreateFixedDelegationData,\n type CreateFixedDelegationDataArgs,\n} from '../types';\n\nexport const CREATE_FIXED_DELEGATION_DISCRIMINATOR = 1;\n\nexport function getCreateFixedDelegationDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CREATE_FIXED_DELEGATION_DISCRIMINATOR);\n}\n\nexport type CreateFixedDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountDelegator extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegationAccount extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountDelegator extends string\n ? WritableSignerAccount<TAccountDelegator> & AccountSignerMeta<TAccountDelegator>\n : TAccountDelegator,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegationAccount extends string\n ? WritableAccount<TAccountDelegationAccount>\n : TAccountDelegationAccount,\n TAccountDelegatee extends string ? ReadonlyAccount<TAccountDelegatee> : TAccountDelegatee,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateFixedDelegationInstructionData = {\n discriminator: number;\n fixedDelegation: CreateFixedDelegationData;\n};\n\nexport type CreateFixedDelegationInstructionDataArgs = { fixedDelegation: CreateFixedDelegationDataArgs };\n\nexport function getCreateFixedDelegationInstructionDataEncoder(): FixedSizeEncoder<CreateFixedDelegationInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['fixedDelegation', getCreateFixedDelegationDataEncoder()],\n ]),\n value => ({ ...value, discriminator: CREATE_FIXED_DELEGATION_DISCRIMINATOR }),\n );\n}\n\nexport function getCreateFixedDelegationInstructionDataDecoder(): FixedSizeDecoder<CreateFixedDelegationInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['fixedDelegation', getCreateFixedDelegationDataDecoder()],\n ]);\n}\n\nexport function getCreateFixedDelegationInstructionDataCodec(): FixedSizeCodec<\n CreateFixedDelegationInstructionDataArgs,\n CreateFixedDelegationInstructionData\n> {\n return combineCodec(\n getCreateFixedDelegationInstructionDataEncoder(),\n getCreateFixedDelegationInstructionDataDecoder(),\n );\n}\n\nexport type CreateFixedDelegationInput<\n TAccountDelegator extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegationAccount extends string = string,\n TAccountDelegatee extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The user creating the delegation */\n delegator: TransactionSigner<TAccountDelegator>;\n /** The subscription_authority PDA for this token */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The fixed delegation PDA being created */\n delegationAccount: Address<TAccountDelegationAccount>;\n /** The user receiving delegation rights */\n delegatee: Address<TAccountDelegatee>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the delegator/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n fixedDelegation: CreateFixedDelegationInstructionDataArgs['fixedDelegation'];\n};\n\nexport function getCreateFixedDelegationInstruction<\n TAccountDelegator extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegationAccount extends string,\n TAccountDelegatee extends string,\n TAccountSystemProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CreateFixedDelegationInput<\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateFixedDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegator: { value: input.delegator ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\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 // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegator', accounts.delegator),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegationAccount', accounts.delegationAccount),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getCreateFixedDelegationInstructionDataEncoder().encode(args as CreateFixedDelegationInstructionDataArgs),\n programAddress,\n } as CreateFixedDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedCreateFixedDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The user creating the delegation */\n delegator: TAccountMetas[0];\n /** The subscription_authority PDA for this token */\n subscriptionAuthority: TAccountMetas[1];\n /** The fixed delegation PDA being created */\n delegationAccount: TAccountMetas[2];\n /** The user receiving delegation rights */\n delegatee: TAccountMetas[3];\n /** The system program */\n systemProgram: TAccountMetas[4];\n /** Optional sponsor that funds the account rent. Defaults to the delegator/signer when omitted. */\n payer?: TAccountMetas[5] | undefined;\n };\n data: CreateFixedDelegationInstructionData;\n};\n\nexport function parseCreateFixedDelegationInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateFixedDelegationInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 let optionalAccountsRemaining = instruction.accounts.length - 5;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n delegator: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegationAccount: getNextAccount(),\n delegatee: getNextAccount(),\n systemProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getCreateFixedDelegationInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getPlanDataDecoder, getPlanDataEncoder, type PlanData, type PlanDataArgs } from '../types';\n\nexport const CREATE_PLAN_DISCRIMINATOR = 7;\n\nexport function getCreatePlanDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CREATE_PLAN_DISCRIMINATOR);\n}\n\nexport type CreatePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMerchant extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountTokenProgram extends string | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountMerchant extends string\n ? WritableSignerAccount<TAccountMerchant> & AccountSignerMeta<TAccountMerchant>\n : TAccountMerchant,\n TAccountPlanPda extends string ? WritableAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreatePlanInstructionData = { discriminator: number; planData: PlanData };\n\nexport type CreatePlanInstructionDataArgs = { planData: PlanDataArgs };\n\nexport function getCreatePlanInstructionDataEncoder(): FixedSizeEncoder<CreatePlanInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['planData', getPlanDataEncoder()],\n ]),\n value => ({ ...value, discriminator: CREATE_PLAN_DISCRIMINATOR }),\n );\n}\n\nexport function getCreatePlanInstructionDataDecoder(): FixedSizeDecoder<CreatePlanInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['planData', getPlanDataDecoder()],\n ]);\n}\n\nexport function getCreatePlanInstructionDataCodec(): FixedSizeCodec<\n CreatePlanInstructionDataArgs,\n CreatePlanInstructionData\n> {\n return combineCodec(getCreatePlanInstructionDataEncoder(), getCreatePlanInstructionDataDecoder());\n}\n\nexport type CreatePlanInput<\n TAccountMerchant extends string = string,\n TAccountPlanPda extends string = string,\n TAccountTokenMint extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n /** The merchant creating the plan */\n merchant: TransactionSigner<TAccountMerchant>;\n /** The plan PDA being created */\n planPda: Address<TAccountPlanPda>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** The token program */\n tokenProgram?: Address<TAccountTokenProgram>;\n planData: CreatePlanInstructionDataArgs['planData'];\n};\n\nexport function getCreatePlanInstruction<\n TAccountMerchant extends string,\n TAccountPlanPda extends string,\n TAccountTokenMint extends string,\n TAccountSystemProgram extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CreatePlanInput<\n TAccountMerchant,\n TAccountPlanPda,\n TAccountTokenMint,\n TAccountSystemProgram,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreatePlanInstruction<\n TProgramAddress,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountTokenMint,\n TAccountSystemProgram,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n merchant: { value: input.merchant ?? null, isWritable: true },\n planPda: { value: input.planPda ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? 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.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('merchant', accounts.merchant),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n ],\n data: getCreatePlanInstructionDataEncoder().encode(args as CreatePlanInstructionDataArgs),\n programAddress,\n } as CreatePlanInstruction<\n TProgramAddress,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountTokenMint,\n TAccountSystemProgram,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedCreatePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The merchant creating the plan */\n merchant: TAccountMetas[0];\n /** The plan PDA being created */\n planPda: TAccountMetas[1];\n /** The token mint */\n tokenMint: TAccountMetas[2];\n /** The system program */\n systemProgram: TAccountMetas[3];\n /** The token program */\n tokenProgram: TAccountMetas[4];\n };\n data: CreatePlanInstructionData;\n};\n\nexport function parseCreatePlanInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreatePlanInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 merchant: getNextAccount(),\n planPda: getNextAccount(),\n tokenMint: getNextAccount(),\n systemProgram: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getCreatePlanInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport {\n getCreateRecurringDelegationDataDecoder,\n getCreateRecurringDelegationDataEncoder,\n type CreateRecurringDelegationData,\n type CreateRecurringDelegationDataArgs,\n} from '../types';\n\nexport const CREATE_RECURRING_DELEGATION_DISCRIMINATOR = 2;\n\nexport function getCreateRecurringDelegationDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CREATE_RECURRING_DELEGATION_DISCRIMINATOR);\n}\n\nexport type CreateRecurringDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountDelegator extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegationAccount extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountDelegator extends string\n ? WritableSignerAccount<TAccountDelegator> & AccountSignerMeta<TAccountDelegator>\n : TAccountDelegator,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegationAccount extends string\n ? WritableAccount<TAccountDelegationAccount>\n : TAccountDelegationAccount,\n TAccountDelegatee extends string ? ReadonlyAccount<TAccountDelegatee> : TAccountDelegatee,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateRecurringDelegationInstructionData = {\n discriminator: number;\n recurringDelegation: CreateRecurringDelegationData;\n};\n\nexport type CreateRecurringDelegationInstructionDataArgs = { recurringDelegation: CreateRecurringDelegationDataArgs };\n\nexport function getCreateRecurringDelegationInstructionDataEncoder(): FixedSizeEncoder<CreateRecurringDelegationInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['recurringDelegation', getCreateRecurringDelegationDataEncoder()],\n ]),\n value => ({ ...value, discriminator: CREATE_RECURRING_DELEGATION_DISCRIMINATOR }),\n );\n}\n\nexport function getCreateRecurringDelegationInstructionDataDecoder(): FixedSizeDecoder<CreateRecurringDelegationInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['recurringDelegation', getCreateRecurringDelegationDataDecoder()],\n ]);\n}\n\nexport function getCreateRecurringDelegationInstructionDataCodec(): FixedSizeCodec<\n CreateRecurringDelegationInstructionDataArgs,\n CreateRecurringDelegationInstructionData\n> {\n return combineCodec(\n getCreateRecurringDelegationInstructionDataEncoder(),\n getCreateRecurringDelegationInstructionDataDecoder(),\n );\n}\n\nexport type CreateRecurringDelegationInput<\n TAccountDelegator extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegationAccount extends string = string,\n TAccountDelegatee extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The user creating the delegation */\n delegator: TransactionSigner<TAccountDelegator>;\n /** The subscription_authority PDA for this token */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The recurring delegation PDA being created */\n delegationAccount: Address<TAccountDelegationAccount>;\n /** The user receiving delegation rights */\n delegatee: Address<TAccountDelegatee>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the delegator/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n recurringDelegation: CreateRecurringDelegationInstructionDataArgs['recurringDelegation'];\n};\n\nexport function getCreateRecurringDelegationInstruction<\n TAccountDelegator extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegationAccount extends string,\n TAccountDelegatee extends string,\n TAccountSystemProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CreateRecurringDelegationInput<\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateRecurringDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegator: { value: input.delegator ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\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 // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegator', accounts.delegator),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegationAccount', accounts.delegationAccount),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getCreateRecurringDelegationInstructionDataEncoder().encode(\n args as CreateRecurringDelegationInstructionDataArgs,\n ),\n programAddress,\n } as CreateRecurringDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedCreateRecurringDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The user creating the delegation */\n delegator: TAccountMetas[0];\n /** The subscription_authority PDA for this token */\n subscriptionAuthority: TAccountMetas[1];\n /** The recurring delegation PDA being created */\n delegationAccount: TAccountMetas[2];\n /** The user receiving delegation rights */\n delegatee: TAccountMetas[3];\n /** The system program */\n systemProgram: TAccountMetas[4];\n /** Optional sponsor that funds the account rent. Defaults to the delegator/signer when omitted. */\n payer?: TAccountMetas[5] | undefined;\n };\n data: CreateRecurringDelegationInstructionData;\n};\n\nexport function parseCreateRecurringDelegationInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateRecurringDelegationInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 let optionalAccountsRemaining = instruction.accounts.length - 5;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n delegator: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegationAccount: getNextAccount(),\n delegatee: getNextAccount(),\n systemProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getCreateRecurringDelegationInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const DELETE_PLAN_DISCRIMINATOR = 9;\n\nexport function getDeletePlanDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(DELETE_PLAN_DISCRIMINATOR);\n}\n\nexport type DeletePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountOwner extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountOwner extends string\n ? WritableSignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner>\n : TAccountOwner,\n TAccountPlanPda extends string ? WritableAccount<TAccountPlanPda> : TAccountPlanPda,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type DeletePlanInstructionData = { discriminator: number };\n\nexport type DeletePlanInstructionDataArgs = {};\n\nexport function getDeletePlanInstructionDataEncoder(): FixedSizeEncoder<DeletePlanInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: DELETE_PLAN_DISCRIMINATOR,\n }));\n}\n\nexport function getDeletePlanInstructionDataDecoder(): FixedSizeDecoder<DeletePlanInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getDeletePlanInstructionDataCodec(): FixedSizeCodec<\n DeletePlanInstructionDataArgs,\n DeletePlanInstructionData\n> {\n return combineCodec(getDeletePlanInstructionDataEncoder(), getDeletePlanInstructionDataDecoder());\n}\n\nexport type DeletePlanInput<TAccountOwner extends string = string, TAccountPlanPda extends string = string> = {\n /** The plan owner deleting the plan (receives rent) */\n owner: TransactionSigner<TAccountOwner>;\n /** The plan PDA being deleted */\n planPda: Address<TAccountPlanPda>;\n};\n\nexport function getDeletePlanInstruction<\n TAccountOwner extends string,\n TAccountPlanPda extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: DeletePlanInput<TAccountOwner, TAccountPlanPda>,\n config?: { programAddress?: TProgramAddress },\n): DeletePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: true },\n planPda: { value: input.planPda ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [getAccountMeta('owner', accounts.owner), getAccountMeta('planPda', accounts.planPda)],\n data: getDeletePlanInstructionDataEncoder().encode({}),\n programAddress,\n } as DeletePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda>);\n}\n\nexport type ParsedDeletePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The plan owner deleting the plan (receives rent) */\n owner: TAccountMetas[0];\n /** The plan PDA being deleted */\n planPda: TAccountMetas[1];\n };\n data: DeletePlanInstructionData;\n};\n\nexport function parseDeletePlanInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedDeletePlanInstruction<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: { owner: getNextAccount(), planPda: getNextAccount() },\n data: getDeletePlanInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionAuthorityPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 0;\n\nexport function getInitSubscriptionAuthorityDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);\n}\n\nexport type InitSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountOwner extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountUserAta extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountOwner extends string\n ? WritableSignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner>\n : TAccountOwner,\n TAccountSubscriptionAuthority extends string\n ? WritableAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountUserAta extends string ? WritableAccount<TAccountUserAta> : TAccountUserAta,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitSubscriptionAuthorityInstructionData = { discriminator: number };\n\nexport type InitSubscriptionAuthorityInstructionDataArgs = {};\n\nexport function getInitSubscriptionAuthorityInstructionDataEncoder(): FixedSizeEncoder<InitSubscriptionAuthorityInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,\n }));\n}\n\nexport function getInitSubscriptionAuthorityInstructionDataDecoder(): FixedSizeDecoder<InitSubscriptionAuthorityInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getInitSubscriptionAuthorityInstructionDataCodec(): FixedSizeCodec<\n InitSubscriptionAuthorityInstructionDataArgs,\n InitSubscriptionAuthorityInstructionData\n> {\n return combineCodec(\n getInitSubscriptionAuthorityInstructionDataEncoder(),\n getInitSubscriptionAuthorityInstructionDataDecoder(),\n );\n}\n\nexport type InitSubscriptionAuthorityAsyncInput<\n TAccountOwner extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountTokenMint extends string = string,\n TAccountUserAta extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The owner of the subscription-authority program */\n owner: TransactionSigner<TAccountOwner>;\n /** The subscription_authority PDA that will be the delegate instance for this token */\n subscriptionAuthority?: Address<TAccountSubscriptionAuthority>;\n /** The token mint that we are creating a subscription-authority account for */\n tokenMint: Address<TAccountTokenMint>;\n /** The ata that we are setting up delegation for */\n userAta: Address<TAccountUserAta>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the owner/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n};\n\nexport async function getInitSubscriptionAuthorityInstructionAsync<\n TAccountOwner extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountTokenMint extends string,\n TAccountUserAta extends string,\n TAccountSystemProgram extends string,\n TAccountTokenProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: InitSubscriptionAuthorityAsyncInput<\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n userAta: { value: input.userAta ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.subscriptionAuthority.value) {\n accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda({\n user: getAddressFromResolvedInstructionAccount('owner', accounts.owner.value),\n tokenMint: getAddressFromResolvedInstructionAccount('tokenMint', accounts.tokenMint.value),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('owner', accounts.owner),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('userAta', accounts.userAta),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getInitSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >);\n}\n\nexport type InitSubscriptionAuthorityInput<\n TAccountOwner extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountTokenMint extends string = string,\n TAccountUserAta extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The owner of the subscription-authority program */\n owner: TransactionSigner<TAccountOwner>;\n /** The subscription_authority PDA that will be the delegate instance for this token */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The token mint that we are creating a subscription-authority account for */\n tokenMint: Address<TAccountTokenMint>;\n /** The ata that we are setting up delegation for */\n userAta: Address<TAccountUserAta>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the owner/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n};\n\nexport function getInitSubscriptionAuthorityInstruction<\n TAccountOwner extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountTokenMint extends string,\n TAccountUserAta extends string,\n TAccountSystemProgram extends string,\n TAccountTokenProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: InitSubscriptionAuthorityInput<\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n userAta: { value: input.userAta ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('owner', accounts.owner),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('userAta', accounts.userAta),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getInitSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedInitSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The owner of the subscription-authority program */\n owner: TAccountMetas[0];\n /** The subscription_authority PDA that will be the delegate instance for this token */\n subscriptionAuthority: TAccountMetas[1];\n /** The token mint that we are creating a subscription-authority account for */\n tokenMint: TAccountMetas[2];\n /** The ata that we are setting up delegation for */\n userAta: TAccountMetas[3];\n /** The system program */\n systemProgram: TAccountMetas[4];\n /** Token program */\n tokenProgram: TAccountMetas[5];\n /** Optional sponsor that funds the account rent. Defaults to the owner/signer when omitted. */\n payer?: TAccountMetas[6] | undefined;\n };\n data: InitSubscriptionAuthorityInstructionData;\n};\n\nexport function parseInitSubscriptionAuthorityInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitSubscriptionAuthorityInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 6) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 6,\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 let optionalAccountsRemaining = instruction.accounts.length - 6;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n owner: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n tokenMint: getNextAccount(),\n userAta: getNextAccount(),\n systemProgram: getNextAccount(),\n tokenProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getInitSubscriptionAuthorityInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionDelegationPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const RESUME_SUBSCRIPTION_DISCRIMINATOR = 13;\n\nexport function getResumeSubscriptionDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(RESUME_SUBSCRIPTION_DISCRIMINATOR);\n}\n\nexport type ResumeSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriber extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriber extends string\n ? ReadonlySignerAccount<TAccountSubscriber> & AccountSignerMeta<TAccountSubscriber>\n : TAccountSubscriber,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ResumeSubscriptionInstructionData = { discriminator: number };\n\nexport type ResumeSubscriptionInstructionDataArgs = {};\n\nexport function getResumeSubscriptionInstructionDataEncoder(): FixedSizeEncoder<ResumeSubscriptionInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: RESUME_SUBSCRIPTION_DISCRIMINATOR,\n }));\n}\n\nexport function getResumeSubscriptionInstructionDataDecoder(): FixedSizeDecoder<ResumeSubscriptionInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getResumeSubscriptionInstructionDataCodec(): FixedSizeCodec<\n ResumeSubscriptionInstructionDataArgs,\n ResumeSubscriptionInstructionData\n> {\n return combineCodec(getResumeSubscriptionInstructionDataEncoder(), getResumeSubscriptionInstructionDataDecoder());\n}\n\nexport type ResumeSubscriptionAsyncInput<\n TAccountSubscriber extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber resuming the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being resumed */\n subscriptionPda?: Address<TAccountSubscriptionPda>;\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n};\n\nexport async function getResumeSubscriptionInstructionAsync<\n TAccountSubscriber extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: ResumeSubscriptionAsyncInput<\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.subscriptionPda.value) {\n accounts.subscriptionPda.value = await findSubscriptionDelegationPda({\n planPda: getAddressFromResolvedInstructionAccount('planPda', accounts.planPda.value),\n subscriber: getAddressFromResolvedInstructionAccount('subscriber', accounts.subscriber.value),\n });\n }\n if (!accounts.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getResumeSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ResumeSubscriptionInput<\n TAccountSubscriber extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber resuming the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being resumed */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n};\n\nexport function getResumeSubscriptionInstruction<\n TAccountSubscriber extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: ResumeSubscriptionInput<\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getResumeSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedResumeSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscriber resuming the subscription */\n subscriber: TAccountMetas[0];\n /** The plan PDA for the subscription */\n planPda: TAccountMetas[1];\n /** The subscription PDA being resumed */\n subscriptionPda: TAccountMetas[2];\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthority: TAccountMetas[3];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[4];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[5];\n };\n data: ResumeSubscriptionInstructionData;\n};\n\nexport function parseResumeSubscriptionInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedResumeSubscriptionInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 6) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 6,\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 subscriber: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getResumeSubscriptionInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR = 15;\n\nexport function getRevokeAbandonedDelegationDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR);\n}\n\nexport type RevokeAbandonedDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountDelegationAccount extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountDelegationAccount extends string\n ? WritableAccount<TAccountDelegationAccount>\n : TAccountDelegationAccount,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevokeAbandonedDelegationInstructionData = { discriminator: number };\n\nexport type RevokeAbandonedDelegationInstructionDataArgs = {};\n\nexport function getRevokeAbandonedDelegationInstructionDataEncoder(): FixedSizeEncoder<RevokeAbandonedDelegationInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR,\n }));\n}\n\nexport function getRevokeAbandonedDelegationInstructionDataDecoder(): FixedSizeDecoder<RevokeAbandonedDelegationInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getRevokeAbandonedDelegationInstructionDataCodec(): FixedSizeCodec<\n RevokeAbandonedDelegationInstructionDataArgs,\n RevokeAbandonedDelegationInstructionData\n> {\n return combineCodec(\n getRevokeAbandonedDelegationInstructionDataEncoder(),\n getRevokeAbandonedDelegationInstructionDataDecoder(),\n );\n}\n\nexport type RevokeAbandonedDelegationInput<\n TAccountPayer extends string = string,\n TAccountDelegationAccount extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n> = {\n /** The recorded payer reclaiming rent */\n payer: TransactionSigner<TAccountPayer>;\n /** The fixed or recurring delegation PDA to close */\n delegationAccount: Address<TAccountDelegationAccount>;\n /** The delegation's recorded SubscriptionAuthority PDA (may be closed) */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n};\n\nexport function getRevokeAbandonedDelegationInstruction<\n TAccountPayer extends string,\n TAccountDelegationAccount extends string,\n TAccountSubscriptionAuthority extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeAbandonedDelegationInput<TAccountPayer, TAccountDelegationAccount, TAccountSubscriptionAuthority>,\n config?: { programAddress?: TProgramAddress },\n): RevokeAbandonedDelegationInstruction<\n TProgramAddress,\n TAccountPayer,\n TAccountDelegationAccount,\n TAccountSubscriptionAuthority\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n payer: { value: input.payer ?? null, isWritable: true },\n delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? 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('payer', accounts.payer),\n getAccountMeta('delegationAccount', accounts.delegationAccount),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n ],\n data: getRevokeAbandonedDelegationInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeAbandonedDelegationInstruction<\n TProgramAddress,\n TAccountPayer,\n TAccountDelegationAccount,\n TAccountSubscriptionAuthority\n >);\n}\n\nexport type ParsedRevokeAbandonedDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The recorded payer reclaiming rent */\n payer: TAccountMetas[0];\n /** The fixed or recurring delegation PDA to close */\n delegationAccount: TAccountMetas[1];\n /** The delegation's recorded SubscriptionAuthority PDA (may be closed) */\n subscriptionAuthority: TAccountMetas[2];\n };\n data: RevokeAbandonedDelegationInstructionData;\n};\n\nexport function parseRevokeAbandonedDelegationInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevokeAbandonedDelegationInstruction<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 payer: getNextAccount(),\n delegationAccount: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n },\n data: getRevokeAbandonedDelegationInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR = 16;\n\nexport function getRevokeAbandonedSubscriptionDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR);\n}\n\nexport type RevokeAbandonedSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountSubscriptionAccount extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountSubscriptionAccount extends string\n ? WritableAccount<TAccountSubscriptionAccount>\n : TAccountSubscriptionAccount,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevokeAbandonedSubscriptionInstructionData = { discriminator: number };\n\nexport type RevokeAbandonedSubscriptionInstructionDataArgs = {};\n\nexport function getRevokeAbandonedSubscriptionInstructionDataEncoder(): FixedSizeEncoder<RevokeAbandonedSubscriptionInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR,\n }));\n}\n\nexport function getRevokeAbandonedSubscriptionInstructionDataDecoder(): FixedSizeDecoder<RevokeAbandonedSubscriptionInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getRevokeAbandonedSubscriptionInstructionDataCodec(): FixedSizeCodec<\n RevokeAbandonedSubscriptionInstructionDataArgs,\n RevokeAbandonedSubscriptionInstructionData\n> {\n return combineCodec(\n getRevokeAbandonedSubscriptionInstructionDataEncoder(),\n getRevokeAbandonedSubscriptionInstructionDataDecoder(),\n );\n}\n\nexport type RevokeAbandonedSubscriptionInput<\n TAccountPayer extends string = string,\n TAccountSubscriptionAccount extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountPlanPda extends string = string,\n> = {\n /** The recorded payer reclaiming rent */\n payer: TransactionSigner<TAccountPayer>;\n /** The abandoned subscription PDA to close */\n subscriptionAccount: Address<TAccountSubscriptionAccount>;\n /** The subscriber's recorded SubscriptionAuthority PDA for the plan's mint (may be closed) */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The plan the subscription belongs to; provides the mint */\n planPda: Address<TAccountPlanPda>;\n};\n\nexport function getRevokeAbandonedSubscriptionInstruction<\n TAccountPayer extends string,\n TAccountSubscriptionAccount extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountPlanPda extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeAbandonedSubscriptionInput<\n TAccountPayer,\n TAccountSubscriptionAccount,\n TAccountSubscriptionAuthority,\n TAccountPlanPda\n >,\n config?: { programAddress?: TProgramAddress },\n): RevokeAbandonedSubscriptionInstruction<\n TProgramAddress,\n TAccountPayer,\n TAccountSubscriptionAccount,\n TAccountSubscriptionAuthority,\n TAccountPlanPda\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n payer: { value: input.payer ?? null, isWritable: true },\n subscriptionAccount: { value: input.subscriptionAccount ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n planPda: { value: input.planPda ?? 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('payer', accounts.payer),\n getAccountMeta('subscriptionAccount', accounts.subscriptionAccount),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('planPda', accounts.planPda),\n ],\n data: getRevokeAbandonedSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeAbandonedSubscriptionInstruction<\n TProgramAddress,\n TAccountPayer,\n TAccountSubscriptionAccount,\n TAccountSubscriptionAuthority,\n TAccountPlanPda\n >);\n}\n\nexport type ParsedRevokeAbandonedSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The recorded payer reclaiming rent */\n payer: TAccountMetas[0];\n /** The abandoned subscription PDA to close */\n subscriptionAccount: TAccountMetas[1];\n /** The subscriber's recorded SubscriptionAuthority PDA for the plan's mint (may be closed) */\n subscriptionAuthority: TAccountMetas[2];\n /** The plan the subscription belongs to; provides the mint */\n planPda: TAccountMetas[3];\n };\n data: RevokeAbandonedSubscriptionInstructionData;\n};\n\nexport function parseRevokeAbandonedSubscriptionInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevokeAbandonedSubscriptionInstruction<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 return {\n programAddress: instruction.programAddress,\n accounts: {\n payer: getNextAccount(),\n subscriptionAccount: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n planPda: getNextAccount(),\n },\n data: getRevokeAbandonedSubscriptionInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const REVOKE_DELEGATION_DISCRIMINATOR = 3;\n\nexport function getRevokeDelegationDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(REVOKE_DELEGATION_DISCRIMINATOR);\n}\n\nexport type RevokeDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountDelegationAccount extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountDelegationAccount extends string\n ? WritableAccount<TAccountDelegationAccount>\n : TAccountDelegationAccount,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevokeDelegationInstructionData = { discriminator: number };\n\nexport type RevokeDelegationInstructionDataArgs = {};\n\nexport function getRevokeDelegationInstructionDataEncoder(): FixedSizeEncoder<RevokeDelegationInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: REVOKE_DELEGATION_DISCRIMINATOR,\n }));\n}\n\nexport function getRevokeDelegationInstructionDataDecoder(): FixedSizeDecoder<RevokeDelegationInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getRevokeDelegationInstructionDataCodec(): FixedSizeCodec<\n RevokeDelegationInstructionDataArgs,\n RevokeDelegationInstructionData\n> {\n return combineCodec(getRevokeDelegationInstructionDataEncoder(), getRevokeDelegationInstructionDataDecoder());\n}\n\nexport type RevokeDelegationInput<\n TAccountAuthority extends string = string,\n TAccountDelegationAccount extends string = string,\n> = {\n /** The delegator revoking the delegation (receives rent) */\n authority: TransactionSigner<TAccountAuthority>;\n /** The delegation PDA to close */\n delegationAccount: Address<TAccountDelegationAccount>;\n};\n\nexport function getRevokeDelegationInstruction<\n TAccountAuthority extends string,\n TAccountDelegationAccount extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeDelegationInput<TAccountAuthority, TAccountDelegationAccount>,\n config?: { programAddress?: TProgramAddress },\n): RevokeDelegationInstruction<TProgramAddress, TAccountAuthority, TAccountDelegationAccount> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },\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('authority', accounts.authority),\n getAccountMeta('delegationAccount', accounts.delegationAccount),\n ],\n data: getRevokeDelegationInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeDelegationInstruction<TProgramAddress, TAccountAuthority, TAccountDelegationAccount>);\n}\n\nexport type ParsedRevokeDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The delegator revoking the delegation (receives rent) */\n authority: TAccountMetas[0];\n /** The delegation PDA to close */\n delegationAccount: TAccountMetas[1];\n };\n data: RevokeDelegationInstructionData;\n};\n\nexport function parseRevokeDelegationInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevokeDelegationInstruction<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: { authority: getNextAccount(), delegationAccount: getNextAccount() },\n data: getRevokeDelegationInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionAuthorityPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 14;\n\nexport function getRevokeSubscriptionAuthorityDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);\n}\n\nexport type RevokeSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountUser extends string | AccountMeta<string> = string,\n TAccountUserAta extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountReceiver extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountUser extends string\n ? WritableSignerAccount<TAccountUser> & AccountSignerMeta<TAccountUser>\n : TAccountUser,\n TAccountUserAta extends string ? WritableAccount<TAccountUserAta> : TAccountUserAta,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n TAccountSubscriptionAuthority extends string\n ? WritableAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n ...(TAccountReceiver extends undefined\n ? []\n : [TAccountReceiver extends string ? WritableAccount<TAccountReceiver> : TAccountReceiver]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevokeSubscriptionAuthorityInstructionData = { discriminator: number };\n\nexport type RevokeSubscriptionAuthorityInstructionDataArgs = {};\n\nexport function getRevokeSubscriptionAuthorityInstructionDataEncoder(): FixedSizeEncoder<RevokeSubscriptionAuthorityInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,\n }));\n}\n\nexport function getRevokeSubscriptionAuthorityInstructionDataDecoder(): FixedSizeDecoder<RevokeSubscriptionAuthorityInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getRevokeSubscriptionAuthorityInstructionDataCodec(): FixedSizeCodec<\n RevokeSubscriptionAuthorityInstructionDataArgs,\n RevokeSubscriptionAuthorityInstructionData\n> {\n return combineCodec(\n getRevokeSubscriptionAuthorityInstructionDataEncoder(),\n getRevokeSubscriptionAuthorityInstructionDataDecoder(),\n );\n}\n\nexport type RevokeSubscriptionAuthorityAsyncInput<\n TAccountUser extends string = string,\n TAccountUserAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountReceiver extends string = string,\n> = {\n /** The ATA owner: revokes the program's delegate and, when still open, closes the SubscriptionAuthority PDA (receives rent when self-funded) */\n user: TransactionSigner<TAccountUser>;\n /** The user's ATA whose delegate is being revoked */\n userAta: Address<TAccountUserAta>;\n /** The token mint of the user's ATA */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The SubscriptionAuthority PDA. Closed when still open; ignored when already closed. */\n subscriptionAuthority?: Address<TAccountSubscriptionAuthority>;\n /** Optional rent recipient, required when the SubscriptionAuthority is still open and its recorded payer differs from the user. Must match the stored payer. */\n receiver?: Address<TAccountReceiver>;\n};\n\nexport async function getRevokeSubscriptionAuthorityInstructionAsync<\n TAccountUser extends string,\n TAccountUserAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountReceiver extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeSubscriptionAuthorityAsyncInput<\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RevokeSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n user: { value: input.user ?? null, isWritable: true },\n userAta: { value: input.userAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n receiver: { value: input.receiver ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.subscriptionAuthority.value) {\n accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda({\n user: getAddressFromResolvedInstructionAccount('user', accounts.user.value),\n tokenMint: getAddressFromResolvedInstructionAccount('tokenMint', accounts.tokenMint.value),\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('user', accounts.user),\n getAccountMeta('userAta', accounts.userAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('receiver', accounts.receiver),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getRevokeSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >);\n}\n\nexport type RevokeSubscriptionAuthorityInput<\n TAccountUser extends string = string,\n TAccountUserAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountReceiver extends string = string,\n> = {\n /** The ATA owner: revokes the program's delegate and, when still open, closes the SubscriptionAuthority PDA (receives rent when self-funded) */\n user: TransactionSigner<TAccountUser>;\n /** The user's ATA whose delegate is being revoked */\n userAta: Address<TAccountUserAta>;\n /** The token mint of the user's ATA */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The SubscriptionAuthority PDA. Closed when still open; ignored when already closed. */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** Optional rent recipient, required when the SubscriptionAuthority is still open and its recorded payer differs from the user. Must match the stored payer. */\n receiver?: Address<TAccountReceiver>;\n};\n\nexport function getRevokeSubscriptionAuthorityInstruction<\n TAccountUser extends string,\n TAccountUserAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountReceiver extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeSubscriptionAuthorityInput<\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >,\n config?: { programAddress?: TProgramAddress },\n): RevokeSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n user: { value: input.user ?? null, isWritable: true },\n userAta: { value: input.userAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n receiver: { value: input.receiver ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('user', accounts.user),\n getAccountMeta('userAta', accounts.userAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('receiver', accounts.receiver),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getRevokeSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >);\n}\n\nexport type ParsedRevokeSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The ATA owner: revokes the program's delegate and, when still open, closes the SubscriptionAuthority PDA (receives rent when self-funded) */\n user: TAccountMetas[0];\n /** The user's ATA whose delegate is being revoked */\n userAta: TAccountMetas[1];\n /** The token mint of the user's ATA */\n tokenMint: TAccountMetas[2];\n /** Token program */\n tokenProgram: TAccountMetas[3];\n /** The SubscriptionAuthority PDA. Closed when still open; ignored when already closed. */\n subscriptionAuthority: TAccountMetas[4];\n /** Optional rent recipient, required when the SubscriptionAuthority is still open and its recorded payer differs from the user. Must match the stored payer. */\n receiver?: TAccountMetas[5] | undefined;\n };\n data: RevokeSubscriptionAuthorityInstructionData;\n};\n\nexport function parseRevokeSubscriptionAuthorityInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevokeSubscriptionAuthorityInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 let optionalAccountsRemaining = instruction.accounts.length - 5;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n user: getNextAccount(),\n userAta: getNextAccount(),\n tokenMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n receiver: getNextOptionalAccount(),\n },\n data: getRevokeSubscriptionAuthorityInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionDelegationPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getSubscribeDataDecoder, getSubscribeDataEncoder, type SubscribeData, type SubscribeDataArgs } from '../types';\n\nexport const SUBSCRIBE_DISCRIMINATOR = 11;\n\nexport function getSubscribeDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(SUBSCRIBE_DISCRIMINATOR);\n}\n\nexport type SubscribeInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriber extends string | AccountMeta<string> = string,\n TAccountMerchant extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthorityPda extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriber extends string\n ? WritableSignerAccount<TAccountSubscriber> & AccountSignerMeta<TAccountSubscriber>\n : TAccountSubscriber,\n TAccountMerchant extends string ? ReadonlyAccount<TAccountMerchant> : TAccountMerchant,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthorityPda>\n : TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SubscribeInstructionData = { discriminator: number; subscribeData: SubscribeData };\n\nexport type SubscribeInstructionDataArgs = { subscribeData: SubscribeDataArgs };\n\nexport function getSubscribeInstructionDataEncoder(): FixedSizeEncoder<SubscribeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['subscribeData', getSubscribeDataEncoder()],\n ]),\n value => ({ ...value, discriminator: SUBSCRIBE_DISCRIMINATOR }),\n );\n}\n\nexport function getSubscribeInstructionDataDecoder(): FixedSizeDecoder<SubscribeInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['subscribeData', getSubscribeDataDecoder()],\n ]);\n}\n\nexport function getSubscribeInstructionDataCodec(): FixedSizeCodec<\n SubscribeInstructionDataArgs,\n SubscribeInstructionData\n> {\n return combineCodec(getSubscribeInstructionDataEncoder(), getSubscribeInstructionDataDecoder());\n}\n\nexport type SubscribeAsyncInput<\n TAccountSubscriber extends string = string,\n TAccountMerchant extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountSubscriptionAuthorityPda extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The subscriber creating the subscription (pays rent) */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The merchant who owns the plan */\n merchant: Address<TAccountMerchant>;\n /** The plan PDA to subscribe to */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being created */\n subscriptionPda?: Address<TAccountSubscriptionPda>;\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthorityPda: Address<TAccountSubscriptionAuthorityPda>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the subscriber/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n subscribeData: SubscribeInstructionDataArgs['subscribeData'];\n};\n\nexport async function getSubscribeInstructionAsync<\n TAccountSubscriber extends string,\n TAccountMerchant extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountSubscriptionAuthorityPda extends string,\n TAccountSystemProgram extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: SubscribeAsyncInput<\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SubscribeInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: true },\n merchant: { value: input.merchant ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n subscriptionAuthorityPda: { value: input.subscriptionAuthorityPda ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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 // Resolve default values.\n if (!accounts.subscriptionPda.value) {\n accounts.subscriptionPda.value = await findSubscriptionDelegationPda({\n planPda: getAddressFromResolvedInstructionAccount('planPda', accounts.planPda.value),\n subscriber: getAddressFromResolvedInstructionAccount('subscriber', accounts.subscriber.value),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('merchant', accounts.merchant),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('subscriptionAuthorityPda', accounts.subscriptionAuthorityPda),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getSubscribeInstructionDataEncoder().encode(args as SubscribeInstructionDataArgs),\n programAddress,\n } as SubscribeInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >);\n}\n\nexport type SubscribeInput<\n TAccountSubscriber extends string = string,\n TAccountMerchant extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountSubscriptionAuthorityPda extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The subscriber creating the subscription (pays rent) */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The merchant who owns the plan */\n merchant: Address<TAccountMerchant>;\n /** The plan PDA to subscribe to */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being created */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthorityPda: Address<TAccountSubscriptionAuthorityPda>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the subscriber/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n subscribeData: SubscribeInstructionDataArgs['subscribeData'];\n};\n\nexport function getSubscribeInstruction<\n TAccountSubscriber extends string,\n TAccountMerchant extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountSubscriptionAuthorityPda extends string,\n TAccountSystemProgram extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: SubscribeInput<\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): SubscribeInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: true },\n merchant: { value: input.merchant ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n subscriptionAuthorityPda: { value: input.subscriptionAuthorityPda ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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 // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('merchant', accounts.merchant),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('subscriptionAuthorityPda', accounts.subscriptionAuthorityPda),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getSubscribeInstructionDataEncoder().encode(args as SubscribeInstructionDataArgs),\n programAddress,\n } as SubscribeInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedSubscribeInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscriber creating the subscription (pays rent) */\n subscriber: TAccountMetas[0];\n /** The merchant who owns the plan */\n merchant: TAccountMetas[1];\n /** The plan PDA to subscribe to */\n planPda: TAccountMetas[2];\n /** The subscription PDA being created */\n subscriptionPda: TAccountMetas[3];\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthorityPda: TAccountMetas[4];\n /** The system program */\n systemProgram: TAccountMetas[5];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[6];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[7];\n /** Optional sponsor that funds the account rent. Defaults to the subscriber/signer when omitted. */\n payer?: TAccountMetas[8] | undefined;\n };\n data: SubscribeInstructionData;\n};\n\nexport function parseSubscribeInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSubscribeInstruction<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 let optionalAccountsRemaining = instruction.accounts.length - 8;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n subscriber: getNextAccount(),\n merchant: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionPda: getNextAccount(),\n subscriptionAuthorityPda: getNextAccount(),\n systemProgram: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getSubscribeInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getTransferDataDecoder, getTransferDataEncoder, type TransferData, type TransferDataArgs } from '../types';\n\nexport const TRANSFER_FIXED_DISCRIMINATOR = 4;\n\nexport function getTransferFixedDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(TRANSFER_FIXED_DISCRIMINATOR);\n}\n\nexport type TransferFixedInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountDelegationPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegatorAta extends string | AccountMeta<string> = string,\n TAccountReceiverAta extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountDelegationPda extends string ? WritableAccount<TAccountDelegationPda> : TAccountDelegationPda,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegatorAta extends string ? WritableAccount<TAccountDelegatorAta> : TAccountDelegatorAta,\n TAccountReceiverAta extends string ? WritableAccount<TAccountReceiverAta> : TAccountReceiverAta,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n TAccountDelegatee extends string\n ? ReadonlySignerAccount<TAccountDelegatee> & AccountSignerMeta<TAccountDelegatee>\n : TAccountDelegatee,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type TransferFixedInstructionData = { discriminator: number; transferData: TransferData };\n\nexport type TransferFixedInstructionDataArgs = { transferData: TransferDataArgs };\n\nexport function getTransferFixedInstructionDataEncoder(): FixedSizeEncoder<TransferFixedInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['transferData', getTransferDataEncoder()],\n ]),\n value => ({ ...value, discriminator: TRANSFER_FIXED_DISCRIMINATOR }),\n );\n}\n\nexport function getTransferFixedInstructionDataDecoder(): FixedSizeDecoder<TransferFixedInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['transferData', getTransferDataDecoder()],\n ]);\n}\n\nexport function getTransferFixedInstructionDataCodec(): FixedSizeCodec<\n TransferFixedInstructionDataArgs,\n TransferFixedInstructionData\n> {\n return combineCodec(getTransferFixedInstructionDataEncoder(), getTransferFixedInstructionDataDecoder());\n}\n\nexport type TransferFixedAsyncInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountDelegatee extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The fixed delegation PDA to transfer from */\n delegationPda: Address<TAccountDelegationPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The delegatee signing the transfer */\n delegatee: TransactionSigner<TAccountDelegatee>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferFixedInstructionDataArgs['transferData'];\n};\n\nexport async function getTransferFixedInstructionAsync<\n TAccountDelegationPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountDelegatee extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferFixedAsyncInput<\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n TransferFixedInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegationPda: { value: input.delegationPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegationPda', accounts.delegationPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferFixedInstructionDataEncoder().encode(args as TransferFixedInstructionDataArgs),\n programAddress,\n } as TransferFixedInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type TransferFixedInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountDelegatee extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The fixed delegation PDA to transfer from */\n delegationPda: Address<TAccountDelegationPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The delegatee signing the transfer */\n delegatee: TransactionSigner<TAccountDelegatee>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferFixedInstructionDataArgs['transferData'];\n};\n\nexport function getTransferFixedInstruction<\n TAccountDelegationPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountDelegatee extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferFixedInput<\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): TransferFixedInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegationPda: { value: input.delegationPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegationPda', accounts.delegationPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferFixedInstructionDataEncoder().encode(args as TransferFixedInstructionDataArgs),\n programAddress,\n } as TransferFixedInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedTransferFixedInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The fixed delegation PDA to transfer from */\n delegationPda: TAccountMetas[0];\n /** The subscription-authority PDA */\n subscriptionAuthority: TAccountMetas[1];\n /** The delegator's ATA to transfer from */\n delegatorAta: TAccountMetas[2];\n /** The receiver's ATA to transfer to */\n receiverAta: TAccountMetas[3];\n /** The token mint */\n tokenMint: TAccountMetas[4];\n /** Token program */\n tokenProgram: TAccountMetas[5];\n /** The delegatee signing the transfer */\n delegatee: TAccountMetas[6];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[7];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[8];\n };\n data: TransferFixedInstructionData;\n};\n\nexport function parseTransferFixedInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedTransferFixedInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 9) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 9,\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 delegationPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: getNextAccount(),\n tokenMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n delegatee: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getTransferFixedInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getTransferDataDecoder, getTransferDataEncoder, type TransferData, type TransferDataArgs } from '../types';\n\nexport const TRANSFER_RECURRING_DISCRIMINATOR = 5;\n\nexport function getTransferRecurringDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(TRANSFER_RECURRING_DISCRIMINATOR);\n}\n\nexport type TransferRecurringInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountDelegationPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegatorAta extends string | AccountMeta<string> = string,\n TAccountReceiverAta extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountDelegationPda extends string ? WritableAccount<TAccountDelegationPda> : TAccountDelegationPda,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegatorAta extends string ? WritableAccount<TAccountDelegatorAta> : TAccountDelegatorAta,\n TAccountReceiverAta extends string ? WritableAccount<TAccountReceiverAta> : TAccountReceiverAta,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n TAccountDelegatee extends string\n ? ReadonlySignerAccount<TAccountDelegatee> & AccountSignerMeta<TAccountDelegatee>\n : TAccountDelegatee,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type TransferRecurringInstructionData = { discriminator: number; transferData: TransferData };\n\nexport type TransferRecurringInstructionDataArgs = { transferData: TransferDataArgs };\n\nexport function getTransferRecurringInstructionDataEncoder(): FixedSizeEncoder<TransferRecurringInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['transferData', getTransferDataEncoder()],\n ]),\n value => ({ ...value, discriminator: TRANSFER_RECURRING_DISCRIMINATOR }),\n );\n}\n\nexport function getTransferRecurringInstructionDataDecoder(): FixedSizeDecoder<TransferRecurringInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['transferData', getTransferDataDecoder()],\n ]);\n}\n\nexport function getTransferRecurringInstructionDataCodec(): FixedSizeCodec<\n TransferRecurringInstructionDataArgs,\n TransferRecurringInstructionData\n> {\n return combineCodec(getTransferRecurringInstructionDataEncoder(), getTransferRecurringInstructionDataDecoder());\n}\n\nexport type TransferRecurringAsyncInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountDelegatee extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The recurring delegation PDA to transfer from */\n delegationPda: Address<TAccountDelegationPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The delegatee signing the transfer */\n delegatee: TransactionSigner<TAccountDelegatee>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferRecurringInstructionDataArgs['transferData'];\n};\n\nexport async function getTransferRecurringInstructionAsync<\n TAccountDelegationPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountDelegatee extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferRecurringAsyncInput<\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n TransferRecurringInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegationPda: { value: input.delegationPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegationPda', accounts.delegationPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferRecurringInstructionDataEncoder().encode(args as TransferRecurringInstructionDataArgs),\n programAddress,\n } as TransferRecurringInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type TransferRecurringInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountDelegatee extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The recurring delegation PDA to transfer from */\n delegationPda: Address<TAccountDelegationPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The delegatee signing the transfer */\n delegatee: TransactionSigner<TAccountDelegatee>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferRecurringInstructionDataArgs['transferData'];\n};\n\nexport function getTransferRecurringInstruction<\n TAccountDelegationPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountDelegatee extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferRecurringInput<\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): TransferRecurringInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegationPda: { value: input.delegationPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegationPda', accounts.delegationPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferRecurringInstructionDataEncoder().encode(args as TransferRecurringInstructionDataArgs),\n programAddress,\n } as TransferRecurringInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedTransferRecurringInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The recurring delegation PDA to transfer from */\n delegationPda: TAccountMetas[0];\n /** The subscription-authority PDA */\n subscriptionAuthority: TAccountMetas[1];\n /** The delegator's ATA to transfer from */\n delegatorAta: TAccountMetas[2];\n /** The receiver's ATA to transfer to */\n receiverAta: TAccountMetas[3];\n /** The token mint */\n tokenMint: TAccountMetas[4];\n /** Token program */\n tokenProgram: TAccountMetas[5];\n /** The delegatee signing the transfer */\n delegatee: TAccountMetas[6];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[7];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[8];\n };\n data: TransferRecurringInstructionData;\n};\n\nexport function parseTransferRecurringInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedTransferRecurringInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 9) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 9,\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 delegationPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: getNextAccount(),\n tokenMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n delegatee: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getTransferRecurringInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getTransferDataDecoder, getTransferDataEncoder, type TransferData, type TransferDataArgs } from '../types';\n\nexport const TRANSFER_SUBSCRIPTION_DISCRIMINATOR = 10;\n\nexport function getTransferSubscriptionDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(TRANSFER_SUBSCRIPTION_DISCRIMINATOR);\n}\n\nexport type TransferSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegatorAta extends string | AccountMeta<string> = string,\n TAccountReceiverAta extends string | AccountMeta<string> = string,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegatorAta extends string ? WritableAccount<TAccountDelegatorAta> : TAccountDelegatorAta,\n TAccountReceiverAta extends string ? WritableAccount<TAccountReceiverAta> : TAccountReceiverAta,\n TAccountCaller extends string\n ? ReadonlySignerAccount<TAccountCaller> & AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type TransferSubscriptionInstructionData = { discriminator: number; transferData: TransferData };\n\nexport type TransferSubscriptionInstructionDataArgs = { transferData: TransferDataArgs };\n\nexport function getTransferSubscriptionInstructionDataEncoder(): FixedSizeEncoder<TransferSubscriptionInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['transferData', getTransferDataEncoder()],\n ]),\n value => ({ ...value, discriminator: TRANSFER_SUBSCRIPTION_DISCRIMINATOR }),\n );\n}\n\nexport function getTransferSubscriptionInstructionDataDecoder(): FixedSizeDecoder<TransferSubscriptionInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['transferData', getTransferDataDecoder()],\n ]);\n}\n\nexport function getTransferSubscriptionInstructionDataCodec(): FixedSizeCodec<\n TransferSubscriptionInstructionDataArgs,\n TransferSubscriptionInstructionData\n> {\n return combineCodec(\n getTransferSubscriptionInstructionDataEncoder(),\n getTransferSubscriptionInstructionDataDecoder(),\n );\n}\n\nexport type TransferSubscriptionAsyncInput<\n TAccountSubscriptionPda extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountCaller extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscription delegation PDA */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The plan PDA */\n planPda: Address<TAccountPlanPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The authorized puller (plan owner or whitelisted) */\n caller: TransactionSigner<TAccountCaller>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferSubscriptionInstructionDataArgs['transferData'];\n};\n\nexport async function getTransferSubscriptionInstructionAsync<\n TAccountSubscriptionPda extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountCaller extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferSubscriptionAsyncInput<\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n TransferSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n caller: { value: input.caller ?? null, isWritable: false },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('caller', accounts.caller),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferSubscriptionInstructionDataEncoder().encode(args as TransferSubscriptionInstructionDataArgs),\n programAddress,\n } as TransferSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type TransferSubscriptionInput<\n TAccountSubscriptionPda extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountCaller extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscription delegation PDA */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The plan PDA */\n planPda: Address<TAccountPlanPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The authorized puller (plan owner or whitelisted) */\n caller: TransactionSigner<TAccountCaller>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferSubscriptionInstructionDataArgs['transferData'];\n};\n\nexport function getTransferSubscriptionInstruction<\n TAccountSubscriptionPda extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountCaller extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferSubscriptionInput<\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): TransferSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n caller: { value: input.caller ?? null, isWritable: false },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('caller', accounts.caller),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferSubscriptionInstructionDataEncoder().encode(args as TransferSubscriptionInstructionDataArgs),\n programAddress,\n } as TransferSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedTransferSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscription delegation PDA */\n subscriptionPda: TAccountMetas[0];\n /** The plan PDA */\n planPda: TAccountMetas[1];\n /** The subscription-authority PDA */\n subscriptionAuthority: TAccountMetas[2];\n /** The delegator's ATA to transfer from */\n delegatorAta: TAccountMetas[3];\n /** The receiver's ATA to transfer to */\n receiverAta: TAccountMetas[4];\n /** The authorized puller (plan owner or whitelisted) */\n caller: TAccountMetas[5];\n /** The token mint */\n tokenMint: TAccountMetas[6];\n /** Token program */\n tokenProgram: TAccountMetas[7];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[8];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[9];\n };\n data: TransferSubscriptionInstructionData;\n};\n\nexport function parseTransferSubscriptionInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedTransferSubscriptionInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 10) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 10,\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 subscriptionPda: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: getNextAccount(),\n caller: getNextAccount(),\n tokenMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getTransferSubscriptionInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport {\n getUpdatePlanDataDecoder,\n getUpdatePlanDataEncoder,\n type UpdatePlanData,\n type UpdatePlanDataArgs,\n} from '../types';\n\nexport const UPDATE_PLAN_DISCRIMINATOR = 8;\n\nexport function getUpdatePlanDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(UPDATE_PLAN_DISCRIMINATOR);\n}\n\nexport type UpdatePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountOwner extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountOwner extends string\n ? ReadonlySignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner>\n : TAccountOwner,\n TAccountPlanPda extends string ? WritableAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type UpdatePlanInstructionData = { discriminator: number; updatePlanData: UpdatePlanData };\n\nexport type UpdatePlanInstructionDataArgs = { updatePlanData: UpdatePlanDataArgs };\n\nexport function getUpdatePlanInstructionDataEncoder(): FixedSizeEncoder<UpdatePlanInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['updatePlanData', getUpdatePlanDataEncoder()],\n ]),\n value => ({ ...value, discriminator: UPDATE_PLAN_DISCRIMINATOR }),\n );\n}\n\nexport function getUpdatePlanInstructionDataDecoder(): FixedSizeDecoder<UpdatePlanInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['updatePlanData', getUpdatePlanDataDecoder()],\n ]);\n}\n\nexport function getUpdatePlanInstructionDataCodec(): FixedSizeCodec<\n UpdatePlanInstructionDataArgs,\n UpdatePlanInstructionData\n> {\n return combineCodec(getUpdatePlanInstructionDataEncoder(), getUpdatePlanInstructionDataDecoder());\n}\n\nexport type UpdatePlanAsyncInput<\n TAccountOwner extends string = string,\n TAccountPlanPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The plan owner updating the plan */\n owner: TransactionSigner<TAccountOwner>;\n /** The plan PDA being updated */\n planPda: Address<TAccountPlanPda>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n updatePlanData: UpdatePlanInstructionDataArgs['updatePlanData'];\n};\n\nexport async function getUpdatePlanInstructionAsync<\n TAccountOwner extends string,\n TAccountPlanPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: UpdatePlanAsyncInput<TAccountOwner, TAccountPlanPda, TAccountEventAuthority, TAccountSelfProgram>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n UpdatePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda, TAccountEventAuthority, TAccountSelfProgram>\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('owner', accounts.owner),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getUpdatePlanInstructionDataEncoder().encode(args as UpdatePlanInstructionDataArgs),\n programAddress,\n } as UpdatePlanInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountPlanPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type UpdatePlanInput<\n TAccountOwner extends string = string,\n TAccountPlanPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The plan owner updating the plan */\n owner: TransactionSigner<TAccountOwner>;\n /** The plan PDA being updated */\n planPda: Address<TAccountPlanPda>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n updatePlanData: UpdatePlanInstructionDataArgs['updatePlanData'];\n};\n\nexport function getUpdatePlanInstruction<\n TAccountOwner extends string,\n TAccountPlanPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: UpdatePlanInput<TAccountOwner, TAccountPlanPda, TAccountEventAuthority, TAccountSelfProgram>,\n config?: { programAddress?: TProgramAddress },\n): UpdatePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda, TAccountEventAuthority, TAccountSelfProgram> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('owner', accounts.owner),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getUpdatePlanInstructionDataEncoder().encode(args as UpdatePlanInstructionDataArgs),\n programAddress,\n } as UpdatePlanInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountPlanPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedUpdatePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The plan owner updating the plan */\n owner: TAccountMetas[0];\n /** The plan PDA being updated */\n planPda: TAccountMetas[1];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[2];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[3];\n };\n data: UpdatePlanInstructionData;\n};\n\nexport function parseUpdatePlanInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedUpdatePlanInstruction<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 return {\n programAddress: instruction.programAddress,\n accounts: {\n owner: getNextAccount(),\n planPda: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getUpdatePlanInstructionDataDecoder().decode(instruction.data),\n };\n}\n","import { SUBSCRIPTIONS_PROGRAM_ADDRESS } from './generated/index.js';\n\n/** Deployed program address, sourced from Codama-generated bindings. */\nexport const PROGRAM_ID = SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n/** Current on-chain account schema version. */\nexport const CURRENT_PROGRAM_VERSION = 1;\n\n/** Default zero address used for padding arrays (e.g. empty puller/destination slots). */\nexport const ZERO_ADDRESS =\n '11111111111111111111111111111111' as import('@solana/kit').Address<'11111111111111111111111111111111'>;\n\n/** Byte offset of the account discriminator in the Header struct. */\nexport const DISCRIMINATOR_OFFSET = 0;\n/** Byte offset of the delegator pubkey in the Header struct. */\nexport const DELEGATOR_OFFSET = 3;\n/** Byte offset of the delegatee pubkey in the Header struct. */\nexport const DELEGATEE_OFFSET = 35;\n\n/** Byte size of a u64 value (used in nonce encoding). */\nexport const U64_BYTE_SIZE = 8;\n\n/** PDA seed for SubscriptionAuthority accounts. */\nexport const SUBSCRIPTION_AUTHORITY_SEED = 'SubscriptionAuthority';\n\n/** PDA seed for delegation accounts (FixedDelegation, RecurringDelegation). */\nexport const DELEGATION_SEED = 'delegation';\n\n/** PDA seed for Plan accounts. */\nexport const PLAN_SEED = 'plan';\n/** PDA seed for SubscriptionDelegation accounts. */\nexport const SUBSCRIPTION_SEED = 'subscription';\n/** PDA seed for the event authority (self-CPI). */\nexport const EVENT_AUTHORITY_SEED = 'event_authority';\n\n/** On-chain Plan account size in bytes: discriminator(1) + owner(32) + bump(1) + status(1) + planData(456). */\nexport const PLAN_SIZE = 491;\n/** On-chain SubscriptionDelegation account size in bytes: header(107) + terms(24) + pulled(8) + periodStart(8) + expiresAt(8). */\nexport const SUBSCRIPTION_SIZE = 155;\n\n/** Byte offset of the owner pubkey in a Plan account. */\nexport const PLAN_OWNER_OFFSET = 1;\n\n/** Maximum number of destination addresses in a Plan. */\nexport const MAX_PLAN_DESTINATIONS = 4;\n/** Maximum number of puller addresses in a Plan. */\nexport const MAX_PLAN_PULLERS = 4;\n/** Maximum byte length of a Plan's metadata URI. */\nexport const METADATA_URI_LEN = 128;\n\n/** On-chain delegation variant identifier (matches the `kind` tag in the `Delegation` union). */\nexport type DelegationKindId = 'fixed' | 'recurring' | 'subscription';\n","import type { Address, Base58EncodedBytes, GetProgramAccountsApi, Rpc } from '@solana/kit';\n\nimport { DELEGATEE_OFFSET, DELEGATOR_OFFSET } from '../constants.js';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../generated/index.js';\nimport type { Delegation } from '../types/delegation.js';\nimport type { RawProgramAccount } from './decode.js';\nimport { decodeDelegationAccount } from './decode.js';\n\n/**\n * Fetches all delegation accounts (fixed, recurring, and subscription) for a delegator.\n *\n * @param rpc - An RPC client supporting `getProgramAccounts`.\n * @param wallet - The delegator's wallet address.\n * @returns All decoded delegations owned by the wallet.\n */\nexport async function fetchDelegationsByDelegator(\n rpc: Rpc<GetProgramAccountsApi>,\n wallet: Address,\n programAddress?: Address,\n): Promise<Delegation[]> {\n return await fetchDelegationsByOffset(rpc, wallet, DELEGATOR_OFFSET, programAddress);\n}\n\n/**\n * Fetches all delegation accounts (fixed, recurring, and subscription) for a delegatee.\n *\n * @param rpc - An RPC client supporting `getProgramAccounts`.\n * @param wallet - The delegatee's wallet address.\n * @param programAddress - Optional program address override.\n * @returns All decoded delegations where the wallet is the delegatee.\n */\nexport async function fetchDelegationsByDelegatee(\n rpc: Rpc<GetProgramAccountsApi>,\n wallet: Address,\n programAddress?: Address,\n): Promise<Delegation[]> {\n return await fetchDelegationsByOffset(rpc, wallet, DELEGATEE_OFFSET, programAddress);\n}\n\nasync function fetchDelegationsByOffset(\n rpc: Rpc<GetProgramAccountsApi>,\n wallet: Address,\n offset: number,\n programAddress?: Address,\n): Promise<Delegation[]> {\n const progAddr = programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n const response = await rpc\n .getProgramAccounts(progAddr, {\n encoding: 'base64',\n filters: [\n {\n memcmp: {\n bytes: wallet as string as Base58EncodedBytes,\n encoding: 'base58',\n offset: BigInt(offset),\n },\n },\n ],\n })\n .send();\n\n return response\n .map(account => decodeDelegationAccount(account as unknown as RawProgramAccount, progAddr))\n .filter((d): d is Delegation => d !== null);\n}\n","import type { Address, Base58EncodedBytes, GetProgramAccountsApi, Rpc } from '@solana/kit';\n\nimport { PLAN_OWNER_OFFSET, PLAN_SIZE } from '../constants.js';\nimport { decodePlan, SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../generated/index.js';\nimport type { PlanWithAddress } from '../types/plan.js';\nimport { toEncodedAccount } from './decode.js';\n\n/**\n * Fetches all plan accounts owned by a given address, filtered by account size.\n *\n * @param rpc - An RPC client supporting `getProgramAccounts`.\n * @param owner - The plan owner's wallet address.\n * @returns All decoded plans belonging to the owner.\n */\nexport async function fetchPlansForOwner(\n rpc: Rpc<GetProgramAccountsApi>,\n owner: Address,\n programAddress?: Address,\n): Promise<PlanWithAddress[]> {\n const progAddr = programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n const response = await rpc\n .getProgramAccounts(progAddr, {\n encoding: 'base64',\n filters: [\n { dataSize: BigInt(PLAN_SIZE) },\n {\n memcmp: {\n bytes: owner as string as Base58EncodedBytes,\n encoding: 'base58',\n offset: BigInt(PLAN_OWNER_OFFSET),\n },\n },\n ],\n })\n .send();\n\n return response.map(account => {\n const encoded = toEncodedAccount(account, progAddr);\n const { address, data } = decodePlan(encoded);\n return { address, data };\n });\n}\n","import type { Address, Base58EncodedBytes, GetProgramAccountsApi, Rpc } from '@solana/kit';\n\nimport { DELEGATOR_OFFSET, SUBSCRIPTION_SIZE } from '../constants.js';\nimport {\n decodeSubscriptionDelegation,\n type SubscriptionDelegation,\n SUBSCRIPTIONS_PROGRAM_ADDRESS,\n} from '../generated/index.js';\nimport type { RawProgramAccount } from './decode.js';\nimport { toEncodedAccount } from './decode.js';\n\n/**\n * Fetches all subscription delegation accounts for a given subscriber wallet.\n *\n * @param rpc - An RPC client supporting `getProgramAccounts`.\n * @param user - The subscriber's (delegator's) wallet address.\n * @returns Decoded subscription delegations paired with their on-chain addresses.\n */\nexport async function fetchSubscriptionsForUser(\n rpc: Rpc<GetProgramAccountsApi>,\n user: Address,\n programAddress?: Address,\n): Promise<Array<{ address: Address; data: SubscriptionDelegation }>> {\n const progAddr = programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n const response = await rpc\n .getProgramAccounts(progAddr, {\n encoding: 'base64',\n filters: [\n { dataSize: BigInt(SUBSCRIPTION_SIZE) },\n {\n memcmp: {\n bytes: user as string as Base58EncodedBytes,\n encoding: 'base58',\n offset: BigInt(DELEGATOR_OFFSET),\n },\n },\n ],\n })\n .send();\n\n return response.map(account => {\n const raw = account as unknown as RawProgramAccount;\n const encoded = toEncodedAccount(raw, progAddr);\n const decoded = decodeSubscriptionDelegation(encoded);\n return { address: raw.pubkey, data: decoded.data };\n });\n}\n","/**\n * `subscriptionsProgram()` — `@solana/kit` plugin that wraps the Codama-generated\n * `subscriptionsProgram()` plugin with higher-level instruction overlays\n * (PDA derivation, event-account resolution [`eventAuthority` + `selfProgram`\n * from the active `programAddress`], sponsor `payer` trailing accounts, ATA\n * derivation, validators) and a `queries` namespace for common account fetches.\n *\n * Each overlay defaults its actor field (`owner` / `delegator` / `subscriber`\n * / `authority` / `delegatee` / `caller`) to `client.identity`, and any\n * `payer` slot to `client.payer`. Sponsor flows install separate signers via\n * `payer()` + `identity()` instead of `signer()`.\n *\n * @example Same signer for everything\n * ```ts\n * import { createClient } from '@solana/kit';\n * import { signer } from '@solana/kit-plugin-signer';\n * import { solanaLocalRpc } from '@solana/kit-plugin-rpc';\n * import { subscriptionsProgram } from '@solana/subscriptions';\n *\n * const client = createClient()\n * .use(signer(mySigner))\n * .use(solanaLocalRpc())\n * .use(subscriptionsProgram());\n *\n * await client.subscriptions.instructions\n * .createPlan({ planId, mint, amount, periodHours, endTs, destinations, pullers, metadataUri })\n * .sendTransaction();\n * ```\n *\n * @example Sponsor pays fees + rent on behalf of the user\n * ```ts\n * import { payer, identity } from '@solana/kit-plugin-signer';\n *\n * const client = createClient()\n * .use(payer(sponsorSigner)) // pays gas + rent\n * .use(identity(userSigner)) // signs as delegator\n * .use(solanaLocalRpc())\n * .use(subscriptionsProgram());\n *\n * await client.subscriptions.instructions\n * .createFixedDelegation({ delegatee, nonce, amount, expiryTs, tokenMint })\n * .sendTransaction();\n * ```\n */\n\nimport {\n AccountRole,\n type Address,\n type ClientWithIdentity,\n type ClientWithPayer,\n type ClientWithRpc,\n type GetProgramAccountsApi,\n type Instruction,\n pipe,\n type TransactionSigner,\n} from '@solana/kit';\nimport { addSelfPlanAndSendFunctions, type SelfPlanAndSendFunctions } from '@solana/program-client-core';\nimport { findAssociatedTokenPda } from '@solana-program/token';\n\nimport { fetchDelegationsByDelegatee, fetchDelegationsByDelegator } from './accounts/delegations.js';\nimport { fetchPlansForOwner } from './accounts/plans.js';\nimport {\n fetchMaybeSubscriptionAuthority,\n fetchPlan,\n findEventAuthorityPda,\n findFixedDelegationPda,\n findPlanPda,\n findRecurringDelegationPda,\n findSubscriptionAuthorityPda,\n getCancelSubscriptionInstructionAsync,\n getCloseSubscriptionAuthorityInstruction,\n getCreateFixedDelegationInstruction,\n getCreatePlanInstruction,\n getCreateRecurringDelegationInstruction,\n getDeletePlanInstruction,\n getInitSubscriptionAuthorityInstructionAsync,\n getResumeSubscriptionInstructionAsync,\n getRevokeDelegationInstruction,\n getRevokeSubscriptionAuthorityInstruction,\n getSubscribeInstructionAsync,\n getTransferFixedInstruction,\n getTransferRecurringInstruction,\n getTransferSubscriptionInstruction,\n getUpdatePlanInstruction,\n type PlanStatus,\n SUBSCRIPTIONS_PROGRAM_ADDRESS,\n type SubscriptionsPlugin as GeneratedSubscriptionsPlugin,\n type SubscriptionsPluginRequirements as GeneratedSubscriptionsPluginRequirements,\n subscriptionsProgram as generatedSubscriptionsProgram,\n} from './generated/index.js';\nimport { resolveTransferHookAccounts, type TransferHookAccount } from './transfer-hook.js';\nimport type { Delegation } from './types/delegation.js';\nimport type { PlanWithAddress } from './types/plan.js';\nimport { assertMetadataUri, assertPositive, assertSafeU64, padPlanDestinations, padPlanPullers } from './validators.js';\n\ntype WithProgramAddress = { programAddress?: Address };\n\n/** Mark `K` keys of `T` as optional (used to relax overlay inputs that the\n * plugin can fill from `client.identity` / `client.payer`). */\ntype MakeOptional<T, K extends keyof T> = Omit<T, K> & { [P in K]?: T[P] };\n\nfunction pdaConfig(programAddress?: Address) {\n return programAddress ? { programAddress } : {};\n}\n\nasync function eventAccounts(programAddress?: Address) {\n const [eventAuthority] = await findEventAuthorityPda(pdaConfig(programAddress));\n return { eventAuthority, selfProgram: programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS };\n}\n\nfunction withTrailing<I extends Instruction>(\n instruction: I,\n trailing: Array<{\n address: Address;\n role: number;\n signer?: TransactionSigner;\n }>,\n): I {\n if (trailing.length === 0) return instruction;\n const accounts = [\n ...((instruction as Instruction & { accounts?: readonly unknown[] }).accounts ?? []),\n ...trailing,\n ];\n return { ...instruction, accounts };\n}\n\nfunction appendPayer<I extends Instruction>(instruction: I, payer: TransactionSigner | undefined): I {\n if (!payer) return instruction;\n return withTrailing(instruction, [\n {\n address: payer.address,\n role: AccountRole.WRITABLE_SIGNER,\n signer: payer,\n },\n ]);\n}\n\n// ============================================================================\n// Instruction overlay inputs\n// ============================================================================\n\nexport type InitSubscriptionAuthorityInput = WithProgramAddress & {\n owner: TransactionSigner;\n payer?: TransactionSigner;\n tokenMint: Address;\n tokenProgram: Address;\n userAta: Address;\n};\n\nexport type CloseSubscriptionAuthorityInput = WithProgramAddress & {\n receiver?: Address;\n tokenMint: Address;\n user: TransactionSigner;\n};\n\nexport type RevokeSubscriptionAuthorityInput = WithProgramAddress & {\n /** Rent recipient for closing the SubscriptionAuthority PDA. Required when the authority's stored payer differs from `user`, and must equal that stored payer. */\n receiver?: Address;\n tokenMint: Address;\n tokenProgram: Address;\n user: TransactionSigner;\n};\n\nexport type CreateFixedDelegationInput = WithProgramAddress & {\n amount: bigint | number;\n delegatee: Address;\n delegator: TransactionSigner;\n expectedSubscriptionAuthorityInitId?: bigint | number;\n expiryTs: bigint | number;\n nonce: bigint | number;\n payer?: TransactionSigner;\n tokenMint: Address;\n};\n\nexport type CreateRecurringDelegationInput = WithProgramAddress & {\n amountPerPeriod: bigint | number;\n delegatee: Address;\n delegator: TransactionSigner;\n expectedSubscriptionAuthorityInitId?: bigint | number;\n expiryTs: bigint | number;\n nonce: bigint | number;\n payer?: TransactionSigner;\n periodLengthS: bigint | number;\n /** Unix timestamp when the first period begins. Pass 0 to start when the\n * transaction lands on chain (requires a non-zero `expiryTs`). */\n startTs: bigint | number;\n tokenMint: Address;\n};\n\nexport type RevokeDelegationInput = WithProgramAddress & {\n authority: TransactionSigner;\n delegationAccount: Address;\n receiver?: Address;\n};\n\nexport type RevokeSubscriptionInput = WithProgramAddress & {\n authority: TransactionSigner;\n planPda: Address;\n receiver?: Address;\n subscriptionPda: Address;\n};\n\nexport type TransferDelegationInput = WithProgramAddress & {\n amount: bigint | number;\n delegatee: TransactionSigner;\n delegationPda: Address;\n delegator: Address;\n delegatorAta: Address;\n receiverAta: Address;\n tokenMint: Address;\n tokenProgram: Address;\n /** Token-2022 transfer-hook accounts. Leave unset: the plugin client resolves\n * them from the mint's hook. Set to override resolution, or when calling the\n * overlay instruction directly (which does not auto-resolve). */\n transferHookAccounts?: TransferHookAccount[];\n};\n\nexport type TransferSubscriptionInput = WithProgramAddress & {\n amount: bigint | number;\n caller: TransactionSigner;\n delegator: Address;\n planPda: Address;\n receiverAta: Address;\n subscriptionPda: Address;\n tokenMint: Address;\n tokenProgram: Address;\n /** Token-2022 transfer-hook accounts. Leave unset: the plugin client resolves\n * them from the mint's hook. Set to override resolution, or when calling the\n * overlay instruction directly (which does not auto-resolve). */\n transferHookAccounts?: TransferHookAccount[];\n};\n\nexport type CreatePlanInput = WithProgramAddress & {\n amount: bigint | number;\n destinations: Address[];\n endTs: bigint | number;\n metadataUri: string;\n mint: Address;\n owner: TransactionSigner;\n periodHours: bigint | number;\n planId: bigint | number;\n pullers: Address[];\n tokenProgram?: Address;\n};\n\nexport type UpdatePlanInput = WithProgramAddress & {\n endTs: bigint | number;\n metadataUri: string;\n owner: TransactionSigner;\n planPda: Address;\n pullers: Address[];\n status: PlanStatus;\n};\n\nexport type DeletePlanInput = WithProgramAddress & {\n owner: TransactionSigner;\n planPda: Address;\n};\n\nexport type SubscribeInput = WithProgramAddress & {\n /**\n * Live plan terms snapshot the subscriber consents to. If omitted, the\n * caller must use the plugin client's `subscribe` (which fetches the live\n * plan via rpc); the standalone overlay cannot fetch on its own.\n */\n expectedAmount?: bigint | number;\n expectedCreatedAt?: bigint | number;\n expectedPeriodHours?: bigint | number;\n expectedSubscriptionAuthorityInitId?: bigint | number;\n merchant: Address;\n payer?: TransactionSigner;\n planId: bigint | number;\n subscriber: TransactionSigner;\n tokenMint: Address;\n};\n\nexport type CancelSubscriptionInput = WithProgramAddress & {\n planPda: Address;\n subscriber: TransactionSigner;\n subscriptionPda?: Address;\n};\n\nexport type ResumeSubscriptionInput = WithProgramAddress & {\n planPda: Address;\n subscriber: TransactionSigner;\n subscriptionPda?: Address;\n tokenMint: Address;\n};\n\n// ============================================================================\n// Overlay instruction builders (return Instruction / Promise<Instruction>)\n// ============================================================================\n\nexport async function getInitSubscriptionAuthorityOverlayInstructionAsync(\n input: InitSubscriptionAuthorityInput,\n): Promise<Instruction> {\n return appendPayer(\n await getInitSubscriptionAuthorityInstructionAsync(\n {\n owner: input.owner,\n tokenMint: input.tokenMint,\n tokenProgram: input.tokenProgram,\n userAta: input.userAta,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\nexport async function getCloseSubscriptionAuthorityOverlayInstructionAsync(\n input: CloseSubscriptionAuthorityInput,\n): Promise<Instruction> {\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.user.address },\n pdaConfig(input.programAddress),\n );\n let ix: Instruction = getCloseSubscriptionAuthorityInstruction(\n { subscriptionAuthority, user: input.user },\n pdaConfig(input.programAddress),\n );\n if (input.receiver) {\n ix = withTrailing(ix, [{ address: input.receiver, role: AccountRole.WRITABLE }]);\n }\n return ix;\n}\n\nexport async function getRevokeSubscriptionAuthorityOverlayInstructionAsync(\n input: RevokeSubscriptionAuthorityInput,\n): Promise<Instruction> {\n const [userAta] = await findAssociatedTokenPda({\n mint: input.tokenMint,\n owner: input.user.address,\n tokenProgram: input.tokenProgram,\n });\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.user.address },\n pdaConfig(input.programAddress),\n );\n let ix: Instruction = getRevokeSubscriptionAuthorityInstruction(\n {\n subscriptionAuthority,\n tokenMint: input.tokenMint,\n tokenProgram: input.tokenProgram,\n user: input.user,\n userAta,\n },\n pdaConfig(input.programAddress),\n );\n if (input.receiver) {\n ix = withTrailing(ix, [{ address: input.receiver, role: AccountRole.WRITABLE }]);\n }\n return ix;\n}\n\nexport async function getCreateFixedDelegationOverlayInstructionAsync(\n input: CreateFixedDelegationInput,\n): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n if (input.expectedSubscriptionAuthorityInitId === undefined) {\n throw new Error(\n 'getCreateFixedDelegationOverlayInstructionAsync requires expectedSubscriptionAuthorityInitId. Use the plugin client `subscriptions.instructions.createFixedDelegation(...)` to auto-fetch from the live authority.',\n );\n }\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator.address },\n pdaConfig(input.programAddress),\n );\n const [delegationPda] = await findFixedDelegationPda(\n {\n delegatee: input.delegatee,\n delegator: input.delegator.address,\n nonce: input.nonce,\n subscriptionAuthority,\n },\n pdaConfig(input.programAddress),\n );\n return appendPayer(\n getCreateFixedDelegationInstruction(\n {\n delegatee: input.delegatee,\n delegationAccount: delegationPda,\n delegator: input.delegator,\n fixedDelegation: {\n amount: input.amount,\n expectedSubscriptionAuthorityInitId: input.expectedSubscriptionAuthorityInitId,\n expiryTs: input.expiryTs,\n nonce: input.nonce,\n },\n subscriptionAuthority,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\nexport async function getCreateRecurringDelegationOverlayInstructionAsync(\n input: CreateRecurringDelegationInput,\n): Promise<Instruction> {\n assertPositive(input.amountPerPeriod, 'amountPerPeriod');\n assertPositive(input.periodLengthS, 'periodLengthS');\n if (input.expectedSubscriptionAuthorityInitId === undefined) {\n throw new Error(\n 'getCreateRecurringDelegationOverlayInstructionAsync requires expectedSubscriptionAuthorityInitId. Use the plugin client `subscriptions.instructions.createRecurringDelegation(...)` to auto-fetch from the live authority.',\n );\n }\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator.address },\n pdaConfig(input.programAddress),\n );\n const [delegationPda] = await findRecurringDelegationPda(\n {\n delegatee: input.delegatee,\n delegator: input.delegator.address,\n nonce: input.nonce,\n subscriptionAuthority,\n },\n pdaConfig(input.programAddress),\n );\n return appendPayer(\n getCreateRecurringDelegationInstruction(\n {\n delegatee: input.delegatee,\n delegationAccount: delegationPda,\n delegator: input.delegator,\n recurringDelegation: {\n amountPerPeriod: input.amountPerPeriod,\n expectedSubscriptionAuthorityInitId: input.expectedSubscriptionAuthorityInitId,\n expiryTs: input.expiryTs,\n nonce: input.nonce,\n periodLengthS: input.periodLengthS,\n startTs: input.startTs,\n },\n subscriptionAuthority,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\n/** Revoke a fixed/recurring delegation. For subscription PDAs use {@link getRevokeSubscriptionOverlayInstruction}. */\nexport function getRevokeDelegationOverlayInstruction(input: RevokeDelegationInput): Instruction {\n let ix: Instruction = getRevokeDelegationInstruction(\n {\n authority: input.authority,\n delegationAccount: input.delegationAccount,\n },\n pdaConfig(input.programAddress),\n );\n if (input.receiver) {\n ix = withTrailing(ix, [{ address: input.receiver, role: AccountRole.WRITABLE }]);\n }\n return ix;\n}\n\n/**\n * Revoke a subscription PDA. Trailing-account layout: `[planPda, receiver?]`.\n * For fixed/recurring delegations use {@link getRevokeDelegationOverlayInstruction}.\n */\nexport function getRevokeSubscriptionOverlayInstruction(input: RevokeSubscriptionInput): Instruction {\n const trailing: { address: Address; role: number }[] = [{ address: input.planPda, role: AccountRole.READONLY }];\n if (input.receiver) {\n trailing.push({ address: input.receiver, role: AccountRole.WRITABLE });\n }\n return withTrailing(\n getRevokeDelegationInstruction(\n {\n authority: input.authority,\n delegationAccount: input.subscriptionPda,\n },\n pdaConfig(input.programAddress),\n ),\n trailing,\n );\n}\n\nasync function getTransferDelegationOverlayInstructionAsync(\n input: TransferDelegationInput,\n getInstruction: typeof getTransferFixedInstruction | typeof getTransferRecurringInstruction,\n): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator },\n pdaConfig(input.programAddress),\n );\n return withTrailing(\n getInstruction(\n {\n ...(await eventAccounts(input.programAddress)),\n delegatee: input.delegatee,\n delegationPda: input.delegationPda,\n delegatorAta: input.delegatorAta,\n receiverAta: input.receiverAta,\n subscriptionAuthority,\n tokenMint: input.tokenMint,\n tokenProgram: input.tokenProgram,\n transferData: {\n amount: input.amount,\n delegator: input.delegator,\n mint: input.tokenMint,\n },\n },\n pdaConfig(input.programAddress),\n ),\n input.transferHookAccounts ?? [],\n );\n}\n\nexport function getTransferFixedOverlayInstructionAsync(input: TransferDelegationInput): Promise<Instruction> {\n return getTransferDelegationOverlayInstructionAsync(input, getTransferFixedInstruction);\n}\n\nexport function getTransferRecurringOverlayInstructionAsync(input: TransferDelegationInput): Promise<Instruction> {\n return getTransferDelegationOverlayInstructionAsync(input, getTransferRecurringInstruction);\n}\n\nexport async function getTransferSubscriptionOverlayInstructionAsync(\n input: TransferSubscriptionInput,\n): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator },\n pdaConfig(input.programAddress),\n );\n const [delegatorAta] = await findAssociatedTokenPda({\n mint: input.tokenMint,\n owner: input.delegator,\n tokenProgram: input.tokenProgram,\n });\n return withTrailing(\n getTransferSubscriptionInstruction(\n {\n ...(await eventAccounts(input.programAddress)),\n caller: input.caller,\n delegatorAta,\n planPda: input.planPda,\n receiverAta: input.receiverAta,\n subscriptionAuthority,\n subscriptionPda: input.subscriptionPda,\n tokenMint: input.tokenMint,\n tokenProgram: input.tokenProgram,\n transferData: {\n amount: input.amount,\n delegator: input.delegator,\n mint: input.tokenMint,\n },\n },\n pdaConfig(input.programAddress),\n ),\n input.transferHookAccounts ?? [],\n );\n}\n\nexport async function getCreatePlanOverlayInstructionAsync(input: CreatePlanInput): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n assertPositive(input.periodHours, 'periodHours');\n assertSafeU64(input.planId, 'planId');\n assertMetadataUri(input.metadataUri);\n const destinations = padPlanDestinations(input.destinations);\n const pullers = padPlanPullers(input.pullers);\n\n const [planPda] = await findPlanPda(\n { owner: input.owner.address, planId: input.planId },\n pdaConfig(input.programAddress),\n );\n\n return getCreatePlanInstruction(\n {\n merchant: input.owner,\n planData: {\n destinations,\n endTs: input.endTs,\n metadataUri: input.metadataUri,\n mint: input.mint,\n planId: input.planId,\n pullers,\n terms: {\n amount: input.amount,\n createdAt: 0n,\n periodHours: input.periodHours,\n },\n },\n planPda,\n tokenMint: input.mint,\n tokenProgram: input.tokenProgram,\n },\n pdaConfig(input.programAddress),\n );\n}\n\nexport async function getUpdatePlanOverlayInstruction(input: UpdatePlanInput): Promise<Instruction> {\n assertMetadataUri(input.metadataUri);\n const pullers = padPlanPullers(input.pullers);\n return getUpdatePlanInstruction(\n {\n ...(await eventAccounts(input.programAddress)),\n owner: input.owner,\n planPda: input.planPda,\n updatePlanData: {\n endTs: input.endTs,\n metadataUri: input.metadataUri,\n pullers,\n status: input.status,\n },\n },\n pdaConfig(input.programAddress),\n );\n}\n\nexport function getDeletePlanOverlayInstruction(input: DeletePlanInput): Instruction {\n return getDeletePlanInstruction({ owner: input.owner, planPda: input.planPda }, pdaConfig(input.programAddress));\n}\n\nexport async function getSubscribeOverlayInstructionAsync(input: SubscribeInput): Promise<Instruction> {\n if (\n input.expectedAmount === undefined ||\n input.expectedPeriodHours === undefined ||\n input.expectedCreatedAt === undefined ||\n input.expectedSubscriptionAuthorityInitId === undefined\n ) {\n throw new Error(\n 'getSubscribeOverlayInstructionAsync requires expectedAmount, expectedPeriodHours, expectedCreatedAt, and expectedSubscriptionAuthorityInitId. Use the plugin client `subscriptions.instructions.subscribe(...)` to auto-fetch from the live plan and authority.',\n );\n }\n assertSafeU64(input.planId, 'planId');\n const [planPda, planBump] = await findPlanPda(\n { owner: input.merchant, planId: input.planId },\n pdaConfig(input.programAddress),\n );\n const [subscriptionAuthorityPda] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.subscriber.address },\n pdaConfig(input.programAddress),\n );\n return appendPayer(\n await getSubscribeInstructionAsync(\n {\n ...(await eventAccounts(input.programAddress)),\n merchant: input.merchant,\n planPda,\n subscribeData: {\n expectedAmount: input.expectedAmount,\n expectedCreatedAt: input.expectedCreatedAt,\n expectedMint: input.tokenMint,\n expectedPeriodHours: input.expectedPeriodHours,\n expectedSubscriptionAuthorityInitId: input.expectedSubscriptionAuthorityInitId,\n planBump,\n planId: input.planId,\n },\n subscriber: input.subscriber,\n subscriptionAuthorityPda,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\nexport async function getCancelSubscriptionOverlayInstructionAsync(\n input: CancelSubscriptionInput,\n): Promise<Instruction> {\n return await getCancelSubscriptionInstructionAsync(\n {\n ...(await eventAccounts(input.programAddress)),\n planPda: input.planPda,\n subscriber: input.subscriber,\n subscriptionPda: input.subscriptionPda,\n },\n pdaConfig(input.programAddress),\n );\n}\n\nexport async function getResumeSubscriptionOverlayInstructionAsync(\n input: ResumeSubscriptionInput,\n): Promise<Instruction> {\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.subscriber.address },\n pdaConfig(input.programAddress),\n );\n return await getResumeSubscriptionInstructionAsync(\n {\n ...(await eventAccounts(input.programAddress)),\n planPda: input.planPda,\n subscriber: input.subscriber,\n subscriptionAuthority,\n subscriptionPda: input.subscriptionPda,\n },\n pdaConfig(input.programAddress),\n );\n}\n\n// ============================================================================\n// Plugin\n// ============================================================================\n\nexport type SubscriptionsPluginRequirements = ClientWithIdentity &\n ClientWithPayer &\n ClientWithRpc<GetProgramAccountsApi> &\n GeneratedSubscriptionsPluginRequirements;\n\ntype Self<T> = SelfPlanAndSendFunctions & T;\n\nexport type SubscriptionsPluginInstructions = {\n cancelSubscription: (input: MakeOptional<CancelSubscriptionInput, 'subscriber'>) => Self<Promise<Instruction>>;\n closeSubscriptionAuthority: (\n input: MakeOptional<CloseSubscriptionAuthorityInput, 'user'>,\n ) => Self<Promise<Instruction>>;\n createFixedDelegation: (\n input: MakeOptional<CreateFixedDelegationInput, 'delegator' | 'payer'>,\n ) => Self<Promise<Instruction>>;\n createPlan: (input: MakeOptional<CreatePlanInput, 'owner'>) => Self<Promise<Instruction>>;\n createRecurringDelegation: (\n input: MakeOptional<CreateRecurringDelegationInput, 'delegator' | 'payer'>,\n ) => Self<Promise<Instruction>>;\n deletePlan: (input: MakeOptional<DeletePlanInput, 'owner'>) => Self<Instruction>;\n initSubscriptionAuthority: (\n input: MakeOptional<InitSubscriptionAuthorityInput, 'owner' | 'payer'>,\n ) => Self<Promise<Instruction>>;\n resumeSubscription: (input: MakeOptional<ResumeSubscriptionInput, 'subscriber'>) => Self<Promise<Instruction>>;\n revokeDelegation: (input: MakeOptional<RevokeDelegationInput, 'authority'>) => Self<Instruction>;\n revokeSubscription: (input: MakeOptional<RevokeSubscriptionInput, 'authority'>) => Self<Instruction>;\n revokeSubscriptionAuthority: (\n input: MakeOptional<RevokeSubscriptionAuthorityInput, 'user'>,\n ) => Self<Promise<Instruction>>;\n subscribe: (input: MakeOptional<SubscribeInput, 'payer' | 'subscriber'>) => Self<Promise<Instruction>>;\n transferFixed: (input: MakeOptional<TransferDelegationInput, 'delegatee'>) => Self<Promise<Instruction>>;\n transferRecurring: (input: MakeOptional<TransferDelegationInput, 'delegatee'>) => Self<Promise<Instruction>>;\n transferSubscription: (input: MakeOptional<TransferSubscriptionInput, 'caller'>) => Self<Promise<Instruction>>;\n updatePlan: (input: MakeOptional<UpdatePlanInput, 'owner'>) => Self<Promise<Instruction>>;\n};\n\nexport type SubscriptionsPluginQueries = {\n /** Counts of active delegations grouped by kind. */\n activeDelegationSummary: (wallet: Address) => Promise<{\n fixed: number;\n recurring: number;\n subscriptions: number;\n total: number;\n }>;\n /** All delegations where `wallet` is the delegatee. */\n delegationsByDelegatee: (wallet: Address) => Promise<Delegation[]>;\n /** All delegations where `wallet` is the delegator. */\n delegationsByDelegator: (wallet: Address) => Promise<Delegation[]>;\n /** Whether the SubscriptionAuthority PDA exists for `(user, tokenMint)`. */\n isSubscriptionAuthorityInitialized: (\n user: Address,\n tokenMint: Address,\n programAddress?: Address,\n ) => Promise<{ initialized: boolean; pda: Address }>;\n /** Plans owned by `owner`. */\n plansForOwner: (owner: Address) => Promise<PlanWithAddress[]>;\n};\n\nexport type SubscriptionsPlugin = Omit<GeneratedSubscriptionsPlugin, 'instructions'> & {\n instructions: SubscriptionsPluginInstructions;\n queries: SubscriptionsPluginQueries;\n};\n\nexport function subscriptionsProgram() {\n return <T extends SubscriptionsPluginRequirements>(client: T) => {\n return pipe(client, generatedSubscriptionsProgram(), c => {\n const queries: SubscriptionsPluginQueries = {\n activeDelegationSummary: async wallet => {\n const delegations = await fetchDelegationsByDelegator(c.rpc, wallet);\n let fixed = 0;\n let recurring = 0;\n let subscriptions = 0;\n for (const d of delegations) {\n if (d.kind === 'fixed') fixed++;\n else if (d.kind === 'recurring') recurring++;\n else if (d.kind === 'subscription') subscriptions++;\n }\n return { fixed, recurring, subscriptions, total: delegations.length };\n },\n delegationsByDelegatee: wallet => fetchDelegationsByDelegatee(c.rpc, wallet),\n delegationsByDelegator: wallet => fetchDelegationsByDelegator(c.rpc, wallet),\n isSubscriptionAuthorityInitialized: async (user, tokenMint, programAddress) => {\n const [pda] = await findSubscriptionAuthorityPda({ tokenMint, user }, pdaConfig(programAddress));\n const account = await fetchMaybeSubscriptionAuthority(c.rpc, pda);\n return { initialized: account.exists, pda };\n },\n plansForOwner: owner => fetchPlansForOwner(c.rpc, owner),\n };\n\n const resolveExpectedSubscriptionAuthorityInitId = async (\n tokenMint: Address,\n user: Address,\n programAddress: Address | undefined,\n expectedSubscriptionAuthorityInitId: bigint | number | undefined,\n ) => {\n if (expectedSubscriptionAuthorityInitId !== undefined) {\n return expectedSubscriptionAuthorityInitId;\n }\n const [subscriptionAuthorityPda] = await findSubscriptionAuthorityPda(\n { tokenMint, user },\n pdaConfig(programAddress),\n );\n const subscriptionAuthority = await fetchMaybeSubscriptionAuthority(c.rpc, subscriptionAuthorityPda);\n if (!subscriptionAuthority.exists) {\n throw new Error('SubscriptionAuthority is not initialized for this delegator and token mint.');\n }\n return subscriptionAuthority.data.initId;\n };\n\n const resolveDelegationHookAccounts = async (input: Omit<TransferDelegationInput, 'delegatee'>) => {\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator },\n pdaConfig(input.programAddress),\n );\n return await resolveTransferHookAccounts(c.rpc, {\n amount: input.amount,\n authority: subscriptionAuthority,\n destination: input.receiverAta,\n mint: input.tokenMint,\n source: input.delegatorAta,\n tokenProgram: input.tokenProgram,\n transferHookAccounts: input.transferHookAccounts,\n });\n };\n\n const instructions: SubscriptionsPluginInstructions = {\n cancelSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n getCancelSubscriptionOverlayInstructionAsync({\n ...input,\n subscriber: input.subscriber ?? client.identity,\n }),\n ),\n closeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(\n client,\n getCloseSubscriptionAuthorityOverlayInstructionAsync({\n ...input,\n user: input.user ?? client.identity,\n }),\n ),\n createFixedDelegation: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n const delegator = input.delegator ?? client.identity;\n const expectedSubscriptionAuthorityInitId =\n await resolveExpectedSubscriptionAuthorityInitId(\n input.tokenMint,\n delegator.address,\n input.programAddress,\n input.expectedSubscriptionAuthorityInitId,\n );\n return await getCreateFixedDelegationOverlayInstructionAsync({\n ...input,\n delegator,\n expectedSubscriptionAuthorityInitId,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n });\n })(),\n ),\n createPlan: input =>\n addSelfPlanAndSendFunctions(\n client,\n getCreatePlanOverlayInstructionAsync({\n ...input,\n owner: input.owner ?? client.identity,\n }),\n ),\n createRecurringDelegation: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n const delegator = input.delegator ?? client.identity;\n const expectedSubscriptionAuthorityInitId =\n await resolveExpectedSubscriptionAuthorityInitId(\n input.tokenMint,\n delegator.address,\n input.programAddress,\n input.expectedSubscriptionAuthorityInitId,\n );\n return await getCreateRecurringDelegationOverlayInstructionAsync({\n ...input,\n delegator,\n expectedSubscriptionAuthorityInitId,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n });\n })(),\n ),\n deletePlan: input =>\n addSelfPlanAndSendFunctions(\n client,\n getDeletePlanOverlayInstruction({\n ...input,\n owner: input.owner ?? client.identity,\n }),\n ),\n initSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(\n client,\n getInitSubscriptionAuthorityOverlayInstructionAsync({\n ...input,\n owner: input.owner ?? client.identity,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n }),\n ),\n resumeSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n getResumeSubscriptionOverlayInstructionAsync({\n ...input,\n subscriber: input.subscriber ?? client.identity,\n }),\n ),\n revokeDelegation: input =>\n addSelfPlanAndSendFunctions(\n client,\n getRevokeDelegationOverlayInstruction({\n ...input,\n authority: input.authority ?? client.identity,\n }),\n ),\n revokeSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n getRevokeSubscriptionOverlayInstruction({\n ...input,\n authority: input.authority ?? client.identity,\n }),\n ),\n revokeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(\n client,\n getRevokeSubscriptionAuthorityOverlayInstructionAsync({\n ...input,\n user: input.user ?? client.identity,\n }),\n ),\n subscribe: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n const subscriber = input.subscriber ?? client.identity;\n assertSafeU64(input.planId, 'planId');\n let {\n expectedAmount,\n expectedCreatedAt,\n expectedPeriodHours,\n expectedSubscriptionAuthorityInitId,\n } = input;\n if (\n expectedAmount === undefined ||\n expectedPeriodHours === undefined ||\n expectedCreatedAt === undefined\n ) {\n const [planPda] = await findPlanPda(\n { owner: input.merchant, planId: input.planId },\n pdaConfig(input.programAddress),\n );\n const plan = await fetchPlan(c.rpc, planPda);\n expectedAmount = expectedAmount ?? plan.data.data.terms.amount;\n expectedPeriodHours = expectedPeriodHours ?? plan.data.data.terms.periodHours;\n expectedCreatedAt = expectedCreatedAt ?? plan.data.data.terms.createdAt;\n }\n if (expectedSubscriptionAuthorityInitId === undefined) {\n const [subscriptionAuthorityPda] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: subscriber.address },\n pdaConfig(input.programAddress),\n );\n const subscriptionAuthority = await fetchMaybeSubscriptionAuthority(\n c.rpc,\n subscriptionAuthorityPda,\n );\n if (!subscriptionAuthority.exists) {\n throw new Error(\n 'SubscriptionAuthority is not initialized for this subscriber and token mint.',\n );\n }\n expectedSubscriptionAuthorityInitId = subscriptionAuthority.data.initId;\n }\n return await getSubscribeOverlayInstructionAsync({\n ...input,\n expectedAmount,\n expectedCreatedAt,\n expectedPeriodHours,\n expectedSubscriptionAuthorityInitId,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n subscriber,\n });\n })(),\n ),\n transferFixed: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () =>\n await getTransferFixedOverlayInstructionAsync({\n ...input,\n delegatee: input.delegatee ?? client.identity,\n transferHookAccounts: await resolveDelegationHookAccounts(input),\n }))(),\n ),\n transferRecurring: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () =>\n await getTransferRecurringOverlayInstructionAsync({\n ...input,\n delegatee: input.delegatee ?? client.identity,\n transferHookAccounts: await resolveDelegationHookAccounts(input),\n }))(),\n ),\n transferSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator },\n pdaConfig(input.programAddress),\n );\n const [delegatorAta] = await findAssociatedTokenPda({\n mint: input.tokenMint,\n owner: input.delegator,\n tokenProgram: input.tokenProgram,\n });\n const transferHookAccounts = await resolveTransferHookAccounts(c.rpc, {\n amount: input.amount,\n authority: subscriptionAuthority,\n destination: input.receiverAta,\n mint: input.tokenMint,\n source: delegatorAta,\n tokenProgram: input.tokenProgram,\n transferHookAccounts: input.transferHookAccounts,\n });\n return await getTransferSubscriptionOverlayInstructionAsync({\n ...input,\n caller: input.caller ?? client.identity,\n transferHookAccounts,\n });\n })(),\n ),\n updatePlan: input =>\n addSelfPlanAndSendFunctions(\n client,\n getUpdatePlanOverlayInstruction({\n ...input,\n owner: input.owner ?? client.identity,\n }),\n ),\n };\n\n return {\n ...c,\n subscriptions: {\n ...c.subscriptions,\n instructions,\n queries,\n },\n };\n });\n };\n}\n","/**\n * Token-2022 transfer-hook account resolution, ported to `@solana/kit` from the\n * web3.js `@solana/spl-token` resolver (the kit client ships no equivalent).\n * Computes the trailing accounts a hooked `TransferChecked` must forward.\n */\n\nimport {\n AccountRole,\n type Address,\n fetchEncodedAccount,\n getAddressDecoder,\n getAddressEncoder,\n getProgramDerivedAddress,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport { fetchMint, TOKEN_2022_PROGRAM_ADDRESS } from '@solana-program/token-2022';\n\nexport type TransferHookAccount = { address: Address; role: AccountRole };\n\n/** Identity of the four base `Execute` accounts and the transfer amount, needed\n * to resolve seed- and instruction-data-derived extra accounts. */\nexport type ResolveTransferHookArgs = {\n amount: bigint | number;\n authority: Address;\n destination: Address;\n mint: Address;\n source: Address;\n tokenProgram: Address;\n transferHookAccounts?: TransferHookAccount[];\n};\n\nconst DEFAULT_ADDRESS = '11111111111111111111111111111111' as Address;\nconst EXTRA_ACCOUNT_METAS_SEED = 'extra-account-metas';\nconst TLV_HEADER_LEN = 12; // u64 discriminator + u32 length\nconst POD_SLICE_COUNT_LEN = 4;\nconst EXTRA_ACCOUNT_META_LEN = 35;\nconst PUBKEY_LEN = 32;\nconst PDA_PROGRAM_INDEX_OFFSET = 1 << 7;\n// sha256(\"spl-transfer-hook-interface:execute\")[..8]\nconst EXECUTE_DISCRIMINATOR = Uint8Array.from([0x69, 0x25, 0x65, 0xc5, 0x4b, 0xfb, 0x66, 0x1a]);\n\nconst addressDecoder = getAddressDecoder();\nconst addressEncoder = getAddressEncoder();\n\nfunction roleFor(isSigner: boolean, isWritable: boolean): AccountRole {\n if (isSigner && isWritable) return AccountRole.WRITABLE_SIGNER;\n if (isSigner) return AccountRole.READONLY_SIGNER;\n if (isWritable) return AccountRole.WRITABLE;\n return AccountRole.READONLY;\n}\n\nasync function fetchData(rpc: ResolveRpc, address: Address): Promise<ReadonlyUint8Array> {\n const account = await fetchEncodedAccount(rpc, address);\n if (!account.exists) throw new Error('transfer hook: referenced account not found');\n return account.data;\n}\n\ntype ResolveRpc = Parameters<typeof fetchMint>[0];\ntype RawMeta = { addressConfig: ReadonlyUint8Array; discriminator: number; isSigner: boolean; isWritable: boolean };\n\nfunction executeInstructionData(amount: bigint | number): Uint8Array {\n const data = new Uint8Array(EXECUTE_DISCRIMINATOR.length + 8);\n data.set(EXECUTE_DISCRIMINATOR, 0);\n new DataView(data.buffer).setBigUint64(EXECUTE_DISCRIMINATOR.length, BigInt(amount), true);\n return data;\n}\n\nfunction readMetas(data: ReadonlyUint8Array): RawMeta[] {\n if (data.length < TLV_HEADER_LEN || !EXECUTE_DISCRIMINATOR.every((byte, i) => data[i] === byte)) {\n return [];\n }\n const view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n const count = view.getUint32(TLV_HEADER_LEN, true);\n const metas: RawMeta[] = [];\n let offset = TLV_HEADER_LEN + POD_SLICE_COUNT_LEN;\n for (let n = 0; n < count && offset + EXTRA_ACCOUNT_META_LEN <= data.length; n++) {\n metas.push({\n addressConfig: data.subarray(offset + 1, offset + 33),\n discriminator: data[offset],\n isSigner: data[offset + 33] === 1,\n isWritable: data[offset + 34] === 1,\n });\n offset += EXTRA_ACCOUNT_META_LEN;\n }\n return metas;\n}\n\nasync function unpackSeeds(\n config: ReadonlyUint8Array,\n previous: TransferHookAccount[],\n instructionData: Uint8Array,\n rpc: ResolveRpc,\n): Promise<ReadonlyUint8Array[]> {\n const seeds: ReadonlyUint8Array[] = [];\n let i = 0;\n while (i < 32) {\n const discriminator = config[i];\n const rest = config.subarray(i + 1);\n if (discriminator === 0) break;\n if (discriminator === 1) {\n const length = rest[0];\n seeds.push(rest.subarray(1, 1 + length));\n i += 2 + length;\n } else if (discriminator === 2) {\n const [index, length] = [rest[0], rest[1]];\n seeds.push(instructionData.subarray(index, index + length));\n i += 3;\n } else if (discriminator === 3) {\n seeds.push(addressEncoder.encode(previous[rest[0]].address));\n i += 2;\n } else if (discriminator === 4) {\n const [accountIndex, dataIndex, length] = [rest[0], rest[1], rest[2]];\n const data = await fetchData(rpc, previous[accountIndex].address);\n seeds.push(data.subarray(dataIndex, dataIndex + length));\n i += 4;\n } else {\n throw new Error('transfer hook: invalid seed');\n }\n }\n return seeds;\n}\n\nasync function unpackPubkeyData(\n config: ReadonlyUint8Array,\n previous: TransferHookAccount[],\n instructionData: Uint8Array,\n rpc: ResolveRpc,\n): Promise<Address> {\n const rest = config.subarray(1);\n if (config[0] === 1) {\n const offset = rest[0];\n return addressDecoder.decode(instructionData.subarray(offset, offset + PUBKEY_LEN));\n }\n if (config[0] === 2) {\n const [accountIndex, offset] = [rest[0], rest[1]];\n const data = await fetchData(rpc, previous[accountIndex].address);\n return addressDecoder.decode(data.subarray(offset, offset + PUBKEY_LEN));\n }\n throw new Error('transfer hook: invalid pubkey data');\n}\n\nasync function resolveMeta(\n meta: RawMeta,\n previous: TransferHookAccount[],\n instructionData: Uint8Array,\n hookProgram: Address,\n rpc: ResolveRpc,\n): Promise<TransferHookAccount> {\n const role = roleFor(meta.isSigner, meta.isWritable);\n if (meta.discriminator === 0) {\n return { address: addressDecoder.decode(meta.addressConfig), role };\n }\n if (meta.discriminator === 2) {\n return { address: await unpackPubkeyData(meta.addressConfig, previous, instructionData, rpc), role };\n }\n const programId =\n meta.discriminator === 1 ? hookProgram : previous[meta.discriminator - PDA_PROGRAM_INDEX_OFFSET].address;\n const seeds = await unpackSeeds(meta.addressConfig, previous, instructionData, rpc);\n const [pda] = await getProgramDerivedAddress({ programAddress: programId, seeds });\n return { address: pda, role };\n}\n\n/**\n * Trailing hook accounts for a `TransferChecked` — `[hook program, validation PDA,\n * ...resolved extras]`. Returns `[]` for non-2022, no-hook, or inert mints, and\n * the explicit `transferHookAccounts` verbatim when provided.\n */\nexport async function resolveTransferHookAccounts(\n rpc: ResolveRpc,\n args: ResolveTransferHookArgs,\n): Promise<TransferHookAccount[]> {\n if (args.transferHookAccounts?.length) return args.transferHookAccounts;\n if (args.tokenProgram !== TOKEN_2022_PROGRAM_ADDRESS) return [];\n\n const { data } = await fetchMint(rpc, args.mint);\n const extensions = data.extensions.__option === 'Some' ? data.extensions.value : [];\n const hook = extensions.find(extension => extension.__kind === 'TransferHook');\n if (!hook || hook.programId === DEFAULT_ADDRESS) return [];\n\n const hookProgram = hook.programId;\n const [validationPda] = await getProgramDerivedAddress({\n programAddress: hookProgram,\n seeds: [EXTRA_ACCOUNT_METAS_SEED, addressEncoder.encode(args.mint)],\n });\n\n const trailing: TransferHookAccount[] = [\n { address: hookProgram, role: AccountRole.READONLY },\n { address: validationPda, role: AccountRole.READONLY },\n ];\n\n const validationAccount = await fetchEncodedAccount(rpc, validationPda);\n if (!validationAccount.exists) return trailing;\n\n const instructionData = executeInstructionData(args.amount);\n const previous: TransferHookAccount[] = [\n { address: args.source, role: AccountRole.READONLY },\n { address: args.mint, role: AccountRole.READONLY },\n { address: args.destination, role: AccountRole.READONLY },\n { address: args.authority, role: AccountRole.READONLY },\n { address: validationPda, role: AccountRole.READONLY },\n ];\n for (const meta of readMetas(validationAccount.data)) {\n const resolved = await resolveMeta(meta, previous, instructionData, hookProgram, rpc);\n previous.push(resolved);\n trailing.push(resolved);\n }\n return trailing;\n}\n","import type { Address } from '@solana/kit';\n\nimport { MAX_PLAN_DESTINATIONS, MAX_PLAN_PULLERS, METADATA_URI_LEN, ZERO_ADDRESS } from './constants.js';\n\nconst textEncoder = new TextEncoder();\n\n/** Client-side validation failure (e.g. max destinations exceeded). */\nexport class ValidationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'ValidationError';\n }\n}\n\nexport function assertPositive(value: bigint | number, name: string): void {\n if (BigInt(value) <= 0n) throw new ValidationError(`${name} must be greater than zero`);\n}\n\nexport function assertSafeU64(value: bigint | number, name: string): void {\n if (typeof value === 'number' && !Number.isSafeInteger(value))\n throw new ValidationError(`${name} must be a bigint or a safe integer (numbers above 2^53-1 lose precision)`);\n}\n\nexport function assertMetadataUri(metadataUri: string): void {\n if (textEncoder.encode(metadataUri).length > METADATA_URI_LEN)\n throw new ValidationError(`metadataUri exceeds ${METADATA_URI_LEN} bytes`);\n}\n\nexport function assertMaxLen(arr: unknown[], max: number, name: string): void {\n if (arr.length > max) throw new ValidationError(`${name} must have at most ${max} entries`);\n}\n\nexport function padAddresses(addresses: Address[], maxLen: number): Address[] {\n return Array.from({ length: maxLen }, (_, i) => addresses[i] ?? ZERO_ADDRESS);\n}\n\nexport function padPlanDestinations(addresses: Address[]): Address[] {\n assertMaxLen(addresses, MAX_PLAN_DESTINATIONS, 'destinations');\n return padAddresses(addresses, MAX_PLAN_DESTINATIONS);\n}\n\nexport function padPlanPullers(addresses: Address[]): [Address, Address, Address, Address] {\n assertMaxLen(addresses, MAX_PLAN_PULLERS, 'pullers');\n return padAddresses(addresses, MAX_PLAN_PULLERS) as [Address, Address, Address, Address];\n}\n"],"mappings":";AAOA,SAAS,wBAAwB;;;ACCjC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAWG;;;ACnBP,SAAS,0BAA0B,sBAAgE;AAEnG,eAAsB,sBAClB,SAAmD,CAAC,GACtB;AAC9B,QAAM;AAAA,IACF,iBAAiB;AAAA,EACrB,IAAI;AACJ,SAAO,MAAM,yBAAyB,EAAE,gBAAgB,OAAO,CAAC,eAAe,EAAE,OAAO,iBAAiB,CAAC,EAAE,CAAC;AACjH;;;ACTA;AAAA,EACI;AAAA,EACA,4BAAAA;AAAA,EACA;AAAA,EACA,kBAAAC;AAAA,OAGG;AASP,eAAsB,uBAClB,OACA,SAAmD,CAAC,GACtB;AAC9B,QAAM;AAAA,IACF,iBAAiB;AAAA,EACrB,IAAI;AACJ,SAAO,MAAMD,0BAAyB;AAAA,IAClC;AAAA,IACA,OAAO;AAAA,MACHC,gBAAe,EAAE,OAAO,YAAY;AAAA,MACpC,kBAAkB,EAAE,OAAO,MAAM,qBAAqB;AAAA,MACtD,kBAAkB,EAAE,OAAO,MAAM,SAAS;AAAA,MAC1C,kBAAkB,EAAE,OAAO,MAAM,SAAS;AAAA,MAC1C,cAAc,EAAE,OAAO,MAAM,KAAK;AAAA,IACtC;AAAA,EACJ,CAAC;AACL;;;ACjCA;AAAA,EACI,qBAAAC;AAAA,EACA,4BAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,kBAAAC;AAAA,OAGG;AAOP,eAAsB,YAClB,OACA,SAAmD,CAAC,GACtB;AAC9B,QAAM;AAAA,IACF,iBAAiB;AAAA,EACrB,IAAI;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;AAAA,cACd,WAAW;AAAA,cACX,aAAa,MAAM;AAAA,cACnB,MAAM,MAAM;AAAA,cACZ,QAAQ;AAAA,cACR,cAAc,MAAM;AAAA,cACpB,sBAAsB,MAAM;AAAA,YAChC,CAAC;AACD,mBAAO,MAAM,+CAA+C;AAAA,cACxD,GAAG;AAAA,cACH,QAAQ,MAAM,UAAU,OAAO;AAAA,cAC/B;AAAA,YACJ,CAAC;AAAA,UACL,GAAG;AAAA,QACP;AAAA,QACJ,YAAY,WACRA;AAAA,UACI;AAAA,UACA,gCAAgC;AAAA,YAC5B,GAAG;AAAA,YACH,OAAO,MAAM,SAAS,OAAO;AAAA,UACjC,CAAC;AAAA,QACL;AAAA,MACR;AAEA,aAAO;AAAA,QACH,GAAG;AAAA,QACH,eAAe;AAAA,UACX,GAAG,EAAE;AAAA,UACL;AAAA,UACA;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;","names":["getProgramDerivedAddress","getUtf8Encoder","getAddressEncoder","getProgramDerivedAddress","getU64Encoder","getUtf8Encoder","getAddressEncoder","getProgramDerivedAddress","getU64Encoder","getUtf8Encoder","getAddressEncoder","getProgramDerivedAddress","getUtf8Encoder","getAddressEncoder","getProgramDerivedAddress","getUtf8Encoder","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","combineCodec","AccountDiscriminator","combineCodec","getStructDecoder","getStructEncoder","getU64Encoder","combineCodec","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","combineCodec","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","combineCodec","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getUtf8Encoder","getStructEncoder","getU64Encoder","getAddressEncoder","getI64Encoder","getUtf8Encoder","getStructDecoder","getU64Decoder","getAddressDecoder","getI64Decoder","combineCodec","combineCodec","getEnumDecoder","getEnumEncoder","PlanStatus","combineCodec","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","combineCodec","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","combineCodec","getAddressDecoder","getAddressEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","combineCodec","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getArrayDecoder","getArrayEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Decoder","getUtf8Encoder","getStructEncoder","getAddressEncoder","getU64Encoder","getI64Encoder","getStructDecoder","getAddressDecoder","getU64Decoder","getI64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getAddressDecoder","getAddressEncoder","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getStructEncoder","getU8Encoder","getAddressEncoder","getStructDecoder","getU8Decoder","getAddressDecoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getStructEncoder","getAddressEncoder","getI64Encoder","getU64Encoder","getStructDecoder","getAddressDecoder","getI64Decoder","getU64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getStructEncoder","getU8Encoder","getAddressEncoder","getI64Encoder","getStructDecoder","getU8Decoder","getAddressDecoder","getI64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getStructEncoder","getU64Encoder","getI64Encoder","getStructDecoder","getU64Decoder","getI64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","getU8Encoder","SolanaError","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","getU8Encoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SubscriptionsAccount","SubscriptionsInstruction","getU8Encoder","SolanaError","AccountRole","addSelfPlanAndSendFunctions","fetchEncodedAccount","getAddressDecoder","getAddressEncoder","getProgramDerivedAddress","AccountRole","subscriptionsProgram","addSelfPlanAndSendFunctions"]}
1
+ {"version":3,"sources":["../src/accounts/decode.ts","../src/generated/accounts/eventAuthority.ts","../src/generated/pdas/eventAuthority.ts","../src/generated/pdas/fixedDelegation.ts","../src/generated/pdas/plan.ts","../src/generated/pdas/recurringDelegation.ts","../src/generated/pdas/subscriptionAuthority.ts","../src/generated/pdas/subscriptionDelegation.ts","../src/generated/accounts/fixedDelegation.ts","../src/generated/types/accountDiscriminator.ts","../src/generated/types/cancelSubscriptionNowData.ts","../src/generated/types/createFixedDelegationData.ts","../src/generated/types/createRecurringDelegationData.ts","../src/generated/types/header.ts","../src/generated/types/planData.ts","../src/generated/types/planStatus.ts","../src/generated/types/planTerms.ts","../src/generated/types/resumeData.ts","../src/generated/types/subscribeData.ts","../src/generated/types/transferData.ts","../src/generated/types/updatePlanData.ts","../src/generated/accounts/plan.ts","../src/generated/accounts/recurringDelegation.ts","../src/generated/accounts/subscriptionAuthority.ts","../src/generated/accounts/subscriptionDelegation.ts","../src/generated/errors/subscriptions.ts","../src/generated/programs/subscriptions.ts","../src/generated/instructions/cancelSubscription.ts","../src/generated/instructions/cancelSubscriptionNow.ts","../src/generated/instructions/closeSubscriptionAuthority.ts","../src/generated/instructions/createFixedDelegation.ts","../src/generated/instructions/createPlan.ts","../src/generated/instructions/createRecurringDelegation.ts","../src/generated/instructions/deletePlan.ts","../src/generated/instructions/initSubscriptionAuthority.ts","../src/generated/instructions/resumeSubscription.ts","../src/generated/instructions/revokeAbandonedDelegation.ts","../src/generated/instructions/revokeAbandonedSubscription.ts","../src/generated/instructions/revokeDelegation.ts","../src/generated/instructions/revokeSubscriptionAuthority.ts","../src/generated/instructions/subscribe.ts","../src/generated/instructions/transferFixed.ts","../src/generated/instructions/transferRecurring.ts","../src/generated/instructions/transferSubscription.ts","../src/generated/instructions/updatePlan.ts","../src/constants.ts","../src/accounts/delegations.ts","../src/accounts/plans.ts","../src/accounts/subscriptions.ts","../src/plugin.ts","../src/transfer-hook.ts","../src/validators.ts"],"sourcesContent":["import type {\n AccountInfoBase,\n AccountInfoWithBase64EncodedData,\n AccountInfoWithPubkey,\n Address,\n EncodedAccount,\n} from '@solana/kit';\nimport { getBase64Encoder } from '@solana/kit';\n\nimport { DISCRIMINATOR_OFFSET } from '../constants.js';\nimport {\n AccountDiscriminator,\n decodeFixedDelegation,\n decodeRecurringDelegation,\n decodeSubscriptionDelegation,\n} from '../generated/index.js';\nimport type { Delegation } from '../types/delegation.js';\n\n/** Raw account shape returned by `getProgramAccounts` RPC calls. */\nexport type RawProgramAccount = AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>;\n\n/**\n * Converts a {@link RawProgramAccount} into Kit's `EncodedAccount` format for use with Codama decoders.\n *\n * @param raw - The raw account as returned by `getProgramAccounts`.\n * @param programAddress - The program address that owns the account.\n * @returns An `EncodedAccount` with base64-decoded data.\n */\nexport function toEncodedAccount(raw: RawProgramAccount, programAddress: Address): EncodedAccount {\n const base64Encoder = getBase64Encoder();\n const data = base64Encoder.encode(raw.account.data[0]);\n return {\n address: raw.pubkey,\n data,\n executable: raw.account.executable,\n lamports: raw.account.lamports,\n programAddress,\n space: raw.account.space,\n };\n}\n\n/**\n * Decodes a raw program account into a {@link Delegation} by inspecting the discriminator byte.\n *\n * @param raw - The raw account as returned by `getProgramAccounts`.\n * @param programAddress - The program address that owns the account.\n * @returns The decoded {@link Delegation}, or `null` if the discriminator is unrecognized.\n */\nexport function decodeDelegationAccount(raw: RawProgramAccount, programAddress: Address): Delegation | null {\n const encoded = toEncodedAccount(raw, programAddress);\n const kind = encoded.data[DISCRIMINATOR_OFFSET] as AccountDiscriminator | undefined;\n\n switch (kind) {\n case AccountDiscriminator.FixedDelegation: {\n const decoded = decodeFixedDelegation(encoded);\n return {\n address: raw.pubkey,\n data: decoded.data,\n kind: 'fixed',\n };\n }\n case AccountDiscriminator.RecurringDelegation: {\n const decoded = decodeRecurringDelegation(encoded);\n return {\n address: raw.pubkey,\n data: decoded.data,\n kind: 'recurring',\n };\n }\n case AccountDiscriminator.SubscriptionDelegation: {\n const decoded = decodeSubscriptionDelegation(encoded);\n return {\n address: raw.pubkey,\n data: decoded.data,\n kind: 'subscription',\n };\n }\n default:\n console.warn(`Unknown delegation discriminator: ${kind}`);\n return null;\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getStructDecoder,\n getStructEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findEventAuthorityPda } from '../pdas';\n\nexport type EventAuthority = {};\n\nexport type EventAuthorityArgs = EventAuthority;\n\n/** Gets the encoder for {@link EventAuthorityArgs} account data. */\nexport function getEventAuthorityEncoder(): FixedSizeEncoder<EventAuthorityArgs> {\n return getStructEncoder([]);\n}\n\n/** Gets the decoder for {@link EventAuthority} account data. */\nexport function getEventAuthorityDecoder(): FixedSizeDecoder<EventAuthority> {\n return getStructDecoder([]);\n}\n\n/** Gets the codec for {@link EventAuthority} account data. */\nexport function getEventAuthorityCodec(): FixedSizeCodec<EventAuthorityArgs, EventAuthority> {\n return combineCodec(getEventAuthorityEncoder(), getEventAuthorityDecoder());\n}\n\nexport function decodeEventAuthority<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<EventAuthority, TAddress>;\nexport function decodeEventAuthority<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<EventAuthority, TAddress>;\nexport function decodeEventAuthority<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<EventAuthority, TAddress> | MaybeAccount<EventAuthority, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getEventAuthorityDecoder());\n}\n\nexport async function fetchEventAuthority<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<EventAuthority, TAddress>> {\n const maybeAccount = await fetchMaybeEventAuthority(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeEventAuthority<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<EventAuthority, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeEventAuthority(maybeAccount);\n}\n\nexport async function fetchAllEventAuthority(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<EventAuthority>[]> {\n const maybeAccounts = await fetchAllMaybeEventAuthority(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeEventAuthority(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<EventAuthority>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeEventAuthority(maybeAccount));\n}\n\nexport async function fetchEventAuthorityFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<EventAuthority>> {\n const maybeAccount = await fetchMaybeEventAuthorityFromSeeds(rpc, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeEventAuthorityFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<EventAuthority>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findEventAuthorityPda({ programAddress });\n return await fetchMaybeEventAuthority(rpc, address, fetchConfig);\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 { getProgramDerivedAddress, getUtf8Encoder, type Address, type ProgramDerivedAddress } from '@solana/kit';\n\nexport async function findEventAuthorityPda(\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({ programAddress, seeds: [getUtf8Encoder().encode('event_authority')] });\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 getAddressEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type FixedDelegationSeeds = {\n subscriptionAuthority: Address;\n delegator: Address;\n delegatee: Address;\n nonce: number | bigint;\n};\n\nexport async function findFixedDelegationPda(\n seeds: FixedDelegationSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('delegation'),\n getAddressEncoder().encode(seeds.subscriptionAuthority),\n getAddressEncoder().encode(seeds.delegator),\n getAddressEncoder().encode(seeds.delegatee),\n getU64Encoder().encode(seeds.nonce),\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 getAddressEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type PlanSeeds = {\n owner: Address;\n planId: number | bigint;\n};\n\nexport async function findPlanPda(\n seeds: PlanSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('plan'),\n getAddressEncoder().encode(seeds.owner),\n getU64Encoder().encode(seeds.planId),\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 getAddressEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type RecurringDelegationSeeds = {\n subscriptionAuthority: Address;\n delegator: Address;\n delegatee: Address;\n nonce: number | bigint;\n};\n\nexport async function findRecurringDelegationPda(\n seeds: RecurringDelegationSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('delegation'),\n getAddressEncoder().encode(seeds.subscriptionAuthority),\n getAddressEncoder().encode(seeds.delegator),\n getAddressEncoder().encode(seeds.delegatee),\n getU64Encoder().encode(seeds.nonce),\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 getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type SubscriptionAuthoritySeeds = {\n user: Address;\n tokenMint: Address;\n};\n\nexport async function findSubscriptionAuthorityPda(\n seeds: SubscriptionAuthoritySeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('SubscriptionAuthority'),\n getAddressEncoder().encode(seeds.user),\n getAddressEncoder().encode(seeds.tokenMint),\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 getAddressEncoder,\n getProgramDerivedAddress,\n getUtf8Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\n\nexport type SubscriptionDelegationSeeds = {\n planPda: Address;\n subscriber: Address;\n};\n\nexport async function findSubscriptionDelegationPda(\n seeds: SubscriptionDelegationSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getUtf8Encoder().encode('subscription'),\n getAddressEncoder().encode(seeds.planPda),\n getAddressEncoder().encode(seeds.subscriber),\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findFixedDelegationPda, FixedDelegationSeeds } from '../pdas';\nimport { getHeaderDecoder, getHeaderEncoder, type Header, type HeaderArgs } from '../types';\n\nexport type FixedDelegation = {\n header: Header;\n subscriptionAuthority: Address;\n mint: Address;\n amount: bigint;\n expiryTs: bigint;\n};\n\nexport type FixedDelegationArgs = {\n header: HeaderArgs;\n subscriptionAuthority: Address;\n mint: Address;\n amount: number | bigint;\n expiryTs: number | bigint;\n};\n\n/** Gets the encoder for {@link FixedDelegationArgs} account data. */\nexport function getFixedDelegationEncoder(): FixedSizeEncoder<FixedDelegationArgs> {\n return getStructEncoder([\n ['header', getHeaderEncoder()],\n ['subscriptionAuthority', getAddressEncoder()],\n ['mint', getAddressEncoder()],\n ['amount', getU64Encoder()],\n ['expiryTs', getI64Encoder()],\n ]);\n}\n\n/** Gets the decoder for {@link FixedDelegation} account data. */\nexport function getFixedDelegationDecoder(): FixedSizeDecoder<FixedDelegation> {\n return getStructDecoder([\n ['header', getHeaderDecoder()],\n ['subscriptionAuthority', getAddressDecoder()],\n ['mint', getAddressDecoder()],\n ['amount', getU64Decoder()],\n ['expiryTs', getI64Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link FixedDelegation} account data. */\nexport function getFixedDelegationCodec(): FixedSizeCodec<FixedDelegationArgs, FixedDelegation> {\n return combineCodec(getFixedDelegationEncoder(), getFixedDelegationDecoder());\n}\n\nexport function decodeFixedDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<FixedDelegation, TAddress>;\nexport function decodeFixedDelegation<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<FixedDelegation, TAddress>;\nexport function decodeFixedDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<FixedDelegation, TAddress> | MaybeAccount<FixedDelegation, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getFixedDelegationDecoder());\n}\n\nexport async function fetchFixedDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<FixedDelegation, TAddress>> {\n const maybeAccount = await fetchMaybeFixedDelegation(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeFixedDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<FixedDelegation, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeFixedDelegation(maybeAccount);\n}\n\nexport async function fetchAllFixedDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<FixedDelegation>[]> {\n const maybeAccounts = await fetchAllMaybeFixedDelegation(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeFixedDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<FixedDelegation>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeFixedDelegation(maybeAccount));\n}\n\nexport async function fetchFixedDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: FixedDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<FixedDelegation>> {\n const maybeAccount = await fetchMaybeFixedDelegationFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeFixedDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: FixedDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<FixedDelegation>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findFixedDelegationPda(seeds, { programAddress });\n return await fetchMaybeFixedDelegation(rpc, address, fetchConfig);\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 getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport enum AccountDiscriminator {\n SubscriptionAuthority,\n Plan,\n FixedDelegation,\n RecurringDelegation,\n SubscriptionDelegation,\n}\n\nexport type AccountDiscriminatorArgs = AccountDiscriminator;\n\nexport function getAccountDiscriminatorEncoder(): FixedSizeEncoder<AccountDiscriminatorArgs> {\n return getEnumEncoder(AccountDiscriminator);\n}\n\nexport function getAccountDiscriminatorDecoder(): FixedSizeDecoder<AccountDiscriminator> {\n return getEnumDecoder(AccountDiscriminator);\n}\n\nexport function getAccountDiscriminatorCodec(): FixedSizeCodec<AccountDiscriminatorArgs, AccountDiscriminator> {\n return combineCodec(getAccountDiscriminatorEncoder(), getAccountDiscriminatorDecoder());\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 getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type CancelSubscriptionNowData = { expectedCurrentPeriodStartTs: bigint };\n\nexport type CancelSubscriptionNowDataArgs = { expectedCurrentPeriodStartTs: number | bigint };\n\nexport function getCancelSubscriptionNowDataEncoder(): FixedSizeEncoder<CancelSubscriptionNowDataArgs> {\n return getStructEncoder([['expectedCurrentPeriodStartTs', getI64Encoder()]]);\n}\n\nexport function getCancelSubscriptionNowDataDecoder(): FixedSizeDecoder<CancelSubscriptionNowData> {\n return getStructDecoder([['expectedCurrentPeriodStartTs', getI64Decoder()]]);\n}\n\nexport function getCancelSubscriptionNowDataCodec(): FixedSizeCodec<\n CancelSubscriptionNowDataArgs,\n CancelSubscriptionNowData\n> {\n return combineCodec(getCancelSubscriptionNowDataEncoder(), getCancelSubscriptionNowDataDecoder());\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 getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type CreateFixedDelegationData = {\n nonce: bigint;\n amount: bigint;\n expiryTs: bigint;\n expectedSubscriptionAuthorityInitId: bigint;\n};\n\nexport type CreateFixedDelegationDataArgs = {\n nonce: number | bigint;\n amount: number | bigint;\n expiryTs: number | bigint;\n expectedSubscriptionAuthorityInitId: number | bigint;\n};\n\nexport function getCreateFixedDelegationDataEncoder(): FixedSizeEncoder<CreateFixedDelegationDataArgs> {\n return getStructEncoder([\n ['nonce', getU64Encoder()],\n ['amount', getU64Encoder()],\n ['expiryTs', getI64Encoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Encoder()],\n ]);\n}\n\nexport function getCreateFixedDelegationDataDecoder(): FixedSizeDecoder<CreateFixedDelegationData> {\n return getStructDecoder([\n ['nonce', getU64Decoder()],\n ['amount', getU64Decoder()],\n ['expiryTs', getI64Decoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Decoder()],\n ]);\n}\n\nexport function getCreateFixedDelegationDataCodec(): FixedSizeCodec<\n CreateFixedDelegationDataArgs,\n CreateFixedDelegationData\n> {\n return combineCodec(getCreateFixedDelegationDataEncoder(), getCreateFixedDelegationDataDecoder());\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 getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type CreateRecurringDelegationData = {\n nonce: bigint;\n amountPerPeriod: bigint;\n periodLengthS: bigint;\n startTs: bigint;\n expiryTs: bigint;\n expectedSubscriptionAuthorityInitId: bigint;\n};\n\nexport type CreateRecurringDelegationDataArgs = {\n nonce: number | bigint;\n amountPerPeriod: number | bigint;\n periodLengthS: number | bigint;\n startTs: number | bigint;\n expiryTs: number | bigint;\n expectedSubscriptionAuthorityInitId: number | bigint;\n};\n\nexport function getCreateRecurringDelegationDataEncoder(): FixedSizeEncoder<CreateRecurringDelegationDataArgs> {\n return getStructEncoder([\n ['nonce', getU64Encoder()],\n ['amountPerPeriod', getU64Encoder()],\n ['periodLengthS', getU64Encoder()],\n ['startTs', getI64Encoder()],\n ['expiryTs', getI64Encoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Encoder()],\n ]);\n}\n\nexport function getCreateRecurringDelegationDataDecoder(): FixedSizeDecoder<CreateRecurringDelegationData> {\n return getStructDecoder([\n ['nonce', getU64Decoder()],\n ['amountPerPeriod', getU64Decoder()],\n ['periodLengthS', getU64Decoder()],\n ['startTs', getI64Decoder()],\n ['expiryTs', getI64Decoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Decoder()],\n ]);\n}\n\nexport function getCreateRecurringDelegationDataCodec(): FixedSizeCodec<\n CreateRecurringDelegationDataArgs,\n CreateRecurringDelegationData\n> {\n return combineCodec(getCreateRecurringDelegationDataEncoder(), getCreateRecurringDelegationDataDecoder());\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 getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type Header = {\n discriminator: number;\n version: number;\n bump: number;\n delegator: Address;\n delegatee: Address;\n payer: Address;\n initId: bigint;\n};\n\nexport type HeaderArgs = {\n discriminator: number;\n version: number;\n bump: number;\n delegator: Address;\n delegatee: Address;\n payer: Address;\n initId: number | bigint;\n};\n\nexport function getHeaderEncoder(): FixedSizeEncoder<HeaderArgs> {\n return getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['version', getU8Encoder()],\n ['bump', getU8Encoder()],\n ['delegator', getAddressEncoder()],\n ['delegatee', getAddressEncoder()],\n ['payer', getAddressEncoder()],\n ['initId', getI64Encoder()],\n ]);\n}\n\nexport function getHeaderDecoder(): FixedSizeDecoder<Header> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['version', getU8Decoder()],\n ['bump', getU8Decoder()],\n ['delegator', getAddressDecoder()],\n ['delegatee', getAddressDecoder()],\n ['payer', getAddressDecoder()],\n ['initId', getI64Decoder()],\n ]);\n}\n\nexport function getHeaderCodec(): FixedSizeCodec<HeaderArgs, Header> {\n return combineCodec(getHeaderEncoder(), getHeaderDecoder());\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 fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\nimport { getPlanTermsDecoder, getPlanTermsEncoder, type PlanTerms, type PlanTermsArgs } from '.';\n\nexport type PlanData = {\n planId: bigint;\n mint: Address;\n terms: PlanTerms;\n endTs: bigint;\n destinations: Array<Address>;\n pullers: Array<Address>;\n metadataUri: string;\n};\n\nexport type PlanDataArgs = {\n planId: number | bigint;\n mint: Address;\n terms: PlanTermsArgs;\n endTs: number | bigint;\n destinations: Array<Address>;\n pullers: Array<Address>;\n metadataUri: string;\n};\n\nexport function getPlanDataEncoder(): FixedSizeEncoder<PlanDataArgs> {\n return getStructEncoder([\n ['planId', getU64Encoder()],\n ['mint', getAddressEncoder()],\n ['terms', getPlanTermsEncoder()],\n ['endTs', getI64Encoder()],\n ['destinations', getArrayEncoder(getAddressEncoder(), { size: 4 })],\n ['pullers', getArrayEncoder(getAddressEncoder(), { size: 4 })],\n ['metadataUri', fixEncoderSize(getUtf8Encoder(), 128)],\n ]);\n}\n\nexport function getPlanDataDecoder(): FixedSizeDecoder<PlanData> {\n return getStructDecoder([\n ['planId', getU64Decoder()],\n ['mint', getAddressDecoder()],\n ['terms', getPlanTermsDecoder()],\n ['endTs', getI64Decoder()],\n ['destinations', getArrayDecoder(getAddressDecoder(), { size: 4 })],\n ['pullers', getArrayDecoder(getAddressDecoder(), { size: 4 })],\n ['metadataUri', fixDecoderSize(getUtf8Decoder(), 128)],\n ]);\n}\n\nexport function getPlanDataCodec(): FixedSizeCodec<PlanDataArgs, PlanData> {\n return combineCodec(getPlanDataEncoder(), getPlanDataDecoder());\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 getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport enum PlanStatus {\n Sunset,\n Active,\n}\n\nexport type PlanStatusArgs = PlanStatus;\n\nexport function getPlanStatusEncoder(): FixedSizeEncoder<PlanStatusArgs> {\n return getEnumEncoder(PlanStatus);\n}\n\nexport function getPlanStatusDecoder(): FixedSizeDecoder<PlanStatus> {\n return getEnumDecoder(PlanStatus);\n}\n\nexport function getPlanStatusCodec(): FixedSizeCodec<PlanStatusArgs, PlanStatus> {\n return combineCodec(getPlanStatusEncoder(), getPlanStatusDecoder());\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 getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type PlanTerms = { amount: bigint; periodHours: bigint; createdAt: bigint };\n\nexport type PlanTermsArgs = { amount: number | bigint; periodHours: number | bigint; createdAt: number | bigint };\n\nexport function getPlanTermsEncoder(): FixedSizeEncoder<PlanTermsArgs> {\n return getStructEncoder([\n ['amount', getU64Encoder()],\n ['periodHours', getU64Encoder()],\n ['createdAt', getI64Encoder()],\n ]);\n}\n\nexport function getPlanTermsDecoder(): FixedSizeDecoder<PlanTerms> {\n return getStructDecoder([\n ['amount', getU64Decoder()],\n ['periodHours', getU64Decoder()],\n ['createdAt', getI64Decoder()],\n ]);\n}\n\nexport function getPlanTermsCodec(): FixedSizeCodec<PlanTermsArgs, PlanTerms> {\n return combineCodec(getPlanTermsEncoder(), getPlanTermsDecoder());\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 getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type ResumeData = { expectedExpiresAtTs: bigint };\n\nexport type ResumeDataArgs = { expectedExpiresAtTs: number | bigint };\n\nexport function getResumeDataEncoder(): FixedSizeEncoder<ResumeDataArgs> {\n return getStructEncoder([['expectedExpiresAtTs', getI64Encoder()]]);\n}\n\nexport function getResumeDataDecoder(): FixedSizeDecoder<ResumeData> {\n return getStructDecoder([['expectedExpiresAtTs', getI64Decoder()]]);\n}\n\nexport function getResumeDataCodec(): FixedSizeCodec<ResumeDataArgs, ResumeData> {\n return combineCodec(getResumeDataEncoder(), getResumeDataDecoder());\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 getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type SubscribeData = {\n planId: bigint;\n planBump: number;\n expectedMint: Address;\n expectedAmount: bigint;\n expectedPeriodHours: bigint;\n expectedCreatedAt: bigint;\n expectedSubscriptionAuthorityInitId: bigint;\n};\n\nexport type SubscribeDataArgs = {\n planId: number | bigint;\n planBump: number;\n expectedMint: Address;\n expectedAmount: number | bigint;\n expectedPeriodHours: number | bigint;\n expectedCreatedAt: number | bigint;\n expectedSubscriptionAuthorityInitId: number | bigint;\n};\n\nexport function getSubscribeDataEncoder(): FixedSizeEncoder<SubscribeDataArgs> {\n return getStructEncoder([\n ['planId', getU64Encoder()],\n ['planBump', getU8Encoder()],\n ['expectedMint', getAddressEncoder()],\n ['expectedAmount', getU64Encoder()],\n ['expectedPeriodHours', getU64Encoder()],\n ['expectedCreatedAt', getI64Encoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Encoder()],\n ]);\n}\n\nexport function getSubscribeDataDecoder(): FixedSizeDecoder<SubscribeData> {\n return getStructDecoder([\n ['planId', getU64Decoder()],\n ['planBump', getU8Decoder()],\n ['expectedMint', getAddressDecoder()],\n ['expectedAmount', getU64Decoder()],\n ['expectedPeriodHours', getU64Decoder()],\n ['expectedCreatedAt', getI64Decoder()],\n ['expectedSubscriptionAuthorityInitId', getI64Decoder()],\n ]);\n}\n\nexport function getSubscribeDataCodec(): FixedSizeCodec<SubscribeDataArgs, SubscribeData> {\n return combineCodec(getSubscribeDataEncoder(), getSubscribeDataDecoder());\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 getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type TransferData = { amount: bigint; delegator: Address; mint: Address };\n\nexport type TransferDataArgs = { amount: number | bigint; delegator: Address; mint: Address };\n\nexport function getTransferDataEncoder(): FixedSizeEncoder<TransferDataArgs> {\n return getStructEncoder([\n ['amount', getU64Encoder()],\n ['delegator', getAddressEncoder()],\n ['mint', getAddressEncoder()],\n ]);\n}\n\nexport function getTransferDataDecoder(): FixedSizeDecoder<TransferData> {\n return getStructDecoder([\n ['amount', getU64Decoder()],\n ['delegator', getAddressDecoder()],\n ['mint', getAddressDecoder()],\n ]);\n}\n\nexport function getTransferDataCodec(): FixedSizeCodec<TransferDataArgs, TransferData> {\n return combineCodec(getTransferDataEncoder(), getTransferDataDecoder());\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 fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type UpdatePlanData = {\n status: number;\n endTs: bigint;\n pullers: Array<Address>;\n metadataUri: string;\n expectedCreatedAt: bigint;\n expectedEndTs: bigint;\n expectedPullers: Array<Address>;\n expectedMetadataUri: string;\n};\n\nexport type UpdatePlanDataArgs = {\n status: number;\n endTs: number | bigint;\n pullers: Array<Address>;\n metadataUri: string;\n expectedCreatedAt: number | bigint;\n expectedEndTs: number | bigint;\n expectedPullers: Array<Address>;\n expectedMetadataUri: string;\n};\n\nexport function getUpdatePlanDataEncoder(): FixedSizeEncoder<UpdatePlanDataArgs> {\n return getStructEncoder([\n ['status', getU8Encoder()],\n ['endTs', getI64Encoder()],\n ['pullers', getArrayEncoder(getAddressEncoder(), { size: 4 })],\n ['metadataUri', fixEncoderSize(getUtf8Encoder(), 128)],\n ['expectedCreatedAt', getI64Encoder()],\n ['expectedEndTs', getI64Encoder()],\n ['expectedPullers', getArrayEncoder(getAddressEncoder(), { size: 4 })],\n ['expectedMetadataUri', fixEncoderSize(getUtf8Encoder(), 128)],\n ]);\n}\n\nexport function getUpdatePlanDataDecoder(): FixedSizeDecoder<UpdatePlanData> {\n return getStructDecoder([\n ['status', getU8Decoder()],\n ['endTs', getI64Decoder()],\n ['pullers', getArrayDecoder(getAddressDecoder(), { size: 4 })],\n ['metadataUri', fixDecoderSize(getUtf8Decoder(), 128)],\n ['expectedCreatedAt', getI64Decoder()],\n ['expectedEndTs', getI64Decoder()],\n ['expectedPullers', getArrayDecoder(getAddressDecoder(), { size: 4 })],\n ['expectedMetadataUri', fixDecoderSize(getUtf8Decoder(), 128)],\n ]);\n}\n\nexport function getUpdatePlanDataCodec(): FixedSizeCodec<UpdatePlanDataArgs, UpdatePlanData> {\n return combineCodec(getUpdatePlanDataEncoder(), getUpdatePlanDataDecoder());\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findPlanPda, PlanSeeds } from '../pdas';\nimport { getPlanDataDecoder, getPlanDataEncoder, type PlanData, type PlanDataArgs } from '../types';\n\nexport type Plan = { discriminator: number; owner: Address; bump: number; status: number; data: PlanData };\n\nexport type PlanArgs = { discriminator: number; owner: Address; bump: number; status: number; data: PlanDataArgs };\n\n/** Gets the encoder for {@link PlanArgs} account data. */\nexport function getPlanEncoder(): FixedSizeEncoder<PlanArgs> {\n return getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['owner', getAddressEncoder()],\n ['bump', getU8Encoder()],\n ['status', getU8Encoder()],\n ['data', getPlanDataEncoder()],\n ]);\n}\n\n/** Gets the decoder for {@link Plan} account data. */\nexport function getPlanDecoder(): FixedSizeDecoder<Plan> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['owner', getAddressDecoder()],\n ['bump', getU8Decoder()],\n ['status', getU8Decoder()],\n ['data', getPlanDataDecoder()],\n ]);\n}\n\n/** Gets the codec for {@link Plan} account data. */\nexport function getPlanCodec(): FixedSizeCodec<PlanArgs, Plan> {\n return combineCodec(getPlanEncoder(), getPlanDecoder());\n}\n\nexport function decodePlan<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Plan, TAddress>;\nexport function decodePlan<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Plan, TAddress>;\nexport function decodePlan<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Plan, TAddress> | MaybeAccount<Plan, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getPlanDecoder());\n}\n\nexport async function fetchPlan<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Plan, TAddress>> {\n const maybeAccount = await fetchMaybePlan(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybePlan<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Plan, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodePlan(maybeAccount);\n}\n\nexport async function fetchAllPlan(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Plan>[]> {\n const maybeAccounts = await fetchAllMaybePlan(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybePlan(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Plan>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodePlan(maybeAccount));\n}\n\nexport async function fetchPlanFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: PlanSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<Plan>> {\n const maybeAccount = await fetchMaybePlanFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybePlanFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: PlanSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<Plan>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findPlanPda(seeds, { programAddress });\n return await fetchMaybePlan(rpc, address, fetchConfig);\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findRecurringDelegationPda, RecurringDelegationSeeds } from '../pdas';\nimport { getHeaderDecoder, getHeaderEncoder, type Header, type HeaderArgs } from '../types';\n\nexport type RecurringDelegation = {\n header: Header;\n subscriptionAuthority: Address;\n mint: Address;\n currentPeriodStartTs: bigint;\n periodLengthS: bigint;\n expiryTs: bigint;\n amountPerPeriod: bigint;\n amountPulledInPeriod: bigint;\n};\n\nexport type RecurringDelegationArgs = {\n header: HeaderArgs;\n subscriptionAuthority: Address;\n mint: Address;\n currentPeriodStartTs: number | bigint;\n periodLengthS: number | bigint;\n expiryTs: number | bigint;\n amountPerPeriod: number | bigint;\n amountPulledInPeriod: number | bigint;\n};\n\n/** Gets the encoder for {@link RecurringDelegationArgs} account data. */\nexport function getRecurringDelegationEncoder(): FixedSizeEncoder<RecurringDelegationArgs> {\n return getStructEncoder([\n ['header', getHeaderEncoder()],\n ['subscriptionAuthority', getAddressEncoder()],\n ['mint', getAddressEncoder()],\n ['currentPeriodStartTs', getI64Encoder()],\n ['periodLengthS', getU64Encoder()],\n ['expiryTs', getI64Encoder()],\n ['amountPerPeriod', getU64Encoder()],\n ['amountPulledInPeriod', getU64Encoder()],\n ]);\n}\n\n/** Gets the decoder for {@link RecurringDelegation} account data. */\nexport function getRecurringDelegationDecoder(): FixedSizeDecoder<RecurringDelegation> {\n return getStructDecoder([\n ['header', getHeaderDecoder()],\n ['subscriptionAuthority', getAddressDecoder()],\n ['mint', getAddressDecoder()],\n ['currentPeriodStartTs', getI64Decoder()],\n ['periodLengthS', getU64Decoder()],\n ['expiryTs', getI64Decoder()],\n ['amountPerPeriod', getU64Decoder()],\n ['amountPulledInPeriod', getU64Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link RecurringDelegation} account data. */\nexport function getRecurringDelegationCodec(): FixedSizeCodec<RecurringDelegationArgs, RecurringDelegation> {\n return combineCodec(getRecurringDelegationEncoder(), getRecurringDelegationDecoder());\n}\n\nexport function decodeRecurringDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<RecurringDelegation, TAddress>;\nexport function decodeRecurringDelegation<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<RecurringDelegation, TAddress>;\nexport function decodeRecurringDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<RecurringDelegation, TAddress> | MaybeAccount<RecurringDelegation, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getRecurringDelegationDecoder());\n}\n\nexport async function fetchRecurringDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<RecurringDelegation, TAddress>> {\n const maybeAccount = await fetchMaybeRecurringDelegation(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeRecurringDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<RecurringDelegation, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeRecurringDelegation(maybeAccount);\n}\n\nexport async function fetchAllRecurringDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<RecurringDelegation>[]> {\n const maybeAccounts = await fetchAllMaybeRecurringDelegation(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeRecurringDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<RecurringDelegation>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeRecurringDelegation(maybeAccount));\n}\n\nexport async function fetchRecurringDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: RecurringDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<RecurringDelegation>> {\n const maybeAccount = await fetchMaybeRecurringDelegationFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeRecurringDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: RecurringDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<RecurringDelegation>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findRecurringDelegationPda(seeds, { programAddress });\n return await fetchMaybeRecurringDelegation(rpc, address, fetchConfig);\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getAddressDecoder,\n getAddressEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findSubscriptionAuthorityPda, SubscriptionAuthoritySeeds } from '../pdas';\n\nexport type SubscriptionAuthority = {\n discriminator: number;\n user: Address;\n tokenMint: Address;\n payer: Address;\n bump: number;\n initId: bigint;\n};\n\nexport type SubscriptionAuthorityArgs = {\n discriminator: number;\n user: Address;\n tokenMint: Address;\n payer: Address;\n bump: number;\n initId: number | bigint;\n};\n\n/** Gets the encoder for {@link SubscriptionAuthorityArgs} account data. */\nexport function getSubscriptionAuthorityEncoder(): FixedSizeEncoder<SubscriptionAuthorityArgs> {\n return getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['user', getAddressEncoder()],\n ['tokenMint', getAddressEncoder()],\n ['payer', getAddressEncoder()],\n ['bump', getU8Encoder()],\n ['initId', getI64Encoder()],\n ]);\n}\n\n/** Gets the decoder for {@link SubscriptionAuthority} account data. */\nexport function getSubscriptionAuthorityDecoder(): FixedSizeDecoder<SubscriptionAuthority> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['user', getAddressDecoder()],\n ['tokenMint', getAddressDecoder()],\n ['payer', getAddressDecoder()],\n ['bump', getU8Decoder()],\n ['initId', getI64Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link SubscriptionAuthority} account data. */\nexport function getSubscriptionAuthorityCodec(): FixedSizeCodec<SubscriptionAuthorityArgs, SubscriptionAuthority> {\n return combineCodec(getSubscriptionAuthorityEncoder(), getSubscriptionAuthorityDecoder());\n}\n\nexport function decodeSubscriptionAuthority<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<SubscriptionAuthority, TAddress>;\nexport function decodeSubscriptionAuthority<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<SubscriptionAuthority, TAddress>;\nexport function decodeSubscriptionAuthority<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<SubscriptionAuthority, TAddress> | MaybeAccount<SubscriptionAuthority, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getSubscriptionAuthorityDecoder());\n}\n\nexport async function fetchSubscriptionAuthority<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<SubscriptionAuthority, TAddress>> {\n const maybeAccount = await fetchMaybeSubscriptionAuthority(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubscriptionAuthority<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<SubscriptionAuthority, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeSubscriptionAuthority(maybeAccount);\n}\n\nexport async function fetchAllSubscriptionAuthority(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<SubscriptionAuthority>[]> {\n const maybeAccounts = await fetchAllMaybeSubscriptionAuthority(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeSubscriptionAuthority(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<SubscriptionAuthority>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeSubscriptionAuthority(maybeAccount));\n}\n\nexport async function fetchSubscriptionAuthorityFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: SubscriptionAuthoritySeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<SubscriptionAuthority>> {\n const maybeAccount = await fetchMaybeSubscriptionAuthorityFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubscriptionAuthorityFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: SubscriptionAuthoritySeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<SubscriptionAuthority>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findSubscriptionAuthorityPda(seeds, { programAddress });\n return await fetchMaybeSubscriptionAuthority(rpc, address, fetchConfig);\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 assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/kit';\nimport { findSubscriptionDelegationPda, SubscriptionDelegationSeeds } from '../pdas';\nimport {\n getHeaderDecoder,\n getHeaderEncoder,\n getPlanTermsDecoder,\n getPlanTermsEncoder,\n type Header,\n type HeaderArgs,\n type PlanTerms,\n type PlanTermsArgs,\n} from '../types';\n\nexport type SubscriptionDelegation = {\n header: Header;\n terms: PlanTerms;\n amountPulledInPeriod: bigint;\n currentPeriodStartTs: bigint;\n expiresAtTs: bigint;\n};\n\nexport type SubscriptionDelegationArgs = {\n header: HeaderArgs;\n terms: PlanTermsArgs;\n amountPulledInPeriod: number | bigint;\n currentPeriodStartTs: number | bigint;\n expiresAtTs: number | bigint;\n};\n\n/** Gets the encoder for {@link SubscriptionDelegationArgs} account data. */\nexport function getSubscriptionDelegationEncoder(): FixedSizeEncoder<SubscriptionDelegationArgs> {\n return getStructEncoder([\n ['header', getHeaderEncoder()],\n ['terms', getPlanTermsEncoder()],\n ['amountPulledInPeriod', getU64Encoder()],\n ['currentPeriodStartTs', getI64Encoder()],\n ['expiresAtTs', getI64Encoder()],\n ]);\n}\n\n/** Gets the decoder for {@link SubscriptionDelegation} account data. */\nexport function getSubscriptionDelegationDecoder(): FixedSizeDecoder<SubscriptionDelegation> {\n return getStructDecoder([\n ['header', getHeaderDecoder()],\n ['terms', getPlanTermsDecoder()],\n ['amountPulledInPeriod', getU64Decoder()],\n ['currentPeriodStartTs', getI64Decoder()],\n ['expiresAtTs', getI64Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link SubscriptionDelegation} account data. */\nexport function getSubscriptionDelegationCodec(): FixedSizeCodec<SubscriptionDelegationArgs, SubscriptionDelegation> {\n return combineCodec(getSubscriptionDelegationEncoder(), getSubscriptionDelegationDecoder());\n}\n\nexport function decodeSubscriptionDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<SubscriptionDelegation, TAddress>;\nexport function decodeSubscriptionDelegation<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<SubscriptionDelegation, TAddress>;\nexport function decodeSubscriptionDelegation<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<SubscriptionDelegation, TAddress> | MaybeAccount<SubscriptionDelegation, TAddress> {\n return decodeAccount(encodedAccount as MaybeEncodedAccount<TAddress>, getSubscriptionDelegationDecoder());\n}\n\nexport async function fetchSubscriptionDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<SubscriptionDelegation, TAddress>> {\n const maybeAccount = await fetchMaybeSubscriptionDelegation(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubscriptionDelegation<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<SubscriptionDelegation, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeSubscriptionDelegation(maybeAccount);\n}\n\nexport async function fetchAllSubscriptionDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<SubscriptionDelegation>[]> {\n const maybeAccounts = await fetchAllMaybeSubscriptionDelegation(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeSubscriptionDelegation(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<SubscriptionDelegation>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map(maybeAccount => decodeSubscriptionDelegation(maybeAccount));\n}\n\nexport async function fetchSubscriptionDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: SubscriptionDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<Account<SubscriptionDelegation>> {\n const maybeAccount = await fetchMaybeSubscriptionDelegationFromSeeds(rpc, seeds, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubscriptionDelegationFromSeeds(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n seeds: SubscriptionDelegationSeeds,\n config: FetchAccountConfig & { programAddress?: Address } = {},\n): Promise<MaybeAccount<SubscriptionDelegation>> {\n const { programAddress, ...fetchConfig } = config;\n const [address] = await findSubscriptionDelegationPda(seeds, { programAddress });\n return await fetchMaybeSubscriptionDelegation(rpc, address, fetchConfig);\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 isProgramError,\n type Address,\n type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,\n type SolanaError,\n} from '@solana/kit';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const SUBSCRIPTIONS_ERROR__NOT_SIGNER = 0x64; // 100\nexport const SUBSCRIPTIONS_ERROR__INVALID_ADDRESS = 0x65; // 101\nexport const SUBSCRIPTIONS_ERROR__INVALID_ESCROW_PDA = 0x66; // 102\nexport const SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_AUTHORITY_PDA = 0x67; // 103\nexport const SUBSCRIPTIONS_ERROR__NOT_SYSTEM_PROGRAM = 0x68; // 104\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN_PROGRAM = 0x69; // 105\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_MINT_ACCOUNT_DATA = 0x6a; // 106\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_TOKEN_ACCOUNT_DATA = 0x6b; // 107\nexport const SUBSCRIPTIONS_ERROR__INVALID_ASSOCIATED_TOKEN_ACCOUNT_DERIVED_ADDRESS = 0x6c; // 108\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_MINT_ACCOUNT_DATA = 0x6d; // 109\nexport const SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_TOKEN_ACCOUNT_DATA = 0x6e; // 110\nexport const SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DATA = 0x6f; // 111\nexport const SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION_DATA = 0x70; // 112\nexport const SUBSCRIPTIONS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS = 0x71; // 113\nexport const SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION = 0x72; // 114\nexport const SUBSCRIPTIONS_ERROR__ARITHMETIC_OVERFLOW = 0x73; // 115\nexport const SUBSCRIPTIONS_ERROR__ARITHMETIC_UNDERFLOW = 0x74; // 116\nexport const SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DISCRIMINATOR = 0x75; // 117\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_CONFIDENTIAL_TRANSFER = 0x76; // 118\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_NON_TRANSFERABLE = 0x77; // 119\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_PERMANENT_DELEGATE = 0x78; // 120\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_HOOK = 0x79; // 121\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_FEE = 0x7a; // 122\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_MINT_CLOSE_AUTHORITY = 0x7b; // 123\nexport const SUBSCRIPTIONS_ERROR__MINT_HAS_PAUSABLE = 0x7c; // 124\nexport const SUBSCRIPTIONS_ERROR__MINT_MISMATCH = 0x7d; // 125\nexport const SUBSCRIPTIONS_ERROR__INVALID_DELEGATE_PDA = 0x7e; // 126\nexport const SUBSCRIPTIONS_ERROR__INVALID_HEADER_DATA = 0x7f; // 127\nexport const SUBSCRIPTIONS_ERROR__DELEGATION_EXPIRED = 0x80; // 128\nexport const SUBSCRIPTIONS_ERROR__INVALID_AMOUNT = 0x81; // 129\nexport const SUBSCRIPTIONS_ERROR__UNAUTHORIZED = 0x82; // 130\nexport const SUBSCRIPTIONS_ERROR__ACCOUNT_NOT_WRITABLE = 0x83; // 131\nexport const SUBSCRIPTIONS_ERROR__ATA_OWNER_MISMATCH = 0x84; // 132\nexport const SUBSCRIPTIONS_ERROR__DELEGATION_VERSION_MISMATCH = 0x85; // 133\nexport const SUBSCRIPTIONS_ERROR__MIGRATION_REQUIRED = 0x86; // 134\nexport const SUBSCRIPTIONS_ERROR__DELEGATION_ALREADY_EXISTS = 0x87; // 135\nexport const SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY = 0x88; // 136\nexport const SUBSCRIPTIONS_ERROR__TRANSFER_HOOK_TOO_MANY_ACCOUNTS = 0x89; // 137\nexport const SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_LIMIT = 0x12c; // 300\nexport const SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_EXPIRY_IN_PAST = 0x12d; // 301\nexport const SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_AMOUNT_ZERO = 0x12e; // 302\nexport const SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_PERIOD_LIMIT = 0x190; // 400\nexport const SUBSCRIPTIONS_ERROR__PERIOD_NOT_ELAPSED = 0x191; // 401\nexport const SUBSCRIPTIONS_ERROR__INVALID_PERIOD_LENGTH = 0x192; // 402\nexport const SUBSCRIPTIONS_ERROR__INVALID_PAYER_DATA = 0x193; // 403\nexport const SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST = 0x194; // 404\nexport const SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY = 0x195; // 405\nexport const SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_AMOUNT_ZERO = 0x196; // 406\nexport const SUBSCRIPTIONS_ERROR__DELEGATION_NOT_STARTED = 0x197; // 407\nexport const SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY = 0x198; // 408\nexport const SUBSCRIPTIONS_ERROR__PLAN_SUNSET = 0x1f4; // 500\nexport const SUBSCRIPTIONS_ERROR__PLAN_EXPIRED = 0x1f5; // 501\nexport const SUBSCRIPTIONS_ERROR__INVALID_PLAN_PDA = 0x1f6; // 502\nexport const SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_PDA = 0x1f7; // 503\nexport const SUBSCRIPTIONS_ERROR__NOT_PLAN_OWNER = 0x1f8; // 504\nexport const SUBSCRIPTIONS_ERROR__SUBSCRIPTION_PLAN_MISMATCH = 0x1f9; // 505\nexport const SUBSCRIPTIONS_ERROR__UNAUTHORIZED_DESTINATION = 0x1fa; // 506\nexport const SUBSCRIPTIONS_ERROR__INVALID_NUM_DESTINATIONS = 0x1fb; // 507\nexport const SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED = 0x1fc; // 508\nexport const SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED = 0x1fd; // 509\nexport const SUBSCRIPTIONS_ERROR__SUBSCRIPTION_NOT_CANCELLED = 0x1fe; // 510\nexport const SUBSCRIPTIONS_ERROR__INVALID_END_TS = 0x1ff; // 511\nexport const SUBSCRIPTIONS_ERROR__INVALID_PLAN_STATUS = 0x200; // 512\nexport const SUBSCRIPTIONS_ERROR__PLAN_IMMUTABLE_AFTER_SUNSET = 0x201; // 513\nexport const SUBSCRIPTIONS_ERROR__SUNSET_REQUIRES_END_TS = 0x202; // 514\nexport const SUBSCRIPTIONS_ERROR__PLAN_NOT_EXPIRED = 0x203; // 515\nexport const SUBSCRIPTIONS_ERROR__PLAN_CLOSED = 0x204; // 516\nexport const SUBSCRIPTIONS_ERROR__ALREADY_SUBSCRIBED = 0x205; // 517\nexport const SUBSCRIPTIONS_ERROR__PLAN_ALREADY_EXISTS = 0x206; // 518\nexport const SUBSCRIPTIONS_ERROR__PLAN_TERMS_MISMATCH = 0x207; // 519\nexport const SUBSCRIPTIONS_ERROR__PLAN_END_TS_CANNOT_EXTEND = 0x208; // 520\nexport const SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_APPROVAL = 0x209; // 521\nexport const SUBSCRIPTIONS_ERROR__STALE_PLAN_APPROVAL = 0x20a; // 522\nexport const SUBSCRIPTIONS_ERROR__INVALID_EVENT_AUTHORITY = 0x258; // 600\nexport const SUBSCRIPTIONS_ERROR__INVALID_EVENT_DATA = 0x259; // 601\nexport const SUBSCRIPTIONS_ERROR__INVALID_EVENT_TAG = 0x25a; // 602\nexport const SUBSCRIPTIONS_ERROR__INVALID_EVENT_DISCRIMINATOR = 0x25b; // 603\nexport const SUBSCRIPTIONS_ERROR__INVALID_SELF_PROGRAM = 0x25c; // 604\n\nexport type SubscriptionsError =\n | typeof SUBSCRIPTIONS_ERROR__ACCOUNT_NOT_WRITABLE\n | typeof SUBSCRIPTIONS_ERROR__ALREADY_SUBSCRIBED\n | typeof SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_LIMIT\n | typeof SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_PERIOD_LIMIT\n | typeof SUBSCRIPTIONS_ERROR__ARITHMETIC_OVERFLOW\n | typeof SUBSCRIPTIONS_ERROR__ARITHMETIC_UNDERFLOW\n | typeof SUBSCRIPTIONS_ERROR__ATA_OWNER_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__DELEGATION_ALREADY_EXISTS\n | typeof SUBSCRIPTIONS_ERROR__DELEGATION_EXPIRED\n | typeof SUBSCRIPTIONS_ERROR__DELEGATION_NOT_STARTED\n | typeof SUBSCRIPTIONS_ERROR__DELEGATION_VERSION_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_AMOUNT_ZERO\n | typeof SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_EXPIRY_IN_PAST\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DISCRIMINATOR\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ADDRESS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_AMOUNT\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ASSOCIATED_TOKEN_ACCOUNT_DERIVED_ADDRESS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_DELEGATE_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_END_TS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_ESCROW_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_EVENT_AUTHORITY\n | typeof SUBSCRIPTIONS_ERROR__INVALID_EVENT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_EVENT_DISCRIMINATOR\n | typeof SUBSCRIPTIONS_ERROR__INVALID_EVENT_TAG\n | typeof SUBSCRIPTIONS_ERROR__INVALID_HEADER_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION\n | typeof SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_NUM_DESTINATIONS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_PAYER_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_PERIOD_LENGTH\n | typeof SUBSCRIPTIONS_ERROR__INVALID_PLAN_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_PLAN_STATUS\n | typeof SUBSCRIPTIONS_ERROR__INVALID_SELF_PROGRAM\n | typeof SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_AUTHORITY_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_PDA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_MINT_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_TOKEN_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN_PROGRAM\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_MINT_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_TOKEN_ACCOUNT_DATA\n | typeof SUBSCRIPTIONS_ERROR__MIGRATION_REQUIRED\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_CONFIDENTIAL_TRANSFER\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_MINT_CLOSE_AUTHORITY\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_NON_TRANSFERABLE\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_PAUSABLE\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_PERMANENT_DELEGATE\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_FEE\n | typeof SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_HOOK\n | typeof SUBSCRIPTIONS_ERROR__MINT_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS\n | typeof SUBSCRIPTIONS_ERROR__NOT_PLAN_OWNER\n | typeof SUBSCRIPTIONS_ERROR__NOT_SIGNER\n | typeof SUBSCRIPTIONS_ERROR__NOT_SYSTEM_PROGRAM\n | typeof SUBSCRIPTIONS_ERROR__PERIOD_NOT_ELAPSED\n | typeof SUBSCRIPTIONS_ERROR__PLAN_ALREADY_EXISTS\n | typeof SUBSCRIPTIONS_ERROR__PLAN_CLOSED\n | typeof SUBSCRIPTIONS_ERROR__PLAN_END_TS_CANNOT_EXTEND\n | typeof SUBSCRIPTIONS_ERROR__PLAN_EXPIRED\n | typeof SUBSCRIPTIONS_ERROR__PLAN_IMMUTABLE_AFTER_SUNSET\n | typeof SUBSCRIPTIONS_ERROR__PLAN_NOT_EXPIRED\n | typeof SUBSCRIPTIONS_ERROR__PLAN_SUNSET\n | typeof SUBSCRIPTIONS_ERROR__PLAN_TERMS_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_AMOUNT_ZERO\n | typeof SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY\n | typeof SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY\n | typeof SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST\n | typeof SUBSCRIPTIONS_ERROR__STALE_PLAN_APPROVAL\n | typeof SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_APPROVAL\n | typeof SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY\n | typeof SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED\n | typeof SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED\n | typeof SUBSCRIPTIONS_ERROR__SUBSCRIPTION_NOT_CANCELLED\n | typeof SUBSCRIPTIONS_ERROR__SUBSCRIPTION_PLAN_MISMATCH\n | typeof SUBSCRIPTIONS_ERROR__SUNSET_REQUIRES_END_TS\n | typeof SUBSCRIPTIONS_ERROR__TRANSFER_HOOK_TOO_MANY_ACCOUNTS\n | typeof SUBSCRIPTIONS_ERROR__UNAUTHORIZED\n | typeof SUBSCRIPTIONS_ERROR__UNAUTHORIZED_DESTINATION;\n\nlet subscriptionsErrorMessages: Record<SubscriptionsError, string> | undefined;\nif (process.env['NODE_ENV'] !== 'production') {\n subscriptionsErrorMessages = {\n [SUBSCRIPTIONS_ERROR__ACCOUNT_NOT_WRITABLE]: `Account must be writable`,\n [SUBSCRIPTIONS_ERROR__ALREADY_SUBSCRIBED]: `Already subscribed to this plan`,\n [SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_LIMIT]: `Transfer amount exceeds delegation limit`,\n [SUBSCRIPTIONS_ERROR__AMOUNT_EXCEEDS_PERIOD_LIMIT]: `Transfer amount exceeds period limit`,\n [SUBSCRIPTIONS_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic Overflow`,\n [SUBSCRIPTIONS_ERROR__ARITHMETIC_UNDERFLOW]: `Arithmetic Underflow`,\n [SUBSCRIPTIONS_ERROR__ATA_OWNER_MISMATCH]: `Token account owner does not match expected`,\n [SUBSCRIPTIONS_ERROR__DELEGATION_ALREADY_EXISTS]: `Delegation account already exists`,\n [SUBSCRIPTIONS_ERROR__DELEGATION_EXPIRED]: `Delegation has expired`,\n [SUBSCRIPTIONS_ERROR__DELEGATION_NOT_STARTED]: `Delegation period has not started yet`,\n [SUBSCRIPTIONS_ERROR__DELEGATION_VERSION_MISMATCH]: `Delegation header version is not compatible`,\n [SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_AMOUNT_ZERO]: `zero amount specified`,\n [SUBSCRIPTIONS_ERROR__FIXED_DELEGATION_EXPIRY_IN_PAST]: `Expiry time specified is less than current time`,\n [SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DATA]: `Invalid account data`,\n [SUBSCRIPTIONS_ERROR__INVALID_ACCOUNT_DISCRIMINATOR]: `Invalid account discriminator`,\n [SUBSCRIPTIONS_ERROR__INVALID_ADDRESS]: `Invalid account address`,\n [SUBSCRIPTIONS_ERROR__INVALID_AMOUNT]: `Invalid amount specified`,\n [SUBSCRIPTIONS_ERROR__INVALID_ASSOCIATED_TOKEN_ACCOUNT_DERIVED_ADDRESS]: `Invalid associated token account address`,\n [SUBSCRIPTIONS_ERROR__INVALID_DELEGATE_PDA]: `Invalid delegation PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_END_TS]: `End timestamp must be zero or in the future`,\n [SUBSCRIPTIONS_ERROR__INVALID_ESCROW_PDA]: `Invalid escrow PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_EVENT_AUTHORITY]: `Invalid event authority PDA`,\n [SUBSCRIPTIONS_ERROR__INVALID_EVENT_DATA]: `Invalid event data`,\n [SUBSCRIPTIONS_ERROR__INVALID_EVENT_DISCRIMINATOR]: `Unknown event discriminator`,\n [SUBSCRIPTIONS_ERROR__INVALID_EVENT_TAG]: `Invalid event tag prefix`,\n [SUBSCRIPTIONS_ERROR__INVALID_HEADER_DATA]: `Invalid header data`,\n [SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION]: `Invalid instruction`,\n [SUBSCRIPTIONS_ERROR__INVALID_INSTRUCTION_DATA]: `Invalid instruction data`,\n [SUBSCRIPTIONS_ERROR__INVALID_NUM_DESTINATIONS]: `No valid destinations provided`,\n [SUBSCRIPTIONS_ERROR__INVALID_PAYER_DATA]: `Payer provided does not match delegation`,\n [SUBSCRIPTIONS_ERROR__INVALID_PERIOD_LENGTH]: `Invalid Period length`,\n [SUBSCRIPTIONS_ERROR__INVALID_PLAN_PDA]: `Invalid Plan PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_PLAN_STATUS]: `Invalid plan status value`,\n [SUBSCRIPTIONS_ERROR__INVALID_SELF_PROGRAM]: `Self program account does not match this program`,\n [SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_AUTHORITY_PDA]: `Invalid subscription-authority PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_SUBSCRIPTION_PDA]: `Invalid subscription PDA derivation`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_MINT_ACCOUNT_DATA]: `Invalid Token-2022 mint account data`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN2022_TOKEN_ACCOUNT_DATA]: `Invalid Token-2022 token account data`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN_PROGRAM]: `Token Program does not match other accounts`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_MINT_ACCOUNT_DATA]: `Invalid SPL Token mint account data`,\n [SUBSCRIPTIONS_ERROR__INVALID_TOKEN_SPL_TOKEN_ACCOUNT_DATA]: `Invalid SPL Token account data`,\n [SUBSCRIPTIONS_ERROR__MIGRATION_REQUIRED]: `Account requires explicit migration`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_CONFIDENTIAL_TRANSFER]: `Mint has ConfidentialTransfer extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_MINT_CLOSE_AUTHORITY]: `Mint has MintCloseAuthority extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_NON_TRANSFERABLE]: `Mint has NonTransferable extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_PAUSABLE]: `Mint has Pausable extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_PERMANENT_DELEGATE]: `Mint has PermanentDelegate extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_FEE]: `Mint has TransferFee extension`,\n [SUBSCRIPTIONS_ERROR__MINT_HAS_TRANSFER_HOOK]: `Mint has TransferHook extension`,\n [SUBSCRIPTIONS_ERROR__MINT_MISMATCH]: `Token mint mismatch`,\n [SUBSCRIPTIONS_ERROR__NOT_ENOUGH_ACCOUNT_KEYS]: `Not enough account keys provided`,\n [SUBSCRIPTIONS_ERROR__NOT_PLAN_OWNER]: `Caller is not the plan owner`,\n [SUBSCRIPTIONS_ERROR__NOT_SIGNER]: `Account must be a signer`,\n [SUBSCRIPTIONS_ERROR__NOT_SYSTEM_PROGRAM]: `Expected system program`,\n [SUBSCRIPTIONS_ERROR__PERIOD_NOT_ELAPSED]: `Period has not elapsed yet`,\n [SUBSCRIPTIONS_ERROR__PLAN_ALREADY_EXISTS]: `Plan account already exists`,\n [SUBSCRIPTIONS_ERROR__PLAN_CLOSED]: `Plan account has been closed`,\n [SUBSCRIPTIONS_ERROR__PLAN_END_TS_CANNOT_EXTEND]: `A finite plan end timestamp can only be shortened, not removed or extended`,\n [SUBSCRIPTIONS_ERROR__PLAN_EXPIRED]: `Plan has expired`,\n [SUBSCRIPTIONS_ERROR__PLAN_IMMUTABLE_AFTER_SUNSET]: `Plan cannot be updated after sunset`,\n [SUBSCRIPTIONS_ERROR__PLAN_NOT_EXPIRED]: `Plan must be expired to delete`,\n [SUBSCRIPTIONS_ERROR__PLAN_SUNSET]: `Plan is in sunset status`,\n [SUBSCRIPTIONS_ERROR__PLAN_TERMS_MISMATCH]: `Subscription plan terms do not match the current plan`,\n [SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_AMOUNT_ZERO]: `zero amount specified`,\n [SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_ON_LANDING_REQUIRES_EXPIRY]: `start_ts of 0 (start on landing) requires a non-zero expiry`,\n [SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_GREATER_THAN_EXPIRY]: `start time specified is greater than expiry`,\n [SUBSCRIPTIONS_ERROR__RECURRING_DELEGATION_START_TIME_IN_PAST]: `Past start time specified`,\n [SUBSCRIPTIONS_ERROR__STALE_PLAN_APPROVAL]: `Plan update approval does not match the current plan state`,\n [SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_APPROVAL]: `Subscription approval does not match the current subscription`,\n [SUBSCRIPTIONS_ERROR__STALE_SUBSCRIPTION_AUTHORITY]: `Delegation init_id does not match current SubscriptionAuthority`,\n [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_ALREADY_CANCELLED]: `Subscription already cancelled`,\n [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_CANCELLED]: `Subscription cancelled and past valid period`,\n [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_NOT_CANCELLED]: `Subscription is not cancelled`,\n [SUBSCRIPTIONS_ERROR__SUBSCRIPTION_PLAN_MISMATCH]: `Subscription does not belong to this plan`,\n [SUBSCRIPTIONS_ERROR__SUNSET_REQUIRES_END_TS]: `Sunset requires a non-zero end timestamp`,\n [SUBSCRIPTIONS_ERROR__TRANSFER_HOOK_TOO_MANY_ACCOUNTS]: `Too many transfer hook accounts provided`,\n [SUBSCRIPTIONS_ERROR__UNAUTHORIZED]: `Caller not authorized for this action`,\n [SUBSCRIPTIONS_ERROR__UNAUTHORIZED_DESTINATION]: `Destination not in plan whitelist`,\n };\n}\n\nexport function getSubscriptionsErrorMessage(code: SubscriptionsError): string {\n if (process.env['NODE_ENV'] !== 'production') {\n return (subscriptionsErrorMessages as Record<SubscriptionsError, string>)[code];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isSubscriptionsError<TProgramErrorCode extends SubscriptionsError>(\n error: unknown,\n transactionMessage: { instructions: Record<number, { programAddress: Address }> },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &\n Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(error, transactionMessage, SUBSCRIPTIONS_PROGRAM_ADDRESS, code);\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 assertIsInstructionWithAccounts,\n containsBytes,\n extendClient,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n SolanaError,\n type Address,\n type ClientWithRpc,\n type ClientWithTransactionPlanning,\n type ClientWithTransactionSending,\n type ExtendedClient,\n type GetAccountInfoApi,\n type GetMultipleAccountsApi,\n type Instruction,\n type InstructionWithData,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n addSelfFetchFunctions,\n addSelfPlanAndSendFunctions,\n type SelfFetchFunctions,\n type SelfPlanAndSendFunctions,\n} from '@solana/program-client-core';\nimport {\n getEventAuthorityCodec,\n getFixedDelegationCodec,\n getPlanCodec,\n getRecurringDelegationCodec,\n getSubscriptionAuthorityCodec,\n getSubscriptionDelegationCodec,\n type EventAuthority,\n type EventAuthorityArgs,\n type FixedDelegation,\n type FixedDelegationArgs,\n type Plan,\n type PlanArgs,\n type RecurringDelegation,\n type RecurringDelegationArgs,\n type SubscriptionAuthority,\n type SubscriptionAuthorityArgs,\n type SubscriptionDelegation,\n type SubscriptionDelegationArgs,\n} from '../accounts';\nimport {\n getCancelSubscriptionInstructionAsync,\n getCancelSubscriptionNowInstructionAsync,\n getCloseSubscriptionAuthorityInstruction,\n getCreateFixedDelegationInstruction,\n getCreatePlanInstruction,\n getCreateRecurringDelegationInstruction,\n getDeletePlanInstruction,\n getInitSubscriptionAuthorityInstructionAsync,\n getResumeSubscriptionInstructionAsync,\n getRevokeAbandonedDelegationInstruction,\n getRevokeAbandonedSubscriptionInstruction,\n getRevokeDelegationInstruction,\n getRevokeSubscriptionAuthorityInstructionAsync,\n getSubscribeInstructionAsync,\n getTransferFixedInstructionAsync,\n getTransferRecurringInstructionAsync,\n getTransferSubscriptionInstructionAsync,\n getUpdatePlanInstructionAsync,\n parseCancelSubscriptionInstruction,\n parseCancelSubscriptionNowInstruction,\n parseCloseSubscriptionAuthorityInstruction,\n parseCreateFixedDelegationInstruction,\n parseCreatePlanInstruction,\n parseCreateRecurringDelegationInstruction,\n parseDeletePlanInstruction,\n parseInitSubscriptionAuthorityInstruction,\n parseResumeSubscriptionInstruction,\n parseRevokeAbandonedDelegationInstruction,\n parseRevokeAbandonedSubscriptionInstruction,\n parseRevokeDelegationInstruction,\n parseRevokeSubscriptionAuthorityInstruction,\n parseSubscribeInstruction,\n parseTransferFixedInstruction,\n parseTransferRecurringInstruction,\n parseTransferSubscriptionInstruction,\n parseUpdatePlanInstruction,\n type CancelSubscriptionAsyncInput,\n type CancelSubscriptionNowAsyncInput,\n type CloseSubscriptionAuthorityInput,\n type CreateFixedDelegationInput,\n type CreatePlanInput,\n type CreateRecurringDelegationInput,\n type DeletePlanInput,\n type InitSubscriptionAuthorityAsyncInput,\n type ParsedCancelSubscriptionInstruction,\n type ParsedCancelSubscriptionNowInstruction,\n type ParsedCloseSubscriptionAuthorityInstruction,\n type ParsedCreateFixedDelegationInstruction,\n type ParsedCreatePlanInstruction,\n type ParsedCreateRecurringDelegationInstruction,\n type ParsedDeletePlanInstruction,\n type ParsedInitSubscriptionAuthorityInstruction,\n type ParsedResumeSubscriptionInstruction,\n type ParsedRevokeAbandonedDelegationInstruction,\n type ParsedRevokeAbandonedSubscriptionInstruction,\n type ParsedRevokeDelegationInstruction,\n type ParsedRevokeSubscriptionAuthorityInstruction,\n type ParsedSubscribeInstruction,\n type ParsedTransferFixedInstruction,\n type ParsedTransferRecurringInstruction,\n type ParsedTransferSubscriptionInstruction,\n type ParsedUpdatePlanInstruction,\n type ResumeSubscriptionAsyncInput,\n type RevokeAbandonedDelegationInput,\n type RevokeAbandonedSubscriptionInput,\n type RevokeDelegationInput,\n type RevokeSubscriptionAuthorityAsyncInput,\n type SubscribeAsyncInput,\n type TransferFixedAsyncInput,\n type TransferRecurringAsyncInput,\n type TransferSubscriptionAsyncInput,\n type UpdatePlanAsyncInput,\n} from '../instructions';\nimport {\n findEventAuthorityPda,\n findFixedDelegationPda,\n findPlanPda,\n findRecurringDelegationPda,\n findSubscriptionAuthorityPda,\n findSubscriptionDelegationPda,\n} from '../pdas';\n\nexport const SUBSCRIPTIONS_PROGRAM_ADDRESS =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\n\nexport enum SubscriptionsAccount {\n FixedDelegation,\n Plan,\n RecurringDelegation,\n SubscriptionAuthority,\n SubscriptionDelegation,\n EventAuthority,\n}\n\nexport enum SubscriptionsInstruction {\n InitSubscriptionAuthority,\n CreateFixedDelegation,\n CreateRecurringDelegation,\n RevokeDelegation,\n TransferFixed,\n TransferRecurring,\n CloseSubscriptionAuthority,\n CreatePlan,\n UpdatePlan,\n DeletePlan,\n TransferSubscription,\n Subscribe,\n CancelSubscription,\n ResumeSubscription,\n RevokeSubscriptionAuthority,\n RevokeAbandonedDelegation,\n RevokeAbandonedSubscription,\n CancelSubscriptionNow,\n}\n\nexport function identifySubscriptionsInstruction(\n instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): SubscriptionsInstruction {\n const data = 'data' in instruction ? instruction.data : instruction;\n if (containsBytes(data, getU8Encoder().encode(0), 0)) {\n return SubscriptionsInstruction.InitSubscriptionAuthority;\n }\n if (containsBytes(data, getU8Encoder().encode(1), 0)) {\n return SubscriptionsInstruction.CreateFixedDelegation;\n }\n if (containsBytes(data, getU8Encoder().encode(2), 0)) {\n return SubscriptionsInstruction.CreateRecurringDelegation;\n }\n if (containsBytes(data, getU8Encoder().encode(3), 0)) {\n return SubscriptionsInstruction.RevokeDelegation;\n }\n if (containsBytes(data, getU8Encoder().encode(4), 0)) {\n return SubscriptionsInstruction.TransferFixed;\n }\n if (containsBytes(data, getU8Encoder().encode(5), 0)) {\n return SubscriptionsInstruction.TransferRecurring;\n }\n if (containsBytes(data, getU8Encoder().encode(6), 0)) {\n return SubscriptionsInstruction.CloseSubscriptionAuthority;\n }\n if (containsBytes(data, getU8Encoder().encode(7), 0)) {\n return SubscriptionsInstruction.CreatePlan;\n }\n if (containsBytes(data, getU8Encoder().encode(8), 0)) {\n return SubscriptionsInstruction.UpdatePlan;\n }\n if (containsBytes(data, getU8Encoder().encode(9), 0)) {\n return SubscriptionsInstruction.DeletePlan;\n }\n if (containsBytes(data, getU8Encoder().encode(10), 0)) {\n return SubscriptionsInstruction.TransferSubscription;\n }\n if (containsBytes(data, getU8Encoder().encode(11), 0)) {\n return SubscriptionsInstruction.Subscribe;\n }\n if (containsBytes(data, getU8Encoder().encode(12), 0)) {\n return SubscriptionsInstruction.CancelSubscription;\n }\n if (containsBytes(data, getU8Encoder().encode(13), 0)) {\n return SubscriptionsInstruction.ResumeSubscription;\n }\n if (containsBytes(data, getU8Encoder().encode(14), 0)) {\n return SubscriptionsInstruction.RevokeSubscriptionAuthority;\n }\n if (containsBytes(data, getU8Encoder().encode(15), 0)) {\n return SubscriptionsInstruction.RevokeAbandonedDelegation;\n }\n if (containsBytes(data, getU8Encoder().encode(16), 0)) {\n return SubscriptionsInstruction.RevokeAbandonedSubscription;\n }\n if (containsBytes(data, getU8Encoder().encode(17), 0)) {\n return SubscriptionsInstruction.CancelSubscriptionNow;\n }\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {\n instructionData: data,\n programName: 'subscriptions',\n });\n}\n\nexport type ParsedSubscriptionsInstruction<TProgram extends string = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'> =\n | ({\n instructionType: SubscriptionsInstruction.InitSubscriptionAuthority;\n } & ParsedInitSubscriptionAuthorityInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.CreateFixedDelegation;\n } & ParsedCreateFixedDelegationInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.CreateRecurringDelegation;\n } & ParsedCreateRecurringDelegationInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.RevokeDelegation } & ParsedRevokeDelegationInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.TransferFixed } & ParsedTransferFixedInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.TransferRecurring } & ParsedTransferRecurringInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.CloseSubscriptionAuthority;\n } & ParsedCloseSubscriptionAuthorityInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.CreatePlan } & ParsedCreatePlanInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.UpdatePlan } & ParsedUpdatePlanInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.DeletePlan } & ParsedDeletePlanInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.TransferSubscription;\n } & ParsedTransferSubscriptionInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.Subscribe } & ParsedSubscribeInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.CancelSubscription } & ParsedCancelSubscriptionInstruction<TProgram>)\n | ({ instructionType: SubscriptionsInstruction.ResumeSubscription } & ParsedResumeSubscriptionInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.RevokeSubscriptionAuthority;\n } & ParsedRevokeSubscriptionAuthorityInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.RevokeAbandonedDelegation;\n } & ParsedRevokeAbandonedDelegationInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.RevokeAbandonedSubscription;\n } & ParsedRevokeAbandonedSubscriptionInstruction<TProgram>)\n | ({\n instructionType: SubscriptionsInstruction.CancelSubscriptionNow;\n } & ParsedCancelSubscriptionNowInstruction<TProgram>);\n\nexport function parseSubscriptionsInstruction<TProgram extends string>(\n instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,\n): ParsedSubscriptionsInstruction<TProgram> {\n const instructionType = identifySubscriptionsInstruction(instruction);\n switch (instructionType) {\n case SubscriptionsInstruction.InitSubscriptionAuthority: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.InitSubscriptionAuthority,\n ...parseInitSubscriptionAuthorityInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CreateFixedDelegation: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CreateFixedDelegation,\n ...parseCreateFixedDelegationInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CreateRecurringDelegation: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CreateRecurringDelegation,\n ...parseCreateRecurringDelegationInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.RevokeDelegation: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.RevokeDelegation,\n ...parseRevokeDelegationInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.TransferFixed: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.TransferFixed,\n ...parseTransferFixedInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.TransferRecurring: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.TransferRecurring,\n ...parseTransferRecurringInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CloseSubscriptionAuthority: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CloseSubscriptionAuthority,\n ...parseCloseSubscriptionAuthorityInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CreatePlan: {\n assertIsInstructionWithAccounts(instruction);\n return { instructionType: SubscriptionsInstruction.CreatePlan, ...parseCreatePlanInstruction(instruction) };\n }\n case SubscriptionsInstruction.UpdatePlan: {\n assertIsInstructionWithAccounts(instruction);\n return { instructionType: SubscriptionsInstruction.UpdatePlan, ...parseUpdatePlanInstruction(instruction) };\n }\n case SubscriptionsInstruction.DeletePlan: {\n assertIsInstructionWithAccounts(instruction);\n return { instructionType: SubscriptionsInstruction.DeletePlan, ...parseDeletePlanInstruction(instruction) };\n }\n case SubscriptionsInstruction.TransferSubscription: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.TransferSubscription,\n ...parseTransferSubscriptionInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.Subscribe: {\n assertIsInstructionWithAccounts(instruction);\n return { instructionType: SubscriptionsInstruction.Subscribe, ...parseSubscribeInstruction(instruction) };\n }\n case SubscriptionsInstruction.CancelSubscription: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CancelSubscription,\n ...parseCancelSubscriptionInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.ResumeSubscription: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.ResumeSubscription,\n ...parseResumeSubscriptionInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.RevokeSubscriptionAuthority: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.RevokeSubscriptionAuthority,\n ...parseRevokeSubscriptionAuthorityInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.RevokeAbandonedDelegation: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.RevokeAbandonedDelegation,\n ...parseRevokeAbandonedDelegationInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.RevokeAbandonedSubscription: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.RevokeAbandonedSubscription,\n ...parseRevokeAbandonedSubscriptionInstruction(instruction),\n };\n }\n case SubscriptionsInstruction.CancelSubscriptionNow: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: SubscriptionsInstruction.CancelSubscriptionNow,\n ...parseCancelSubscriptionNowInstruction(instruction),\n };\n }\n default:\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {\n instructionType: instructionType as string,\n programName: 'subscriptions',\n });\n }\n}\n\nexport type SubscriptionsPlugin = {\n accounts: SubscriptionsPluginAccounts;\n instructions: SubscriptionsPluginInstructions;\n pdas: SubscriptionsPluginPdas;\n identifyInstruction: typeof identifySubscriptionsInstruction;\n parseInstruction: typeof parseSubscriptionsInstruction;\n};\n\nexport type SubscriptionsPluginAccounts = {\n fixedDelegation: ReturnType<typeof getFixedDelegationCodec> &\n SelfFetchFunctions<FixedDelegationArgs, FixedDelegation>;\n plan: ReturnType<typeof getPlanCodec> & SelfFetchFunctions<PlanArgs, Plan>;\n recurringDelegation: ReturnType<typeof getRecurringDelegationCodec> &\n SelfFetchFunctions<RecurringDelegationArgs, RecurringDelegation>;\n subscriptionAuthority: ReturnType<typeof getSubscriptionAuthorityCodec> &\n SelfFetchFunctions<SubscriptionAuthorityArgs, SubscriptionAuthority>;\n subscriptionDelegation: ReturnType<typeof getSubscriptionDelegationCodec> &\n SelfFetchFunctions<SubscriptionDelegationArgs, SubscriptionDelegation>;\n eventAuthority: ReturnType<typeof getEventAuthorityCodec> & SelfFetchFunctions<EventAuthorityArgs, EventAuthority>;\n};\n\nexport type SubscriptionsPluginInstructions = {\n initSubscriptionAuthority: (\n input: InitSubscriptionAuthorityAsyncInput,\n ) => ReturnType<typeof getInitSubscriptionAuthorityInstructionAsync> & SelfPlanAndSendFunctions;\n createFixedDelegation: (\n input: CreateFixedDelegationInput,\n ) => ReturnType<typeof getCreateFixedDelegationInstruction> & SelfPlanAndSendFunctions;\n createRecurringDelegation: (\n input: CreateRecurringDelegationInput,\n ) => ReturnType<typeof getCreateRecurringDelegationInstruction> & SelfPlanAndSendFunctions;\n revokeDelegation: (\n input: RevokeDelegationInput,\n ) => ReturnType<typeof getRevokeDelegationInstruction> & SelfPlanAndSendFunctions;\n transferFixed: (\n input: TransferFixedAsyncInput,\n ) => ReturnType<typeof getTransferFixedInstructionAsync> & SelfPlanAndSendFunctions;\n transferRecurring: (\n input: TransferRecurringAsyncInput,\n ) => ReturnType<typeof getTransferRecurringInstructionAsync> & SelfPlanAndSendFunctions;\n closeSubscriptionAuthority: (\n input: CloseSubscriptionAuthorityInput,\n ) => ReturnType<typeof getCloseSubscriptionAuthorityInstruction> & SelfPlanAndSendFunctions;\n createPlan: (input: CreatePlanInput) => ReturnType<typeof getCreatePlanInstruction> & SelfPlanAndSendFunctions;\n updatePlan: (\n input: UpdatePlanAsyncInput,\n ) => ReturnType<typeof getUpdatePlanInstructionAsync> & SelfPlanAndSendFunctions;\n deletePlan: (input: DeletePlanInput) => ReturnType<typeof getDeletePlanInstruction> & SelfPlanAndSendFunctions;\n transferSubscription: (\n input: TransferSubscriptionAsyncInput,\n ) => ReturnType<typeof getTransferSubscriptionInstructionAsync> & SelfPlanAndSendFunctions;\n subscribe: (\n input: SubscribeAsyncInput,\n ) => ReturnType<typeof getSubscribeInstructionAsync> & SelfPlanAndSendFunctions;\n cancelSubscription: (\n input: CancelSubscriptionAsyncInput,\n ) => ReturnType<typeof getCancelSubscriptionInstructionAsync> & SelfPlanAndSendFunctions;\n resumeSubscription: (\n input: ResumeSubscriptionAsyncInput,\n ) => ReturnType<typeof getResumeSubscriptionInstructionAsync> & SelfPlanAndSendFunctions;\n revokeSubscriptionAuthority: (\n input: RevokeSubscriptionAuthorityAsyncInput,\n ) => ReturnType<typeof getRevokeSubscriptionAuthorityInstructionAsync> & SelfPlanAndSendFunctions;\n revokeAbandonedDelegation: (\n input: RevokeAbandonedDelegationInput,\n ) => ReturnType<typeof getRevokeAbandonedDelegationInstruction> & SelfPlanAndSendFunctions;\n revokeAbandonedSubscription: (\n input: RevokeAbandonedSubscriptionInput,\n ) => ReturnType<typeof getRevokeAbandonedSubscriptionInstruction> & SelfPlanAndSendFunctions;\n cancelSubscriptionNow: (\n input: CancelSubscriptionNowAsyncInput,\n ) => ReturnType<typeof getCancelSubscriptionNowInstructionAsync> & SelfPlanAndSendFunctions;\n};\n\nexport type SubscriptionsPluginPdas = {\n fixedDelegation: typeof findFixedDelegationPda;\n plan: typeof findPlanPda;\n recurringDelegation: typeof findRecurringDelegationPda;\n subscriptionAuthority: typeof findSubscriptionAuthorityPda;\n subscriptionDelegation: typeof findSubscriptionDelegationPda;\n eventAuthority: typeof findEventAuthorityPda;\n};\n\nexport type SubscriptionsPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> &\n ClientWithTransactionPlanning &\n ClientWithTransactionSending;\n\nexport function subscriptionsProgram() {\n return <T extends SubscriptionsPluginRequirements>(\n client: T,\n ): ExtendedClient<T, { subscriptions: SubscriptionsPlugin }> => {\n return extendClient(client, {\n subscriptions: <SubscriptionsPlugin>{\n accounts: {\n fixedDelegation: addSelfFetchFunctions(client, getFixedDelegationCodec()),\n plan: addSelfFetchFunctions(client, getPlanCodec()),\n recurringDelegation: addSelfFetchFunctions(client, getRecurringDelegationCodec()),\n subscriptionAuthority: addSelfFetchFunctions(client, getSubscriptionAuthorityCodec()),\n subscriptionDelegation: addSelfFetchFunctions(client, getSubscriptionDelegationCodec()),\n eventAuthority: addSelfFetchFunctions(client, getEventAuthorityCodec()),\n },\n instructions: {\n initSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(client, getInitSubscriptionAuthorityInstructionAsync(input)),\n createFixedDelegation: input =>\n addSelfPlanAndSendFunctions(client, getCreateFixedDelegationInstruction(input)),\n createRecurringDelegation: input =>\n addSelfPlanAndSendFunctions(client, getCreateRecurringDelegationInstruction(input)),\n revokeDelegation: input =>\n addSelfPlanAndSendFunctions(client, getRevokeDelegationInstruction(input)),\n transferFixed: input =>\n addSelfPlanAndSendFunctions(client, getTransferFixedInstructionAsync(input)),\n transferRecurring: input =>\n addSelfPlanAndSendFunctions(client, getTransferRecurringInstructionAsync(input)),\n closeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(client, getCloseSubscriptionAuthorityInstruction(input)),\n createPlan: input => addSelfPlanAndSendFunctions(client, getCreatePlanInstruction(input)),\n updatePlan: input => addSelfPlanAndSendFunctions(client, getUpdatePlanInstructionAsync(input)),\n deletePlan: input => addSelfPlanAndSendFunctions(client, getDeletePlanInstruction(input)),\n transferSubscription: input =>\n addSelfPlanAndSendFunctions(client, getTransferSubscriptionInstructionAsync(input)),\n subscribe: input => addSelfPlanAndSendFunctions(client, getSubscribeInstructionAsync(input)),\n cancelSubscription: input =>\n addSelfPlanAndSendFunctions(client, getCancelSubscriptionInstructionAsync(input)),\n resumeSubscription: input =>\n addSelfPlanAndSendFunctions(client, getResumeSubscriptionInstructionAsync(input)),\n revokeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(client, getRevokeSubscriptionAuthorityInstructionAsync(input)),\n revokeAbandonedDelegation: input =>\n addSelfPlanAndSendFunctions(client, getRevokeAbandonedDelegationInstruction(input)),\n revokeAbandonedSubscription: input =>\n addSelfPlanAndSendFunctions(client, getRevokeAbandonedSubscriptionInstruction(input)),\n cancelSubscriptionNow: input =>\n addSelfPlanAndSendFunctions(client, getCancelSubscriptionNowInstructionAsync(input)),\n },\n pdas: {\n fixedDelegation: findFixedDelegationPda,\n plan: findPlanPda,\n recurringDelegation: findRecurringDelegationPda,\n subscriptionAuthority: findSubscriptionAuthorityPda,\n subscriptionDelegation: findSubscriptionDelegationPda,\n eventAuthority: findEventAuthorityPda,\n },\n identifyInstruction: identifySubscriptionsInstruction,\n parseInstruction: parseSubscriptionsInstruction,\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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionDelegationPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const CANCEL_SUBSCRIPTION_DISCRIMINATOR = 12;\n\nexport function getCancelSubscriptionDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CANCEL_SUBSCRIPTION_DISCRIMINATOR);\n}\n\nexport type CancelSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriber extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriber extends string\n ? ReadonlySignerAccount<TAccountSubscriber> & AccountSignerMeta<TAccountSubscriber>\n : TAccountSubscriber,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CancelSubscriptionInstructionData = { discriminator: number };\n\nexport type CancelSubscriptionInstructionDataArgs = {};\n\nexport function getCancelSubscriptionInstructionDataEncoder(): FixedSizeEncoder<CancelSubscriptionInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: CANCEL_SUBSCRIPTION_DISCRIMINATOR,\n }));\n}\n\nexport function getCancelSubscriptionInstructionDataDecoder(): FixedSizeDecoder<CancelSubscriptionInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getCancelSubscriptionInstructionDataCodec(): FixedSizeCodec<\n CancelSubscriptionInstructionDataArgs,\n CancelSubscriptionInstructionData\n> {\n return combineCodec(getCancelSubscriptionInstructionDataEncoder(), getCancelSubscriptionInstructionDataDecoder());\n}\n\nexport type CancelSubscriptionAsyncInput<\n TAccountSubscriber extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber cancelling the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being cancelled */\n subscriptionPda?: Address<TAccountSubscriptionPda>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n};\n\nexport async function getCancelSubscriptionInstructionAsync<\n TAccountSubscriber extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CancelSubscriptionAsyncInput<\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CancelSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.subscriptionPda.value) {\n accounts.subscriptionPda.value = await findSubscriptionDelegationPda({\n planPda: getAddressFromResolvedInstructionAccount('planPda', accounts.planPda.value),\n subscriber: getAddressFromResolvedInstructionAccount('subscriber', accounts.subscriber.value),\n });\n }\n if (!accounts.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getCancelSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as CancelSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type CancelSubscriptionInput<\n TAccountSubscriber extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber cancelling the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being cancelled */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n};\n\nexport function getCancelSubscriptionInstruction<\n TAccountSubscriber extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CancelSubscriptionInput<\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CancelSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getCancelSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as CancelSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedCancelSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscriber cancelling the subscription */\n subscriber: TAccountMetas[0];\n /** The plan PDA for the subscription */\n planPda: TAccountMetas[1];\n /** The subscription PDA being cancelled */\n subscriptionPda: TAccountMetas[2];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[3];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[4];\n };\n data: CancelSubscriptionInstructionData;\n};\n\nexport function parseCancelSubscriptionInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCancelSubscriptionInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 subscriber: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionPda: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getCancelSubscriptionInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionDelegationPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport {\n getCancelSubscriptionNowDataDecoder,\n getCancelSubscriptionNowDataEncoder,\n type CancelSubscriptionNowData,\n type CancelSubscriptionNowDataArgs,\n} from '../types';\n\nexport const CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR = 17;\n\nexport function getCancelSubscriptionNowDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR);\n}\n\nexport type CancelSubscriptionNowInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriber extends string | AccountMeta<string> = string,\n TAccountMerchant extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriber extends string\n ? ReadonlySignerAccount<TAccountSubscriber> & AccountSignerMeta<TAccountSubscriber>\n : TAccountSubscriber,\n TAccountMerchant extends string\n ? ReadonlySignerAccount<TAccountMerchant> & AccountSignerMeta<TAccountMerchant>\n : TAccountMerchant,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CancelSubscriptionNowInstructionData = {\n discriminator: number;\n cancelSubscriptionNowData: CancelSubscriptionNowData;\n};\n\nexport type CancelSubscriptionNowInstructionDataArgs = { cancelSubscriptionNowData: CancelSubscriptionNowDataArgs };\n\nexport function getCancelSubscriptionNowInstructionDataEncoder(): FixedSizeEncoder<CancelSubscriptionNowInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['cancelSubscriptionNowData', getCancelSubscriptionNowDataEncoder()],\n ]),\n value => ({ ...value, discriminator: CANCEL_SUBSCRIPTION_NOW_DISCRIMINATOR }),\n );\n}\n\nexport function getCancelSubscriptionNowInstructionDataDecoder(): FixedSizeDecoder<CancelSubscriptionNowInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['cancelSubscriptionNowData', getCancelSubscriptionNowDataDecoder()],\n ]);\n}\n\nexport function getCancelSubscriptionNowInstructionDataCodec(): FixedSizeCodec<\n CancelSubscriptionNowInstructionDataArgs,\n CancelSubscriptionNowInstructionData\n> {\n return combineCodec(\n getCancelSubscriptionNowInstructionDataEncoder(),\n getCancelSubscriptionNowInstructionDataDecoder(),\n );\n}\n\nexport type CancelSubscriptionNowAsyncInput<\n TAccountSubscriber extends string = string,\n TAccountMerchant extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber cancelling the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The owner of the subscription plan approving immediate cancellation */\n merchant: TransactionSigner<TAccountMerchant>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being cancelled immediately */\n subscriptionPda?: Address<TAccountSubscriptionPda>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n cancelSubscriptionNowData: CancelSubscriptionNowInstructionDataArgs['cancelSubscriptionNowData'];\n};\n\nexport async function getCancelSubscriptionNowInstructionAsync<\n TAccountSubscriber extends string,\n TAccountMerchant extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CancelSubscriptionNowAsyncInput<\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CancelSubscriptionNowInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n merchant: { value: input.merchant ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.subscriptionPda.value) {\n accounts.subscriptionPda.value = await findSubscriptionDelegationPda({\n planPda: getAddressFromResolvedInstructionAccount('planPda', accounts.planPda.value),\n subscriber: getAddressFromResolvedInstructionAccount('subscriber', accounts.subscriber.value),\n });\n }\n if (!accounts.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('merchant', accounts.merchant),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getCancelSubscriptionNowInstructionDataEncoder().encode(args as CancelSubscriptionNowInstructionDataArgs),\n programAddress,\n } as CancelSubscriptionNowInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type CancelSubscriptionNowInput<\n TAccountSubscriber extends string = string,\n TAccountMerchant extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber cancelling the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The owner of the subscription plan approving immediate cancellation */\n merchant: TransactionSigner<TAccountMerchant>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being cancelled immediately */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n cancelSubscriptionNowData: CancelSubscriptionNowInstructionDataArgs['cancelSubscriptionNowData'];\n};\n\nexport function getCancelSubscriptionNowInstruction<\n TAccountSubscriber extends string,\n TAccountMerchant extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CancelSubscriptionNowInput<\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CancelSubscriptionNowInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n merchant: { value: input.merchant ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('merchant', accounts.merchant),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getCancelSubscriptionNowInstructionDataEncoder().encode(args as CancelSubscriptionNowInstructionDataArgs),\n programAddress,\n } as CancelSubscriptionNowInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedCancelSubscriptionNowInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscriber cancelling the subscription */\n subscriber: TAccountMetas[0];\n /** The owner of the subscription plan approving immediate cancellation */\n merchant: TAccountMetas[1];\n /** The plan PDA for the subscription */\n planPda: TAccountMetas[2];\n /** The subscription PDA being cancelled immediately */\n subscriptionPda: TAccountMetas[3];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[4];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[5];\n };\n data: CancelSubscriptionNowInstructionData;\n};\n\nexport function parseCancelSubscriptionNowInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCancelSubscriptionNowInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 6) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 6,\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 subscriber: getNextAccount(),\n merchant: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionPda: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getCancelSubscriptionNowInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 6;\n\nexport function getCloseSubscriptionAuthorityDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);\n}\n\nexport type CloseSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountUser extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountReceiver extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountUser extends string\n ? WritableSignerAccount<TAccountUser> & AccountSignerMeta<TAccountUser>\n : TAccountUser,\n TAccountSubscriptionAuthority extends string\n ? WritableAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n ...(TAccountReceiver extends undefined\n ? []\n : [TAccountReceiver extends string ? WritableAccount<TAccountReceiver> : TAccountReceiver]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CloseSubscriptionAuthorityInstructionData = { discriminator: number };\n\nexport type CloseSubscriptionAuthorityInstructionDataArgs = {};\n\nexport function getCloseSubscriptionAuthorityInstructionDataEncoder(): FixedSizeEncoder<CloseSubscriptionAuthorityInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: CLOSE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,\n }));\n}\n\nexport function getCloseSubscriptionAuthorityInstructionDataDecoder(): FixedSizeDecoder<CloseSubscriptionAuthorityInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getCloseSubscriptionAuthorityInstructionDataCodec(): FixedSizeCodec<\n CloseSubscriptionAuthorityInstructionDataArgs,\n CloseSubscriptionAuthorityInstructionData\n> {\n return combineCodec(\n getCloseSubscriptionAuthorityInstructionDataEncoder(),\n getCloseSubscriptionAuthorityInstructionDataDecoder(),\n );\n}\n\nexport type CloseSubscriptionAuthorityInput<\n TAccountUser extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountReceiver extends string = string,\n> = {\n /** The user who owns the SubscriptionAuthority PDA (receives rent) */\n user: TransactionSigner<TAccountUser>;\n /** The SubscriptionAuthority PDA to close */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** Optional rent recipient, required when the recorded payer differs from the user. Must match the stored payer. */\n receiver?: Address<TAccountReceiver>;\n};\n\nexport function getCloseSubscriptionAuthorityInstruction<\n TAccountUser extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountReceiver extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CloseSubscriptionAuthorityInput<TAccountUser, TAccountSubscriptionAuthority, TAccountReceiver>,\n config?: { programAddress?: TProgramAddress },\n): CloseSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n user: { value: input.user ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n receiver: { value: input.receiver ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('user', accounts.user),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('receiver', accounts.receiver),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getCloseSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as CloseSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >);\n}\n\nexport type ParsedCloseSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The user who owns the SubscriptionAuthority PDA (receives rent) */\n user: TAccountMetas[0];\n /** The SubscriptionAuthority PDA to close */\n subscriptionAuthority: TAccountMetas[1];\n /** Optional rent recipient, required when the recorded payer differs from the user. Must match the stored payer. */\n receiver?: TAccountMetas[2] | undefined;\n };\n data: CloseSubscriptionAuthorityInstructionData;\n};\n\nexport function parseCloseSubscriptionAuthorityInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCloseSubscriptionAuthorityInstruction<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 let optionalAccountsRemaining = instruction.accounts.length - 2;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n user: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n receiver: getNextOptionalAccount(),\n },\n data: getCloseSubscriptionAuthorityInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport {\n getCreateFixedDelegationDataDecoder,\n getCreateFixedDelegationDataEncoder,\n type CreateFixedDelegationData,\n type CreateFixedDelegationDataArgs,\n} from '../types';\n\nexport const CREATE_FIXED_DELEGATION_DISCRIMINATOR = 1;\n\nexport function getCreateFixedDelegationDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CREATE_FIXED_DELEGATION_DISCRIMINATOR);\n}\n\nexport type CreateFixedDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountDelegator extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegationAccount extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountDelegator extends string\n ? WritableSignerAccount<TAccountDelegator> & AccountSignerMeta<TAccountDelegator>\n : TAccountDelegator,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegationAccount extends string\n ? WritableAccount<TAccountDelegationAccount>\n : TAccountDelegationAccount,\n TAccountDelegatee extends string ? ReadonlyAccount<TAccountDelegatee> : TAccountDelegatee,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateFixedDelegationInstructionData = {\n discriminator: number;\n fixedDelegation: CreateFixedDelegationData;\n};\n\nexport type CreateFixedDelegationInstructionDataArgs = { fixedDelegation: CreateFixedDelegationDataArgs };\n\nexport function getCreateFixedDelegationInstructionDataEncoder(): FixedSizeEncoder<CreateFixedDelegationInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['fixedDelegation', getCreateFixedDelegationDataEncoder()],\n ]),\n value => ({ ...value, discriminator: CREATE_FIXED_DELEGATION_DISCRIMINATOR }),\n );\n}\n\nexport function getCreateFixedDelegationInstructionDataDecoder(): FixedSizeDecoder<CreateFixedDelegationInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['fixedDelegation', getCreateFixedDelegationDataDecoder()],\n ]);\n}\n\nexport function getCreateFixedDelegationInstructionDataCodec(): FixedSizeCodec<\n CreateFixedDelegationInstructionDataArgs,\n CreateFixedDelegationInstructionData\n> {\n return combineCodec(\n getCreateFixedDelegationInstructionDataEncoder(),\n getCreateFixedDelegationInstructionDataDecoder(),\n );\n}\n\nexport type CreateFixedDelegationInput<\n TAccountDelegator extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegationAccount extends string = string,\n TAccountDelegatee extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The user creating the delegation */\n delegator: TransactionSigner<TAccountDelegator>;\n /** The subscription_authority PDA for this token */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The fixed delegation PDA being created */\n delegationAccount: Address<TAccountDelegationAccount>;\n /** The user receiving delegation rights */\n delegatee: Address<TAccountDelegatee>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the delegator/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n fixedDelegation: CreateFixedDelegationInstructionDataArgs['fixedDelegation'];\n};\n\nexport function getCreateFixedDelegationInstruction<\n TAccountDelegator extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegationAccount extends string,\n TAccountDelegatee extends string,\n TAccountSystemProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CreateFixedDelegationInput<\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateFixedDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegator: { value: input.delegator ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\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 // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegator', accounts.delegator),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegationAccount', accounts.delegationAccount),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getCreateFixedDelegationInstructionDataEncoder().encode(args as CreateFixedDelegationInstructionDataArgs),\n programAddress,\n } as CreateFixedDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedCreateFixedDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The user creating the delegation */\n delegator: TAccountMetas[0];\n /** The subscription_authority PDA for this token */\n subscriptionAuthority: TAccountMetas[1];\n /** The fixed delegation PDA being created */\n delegationAccount: TAccountMetas[2];\n /** The user receiving delegation rights */\n delegatee: TAccountMetas[3];\n /** The system program */\n systemProgram: TAccountMetas[4];\n /** Optional sponsor that funds the account rent. Defaults to the delegator/signer when omitted. */\n payer?: TAccountMetas[5] | undefined;\n };\n data: CreateFixedDelegationInstructionData;\n};\n\nexport function parseCreateFixedDelegationInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateFixedDelegationInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 let optionalAccountsRemaining = instruction.accounts.length - 5;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n delegator: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegationAccount: getNextAccount(),\n delegatee: getNextAccount(),\n systemProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getCreateFixedDelegationInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getPlanDataDecoder, getPlanDataEncoder, type PlanData, type PlanDataArgs } from '../types';\n\nexport const CREATE_PLAN_DISCRIMINATOR = 7;\n\nexport function getCreatePlanDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CREATE_PLAN_DISCRIMINATOR);\n}\n\nexport type CreatePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMerchant extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountTokenProgram extends string | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountMerchant extends string\n ? WritableSignerAccount<TAccountMerchant> & AccountSignerMeta<TAccountMerchant>\n : TAccountMerchant,\n TAccountPlanPda extends string ? WritableAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreatePlanInstructionData = { discriminator: number; planData: PlanData };\n\nexport type CreatePlanInstructionDataArgs = { planData: PlanDataArgs };\n\nexport function getCreatePlanInstructionDataEncoder(): FixedSizeEncoder<CreatePlanInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['planData', getPlanDataEncoder()],\n ]),\n value => ({ ...value, discriminator: CREATE_PLAN_DISCRIMINATOR }),\n );\n}\n\nexport function getCreatePlanInstructionDataDecoder(): FixedSizeDecoder<CreatePlanInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['planData', getPlanDataDecoder()],\n ]);\n}\n\nexport function getCreatePlanInstructionDataCodec(): FixedSizeCodec<\n CreatePlanInstructionDataArgs,\n CreatePlanInstructionData\n> {\n return combineCodec(getCreatePlanInstructionDataEncoder(), getCreatePlanInstructionDataDecoder());\n}\n\nexport type CreatePlanInput<\n TAccountMerchant extends string = string,\n TAccountPlanPda extends string = string,\n TAccountTokenMint extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The merchant creating the plan */\n merchant: TransactionSigner<TAccountMerchant>;\n /** The plan PDA being created */\n planPda: Address<TAccountPlanPda>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** The token program */\n tokenProgram?: Address<TAccountTokenProgram>;\n /** Optional sponsor that funds the plan rent. Defaults to the merchant/signer when omitted; delete_plan refunds the owner, not the payer. */\n payer?: TransactionSigner<TAccountPayer>;\n planData: CreatePlanInstructionDataArgs['planData'];\n};\n\nexport function getCreatePlanInstruction<\n TAccountMerchant extends string,\n TAccountPlanPda extends string,\n TAccountTokenMint extends string,\n TAccountSystemProgram extends string,\n TAccountTokenProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CreatePlanInput<\n TAccountMerchant,\n TAccountPlanPda,\n TAccountTokenMint,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): CreatePlanInstruction<\n TProgramAddress,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountTokenMint,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n merchant: { value: input.merchant ?? null, isWritable: true },\n planPda: { value: input.planPda ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? 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 // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('merchant', accounts.merchant),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getCreatePlanInstructionDataEncoder().encode(args as CreatePlanInstructionDataArgs),\n programAddress,\n } as CreatePlanInstruction<\n TProgramAddress,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountTokenMint,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedCreatePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The merchant creating the plan */\n merchant: TAccountMetas[0];\n /** The plan PDA being created */\n planPda: TAccountMetas[1];\n /** The token mint */\n tokenMint: TAccountMetas[2];\n /** The system program */\n systemProgram: TAccountMetas[3];\n /** The token program */\n tokenProgram: TAccountMetas[4];\n /** Optional sponsor that funds the plan rent. Defaults to the merchant/signer when omitted; delete_plan refunds the owner, not the payer. */\n payer?: TAccountMetas[5] | undefined;\n };\n data: CreatePlanInstructionData;\n};\n\nexport function parseCreatePlanInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreatePlanInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 let optionalAccountsRemaining = instruction.accounts.length - 5;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n merchant: getNextAccount(),\n planPda: getNextAccount(),\n tokenMint: getNextAccount(),\n systemProgram: getNextAccount(),\n tokenProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getCreatePlanInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport {\n getCreateRecurringDelegationDataDecoder,\n getCreateRecurringDelegationDataEncoder,\n type CreateRecurringDelegationData,\n type CreateRecurringDelegationDataArgs,\n} from '../types';\n\nexport const CREATE_RECURRING_DELEGATION_DISCRIMINATOR = 2;\n\nexport function getCreateRecurringDelegationDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(CREATE_RECURRING_DELEGATION_DISCRIMINATOR);\n}\n\nexport type CreateRecurringDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountDelegator extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegationAccount extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountDelegator extends string\n ? WritableSignerAccount<TAccountDelegator> & AccountSignerMeta<TAccountDelegator>\n : TAccountDelegator,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegationAccount extends string\n ? WritableAccount<TAccountDelegationAccount>\n : TAccountDelegationAccount,\n TAccountDelegatee extends string ? ReadonlyAccount<TAccountDelegatee> : TAccountDelegatee,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateRecurringDelegationInstructionData = {\n discriminator: number;\n recurringDelegation: CreateRecurringDelegationData;\n};\n\nexport type CreateRecurringDelegationInstructionDataArgs = { recurringDelegation: CreateRecurringDelegationDataArgs };\n\nexport function getCreateRecurringDelegationInstructionDataEncoder(): FixedSizeEncoder<CreateRecurringDelegationInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['recurringDelegation', getCreateRecurringDelegationDataEncoder()],\n ]),\n value => ({ ...value, discriminator: CREATE_RECURRING_DELEGATION_DISCRIMINATOR }),\n );\n}\n\nexport function getCreateRecurringDelegationInstructionDataDecoder(): FixedSizeDecoder<CreateRecurringDelegationInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['recurringDelegation', getCreateRecurringDelegationDataDecoder()],\n ]);\n}\n\nexport function getCreateRecurringDelegationInstructionDataCodec(): FixedSizeCodec<\n CreateRecurringDelegationInstructionDataArgs,\n CreateRecurringDelegationInstructionData\n> {\n return combineCodec(\n getCreateRecurringDelegationInstructionDataEncoder(),\n getCreateRecurringDelegationInstructionDataDecoder(),\n );\n}\n\nexport type CreateRecurringDelegationInput<\n TAccountDelegator extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegationAccount extends string = string,\n TAccountDelegatee extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The user creating the delegation */\n delegator: TransactionSigner<TAccountDelegator>;\n /** The subscription_authority PDA for this token */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The recurring delegation PDA being created */\n delegationAccount: Address<TAccountDelegationAccount>;\n /** The user receiving delegation rights */\n delegatee: Address<TAccountDelegatee>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the delegator/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n recurringDelegation: CreateRecurringDelegationInstructionDataArgs['recurringDelegation'];\n};\n\nexport function getCreateRecurringDelegationInstruction<\n TAccountDelegator extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegationAccount extends string,\n TAccountDelegatee extends string,\n TAccountSystemProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CreateRecurringDelegationInput<\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateRecurringDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegator: { value: input.delegator ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\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 // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegator', accounts.delegator),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegationAccount', accounts.delegationAccount),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getCreateRecurringDelegationInstructionDataEncoder().encode(\n args as CreateRecurringDelegationInstructionDataArgs,\n ),\n programAddress,\n } as CreateRecurringDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedCreateRecurringDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The user creating the delegation */\n delegator: TAccountMetas[0];\n /** The subscription_authority PDA for this token */\n subscriptionAuthority: TAccountMetas[1];\n /** The recurring delegation PDA being created */\n delegationAccount: TAccountMetas[2];\n /** The user receiving delegation rights */\n delegatee: TAccountMetas[3];\n /** The system program */\n systemProgram: TAccountMetas[4];\n /** Optional sponsor that funds the account rent. Defaults to the delegator/signer when omitted. */\n payer?: TAccountMetas[5] | undefined;\n };\n data: CreateRecurringDelegationInstructionData;\n};\n\nexport function parseCreateRecurringDelegationInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateRecurringDelegationInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 let optionalAccountsRemaining = instruction.accounts.length - 5;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n delegator: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegationAccount: getNextAccount(),\n delegatee: getNextAccount(),\n systemProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getCreateRecurringDelegationInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const DELETE_PLAN_DISCRIMINATOR = 9;\n\nexport function getDeletePlanDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(DELETE_PLAN_DISCRIMINATOR);\n}\n\nexport type DeletePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountOwner extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountOwner extends string\n ? WritableSignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner>\n : TAccountOwner,\n TAccountPlanPda extends string ? WritableAccount<TAccountPlanPda> : TAccountPlanPda,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type DeletePlanInstructionData = { discriminator: number };\n\nexport type DeletePlanInstructionDataArgs = {};\n\nexport function getDeletePlanInstructionDataEncoder(): FixedSizeEncoder<DeletePlanInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: DELETE_PLAN_DISCRIMINATOR,\n }));\n}\n\nexport function getDeletePlanInstructionDataDecoder(): FixedSizeDecoder<DeletePlanInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getDeletePlanInstructionDataCodec(): FixedSizeCodec<\n DeletePlanInstructionDataArgs,\n DeletePlanInstructionData\n> {\n return combineCodec(getDeletePlanInstructionDataEncoder(), getDeletePlanInstructionDataDecoder());\n}\n\nexport type DeletePlanInput<TAccountOwner extends string = string, TAccountPlanPda extends string = string> = {\n /** The plan owner deleting the plan (receives rent) */\n owner: TransactionSigner<TAccountOwner>;\n /** The plan PDA being deleted */\n planPda: Address<TAccountPlanPda>;\n};\n\nexport function getDeletePlanInstruction<\n TAccountOwner extends string,\n TAccountPlanPda extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: DeletePlanInput<TAccountOwner, TAccountPlanPda>,\n config?: { programAddress?: TProgramAddress },\n): DeletePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: true },\n planPda: { value: input.planPda ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [getAccountMeta('owner', accounts.owner), getAccountMeta('planPda', accounts.planPda)],\n data: getDeletePlanInstructionDataEncoder().encode({}),\n programAddress,\n } as DeletePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda>);\n}\n\nexport type ParsedDeletePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The plan owner deleting the plan (receives rent) */\n owner: TAccountMetas[0];\n /** The plan PDA being deleted */\n planPda: TAccountMetas[1];\n };\n data: DeletePlanInstructionData;\n};\n\nexport function parseDeletePlanInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedDeletePlanInstruction<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: { owner: getNextAccount(), planPda: getNextAccount() },\n data: getDeletePlanInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionAuthorityPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 0;\n\nexport function getInitSubscriptionAuthorityDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);\n}\n\nexport type InitSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountOwner extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountUserAta extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountOwner extends string\n ? WritableSignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner>\n : TAccountOwner,\n TAccountSubscriptionAuthority extends string\n ? WritableAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountUserAta extends string ? WritableAccount<TAccountUserAta> : TAccountUserAta,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitSubscriptionAuthorityInstructionData = { discriminator: number };\n\nexport type InitSubscriptionAuthorityInstructionDataArgs = {};\n\nexport function getInitSubscriptionAuthorityInstructionDataEncoder(): FixedSizeEncoder<InitSubscriptionAuthorityInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: INIT_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,\n }));\n}\n\nexport function getInitSubscriptionAuthorityInstructionDataDecoder(): FixedSizeDecoder<InitSubscriptionAuthorityInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getInitSubscriptionAuthorityInstructionDataCodec(): FixedSizeCodec<\n InitSubscriptionAuthorityInstructionDataArgs,\n InitSubscriptionAuthorityInstructionData\n> {\n return combineCodec(\n getInitSubscriptionAuthorityInstructionDataEncoder(),\n getInitSubscriptionAuthorityInstructionDataDecoder(),\n );\n}\n\nexport type InitSubscriptionAuthorityAsyncInput<\n TAccountOwner extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountTokenMint extends string = string,\n TAccountUserAta extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The owner of the subscription-authority program */\n owner: TransactionSigner<TAccountOwner>;\n /** The subscription_authority PDA that will be the delegate instance for this token */\n subscriptionAuthority?: Address<TAccountSubscriptionAuthority>;\n /** The token mint that we are creating a subscription-authority account for */\n tokenMint: Address<TAccountTokenMint>;\n /** The ata that we are setting up delegation for */\n userAta: Address<TAccountUserAta>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the owner/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n};\n\nexport async function getInitSubscriptionAuthorityInstructionAsync<\n TAccountOwner extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountTokenMint extends string,\n TAccountUserAta extends string,\n TAccountSystemProgram extends string,\n TAccountTokenProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: InitSubscriptionAuthorityAsyncInput<\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n userAta: { value: input.userAta ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.subscriptionAuthority.value) {\n accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda({\n user: getAddressFromResolvedInstructionAccount('owner', accounts.owner.value),\n tokenMint: getAddressFromResolvedInstructionAccount('tokenMint', accounts.tokenMint.value),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('owner', accounts.owner),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('userAta', accounts.userAta),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getInitSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >);\n}\n\nexport type InitSubscriptionAuthorityInput<\n TAccountOwner extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountTokenMint extends string = string,\n TAccountUserAta extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The owner of the subscription-authority program */\n owner: TransactionSigner<TAccountOwner>;\n /** The subscription_authority PDA that will be the delegate instance for this token */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The token mint that we are creating a subscription-authority account for */\n tokenMint: Address<TAccountTokenMint>;\n /** The ata that we are setting up delegation for */\n userAta: Address<TAccountUserAta>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the owner/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n};\n\nexport function getInitSubscriptionAuthorityInstruction<\n TAccountOwner extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountTokenMint extends string,\n TAccountUserAta extends string,\n TAccountSystemProgram extends string,\n TAccountTokenProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: InitSubscriptionAuthorityInput<\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n userAta: { value: input.userAta ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('owner', accounts.owner),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('userAta', accounts.userAta),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getInitSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedInitSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The owner of the subscription-authority program */\n owner: TAccountMetas[0];\n /** The subscription_authority PDA that will be the delegate instance for this token */\n subscriptionAuthority: TAccountMetas[1];\n /** The token mint that we are creating a subscription-authority account for */\n tokenMint: TAccountMetas[2];\n /** The ata that we are setting up delegation for */\n userAta: TAccountMetas[3];\n /** The system program */\n systemProgram: TAccountMetas[4];\n /** Token program */\n tokenProgram: TAccountMetas[5];\n /** Optional sponsor that funds the account rent. Defaults to the owner/signer when omitted. */\n payer?: TAccountMetas[6] | undefined;\n };\n data: InitSubscriptionAuthorityInstructionData;\n};\n\nexport function parseInitSubscriptionAuthorityInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitSubscriptionAuthorityInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 6) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 6,\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 let optionalAccountsRemaining = instruction.accounts.length - 6;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n owner: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n tokenMint: getNextAccount(),\n userAta: getNextAccount(),\n systemProgram: getNextAccount(),\n tokenProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getInitSubscriptionAuthorityInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionDelegationPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getResumeDataDecoder, getResumeDataEncoder, type ResumeData, type ResumeDataArgs } from '../types';\n\nexport const RESUME_SUBSCRIPTION_DISCRIMINATOR = 13;\n\nexport function getResumeSubscriptionDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(RESUME_SUBSCRIPTION_DISCRIMINATOR);\n}\n\nexport type ResumeSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriber extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriber extends string\n ? ReadonlySignerAccount<TAccountSubscriber> & AccountSignerMeta<TAccountSubscriber>\n : TAccountSubscriber,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ResumeSubscriptionInstructionData = { discriminator: number; resumeData: ResumeData };\n\nexport type ResumeSubscriptionInstructionDataArgs = { resumeData: ResumeDataArgs };\n\nexport function getResumeSubscriptionInstructionDataEncoder(): FixedSizeEncoder<ResumeSubscriptionInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['resumeData', getResumeDataEncoder()],\n ]),\n value => ({ ...value, discriminator: RESUME_SUBSCRIPTION_DISCRIMINATOR }),\n );\n}\n\nexport function getResumeSubscriptionInstructionDataDecoder(): FixedSizeDecoder<ResumeSubscriptionInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['resumeData', getResumeDataDecoder()],\n ]);\n}\n\nexport function getResumeSubscriptionInstructionDataCodec(): FixedSizeCodec<\n ResumeSubscriptionInstructionDataArgs,\n ResumeSubscriptionInstructionData\n> {\n return combineCodec(getResumeSubscriptionInstructionDataEncoder(), getResumeSubscriptionInstructionDataDecoder());\n}\n\nexport type ResumeSubscriptionAsyncInput<\n TAccountSubscriber extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber resuming the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being resumed */\n subscriptionPda?: Address<TAccountSubscriptionPda>;\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n resumeData: ResumeSubscriptionInstructionDataArgs['resumeData'];\n};\n\nexport async function getResumeSubscriptionInstructionAsync<\n TAccountSubscriber extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: ResumeSubscriptionAsyncInput<\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.subscriptionPda.value) {\n accounts.subscriptionPda.value = await findSubscriptionDelegationPda({\n planPda: getAddressFromResolvedInstructionAccount('planPda', accounts.planPda.value),\n subscriber: getAddressFromResolvedInstructionAccount('subscriber', accounts.subscriber.value),\n });\n }\n if (!accounts.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getResumeSubscriptionInstructionDataEncoder().encode(args as ResumeSubscriptionInstructionDataArgs),\n programAddress,\n } as ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ResumeSubscriptionInput<\n TAccountSubscriber extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscriber resuming the subscription */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The plan PDA for the subscription */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being resumed */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n resumeData: ResumeSubscriptionInstructionDataArgs['resumeData'];\n};\n\nexport function getResumeSubscriptionInstruction<\n TAccountSubscriber extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: ResumeSubscriptionInput<\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getResumeSubscriptionInstructionDataEncoder().encode(args as ResumeSubscriptionInstructionDataArgs),\n programAddress,\n } as ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthority,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedResumeSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscriber resuming the subscription */\n subscriber: TAccountMetas[0];\n /** The plan PDA for the subscription */\n planPda: TAccountMetas[1];\n /** The subscription PDA being resumed */\n subscriptionPda: TAccountMetas[2];\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthority: TAccountMetas[3];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[4];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[5];\n };\n data: ResumeSubscriptionInstructionData;\n};\n\nexport function parseResumeSubscriptionInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedResumeSubscriptionInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 6) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 6,\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 subscriber: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getResumeSubscriptionInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR = 15;\n\nexport function getRevokeAbandonedDelegationDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR);\n}\n\nexport type RevokeAbandonedDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountDelegationAccount extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountDelegationAccount extends string\n ? WritableAccount<TAccountDelegationAccount>\n : TAccountDelegationAccount,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevokeAbandonedDelegationInstructionData = { discriminator: number };\n\nexport type RevokeAbandonedDelegationInstructionDataArgs = {};\n\nexport function getRevokeAbandonedDelegationInstructionDataEncoder(): FixedSizeEncoder<RevokeAbandonedDelegationInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: REVOKE_ABANDONED_DELEGATION_DISCRIMINATOR,\n }));\n}\n\nexport function getRevokeAbandonedDelegationInstructionDataDecoder(): FixedSizeDecoder<RevokeAbandonedDelegationInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getRevokeAbandonedDelegationInstructionDataCodec(): FixedSizeCodec<\n RevokeAbandonedDelegationInstructionDataArgs,\n RevokeAbandonedDelegationInstructionData\n> {\n return combineCodec(\n getRevokeAbandonedDelegationInstructionDataEncoder(),\n getRevokeAbandonedDelegationInstructionDataDecoder(),\n );\n}\n\nexport type RevokeAbandonedDelegationInput<\n TAccountPayer extends string = string,\n TAccountDelegationAccount extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n> = {\n /** The recorded payer reclaiming rent */\n payer: TransactionSigner<TAccountPayer>;\n /** The fixed or recurring delegation PDA to close */\n delegationAccount: Address<TAccountDelegationAccount>;\n /** The delegation's recorded SubscriptionAuthority PDA (may be closed) */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n};\n\nexport function getRevokeAbandonedDelegationInstruction<\n TAccountPayer extends string,\n TAccountDelegationAccount extends string,\n TAccountSubscriptionAuthority extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeAbandonedDelegationInput<TAccountPayer, TAccountDelegationAccount, TAccountSubscriptionAuthority>,\n config?: { programAddress?: TProgramAddress },\n): RevokeAbandonedDelegationInstruction<\n TProgramAddress,\n TAccountPayer,\n TAccountDelegationAccount,\n TAccountSubscriptionAuthority\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n payer: { value: input.payer ?? null, isWritable: true },\n delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? 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('payer', accounts.payer),\n getAccountMeta('delegationAccount', accounts.delegationAccount),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n ],\n data: getRevokeAbandonedDelegationInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeAbandonedDelegationInstruction<\n TProgramAddress,\n TAccountPayer,\n TAccountDelegationAccount,\n TAccountSubscriptionAuthority\n >);\n}\n\nexport type ParsedRevokeAbandonedDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The recorded payer reclaiming rent */\n payer: TAccountMetas[0];\n /** The fixed or recurring delegation PDA to close */\n delegationAccount: TAccountMetas[1];\n /** The delegation's recorded SubscriptionAuthority PDA (may be closed) */\n subscriptionAuthority: TAccountMetas[2];\n };\n data: RevokeAbandonedDelegationInstructionData;\n};\n\nexport function parseRevokeAbandonedDelegationInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevokeAbandonedDelegationInstruction<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 payer: getNextAccount(),\n delegationAccount: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n },\n data: getRevokeAbandonedDelegationInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR = 16;\n\nexport function getRevokeAbandonedSubscriptionDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR);\n}\n\nexport type RevokeAbandonedSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountSubscriptionAccount extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountSubscriptionAccount extends string\n ? WritableAccount<TAccountSubscriptionAccount>\n : TAccountSubscriptionAccount,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevokeAbandonedSubscriptionInstructionData = { discriminator: number };\n\nexport type RevokeAbandonedSubscriptionInstructionDataArgs = {};\n\nexport function getRevokeAbandonedSubscriptionInstructionDataEncoder(): FixedSizeEncoder<RevokeAbandonedSubscriptionInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: REVOKE_ABANDONED_SUBSCRIPTION_DISCRIMINATOR,\n }));\n}\n\nexport function getRevokeAbandonedSubscriptionInstructionDataDecoder(): FixedSizeDecoder<RevokeAbandonedSubscriptionInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getRevokeAbandonedSubscriptionInstructionDataCodec(): FixedSizeCodec<\n RevokeAbandonedSubscriptionInstructionDataArgs,\n RevokeAbandonedSubscriptionInstructionData\n> {\n return combineCodec(\n getRevokeAbandonedSubscriptionInstructionDataEncoder(),\n getRevokeAbandonedSubscriptionInstructionDataDecoder(),\n );\n}\n\nexport type RevokeAbandonedSubscriptionInput<\n TAccountPayer extends string = string,\n TAccountSubscriptionAccount extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountPlanPda extends string = string,\n> = {\n /** The recorded payer reclaiming rent */\n payer: TransactionSigner<TAccountPayer>;\n /** The abandoned subscription PDA to close */\n subscriptionAccount: Address<TAccountSubscriptionAccount>;\n /** The subscriber's recorded SubscriptionAuthority PDA for the plan's mint (may be closed) */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The plan the subscription belongs to; provides the mint */\n planPda: Address<TAccountPlanPda>;\n};\n\nexport function getRevokeAbandonedSubscriptionInstruction<\n TAccountPayer extends string,\n TAccountSubscriptionAccount extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountPlanPda extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeAbandonedSubscriptionInput<\n TAccountPayer,\n TAccountSubscriptionAccount,\n TAccountSubscriptionAuthority,\n TAccountPlanPda\n >,\n config?: { programAddress?: TProgramAddress },\n): RevokeAbandonedSubscriptionInstruction<\n TProgramAddress,\n TAccountPayer,\n TAccountSubscriptionAccount,\n TAccountSubscriptionAuthority,\n TAccountPlanPda\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n payer: { value: input.payer ?? null, isWritable: true },\n subscriptionAccount: { value: input.subscriptionAccount ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n planPda: { value: input.planPda ?? 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('payer', accounts.payer),\n getAccountMeta('subscriptionAccount', accounts.subscriptionAccount),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('planPda', accounts.planPda),\n ],\n data: getRevokeAbandonedSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeAbandonedSubscriptionInstruction<\n TProgramAddress,\n TAccountPayer,\n TAccountSubscriptionAccount,\n TAccountSubscriptionAuthority,\n TAccountPlanPda\n >);\n}\n\nexport type ParsedRevokeAbandonedSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The recorded payer reclaiming rent */\n payer: TAccountMetas[0];\n /** The abandoned subscription PDA to close */\n subscriptionAccount: TAccountMetas[1];\n /** The subscriber's recorded SubscriptionAuthority PDA for the plan's mint (may be closed) */\n subscriptionAuthority: TAccountMetas[2];\n /** The plan the subscription belongs to; provides the mint */\n planPda: TAccountMetas[3];\n };\n data: RevokeAbandonedSubscriptionInstructionData;\n};\n\nexport function parseRevokeAbandonedSubscriptionInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevokeAbandonedSubscriptionInstruction<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 return {\n programAddress: instruction.programAddress,\n accounts: {\n payer: getNextAccount(),\n subscriptionAccount: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n planPda: getNextAccount(),\n },\n data: getRevokeAbandonedSubscriptionInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport { getAccountMetaFactory, type ResolvedInstructionAccount } from '@solana/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const REVOKE_DELEGATION_DISCRIMINATOR = 3;\n\nexport function getRevokeDelegationDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(REVOKE_DELEGATION_DISCRIMINATOR);\n}\n\nexport type RevokeDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountDelegationAccount extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountDelegationAccount extends string\n ? WritableAccount<TAccountDelegationAccount>\n : TAccountDelegationAccount,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevokeDelegationInstructionData = { discriminator: number };\n\nexport type RevokeDelegationInstructionDataArgs = {};\n\nexport function getRevokeDelegationInstructionDataEncoder(): FixedSizeEncoder<RevokeDelegationInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: REVOKE_DELEGATION_DISCRIMINATOR,\n }));\n}\n\nexport function getRevokeDelegationInstructionDataDecoder(): FixedSizeDecoder<RevokeDelegationInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getRevokeDelegationInstructionDataCodec(): FixedSizeCodec<\n RevokeDelegationInstructionDataArgs,\n RevokeDelegationInstructionData\n> {\n return combineCodec(getRevokeDelegationInstructionDataEncoder(), getRevokeDelegationInstructionDataDecoder());\n}\n\nexport type RevokeDelegationInput<\n TAccountAuthority extends string = string,\n TAccountDelegationAccount extends string = string,\n> = {\n /** The delegator revoking the delegation (receives rent) */\n authority: TransactionSigner<TAccountAuthority>;\n /** The delegation PDA to close */\n delegationAccount: Address<TAccountDelegationAccount>;\n};\n\nexport function getRevokeDelegationInstruction<\n TAccountAuthority extends string,\n TAccountDelegationAccount extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeDelegationInput<TAccountAuthority, TAccountDelegationAccount>,\n config?: { programAddress?: TProgramAddress },\n): RevokeDelegationInstruction<TProgramAddress, TAccountAuthority, TAccountDelegationAccount> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n delegationAccount: { value: input.delegationAccount ?? null, isWritable: true },\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('authority', accounts.authority),\n getAccountMeta('delegationAccount', accounts.delegationAccount),\n ],\n data: getRevokeDelegationInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeDelegationInstruction<TProgramAddress, TAccountAuthority, TAccountDelegationAccount>);\n}\n\nexport type ParsedRevokeDelegationInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The delegator revoking the delegation (receives rent) */\n authority: TAccountMetas[0];\n /** The delegation PDA to close */\n delegationAccount: TAccountMetas[1];\n };\n data: RevokeDelegationInstructionData;\n};\n\nexport function parseRevokeDelegationInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevokeDelegationInstruction<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: { authority: getNextAccount(), delegationAccount: getNextAccount() },\n data: getRevokeDelegationInstructionDataDecoder().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 getU8Decoder,\n getU8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionAuthorityPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\n\nexport const REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR = 14;\n\nexport function getRevokeSubscriptionAuthorityDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR);\n}\n\nexport type RevokeSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountUser extends string | AccountMeta<string> = string,\n TAccountUserAta extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountReceiver extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountUser extends string\n ? WritableSignerAccount<TAccountUser> & AccountSignerMeta<TAccountUser>\n : TAccountUser,\n TAccountUserAta extends string ? WritableAccount<TAccountUserAta> : TAccountUserAta,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n TAccountSubscriptionAuthority extends string\n ? WritableAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n ...(TAccountReceiver extends undefined\n ? []\n : [TAccountReceiver extends string ? WritableAccount<TAccountReceiver> : TAccountReceiver]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevokeSubscriptionAuthorityInstructionData = { discriminator: number };\n\nexport type RevokeSubscriptionAuthorityInstructionDataArgs = {};\n\nexport function getRevokeSubscriptionAuthorityInstructionDataEncoder(): FixedSizeEncoder<RevokeSubscriptionAuthorityInstructionDataArgs> {\n return transformEncoder(getStructEncoder([['discriminator', getU8Encoder()]]), value => ({\n ...value,\n discriminator: REVOKE_SUBSCRIPTION_AUTHORITY_DISCRIMINATOR,\n }));\n}\n\nexport function getRevokeSubscriptionAuthorityInstructionDataDecoder(): FixedSizeDecoder<RevokeSubscriptionAuthorityInstructionData> {\n return getStructDecoder([['discriminator', getU8Decoder()]]);\n}\n\nexport function getRevokeSubscriptionAuthorityInstructionDataCodec(): FixedSizeCodec<\n RevokeSubscriptionAuthorityInstructionDataArgs,\n RevokeSubscriptionAuthorityInstructionData\n> {\n return combineCodec(\n getRevokeSubscriptionAuthorityInstructionDataEncoder(),\n getRevokeSubscriptionAuthorityInstructionDataDecoder(),\n );\n}\n\nexport type RevokeSubscriptionAuthorityAsyncInput<\n TAccountUser extends string = string,\n TAccountUserAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountReceiver extends string = string,\n> = {\n /** The ATA owner: revokes the program's delegate and, when still open, closes the SubscriptionAuthority PDA (receives rent when self-funded) */\n user: TransactionSigner<TAccountUser>;\n /** The user's ATA whose delegate is being revoked */\n userAta: Address<TAccountUserAta>;\n /** The token mint of the user's ATA */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The SubscriptionAuthority PDA. Closed when still open; ignored when already closed. */\n subscriptionAuthority?: Address<TAccountSubscriptionAuthority>;\n /** Optional rent recipient, required when the SubscriptionAuthority is still open and its recorded payer differs from the user. Must match the stored payer. */\n receiver?: Address<TAccountReceiver>;\n};\n\nexport async function getRevokeSubscriptionAuthorityInstructionAsync<\n TAccountUser extends string,\n TAccountUserAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountReceiver extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeSubscriptionAuthorityAsyncInput<\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RevokeSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n user: { value: input.user ?? null, isWritable: true },\n userAta: { value: input.userAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n receiver: { value: input.receiver ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Resolve default values.\n if (!accounts.subscriptionAuthority.value) {\n accounts.subscriptionAuthority.value = await findSubscriptionAuthorityPda({\n user: getAddressFromResolvedInstructionAccount('user', accounts.user.value),\n tokenMint: getAddressFromResolvedInstructionAccount('tokenMint', accounts.tokenMint.value),\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('user', accounts.user),\n getAccountMeta('userAta', accounts.userAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('receiver', accounts.receiver),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getRevokeSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >);\n}\n\nexport type RevokeSubscriptionAuthorityInput<\n TAccountUser extends string = string,\n TAccountUserAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountReceiver extends string = string,\n> = {\n /** The ATA owner: revokes the program's delegate and, when still open, closes the SubscriptionAuthority PDA (receives rent when self-funded) */\n user: TransactionSigner<TAccountUser>;\n /** The user's ATA whose delegate is being revoked */\n userAta: Address<TAccountUserAta>;\n /** The token mint of the user's ATA */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The SubscriptionAuthority PDA. Closed when still open; ignored when already closed. */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** Optional rent recipient, required when the SubscriptionAuthority is still open and its recorded payer differs from the user. Must match the stored payer. */\n receiver?: Address<TAccountReceiver>;\n};\n\nexport function getRevokeSubscriptionAuthorityInstruction<\n TAccountUser extends string,\n TAccountUserAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountReceiver extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: RevokeSubscriptionAuthorityInput<\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >,\n config?: { programAddress?: TProgramAddress },\n): RevokeSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n user: { value: input.user ?? null, isWritable: true },\n userAta: { value: input.userAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: true },\n receiver: { value: input.receiver ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('user', accounts.user),\n getAccountMeta('userAta', accounts.userAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('receiver', accounts.receiver),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getRevokeSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as RevokeSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountUser,\n TAccountUserAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountSubscriptionAuthority,\n TAccountReceiver\n >);\n}\n\nexport type ParsedRevokeSubscriptionAuthorityInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The ATA owner: revokes the program's delegate and, when still open, closes the SubscriptionAuthority PDA (receives rent when self-funded) */\n user: TAccountMetas[0];\n /** The user's ATA whose delegate is being revoked */\n userAta: TAccountMetas[1];\n /** The token mint of the user's ATA */\n tokenMint: TAccountMetas[2];\n /** Token program */\n tokenProgram: TAccountMetas[3];\n /** The SubscriptionAuthority PDA. Closed when still open; ignored when already closed. */\n subscriptionAuthority: TAccountMetas[4];\n /** Optional rent recipient, required when the SubscriptionAuthority is still open and its recorded payer differs from the user. Must match the stored payer. */\n receiver?: TAccountMetas[5] | undefined;\n };\n data: RevokeSubscriptionAuthorityInstructionData;\n};\n\nexport function parseRevokeSubscriptionAuthorityInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevokeSubscriptionAuthorityInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\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 let optionalAccountsRemaining = instruction.accounts.length - 5;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n user: getNextAccount(),\n userAta: getNextAccount(),\n tokenMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n receiver: getNextOptionalAccount(),\n },\n data: getRevokeSubscriptionAuthorityInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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 {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { findSubscriptionDelegationPda } from '../pdas';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getSubscribeDataDecoder, getSubscribeDataEncoder, type SubscribeData, type SubscribeDataArgs } from '../types';\n\nexport const SUBSCRIBE_DISCRIMINATOR = 11;\n\nexport function getSubscribeDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(SUBSCRIBE_DISCRIMINATOR);\n}\n\nexport type SubscribeInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriber extends string | AccountMeta<string> = string,\n TAccountMerchant extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthorityPda extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TAccountPayer extends string | AccountMeta<string> | undefined = undefined,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriber extends string\n ? WritableSignerAccount<TAccountSubscriber> & AccountSignerMeta<TAccountSubscriber>\n : TAccountSubscriber,\n TAccountMerchant extends string ? ReadonlyAccount<TAccountMerchant> : TAccountMerchant,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthorityPda>\n : TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...(TAccountPayer extends undefined\n ? []\n : [\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n ]),\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SubscribeInstructionData = { discriminator: number; subscribeData: SubscribeData };\n\nexport type SubscribeInstructionDataArgs = { subscribeData: SubscribeDataArgs };\n\nexport function getSubscribeInstructionDataEncoder(): FixedSizeEncoder<SubscribeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['subscribeData', getSubscribeDataEncoder()],\n ]),\n value => ({ ...value, discriminator: SUBSCRIBE_DISCRIMINATOR }),\n );\n}\n\nexport function getSubscribeInstructionDataDecoder(): FixedSizeDecoder<SubscribeInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['subscribeData', getSubscribeDataDecoder()],\n ]);\n}\n\nexport function getSubscribeInstructionDataCodec(): FixedSizeCodec<\n SubscribeInstructionDataArgs,\n SubscribeInstructionData\n> {\n return combineCodec(getSubscribeInstructionDataEncoder(), getSubscribeInstructionDataDecoder());\n}\n\nexport type SubscribeAsyncInput<\n TAccountSubscriber extends string = string,\n TAccountMerchant extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountSubscriptionAuthorityPda extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The subscriber creating the subscription (pays rent) */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The merchant who owns the plan */\n merchant: Address<TAccountMerchant>;\n /** The plan PDA to subscribe to */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being created */\n subscriptionPda?: Address<TAccountSubscriptionPda>;\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthorityPda: Address<TAccountSubscriptionAuthorityPda>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the subscriber/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n subscribeData: SubscribeInstructionDataArgs['subscribeData'];\n};\n\nexport async function getSubscribeInstructionAsync<\n TAccountSubscriber extends string,\n TAccountMerchant extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountSubscriptionAuthorityPda extends string,\n TAccountSystemProgram extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: SubscribeAsyncInput<\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SubscribeInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: true },\n merchant: { value: input.merchant ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n subscriptionAuthorityPda: { value: input.subscriptionAuthorityPda ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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 // Resolve default values.\n if (!accounts.subscriptionPda.value) {\n accounts.subscriptionPda.value = await findSubscriptionDelegationPda({\n planPda: getAddressFromResolvedInstructionAccount('planPda', accounts.planPda.value),\n subscriber: getAddressFromResolvedInstructionAccount('subscriber', accounts.subscriber.value),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('merchant', accounts.merchant),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('subscriptionAuthorityPda', accounts.subscriptionAuthorityPda),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getSubscribeInstructionDataEncoder().encode(args as SubscribeInstructionDataArgs),\n programAddress,\n } as SubscribeInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >);\n}\n\nexport type SubscribeInput<\n TAccountSubscriber extends string = string,\n TAccountMerchant extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionPda extends string = string,\n TAccountSubscriptionAuthorityPda extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n TAccountPayer extends string = string,\n> = {\n /** The subscriber creating the subscription (pays rent) */\n subscriber: TransactionSigner<TAccountSubscriber>;\n /** The merchant who owns the plan */\n merchant: Address<TAccountMerchant>;\n /** The plan PDA to subscribe to */\n planPda: Address<TAccountPlanPda>;\n /** The subscription PDA being created */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthorityPda: Address<TAccountSubscriptionAuthorityPda>;\n /** The system program */\n systemProgram?: Address<TAccountSystemProgram>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n /** Optional sponsor that funds the account rent. Defaults to the subscriber/signer when omitted. */\n payer?: TransactionSigner<TAccountPayer>;\n subscribeData: SubscribeInstructionDataArgs['subscribeData'];\n};\n\nexport function getSubscribeInstruction<\n TAccountSubscriber extends string,\n TAccountMerchant extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionPda extends string,\n TAccountSubscriptionAuthorityPda extends string,\n TAccountSystemProgram extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TAccountPayer extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: SubscribeInput<\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >,\n config?: { programAddress?: TProgramAddress },\n): SubscribeInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriber: { value: input.subscriber ?? null, isWritable: true },\n merchant: { value: input.merchant ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n subscriptionAuthorityPda: { value: input.subscriptionAuthorityPda ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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 // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'omitted');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriber', accounts.subscriber),\n getAccountMeta('merchant', accounts.merchant),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('subscriptionAuthorityPda', accounts.subscriptionAuthorityPda),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n getAccountMeta('payer', accounts.payer),\n ].filter(<T>(x: T | undefined): x is T => x !== undefined),\n data: getSubscribeInstructionDataEncoder().encode(args as SubscribeInstructionDataArgs),\n programAddress,\n } as SubscribeInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountMerchant,\n TAccountPlanPda,\n TAccountSubscriptionPda,\n TAccountSubscriptionAuthorityPda,\n TAccountSystemProgram,\n TAccountEventAuthority,\n TAccountSelfProgram,\n TAccountPayer\n >);\n}\n\nexport type ParsedSubscribeInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscriber creating the subscription (pays rent) */\n subscriber: TAccountMetas[0];\n /** The merchant who owns the plan */\n merchant: TAccountMetas[1];\n /** The plan PDA to subscribe to */\n planPda: TAccountMetas[2];\n /** The subscription PDA being created */\n subscriptionPda: TAccountMetas[3];\n /** The subscriber's SubscriptionAuthority PDA for the plan's mint */\n subscriptionAuthorityPda: TAccountMetas[4];\n /** The system program */\n systemProgram: TAccountMetas[5];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[6];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[7];\n /** Optional sponsor that funds the account rent. Defaults to the subscriber/signer when omitted. */\n payer?: TAccountMetas[8] | undefined;\n };\n data: SubscribeInstructionData;\n};\n\nexport function parseSubscribeInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSubscribeInstruction<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 let optionalAccountsRemaining = instruction.accounts.length - 8;\n const getNextOptionalAccount = () => {\n if (optionalAccountsRemaining === 0) return undefined;\n optionalAccountsRemaining -= 1;\n return getNextAccount();\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n subscriber: getNextAccount(),\n merchant: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionPda: getNextAccount(),\n subscriptionAuthorityPda: getNextAccount(),\n systemProgram: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n payer: getNextOptionalAccount(),\n },\n data: getSubscribeInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getTransferDataDecoder, getTransferDataEncoder, type TransferData, type TransferDataArgs } from '../types';\n\nexport const TRANSFER_FIXED_DISCRIMINATOR = 4;\n\nexport function getTransferFixedDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(TRANSFER_FIXED_DISCRIMINATOR);\n}\n\nexport type TransferFixedInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountDelegationPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegatorAta extends string | AccountMeta<string> = string,\n TAccountReceiverAta extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountDelegationPda extends string ? WritableAccount<TAccountDelegationPda> : TAccountDelegationPda,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegatorAta extends string ? WritableAccount<TAccountDelegatorAta> : TAccountDelegatorAta,\n TAccountReceiverAta extends string ? WritableAccount<TAccountReceiverAta> : TAccountReceiverAta,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n TAccountDelegatee extends string\n ? ReadonlySignerAccount<TAccountDelegatee> & AccountSignerMeta<TAccountDelegatee>\n : TAccountDelegatee,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type TransferFixedInstructionData = { discriminator: number; transferData: TransferData };\n\nexport type TransferFixedInstructionDataArgs = { transferData: TransferDataArgs };\n\nexport function getTransferFixedInstructionDataEncoder(): FixedSizeEncoder<TransferFixedInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['transferData', getTransferDataEncoder()],\n ]),\n value => ({ ...value, discriminator: TRANSFER_FIXED_DISCRIMINATOR }),\n );\n}\n\nexport function getTransferFixedInstructionDataDecoder(): FixedSizeDecoder<TransferFixedInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['transferData', getTransferDataDecoder()],\n ]);\n}\n\nexport function getTransferFixedInstructionDataCodec(): FixedSizeCodec<\n TransferFixedInstructionDataArgs,\n TransferFixedInstructionData\n> {\n return combineCodec(getTransferFixedInstructionDataEncoder(), getTransferFixedInstructionDataDecoder());\n}\n\nexport type TransferFixedAsyncInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountDelegatee extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The fixed delegation PDA to transfer from */\n delegationPda: Address<TAccountDelegationPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The delegatee signing the transfer */\n delegatee: TransactionSigner<TAccountDelegatee>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferFixedInstructionDataArgs['transferData'];\n};\n\nexport async function getTransferFixedInstructionAsync<\n TAccountDelegationPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountDelegatee extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferFixedAsyncInput<\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n TransferFixedInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegationPda: { value: input.delegationPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegationPda', accounts.delegationPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferFixedInstructionDataEncoder().encode(args as TransferFixedInstructionDataArgs),\n programAddress,\n } as TransferFixedInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type TransferFixedInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountDelegatee extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The fixed delegation PDA to transfer from */\n delegationPda: Address<TAccountDelegationPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The delegatee signing the transfer */\n delegatee: TransactionSigner<TAccountDelegatee>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferFixedInstructionDataArgs['transferData'];\n};\n\nexport function getTransferFixedInstruction<\n TAccountDelegationPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountDelegatee extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferFixedInput<\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): TransferFixedInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegationPda: { value: input.delegationPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegationPda', accounts.delegationPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferFixedInstructionDataEncoder().encode(args as TransferFixedInstructionDataArgs),\n programAddress,\n } as TransferFixedInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedTransferFixedInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The fixed delegation PDA to transfer from */\n delegationPda: TAccountMetas[0];\n /** The subscription-authority PDA */\n subscriptionAuthority: TAccountMetas[1];\n /** The delegator's ATA to transfer from */\n delegatorAta: TAccountMetas[2];\n /** The receiver's ATA to transfer to */\n receiverAta: TAccountMetas[3];\n /** The token mint */\n tokenMint: TAccountMetas[4];\n /** Token program */\n tokenProgram: TAccountMetas[5];\n /** The delegatee signing the transfer */\n delegatee: TAccountMetas[6];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[7];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[8];\n };\n data: TransferFixedInstructionData;\n};\n\nexport function parseTransferFixedInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedTransferFixedInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 9) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 9,\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 delegationPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: getNextAccount(),\n tokenMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n delegatee: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getTransferFixedInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getTransferDataDecoder, getTransferDataEncoder, type TransferData, type TransferDataArgs } from '../types';\n\nexport const TRANSFER_RECURRING_DISCRIMINATOR = 5;\n\nexport function getTransferRecurringDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(TRANSFER_RECURRING_DISCRIMINATOR);\n}\n\nexport type TransferRecurringInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountDelegationPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegatorAta extends string | AccountMeta<string> = string,\n TAccountReceiverAta extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountDelegationPda extends string ? WritableAccount<TAccountDelegationPda> : TAccountDelegationPda,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegatorAta extends string ? WritableAccount<TAccountDelegatorAta> : TAccountDelegatorAta,\n TAccountReceiverAta extends string ? WritableAccount<TAccountReceiverAta> : TAccountReceiverAta,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n TAccountDelegatee extends string\n ? ReadonlySignerAccount<TAccountDelegatee> & AccountSignerMeta<TAccountDelegatee>\n : TAccountDelegatee,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type TransferRecurringInstructionData = { discriminator: number; transferData: TransferData };\n\nexport type TransferRecurringInstructionDataArgs = { transferData: TransferDataArgs };\n\nexport function getTransferRecurringInstructionDataEncoder(): FixedSizeEncoder<TransferRecurringInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['transferData', getTransferDataEncoder()],\n ]),\n value => ({ ...value, discriminator: TRANSFER_RECURRING_DISCRIMINATOR }),\n );\n}\n\nexport function getTransferRecurringInstructionDataDecoder(): FixedSizeDecoder<TransferRecurringInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['transferData', getTransferDataDecoder()],\n ]);\n}\n\nexport function getTransferRecurringInstructionDataCodec(): FixedSizeCodec<\n TransferRecurringInstructionDataArgs,\n TransferRecurringInstructionData\n> {\n return combineCodec(getTransferRecurringInstructionDataEncoder(), getTransferRecurringInstructionDataDecoder());\n}\n\nexport type TransferRecurringAsyncInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountDelegatee extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The recurring delegation PDA to transfer from */\n delegationPda: Address<TAccountDelegationPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The delegatee signing the transfer */\n delegatee: TransactionSigner<TAccountDelegatee>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferRecurringInstructionDataArgs['transferData'];\n};\n\nexport async function getTransferRecurringInstructionAsync<\n TAccountDelegationPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountDelegatee extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferRecurringAsyncInput<\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n TransferRecurringInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegationPda: { value: input.delegationPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegationPda', accounts.delegationPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferRecurringInstructionDataEncoder().encode(args as TransferRecurringInstructionDataArgs),\n programAddress,\n } as TransferRecurringInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type TransferRecurringInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountDelegatee extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The recurring delegation PDA to transfer from */\n delegationPda: Address<TAccountDelegationPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The delegatee signing the transfer */\n delegatee: TransactionSigner<TAccountDelegatee>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferRecurringInstructionDataArgs['transferData'];\n};\n\nexport function getTransferRecurringInstruction<\n TAccountDelegationPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountDelegatee extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferRecurringInput<\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): TransferRecurringInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n delegationPda: { value: input.delegationPda ?? null, isWritable: true },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n delegatee: { value: input.delegatee ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('delegationPda', accounts.delegationPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('delegatee', accounts.delegatee),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferRecurringInstructionDataEncoder().encode(args as TransferRecurringInstructionDataArgs),\n programAddress,\n } as TransferRecurringInstruction<\n TProgramAddress,\n TAccountDelegationPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountDelegatee,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedTransferRecurringInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The recurring delegation PDA to transfer from */\n delegationPda: TAccountMetas[0];\n /** The subscription-authority PDA */\n subscriptionAuthority: TAccountMetas[1];\n /** The delegator's ATA to transfer from */\n delegatorAta: TAccountMetas[2];\n /** The receiver's ATA to transfer to */\n receiverAta: TAccountMetas[3];\n /** The token mint */\n tokenMint: TAccountMetas[4];\n /** Token program */\n tokenProgram: TAccountMetas[5];\n /** The delegatee signing the transfer */\n delegatee: TAccountMetas[6];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[7];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[8];\n };\n data: TransferRecurringInstructionData;\n};\n\nexport function parseTransferRecurringInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedTransferRecurringInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 9) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 9,\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 delegationPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: getNextAccount(),\n tokenMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n delegatee: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getTransferRecurringInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport { getTransferDataDecoder, getTransferDataEncoder, type TransferData, type TransferDataArgs } from '../types';\n\nexport const TRANSFER_SUBSCRIPTION_DISCRIMINATOR = 10;\n\nexport function getTransferSubscriptionDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(TRANSFER_SUBSCRIPTION_DISCRIMINATOR);\n}\n\nexport type TransferSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountSubscriptionPda extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountSubscriptionAuthority extends string | AccountMeta<string> = string,\n TAccountDelegatorAta extends string | AccountMeta<string> = string,\n TAccountReceiverAta extends string | AccountMeta<string> = string,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountTokenMint extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountSubscriptionPda extends string ? WritableAccount<TAccountSubscriptionPda> : TAccountSubscriptionPda,\n TAccountPlanPda extends string ? ReadonlyAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountSubscriptionAuthority extends string\n ? ReadonlyAccount<TAccountSubscriptionAuthority>\n : TAccountSubscriptionAuthority,\n TAccountDelegatorAta extends string ? WritableAccount<TAccountDelegatorAta> : TAccountDelegatorAta,\n TAccountReceiverAta extends string ? WritableAccount<TAccountReceiverAta> : TAccountReceiverAta,\n TAccountCaller extends string\n ? ReadonlySignerAccount<TAccountCaller> & AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountTokenMint extends string ? ReadonlyAccount<TAccountTokenMint> : TAccountTokenMint,\n TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type TransferSubscriptionInstructionData = { discriminator: number; transferData: TransferData };\n\nexport type TransferSubscriptionInstructionDataArgs = { transferData: TransferDataArgs };\n\nexport function getTransferSubscriptionInstructionDataEncoder(): FixedSizeEncoder<TransferSubscriptionInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['transferData', getTransferDataEncoder()],\n ]),\n value => ({ ...value, discriminator: TRANSFER_SUBSCRIPTION_DISCRIMINATOR }),\n );\n}\n\nexport function getTransferSubscriptionInstructionDataDecoder(): FixedSizeDecoder<TransferSubscriptionInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['transferData', getTransferDataDecoder()],\n ]);\n}\n\nexport function getTransferSubscriptionInstructionDataCodec(): FixedSizeCodec<\n TransferSubscriptionInstructionDataArgs,\n TransferSubscriptionInstructionData\n> {\n return combineCodec(\n getTransferSubscriptionInstructionDataEncoder(),\n getTransferSubscriptionInstructionDataDecoder(),\n );\n}\n\nexport type TransferSubscriptionAsyncInput<\n TAccountSubscriptionPda extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountCaller extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscription delegation PDA */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The plan PDA */\n planPda: Address<TAccountPlanPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The authorized puller (plan owner or whitelisted) */\n caller: TransactionSigner<TAccountCaller>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferSubscriptionInstructionDataArgs['transferData'];\n};\n\nexport async function getTransferSubscriptionInstructionAsync<\n TAccountSubscriptionPda extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountCaller extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferSubscriptionAsyncInput<\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n TransferSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n caller: { value: input.caller ?? null, isWritable: false },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('caller', accounts.caller),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferSubscriptionInstructionDataEncoder().encode(args as TransferSubscriptionInstructionDataArgs),\n programAddress,\n } as TransferSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type TransferSubscriptionInput<\n TAccountSubscriptionPda extends string = string,\n TAccountPlanPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta extends string = string,\n TAccountCaller extends string = string,\n TAccountTokenMint extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The subscription delegation PDA */\n subscriptionPda: Address<TAccountSubscriptionPda>;\n /** The plan PDA */\n planPda: Address<TAccountPlanPda>;\n /** The subscription-authority PDA */\n subscriptionAuthority: Address<TAccountSubscriptionAuthority>;\n /** The delegator's ATA to transfer from */\n delegatorAta: Address<TAccountDelegatorAta>;\n /** The receiver's ATA to transfer to */\n receiverAta: Address<TAccountReceiverAta>;\n /** The authorized puller (plan owner or whitelisted) */\n caller: TransactionSigner<TAccountCaller>;\n /** The token mint */\n tokenMint: Address<TAccountTokenMint>;\n /** Token program */\n tokenProgram: Address<TAccountTokenProgram>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n transferData: TransferSubscriptionInstructionDataArgs['transferData'];\n};\n\nexport function getTransferSubscriptionInstruction<\n TAccountSubscriptionPda extends string,\n TAccountPlanPda extends string,\n TAccountSubscriptionAuthority extends string,\n TAccountDelegatorAta extends string,\n TAccountReceiverAta extends string,\n TAccountCaller extends string,\n TAccountTokenMint extends string,\n TAccountTokenProgram extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: TransferSubscriptionInput<\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): TransferSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n subscriptionPda: { value: input.subscriptionPda ?? null, isWritable: true },\n planPda: { value: input.planPda ?? null, isWritable: false },\n subscriptionAuthority: { value: input.subscriptionAuthority ?? null, isWritable: false },\n delegatorAta: { value: input.delegatorAta ?? null, isWritable: true },\n receiverAta: { value: input.receiverAta ?? null, isWritable: true },\n caller: { value: input.caller ?? null, isWritable: false },\n tokenMint: { value: input.tokenMint ?? null, isWritable: false },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('subscriptionPda', accounts.subscriptionPda),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n getAccountMeta('delegatorAta', accounts.delegatorAta),\n getAccountMeta('receiverAta', accounts.receiverAta),\n getAccountMeta('caller', accounts.caller),\n getAccountMeta('tokenMint', accounts.tokenMint),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getTransferSubscriptionInstructionDataEncoder().encode(args as TransferSubscriptionInstructionDataArgs),\n programAddress,\n } as TransferSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriptionPda,\n TAccountPlanPda,\n TAccountSubscriptionAuthority,\n TAccountDelegatorAta,\n TAccountReceiverAta,\n TAccountCaller,\n TAccountTokenMint,\n TAccountTokenProgram,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedTransferSubscriptionInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The subscription delegation PDA */\n subscriptionPda: TAccountMetas[0];\n /** The plan PDA */\n planPda: TAccountMetas[1];\n /** The subscription-authority PDA */\n subscriptionAuthority: TAccountMetas[2];\n /** The delegator's ATA to transfer from */\n delegatorAta: TAccountMetas[3];\n /** The receiver's ATA to transfer to */\n receiverAta: TAccountMetas[4];\n /** The authorized puller (plan owner or whitelisted) */\n caller: TAccountMetas[5];\n /** The token mint */\n tokenMint: TAccountMetas[6];\n /** Token program */\n tokenProgram: TAccountMetas[7];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[8];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[9];\n };\n data: TransferSubscriptionInstructionData;\n};\n\nexport function parseTransferSubscriptionInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedTransferSubscriptionInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 10) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 10,\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 subscriptionPda: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: getNextAccount(),\n caller: getNextAccount(),\n tokenMint: getNextAccount(),\n tokenProgram: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getTransferSubscriptionInstructionDataDecoder().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 getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Encoder,\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/program-client-core';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../programs';\nimport {\n getUpdatePlanDataDecoder,\n getUpdatePlanDataEncoder,\n type UpdatePlanData,\n type UpdatePlanDataArgs,\n} from '../types';\n\nexport const UPDATE_PLAN_DISCRIMINATOR = 8;\n\nexport function getUpdatePlanDiscriminatorBytes(): ReadonlyUint8Array {\n return getU8Encoder().encode(UPDATE_PLAN_DISCRIMINATOR);\n}\n\nexport type UpdatePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountOwner extends string | AccountMeta<string> = string,\n TAccountPlanPda extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = string,\n TAccountSelfProgram extends string | AccountMeta<string> = 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountOwner extends string\n ? ReadonlySignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner>\n : TAccountOwner,\n TAccountPlanPda extends string ? WritableAccount<TAccountPlanPda> : TAccountPlanPda,\n TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,\n TAccountSelfProgram extends string ? ReadonlyAccount<TAccountSelfProgram> : TAccountSelfProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type UpdatePlanInstructionData = { discriminator: number; updatePlanData: UpdatePlanData };\n\nexport type UpdatePlanInstructionDataArgs = { updatePlanData: UpdatePlanDataArgs };\n\nexport function getUpdatePlanInstructionDataEncoder(): FixedSizeEncoder<UpdatePlanInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['updatePlanData', getUpdatePlanDataEncoder()],\n ]),\n value => ({ ...value, discriminator: UPDATE_PLAN_DISCRIMINATOR }),\n );\n}\n\nexport function getUpdatePlanInstructionDataDecoder(): FixedSizeDecoder<UpdatePlanInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['updatePlanData', getUpdatePlanDataDecoder()],\n ]);\n}\n\nexport function getUpdatePlanInstructionDataCodec(): FixedSizeCodec<\n UpdatePlanInstructionDataArgs,\n UpdatePlanInstructionData\n> {\n return combineCodec(getUpdatePlanInstructionDataEncoder(), getUpdatePlanInstructionDataDecoder());\n}\n\nexport type UpdatePlanAsyncInput<\n TAccountOwner extends string = string,\n TAccountPlanPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The plan owner updating the plan */\n owner: TransactionSigner<TAccountOwner>;\n /** The plan PDA being updated */\n planPda: Address<TAccountPlanPda>;\n /** The event authority PDA */\n eventAuthority?: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n updatePlanData: UpdatePlanInstructionDataArgs['updatePlanData'];\n};\n\nexport async function getUpdatePlanInstructionAsync<\n TAccountOwner extends string,\n TAccountPlanPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: UpdatePlanAsyncInput<TAccountOwner, TAccountPlanPda, TAccountEventAuthority, TAccountSelfProgram>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n UpdatePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda, TAccountEventAuthority, TAccountSelfProgram>\n> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.eventAuthority.value) {\n accounts.eventAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [getUtf8Encoder().encode('event_authority')],\n });\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('owner', accounts.owner),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getUpdatePlanInstructionDataEncoder().encode(args as UpdatePlanInstructionDataArgs),\n programAddress,\n } as UpdatePlanInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountPlanPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type UpdatePlanInput<\n TAccountOwner extends string = string,\n TAccountPlanPda extends string = string,\n TAccountEventAuthority extends string = string,\n TAccountSelfProgram extends string = string,\n> = {\n /** The plan owner updating the plan */\n owner: TransactionSigner<TAccountOwner>;\n /** The plan PDA being updated */\n planPda: Address<TAccountPlanPda>;\n /** The event authority PDA */\n eventAuthority: Address<TAccountEventAuthority>;\n /** This program (for self-CPI) */\n selfProgram?: Address<TAccountSelfProgram>;\n updatePlanData: UpdatePlanInstructionDataArgs['updatePlanData'];\n};\n\nexport function getUpdatePlanInstruction<\n TAccountOwner extends string,\n TAccountPlanPda extends string,\n TAccountEventAuthority extends string,\n TAccountSelfProgram extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: UpdatePlanInput<TAccountOwner, TAccountPlanPda, TAccountEventAuthority, TAccountSelfProgram>,\n config?: { programAddress?: TProgramAddress },\n): UpdatePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda, TAccountEventAuthority, TAccountSelfProgram> {\n // Program address.\n const programAddress = config?.programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n owner: { value: input.owner ?? null, isWritable: false },\n planPda: { value: input.planPda ?? null, isWritable: true },\n eventAuthority: { value: input.eventAuthority ?? null, isWritable: false },\n selfProgram: { value: input.selfProgram ?? 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.selfProgram.value) {\n accounts.selfProgram.value = programAddress;\n accounts.selfProgram.isWritable = false;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('owner', accounts.owner),\n getAccountMeta('planPda', accounts.planPda),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\n data: getUpdatePlanInstructionDataEncoder().encode(args as UpdatePlanInstructionDataArgs),\n programAddress,\n } as UpdatePlanInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountPlanPda,\n TAccountEventAuthority,\n TAccountSelfProgram\n >);\n}\n\nexport type ParsedUpdatePlanInstruction<\n TProgram extends string = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The plan owner updating the plan */\n owner: TAccountMetas[0];\n /** The plan PDA being updated */\n planPda: TAccountMetas[1];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[2];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[3];\n };\n data: UpdatePlanInstructionData;\n};\n\nexport function parseUpdatePlanInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedUpdatePlanInstruction<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 return {\n programAddress: instruction.programAddress,\n accounts: {\n owner: getNextAccount(),\n planPda: getNextAccount(),\n eventAuthority: getNextAccount(),\n selfProgram: getNextAccount(),\n },\n data: getUpdatePlanInstructionDataDecoder().decode(instruction.data),\n };\n}\n","import { SUBSCRIPTIONS_PROGRAM_ADDRESS } from './generated/index.js';\n\n/** Deployed program address, sourced from Codama-generated bindings. */\nexport const PROGRAM_ID = SUBSCRIPTIONS_PROGRAM_ADDRESS;\n\n/** Current on-chain account schema version. */\nexport const CURRENT_PROGRAM_VERSION = 1;\n\n/** Default zero address used for padding arrays (e.g. empty puller/destination slots). */\nexport const ZERO_ADDRESS =\n '11111111111111111111111111111111' as import('@solana/kit').Address<'11111111111111111111111111111111'>;\n\n/** Byte offset of the account discriminator in the Header struct. */\nexport const DISCRIMINATOR_OFFSET = 0;\n/** Byte offset of the delegator address in the Header struct. */\nexport const DELEGATOR_OFFSET = 3;\n/** Byte offset of the delegatee address in the Header struct. */\nexport const DELEGATEE_OFFSET = 35;\n\n/** Byte size of a u64 value (used in nonce encoding). */\nexport const U64_BYTE_SIZE = 8;\n\n/** PDA seed for SubscriptionAuthority accounts. */\nexport const SUBSCRIPTION_AUTHORITY_SEED = 'SubscriptionAuthority';\n\n/** PDA seed for delegation accounts (FixedDelegation, RecurringDelegation). */\nexport const DELEGATION_SEED = 'delegation';\n\n/** PDA seed for Plan accounts. */\nexport const PLAN_SEED = 'plan';\n/** PDA seed for SubscriptionDelegation accounts. */\nexport const SUBSCRIPTION_SEED = 'subscription';\n/** PDA seed for the event authority (self-CPI). */\nexport const EVENT_AUTHORITY_SEED = 'event_authority';\n\n/** On-chain Plan account size in bytes: discriminator(1) + owner(32) + bump(1) + status(1) + planData(456). */\nexport const PLAN_SIZE = 491;\n/** On-chain SubscriptionDelegation account size in bytes: header(107) + terms(24) + pulled(8) + periodStart(8) + expiresAt(8). */\nexport const SUBSCRIPTION_SIZE = 155;\n\n/** Byte offset of the owner address in a Plan account. */\nexport const PLAN_OWNER_OFFSET = 1;\n\n/** Maximum number of destination addresses in a Plan. */\nexport const MAX_PLAN_DESTINATIONS = 4;\n/** Maximum number of puller addresses in a Plan. */\nexport const MAX_PLAN_PULLERS = 4;\n/** Maximum byte length of a Plan's metadata URI. */\nexport const METADATA_URI_LEN = 128;\n\n/** On-chain delegation variant identifier (matches the `kind` tag in the `Delegation` union). */\nexport type DelegationKindId = 'fixed' | 'recurring' | 'subscription';\n\n/**\n * Sentinel `expectedSubscriptionAuthorityInitId` for 1-step signup.\n *\n * When passed to subscribe or delegation creation, the program accepts the\n * SubscriptionAuthority only if its stored `initId` equals the current slot.\n * This is intended for bundling `initSubscriptionAuthority` in the same\n * transaction, but the check is slot-scoped, not transaction-scoped. Pass the\n * real `initId` when it is known.\n */\nexport const UNKNOWN_INIT_ID = -9223372036854775808n;\n","import type { Address, Base58EncodedBytes, GetProgramAccountsApi, Rpc } from '@solana/kit';\n\nimport { DELEGATEE_OFFSET, DELEGATOR_OFFSET } from '../constants.js';\nimport { SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../generated/index.js';\nimport type { Delegation } from '../types/delegation.js';\nimport type { RawProgramAccount } from './decode.js';\nimport { decodeDelegationAccount } from './decode.js';\n\n/**\n * Fetches all delegation accounts (fixed, recurring, and subscription) for a delegator.\n *\n * @param rpc - An RPC client supporting `getProgramAccounts`.\n * @param wallet - The delegator's wallet address.\n * @returns All decoded delegations owned by the wallet.\n */\nexport async function fetchDelegationsByDelegator(\n rpc: Rpc<GetProgramAccountsApi>,\n wallet: Address,\n programAddress?: Address,\n): Promise<Delegation[]> {\n return await fetchDelegationsByOffset(rpc, wallet, DELEGATOR_OFFSET, programAddress);\n}\n\n/**\n * Fetches all delegation accounts (fixed, recurring, and subscription) for a delegatee.\n *\n * @param rpc - An RPC client supporting `getProgramAccounts`.\n * @param wallet - The delegatee's wallet address.\n * @param programAddress - Optional program address override.\n * @returns All decoded delegations where the wallet is the delegatee.\n */\nexport async function fetchDelegationsByDelegatee(\n rpc: Rpc<GetProgramAccountsApi>,\n wallet: Address,\n programAddress?: Address,\n): Promise<Delegation[]> {\n return await fetchDelegationsByOffset(rpc, wallet, DELEGATEE_OFFSET, programAddress);\n}\n\nasync function fetchDelegationsByOffset(\n rpc: Rpc<GetProgramAccountsApi>,\n wallet: Address,\n offset: number,\n programAddress?: Address,\n): Promise<Delegation[]> {\n const progAddr = programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n const response = await rpc\n .getProgramAccounts(progAddr, {\n encoding: 'base64',\n filters: [\n {\n memcmp: {\n bytes: wallet as string as Base58EncodedBytes,\n encoding: 'base58',\n offset: BigInt(offset),\n },\n },\n ],\n })\n .send();\n\n return response\n .map(account => decodeDelegationAccount(account as unknown as RawProgramAccount, progAddr))\n .filter((d): d is Delegation => d !== null);\n}\n","import type { Address, Base58EncodedBytes, GetProgramAccountsApi, Rpc } from '@solana/kit';\n\nimport { PLAN_OWNER_OFFSET, PLAN_SIZE } from '../constants.js';\nimport { decodePlan, SUBSCRIPTIONS_PROGRAM_ADDRESS } from '../generated/index.js';\nimport type { PlanWithAddress } from '../types/plan.js';\nimport { toEncodedAccount } from './decode.js';\n\n/**\n * Fetches all plan accounts owned by a given address, filtered by account size.\n *\n * @param rpc - An RPC client supporting `getProgramAccounts`.\n * @param owner - The plan owner's wallet address.\n * @returns All decoded plans belonging to the owner.\n */\nexport async function fetchPlansForOwner(\n rpc: Rpc<GetProgramAccountsApi>,\n owner: Address,\n programAddress?: Address,\n): Promise<PlanWithAddress[]> {\n const progAddr = programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n const response = await rpc\n .getProgramAccounts(progAddr, {\n encoding: 'base64',\n filters: [\n { dataSize: BigInt(PLAN_SIZE) },\n {\n memcmp: {\n bytes: owner as string as Base58EncodedBytes,\n encoding: 'base58',\n offset: BigInt(PLAN_OWNER_OFFSET),\n },\n },\n ],\n })\n .send();\n\n return response.map(account => {\n const encoded = toEncodedAccount(account, progAddr);\n const { address, data } = decodePlan(encoded);\n return { address, data };\n });\n}\n","import type { Address, Base58EncodedBytes, GetProgramAccountsApi, Rpc } from '@solana/kit';\n\nimport { DELEGATOR_OFFSET, SUBSCRIPTION_SIZE } from '../constants.js';\nimport {\n decodeSubscriptionDelegation,\n type SubscriptionDelegation,\n SUBSCRIPTIONS_PROGRAM_ADDRESS,\n} from '../generated/index.js';\nimport type { RawProgramAccount } from './decode.js';\nimport { toEncodedAccount } from './decode.js';\n\n/**\n * Fetches all subscription delegation accounts for a given subscriber wallet.\n *\n * @param rpc - An RPC client supporting `getProgramAccounts`.\n * @param user - The subscriber's (delegator's) wallet address.\n * @returns Decoded subscription delegations paired with their on-chain addresses.\n */\nexport async function fetchSubscriptionsForUser(\n rpc: Rpc<GetProgramAccountsApi>,\n user: Address,\n programAddress?: Address,\n): Promise<Array<{ address: Address; data: SubscriptionDelegation }>> {\n const progAddr = programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS;\n const response = await rpc\n .getProgramAccounts(progAddr, {\n encoding: 'base64',\n filters: [\n { dataSize: BigInt(SUBSCRIPTION_SIZE) },\n {\n memcmp: {\n bytes: user as string as Base58EncodedBytes,\n encoding: 'base58',\n offset: BigInt(DELEGATOR_OFFSET),\n },\n },\n ],\n })\n .send();\n\n return response.map(account => {\n const raw = account as unknown as RawProgramAccount;\n const encoded = toEncodedAccount(raw, progAddr);\n const decoded = decodeSubscriptionDelegation(encoded);\n return { address: raw.pubkey, data: decoded.data };\n });\n}\n","/**\n * `subscriptionsProgram()` — `@solana/kit` plugin that wraps the Codama-generated\n * `subscriptionsProgram()` plugin with higher-level instruction overlays\n * (PDA derivation, event-account resolution [`eventAuthority` + `selfProgram`\n * from the active `programAddress`], sponsor `payer` trailing accounts, ATA\n * derivation, validators) and a `queries` namespace for common account fetches.\n *\n * Each overlay defaults its actor field (`owner` / `delegator` / `subscriber`\n * / `authority` / `delegatee` / `caller`) to `client.identity`, and any\n * `payer` slot to `client.payer`. Sponsor flows install separate signers via\n * `payer()` + `identity()` instead of `signer()`.\n *\n * @example Same signer for everything\n * ```ts\n * import { createClient } from '@solana/kit';\n * import { signer } from '@solana/kit-plugin-signer';\n * import { solanaLocalRpc } from '@solana/kit-plugin-rpc';\n * import { subscriptionsProgram } from '@solana/subscriptions';\n *\n * const client = createClient()\n * .use(signer(mySigner))\n * .use(solanaLocalRpc())\n * .use(subscriptionsProgram());\n *\n * await client.subscriptions.instructions\n * .createPlan({ planId, mint, amount, periodHours, endTs, destinations, pullers, metadataUri })\n * .sendTransaction();\n * ```\n *\n * @example Sponsor pays fees + rent on behalf of the user\n * ```ts\n * import { payer, identity } from '@solana/kit-plugin-signer';\n *\n * const client = createClient()\n * .use(payer(sponsorSigner)) // pays gas + rent\n * .use(identity(userSigner)) // signs as delegator\n * .use(solanaLocalRpc())\n * .use(subscriptionsProgram());\n *\n * await client.subscriptions.instructions\n * .createFixedDelegation({ delegatee, nonce, amount, expiryTs, tokenMint })\n * .sendTransaction();\n * ```\n */\n\nimport {\n AccountRole,\n type Address,\n type ClientWithIdentity,\n type ClientWithPayer,\n type ClientWithRpc,\n type GetProgramAccountsApi,\n type Instruction,\n pipe,\n type TransactionSigner,\n} from '@solana/kit';\nimport { addSelfPlanAndSendFunctions, type SelfPlanAndSendFunctions } from '@solana/program-client-core';\nimport { findAssociatedTokenPda } from '@solana-program/token';\n\nimport { fetchDelegationsByDelegatee, fetchDelegationsByDelegator } from './accounts/delegations.js';\nimport { fetchPlansForOwner } from './accounts/plans.js';\nimport {\n fetchMaybeSubscriptionAuthority,\n fetchPlan,\n findEventAuthorityPda,\n findFixedDelegationPda,\n findPlanPda,\n findRecurringDelegationPda,\n findSubscriptionAuthorityPda,\n getCancelSubscriptionInstructionAsync,\n getCancelSubscriptionNowInstructionAsync,\n getCloseSubscriptionAuthorityInstruction,\n getCreateFixedDelegationInstruction,\n getCreatePlanInstruction,\n getCreateRecurringDelegationInstruction,\n getDeletePlanInstruction,\n getInitSubscriptionAuthorityInstructionAsync,\n getResumeSubscriptionInstructionAsync,\n getRevokeDelegationInstruction,\n getRevokeSubscriptionAuthorityInstruction,\n getSubscribeInstructionAsync,\n getTransferFixedInstruction,\n getTransferRecurringInstruction,\n getTransferSubscriptionInstruction,\n getUpdatePlanInstruction,\n type PlanStatus,\n SUBSCRIPTIONS_PROGRAM_ADDRESS,\n type SubscriptionsPlugin as GeneratedSubscriptionsPlugin,\n type SubscriptionsPluginRequirements as GeneratedSubscriptionsPluginRequirements,\n subscriptionsProgram as generatedSubscriptionsProgram,\n} from './generated/index.js';\nimport { resolveTransferHookAccounts, type TransferHookAccount } from './transfer-hook.js';\nimport type { Delegation } from './types/delegation.js';\nimport type { PlanWithAddress } from './types/plan.js';\nimport { assertMetadataUri, assertPositive, assertSafeU64, padPlanDestinations, padPlanPullers } from './validators.js';\n\ntype WithProgramAddress = { programAddress?: Address };\n\n/** Mark `K` keys of `T` as optional (used to relax overlay inputs that the\n * plugin can fill from `client.identity` / `client.payer`). */\ntype MakeOptional<T, K extends keyof T> = Omit<T, K> & { [P in K]?: T[P] };\n\nfunction pdaConfig(programAddress?: Address) {\n return programAddress ? { programAddress } : {};\n}\n\nasync function eventAccounts(programAddress?: Address) {\n const [eventAuthority] = await findEventAuthorityPda(pdaConfig(programAddress));\n return { eventAuthority, selfProgram: programAddress ?? SUBSCRIPTIONS_PROGRAM_ADDRESS };\n}\n\nfunction withTrailing<I extends Instruction>(\n instruction: I,\n trailing: Array<{\n address: Address;\n role: number;\n signer?: TransactionSigner;\n }>,\n): I {\n if (trailing.length === 0) return instruction;\n const accounts = [\n ...((instruction as Instruction & { accounts?: readonly unknown[] }).accounts ?? []),\n ...trailing,\n ];\n return { ...instruction, accounts };\n}\n\nfunction appendPayer<I extends Instruction>(instruction: I, payer: TransactionSigner | undefined): I {\n if (!payer) return instruction;\n return withTrailing(instruction, [\n {\n address: payer.address,\n role: AccountRole.WRITABLE_SIGNER,\n signer: payer,\n },\n ]);\n}\n\n// ============================================================================\n// Instruction overlay inputs\n// ============================================================================\n\nexport type InitSubscriptionAuthorityInput = WithProgramAddress & {\n owner: TransactionSigner;\n payer?: TransactionSigner;\n tokenMint: Address;\n tokenProgram: Address;\n userAta: Address;\n};\n\nexport type CloseSubscriptionAuthorityInput = WithProgramAddress & {\n receiver?: Address;\n tokenMint: Address;\n user: TransactionSigner;\n};\n\nexport type RevokeSubscriptionAuthorityInput = WithProgramAddress & {\n /** Rent recipient for closing the SubscriptionAuthority PDA. Required when the authority's stored payer differs from `user`, and must equal that stored payer. */\n receiver?: Address;\n tokenMint: Address;\n tokenProgram: Address;\n user: TransactionSigner;\n};\n\nexport type CreateFixedDelegationInput = WithProgramAddress & {\n amount: bigint | number;\n delegatee: Address;\n delegator: TransactionSigner;\n expectedSubscriptionAuthorityInitId?: bigint | number;\n expiryTs: bigint | number;\n nonce: bigint | number;\n payer?: TransactionSigner;\n tokenMint: Address;\n};\n\nexport type CreateRecurringDelegationInput = WithProgramAddress & {\n amountPerPeriod: bigint | number;\n delegatee: Address;\n delegator: TransactionSigner;\n expectedSubscriptionAuthorityInitId?: bigint | number;\n expiryTs: bigint | number;\n nonce: bigint | number;\n payer?: TransactionSigner;\n periodLengthS: bigint | number;\n /** Unix timestamp when the first period begins. Pass 0 to start when the\n * transaction lands on chain (requires a non-zero `expiryTs`). */\n startTs: bigint | number;\n tokenMint: Address;\n};\n\nexport type RevokeDelegationInput = WithProgramAddress & {\n authority: TransactionSigner;\n delegationAccount: Address;\n receiver?: Address;\n};\n\nexport type RevokeSubscriptionInput = WithProgramAddress & {\n authority: TransactionSigner;\n planPda: Address;\n receiver?: Address;\n subscriptionPda: Address;\n};\n\nexport type TransferDelegationInput = WithProgramAddress & {\n amount: bigint | number;\n delegatee: TransactionSigner;\n delegationPda: Address;\n delegator: Address;\n delegatorAta: Address;\n receiverAta: Address;\n tokenMint: Address;\n tokenProgram: Address;\n /** Token-2022 transfer-hook accounts. Leave unset: the plugin client resolves\n * them from the mint's hook. Set to override resolution, or when calling the\n * overlay instruction directly (which does not auto-resolve). */\n transferHookAccounts?: TransferHookAccount[];\n};\n\nexport type TransferSubscriptionInput = WithProgramAddress & {\n amount: bigint | number;\n caller: TransactionSigner;\n delegator: Address;\n planPda: Address;\n receiverAta: Address;\n subscriptionPda: Address;\n tokenMint: Address;\n tokenProgram: Address;\n /** Token-2022 transfer-hook accounts. Leave unset: the plugin client resolves\n * them from the mint's hook. Set to override resolution, or when calling the\n * overlay instruction directly (which does not auto-resolve). */\n transferHookAccounts?: TransferHookAccount[];\n};\n\nexport type CreatePlanInput = WithProgramAddress & {\n amount: bigint | number;\n destinations: Address[];\n endTs: bigint | number;\n metadataUri: string;\n mint: Address;\n owner: TransactionSigner;\n payer?: TransactionSigner;\n periodHours: bigint | number;\n planId: bigint | number;\n pullers: Address[];\n tokenProgram?: Address;\n};\n\nexport type UpdatePlanInput = WithProgramAddress & {\n endTs: bigint | number;\n /**\n * Live plan state observed at signing. If omitted, use the plugin\n * client's `updatePlan`, which fetches it via rpc.\n */\n expectedCreatedAt?: bigint | number;\n expectedEndTs?: bigint | number;\n expectedMetadataUri?: string;\n expectedPullers?: Address[];\n metadataUri: string;\n owner: TransactionSigner;\n planPda: Address;\n pullers: Address[];\n status: PlanStatus;\n};\n\nexport type DeletePlanInput = WithProgramAddress & {\n owner: TransactionSigner;\n planPda: Address;\n};\n\nexport type SubscribeInput = WithProgramAddress & {\n /**\n * Live plan terms snapshot the subscriber consents to. If omitted, the\n * caller must use the plugin client's `subscribe` (which fetches the live\n * plan via rpc); the standalone overlay cannot fetch on its own.\n */\n expectedAmount?: bigint | number;\n expectedCreatedAt?: bigint | number;\n expectedPeriodHours?: bigint | number;\n expectedSubscriptionAuthorityInitId?: bigint | number;\n merchant: Address;\n payer?: TransactionSigner;\n planId: bigint | number;\n subscriber: TransactionSigner;\n tokenMint: Address;\n};\n\nexport type CancelSubscriptionInput = WithProgramAddress & {\n planPda: Address;\n subscriber: TransactionSigner;\n subscriptionPda?: Address;\n};\n\nexport type CancelSubscriptionNowInput = WithProgramAddress & {\n expectedCurrentPeriodStartTs: bigint;\n merchant: TransactionSigner;\n planPda: Address;\n subscriber: TransactionSigner;\n subscriptionPda?: Address;\n};\n\nexport type ResumeSubscriptionInput = WithProgramAddress & {\n expectedExpiresAtTs: bigint;\n planPda: Address;\n subscriber: TransactionSigner;\n subscriptionPda?: Address;\n tokenMint: Address;\n};\n\n// ============================================================================\n// Overlay instruction builders (return Instruction / Promise<Instruction>)\n// ============================================================================\n\nexport async function getInitSubscriptionAuthorityOverlayInstructionAsync(\n input: InitSubscriptionAuthorityInput,\n): Promise<Instruction> {\n return appendPayer(\n await getInitSubscriptionAuthorityInstructionAsync(\n {\n owner: input.owner,\n tokenMint: input.tokenMint,\n tokenProgram: input.tokenProgram,\n userAta: input.userAta,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\nexport async function getCloseSubscriptionAuthorityOverlayInstructionAsync(\n input: CloseSubscriptionAuthorityInput,\n): Promise<Instruction> {\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.user.address },\n pdaConfig(input.programAddress),\n );\n let ix: Instruction = getCloseSubscriptionAuthorityInstruction(\n { subscriptionAuthority, user: input.user },\n pdaConfig(input.programAddress),\n );\n if (input.receiver) {\n ix = withTrailing(ix, [{ address: input.receiver, role: AccountRole.WRITABLE }]);\n }\n return ix;\n}\n\nexport async function getRevokeSubscriptionAuthorityOverlayInstructionAsync(\n input: RevokeSubscriptionAuthorityInput,\n): Promise<Instruction> {\n const [userAta] = await findAssociatedTokenPda({\n mint: input.tokenMint,\n owner: input.user.address,\n tokenProgram: input.tokenProgram,\n });\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.user.address },\n pdaConfig(input.programAddress),\n );\n let ix: Instruction = getRevokeSubscriptionAuthorityInstruction(\n {\n subscriptionAuthority,\n tokenMint: input.tokenMint,\n tokenProgram: input.tokenProgram,\n user: input.user,\n userAta,\n },\n pdaConfig(input.programAddress),\n );\n if (input.receiver) {\n ix = withTrailing(ix, [{ address: input.receiver, role: AccountRole.WRITABLE }]);\n }\n return ix;\n}\n\nexport async function getCreateFixedDelegationOverlayInstructionAsync(\n input: CreateFixedDelegationInput,\n): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n if (input.expectedSubscriptionAuthorityInitId === undefined) {\n throw new Error(\n 'getCreateFixedDelegationOverlayInstructionAsync requires expectedSubscriptionAuthorityInitId. Use the plugin client `subscriptions.instructions.createFixedDelegation(...)` to auto-fetch from the live authority.',\n );\n }\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator.address },\n pdaConfig(input.programAddress),\n );\n const [delegationPda] = await findFixedDelegationPda(\n {\n delegatee: input.delegatee,\n delegator: input.delegator.address,\n nonce: input.nonce,\n subscriptionAuthority,\n },\n pdaConfig(input.programAddress),\n );\n return appendPayer(\n getCreateFixedDelegationInstruction(\n {\n delegatee: input.delegatee,\n delegationAccount: delegationPda,\n delegator: input.delegator,\n fixedDelegation: {\n amount: input.amount,\n expectedSubscriptionAuthorityInitId: input.expectedSubscriptionAuthorityInitId,\n expiryTs: input.expiryTs,\n nonce: input.nonce,\n },\n subscriptionAuthority,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\nexport async function getCreateRecurringDelegationOverlayInstructionAsync(\n input: CreateRecurringDelegationInput,\n): Promise<Instruction> {\n assertPositive(input.amountPerPeriod, 'amountPerPeriod');\n assertPositive(input.periodLengthS, 'periodLengthS');\n if (input.expectedSubscriptionAuthorityInitId === undefined) {\n throw new Error(\n 'getCreateRecurringDelegationOverlayInstructionAsync requires expectedSubscriptionAuthorityInitId. Use the plugin client `subscriptions.instructions.createRecurringDelegation(...)` to auto-fetch from the live authority.',\n );\n }\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator.address },\n pdaConfig(input.programAddress),\n );\n const [delegationPda] = await findRecurringDelegationPda(\n {\n delegatee: input.delegatee,\n delegator: input.delegator.address,\n nonce: input.nonce,\n subscriptionAuthority,\n },\n pdaConfig(input.programAddress),\n );\n return appendPayer(\n getCreateRecurringDelegationInstruction(\n {\n delegatee: input.delegatee,\n delegationAccount: delegationPda,\n delegator: input.delegator,\n recurringDelegation: {\n amountPerPeriod: input.amountPerPeriod,\n expectedSubscriptionAuthorityInitId: input.expectedSubscriptionAuthorityInitId,\n expiryTs: input.expiryTs,\n nonce: input.nonce,\n periodLengthS: input.periodLengthS,\n startTs: input.startTs,\n },\n subscriptionAuthority,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\n/** Revoke a fixed/recurring delegation. For subscription PDAs use {@link getRevokeSubscriptionOverlayInstruction}. */\nexport function getRevokeDelegationOverlayInstruction(input: RevokeDelegationInput): Instruction {\n let ix: Instruction = getRevokeDelegationInstruction(\n {\n authority: input.authority,\n delegationAccount: input.delegationAccount,\n },\n pdaConfig(input.programAddress),\n );\n if (input.receiver) {\n ix = withTrailing(ix, [{ address: input.receiver, role: AccountRole.WRITABLE }]);\n }\n return ix;\n}\n\n/**\n * Revoke a subscription PDA. Trailing-account layout: `[planPda, receiver?]`.\n * For fixed/recurring delegations use {@link getRevokeDelegationOverlayInstruction}.\n */\nexport function getRevokeSubscriptionOverlayInstruction(input: RevokeSubscriptionInput): Instruction {\n const trailing: { address: Address; role: number }[] = [{ address: input.planPda, role: AccountRole.READONLY }];\n if (input.receiver) {\n trailing.push({ address: input.receiver, role: AccountRole.WRITABLE });\n }\n return withTrailing(\n getRevokeDelegationInstruction(\n {\n authority: input.authority,\n delegationAccount: input.subscriptionPda,\n },\n pdaConfig(input.programAddress),\n ),\n trailing,\n );\n}\n\nasync function getTransferDelegationOverlayInstructionAsync(\n input: TransferDelegationInput,\n getInstruction: typeof getTransferFixedInstruction | typeof getTransferRecurringInstruction,\n): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator },\n pdaConfig(input.programAddress),\n );\n return withTrailing(\n getInstruction(\n {\n ...(await eventAccounts(input.programAddress)),\n delegatee: input.delegatee,\n delegationPda: input.delegationPda,\n delegatorAta: input.delegatorAta,\n receiverAta: input.receiverAta,\n subscriptionAuthority,\n tokenMint: input.tokenMint,\n tokenProgram: input.tokenProgram,\n transferData: {\n amount: input.amount,\n delegator: input.delegator,\n mint: input.tokenMint,\n },\n },\n pdaConfig(input.programAddress),\n ),\n input.transferHookAccounts ?? [],\n );\n}\n\nexport function getTransferFixedOverlayInstructionAsync(input: TransferDelegationInput): Promise<Instruction> {\n return getTransferDelegationOverlayInstructionAsync(input, getTransferFixedInstruction);\n}\n\nexport function getTransferRecurringOverlayInstructionAsync(input: TransferDelegationInput): Promise<Instruction> {\n return getTransferDelegationOverlayInstructionAsync(input, getTransferRecurringInstruction);\n}\n\nexport async function getTransferSubscriptionOverlayInstructionAsync(\n input: TransferSubscriptionInput,\n): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator },\n pdaConfig(input.programAddress),\n );\n const [delegatorAta] = await findAssociatedTokenPda({\n mint: input.tokenMint,\n owner: input.delegator,\n tokenProgram: input.tokenProgram,\n });\n return withTrailing(\n getTransferSubscriptionInstruction(\n {\n ...(await eventAccounts(input.programAddress)),\n caller: input.caller,\n delegatorAta,\n planPda: input.planPda,\n receiverAta: input.receiverAta,\n subscriptionAuthority,\n subscriptionPda: input.subscriptionPda,\n tokenMint: input.tokenMint,\n tokenProgram: input.tokenProgram,\n transferData: {\n amount: input.amount,\n delegator: input.delegator,\n mint: input.tokenMint,\n },\n },\n pdaConfig(input.programAddress),\n ),\n input.transferHookAccounts ?? [],\n );\n}\n\nexport async function getCreatePlanOverlayInstructionAsync(input: CreatePlanInput): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n assertPositive(input.periodHours, 'periodHours');\n assertSafeU64(input.planId, 'planId');\n assertMetadataUri(input.metadataUri);\n const destinations = padPlanDestinations(input.destinations);\n const pullers = padPlanPullers(input.pullers);\n\n const [planPda] = await findPlanPda(\n { owner: input.owner.address, planId: input.planId },\n pdaConfig(input.programAddress),\n );\n\n return appendPayer(\n getCreatePlanInstruction(\n {\n merchant: input.owner,\n planData: {\n destinations,\n endTs: input.endTs,\n metadataUri: input.metadataUri,\n mint: input.mint,\n planId: input.planId,\n pullers,\n terms: {\n amount: input.amount,\n createdAt: 0n,\n periodHours: input.periodHours,\n },\n },\n planPda,\n tokenMint: input.mint,\n tokenProgram: input.tokenProgram,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\nexport async function getUpdatePlanOverlayInstruction(input: UpdatePlanInput): Promise<Instruction> {\n if (\n input.expectedCreatedAt === undefined ||\n input.expectedEndTs === undefined ||\n input.expectedPullers === undefined ||\n input.expectedMetadataUri === undefined\n ) {\n throw new Error(\n 'getUpdatePlanOverlayInstruction requires expectedCreatedAt, expectedEndTs, expectedPullers, and expectedMetadataUri. Use the plugin client `subscriptions.instructions.updatePlan(...)` to auto-fetch from the live plan.',\n );\n }\n assertMetadataUri(input.metadataUri);\n const pullers = padPlanPullers(input.pullers);\n const expectedPullers = padPlanPullers(input.expectedPullers);\n return getUpdatePlanInstruction(\n {\n ...(await eventAccounts(input.programAddress)),\n owner: input.owner,\n planPda: input.planPda,\n updatePlanData: {\n endTs: input.endTs,\n expectedCreatedAt: input.expectedCreatedAt,\n expectedEndTs: input.expectedEndTs,\n expectedMetadataUri: input.expectedMetadataUri,\n expectedPullers,\n metadataUri: input.metadataUri,\n pullers,\n status: input.status,\n },\n },\n pdaConfig(input.programAddress),\n );\n}\n\nexport function getDeletePlanOverlayInstruction(input: DeletePlanInput): Instruction {\n return getDeletePlanInstruction({ owner: input.owner, planPda: input.planPda }, pdaConfig(input.programAddress));\n}\n\nexport async function getSubscribeOverlayInstructionAsync(input: SubscribeInput): Promise<Instruction> {\n if (\n input.expectedAmount === undefined ||\n input.expectedPeriodHours === undefined ||\n input.expectedCreatedAt === undefined ||\n input.expectedSubscriptionAuthorityInitId === undefined\n ) {\n throw new Error(\n 'getSubscribeOverlayInstructionAsync requires expectedAmount, expectedPeriodHours, expectedCreatedAt, and expectedSubscriptionAuthorityInitId. Use the plugin client `subscriptions.instructions.subscribe(...)` to auto-fetch from the live plan and authority.',\n );\n }\n assertSafeU64(input.planId, 'planId');\n const [planPda, planBump] = await findPlanPda(\n { owner: input.merchant, planId: input.planId },\n pdaConfig(input.programAddress),\n );\n const [subscriptionAuthorityPda] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.subscriber.address },\n pdaConfig(input.programAddress),\n );\n return appendPayer(\n await getSubscribeInstructionAsync(\n {\n ...(await eventAccounts(input.programAddress)),\n merchant: input.merchant,\n planPda,\n subscribeData: {\n expectedAmount: input.expectedAmount,\n expectedCreatedAt: input.expectedCreatedAt,\n expectedMint: input.tokenMint,\n expectedPeriodHours: input.expectedPeriodHours,\n expectedSubscriptionAuthorityInitId: input.expectedSubscriptionAuthorityInitId,\n planBump,\n planId: input.planId,\n },\n subscriber: input.subscriber,\n subscriptionAuthorityPda,\n },\n pdaConfig(input.programAddress),\n ),\n input.payer,\n );\n}\n\nexport async function getCancelSubscriptionOverlayInstructionAsync(\n input: CancelSubscriptionInput,\n): Promise<Instruction> {\n return await getCancelSubscriptionInstructionAsync(\n {\n ...(await eventAccounts(input.programAddress)),\n planPda: input.planPda,\n subscriber: input.subscriber,\n subscriptionPda: input.subscriptionPda,\n },\n pdaConfig(input.programAddress),\n );\n}\n\nexport async function getCancelSubscriptionNowOverlayInstructionAsync(\n input: CancelSubscriptionNowInput,\n): Promise<Instruction> {\n return await getCancelSubscriptionNowInstructionAsync(\n {\n ...(await eventAccounts(input.programAddress)),\n cancelSubscriptionNowData: { expectedCurrentPeriodStartTs: input.expectedCurrentPeriodStartTs },\n merchant: input.merchant,\n planPda: input.planPda,\n subscriber: input.subscriber,\n subscriptionPda: input.subscriptionPda,\n },\n pdaConfig(input.programAddress),\n );\n}\n\nexport async function getResumeSubscriptionOverlayInstructionAsync(\n input: ResumeSubscriptionInput,\n): Promise<Instruction> {\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.subscriber.address },\n pdaConfig(input.programAddress),\n );\n return await getResumeSubscriptionInstructionAsync(\n {\n ...(await eventAccounts(input.programAddress)),\n planPda: input.planPda,\n resumeData: { expectedExpiresAtTs: input.expectedExpiresAtTs },\n subscriber: input.subscriber,\n subscriptionAuthority,\n subscriptionPda: input.subscriptionPda,\n },\n pdaConfig(input.programAddress),\n );\n}\n\n// ============================================================================\n// Plugin\n// ============================================================================\n\nexport type SubscriptionsPluginRequirements = ClientWithIdentity &\n ClientWithPayer &\n ClientWithRpc<GetProgramAccountsApi> &\n GeneratedSubscriptionsPluginRequirements;\n\ntype Self<T> = SelfPlanAndSendFunctions & T;\n\nexport type SubscriptionsPluginInstructions = {\n cancelSubscription: (input: MakeOptional<CancelSubscriptionInput, 'subscriber'>) => Self<Promise<Instruction>>;\n cancelSubscriptionNow: (\n input: MakeOptional<CancelSubscriptionNowInput, 'merchant' | 'subscriber'>,\n ) => Self<Promise<Instruction>>;\n closeSubscriptionAuthority: (\n input: MakeOptional<CloseSubscriptionAuthorityInput, 'user'>,\n ) => Self<Promise<Instruction>>;\n createFixedDelegation: (\n input: MakeOptional<CreateFixedDelegationInput, 'delegator' | 'payer'>,\n ) => Self<Promise<Instruction>>;\n createPlan: (input: MakeOptional<CreatePlanInput, 'owner'>) => Self<Promise<Instruction>>;\n createRecurringDelegation: (\n input: MakeOptional<CreateRecurringDelegationInput, 'delegator' | 'payer'>,\n ) => Self<Promise<Instruction>>;\n deletePlan: (input: MakeOptional<DeletePlanInput, 'owner'>) => Self<Instruction>;\n initSubscriptionAuthority: (\n input: MakeOptional<InitSubscriptionAuthorityInput, 'owner' | 'payer'>,\n ) => Self<Promise<Instruction>>;\n resumeSubscription: (input: MakeOptional<ResumeSubscriptionInput, 'subscriber'>) => Self<Promise<Instruction>>;\n revokeDelegation: (input: MakeOptional<RevokeDelegationInput, 'authority'>) => Self<Instruction>;\n revokeSubscription: (input: MakeOptional<RevokeSubscriptionInput, 'authority'>) => Self<Instruction>;\n revokeSubscriptionAuthority: (\n input: MakeOptional<RevokeSubscriptionAuthorityInput, 'user'>,\n ) => Self<Promise<Instruction>>;\n subscribe: (input: MakeOptional<SubscribeInput, 'payer' | 'subscriber'>) => Self<Promise<Instruction>>;\n transferFixed: (input: MakeOptional<TransferDelegationInput, 'delegatee'>) => Self<Promise<Instruction>>;\n transferRecurring: (input: MakeOptional<TransferDelegationInput, 'delegatee'>) => Self<Promise<Instruction>>;\n transferSubscription: (input: MakeOptional<TransferSubscriptionInput, 'caller'>) => Self<Promise<Instruction>>;\n updatePlan: (input: MakeOptional<UpdatePlanInput, 'owner'>) => Self<Promise<Instruction>>;\n};\n\nexport type SubscriptionsPluginQueries = {\n /** Counts of active delegations grouped by kind. */\n activeDelegationSummary: (wallet: Address) => Promise<{\n fixed: number;\n recurring: number;\n subscriptions: number;\n total: number;\n }>;\n /** All delegations where `wallet` is the delegatee. */\n delegationsByDelegatee: (wallet: Address) => Promise<Delegation[]>;\n /** All delegations where `wallet` is the delegator. */\n delegationsByDelegator: (wallet: Address) => Promise<Delegation[]>;\n /** Whether the SubscriptionAuthority PDA exists for `(user, tokenMint)`. */\n isSubscriptionAuthorityInitialized: (\n user: Address,\n tokenMint: Address,\n programAddress?: Address,\n ) => Promise<{ initialized: boolean; pda: Address }>;\n /** Plans owned by `owner`. */\n plansForOwner: (owner: Address) => Promise<PlanWithAddress[]>;\n};\n\nexport type SubscriptionsPlugin = Omit<GeneratedSubscriptionsPlugin, 'instructions'> & {\n instructions: SubscriptionsPluginInstructions;\n queries: SubscriptionsPluginQueries;\n};\n\nexport function subscriptionsProgram() {\n return <T extends SubscriptionsPluginRequirements>(client: T) => {\n return pipe(client, generatedSubscriptionsProgram(), c => {\n const queries: SubscriptionsPluginQueries = {\n activeDelegationSummary: async wallet => {\n const delegations = await fetchDelegationsByDelegator(c.rpc, wallet);\n let fixed = 0;\n let recurring = 0;\n let subscriptions = 0;\n for (const d of delegations) {\n if (d.kind === 'fixed') fixed++;\n else if (d.kind === 'recurring') recurring++;\n else if (d.kind === 'subscription') subscriptions++;\n }\n return { fixed, recurring, subscriptions, total: delegations.length };\n },\n delegationsByDelegatee: wallet => fetchDelegationsByDelegatee(c.rpc, wallet),\n delegationsByDelegator: wallet => fetchDelegationsByDelegator(c.rpc, wallet),\n isSubscriptionAuthorityInitialized: async (user, tokenMint, programAddress) => {\n const [pda] = await findSubscriptionAuthorityPda({ tokenMint, user }, pdaConfig(programAddress));\n const account = await fetchMaybeSubscriptionAuthority(c.rpc, pda);\n return { initialized: account.exists, pda };\n },\n plansForOwner: owner => fetchPlansForOwner(c.rpc, owner),\n };\n\n const resolveExpectedSubscriptionAuthorityInitId = async (\n tokenMint: Address,\n user: Address,\n programAddress: Address | undefined,\n expectedSubscriptionAuthorityInitId: bigint | number | undefined,\n ) => {\n if (expectedSubscriptionAuthorityInitId !== undefined) {\n return expectedSubscriptionAuthorityInitId;\n }\n const [subscriptionAuthorityPda] = await findSubscriptionAuthorityPda(\n { tokenMint, user },\n pdaConfig(programAddress),\n );\n const subscriptionAuthority = await fetchMaybeSubscriptionAuthority(c.rpc, subscriptionAuthorityPda);\n if (!subscriptionAuthority.exists) {\n throw new Error('SubscriptionAuthority is not initialized for this delegator and token mint.');\n }\n return subscriptionAuthority.data.initId;\n };\n\n const resolveDelegationHookAccounts = async (input: Omit<TransferDelegationInput, 'delegatee'>) => {\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator },\n pdaConfig(input.programAddress),\n );\n return await resolveTransferHookAccounts(c.rpc, {\n amount: input.amount,\n authority: subscriptionAuthority,\n destination: input.receiverAta,\n mint: input.tokenMint,\n source: input.delegatorAta,\n tokenProgram: input.tokenProgram,\n transferHookAccounts: input.transferHookAccounts,\n });\n };\n\n const instructions: SubscriptionsPluginInstructions = {\n cancelSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n getCancelSubscriptionOverlayInstructionAsync({\n ...input,\n subscriber: input.subscriber ?? client.identity,\n }),\n ),\n cancelSubscriptionNow: input =>\n addSelfPlanAndSendFunctions(\n client,\n getCancelSubscriptionNowOverlayInstructionAsync({\n ...input,\n merchant: input.merchant ?? client.payer,\n subscriber: input.subscriber ?? client.identity,\n }),\n ),\n closeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(\n client,\n getCloseSubscriptionAuthorityOverlayInstructionAsync({\n ...input,\n user: input.user ?? client.identity,\n }),\n ),\n createFixedDelegation: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n const delegator = input.delegator ?? client.identity;\n const expectedSubscriptionAuthorityInitId =\n await resolveExpectedSubscriptionAuthorityInitId(\n input.tokenMint,\n delegator.address,\n input.programAddress,\n input.expectedSubscriptionAuthorityInitId,\n );\n return await getCreateFixedDelegationOverlayInstructionAsync({\n ...input,\n delegator,\n expectedSubscriptionAuthorityInitId,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n });\n })(),\n ),\n createPlan: input =>\n addSelfPlanAndSendFunctions(\n client,\n getCreatePlanOverlayInstructionAsync({\n ...input,\n owner: input.owner ?? client.identity,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n }),\n ),\n createRecurringDelegation: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n const delegator = input.delegator ?? client.identity;\n const expectedSubscriptionAuthorityInitId =\n await resolveExpectedSubscriptionAuthorityInitId(\n input.tokenMint,\n delegator.address,\n input.programAddress,\n input.expectedSubscriptionAuthorityInitId,\n );\n return await getCreateRecurringDelegationOverlayInstructionAsync({\n ...input,\n delegator,\n expectedSubscriptionAuthorityInitId,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n });\n })(),\n ),\n deletePlan: input =>\n addSelfPlanAndSendFunctions(\n client,\n getDeletePlanOverlayInstruction({\n ...input,\n owner: input.owner ?? client.identity,\n }),\n ),\n initSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(\n client,\n getInitSubscriptionAuthorityOverlayInstructionAsync({\n ...input,\n owner: input.owner ?? client.identity,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n }),\n ),\n resumeSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n getResumeSubscriptionOverlayInstructionAsync({\n ...input,\n subscriber: input.subscriber ?? client.identity,\n }),\n ),\n revokeDelegation: input =>\n addSelfPlanAndSendFunctions(\n client,\n getRevokeDelegationOverlayInstruction({\n ...input,\n authority: input.authority ?? client.identity,\n }),\n ),\n revokeSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n getRevokeSubscriptionOverlayInstruction({\n ...input,\n authority: input.authority ?? client.identity,\n }),\n ),\n revokeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(\n client,\n getRevokeSubscriptionAuthorityOverlayInstructionAsync({\n ...input,\n user: input.user ?? client.identity,\n }),\n ),\n subscribe: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n const subscriber = input.subscriber ?? client.identity;\n assertSafeU64(input.planId, 'planId');\n let {\n expectedAmount,\n expectedCreatedAt,\n expectedPeriodHours,\n expectedSubscriptionAuthorityInitId,\n } = input;\n if (\n expectedAmount === undefined ||\n expectedPeriodHours === undefined ||\n expectedCreatedAt === undefined\n ) {\n const [planPda] = await findPlanPda(\n { owner: input.merchant, planId: input.planId },\n pdaConfig(input.programAddress),\n );\n const plan = await fetchPlan(c.rpc, planPda);\n expectedAmount = expectedAmount ?? plan.data.data.terms.amount;\n expectedPeriodHours = expectedPeriodHours ?? plan.data.data.terms.periodHours;\n expectedCreatedAt = expectedCreatedAt ?? plan.data.data.terms.createdAt;\n }\n if (expectedSubscriptionAuthorityInitId === undefined) {\n const [subscriptionAuthorityPda] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: subscriber.address },\n pdaConfig(input.programAddress),\n );\n const subscriptionAuthority = await fetchMaybeSubscriptionAuthority(\n c.rpc,\n subscriptionAuthorityPda,\n );\n if (!subscriptionAuthority.exists) {\n throw new Error(\n 'SubscriptionAuthority is not initialized for this subscriber and token mint.',\n );\n }\n expectedSubscriptionAuthorityInitId = subscriptionAuthority.data.initId;\n }\n return await getSubscribeOverlayInstructionAsync({\n ...input,\n expectedAmount,\n expectedCreatedAt,\n expectedPeriodHours,\n expectedSubscriptionAuthorityInitId,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n subscriber,\n });\n })(),\n ),\n transferFixed: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () =>\n await getTransferFixedOverlayInstructionAsync({\n ...input,\n delegatee: input.delegatee ?? client.identity,\n transferHookAccounts: await resolveDelegationHookAccounts(input),\n }))(),\n ),\n transferRecurring: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () =>\n await getTransferRecurringOverlayInstructionAsync({\n ...input,\n delegatee: input.delegatee ?? client.identity,\n transferHookAccounts: await resolveDelegationHookAccounts(input),\n }))(),\n ),\n transferSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n const [subscriptionAuthority] = await findSubscriptionAuthorityPda(\n { tokenMint: input.tokenMint, user: input.delegator },\n pdaConfig(input.programAddress),\n );\n const [delegatorAta] = await findAssociatedTokenPda({\n mint: input.tokenMint,\n owner: input.delegator,\n tokenProgram: input.tokenProgram,\n });\n const transferHookAccounts = await resolveTransferHookAccounts(c.rpc, {\n amount: input.amount,\n authority: subscriptionAuthority,\n destination: input.receiverAta,\n mint: input.tokenMint,\n source: delegatorAta,\n tokenProgram: input.tokenProgram,\n transferHookAccounts: input.transferHookAccounts,\n });\n return await getTransferSubscriptionOverlayInstructionAsync({\n ...input,\n caller: input.caller ?? client.identity,\n transferHookAccounts,\n });\n })(),\n ),\n updatePlan: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n let { expectedCreatedAt, expectedEndTs, expectedMetadataUri, expectedPullers } = input;\n if (\n expectedCreatedAt === undefined ||\n expectedEndTs === undefined ||\n expectedPullers === undefined ||\n expectedMetadataUri === undefined\n ) {\n const plan = await fetchPlan(c.rpc, input.planPda);\n expectedCreatedAt = expectedCreatedAt ?? plan.data.data.terms.createdAt;\n expectedEndTs = expectedEndTs ?? plan.data.data.endTs;\n expectedMetadataUri = expectedMetadataUri ?? plan.data.data.metadataUri;\n expectedPullers = expectedPullers ?? [...plan.data.data.pullers];\n }\n return await getUpdatePlanOverlayInstruction({\n ...input,\n expectedCreatedAt,\n expectedEndTs,\n expectedMetadataUri,\n expectedPullers,\n owner: input.owner ?? client.identity,\n });\n })(),\n ),\n };\n\n return {\n ...c,\n subscriptions: {\n ...c.subscriptions,\n instructions,\n queries,\n },\n };\n });\n };\n}\n","/**\n * Token-2022 transfer-hook account resolution, ported to `@solana/kit` from the\n * web3.js `@solana/spl-token` resolver (the kit client ships no equivalent).\n * Computes the trailing accounts a hooked `TransferChecked` must forward.\n */\n\nimport {\n AccountRole,\n type Address,\n fetchEncodedAccount,\n getAddressDecoder,\n getAddressEncoder,\n getProgramDerivedAddress,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport { fetchMint, TOKEN_2022_PROGRAM_ADDRESS } from '@solana-program/token-2022';\n\nexport type TransferHookAccount = { address: Address; role: AccountRole };\n\n/** Identity of the four base `Execute` accounts and the transfer amount, needed\n * to resolve seed- and instruction-data-derived extra accounts. */\nexport type ResolveTransferHookArgs = {\n amount: bigint | number;\n authority: Address;\n destination: Address;\n mint: Address;\n source: Address;\n tokenProgram: Address;\n transferHookAccounts?: TransferHookAccount[];\n};\n\nconst DEFAULT_ADDRESS = '11111111111111111111111111111111' as Address;\nconst EXTRA_ACCOUNT_METAS_SEED = 'extra-account-metas';\nconst TLV_HEADER_LEN = 12; // u64 discriminator + u32 length\nconst POD_SLICE_COUNT_LEN = 4;\nconst EXTRA_ACCOUNT_META_LEN = 35;\nconst ADDRESS_LEN = 32;\nconst PDA_PROGRAM_INDEX_OFFSET = 1 << 7;\n// sha256(\"spl-transfer-hook-interface:execute\")[..8]\nconst EXECUTE_DISCRIMINATOR = Uint8Array.from([0x69, 0x25, 0x65, 0xc5, 0x4b, 0xfb, 0x66, 0x1a]);\n\nconst addressDecoder = getAddressDecoder();\nconst addressEncoder = getAddressEncoder();\n\nfunction roleFor(isSigner: boolean, isWritable: boolean): AccountRole {\n if (isSigner && isWritable) return AccountRole.WRITABLE_SIGNER;\n if (isSigner) return AccountRole.READONLY_SIGNER;\n if (isWritable) return AccountRole.WRITABLE;\n return AccountRole.READONLY;\n}\n\nasync function fetchData(rpc: ResolveRpc, address: Address): Promise<ReadonlyUint8Array> {\n const account = await fetchEncodedAccount(rpc, address);\n if (!account.exists) throw new Error('transfer hook: referenced account not found');\n return account.data;\n}\n\ntype ResolveRpc = Parameters<typeof fetchMint>[0];\ntype RawMeta = { addressConfig: ReadonlyUint8Array; discriminator: number; isSigner: boolean; isWritable: boolean };\n\nfunction executeInstructionData(amount: bigint | number): Uint8Array {\n const data = new Uint8Array(EXECUTE_DISCRIMINATOR.length + 8);\n data.set(EXECUTE_DISCRIMINATOR, 0);\n new DataView(data.buffer).setBigUint64(EXECUTE_DISCRIMINATOR.length, BigInt(amount), true);\n return data;\n}\n\nfunction readMetas(data: ReadonlyUint8Array): RawMeta[] {\n if (data.length < TLV_HEADER_LEN || !EXECUTE_DISCRIMINATOR.every((byte, i) => data[i] === byte)) {\n return [];\n }\n const view = new DataView(data.buffer, data.byteOffset, data.byteLength);\n const count = view.getUint32(TLV_HEADER_LEN, true);\n const metas: RawMeta[] = [];\n let offset = TLV_HEADER_LEN + POD_SLICE_COUNT_LEN;\n for (let n = 0; n < count && offset + EXTRA_ACCOUNT_META_LEN <= data.length; n++) {\n metas.push({\n addressConfig: data.subarray(offset + 1, offset + 33),\n discriminator: data[offset],\n isSigner: data[offset + 33] === 1,\n isWritable: data[offset + 34] === 1,\n });\n offset += EXTRA_ACCOUNT_META_LEN;\n }\n return metas;\n}\n\nasync function unpackSeeds(\n config: ReadonlyUint8Array,\n previous: TransferHookAccount[],\n instructionData: Uint8Array,\n rpc: ResolveRpc,\n): Promise<ReadonlyUint8Array[]> {\n const seeds: ReadonlyUint8Array[] = [];\n let i = 0;\n while (i < 32) {\n const discriminator = config[i];\n const rest = config.subarray(i + 1);\n if (discriminator === 0) break;\n if (discriminator === 1) {\n const length = rest[0];\n seeds.push(rest.subarray(1, 1 + length));\n i += 2 + length;\n } else if (discriminator === 2) {\n const [index, length] = [rest[0], rest[1]];\n seeds.push(instructionData.subarray(index, index + length));\n i += 3;\n } else if (discriminator === 3) {\n seeds.push(addressEncoder.encode(previous[rest[0]].address));\n i += 2;\n } else if (discriminator === 4) {\n const [accountIndex, dataIndex, length] = [rest[0], rest[1], rest[2]];\n const data = await fetchData(rpc, previous[accountIndex].address);\n seeds.push(data.subarray(dataIndex, dataIndex + length));\n i += 4;\n } else {\n throw new Error('transfer hook: invalid seed');\n }\n }\n return seeds;\n}\n\nasync function unpackAddressData(\n config: ReadonlyUint8Array,\n previous: TransferHookAccount[],\n instructionData: Uint8Array,\n rpc: ResolveRpc,\n): Promise<Address> {\n const rest = config.subarray(1);\n if (config[0] === 1) {\n const offset = rest[0];\n return addressDecoder.decode(instructionData.subarray(offset, offset + ADDRESS_LEN));\n }\n if (config[0] === 2) {\n const [accountIndex, offset] = [rest[0], rest[1]];\n const data = await fetchData(rpc, previous[accountIndex].address);\n return addressDecoder.decode(data.subarray(offset, offset + ADDRESS_LEN));\n }\n throw new Error('transfer hook: invalid address data');\n}\n\nasync function resolveMeta(\n meta: RawMeta,\n previous: TransferHookAccount[],\n instructionData: Uint8Array,\n hookProgram: Address,\n rpc: ResolveRpc,\n): Promise<TransferHookAccount> {\n const role = roleFor(meta.isSigner, meta.isWritable);\n if (meta.discriminator === 0) {\n return { address: addressDecoder.decode(meta.addressConfig), role };\n }\n if (meta.discriminator === 2) {\n return { address: await unpackAddressData(meta.addressConfig, previous, instructionData, rpc), role };\n }\n const programId =\n meta.discriminator === 1 ? hookProgram : previous[meta.discriminator - PDA_PROGRAM_INDEX_OFFSET].address;\n const seeds = await unpackSeeds(meta.addressConfig, previous, instructionData, rpc);\n const [pda] = await getProgramDerivedAddress({ programAddress: programId, seeds });\n return { address: pda, role };\n}\n\n/**\n * Trailing hook accounts for a `TransferChecked` — `[hook program, validation PDA,\n * ...resolved extras]`. Returns `[]` for non-2022, no-hook, or inert mints, and\n * the explicit `transferHookAccounts` verbatim when provided.\n */\nexport async function resolveTransferHookAccounts(\n rpc: ResolveRpc,\n args: ResolveTransferHookArgs,\n): Promise<TransferHookAccount[]> {\n if (args.transferHookAccounts?.length) return args.transferHookAccounts;\n if (args.tokenProgram !== TOKEN_2022_PROGRAM_ADDRESS) return [];\n\n const { data } = await fetchMint(rpc, args.mint);\n const extensions = data.extensions.__option === 'Some' ? data.extensions.value : [];\n const hook = extensions.find(extension => extension.__kind === 'TransferHook');\n if (!hook || hook.programId === DEFAULT_ADDRESS) return [];\n\n const hookProgram = hook.programId;\n const [validationPda] = await getProgramDerivedAddress({\n programAddress: hookProgram,\n seeds: [EXTRA_ACCOUNT_METAS_SEED, addressEncoder.encode(args.mint)],\n });\n\n const trailing: TransferHookAccount[] = [\n { address: hookProgram, role: AccountRole.READONLY },\n { address: validationPda, role: AccountRole.READONLY },\n ];\n\n const validationAccount = await fetchEncodedAccount(rpc, validationPda);\n if (!validationAccount.exists) return trailing;\n\n const instructionData = executeInstructionData(args.amount);\n const previous: TransferHookAccount[] = [\n { address: args.source, role: AccountRole.READONLY },\n { address: args.mint, role: AccountRole.READONLY },\n { address: args.destination, role: AccountRole.READONLY },\n { address: args.authority, role: AccountRole.READONLY },\n { address: validationPda, role: AccountRole.READONLY },\n ];\n for (const meta of readMetas(validationAccount.data)) {\n const resolved = await resolveMeta(meta, previous, instructionData, hookProgram, rpc);\n previous.push(resolved);\n trailing.push(resolved);\n }\n return trailing;\n}\n","import type { Address } from '@solana/kit';\n\nimport { MAX_PLAN_DESTINATIONS, MAX_PLAN_PULLERS, METADATA_URI_LEN, ZERO_ADDRESS } from './constants.js';\n\nconst textEncoder = new TextEncoder();\n\n/** Client-side validation failure (e.g. max destinations exceeded). */\nexport class ValidationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'ValidationError';\n }\n}\n\nexport function assertPositive(value: bigint | number, name: string): void {\n if (BigInt(value) <= 0n) throw new ValidationError(`${name} must be greater than zero`);\n}\n\nexport function assertSafeU64(value: bigint | number, name: string): void {\n if (typeof value === 'number' && !Number.isSafeInteger(value))\n throw new ValidationError(`${name} must be a bigint or a safe integer (numbers above 2^53-1 lose precision)`);\n}\n\nexport function assertMetadataUri(metadataUri: string): void {\n if (textEncoder.encode(metadataUri).length > METADATA_URI_LEN)\n throw new ValidationError(`metadataUri exceeds ${METADATA_URI_LEN} bytes`);\n}\n\nexport function assertMaxLen(arr: unknown[], max: number, name: string): void {\n if (arr.length > max) throw new ValidationError(`${name} must have at most ${max} entries`);\n}\n\nexport function padAddresses(addresses: Address[], maxLen: number): Address[] {\n return Array.from({ length: maxLen }, (_, i) => addresses[i] ?? ZERO_ADDRESS);\n}\n\nexport function padPlanDestinations(addresses: Address[]): Address[] {\n assertMaxLen(addresses, MAX_PLAN_DESTINATIONS, 'destinations');\n return padAddresses(addresses, MAX_PLAN_DESTINATIONS);\n}\n\nexport function padPlanPullers(addresses: Address[]): [Address, Address, Address, Address] {\n assertMaxLen(addresses, MAX_PLAN_PULLERS, 'pullers');\n return padAddresses(addresses, MAX_PLAN_PULLERS) as [Address, Address, Address, Address];\n}\n"],"mappings":";AAOA,SAAS,wBAAwB;;;ACCjC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAWG;;;ACnBP,SAAS,0BAA0B,sBAAgE;AAEnG,eAAsB,sBAClB,SAAmD,CAAC,GACtB;AAC9B,QAAM;AAAA,IACF,iBAAiB;AAAA,EACrB,IAAI;AACJ,SAAO,MAAM,yBAAyB,EAAE,gBAAgB,OAAO,CAAC,eAAe,EAAE,OAAO,iBAAiB,CAAC,EAAE,CAAC;AACjH;;;ACTA;AAAA,EACI;AAAA,EACA,4BAAAA;AAAA,EACA;AAAA,EACA,kBAAAC;AAAA,OAGG;AASP,eAAsB,uBAClB,OACA,SAAmD,CAAC,GACtB;AAC9B,QAAM;AAAA,IACF,iBAAiB;AAAA,EACrB,IAAI;AACJ,SAAO,MAAMD,0BAAyB;AAAA,IAClC;AAAA,IACA,OAA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AAM;AAAA,cACd,WAAW;AAAA,cACX,aAAa,MAAM;AAAA,cACnB,MAAM,MAAM;AAAA,cACZ,QAAQ;AAAA,cACR,cAAc,MAAM;AAAA,cACpB,sBAAsB,MAAM;AAAA,YAChC,CAAC;AACD,mBAAO,MAAM,+CAA+C;AAAA,cACxD,GAAG;AAAA,cACH,QAAQ,MAAM,UAAU,OAAO;AAAA,cAC/B;AAAA,YACJ,CAAC;AAAA,UACL,GAAG;AAAA,QACP;AAAA,QACJ,YAAY,WACRA;AAAA,UACI;AAAA,WACC,YAAY;AACT,gBAAI,EAAE,mBAAmB,eAAe,qBAAqB,gBAAgB,IAAI;AACjF,gBACI,sBAAsB,UACtB,kBAAkB,UAClB,oBAAoB,UACpB,wBAAwB,QAC1B;AACE,oBAAM,OAAO,MAAM,UAAU,EAAE,KAAK,MAAM,OAAO;AACjD,kCAAoB,qBAAqB,KAAK,KAAK,KAAK,MAAM;AAC9D,8BAAgB,iBAAiB,KAAK,KAAK,KAAK;AAChD,oCAAsB,uBAAuB,KAAK,KAAK,KAAK;AAC5D,gCAAkB,mBAAmB,CAAC,GAAG,KAAK,KAAK,KAAK,OAAO;AAAA,YACnE;AACA,mBAAO,MAAM,gCAAgC;AAAA,cACzC,GAAG;AAAA,cACH;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,OAAO,MAAM,SAAS,OAAO;AAAA,YACjC,CAAC;AAAA,UACL,GAAG;AAAA,QACP;AAAA,MACR;AAEA,aAAO;AAAA,QACH,GAAG;AAAA,QACH,eAAe;AAAA,UACX,GAAG,EAAE;AAAA,UACL;AAAA,UACA;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;","names":["getProgramDerivedAddress","getUtf8Encoder","getAddressEncoder","getProgramDerivedAddress","getU64Encoder","getUtf8Encoder","getAddressEncoder","getProgramDerivedAddress","getU64Encoder","getUtf8Encoder","getAddressEncoder","getProgramDerivedAddress","getUtf8Encoder","getAddressEncoder","getProgramDerivedAddress","getUtf8Encoder","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","combineCodec","AccountDiscriminator","combineCodec","getStructDecoder","getStructEncoder","combineCodec","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Encoder","combineCodec","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","combineCodec","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","combineCodec","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getUtf8Encoder","getStructEncoder","getU64Encoder","getAddressEncoder","getI64Encoder","getUtf8Encoder","getStructDecoder","getU64Decoder","getAddressDecoder","getI64Decoder","combineCodec","combineCodec","getEnumDecoder","getEnumEncoder","PlanStatus","combineCodec","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","combineCodec","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","combineCodec","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","combineCodec","getAddressDecoder","getAddressEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","combineCodec","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getArrayDecoder","getArrayEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Decoder","getUtf8Encoder","getStructEncoder","getAddressEncoder","getU64Encoder","getI64Encoder","getStructDecoder","getAddressDecoder","getU64Decoder","getI64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getAddressDecoder","getAddressEncoder","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getStructEncoder","getU8Encoder","getAddressEncoder","getStructDecoder","getU8Decoder","getAddressDecoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getStructEncoder","getAddressEncoder","getI64Encoder","getU64Encoder","getStructDecoder","getAddressDecoder","getI64Decoder","getU64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getAddressDecoder","getAddressEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getStructEncoder","getU8Encoder","getAddressEncoder","getI64Encoder","getStructDecoder","getU8Decoder","getAddressDecoder","getI64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getStructEncoder","getU64Encoder","getI64Encoder","getStructDecoder","getU64Decoder","getI64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","getU8Encoder","SolanaError","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","getU8Encoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getUtf8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getU8Encoder","transformEncoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","getProgramDerivedAddress","getUtf8Encoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SubscriptionsAccount","SubscriptionsInstruction","getU8Encoder","SolanaError","AccountRole","addSelfPlanAndSendFunctions","fetchEncodedAccount","getAddressDecoder","getAddressEncoder","getProgramDerivedAddress","AccountRole","subscriptionsProgram","addSelfPlanAndSendFunctions"]}