@solana/subscriptions 0.0.0 → 0.2.0
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/LICENSE +9 -0
- package/README.md +118 -0
- package/dist/index.cjs +3576 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2019 -0
- package/dist/index.d.ts +2019 -0
- package/dist/index.js +3581 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -8
|
@@ -0,0 +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/revokeDelegation.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/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 = { nonce: bigint; amount: bigint; expiryTs: bigint };\n\nexport type CreateFixedDelegationDataArgs = {\n nonce: number | bigint;\n amount: number | bigint;\n expiryTs: number | bigint;\n};\n\nexport function getCreateFixedDelegationDataEncoder(): FixedSizeEncoder<CreateFixedDelegationDataArgs> {\n return getStructEncoder([\n ['nonce', getU64Encoder()],\n ['amount', getU64Encoder()],\n ['expiryTs', getI64Encoder()],\n ]);\n}\n\nexport function getCreateFixedDelegationDataDecoder(): FixedSizeDecoder<CreateFixedDelegationData> {\n return getStructDecoder([\n ['nonce', getU64Decoder()],\n ['amount', getU64Decoder()],\n ['expiryTs', 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};\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};\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 ]);\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 ]);\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};\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};\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 ]);\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 ]);\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__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__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__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\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_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_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_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__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_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_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_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__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 getRevokeDelegationInstruction,\n getSubscribeInstructionAsync,\n getTransferFixedInstruction,\n getTransferRecurringInstruction,\n getTransferSubscriptionInstruction,\n getUpdatePlanInstruction,\n parseCancelSubscriptionInstruction,\n parseCloseSubscriptionAuthorityInstruction,\n parseCreateFixedDelegationInstruction,\n parseCreatePlanInstruction,\n parseCreateRecurringDelegationInstruction,\n parseDeletePlanInstruction,\n parseInitSubscriptionAuthorityInstruction,\n parseResumeSubscriptionInstruction,\n parseRevokeDelegationInstruction,\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 ParsedRevokeDelegationInstruction,\n type ParsedSubscribeInstruction,\n type ParsedTransferFixedInstruction,\n type ParsedTransferRecurringInstruction,\n type ParsedTransferSubscriptionInstruction,\n type ParsedUpdatePlanInstruction,\n type ResumeSubscriptionAsyncInput,\n type RevokeDelegationInput,\n type SubscribeAsyncInput,\n type TransferFixedInput,\n type TransferRecurringInput,\n type TransferSubscriptionInput,\n type UpdatePlanInput,\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}\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 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 | ({\n instructionType: SubscriptionsInstruction.ResumeSubscription;\n } & ParsedResumeSubscriptionInstruction<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 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: TransferFixedInput,\n ) => ReturnType<typeof getTransferFixedInstruction> & SelfPlanAndSendFunctions;\n transferRecurring: (\n input: TransferRecurringInput,\n ) => ReturnType<typeof getTransferRecurringInstruction> & SelfPlanAndSendFunctions;\n closeSubscriptionAuthority: (\n input: CloseSubscriptionAuthorityInput,\n ) => ReturnType<typeof getCloseSubscriptionAuthorityInstruction> & SelfPlanAndSendFunctions;\n createPlan: (input: CreatePlanInput) => ReturnType<typeof getCreatePlanInstruction> & SelfPlanAndSendFunctions;\n updatePlan: (input: UpdatePlanInput) => ReturnType<typeof getUpdatePlanInstruction> & SelfPlanAndSendFunctions;\n deletePlan: (input: DeletePlanInput) => ReturnType<typeof getDeletePlanInstruction> & SelfPlanAndSendFunctions;\n transferSubscription: (\n input: TransferSubscriptionInput,\n ) => ReturnType<typeof getTransferSubscriptionInstruction> & 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};\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 => addSelfPlanAndSendFunctions(client, getTransferFixedInstruction(input)),\n transferRecurring: input =>\n addSelfPlanAndSendFunctions(client, getTransferRecurringInstruction(input)),\n closeSubscriptionAuthority: input =>\n addSelfPlanAndSendFunctions(client, getCloseSubscriptionAuthorityInstruction(input)),\n createPlan: input => addSelfPlanAndSendFunctions(client, getCreatePlanInstruction(input)),\n updatePlan: input => addSelfPlanAndSendFunctions(client, getUpdatePlanInstruction(input)),\n deletePlan: input => addSelfPlanAndSendFunctions(client, getDeletePlanInstruction(input)),\n transferSubscription: input =>\n addSelfPlanAndSendFunctions(client, getTransferSubscriptionInstruction(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 },\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 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 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> = '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7',\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 =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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.eventAuthority.value) {\n accounts.eventAuthority.value =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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 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 ...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> = {\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};\n\nexport function getCloseSubscriptionAuthorityInstruction<\n TAccountUser extends string,\n TAccountSubscriptionAuthority extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CloseSubscriptionAuthorityInput<TAccountUser, TAccountSubscriptionAuthority>,\n config?: { programAddress?: TProgramAddress },\n): CloseSubscriptionAuthorityInstruction<TProgramAddress, TAccountUser, TAccountSubscriptionAuthority> {\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 };\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('user', accounts.user),\n getAccountMeta('subscriptionAuthority', accounts.subscriptionAuthority),\n ],\n data: getCloseSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as CloseSubscriptionAuthorityInstruction<TProgramAddress, TAccountUser, TAccountSubscriptionAuthority>);\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 };\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 return {\n programAddress: instruction.programAddress,\n accounts: { user: getNextAccount(), subscriptionAuthority: getNextAccount() },\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 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 ...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> = {\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 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 TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CreateFixedDelegationInput<\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateFixedDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram\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 };\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, 'programId');\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 ],\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 >);\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 };\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 return {\n programAddress: instruction.programAddress,\n accounts: {\n delegator: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegationAccount: getNextAccount(),\n delegatee: getNextAccount(),\n systemProgram: getNextAccount(),\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 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 ...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> = {\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 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 TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: CreateRecurringDelegationInput<\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateRecurringDelegationInstruction<\n TProgramAddress,\n TAccountDelegator,\n TAccountSubscriptionAuthority,\n TAccountDelegationAccount,\n TAccountDelegatee,\n TAccountSystemProgram\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 };\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, 'programId');\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 ],\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 >);\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 };\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 return {\n programAddress: instruction.programAddress,\n accounts: {\n delegator: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegationAccount: getNextAccount(),\n delegatee: getNextAccount(),\n systemProgram: getNextAccount(),\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 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 ...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> = {\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};\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 TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: InitSubscriptionAuthorityAsyncInput<\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram\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 };\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, 'programId');\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 ],\n data: getInitSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram\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> = {\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};\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 TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: InitSubscriptionAuthorityInput<\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram\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 };\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, 'programId');\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 ],\n data: getInitSubscriptionAuthorityInstructionDataEncoder().encode({}),\n programAddress,\n } as InitSubscriptionAuthorityInstruction<\n TProgramAddress,\n TAccountOwner,\n TAccountSubscriptionAuthority,\n TAccountTokenMint,\n TAccountUserAta,\n TAccountSystemProgram,\n TAccountTokenProgram\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 };\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 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 },\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 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 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 TAccountEventAuthority extends string | AccountMeta<string> = '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7',\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 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 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 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 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 TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ResumeSubscriptionInstruction<\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 =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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: getResumeSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\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 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 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 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 TAccountEventAuthority,\n TAccountSelfProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ResumeSubscriptionInstruction<\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.eventAuthority.value) {\n accounts.eventAuthority.value =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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: getResumeSubscriptionInstructionDataEncoder().encode({}),\n programAddress,\n } as ResumeSubscriptionInstruction<\n TProgramAddress,\n TAccountSubscriber,\n TAccountPlanPda,\n TAccountSubscriptionPda,\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 event authority PDA */\n eventAuthority: TAccountMetas[3];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[4];\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 < 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: 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 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 { 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> = '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7',\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 ? 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 ...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> = {\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 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 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 >,\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 >\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 };\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 =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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('subscriptionAuthorityPda', accounts.subscriptionAuthorityPda),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\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 >);\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> = {\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 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 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 >,\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> {\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 };\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.eventAuthority.value) {\n accounts.eventAuthority.value =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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('subscriptionAuthorityPda', accounts.subscriptionAuthorityPda),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('eventAuthority', accounts.eventAuthority),\n getAccountMeta('selfProgram', accounts.selfProgram),\n ],\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 >);\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 };\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 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 },\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 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 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 TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7',\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 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 TransferFixedInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta 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 /** 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 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 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 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 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 =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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('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 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 /** Token program */\n tokenProgram: TAccountMetas[4];\n /** The delegatee signing the transfer */\n delegatee: TAccountMetas[5];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[6];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[7];\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 < 8) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 8,\n });\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n delegationPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: 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 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 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 TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountDelegatee extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7',\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 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 TransferRecurringInput<\n TAccountDelegationPda extends string = string,\n TAccountSubscriptionAuthority extends string = string,\n TAccountDelegatorAta extends string = string,\n TAccountReceiverAta 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 /** 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 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 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 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 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 =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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('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 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 /** Token program */\n tokenProgram: TAccountMetas[4];\n /** The delegatee signing the transfer */\n delegatee: TAccountMetas[5];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[6];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[7];\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 < 8) {\n throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 8,\n });\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n delegationPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: 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 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 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 TAccountTokenProgram extends string | AccountMeta<string> = string,\n TAccountEventAuthority extends string | AccountMeta<string> = '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7',\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 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 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 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 /** 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 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 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 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 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 =\n '3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7' as Address<'3Hnj4BYoDgtpBuqXfiy7Y8cNa3jXaNd4oqgSXBzkMcH7'>;\n }\n if (!accounts.selfProgram.value) {\n accounts.selfProgram.value =\n 'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44' as Address<'De1egAFMkMWZSN5rYXRj9CAdheBamobVNubTsi9avR44'>;\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('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 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 /** Token program */\n tokenProgram: TAccountMetas[6];\n /** The event authority PDA */\n eventAuthority: TAccountMetas[7];\n /** This program (for self-CPI) */\n selfProgram: TAccountMetas[8];\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 < 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 subscriptionPda: getNextAccount(),\n planPda: getNextAccount(),\n subscriptionAuthority: getNextAccount(),\n delegatorAta: getNextAccount(),\n receiverAta: getNextAccount(),\n caller: 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 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 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 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 ...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 UpdatePlanInput<TAccountOwner extends string = string, TAccountPlanPda extends string = string> = {\n /** The plan owner updating the plan */\n owner: TransactionSigner<TAccountOwner>;\n /** The plan PDA being updated */\n planPda: Address<TAccountPlanPda>;\n updatePlanData: UpdatePlanInstructionDataArgs['updatePlanData'];\n};\n\nexport function getUpdatePlanInstruction<\n TAccountOwner extends string,\n TAccountPlanPda extends string,\n TProgramAddress extends Address = typeof SUBSCRIPTIONS_PROGRAM_ADDRESS,\n>(\n input: UpdatePlanInput<TAccountOwner, TAccountPlanPda>,\n config?: { programAddress?: TProgramAddress },\n): UpdatePlanInstruction<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: false },\n planPda: { value: input.planPda ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<keyof typeof originalAccounts, ResolvedInstructionAccount>;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [getAccountMeta('owner', accounts.owner), getAccountMeta('planPda', accounts.planPda)],\n data: getUpdatePlanInstructionDataEncoder().encode(args as UpdatePlanInstructionDataArgs),\n programAddress,\n } as UpdatePlanInstruction<TProgramAddress, TAccountOwner, TAccountPlanPda>);\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 };\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 < 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: 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, sponsor `payer` trailing accounts, ATA derivation, validators)\n * 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 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 getSubscribeInstructionAsync,\n getTransferFixedInstruction,\n getTransferRecurringInstruction,\n getTransferSubscriptionInstruction,\n getUpdatePlanInstruction,\n type PlanStatus,\n type SubscriptionsPlugin as GeneratedSubscriptionsPlugin,\n type SubscriptionsPluginRequirements as GeneratedSubscriptionsPluginRequirements,\n subscriptionsProgram as generatedSubscriptionsProgram,\n} from './generated/index.js';\nimport type { Delegation } from './types/delegation.js';\nimport type { PlanWithAddress } from './types/plan.js';\nimport { assertMetadataUri, assertPositive, 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\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 CreateFixedDelegationInput = WithProgramAddress & {\n amount: bigint | number;\n delegatee: Address;\n delegator: TransactionSigner;\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 expiryTs: bigint | number;\n nonce: bigint | number;\n payer?: TransactionSigner;\n periodLengthS: bigint | number;\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};\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};\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 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};\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 getCreateFixedDelegationOverlayInstructionAsync(\n input: CreateFixedDelegationInput,\n): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\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 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 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 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 getInstruction(\n {\n delegatee: input.delegatee,\n delegationPda: input.delegationPda,\n delegatorAta: input.delegatorAta,\n receiverAta: input.receiverAta,\n subscriptionAuthority,\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}\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 getTransferSubscriptionInstruction(\n {\n caller: input.caller,\n delegatorAta,\n planPda: input.planPda,\n receiverAta: input.receiverAta,\n subscriptionAuthority,\n subscriptionPda: input.subscriptionPda,\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}\n\nexport async function getCreatePlanOverlayInstructionAsync(input: CreatePlanInput): Promise<Instruction> {\n assertPositive(input.amount, 'amount');\n assertPositive(input.periodHours, 'periodHours');\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 function getUpdatePlanOverlayInstruction(input: UpdatePlanInput): Instruction {\n assertMetadataUri(input.metadataUri);\n const pullers = padPlanPullers(input.pullers ?? []);\n return getUpdatePlanInstruction(\n {\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 ) {\n throw new Error(\n 'getSubscribeOverlayInstructionAsync requires expectedAmount, expectedPeriodHours, and expectedCreatedAt. Use the plugin client `subscriptions.instructions.subscribe(...)` to auto-fetch from the live plan.',\n );\n }\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 merchant: input.merchant,\n planPda,\n subscribeData: {\n expectedAmount: input.expectedAmount,\n expectedCreatedAt: input.expectedCreatedAt,\n expectedMint: input.tokenMint,\n expectedPeriodHours: input.expectedPeriodHours,\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 function getCancelSubscriptionOverlayInstructionAsync(input: CancelSubscriptionInput): Promise<Instruction> {\n return getCancelSubscriptionInstructionAsync(\n {\n planPda: input.planPda,\n subscriber: input.subscriber,\n subscriptionPda: input.subscriptionPda,\n },\n pdaConfig(input.programAddress),\n );\n}\n\nexport function getResumeSubscriptionOverlayInstructionAsync(input: ResumeSubscriptionInput): Promise<Instruction> {\n return getResumeSubscriptionInstructionAsync(\n {\n planPda: input.planPda,\n subscriber: input.subscriber,\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 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<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 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 getCreateFixedDelegationOverlayInstructionAsync({\n ...input,\n delegator: input.delegator ?? client.identity,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\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 getCreateRecurringDelegationOverlayInstructionAsync({\n ...input,\n delegator: input.delegator ?? client.identity,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\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 subscribe: input =>\n addSelfPlanAndSendFunctions(\n client,\n (async () => {\n let { expectedAmount, expectedPeriodHours, expectedCreatedAt } = input;\n if (\n expectedAmount === undefined ||\n expectedPeriodHours === undefined ||\n expectedCreatedAt === undefined\n ) {\n const subscriber = input.subscriber ?? client.identity;\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 return await getSubscribeOverlayInstructionAsync({\n ...input,\n expectedAmount,\n expectedCreatedAt,\n expectedPeriodHours,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n subscriber,\n });\n }\n return await getSubscribeOverlayInstructionAsync({\n ...input,\n expectedAmount,\n expectedCreatedAt,\n expectedPeriodHours,\n payer: input.payer ?? (client.payer === client.identity ? undefined : client.payer),\n subscriber: input.subscriber ?? client.identity,\n });\n })(),\n ),\n transferFixed: input =>\n addSelfPlanAndSendFunctions(\n client,\n getTransferFixedOverlayInstructionAsync({\n ...input,\n delegatee: input.delegatee ?? client.identity,\n }),\n ),\n transferRecurring: input =>\n addSelfPlanAndSendFunctions(\n client,\n getTransferRecurringOverlayInstructionAsync({\n ...input,\n delegatee: input.delegatee ?? client.identity,\n }),\n ),\n transferSubscription: input =>\n addSelfPlanAndSendFunctions(\n client,\n getTransferSubscriptionOverlayInstructionAsync({\n ...input,\n caller: input.caller ?? client.identity,\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","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 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,EA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BAAsB,WAClBA;AAAA,UACI;AAAA,UACA,+CAA+C;AAAA,YAC3C,GAAG;AAAA,YACH,QAAQ,MAAM,UAAU,OAAO;AAAA,UACnC,CAAC;AAAA,QACL;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","getStructDecoder","getStructEncoder","getU8Decoder","getU8Encoder","getU8Encoder","getStructEncoder","getStructDecoder","getU8Decoder","combineCodec","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","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","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","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","SubscriptionsAccount","SubscriptionsInstruction","getU8Encoder","SolanaError","addSelfPlanAndSendFunctions","subscriptionsProgram","addSelfPlanAndSendFunctions"]}
|