{"version":3,"sources":["../src/shared/docs.ts","../src/shared/stringCases.ts","../src/shared/versions.ts","../src/generated/typeNodes/StructTypeNode.ts","../src/generated/AccountNode.ts","../src/generated/codamaVersion.ts","../src/generated/ConstantNode.ts","../src/generated/DefinedTypeNode.ts","../src/generated/ErrorNode.ts","../src/generated/EventNode.ts","../src/generated/InstructionAccountNode.ts","../src/generated/InstructionArgumentNode.ts","../src/Node.ts","../src/generated/InstructionByteDeltaNode.ts","../src/generated/InstructionByteDeltaValue.ts","../src/generated/InstructionNode.ts","../src/generated/InstructionRemainingAccountsNode.ts","../src/generated/InstructionRemainingAccountsValue.ts","../src/generated/InstructionStatusNode.ts","../src/generated/contextualValueNodes/StandaloneContextualValueNode.ts","../src/generated/contextualValueNodes/RegisteredContextualValueNode.ts","../src/generated/countNodes/RegisteredCountNode.ts","../src/generated/discriminatorNodes/RegisteredDiscriminatorNode.ts","../src/generated/displayNodes/RegisteredDisplayNode.ts","../src/generated/linkNodes/RegisteredLinkNode.ts","../src/generated/pdaSeedNodes/RegisteredPdaSeedNode.ts","../src/generated/typeNodes/EnumVariantTypeNode.ts","../src/generated/typeNodes/StandaloneTypeNode.ts","../src/generated/typeNodes/RegisteredTypeNode.ts","../src/generated/valueNodes/StandaloneValueNode.ts","../src/generated/valueNodes/RegisteredValueNode.ts","../src/generated/nodeKinds.ts","../src/generated/PdaNode.ts","../src/generated/PluginNode.ts","../src/generated/ProgramNode.ts","../src/generated/ProvidedNode.ts","../src/generated/RootNode.ts","../src/generated/contextualValueNodes/AccountBumpValueNode.ts","../src/generated/contextualValueNodes/AccountFieldValueNode.ts","../src/generated/contextualValueNodes/AccountValueNode.ts","../src/generated/contextualValueNodes/ArgumentValueNode.ts","../src/generated/contextualValueNodes/ConditionalValueCondition.ts","../src/generated/contextualValueNodes/ConditionalValueNode.ts","../src/generated/contextualValueNodes/ContextualValueNode.ts","../src/generated/contextualValueNodes/IdentityValueNode.ts","../src/generated/valueNodes/ValueNode.ts","../src/generated/contextualValueNodes/InstructionInputValueNode.ts","../src/generated/contextualValueNodes/PayerValueNode.ts","../src/generated/contextualValueNodes/PdaSeedValueNode.ts","../src/generated/contextualValueNodes/PdaSeedValueValue.ts","../src/generated/linkNodes/ProgramLinkNode.ts","../src/generated/linkNodes/PdaLinkNode.ts","../src/generated/contextualValueNodes/PdaValueNode.ts","../src/generated/contextualValueNodes/PdaValuePda.ts","../src/generated/contextualValueNodes/PdaValueProgramId.ts","../src/generated/contextualValueNodes/ProgramIdValueNode.ts","../src/generated/contextualValueNodes/ResolverDependency.ts","../src/generated/contextualValueNodes/ResolverValueNode.ts","../src/generated/countNodes/CountNode.ts","../src/generated/countNodes/FixedCountNode.ts","../src/generated/countNodes/PrefixedCountNode.ts","../src/generated/countNodes/RemainderCountNode.ts","../src/generated/discriminatorNodes/ConstantDiscriminatorNode.ts","../src/generated/discriminatorNodes/DiscriminatorNode.ts","../src/generated/discriminatorNodes/FieldDiscriminatorNode.ts","../src/generated/discriminatorNodes/SizeDiscriminatorNode.ts","../src/generated/displayNodes/AmountNumberDisplayNode.ts","../src/generated/displayNodes/DateTimeNumberDisplayNode.ts","../src/generated/displayNodes/DisplayNode.ts","../src/generated/displayNodes/DurationNumberDisplayNode.ts","../src/generated/displayNodes/EnumVariantDisplayNode.ts","../src/generated/displayNodes/InstructionAccountDisplayNode.ts","../src/generated/displayNodes/InstructionDisplayNode.ts","../src/generated/displayNodes/NumberDisplayNode.ts","../src/generated/displayNodes/StringDisplayNode.ts","../src/generated/displayNodes/StructFieldDisplayNode.ts","../src/generated/linkNodes/AccountLinkNode.ts","../src/generated/linkNodes/DefinedTypeLinkNode.ts","../src/generated/linkNodes/InstructionLinkNode.ts","../src/generated/linkNodes/InstructionAccountLinkNode.ts","../src/generated/linkNodes/InstructionArgumentLinkNode.ts","../src/generated/linkNodes/LinkNode.ts","../src/generated/pdaSeedNodes/ConstantPdaSeedNode.ts","../src/generated/pdaSeedNodes/ConstantPdaSeedValue.ts","../src/generated/pdaSeedNodes/PdaSeedNode.ts","../src/generated/pdaSeedNodes/VariablePdaSeedNode.ts","../src/generated/typeNodes/AmountTypeNode.ts","../src/generated/typeNodes/ArrayTypeNode.ts","../src/generated/typeNodes/NumberTypeNode.ts","../src/generated/typeNodes/BooleanTypeNode.ts","../src/generated/typeNodes/BytesTypeNode.ts","../src/generated/typeNodes/DateTimeTypeNode.ts","../src/generated/typeNodes/EnumEmptyVariantTypeNode.ts","../src/generated/typeNodes/EnumStructVariantTypeNode.ts","../src/generated/typeNodes/EnumTupleVariantTypeNode.ts","../src/generated/typeNodes/EnumTypeNode.ts","../src/generated/typeNodes/FixedSizeTypeNode.ts","../src/generated/typeNodes/HiddenPrefixTypeNode.ts","../src/generated/typeNodes/HiddenSuffixTypeNode.ts","../src/generated/typeNodes/MapTypeNode.ts","../src/generated/typeNodes/OptionTypeNode.ts","../src/generated/typeNodes/PostOffsetTypeNode.ts","../src/generated/typeNodes/PreOffsetTypeNode.ts","../src/generated/typeNodes/PublicKeyTypeNode.ts","../src/generated/typeNodes/RemainderOptionTypeNode.ts","../src/generated/typeNodes/SentinelTypeNode.ts","../src/generated/typeNodes/SetTypeNode.ts","../src/generated/typeNodes/SizePrefixTypeNode.ts","../src/generated/typeNodes/SolAmountTypeNode.ts","../src/generated/typeNodes/StringTypeNode.ts","../src/generated/typeNodes/StructFieldTypeNode.ts","../src/generated/typeNodes/TupleTypeNode.ts","../src/generated/typeNodes/TypeNode.ts","../src/generated/typeNodes/ZeroableOptionTypeNode.ts","../src/generated/valueNodes/ArrayValueNode.ts","../src/generated/valueNodes/BooleanValueNode.ts","../src/generated/valueNodes/BytesValueNode.ts","../src/generated/valueNodes/ConstantValueNode.ts","../src/generated/valueNodes/EnumValueNode.ts","../src/generated/valueNodes/EnumValuePayload.ts","../src/generated/valueNodes/InjectableNumberValueNode.ts","../src/generated/valueNodes/InjectableStringValueNode.ts","../src/generated/valueNodes/InjectedValueNode.ts","../src/generated/valueNodes/MapEntryValueNode.ts","../src/generated/valueNodes/MapValueNode.ts","../src/generated/valueNodes/NoneValueNode.ts","../src/generated/valueNodes/NumberValueNode.ts","../src/generated/valueNodes/PublicKeyValueNode.ts","../src/generated/valueNodes/SetValueNode.ts","../src/generated/valueNodes/SomeValueNode.ts","../src/generated/valueNodes/StringValueNode.ts","../src/generated/valueNodes/StructFieldValueNode.ts","../src/generated/valueNodes/StructValueNode.ts","../src/generated/valueNodes/TupleValueNode.ts","../src/ConstantPdaSeedNode.ts","../src/ConstantValueNode.ts","../src/EnumTypeNode.ts","../src/InstructionArgumentNode.ts","../src/ProgramNode.ts","../src/InstructionNode.ts","../src/NestedTypeNode.ts","../src/NumberTypeNode.ts"],"names":["CodamaError","CODAMA_ERROR__UNEXPECTED_NODE_KIND","CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND"],"mappings":";;;;;;;;AAIO,SAAS,UAAU,IAAA,EAA0C;AAChE,EAAA,IAAI,IAAA,KAAS,IAAA,IAAQ,IAAA,KAAS,MAAA,SAAkB,EAAC;AACjD,EAAA,OAAO,MAAM,OAAA,CAAQ,IAAI,CAAA,GAAI,IAAA,GAAO,CAAC,IAAI,CAAA;AAC7C;;;ACCO,SAAS,WAAW,GAAA,EAAqB;AAC5C,EAAA,IAAI,GAAA,CAAI,MAAA,KAAW,CAAA,EAAG,OAAO,GAAA;AAC7B,EAAA,OAAO,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,KAAgB,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,CAAE,WAAA,EAAY;AAClE;AAEO,SAAS,UAAU,GAAA,EAA8B;AACpD,EAAA,IAAI,iCAAA,CAAkC,IAAA,CAAK,GAAG,CAAA,EAAG;AAC7C,IAAA,OAAO,GAAA,CAAI,WAAA,EAAY,CAAE,KAAA,CAAM,GAAG,EAAE,GAAA,CAAI,UAAU,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,EAChE;AACA,EAAA,OAAO,IACF,OAAA,CAAQ,UAAA,EAAY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,KACH,CAAA;AAAA,EACL;AACJ;;;AC9DO,SAAS,gBAAgB,IAAA,EAA+B;AAC3D,EAAA,OAAO,IAAA,CAAK,MAAA,CAAO,UAAA,CAAW,GAAG,CAAA;AACrC;AAEO,SAAS,kBAAkB,IAAA,EAA+B;AAC7D,EAAA,OAAO,KAAK,MAAA,CAAO,UAAA,CAAW,GAAG,CAAA,IAAK,KAAK,MAAA,KAAW,UAAA;AAC1D;AAEO,SAAS,UAAU,IAAA,EAA+B;AACrD,EAAA,OAAO,CAAC,IAAA,CAAK,MAAA,CAAO,UAAA,CAAW,GAAG,CAAA;AACtC;AAEO,SAAS,UAAU,IAAA,EAA+B;AACrD,EAAA,OAAO,IAAA,CAAK,MAAA,CAAO,UAAA,CAAW,GAAG,CAAA;AACrC","file":"index.node.cjs","sourcesContent":["import type { Docs } from '@codama/node-types';\n\nexport type DocsInput = string[] | string;\n\nexport function parseDocs(docs: DocsInput | null | undefined): Docs {\n    if (docs === null || docs === undefined) return [];\n    return Array.isArray(docs) ? docs : [docs];\n}\n","import type {\n    CamelCaseString,\n    KebabCaseString,\n    PascalCaseString,\n    SnakeCaseString,\n    TitleCaseString,\n} from '@codama/node-types';\n\nexport function capitalize(str: string): string {\n    if (str.length === 0) return str;\n    return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n}\n\nexport function titleCase(str: string): TitleCaseString {\n    if (/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/.test(str)) {\n        return str.toLowerCase().split('_').map(capitalize).join(' ') as TitleCaseString;\n    }\n    return str\n        .replace(/([A-Z])/g, ' $1')\n        .split(/[^a-zA-Z0-9]+/)\n        .filter(word => word.length > 0)\n        .map(capitalize)\n        .join(' ') as TitleCaseString;\n}\n\nexport function pascalCase(str: string): PascalCaseString {\n    return titleCase(str).split(' ').join('') as PascalCaseString;\n}\n\nexport function camelCase(str: string): CamelCaseString {\n    if (str.length === 0) return str as CamelCaseString;\n    const pascalStr = pascalCase(str);\n    return (pascalStr.charAt(0).toLowerCase() + pascalStr.slice(1)) as CamelCaseString;\n}\n\nexport function kebabCase(str: string): KebabCaseString {\n    return titleCase(str).split(' ').join('-').toLowerCase() as KebabCaseString;\n}\n\nexport function snakeCase(str: string): SnakeCaseString {\n    return titleCase(str).split(' ').join('_').toLowerCase() as SnakeCaseString;\n}\n","/**\n * Extracts the major version from a Codama version string, e.g. `1` from\n * `'1.9.1'` or `2` from `'2.0.0-rc.4'`.\n *\n * Defensive against arbitrary input — IDLs usually arrive as untrusted\n * JSON — and returns `null` when no major version can be parsed, so callers\n * decide how to fail. Useful for cross-major compatibility checks: two Codama\n * versions are compatible if and only if their majors match.\n */\nexport function getCodamaVersionMajor(version: string): number | null {\n    const match = /^(\\d+)\\./.exec(version);\n    return match ? Number(match[1]) : null;\n}\n","import type { StructFieldTypeNode, StructTypeNode } from '@codama/node-types';\n\n/** A composite type made of an ordered list of named fields. Fields are encoded and decoded in declaration order. */\nexport function structTypeNode<const TFields extends Array<StructFieldTypeNode> | undefined>(\n    fields: TFields,\n): StructTypeNode<TFields> {\n    return Object.freeze({\n        kind: 'structTypeNode',\n\n        // Children.\n        ...(fields !== undefined && fields.length > 0 && { fields: fields as TFields }),\n    });\n}\n","import type { AccountNode, DiscriminatorNode, NestedTypeNode, PdaLinkNode, StructTypeNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\nimport { structTypeNode } from './typeNodes/StructTypeNode';\n\nexport type AccountNodeInput<\n    TData extends NestedTypeNode<StructTypeNode> = NestedTypeNode<StructTypeNode>,\n    TPda extends PdaLinkNode | undefined = PdaLinkNode | undefined,\n    TDiscriminators extends Array<DiscriminatorNode> | undefined = Array<DiscriminatorNode> | undefined,\n> = Omit<Partial<AccountNode<TData, TPda, TDiscriminators>>, 'docs' | 'kind' | 'name'> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/**\n * An on-chain account: its name, data structure, optional fixed size, optional PDA, and optional discriminators.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/77974dad-212e-49b1-8e41-5d466c273a02)\n */\nexport function accountNode<\n    const TData extends NestedTypeNode<StructTypeNode> = StructTypeNode<[]>,\n    const TPda extends PdaLinkNode | undefined = undefined,\n    const TDiscriminators extends Array<DiscriminatorNode> | undefined = undefined,\n>(input: AccountNodeInput<TData, TPda, TDiscriminators>): AccountNode<TData, TPda, TDiscriminators> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'accountNode',\n\n        // Data.\n        name: camelCase(input.name),\n        ...(input.size !== undefined && { size: input.size }),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        data: (input.data ?? structTypeNode([])) as TData,\n        ...(input.pda !== undefined && { pda: input.pda }),\n        ...(input.discriminators !== undefined &&\n            input.discriminators.length > 0 && { discriminators: input.discriminators as TDiscriminators }),\n    });\n}\n","import type { CodamaVersion } from '@codama/node-types';\n\n/**\n * The Codama spec version this package was generated against.\n *\n * Pinned to the literal version of `@codama/spec` at generation time.\n * Used by `rootNode()` to tag the IDL and by downstream consumers\n * that need to compare an IDL's `version` against the spec\n * shape `@codama/nodes` understands.\n */\nexport const CODAMA_VERSION: CodamaVersion = '1.9.2';\n","import type { ConstantNode, TypeNode, ValueNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\n/** A named constant exposed by the program: a typed value associated with a name. */\nexport function constantNode<const TType extends TypeNode, const TValue extends ValueNode>(\n    name: string,\n    type: TType,\n    value: TValue,\n    docs?: DocsInput,\n): ConstantNode<TType, TValue> {\n    const parsedDocs = parseDocs(docs);\n    return Object.freeze({\n        kind: 'constantNode',\n\n        // Data.\n        name: camelCase(name),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        type,\n        value,\n    });\n}\n","import type { DefinedTypeNode, TypeNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\nexport type DefinedTypeNodeInput<TType extends TypeNode = TypeNode> = Omit<\n    DefinedTypeNode<TType>,\n    'docs' | 'kind' | 'name'\n> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/**\n * A reusable named type that can be referenced by `definedTypeLinkNode` from elsewhere in the IDL.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/6049cf77-9a70-4915-8276-dd571d2f8828)\n */\nexport function definedTypeNode<const TType extends TypeNode>(\n    input: DefinedTypeNodeInput<TType>,\n): DefinedTypeNode<TType> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'definedTypeNode',\n\n        // Data.\n        name: camelCase(input.name),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        type: input.type,\n    });\n}\n","import type { ErrorNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\nexport type ErrorNodeInput = Omit<ErrorNode, 'docs' | 'kind' | 'name'> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/**\n * A program error — a numeric code paired with a name and human-readable message.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/0bde98ea-0327-404b-bf38-137d105826b0)\n */\nexport function errorNode(input: ErrorNodeInput): ErrorNode {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'errorNode',\n\n        // Data.\n        name: camelCase(input.name),\n        code: input.code,\n        message: input.message,\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n    });\n}\n","import type { DiscriminatorNode, EventNode, TypeNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\nexport type EventNodeInput<\n    TData extends TypeNode = TypeNode,\n    TDiscriminators extends Array<DiscriminatorNode> | undefined = Array<DiscriminatorNode> | undefined,\n> = Omit<EventNode<TData, TDiscriminators>, 'docs' | 'kind' | 'name'> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/** A program event: its data shape and optional discriminators used to identify it on the wire. */\nexport function eventNode<\n    const TData extends TypeNode,\n    const TDiscriminators extends Array<DiscriminatorNode> | undefined = undefined,\n>(input: EventNodeInput<TData, TDiscriminators>): EventNode<TData, TDiscriminators> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'eventNode',\n\n        // Data.\n        name: camelCase(input.name),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        data: input.data,\n        ...(input.discriminators !== undefined &&\n            input.discriminators.length > 0 && { discriminators: input.discriminators as TDiscriminators }),\n    });\n}\n","import type {\n    AccountLinkNode,\n    InstructionAccountDisplayNode,\n    InstructionAccountNode,\n    InstructionInputValueNode,\n} from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\nexport type InstructionAccountNodeInput<\n    TDefaultValue extends InstructionInputValueNode | undefined = InstructionInputValueNode | undefined,\n    TAccountLink extends AccountLinkNode | undefined = AccountLinkNode | undefined,\n    TDisplay extends InstructionAccountDisplayNode | undefined = InstructionAccountDisplayNode | undefined,\n> = Omit<InstructionAccountNode<TDefaultValue, TAccountLink, TDisplay>, 'docs' | 'kind' | 'name'> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/**\n * An account participating in an instruction, with its name, signing/writability flags, and an optional default value.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/4656a08b-2f89-49c2-b428-5378cb1a0b9e)\n */\nexport function instructionAccountNode<\n    const TDefaultValue extends InstructionInputValueNode | undefined = undefined,\n    const TAccountLink extends AccountLinkNode | undefined = undefined,\n    const TDisplay extends InstructionAccountDisplayNode | undefined = undefined,\n>(\n    input: InstructionAccountNodeInput<TDefaultValue, TAccountLink, TDisplay>,\n): InstructionAccountNode<TDefaultValue, TAccountLink, TDisplay> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'instructionAccountNode',\n\n        // Data.\n        name: camelCase(input.name),\n        isWritable: input.isWritable,\n        isSigner: input.isSigner,\n        isOptional: input.isOptional ?? false,\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }),\n        ...(input.accountLink !== undefined && { accountLink: input.accountLink }),\n        ...(input.display !== undefined && { display: input.display }),\n    });\n}\n","import type {\n    InstructionArgumentNode,\n    InstructionInputValueNode,\n    StructFieldDisplayNode,\n    TypeNode,\n} from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\nexport type InstructionArgumentNodeInput<\n    TDefaultValue extends InstructionInputValueNode | undefined = InstructionInputValueNode | undefined,\n    TType extends TypeNode = TypeNode,\n    TDisplay extends StructFieldDisplayNode | undefined = StructFieldDisplayNode | undefined,\n> = Omit<InstructionArgumentNode<TDefaultValue, TType, TDisplay>, 'docs' | 'kind' | 'name'> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/**\n * A named argument of an instruction, with its type and an optional default value.\n * Serialised next to each other, the arguments of an instruction form its data.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/7e2def82-949a-4663-bdc3-ac599d39d2d2)\n */\nexport function instructionArgumentNode<\n    const TDefaultValue extends InstructionInputValueNode | undefined = undefined,\n    const TType extends TypeNode = TypeNode,\n    const TDisplay extends StructFieldDisplayNode | undefined = undefined,\n>(\n    input: InstructionArgumentNodeInput<TDefaultValue, TType, TDisplay>,\n): InstructionArgumentNode<TDefaultValue, TType, TDisplay> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'instructionArgumentNode',\n\n        // Data.\n        name: camelCase(input.name),\n        ...(input.defaultValueStrategy !== undefined && { defaultValueStrategy: input.defaultValueStrategy }),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        type: input.type,\n        ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }),\n        ...(input.display !== undefined && { display: input.display }),\n    });\n}\n","import { CODAMA_ERROR__UNEXPECTED_NODE_KIND, CodamaError } from '@codama/errors';\nimport type { GetNodeFromKind, Node, NodeKind } from '@codama/node-types';\n\nexport function isNode<TKind extends NodeKind>(\n    node: Node | null | undefined,\n    kind: TKind | TKind[],\n): node is GetNodeFromKind<TKind> {\n    const kinds = Array.isArray(kind) ? kind : [kind];\n    return !!node && (kinds as NodeKind[]).includes(node.kind);\n}\n\nexport function assertIsNode<TKind extends NodeKind>(\n    node: Node | null | undefined,\n    kind: TKind | TKind[],\n): asserts node is GetNodeFromKind<TKind> {\n    const kinds = Array.isArray(kind) ? kind : [kind];\n    if (!isNode(node, kinds)) {\n        throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NODE_KIND, {\n            expectedKinds: kinds,\n            kind: node?.kind ?? null,\n            node,\n        });\n    }\n}\n\nexport function isNodeFilter<TKind extends NodeKind>(\n    kind: TKind | TKind[],\n): (node: Node | null | undefined) => node is GetNodeFromKind<TKind> {\n    return (node): node is GetNodeFromKind<TKind> => isNode(node, kind);\n}\n\nexport function assertIsNodeFilter<TKind extends NodeKind>(\n    kind: TKind | TKind[],\n): (node: Node | null | undefined) => node is GetNodeFromKind<TKind> {\n    return (node): node is GetNodeFromKind<TKind> => {\n        assertIsNode(node, kind);\n        return true;\n    };\n}\n\nexport function removeNullAndAssertIsNodeFilter<TKind extends NodeKind>(\n    kind: TKind | TKind[],\n): (node: Node | null | undefined) => node is GetNodeFromKind<TKind> {\n    return (node): node is GetNodeFromKind<TKind> => {\n        if (node) assertIsNode(node, kind);\n        return node != null;\n    };\n}\n","import type { InstructionByteDeltaNode, InstructionByteDeltaValue } from '@codama/node-types';\n\nimport { isNode } from '../Node';\n\n/**\n * A byte-size delta applied when computing rent or buffer size — typically used by instructions that resize accounts.\n * For instance, if an instruction creates a new account of 42 bytes, this node can carry that information, enabling clients to allocate the right amount of lamports to cover the cost of executing the instruction.\n */\nexport function instructionByteDeltaNode<const TValue extends InstructionByteDeltaValue>(\n    value: TValue,\n    options: {\n        withHeader?: boolean;\n        subtract?: boolean;\n    } = {},\n): InstructionByteDeltaNode<TValue> {\n    return Object.freeze({\n        kind: 'instructionByteDeltaNode',\n\n        // Data.\n        withHeader: options.withHeader ?? !isNode(value, 'resolverValueNode'),\n        ...(options.subtract !== undefined && { subtract: options.subtract }),\n\n        // Children.\n        value,\n    });\n}\n","/**\n * The value forms accepted by an `instructionByteDeltaNode`.\n * An `accountLinkNode` uses the size of the linked account; an `argumentValueNode` uses the value of the referenced instruction argument; a `numberValueNode` uses that explicit number; and a `resolverValueNode` acts as a fallback for more complex values.\n */\nexport const INSTRUCTION_BYTE_DELTA_VALUE_KINDS = [\n    'accountLinkNode' as const,\n    'argumentValueNode' as const,\n    'numberValueNode' as const,\n    'resolverValueNode' as const,\n];\n","import type {\n    DiscriminatorNode,\n    InstructionAccountNode,\n    InstructionArgumentNode,\n    InstructionByteDeltaNode,\n    InstructionDisplayNode,\n    InstructionNode,\n    InstructionRemainingAccountsNode,\n    InstructionStatusNode,\n    PluginNode,\n    ProvidedNode,\n} from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\nexport type InstructionNodeInput<\n    TAccounts extends Array<InstructionAccountNode> | undefined = Array<InstructionAccountNode> | undefined,\n    TArguments extends Array<InstructionArgumentNode> | undefined = Array<InstructionArgumentNode> | undefined,\n    TExtraArguments extends Array<InstructionArgumentNode> | undefined = Array<InstructionArgumentNode> | undefined,\n    TRemainingAccounts extends Array<InstructionRemainingAccountsNode> | undefined =\n        | Array<InstructionRemainingAccountsNode>\n        | undefined,\n    TByteDeltas extends Array<InstructionByteDeltaNode> | undefined = Array<InstructionByteDeltaNode> | undefined,\n    TDiscriminators extends Array<DiscriminatorNode> | undefined = Array<DiscriminatorNode> | undefined,\n    TSubInstructions extends Array<InstructionNode> | undefined = Array<InstructionNode> | undefined,\n    TStatus extends InstructionStatusNode | undefined = InstructionStatusNode | undefined,\n    TProvides extends Array<ProvidedNode> | undefined = Array<ProvidedNode> | undefined,\n    TDisplay extends InstructionDisplayNode | undefined = InstructionDisplayNode | undefined,\n    TPlugins extends Array<PluginNode> | undefined = Array<PluginNode> | undefined,\n> = Omit<\n    Partial<\n        InstructionNode<\n            TAccounts,\n            TArguments,\n            TExtraArguments,\n            TRemainingAccounts,\n            TByteDeltas,\n            TDiscriminators,\n            TSubInstructions,\n            TStatus,\n            TProvides,\n            TDisplay,\n            TPlugins\n        >\n    >,\n    'docs' | 'kind' | 'name'\n> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/**\n * A program instruction: its accounts, arguments, byte-delta hints, discriminators, optional status, and optional sub-instructions.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/0d8edced-cfa4-4500-b80c-ebc56181a338)\n */\nexport function instructionNode<\n    const TAccounts extends Array<InstructionAccountNode> | undefined = [],\n    const TArguments extends Array<InstructionArgumentNode> | undefined = [],\n    const TExtraArguments extends Array<InstructionArgumentNode> | undefined = undefined,\n    const TRemainingAccounts extends Array<InstructionRemainingAccountsNode> | undefined = undefined,\n    const TByteDeltas extends Array<InstructionByteDeltaNode> | undefined = undefined,\n    const TDiscriminators extends Array<DiscriminatorNode> | undefined = undefined,\n    const TSubInstructions extends Array<InstructionNode> | undefined = undefined,\n    const TStatus extends InstructionStatusNode | undefined = undefined,\n    const TProvides extends Array<ProvidedNode> | undefined = undefined,\n    const TDisplay extends InstructionDisplayNode | undefined = undefined,\n    const TPlugins extends Array<PluginNode> | undefined = undefined,\n>(\n    input: InstructionNodeInput<\n        TAccounts,\n        TArguments,\n        TExtraArguments,\n        TRemainingAccounts,\n        TByteDeltas,\n        TDiscriminators,\n        TSubInstructions,\n        TStatus,\n        TProvides,\n        TDisplay,\n        TPlugins\n    >,\n): InstructionNode<\n    TAccounts,\n    TArguments,\n    TExtraArguments,\n    TRemainingAccounts,\n    TByteDeltas,\n    TDiscriminators,\n    TSubInstructions,\n    TStatus,\n    TProvides,\n    TDisplay,\n    TPlugins\n> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'instructionNode',\n\n        // Data.\n        name: camelCase(input.name),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n        optionalAccountStrategy: input.optionalAccountStrategy ?? 'programId',\n\n        // Children.\n        ...(input.accounts !== undefined && input.accounts.length > 0 && { accounts: input.accounts as TAccounts }),\n        ...(input.arguments !== undefined &&\n            input.arguments.length > 0 && { arguments: input.arguments as TArguments }),\n        ...(input.extraArguments !== undefined &&\n            input.extraArguments.length > 0 && { extraArguments: input.extraArguments as TExtraArguments }),\n        ...(input.remainingAccounts !== undefined &&\n            input.remainingAccounts.length > 0 && { remainingAccounts: input.remainingAccounts as TRemainingAccounts }),\n        ...(input.byteDeltas !== undefined &&\n            input.byteDeltas.length > 0 && { byteDeltas: input.byteDeltas as TByteDeltas }),\n        ...(input.discriminators !== undefined &&\n            input.discriminators.length > 0 && { discriminators: input.discriminators as TDiscriminators }),\n        ...(input.status !== undefined && { status: input.status }),\n        ...(input.subInstructions !== undefined &&\n            input.subInstructions.length > 0 && { subInstructions: input.subInstructions as TSubInstructions }),\n        ...(input.provides !== undefined && input.provides.length > 0 && { provides: input.provides as TProvides }),\n        ...(input.display !== undefined && { display: input.display }),\n        ...(input.plugins !== undefined && input.plugins.length > 0 && { plugins: input.plugins as TPlugins }),\n    });\n}\n","import type {\n    InstructionAccountDisplayNode,\n    InstructionRemainingAccountsNode,\n    InstructionRemainingAccountsValue,\n} from '@codama/node-types';\n\nimport { DocsInput, parseDocs } from '../shared';\n\n/** A \"remaining accounts\" slot in an instruction — a variable-length tail of accounts derived from a value. */\nexport function instructionRemainingAccountsNode<\n    const TValue extends InstructionRemainingAccountsValue,\n    const TDisplay extends InstructionAccountDisplayNode | undefined = undefined,\n>(\n    value: TValue,\n    options: {\n        isOptional?: boolean;\n        isSigner?: boolean | 'either';\n        isWritable?: boolean;\n        docs?: DocsInput;\n        display?: TDisplay;\n    } = {},\n): InstructionRemainingAccountsNode<TValue, TDisplay> {\n    const parsedDocs = parseDocs(options.docs);\n    return Object.freeze({\n        kind: 'instructionRemainingAccountsNode',\n\n        // Data.\n        ...(options.isOptional !== undefined && { isOptional: options.isOptional }),\n        ...(options.isSigner !== undefined && { isSigner: options.isSigner }),\n        ...(options.isWritable !== undefined && { isWritable: options.isWritable }),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        value,\n        ...(options.display !== undefined && { display: options.display }),\n    });\n}\n","/**\n * The value forms accepted by an `instructionRemainingAccountsNode`.\n * An `argumentValueNode` represents the array of accounts as a new argument of the provided name; a `resolverValueNode` acts as a fallback for more complex scenarios.\n */\nexport const INSTRUCTION_REMAINING_ACCOUNTS_VALUE_KINDS = ['argumentValueNode' as const, 'resolverValueNode' as const];\n","import type { InstructionLifecycle, InstructionStatusNode } from '@codama/node-types';\n\n/**\n * The lifecycle stage of an instruction (draft, live, deprecated, archived) with an optional accompanying message.\n * An instruction without a status is considered live — a status node is typically only attached to signal another stage.\n */\nexport function instructionStatusNode(lifecycle: InstructionLifecycle, message?: string): InstructionStatusNode {\n    return Object.freeze({\n        kind: 'instructionStatusNode',\n\n        // Data.\n        lifecycle,\n        ...(message !== undefined && { message }),\n    });\n}\n","/** Every contextual-value node usable as a top-level value. */\nexport const STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS = [\n    'accountBumpValueNode' as const,\n    'accountFieldValueNode' as const,\n    'accountValueNode' as const,\n    'argumentValueNode' as const,\n    'conditionalValueNode' as const,\n    'identityValueNode' as const,\n    'payerValueNode' as const,\n    'pdaValueNode' as const,\n    'programIdValueNode' as const,\n    'resolverValueNode' as const,\n];\n","import { STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS } from './StandaloneContextualValueNode';\n\n/** Every node tagged as a contextual-value node, including helper variants. */\nexport const REGISTERED_CONTEXTUAL_VALUE_NODE_KINDS = [\n    'pdaSeedValueNode' as const,\n    ...STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS,\n];\n","/** Every node tagged as a count strategy. */\nexport const REGISTERED_COUNT_NODE_KINDS = [\n    'fixedCountNode' as const,\n    'prefixedCountNode' as const,\n    'remainderCountNode' as const,\n];\n","/** Every node tagged as a discriminator strategy. */\nexport const REGISTERED_DISCRIMINATOR_NODE_KINDS = [\n    'constantDiscriminatorNode' as const,\n    'fieldDiscriminatorNode' as const,\n    'sizeDiscriminatorNode' as const,\n];\n","/** Every node tagged as display metadata. */\nexport const REGISTERED_DISPLAY_NODE_KINDS = [\n    'amountNumberDisplayNode' as const,\n    'dateTimeNumberDisplayNode' as const,\n    'durationNumberDisplayNode' as const,\n    'enumVariantDisplayNode' as const,\n    'instructionAccountDisplayNode' as const,\n    'instructionDisplayNode' as const,\n    'stringDisplayNode' as const,\n    'structFieldDisplayNode' as const,\n];\n","/** Every node tagged as a link to another part of the IDL. */\nexport const REGISTERED_LINK_NODE_KINDS = [\n    'accountLinkNode' as const,\n    'definedTypeLinkNode' as const,\n    'instructionAccountLinkNode' as const,\n    'instructionArgumentLinkNode' as const,\n    'instructionLinkNode' as const,\n    'pdaLinkNode' as const,\n    'programLinkNode' as const,\n];\n","/** Every node tagged as a PDA seed. */\nexport const REGISTERED_PDA_SEED_NODE_KINDS = ['constantPdaSeedNode' as const, 'variablePdaSeedNode' as const];\n","/** The variant flavours of an `enumTypeNode`. */\nexport const ENUM_VARIANT_TYPE_NODE_KINDS = [\n    'enumEmptyVariantTypeNode' as const,\n    'enumStructVariantTypeNode' as const,\n    'enumTupleVariantTypeNode' as const,\n];\n","/** Every type node that can be used as a top-level type. */\nexport const STANDALONE_TYPE_NODE_KINDS = [\n    'amountTypeNode' as const,\n    'arrayTypeNode' as const,\n    'booleanTypeNode' as const,\n    'bytesTypeNode' as const,\n    'dateTimeTypeNode' as const,\n    'enumTypeNode' as const,\n    'fixedSizeTypeNode' as const,\n    'hiddenPrefixTypeNode' as const,\n    'hiddenSuffixTypeNode' as const,\n    'mapTypeNode' as const,\n    'numberTypeNode' as const,\n    'optionTypeNode' as const,\n    'postOffsetTypeNode' as const,\n    'preOffsetTypeNode' as const,\n    'publicKeyTypeNode' as const,\n    'remainderOptionTypeNode' as const,\n    'sentinelTypeNode' as const,\n    'setTypeNode' as const,\n    'sizePrefixTypeNode' as const,\n    'solAmountTypeNode' as const,\n    'stringTypeNode' as const,\n    'structTypeNode' as const,\n    'tupleTypeNode' as const,\n    'zeroableOptionTypeNode' as const,\n];\n","import { ENUM_VARIANT_TYPE_NODE_KINDS } from './EnumVariantTypeNode';\nimport { STANDALONE_TYPE_NODE_KINDS } from './StandaloneTypeNode';\n\n/** Every node tagged as a type-shaped node, including variants and struct fields. */\nexport const REGISTERED_TYPE_NODE_KINDS = [\n    ...ENUM_VARIANT_TYPE_NODE_KINDS,\n    ...STANDALONE_TYPE_NODE_KINDS,\n    'structFieldTypeNode' as const,\n];\n","/** Every value node that can be used as a top-level value. */\nexport const STANDALONE_VALUE_NODE_KINDS = [\n    'arrayValueNode' as const,\n    'booleanValueNode' as const,\n    'bytesValueNode' as const,\n    'constantValueNode' as const,\n    'enumValueNode' as const,\n    'injectedValueNode' as const,\n    'mapValueNode' as const,\n    'noneValueNode' as const,\n    'numberValueNode' as const,\n    'publicKeyValueNode' as const,\n    'setValueNode' as const,\n    'someValueNode' as const,\n    'stringValueNode' as const,\n    'structValueNode' as const,\n    'tupleValueNode' as const,\n];\n","import { STANDALONE_VALUE_NODE_KINDS } from './StandaloneValueNode';\n\n/** Every node tagged as a value-shaped node, including container variants. */\nexport const REGISTERED_VALUE_NODE_KINDS = [\n    'mapEntryValueNode' as const,\n    ...STANDALONE_VALUE_NODE_KINDS,\n    'structFieldValueNode' as const,\n];\n","import { REGISTERED_CONTEXTUAL_VALUE_NODE_KINDS } from './contextualValueNodes/RegisteredContextualValueNode';\nimport { REGISTERED_COUNT_NODE_KINDS } from './countNodes/RegisteredCountNode';\nimport { REGISTERED_DISCRIMINATOR_NODE_KINDS } from './discriminatorNodes/RegisteredDiscriminatorNode';\nimport { REGISTERED_DISPLAY_NODE_KINDS } from './displayNodes/RegisteredDisplayNode';\nimport { REGISTERED_LINK_NODE_KINDS } from './linkNodes/RegisteredLinkNode';\nimport { REGISTERED_PDA_SEED_NODE_KINDS } from './pdaSeedNodes/RegisteredPdaSeedNode';\nimport { REGISTERED_TYPE_NODE_KINDS } from './typeNodes/RegisteredTypeNode';\nimport { REGISTERED_VALUE_NODE_KINDS } from './valueNodes/RegisteredValueNode';\n\n// Node Registration.\nexport const REGISTERED_NODE_KINDS = [\n    'accountNode' as const,\n    'constantNode' as const,\n    'definedTypeNode' as const,\n    'errorNode' as const,\n    'eventNode' as const,\n    'instructionAccountNode' as const,\n    'instructionArgumentNode' as const,\n    'instructionByteDeltaNode' as const,\n    'instructionNode' as const,\n    'instructionRemainingAccountsNode' as const,\n    'instructionStatusNode' as const,\n    'pdaNode' as const,\n    'pluginNode' as const,\n    'programNode' as const,\n    'providedNode' as const,\n    'rootNode' as const,\n    ...REGISTERED_CONTEXTUAL_VALUE_NODE_KINDS,\n    ...REGISTERED_COUNT_NODE_KINDS,\n    ...REGISTERED_DISCRIMINATOR_NODE_KINDS,\n    ...REGISTERED_DISPLAY_NODE_KINDS,\n    ...REGISTERED_LINK_NODE_KINDS,\n    ...REGISTERED_PDA_SEED_NODE_KINDS,\n    ...REGISTERED_TYPE_NODE_KINDS,\n    ...REGISTERED_VALUE_NODE_KINDS,\n];\n","import type { PdaNode, PdaSeedNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\nexport type PdaNodeInput<TSeeds extends Array<PdaSeedNode> | undefined = Array<PdaSeedNode> | undefined> = Omit<\n    PdaNode<TSeeds>,\n    'docs' | 'kind' | 'name'\n> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/**\n * A program-derived address: its name, optional program ID override, and the seeds used to derive it.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/4f7c9718-1ffa-4f2c-aa45-71b3ce204219)\n */\nexport function pdaNode<const TSeeds extends Array<PdaSeedNode> | undefined>(\n    input: PdaNodeInput<TSeeds>,\n): PdaNode<TSeeds> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'pdaNode',\n\n        // Data.\n        name: camelCase(input.name),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n        ...(input.programId !== undefined && { programId: input.programId }),\n\n        // Children.\n        ...(input.seeds !== undefined && input.seeds.length > 0 && { seeds: input.seeds as TSeeds }),\n    });\n}\n","import type { PluginNode } from '@codama/node-types';\n\nimport { camelCase } from '../shared';\n\n/**\n * Attaches named, plugin-specific data to a node.\n * A plugin is uniquely identified by its `name`; the optional `payload` carries arbitrary, consumer-defined data that only the matching plugin knows how to interpret. Codama itself treats the payload as opaque.\n */\nexport function pluginNode(name: string, payload?: unknown): PluginNode {\n    return Object.freeze({\n        kind: 'pluginNode',\n\n        // Data.\n        name: camelCase(name),\n        ...(payload !== undefined && { payload }),\n    });\n}\n","import type {\n    AccountNode,\n    ConstantNode,\n    DefinedTypeNode,\n    ErrorNode,\n    EventNode,\n    InstructionNode,\n    PdaNode,\n    ProgramNode,\n} from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../shared';\n\nexport type ProgramNodeInput<\n    TPdas extends Array<PdaNode> | undefined = Array<PdaNode> | undefined,\n    TAccounts extends Array<AccountNode> | undefined = Array<AccountNode> | undefined,\n    TInstructions extends Array<InstructionNode> | undefined = Array<InstructionNode> | undefined,\n    TDefinedTypes extends Array<DefinedTypeNode> | undefined = Array<DefinedTypeNode> | undefined,\n    TErrors extends Array<ErrorNode> | undefined = Array<ErrorNode> | undefined,\n    TEvents extends Array<EventNode> | undefined = Array<EventNode> | undefined,\n    TConstants extends Array<ConstantNode> | undefined = Array<ConstantNode> | undefined,\n> = Omit<\n    Partial<ProgramNode<TPdas, TAccounts, TInstructions, TDefinedTypes, TErrors, TEvents, TConstants>>,\n    'docs' | 'kind' | 'name' | 'publicKey'\n> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n    readonly publicKey: ProgramNode['publicKey'];\n};\n\n/**\n * A Solana program: its identity, version, accounts, instructions, defined types, PDAs, events, errors, and constants.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/37ec38ea-66df-4c08-81c3-822ef4388580)\n */\nexport function programNode<\n    const TPdas extends Array<PdaNode> | undefined = [],\n    const TAccounts extends Array<AccountNode> | undefined = [],\n    const TInstructions extends Array<InstructionNode> | undefined = [],\n    const TDefinedTypes extends Array<DefinedTypeNode> | undefined = [],\n    const TErrors extends Array<ErrorNode> | undefined = [],\n    const TEvents extends Array<EventNode> | undefined = [],\n    const TConstants extends Array<ConstantNode> | undefined = [],\n>(\n    input: ProgramNodeInput<TPdas, TAccounts, TInstructions, TDefinedTypes, TErrors, TEvents, TConstants>,\n): ProgramNode<TPdas, TAccounts, TInstructions, TDefinedTypes, TErrors, TEvents, TConstants> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'programNode',\n\n        // Data.\n        name: camelCase(input.name),\n        publicKey: input.publicKey,\n        version: input.version ?? '0.0.0',\n        ...(input.origin !== undefined && { origin: input.origin }),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        ...(input.accounts !== undefined && input.accounts.length > 0 && { accounts: input.accounts as TAccounts }),\n        ...(input.instructions !== undefined &&\n            input.instructions.length > 0 && { instructions: input.instructions as TInstructions }),\n        ...(input.definedTypes !== undefined &&\n            input.definedTypes.length > 0 && { definedTypes: input.definedTypes as TDefinedTypes }),\n        ...(input.pdas !== undefined && input.pdas.length > 0 && { pdas: input.pdas as TPdas }),\n        ...(input.events !== undefined && input.events.length > 0 && { events: input.events as TEvents }),\n        ...(input.errors !== undefined && input.errors.length > 0 && { errors: input.errors as TErrors }),\n        ...(input.constants !== undefined &&\n            input.constants.length > 0 && { constants: input.constants as TConstants }),\n    });\n}\n","import type { Node, ProvidedNode } from '@codama/node-types';\n\nimport { camelCase } from '../shared';\n\n/**\n * Exposes a node under a name so consumers in the surrounding scope can resolve it by that key.\n * Sits inside a host's `provides` list and pairs with `injectedValueNode` on the consumer side: an injection with the matching key resolves to this entry's `node`.\n */\nexport function providedNode<const TNode extends Node>(name: string, value: TNode): ProvidedNode<TNode> {\n    return Object.freeze({\n        kind: 'providedNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        node: value,\n    });\n}\n","import type { ProgramNode, RootNode } from '@codama/node-types';\n\nimport { CODAMA_VERSION } from './codamaVersion';\n\n/**\n * The root of a Codama IDL.\n * Pairs a primary program with any number of additional programs and tags the IDL with the spec version.\n *\n * ![Diagram](https://github.com/codama-idl/codama/assets/3642397/96c43c75-5925-4b6b-a1e0-8b8c61317cfe)\n */\nexport function rootNode<\n    const TProgram extends ProgramNode,\n    const TAdditionalPrograms extends Array<ProgramNode> | undefined = [],\n>(\n    program: TProgram,\n    additionalPrograms: TAdditionalPrograms = [] as Array<ProgramNode> as TAdditionalPrograms,\n): RootNode<TProgram, TAdditionalPrograms> {\n    return Object.freeze({\n        kind: 'rootNode',\n\n        // Data.\n        standard: 'codama',\n        version: CODAMA_VERSION,\n\n        // Children.\n        program,\n        ...(additionalPrograms !== undefined &&\n            additionalPrograms.length > 0 && { additionalPrograms: additionalPrograms as TAdditionalPrograms }),\n    });\n}\n","import type { AccountBumpValueNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** Refers to the bump seed of a named PDA-derived account in the surrounding instruction. */\nexport function accountBumpValueNode(name: string): AccountBumpValueNode {\n    return Object.freeze({\n        kind: 'accountBumpValueNode',\n\n        // Data.\n        name: camelCase(name),\n    });\n}\n","import type { AccountFieldValueNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\nexport type AccountFieldValueNodeInput = Omit<AccountFieldValueNode, 'account' | 'kind' | 'path'> & {\n    readonly account: string;\n    readonly path?: string;\n};\n\n/**\n * Refers to a field of a named account's decoded data.\n * The referenced account must carry an `accountLink` so the account's layout is known.\n * Resolving the value requires reading the account state at presentation time.\n */\nexport function accountFieldValueNode(input: AccountFieldValueNodeInput): AccountFieldValueNode {\n    return Object.freeze({\n        kind: 'accountFieldValueNode',\n\n        // Data.\n        account: camelCase(input.account),\n        ...(input.path !== undefined && { path: camelCase(input.path) }),\n    });\n}\n","import type { AccountValueNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** Refers to a named account in the surrounding instruction. */\nexport function accountValueNode(name: string): AccountValueNode {\n    return Object.freeze({\n        kind: 'accountValueNode',\n\n        // Data.\n        name: camelCase(name),\n    });\n}\n","import type { ArgumentValueNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** Refers to a named argument of the surrounding instruction. */\nexport function argumentValueNode(name: string): ArgumentValueNode {\n    return Object.freeze({\n        kind: 'argumentValueNode',\n\n        // Data.\n        name: camelCase(name),\n    });\n}\n","/** The condition forms accepted by a `conditionalValueNode`. */\nexport const CONDITIONAL_VALUE_CONDITION_KINDS = [\n    'accountValueNode' as const,\n    'argumentValueNode' as const,\n    'resolverValueNode' as const,\n];\n","import type {\n    ConditionalValueCondition,\n    ConditionalValueNode,\n    InstructionInputValueNode,\n    ValueNode,\n} from '@codama/node-types';\n\nexport type ConditionalValueNodeInput<\n    TCondition extends ConditionalValueCondition = ConditionalValueCondition,\n    TValue extends ValueNode | undefined = ValueNode | undefined,\n    TIfTrue extends InstructionInputValueNode | undefined = InstructionInputValueNode | undefined,\n    TIfFalse extends InstructionInputValueNode | undefined = InstructionInputValueNode | undefined,\n> = Omit<ConditionalValueNode<TCondition, TValue, TIfTrue, TIfFalse>, 'kind'>;\n\n/**\n * A branching contextual value.\n * The condition resolves to a value at instruction time; that result selects between `ifTrue` and `ifFalse`.\n */\nexport function conditionalValueNode<\n    const TCondition extends ConditionalValueCondition,\n    const TValue extends ValueNode | undefined = undefined,\n    const TIfTrue extends InstructionInputValueNode | undefined = undefined,\n    const TIfFalse extends InstructionInputValueNode | undefined = undefined,\n>(\n    input: ConditionalValueNodeInput<TCondition, TValue, TIfTrue, TIfFalse>,\n): ConditionalValueNode<TCondition, TValue, TIfTrue, TIfFalse> {\n    return Object.freeze({\n        kind: 'conditionalValueNode',\n\n        // Children.\n        condition: input.condition,\n        ...(input.value !== undefined && { value: input.value }),\n        ...(input.ifTrue !== undefined && { ifTrue: input.ifTrue }),\n        ...(input.ifFalse !== undefined && { ifFalse: input.ifFalse }),\n    });\n}\n","import { STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS } from './StandaloneContextualValueNode';\n\n/** The composable form: any standalone contextual-value node. */\nexport const CONTEXTUAL_VALUE_NODE_KINDS = [...STANDALONE_CONTEXTUAL_VALUE_NODE_KINDS];\n","import type { IdentityValueNode } from '@codama/node-types';\n\n/**\n * Refers to the wallet identity providing the instruction context — the main wallet that should own things.\n * For instance, in a web application the identity would be the connected wallet; in a terminal, the wallet identified by `solana address`.\n * A similar node exists for the main wallet that should pay for things — `payerValueNode`. In practice the identity and the payer are often the same, but offering the distinction can be useful should they differ.\n */\nexport function identityValueNode(): IdentityValueNode {\n    return Object.freeze({\n        kind: 'identityValueNode',\n    });\n}\n","import { STANDALONE_VALUE_NODE_KINDS } from './StandaloneValueNode';\n\n/** The composable form: any standalone value node. */\nexport const VALUE_NODE_KINDS = [...STANDALONE_VALUE_NODE_KINDS];\n","import { VALUE_NODE_KINDS } from '../valueNodes/ValueNode';\nimport { CONTEXTUAL_VALUE_NODE_KINDS } from './ContextualValueNode';\n\n/**\n * Anything that can be used as the input value for an instruction account or argument default.\n * Covers concrete values, contextual references, and program links.\n */\nexport const INSTRUCTION_INPUT_VALUE_NODE_KINDS = [\n    ...CONTEXTUAL_VALUE_NODE_KINDS,\n    'programLinkNode' as const,\n    ...VALUE_NODE_KINDS,\n];\n","import type { PayerValueNode } from '@codama/node-types';\n\n/**\n * Refers to the wallet paying for the surrounding transaction — the main wallet that should pay for things, such as rent for account storage.\n * For instance, in a web application the payer would be the connected wallet; in a terminal, the wallet identified by `solana address`.\n * A similar node exists for the main wallet that should own things — `identityValueNode`. In practice the identity and the payer are often the same, but offering the distinction can be useful should they differ.\n */\nexport function payerValueNode(): PayerValueNode {\n    return Object.freeze({\n        kind: 'payerValueNode',\n    });\n}\n","import type { PdaSeedValueNode, PdaSeedValueValue } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** Pairs a PDA seed name with the value to substitute when deriving the PDA. */\nexport function pdaSeedValueNode<const TValue extends PdaSeedValueValue>(\n    name: string,\n    value: TValue,\n): PdaSeedValueNode<TValue> {\n    return Object.freeze({\n        kind: 'pdaSeedValueNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        value,\n    });\n}\n","import { VALUE_NODE_KINDS } from '../valueNodes/ValueNode';\n\n/** The value forms accepted by a `pdaSeedValueNode`. */\nexport const PDA_SEED_VALUE_VALUE_KINDS = [\n    'accountValueNode' as const,\n    'argumentValueNode' as const,\n    ...VALUE_NODE_KINDS,\n];\n","import type { ProgramLinkNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** A reference to a program by name. */\nexport function programLinkNode(name: string): ProgramLinkNode {\n    return Object.freeze({\n        kind: 'programLinkNode',\n\n        // Data.\n        name: camelCase(name),\n    });\n}\n","import type { PdaLinkNode, ProgramLinkNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\nimport { programLinkNode } from './ProgramLinkNode';\n\n/** A reference to a PDA defined elsewhere — possibly in a different program. */\nexport function pdaLinkNode<const TProgram extends ProgramLinkNode | undefined = undefined>(\n    name: string,\n    program?: TProgram | string,\n): PdaLinkNode<TProgram> {\n    return Object.freeze({\n        kind: 'pdaLinkNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        ...(program !== undefined && {\n            program: (typeof program === 'string' ? programLinkNode(program) : program) as TProgram,\n        }),\n    });\n}\n","import type { PdaSeedValueNode, PdaValueNode, PdaValuePda, PdaValueProgramId } from '@codama/node-types';\n\nimport { pdaLinkNode } from '../linkNodes/PdaLinkNode';\n\n/** Resolves to a PDA derived from a list of seed values. */\nexport function pdaValueNode<\n    const TSeeds extends Array<PdaSeedValueNode> | undefined = [],\n    const TProgramId extends PdaValueProgramId | undefined = undefined,\n    const TPda extends PdaValuePda = PdaValuePda,\n>(\n    pda: TPda | string,\n    seeds: TSeeds = [] as Array<PdaSeedValueNode> as TSeeds,\n    programId?: TProgramId,\n): PdaValueNode<TSeeds, TProgramId, TPda> {\n    return Object.freeze({\n        kind: 'pdaValueNode',\n\n        // Children.\n        pda: (typeof pda === 'string' ? pdaLinkNode(pda) : pda) as TPda,\n        ...(seeds !== undefined && seeds.length > 0 && { seeds: seeds as TSeeds }),\n        ...(programId !== undefined && { programId }),\n    });\n}\n","/** A `pdaValueNode` may reference a PDA either by link or inline. */\nexport const PDA_VALUE_PDA_KINDS = ['pdaLinkNode' as const, 'pdaNode' as const];\n","/** The program-id forms accepted by a `pdaValueNode`. */\nexport const PDA_VALUE_PROGRAM_ID_KINDS = ['accountValueNode' as const, 'argumentValueNode' as const];\n","import type { ProgramIdValueNode } from '@codama/node-types';\n\n/** Refers to the program ID of the surrounding instruction — that is, the address of the `programNode` this node descends from. */\nexport function programIdValueNode(): ProgramIdValueNode {\n    return Object.freeze({\n        kind: 'programIdValueNode',\n    });\n}\n","/** The dependency forms accepted by a `resolverValueNode`. */\nexport const RESOLVER_DEPENDENCY_KINDS = ['accountValueNode' as const, 'argumentValueNode' as const];\n","import type { ResolverDependency, ResolverValueNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../../shared';\n\n/**\n * A custom resolver: a named function provided by the consumer that produces a value.\n * May optionally depend on other accounts and arguments resolved at instruction-build time.\n * This node acts as a fallback for any value or logic that cannot easily be described by the other nodes — renderers treat resolvers as functions that can be injected into the generated code.\n */\nexport function resolverValueNode<const TDependsOn extends Array<ResolverDependency> | undefined = undefined>(\n    name: string,\n    options: {\n        docs?: DocsInput;\n        dependsOn?: TDependsOn;\n    } = {},\n): ResolverValueNode<TDependsOn> {\n    const parsedDocs = parseDocs(options.docs);\n    return Object.freeze({\n        kind: 'resolverValueNode',\n\n        // Data.\n        name: camelCase(name),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        ...(options.dependsOn !== undefined &&\n            options.dependsOn.length > 0 && { dependsOn: options.dependsOn as TDependsOn }),\n    });\n}\n","import { REGISTERED_COUNT_NODE_KINDS } from './RegisteredCountNode';\n\n/** The composable form: any registered count node. */\nexport const COUNT_NODE_KINDS = [...REGISTERED_COUNT_NODE_KINDS];\n","import type { FixedCountNode } from '@codama/node-types';\n\n/**\n * A count strategy that fixes the number of items at a constant value.\n * This enables nodes such as `arrayTypeNode` to represent collections of a fixed length.\n */\nexport function fixedCountNode(value: number): FixedCountNode {\n    return Object.freeze({\n        kind: 'fixedCountNode',\n\n        // Data.\n        value,\n    });\n}\n","import type { NestedTypeNode, NumberTypeNode, PrefixedCountNode } from '@codama/node-types';\n\n/**\n * A count strategy where the number of items is read from a numeric prefix.\n * This enables nodes such as `arrayTypeNode` to represent collections whose length is stored as a prefix.\n */\nexport function prefixedCountNode<const TPrefix extends NestedTypeNode<NumberTypeNode>>(\n    prefix: TPrefix,\n): PrefixedCountNode<TPrefix> {\n    return Object.freeze({\n        kind: 'prefixedCountNode',\n\n        // Children.\n        prefix,\n    });\n}\n","import type { RemainderCountNode } from '@codama/node-types';\n\n/**\n * A count strategy where items are read until the buffer is exhausted.\n * When encoding, items are serialised as-is and the total count is never stored; when decoding, items are read one by one until the end of the buffer.\n * This strategy is therefore only meaningful for the last variable-size region of a buffer.\n */\nexport function remainderCountNode(): RemainderCountNode {\n    return Object.freeze({\n        kind: 'remainderCountNode',\n    });\n}\n","import type { ConstantDiscriminatorNode, ConstantValueNode } from '@codama/node-types';\n\n/** Identifies a node by a constant value at a known byte offset (e.g. a magic header). */\nexport function constantDiscriminatorNode<const TConstant extends ConstantValueNode>(\n    constant: TConstant,\n    offset: number = 0,\n): ConstantDiscriminatorNode<TConstant> {\n    return Object.freeze({\n        kind: 'constantDiscriminatorNode',\n\n        // Data.\n        offset,\n\n        // Children.\n        constant,\n    });\n}\n","import { REGISTERED_DISCRIMINATOR_NODE_KINDS } from './RegisteredDiscriminatorNode';\n\n/** The composable form: any registered discriminator node. */\nexport const DISCRIMINATOR_NODE_KINDS = [...REGISTERED_DISCRIMINATOR_NODE_KINDS];\n","import type { FieldDiscriminatorNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** Identifies a node by the value of a named field at a known byte offset. */\nexport function fieldDiscriminatorNode(name: string, offset: number = 0): FieldDiscriminatorNode {\n    return Object.freeze({\n        kind: 'fieldDiscriminatorNode',\n\n        // Data.\n        name: camelCase(name),\n        offset,\n    });\n}\n","import type { SizeDiscriminatorNode } from '@codama/node-types';\n\n/** Identifies a node by its expected total byte size. */\nexport function sizeDiscriminatorNode(size: number): SizeDiscriminatorNode {\n    return Object.freeze({\n        kind: 'sizeDiscriminatorNode',\n\n        // Data.\n        size,\n    });\n}\n","import type { AmountNumberDisplayNode, InjectableNumberValueNode, InjectableStringValueNode } from '@codama/node-types';\n\nexport type AmountNumberDisplayNodeInput<\n    TDecimals extends InjectableNumberValueNode | undefined = InjectableNumberValueNode | undefined,\n    TUnit extends InjectableStringValueNode | undefined = InjectableStringValueNode | undefined,\n> = Omit<AmountNumberDisplayNode<TDecimals, TUnit>, 'kind'>;\n\n/**\n * Display metadata that presents a number as a scaled amount with an optional unit.\n * The value is divided by `10 ^ decimals` and rendered alongside `unit` (e.g. `\"USDC\"`, `\"%\"`, `\"bps\"`).\n */\nexport function amountNumberDisplayNode<\n    const TDecimals extends InjectableNumberValueNode | undefined = undefined,\n    const TUnit extends InjectableStringValueNode | undefined = undefined,\n>(input: AmountNumberDisplayNodeInput<TDecimals, TUnit>): AmountNumberDisplayNode<TDecimals, TUnit> {\n    return Object.freeze({\n        kind: 'amountNumberDisplayNode',\n\n        // Children.\n        ...(input.decimals !== undefined && { decimals: input.decimals }),\n        ...(input.unit !== undefined && { unit: input.unit }),\n    });\n}\n","import type { DateTimeNumberDisplayNode } from '@codama/node-types';\n\nexport type DateTimeNumberDisplayNodeInput = Omit<DateTimeNumberDisplayNode, 'kind'>;\n\n/**\n * Display metadata that presents a number as a point in time.\n * The underlying value counts ticks since the Unix epoch; `ticksPerSecond` is the divisor that converts those ticks back to seconds.\n */\nexport function dateTimeNumberDisplayNode(input: DateTimeNumberDisplayNodeInput): DateTimeNumberDisplayNode {\n    return Object.freeze({\n        kind: 'dateTimeNumberDisplayNode',\n\n        // Data.\n        ...(input.ticksPerSecond !== undefined && { ticksPerSecond: input.ticksPerSecond }),\n    });\n}\n","import { REGISTERED_DISPLAY_NODE_KINDS } from './RegisteredDisplayNode';\n\n/** The composable form: any registered display node. */\nexport const DISPLAY_NODE_KINDS = [...REGISTERED_DISPLAY_NODE_KINDS];\n","import type { DurationNumberDisplayNode } from '@codama/node-types';\n\nexport type DurationNumberDisplayNodeInput = Omit<DurationNumberDisplayNode, 'kind'>;\n\n/**\n * Display metadata that presents a number as an elapsed duration.\n * The underlying value counts ticks; `ticksPerSecond` is the divisor that converts those ticks back to seconds.\n * Renderers typically format the result as `HH:mm:ss` or a coarser human-readable form.\n */\nexport function durationNumberDisplayNode(input: DurationNumberDisplayNodeInput): DurationNumberDisplayNode {\n    return Object.freeze({\n        kind: 'durationNumberDisplayNode',\n\n        // Data.\n        ...(input.ticksPerSecond !== undefined && { ticksPerSecond: input.ticksPerSecond }),\n    });\n}\n","import type { EnumVariantDisplayNode } from '@codama/node-types';\n\nexport type EnumVariantDisplayNodeInput = Omit<EnumVariantDisplayNode, 'kind'>;\n\n/** Display metadata for an enum variant: its label and whether to hide its inner payload. */\nexport function enumVariantDisplayNode(input: EnumVariantDisplayNodeInput): EnumVariantDisplayNode {\n    return Object.freeze({\n        kind: 'enumVariantDisplayNode',\n\n        // Data.\n        ...(input.label !== undefined && { label: input.label }),\n        ...(input.skipInnerData !== undefined && { skipInnerData: input.skipInnerData }),\n    });\n}\n","import type { InstructionAccountDisplayNode } from '@codama/node-types';\n\nexport type InstructionAccountDisplayNodeInput = Omit<InstructionAccountDisplayNode, 'kind'>;\n\n/** Display metadata for an instruction account: its label in the fallback list and whether it is shown. */\nexport function instructionAccountDisplayNode(\n    input: InstructionAccountDisplayNodeInput,\n): InstructionAccountDisplayNode {\n    return Object.freeze({\n        kind: 'instructionAccountDisplayNode',\n\n        // Data.\n        ...(input.label !== undefined && { label: input.label }),\n        ...(input.skip !== undefined && { skip: input.skip }),\n    });\n}\n","import type { InstructionDisplayNode } from '@codama/node-types';\n\nexport type InstructionDisplayNodeInput = Omit<InstructionDisplayNode, 'kind'>;\n\n/**\n * Display metadata for an instruction: a short intent label and an interpolated sentence template.\n * Either form may be absent; presentation strategy is left to the renderer.\n */\nexport function instructionDisplayNode(input: InstructionDisplayNodeInput): InstructionDisplayNode {\n    return Object.freeze({\n        kind: 'instructionDisplayNode',\n\n        // Data.\n        ...(input.intent !== undefined && { intent: input.intent }),\n        ...(input.interpolatedIntent !== undefined && { interpolatedIntent: input.interpolatedIntent }),\n    });\n}\n","/** The presentation forms a number may take. Raw rendering is expressed by the absence of a display attribute. */\nexport const NUMBER_DISPLAY_NODE_KINDS = [\n    'amountNumberDisplayNode' as const,\n    'dateTimeNumberDisplayNode' as const,\n    'durationNumberDisplayNode' as const,\n];\n","import type { StringDisplayNode } from '@codama/node-types';\n\nexport type StringDisplayNodeInput = Omit<StringDisplayNode, 'kind'>;\n\n/**\n * Display metadata for a string value.\n * The string's wire encoding is carried by `stringTypeNode.encoding`; this node only addresses presentation.\n */\nexport function stringDisplayNode(input: StringDisplayNodeInput): StringDisplayNode {\n    return Object.freeze({\n        kind: 'stringDisplayNode',\n\n        // Data.\n        ...(input.sliceStart !== undefined && { sliceStart: input.sliceStart }),\n        ...(input.sliceEnd !== undefined && { sliceEnd: input.sliceEnd }),\n    });\n}\n","import type { StructFieldDisplayNode } from '@codama/node-types';\n\nexport type StructFieldDisplayNodeInput = Omit<StructFieldDisplayNode, 'kind'>;\n\n/**\n * Display metadata for a named member: its label, whether it is shown in the fallback list, and whether it is flattened into its parent.\n * Value presentation is carried by the member's type; this node only addresses naming and composition.\n */\nexport function structFieldDisplayNode(input: StructFieldDisplayNodeInput): StructFieldDisplayNode {\n    return Object.freeze({\n        kind: 'structFieldDisplayNode',\n\n        // Data.\n        ...(input.label !== undefined && { label: input.label }),\n        ...(input.skip !== undefined && { skip: input.skip }),\n        ...(input.flatten !== undefined && { flatten: input.flatten }),\n        ...(input.flattenPrefix !== undefined && { flattenPrefix: input.flattenPrefix }),\n    });\n}\n","import type { AccountLinkNode, ProgramLinkNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\nimport { programLinkNode } from './ProgramLinkNode';\n\n/** A reference to an account defined elsewhere — possibly in a different program. */\nexport function accountLinkNode<const TProgram extends ProgramLinkNode | undefined = undefined>(\n    name: string,\n    program?: TProgram | string,\n): AccountLinkNode<TProgram> {\n    return Object.freeze({\n        kind: 'accountLinkNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        ...(program !== undefined && {\n            program: (typeof program === 'string' ? programLinkNode(program) : program) as TProgram,\n        }),\n    });\n}\n","import type { DefinedTypeLinkNode, ProgramLinkNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\nimport { programLinkNode } from './ProgramLinkNode';\n\n/** A reference to a defined type — possibly in a different program. */\nexport function definedTypeLinkNode<const TProgram extends ProgramLinkNode | undefined = undefined>(\n    name: string,\n    program?: TProgram | string,\n): DefinedTypeLinkNode<TProgram> {\n    return Object.freeze({\n        kind: 'definedTypeLinkNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        ...(program !== undefined && {\n            program: (typeof program === 'string' ? programLinkNode(program) : program) as TProgram,\n        }),\n    });\n}\n","import type { InstructionLinkNode, ProgramLinkNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\nimport { programLinkNode } from './ProgramLinkNode';\n\n/** A reference to an instruction defined elsewhere — possibly in a different program. */\nexport function instructionLinkNode<const TProgram extends ProgramLinkNode | undefined = undefined>(\n    name: string,\n    program?: TProgram | string,\n): InstructionLinkNode<TProgram> {\n    return Object.freeze({\n        kind: 'instructionLinkNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        ...(program !== undefined && {\n            program: (typeof program === 'string' ? programLinkNode(program) : program) as TProgram,\n        }),\n    });\n}\n","import type { InstructionAccountLinkNode, InstructionLinkNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\nimport { instructionLinkNode } from './InstructionLinkNode';\n\n/** A reference to an account of another instruction. */\nexport function instructionAccountLinkNode<const TInstruction extends InstructionLinkNode | undefined = undefined>(\n    name: string,\n    instruction?: TInstruction | string,\n): InstructionAccountLinkNode<TInstruction> {\n    return Object.freeze({\n        kind: 'instructionAccountLinkNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        ...(instruction !== undefined && {\n            instruction: (typeof instruction === 'string'\n                ? instructionLinkNode(instruction)\n                : instruction) as TInstruction,\n        }),\n    });\n}\n","import type { InstructionArgumentLinkNode, InstructionLinkNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\nimport { instructionLinkNode } from './InstructionLinkNode';\n\n/** A reference to an argument of another instruction. */\nexport function instructionArgumentLinkNode<const TInstruction extends InstructionLinkNode | undefined = undefined>(\n    name: string,\n    instruction?: TInstruction | string,\n): InstructionArgumentLinkNode<TInstruction> {\n    return Object.freeze({\n        kind: 'instructionArgumentLinkNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        ...(instruction !== undefined && {\n            instruction: (typeof instruction === 'string'\n                ? instructionLinkNode(instruction)\n                : instruction) as TInstruction,\n        }),\n    });\n}\n","import { REGISTERED_LINK_NODE_KINDS } from './RegisteredLinkNode';\n\n/** The composable form: any registered link node. */\nexport const LINK_NODE_KINDS = [...REGISTERED_LINK_NODE_KINDS];\n","import type { ConstantPdaSeedNode, ConstantPdaSeedValue, TypeNode } from '@codama/node-types';\n\n/** A PDA seed with a constant value (e.g. a UTF-8 string or a fixed byte sequence). */\nexport function constantPdaSeedNode<const TType extends TypeNode, const TValue extends ConstantPdaSeedValue>(\n    type: TType,\n    value: TValue,\n): ConstantPdaSeedNode<TType, TValue> {\n    return Object.freeze({\n        kind: 'constantPdaSeedNode',\n\n        // Children.\n        type,\n        value,\n    });\n}\n","import { VALUE_NODE_KINDS } from '../valueNodes/ValueNode';\n\n/** The value forms a `constantPdaSeedNode` may carry — either a literal value or the program ID placeholder. */\nexport const CONSTANT_PDA_SEED_VALUE_KINDS = ['programIdValueNode' as const, ...VALUE_NODE_KINDS];\n","import { REGISTERED_PDA_SEED_NODE_KINDS } from './RegisteredPdaSeedNode';\n\n/** The composable form: any registered PDA seed node. */\nexport const PDA_SEED_NODE_KINDS = [...REGISTERED_PDA_SEED_NODE_KINDS];\n","import type { TypeNode, VariablePdaSeedNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../../shared';\n\n/** A PDA seed whose value is provided at derivation time, identified by name. */\nexport function variablePdaSeedNode<const TType extends TypeNode>(\n    name: string,\n    type: TType,\n    docs?: DocsInput,\n): VariablePdaSeedNode<TType> {\n    const parsedDocs = parseDocs(docs);\n    return Object.freeze({\n        kind: 'variablePdaSeedNode',\n\n        // Data.\n        name: camelCase(name),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        type,\n    });\n}\n","import type { AmountTypeNode, NestedTypeNode, NumberTypeNode } from '@codama/node-types';\n\n/**\n * Wraps a number type to provide additional context such as decimal places and a unit.\n * Particularly useful for representing financial values as integers, since floating-point numbers are notoriously unsafe for that purpose.\n */\nexport function amountTypeNode<const TNumber extends NestedTypeNode<NumberTypeNode>>(\n    number: TNumber,\n    decimals: number,\n    unit?: string,\n): AmountTypeNode<TNumber> {\n    return Object.freeze({\n        kind: 'amountTypeNode',\n\n        // Data.\n        decimals,\n        ...(unit !== undefined && { unit }),\n\n        // Children.\n        number,\n    });\n}\n","import type { ArrayTypeNode, CountNode, TypeNode } from '@codama/node-types';\n\n/** A homogeneous list of items. The item type is defined by `item`; the length is determined by the `count` strategy. */\nexport function arrayTypeNode<const TItem extends TypeNode, const TCount extends CountNode>(\n    item: TItem,\n    count: TCount,\n): ArrayTypeNode<TItem, TCount> {\n    return Object.freeze({\n        kind: 'arrayTypeNode',\n\n        // Children.\n        item,\n        count,\n    });\n}\n","import type { Endianness, NumberDisplayNode, NumberFormat, NumberTypeNode } from '@codama/node-types';\n\n/** A numeric type with a fixed wire format and byte order. */\nexport function numberTypeNode<\n    const TFormat extends NumberFormat = NumberFormat,\n    const TDisplay extends NumberDisplayNode | undefined = undefined,\n>(\n    format: TFormat,\n    endian: Endianness = 'le',\n    options: {\n        display?: TDisplay;\n    } = {},\n): NumberTypeNode<TFormat, TDisplay> {\n    return Object.freeze({\n        kind: 'numberTypeNode',\n\n        // Data.\n        format,\n        endian,\n\n        // Children.\n        ...(options.display !== undefined && { display: options.display }),\n    });\n}\n","import type { BooleanTypeNode, NestedTypeNode, NumberTypeNode } from '@codama/node-types';\n\nimport { numberTypeNode } from './NumberTypeNode';\n\n/**\n * A boolean serialised as a numeric value. The wrapped number type determines the byte width.\n * A decoded number of `1` yields `true`; any other value yields `false`.\n */\nexport function booleanTypeNode<const TSize extends NestedTypeNode<NumberTypeNode> = NumberTypeNode<'u8'>>(\n    size: TSize = numberTypeNode('u8') as NumberTypeNode<'u8'> as TSize,\n): BooleanTypeNode<TSize> {\n    return Object.freeze({\n        kind: 'booleanTypeNode',\n\n        // Children.\n        size,\n    });\n}\n","import type { BytesTypeNode } from '@codama/node-types';\n\n/** A raw sequence of bytes. Typically used inside a fixed-size, size-prefixed, or sentinel-terminated wrapper. */\nexport function bytesTypeNode(): BytesTypeNode {\n    return Object.freeze({\n        kind: 'bytesTypeNode',\n    });\n}\n","import type { DateTimeTypeNode, NestedTypeNode, NumberTypeNode } from '@codama/node-types';\n\n/** A timestamp encoded as a number, typically seconds since the Unix epoch. The wrapped number type determines the byte width. */\nexport function dateTimeTypeNode<const TNumber extends NestedTypeNode<NumberTypeNode>>(\n    number: TNumber,\n): DateTimeTypeNode<TNumber> {\n    return Object.freeze({\n        kind: 'dateTimeTypeNode',\n\n        // Children.\n        number,\n    });\n}\n","import type { EnumEmptyVariantTypeNode, EnumVariantDisplayNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** A unit-style variant of an enum that carries no payload. */\nexport function enumEmptyVariantTypeNode<const TDisplay extends EnumVariantDisplayNode | undefined = undefined>(\n    name: string,\n    discriminator?: number,\n    options: {\n        display?: TDisplay;\n    } = {},\n): EnumEmptyVariantTypeNode<TDisplay> {\n    return Object.freeze({\n        kind: 'enumEmptyVariantTypeNode',\n\n        // Data.\n        name: camelCase(name),\n        ...(discriminator !== undefined && { discriminator }),\n\n        // Children.\n        ...(options.display !== undefined && { display: options.display }),\n    });\n}\n","import type {\n    EnumStructVariantTypeNode,\n    EnumVariantDisplayNode,\n    NestedTypeNode,\n    StructTypeNode,\n} from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** A variant of an enum that carries a struct payload (named fields). */\nexport function enumStructVariantTypeNode<\n    const TStruct extends NestedTypeNode<StructTypeNode>,\n    const TDisplay extends EnumVariantDisplayNode | undefined = undefined,\n>(\n    name: string,\n    struct: TStruct,\n    discriminator?: number,\n    options: {\n        display?: TDisplay;\n    } = {},\n): EnumStructVariantTypeNode<TStruct, TDisplay> {\n    return Object.freeze({\n        kind: 'enumStructVariantTypeNode',\n\n        // Data.\n        name: camelCase(name),\n        ...(discriminator !== undefined && { discriminator }),\n\n        // Children.\n        struct,\n        ...(options.display !== undefined && { display: options.display }),\n    });\n}\n","import type {\n    EnumTupleVariantTypeNode,\n    EnumVariantDisplayNode,\n    NestedTypeNode,\n    TupleTypeNode,\n} from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** A variant of an enum that carries a tuple payload (positional fields). */\nexport function enumTupleVariantTypeNode<\n    const TTuple extends NestedTypeNode<TupleTypeNode>,\n    const TDisplay extends EnumVariantDisplayNode | undefined = undefined,\n>(\n    name: string,\n    tuple: TTuple,\n    discriminator?: number,\n    options: {\n        display?: TDisplay;\n    } = {},\n): EnumTupleVariantTypeNode<TTuple, TDisplay> {\n    return Object.freeze({\n        kind: 'enumTupleVariantTypeNode',\n\n        // Data.\n        name: camelCase(name),\n        ...(discriminator !== undefined && { discriminator }),\n\n        // Children.\n        tuple,\n        ...(options.display !== undefined && { display: options.display }),\n    });\n}\n","import type { EnumTypeNode, EnumVariantTypeNode, NestedTypeNode, NumberTypeNode } from '@codama/node-types';\n\nimport { numberTypeNode } from './NumberTypeNode';\n\n/** A tagged union: a numeric discriminator followed by one of several variant payloads. */\nexport function enumTypeNode<\n    const TVariants extends Array<EnumVariantTypeNode> | undefined,\n    const TSize extends NestedTypeNode<NumberTypeNode> = NumberTypeNode<'u8'>,\n>(\n    variants: TVariants,\n    options: {\n        size?: TSize;\n    } = {},\n): EnumTypeNode<TVariants, TSize> {\n    return Object.freeze({\n        kind: 'enumTypeNode',\n\n        // Children.\n        ...(variants !== undefined && variants.length > 0 && { variants: variants as TVariants }),\n        size: (options.size ?? numberTypeNode('u8')) as TSize,\n    });\n}\n","import type { FixedSizeTypeNode, TypeNode } from '@codama/node-types';\n\n/** Wraps another type and asserts a fixed total byte size. Padding or truncation is applied as needed. */\nexport function fixedSizeTypeNode<const TType extends TypeNode>(type: TType, size: number): FixedSizeTypeNode<TType> {\n    return Object.freeze({\n        kind: 'fixedSizeTypeNode',\n\n        // Data.\n        size,\n\n        // Children.\n        type,\n    });\n}\n","import type { ConstantValueNode, HiddenPrefixTypeNode, TypeNode } from '@codama/node-types';\n\n/**\n * Prefixes another type with a list of constant values that are written and read but not surfaced as fields to consumers.\n * When decoding, the prefixed constants are consumed and checked against their expected values before being discarded.\n */\nexport function hiddenPrefixTypeNode<\n    const TType extends TypeNode,\n    const TPrefix extends Array<ConstantValueNode> | undefined,\n>(type: TType, prefix: TPrefix): HiddenPrefixTypeNode<TType, TPrefix> {\n    return Object.freeze({\n        kind: 'hiddenPrefixTypeNode',\n\n        // Children.\n        type,\n        ...(prefix !== undefined && prefix.length > 0 && { prefix: prefix as TPrefix }),\n    });\n}\n","import type { ConstantValueNode, HiddenSuffixTypeNode, TypeNode } from '@codama/node-types';\n\n/**\n * Suffixes another type with a list of constant values that are written and read but not surfaced as fields to consumers.\n * When decoding, the suffixed constants are consumed and checked against their expected values before being discarded.\n */\nexport function hiddenSuffixTypeNode<\n    const TType extends TypeNode,\n    const TSuffix extends Array<ConstantValueNode> | undefined,\n>(type: TType, suffix: TSuffix): HiddenSuffixTypeNode<TType, TSuffix> {\n    return Object.freeze({\n        kind: 'hiddenSuffixTypeNode',\n\n        // Children.\n        type,\n        ...(suffix !== undefined && suffix.length > 0 && { suffix: suffix as TSuffix }),\n    });\n}\n","import type { CountNode, MapTypeNode, TypeNode } from '@codama/node-types';\n\n/**\n * A keyed map.\n * The key and value types are described by their respective type nodes; the entry count is determined by a count strategy.\n * Entries are serialised one after the other, each key immediately followed by its value — e.g. key A, value A, key B, value B.\n */\nexport function mapTypeNode<const TKey extends TypeNode, const TValue extends TypeNode, const TCount extends CountNode>(\n    key: TKey,\n    value: TValue,\n    count: TCount,\n): MapTypeNode<TKey, TValue, TCount> {\n    return Object.freeze({\n        kind: 'mapTypeNode',\n\n        // Children.\n        key,\n        value,\n        count,\n    });\n}\n","import type { NestedTypeNode, NumberTypeNode, OptionTypeNode, TypeNode } from '@codama/node-types';\n\nimport { numberTypeNode } from './NumberTypeNode';\n\n/** A value that may be present or absent (Some/None), with an explicit numeric prefix indicating presence. */\nexport function optionTypeNode<\n    const TItem extends TypeNode,\n    const TPrefix extends NestedTypeNode<NumberTypeNode> = NumberTypeNode<'u8'>,\n>(\n    item: TItem,\n    options: {\n        fixed?: boolean;\n        prefix?: TPrefix;\n    } = {},\n): OptionTypeNode<TItem, TPrefix> {\n    return Object.freeze({\n        kind: 'optionTypeNode',\n\n        // Data.\n        fixed: options.fixed ?? false,\n\n        // Children.\n        item,\n        prefix: (options.prefix ?? numberTypeNode('u8')) as TPrefix,\n    });\n}\n","import type { PostOffsetStrategy, PostOffsetTypeNode, TypeNode } from '@codama/node-types';\n\n/**\n * After serialising the wrapped type, advance the cursor by `offset` bytes interpreted via the chosen strategy.\n *\n * Since the offset is applied _after_ the wrapped type runs, this node is useful to move the cursor around once the wrapped type has been processed. See `preOffsetTypeNode` for the opposite behaviour.\n *\n * The strategies below are illustrated against the following buffer: the `99` byte represents the encoded value of the wrapped type and the `FF` byte represents the next bytes to be encoded after it, in order to show the _post_ cursor position.\n *\n * ```\n * 0x00000099FF000000;\n *         | └-- Initial post-offset\n *         └-- Pre-offset\n * ```\n *\n * **`relative`** — the cursor is moved to the right by the provided offset. A negative offset moves it to the left instead.\n *\n * ```\n * offset = 2\n * 0x000000990000FF00;\n *               └-- Post-offset\n *\n * offset = -2\n * 0x0000FF9900000000;\n *       └-- Post-offset\n * ```\n *\n * **`absolute`** — the cursor is moved to an absolute position in the buffer. A negative offset moves it backwards from the end of the buffer.\n *\n * ```\n * offset = 0\n * 0xFF00009900000000;\n *   └-- Post-offset\n *\n * offset = -2\n * 0x000000990000FF00;\n *               └-- Post-offset\n * ```\n *\n * **`padded`** — the cursor is moved to the right by the provided offset **and the buffer size is increased** by the offset amount, allowing padding bytes to be added. Reciprocally, a negative offset moves the cursor to the left and decreases the buffer size.\n *\n * ```\n * offset = 2\n * 0x000000990000FF000000; <- Size = 10 (initially 8)\n *               └-- Post-offset\n *\n * offset = -2\n * 0x0000FF990000; <- Size = 6 (initially 8)\n *       └-- Post-offset\n * ```\n *\n * **`preOffset`** — the cursor is moved to the right of the pre-offset — i.e. where the wrapped type started — by the provided offset. A negative offset moves it to the left of the pre-offset instead.\n *\n * ```\n * offset = 2\n * 0x0000009900FF0000;\n *         |   └-- Post-offset = Pre-offset + 2\n *         └-- Pre-offset\n *\n * offset = -2\n * 0x00FF009900000000;\n *     |   └-- Pre-offset\n *     └-- Post-offset = Pre-offset - 2\n * ```\n *\n * > [!IMPORTANT]\n * > Some type nodes affect the buffer that is available to us: depending on where we are in the type tree, we may not have access to the entire buffer.\n * > For instance, inside a `fixedSizeTypeNode`, the buffer is truncated or padded to match the provided fixed size once the wrapped content has been serialised — we are essentially \"boxed\" into a sub-buffer, and that sub-buffer is the one affected by the `absolute` strategy.\n * > The type nodes that create sub-buffers are: `fixedSizeTypeNode`, `sentinelTypeNode`, and `sizePrefixTypeNode`.\n */\nexport function postOffsetTypeNode<const TType extends TypeNode>(\n    type: TType,\n    offset: number,\n    strategy: PostOffsetStrategy = 'relative',\n): PostOffsetTypeNode<TType> {\n    return Object.freeze({\n        kind: 'postOffsetTypeNode',\n\n        // Data.\n        offset,\n        strategy,\n\n        // Children.\n        type,\n    });\n}\n","import type { PreOffsetStrategy, PreOffsetTypeNode, TypeNode } from '@codama/node-types';\n\n/**\n * Before serialising the wrapped type, advance the cursor by `offset` bytes interpreted via the chosen strategy.\n *\n * Since the offset is applied _before_ the wrapped type runs, this node is useful to move the encoded value of the wrapped type itself. See `postOffsetTypeNode` for the opposite behaviour.\n *\n * The strategies below are illustrated against the following buffer: the `99` byte represents some previously encoded value for reference and the `FF` byte represents the encoded value of the wrapped type, which moves as its pre-offset changes.\n *\n * ```\n * 0x00000099FF000000;\n *           └-- Initial pre-offset\n * ```\n *\n * **`relative`** — the cursor is moved to the right by the provided offset. A negative offset moves it to the left instead.\n *\n * ```\n * offset = 2\n * 0x000000990000FF00;\n *               └-- Pre-offset\n *\n * offset = -2\n * 0x0000FF9900000000;\n *       └-- Pre-offset\n * ```\n *\n * **`absolute`** — the cursor is moved to an absolute position in the buffer. A negative offset moves it backwards from the end of the buffer.\n *\n * ```\n * offset = 0\n * 0xFF00009900000000;\n *   └-- Pre-offset\n *\n * offset = -2\n * 0x000000990000FF00;\n *               └-- Pre-offset\n * ```\n *\n * **`padded`** — the cursor is moved to the right by the provided offset **and the buffer size is increased** by the offset amount, allowing padding bytes to be added. Reciprocally, a negative offset moves the cursor to the left and decreases the buffer size.\n *\n * ```\n * offset = 2\n * 0x000000990000FF000000; <- Size = 10 (initially 8)\n *               └-- Pre-offset\n *\n * offset = -2\n * 0x0000FF990000; <- Size = 6 (initially 8)\n *       └-- Pre-offset\n * ```\n *\n * > [!IMPORTANT]\n * > Some type nodes affect the buffer that is available to us: depending on where we are in the type tree, we may not have access to the entire buffer.\n * > For instance, inside a `fixedSizeTypeNode`, the buffer is truncated or padded to match the provided fixed size once the wrapped content has been serialised — we are essentially \"boxed\" into a sub-buffer, and that sub-buffer is the one affected by the `absolute` strategy.\n * > The type nodes that create sub-buffers are: `fixedSizeTypeNode`, `sentinelTypeNode`, and `sizePrefixTypeNode`.\n */\nexport function preOffsetTypeNode<const TType extends TypeNode>(\n    type: TType,\n    offset: number,\n    strategy: PreOffsetStrategy = 'relative',\n): PreOffsetTypeNode<TType> {\n    return Object.freeze({\n        kind: 'preOffsetTypeNode',\n\n        // Data.\n        offset,\n        strategy,\n\n        // Children.\n        type,\n    });\n}\n","import type { PublicKeyTypeNode } from '@codama/node-types';\n\n/** A 32-byte Solana public key. */\nexport function publicKeyTypeNode(): PublicKeyTypeNode {\n    return Object.freeze({\n        kind: 'publicKeyTypeNode',\n    });\n}\n","import type { RemainderOptionTypeNode, TypeNode } from '@codama/node-types';\n\n/** A value that may be present or absent. Presence is signalled by whether any bytes remain to be read, with no explicit prefix. */\nexport function remainderOptionTypeNode<const TItem extends TypeNode>(item: TItem): RemainderOptionTypeNode<TItem> {\n    return Object.freeze({\n        kind: 'remainderOptionTypeNode',\n\n        // Children.\n        item,\n    });\n}\n","import type { ConstantValueNode, SentinelTypeNode, TypeNode } from '@codama/node-types';\n\n/**\n * Wraps another type and delimits it with a constant sentinel value written immediately after the wrapped type.\n *\n * When decoding, the wrapped type is decoded until the sentinel value is encountered, at which point decoding stops and the sentinel is discarded.\n *\n * > [!IMPORTANT]\n * > For this node to work, the sentinel value must never occur within the encoded bytes of the wrapped type.\n */\nexport function sentinelTypeNode<const TType extends TypeNode, const TSentinel extends ConstantValueNode>(\n    type: TType,\n    sentinel: TSentinel,\n): SentinelTypeNode<TType, TSentinel> {\n    return Object.freeze({\n        kind: 'sentinelTypeNode',\n\n        // Children.\n        type,\n        sentinel,\n    });\n}\n","import type { CountNode, SetTypeNode, TypeNode } from '@codama/node-types';\n\n/** A unique-valued collection. The item type is defined by `item`; the size is determined by the `count` strategy. */\nexport function setTypeNode<const TItem extends TypeNode, const TCount extends CountNode>(\n    item: TItem,\n    count: TCount,\n): SetTypeNode<TItem, TCount> {\n    return Object.freeze({\n        kind: 'setTypeNode',\n\n        // Children.\n        item,\n        count,\n    });\n}\n","import type { NestedTypeNode, NumberTypeNode, SizePrefixTypeNode, TypeNode } from '@codama/node-types';\n\n/**\n * Wraps another type with a numeric prefix indicating the byte length of the wrapped type.\n * When decoding, the size is read first and determines how many bytes the wrapped type may consume.\n */\nexport function sizePrefixTypeNode<const TType extends TypeNode, const TPrefix extends NestedTypeNode<NumberTypeNode>>(\n    type: TType,\n    prefix: TPrefix,\n): SizePrefixTypeNode<TType, TPrefix> {\n    return Object.freeze({\n        kind: 'sizePrefixTypeNode',\n\n        // Children.\n        type,\n        prefix,\n    });\n}\n","import type { NestedTypeNode, NumberTypeNode, SolAmountTypeNode } from '@codama/node-types';\n\n/**\n * A SOL amount expressed in lamports under the wrapped numeric type.\n * Equivalent to an `amountTypeNode` with 9 decimals and `SOL` as the unit.\n */\nexport function solAmountTypeNode<const TNumber extends NestedTypeNode<NumberTypeNode>>(\n    number: TNumber,\n): SolAmountTypeNode<TNumber> {\n    return Object.freeze({\n        kind: 'solAmountTypeNode',\n\n        // Children.\n        number,\n    });\n}\n","import type { BytesEncoding, StringDisplayNode, StringTypeNode } from '@codama/node-types';\n\n/**\n * A string value.\n * The encoding describes how its bytes are written.\n * The byte length is determined by an enclosing wrapper such as `sizePrefixTypeNode` or `fixedSizeTypeNode`.\n */\nexport function stringTypeNode<\n    const TEncoding extends BytesEncoding = BytesEncoding,\n    const TDisplay extends StringDisplayNode | undefined = undefined,\n>(\n    encoding: TEncoding,\n    options: {\n        display?: TDisplay;\n    } = {},\n): StringTypeNode<TEncoding, TDisplay> {\n    return Object.freeze({\n        kind: 'stringTypeNode',\n\n        // Data.\n        encoding,\n\n        // Children.\n        ...(options.display !== undefined && { display: options.display }),\n    });\n}\n","import type { StructFieldDisplayNode, StructFieldTypeNode, TypeNode, ValueNode } from '@codama/node-types';\n\nimport { camelCase, DocsInput, parseDocs } from '../../shared';\n\nexport type StructFieldTypeNodeInput<\n    TType extends TypeNode = TypeNode,\n    TDefaultValue extends ValueNode | undefined = ValueNode | undefined,\n    TDisplay extends StructFieldDisplayNode | undefined = StructFieldDisplayNode | undefined,\n> = Omit<StructFieldTypeNode<TType, TDefaultValue, TDisplay>, 'docs' | 'kind' | 'name'> & {\n    readonly name: string;\n    readonly docs?: DocsInput;\n};\n\n/** A named field within a struct type. */\nexport function structFieldTypeNode<\n    const TType extends TypeNode,\n    const TDefaultValue extends ValueNode | undefined = undefined,\n    const TDisplay extends StructFieldDisplayNode | undefined = undefined,\n>(\n    input: StructFieldTypeNodeInput<TType, TDefaultValue, TDisplay>,\n): StructFieldTypeNode<TType, TDefaultValue, TDisplay> {\n    const parsedDocs = parseDocs(input.docs);\n    return Object.freeze({\n        kind: 'structFieldTypeNode',\n\n        // Data.\n        name: camelCase(input.name),\n        ...(input.defaultValueStrategy !== undefined && { defaultValueStrategy: input.defaultValueStrategy }),\n        ...(parsedDocs.length > 0 && { docs: parsedDocs }),\n\n        // Children.\n        type: input.type,\n        ...(input.defaultValue !== undefined && { defaultValue: input.defaultValue }),\n        ...(input.display !== undefined && { display: input.display }),\n    });\n}\n","import type { TupleTypeNode, TypeNode } from '@codama/node-types';\n\n/** A heterogeneous fixed-length sequence in which each positional slot has its own type. */\nexport function tupleTypeNode<const TItems extends Array<TypeNode> | undefined>(items: TItems): TupleTypeNode<TItems> {\n    return Object.freeze({\n        kind: 'tupleTypeNode',\n\n        // Children.\n        ...(items !== undefined && items.length > 0 && { items: items as TItems }),\n    });\n}\n","import { STANDALONE_TYPE_NODE_KINDS } from './StandaloneTypeNode';\n\n/** The composable form: any standalone type, or a reference to a defined type via `definedTypeLinkNode`. */\nexport const TYPE_NODE_KINDS = ['definedTypeLinkNode' as const, ...STANDALONE_TYPE_NODE_KINDS];\n","import type { ConstantValueNode, TypeNode, ZeroableOptionTypeNode } from '@codama/node-types';\n\n/** An optional value whose absence is signalled by a designated zero value rather than a presence flag. */\nexport function zeroableOptionTypeNode<\n    const TItem extends TypeNode,\n    const TZeroValue extends ConstantValueNode | undefined = undefined,\n>(item: TItem, zeroValue?: TZeroValue): ZeroableOptionTypeNode<TItem, TZeroValue> {\n    return Object.freeze({\n        kind: 'zeroableOptionTypeNode',\n\n        // Children.\n        item,\n        ...(zeroValue !== undefined && { zeroValue }),\n    });\n}\n","import type { ArrayValueNode, ValueNode } from '@codama/node-types';\n\n/** A concrete array value: a list of value nodes. */\nexport function arrayValueNode<const TItems extends Array<ValueNode> | undefined>(\n    items: TItems,\n): ArrayValueNode<TItems> {\n    return Object.freeze({\n        kind: 'arrayValueNode',\n\n        // Children.\n        ...(items !== undefined && items.length > 0 && { items: items as TItems }),\n    });\n}\n","import type { BooleanValueNode } from '@codama/node-types';\n\n/** A concrete boolean value. */\nexport function booleanValueNode(boolean: boolean): BooleanValueNode {\n    return Object.freeze({\n        kind: 'booleanValueNode',\n\n        // Data.\n        boolean,\n    });\n}\n","import type { BytesEncoding, BytesValueNode } from '@codama/node-types';\n\n/** A concrete bytes value, encoded as text in the chosen encoding. */\nexport function bytesValueNode(encoding: BytesEncoding, data: string): BytesValueNode {\n    return Object.freeze({\n        kind: 'bytesValueNode',\n\n        // Data.\n        data,\n        encoding,\n    });\n}\n","import type { ConstantValueNode, TypeNode, ValueNode } from '@codama/node-types';\n\n/** A typed constant: a type node paired with a concrete value node. */\nexport function constantValueNode<const TType extends TypeNode, const TValue extends ValueNode>(\n    type: TType,\n    value: TValue,\n): ConstantValueNode<TType, TValue> {\n    return Object.freeze({\n        kind: 'constantValueNode',\n\n        // Children.\n        type,\n        value,\n    });\n}\n","import type { DefinedTypeLinkNode, EnumValueNode, EnumValuePayload } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\nimport { definedTypeLinkNode } from '../linkNodes/DefinedTypeLinkNode';\n\n/** A concrete value of a defined enum: a variant identifier plus an optional payload. */\nexport function enumValueNode<\n    const TEnum extends DefinedTypeLinkNode = DefinedTypeLinkNode,\n    const TValue extends EnumValuePayload | undefined = undefined,\n>(enumLink: TEnum | string, variant: string, value?: TValue): EnumValueNode<TEnum, TValue> {\n    return Object.freeze({\n        kind: 'enumValueNode',\n\n        // Data.\n        variant: camelCase(variant),\n\n        // Children.\n        enum: (typeof enumLink === 'string' ? definedTypeLinkNode(enumLink) : enumLink) as TEnum,\n        ...(value !== undefined && { value }),\n    });\n}\n","/** The payload kinds an `enumValueNode` may carry — struct fields or positional tuple slots. */\nexport const ENUM_VALUE_PAYLOAD_KINDS = ['structValueNode' as const, 'tupleValueNode' as const];\n","/** A concrete number value, or a key resolved at presentation time from a surrounding provider. */\nexport const INJECTABLE_NUMBER_VALUE_NODE_KINDS = ['injectedValueNode' as const, 'numberValueNode' as const];\n","/** A concrete string value, or a key resolved at presentation time from a surrounding provider. */\nexport const INJECTABLE_STRING_VALUE_NODE_KINDS = ['injectedValueNode' as const, 'stringValueNode' as const];\n","import type { InjectedValueNode, ValueNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\nexport type InjectedValueNodeInput<TFallback extends ValueNode | undefined = ValueNode | undefined> = Omit<\n    InjectedValueNode<TFallback>,\n    'key' | 'kind'\n> & {\n    readonly key: string;\n};\n\n/**\n * A value resolved by key from a surrounding provider.\n * A `providedNode` higher in the resolution tree supplies the actual value; the consumer references only the `key`, so the same type stays portable across instructions that wire the key differently.\n * Resolution is a per-context property: a value with the same key may resolve in one instruction and not another.\n */\nexport function injectedValueNode<const TFallback extends ValueNode | undefined = undefined>(\n    input: InjectedValueNodeInput<TFallback>,\n): InjectedValueNode<TFallback> {\n    return Object.freeze({\n        kind: 'injectedValueNode',\n\n        // Data.\n        key: camelCase(input.key),\n\n        // Children.\n        ...(input.fallback !== undefined && { fallback: input.fallback }),\n    });\n}\n","import type { MapEntryValueNode, ValueNode } from '@codama/node-types';\n\n/**\n * A single (key, value) pair inside a `mapValueNode`.\n * For example, the map `{ total: 42 }` has one entry whose key is the string `\"total\"` and whose value is the number `42`.\n */\nexport function mapEntryValueNode<const TKey extends ValueNode, const TValue extends ValueNode>(\n    key: TKey,\n    value: TValue,\n): MapEntryValueNode<TKey, TValue> {\n    return Object.freeze({\n        kind: 'mapEntryValueNode',\n\n        // Children.\n        key,\n        value,\n    });\n}\n","import type { MapEntryValueNode, MapValueNode } from '@codama/node-types';\n\n/** A concrete map value: a list of (key, value) entries. */\nexport function mapValueNode<const TEntries extends Array<MapEntryValueNode> | undefined>(\n    entries: TEntries,\n): MapValueNode<TEntries> {\n    return Object.freeze({\n        kind: 'mapValueNode',\n\n        // Children.\n        ...(entries !== undefined && entries.length > 0 && { entries: entries as TEntries }),\n    });\n}\n","import type { NoneValueNode } from '@codama/node-types';\n\n/**\n * The \"absent\" value for an optional type.\n * For instance, this can be set as the default value of a field whose type is an `optionTypeNode`.\n */\nexport function noneValueNode(): NoneValueNode {\n    return Object.freeze({\n        kind: 'noneValueNode',\n    });\n}\n","import type { NumberValueNode } from '@codama/node-types';\n\n/**\n * A concrete numeric value.\n * Stored as a 64-bit float; consumers narrow to a specific integer or float width based on the surrounding type context.\n */\nexport function numberValueNode(number: number): NumberValueNode {\n    return Object.freeze({\n        kind: 'numberValueNode',\n\n        // Data.\n        number,\n    });\n}\n","import type { PublicKeyValueNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** A concrete 32-byte public key, with an optional symbolic identifier for the address. */\nexport function publicKeyValueNode(publicKey: string, identifier?: string): PublicKeyValueNode {\n    return Object.freeze({\n        kind: 'publicKeyValueNode',\n\n        // Data.\n        publicKey,\n        ...(identifier !== undefined && { identifier: camelCase(identifier) }),\n    });\n}\n","import type { SetValueNode, ValueNode } from '@codama/node-types';\n\n/** A concrete set value: a list of unique value nodes. */\nexport function setValueNode<const TItems extends Array<ValueNode> | undefined>(items: TItems): SetValueNode<TItems> {\n    return Object.freeze({\n        kind: 'setValueNode',\n\n        // Children.\n        ...(items !== undefined && items.length > 0 && { items: items as TItems }),\n    });\n}\n","import type { SomeValueNode, ValueNode } from '@codama/node-types';\n\n/**\n * The \"present\" value for an optional type, wrapping a concrete value node.\n * For instance, this can be set as the default value of a field whose type is an `optionTypeNode`.\n */\nexport function someValueNode<const TValue extends ValueNode>(value: TValue): SomeValueNode<TValue> {\n    return Object.freeze({\n        kind: 'someValueNode',\n\n        // Children.\n        value,\n    });\n}\n","import type { StringValueNode } from '@codama/node-types';\n\n/** A concrete string value. */\nexport function stringValueNode(string: string): StringValueNode {\n    return Object.freeze({\n        kind: 'stringValueNode',\n\n        // Data.\n        string,\n    });\n}\n","import type { StructFieldValueNode, ValueNode } from '@codama/node-types';\n\nimport { camelCase } from '../../shared';\n\n/** A named field of a `structValueNode`. */\nexport function structFieldValueNode<const TValue extends ValueNode>(\n    name: string,\n    value: TValue,\n): StructFieldValueNode<TValue> {\n    return Object.freeze({\n        kind: 'structFieldValueNode',\n\n        // Data.\n        name: camelCase(name),\n\n        // Children.\n        value,\n    });\n}\n","import type { StructFieldValueNode, StructValueNode } from '@codama/node-types';\n\n/** A concrete struct value: a list of named field values. */\nexport function structValueNode<const TFields extends Array<StructFieldValueNode> | undefined>(\n    fields: TFields,\n): StructValueNode<TFields> {\n    return Object.freeze({\n        kind: 'structValueNode',\n\n        // Children.\n        ...(fields !== undefined && fields.length > 0 && { fields: fields as TFields }),\n    });\n}\n","import type { TupleValueNode, ValueNode } from '@codama/node-types';\n\n/** A concrete tuple value: a fixed-length sequence of positional value nodes. */\nexport function tupleValueNode<const TItems extends Array<ValueNode> | undefined>(\n    items: TItems,\n): TupleValueNode<TItems> {\n    return Object.freeze({\n        kind: 'tupleValueNode',\n\n        // Children.\n        ...(items !== undefined && items.length > 0 && { items: items as TItems }),\n    });\n}\n","import type { BytesEncoding } from '@codama/node-types';\n\nimport { programIdValueNode } from './generated/contextualValueNodes/ProgramIdValueNode';\nimport { constantPdaSeedNode } from './generated/pdaSeedNodes/ConstantPdaSeedNode';\nimport { bytesTypeNode } from './generated/typeNodes/BytesTypeNode';\nimport { publicKeyTypeNode } from './generated/typeNodes/PublicKeyTypeNode';\nimport { stringTypeNode } from './generated/typeNodes/StringTypeNode';\nimport { bytesValueNode } from './generated/valueNodes/BytesValueNode';\nimport { stringValueNode } from './generated/valueNodes/StringValueNode';\n\nexport function constantPdaSeedNodeFromProgramId() {\n    return constantPdaSeedNode(publicKeyTypeNode(), programIdValueNode());\n}\n\nexport function constantPdaSeedNodeFromString<TEncoding extends BytesEncoding>(encoding: TEncoding, string: string) {\n    return constantPdaSeedNode(stringTypeNode(encoding), stringValueNode(string));\n}\n\nexport function constantPdaSeedNodeFromBytes<TEncoding extends BytesEncoding>(encoding: TEncoding, data: string) {\n    return constantPdaSeedNode(bytesTypeNode(), bytesValueNode(encoding, data));\n}\n","import type { BytesEncoding } from '@codama/node-types';\n\nimport { bytesTypeNode } from './generated/typeNodes/BytesTypeNode';\nimport { stringTypeNode } from './generated/typeNodes/StringTypeNode';\nimport { bytesValueNode } from './generated/valueNodes/BytesValueNode';\nimport { constantValueNode } from './generated/valueNodes/ConstantValueNode';\nimport { stringValueNode } from './generated/valueNodes/StringValueNode';\n\nexport function constantValueNodeFromString<TEncoding extends BytesEncoding>(encoding: TEncoding, string: string) {\n    return constantValueNode(stringTypeNode(encoding), stringValueNode(string));\n}\n\nexport function constantValueNodeFromBytes<TEncoding extends BytesEncoding>(encoding: TEncoding, data: string) {\n    return constantValueNode(bytesTypeNode(), bytesValueNode(encoding, data));\n}\n","import type { EnumTypeNode } from '@codama/node-types';\n\nexport function isScalarEnum(node: EnumTypeNode): boolean {\n    return (node.variants ?? []).every(variant => variant.kind === 'enumEmptyVariantTypeNode');\n}\n\nexport function isDataEnum(node: EnumTypeNode): boolean {\n    return !isScalarEnum(node);\n}\n","import type { InstructionArgumentNode } from '@codama/node-types';\n\nimport { structFieldTypeNode } from './generated/typeNodes/StructFieldTypeNode';\nimport { structTypeNode } from './generated/typeNodes/StructTypeNode';\nimport { VALUE_NODE_KINDS } from './generated/valueNodes/ValueNode';\nimport { isNode } from './Node';\n\nexport function structTypeNodeFromInstructionArgumentNodes(nodes: InstructionArgumentNode[]) {\n    return structTypeNode(nodes.map(structFieldTypeNodeFromInstructionArgumentNode));\n}\n\nexport function structFieldTypeNodeFromInstructionArgumentNode(node: InstructionArgumentNode) {\n    if (isNode(node.defaultValue, VALUE_NODE_KINDS)) {\n        return structFieldTypeNode({ ...node, defaultValue: node.defaultValue });\n    }\n    return structFieldTypeNode({\n        ...node,\n        defaultValue: undefined,\n        defaultValueStrategy: undefined,\n    });\n}\n","import type {\n    AccountNode,\n    ConstantNode,\n    DefinedTypeNode,\n    ErrorNode,\n    EventNode,\n    InstructionNode,\n    PdaNode,\n    ProgramNode,\n    RootNode,\n} from '@codama/node-types';\n\nexport function getAllPrograms(node: ProgramNode | ProgramNode[] | RootNode): ProgramNode[] {\n    if (Array.isArray(node)) return node;\n    if (node.kind === 'programNode') return [node];\n    return [node.program, ...(node.additionalPrograms ?? [])];\n}\n\nexport function getAllPdas(node: ProgramNode | ProgramNode[] | RootNode): PdaNode[] {\n    return getAllPrograms(node).flatMap(program => program.pdas ?? []);\n}\n\nexport function getAllAccounts(node: ProgramNode | ProgramNode[] | RootNode): AccountNode[] {\n    return getAllPrograms(node).flatMap(program => program.accounts ?? []);\n}\n\nexport function getAllEvents(node: ProgramNode | ProgramNode[] | RootNode): EventNode[] {\n    return getAllPrograms(node).flatMap(program => program.events ?? []);\n}\n\nexport function getAllDefinedTypes(node: ProgramNode | ProgramNode[] | RootNode): DefinedTypeNode[] {\n    return getAllPrograms(node).flatMap(program => program.definedTypes ?? []);\n}\n\nexport function getAllInstructions(node: ProgramNode | ProgramNode[] | RootNode): InstructionNode[] {\n    return getAllPrograms(node).flatMap(program => program.instructions ?? []);\n}\n\nexport function getAllErrors(node: ProgramNode | ProgramNode[] | RootNode): ErrorNode[] {\n    return getAllPrograms(node).flatMap(program => program.errors ?? []);\n}\n\nexport function getAllConstants(node: ProgramNode | ProgramNode[] | RootNode): ConstantNode[] {\n    return getAllPrograms(node).flatMap(program => program.constants ?? []);\n}\n","import type {\n    InstructionArgumentNode,\n    InstructionNode,\n    OptionalAccountStrategy,\n    ProgramNode,\n    RootNode,\n} from '@codama/node-types';\n\nimport { isNode } from './Node';\nimport { getAllInstructions } from './ProgramNode';\n\nexport function parseOptionalAccountStrategy(\n    optionalAccountStrategy: OptionalAccountStrategy | undefined,\n): OptionalAccountStrategy {\n    return optionalAccountStrategy ?? 'programId';\n}\n\nexport function getAllInstructionArguments(node: InstructionNode): InstructionArgumentNode[] {\n    return [...(node.arguments ?? []), ...(node.extraArguments ?? [])];\n}\n\nexport function getAllInstructionsWithSubs(\n    node: InstructionNode | ProgramNode | RootNode,\n    config: { leavesOnly?: boolean; subInstructionsFirst?: boolean } = {},\n): InstructionNode[] {\n    const { leavesOnly = false, subInstructionsFirst = false } = config;\n    if (isNode(node, 'instructionNode')) {\n        if (!node.subInstructions || node.subInstructions.length === 0) return [node];\n        const subInstructions = node.subInstructions.flatMap(sub => getAllInstructionsWithSubs(sub, config));\n        if (leavesOnly) return subInstructions;\n        return subInstructionsFirst ? [...subInstructions, node] : [node, ...subInstructions];\n    }\n\n    const instructions = isNode(node, 'programNode') ? (node.instructions ?? []) : getAllInstructions(node);\n\n    return instructions.flatMap(instruction => getAllInstructionsWithSubs(instruction, config));\n}\n","import { CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND, CodamaError } from '@codama/errors';\nimport type { NestedTypeNode, Node, TypeNode } from '@codama/node-types';\n\nimport { TYPE_NODE_KINDS } from './generated/typeNodes/TypeNode';\nimport { isNode } from './Node';\n\nexport function resolveNestedTypeNode<TType extends TypeNode>(typeNode: NestedTypeNode<TType>): TType {\n    switch (typeNode.kind) {\n        case 'fixedSizeTypeNode':\n        case 'hiddenPrefixTypeNode':\n        case 'hiddenSuffixTypeNode':\n        case 'postOffsetTypeNode':\n        case 'preOffsetTypeNode':\n        case 'sentinelTypeNode':\n        case 'sizePrefixTypeNode':\n            return resolveNestedTypeNode<TType>(typeNode.type as NestedTypeNode<TType>);\n        default:\n            return typeNode;\n    }\n}\n\nexport function transformNestedTypeNode<TFrom extends TypeNode, TTo extends TypeNode>(\n    typeNode: NestedTypeNode<TFrom>,\n    map: (type: TFrom) => TTo,\n): NestedTypeNode<TTo> {\n    switch (typeNode.kind) {\n        case 'fixedSizeTypeNode':\n        case 'hiddenPrefixTypeNode':\n        case 'hiddenSuffixTypeNode':\n        case 'postOffsetTypeNode':\n        case 'preOffsetTypeNode':\n        case 'sentinelTypeNode':\n        case 'sizePrefixTypeNode':\n            return Object.freeze({\n                ...typeNode,\n                type: transformNestedTypeNode(typeNode.type as NestedTypeNode<TFrom>, map),\n            } as NestedTypeNode<TTo>);\n        default:\n            return map(typeNode);\n    }\n}\n\nexport function isNestedTypeNode<TKind extends TypeNode['kind']>(\n    node: Node | null | undefined,\n    kind: TKind | TKind[],\n): node is NestedTypeNode<Extract<TypeNode, { kind: TKind }>> {\n    if (!isNode(node, TYPE_NODE_KINDS)) return false;\n    const kinds = Array.isArray(kind) ? kind : [kind];\n    const resolved = resolveNestedTypeNode(node);\n    return !!node && kinds.includes(resolved.kind as TKind);\n}\n\nexport function assertIsNestedTypeNode<TKind extends TypeNode['kind']>(\n    node: Node | null | undefined,\n    kind: TKind | TKind[],\n): asserts node is NestedTypeNode<Extract<TypeNode, { kind: TKind }>> {\n    const kinds = Array.isArray(kind) ? kind : [kind];\n    if (!isNestedTypeNode(node, kinds)) {\n        throw new CodamaError(CODAMA_ERROR__UNEXPECTED_NESTED_NODE_KIND, {\n            expectedKinds: kinds,\n            kind: node?.kind ?? null,\n            node,\n        });\n    }\n}\n","import type { NumberTypeNode } from '@codama/node-types';\n\nexport function isSignedInteger(node: NumberTypeNode): boolean {\n    return node.format.startsWith('i');\n}\n\nexport function isUnsignedInteger(node: NumberTypeNode): boolean {\n    return node.format.startsWith('u') || node.format === 'shortU16';\n}\n\nexport function isInteger(node: NumberTypeNode): boolean {\n    return !node.format.startsWith('f');\n}\n\nexport function isDecimal(node: NumberTypeNode): boolean {\n    return node.format.startsWith('f');\n}\n"]}