@tributary-so/sdk
    Preparing search index...

    Function buildComposableExecutionPayload

    • Build the full execution payload (instructionData + remaining_accounts) for execute_composable by composing the four primitives in order (ADR-0030 §1, amended).

      Flow:

      1. Forward gate — when isForwardEnabled is true and a forwardBuilder is supplied, run it with the caller-resolved face to obtain the forward instruction data + forward-program account slice. Throws when forward is enabled but no builder is passed — the orchestrator cannot synthesize a forward instruction. When forward is disabled, instructionData is an empty buffer and the forward-account slice is empty (any supplied builder is ignored).
      2. Validation targets — pre and post targets are resolved in parallel via resolveValidationTargets; each returns [] when the respective spec is not ProgramCall.
      3. Assembly — assembleComposableRemainingAccounts stamps the ADR-0016 order [...preTargets, ...forwardAccounts, ...postTargets] with isSigner: false on every entry (ADR-0008).

      Does not derive face — the caller resolves it via resolveDefaultForwardAmount or a manual override. Does not append the scheduler fee ATA — the SDK executeComposable facade owns that (ADR-0016 amended). Callers needing per-step override (CLI flags) should call the primitives directly.

      Parameters

      • args: {
            composablePolicyPda: PublicKey;
            connection: Connection;
            face: BN;
            forwardBuilder?: ForwardBuilder;
            policy: {
                bump: number;
                createdAt: BN;
                forwardConfig: {
                    forwardFlags: number;
                    inputMint: PublicKey;
                    instructionConstraint: {
                        dataChecks: { expected: number[]; length: number; offset: number }[];
                        numDataChecks: number;
                        numPinnedAccounts: number;
                        pinnedAccounts: { index: number; pubkey: PublicKey }[];
                        programId: PublicKey;
                    };
                    outputMint: PublicKey;
                };
                gateway: PublicKey;
                memo: number[];
                padding: number[];
                paymentCount: number;
                policyId: number;
                policyType: DecodeEnum<
                    {
                        kind: "enum";
                        variants: [
                            {
                                fields: [
                                    { name: "amount"; type: "u64" },
                                    { name: "autoRenew"; type: "bool" },
                                    { name: "maxRenewals"; type: { option: "u32" } },
                                    {
                                        name: "paymentFrequency";
                                        type: { defined: { name: "paymentFrequency" } };
                                    },
                                    { name: "nextPaymentDue"; type: "i64" },
                                    { name: "padding"; type: { array: ["u8", 97] } },
                                ];
                                name: "subscription";
                            },
                            {
                                fields: [
                                    { name: "milestoneAmounts"; type: { array: ["u64", 4] } },
                                    { name: "milestoneTimestamps"; type: { array: ["i64", 4] } },
                                    { name: "currentMilestone"; type: "u8" },
                                    { name: "releaseCondition"; type: "u8" },
                                    { name: "totalMilestones"; type: "u8" },
                                    { name: "escrowAmount"; type: "u64" },
                                    { name: "padding"; type: { array: ["u8", 53] } },
                                ];
                                name: "milestone";
                            },
                            {
                                fields: [
                                    { name: "maxAmountPerPeriod"; type: "u64" },
                                    { name: "maxChunkAmount"; type: "u64" },
                                    { name: "periodLengthSeconds"; type: "u64" },
                                    { name: "currentPeriodStart"; type: "i64" },
                                    { name: "currentPeriodTotal"; type: "u64" },
                                    { name: "expiryDate"; type: { option: "i64" } },
                                    { name: "padding"; type: { array: ["u8", 79] } },
                                ];
                                name: "payAsYouGo";
                            },
                            {
                                fields: [
                                    { name: "amount"; type: "u64" },
                                    { name: "dueDate"; type: "i64" },
                                    { name: "expiryDate"; type: { option: "i64" } },
                                    { name: "padding"; type: { array: ["u8", 103] } },
                                ];
                                name: "oneTime";
                            },
                            {
                                fields: [
                                    { name: "maxAmount"; type: "u64" },
                                    { name: "validAfter"; type: "i64" },
                                    { name: "deadline"; type: "i64" },
                                    { name: "padding"; type: { array: ["u8", 104] } },
                                ];
                                name: "upTo";
                            },
                        ];
                    },
                    DecodedHelper<
                        [
                            {
                                name: "byteRangeCheck";
                                type: {
                                    fields: [
                                        { name: "offset"; type: "u8" },
                                        { name: "length"; type: "u8" },
                                        { name: "expected"; type: { array: [(...), (...)] } },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                docs: [
                                    "An event that is thrown when a composable policy is executed",
                                ];
                                name: "composableExecuted";
                                type: {
                                    fields: [
                                        { name: "composablePolicy"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "targetProgram"; type: "pubkey" },
                                        { name: "inputAmount"; type: "u64" },
                                        { name: "outputAmount"; type: "u64" },
                                        { name: "gatewayFee"; type: "u64" },
                                        { name: "protocolFee"; type: "u64" },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                name: "composablePolicy";
                                type: {
                                    fields: [
                                        { name: "bump"; type: "u8" },
                                        { name: "userPayment"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "status"; type: { defined: { name: ... } } },
                                        { name: "rentPayer"; type: "pubkey" },
                                        { name: "policyType"; type: { defined: { name: ... } } },
                                        { name: "forwardConfig"; type: { defined: { name: ... } } },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                docs: [
                                    "An event that is thrown when a composable policy is created",
                                ];
                                name: "composablePolicyCreated";
                                type: {
                                    fields: [
                                        { name: "composablePolicy"; type: "pubkey" },
                                        { name: "userPayment"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "recipient"; type: "pubkey" },
                                        { name: "policyId"; type: "u32" },
                                        { name: "policyType"; type: { defined: { name: ... } } },
                                        { name: "memo"; type: { array: [(...), (...)] } },
                                    ];
                                    kind: "struct";
                                };
                            },
                        ],
                        DecodedHelper<
                            [
                                {
                                    name: "byteRangeCheck";
                                    type: {
                                        fields: [
                                            { name: "offset"; type: "u8" },
                                            { name: "length"; type: "u8" },
                                            { name: "expected"; type: { array: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    docs: [
                                        "An event that is thrown when a composable policy is executed",
                                    ];
                                    name: "composableExecuted";
                                    type: {
                                        fields: [
                                            { name: "composablePolicy"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "targetProgram"; type: "pubkey" },
                                            { name: "inputAmount"; type: "u64" },
                                            { name: "outputAmount"; type: "u64" },
                                            { name: "gatewayFee"; type: "u64" },
                                            { name: "protocolFee"; type: "u64" },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    name: "composablePolicy";
                                    type: {
                                        fields: [
                                            { name: "bump"; type: "u8" },
                                            { name: "userPayment"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "status"; type: { defined: ... } },
                                            { name: "rentPayer"; type: "pubkey" },
                                            { name: "policyType"; type: { defined: ... } },
                                            { name: "forwardConfig"; type: { defined: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    docs: [
                                        "An event that is thrown when a composable policy is created",
                                    ];
                                    name: "composablePolicyCreated";
                                    type: {
                                        fields: [
                                            { name: "composablePolicy"; type: "pubkey" },
                                            { name: "userPayment"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "recipient"; type: "pubkey" },
                                            { name: "policyId"; type: "u32" },
                                            { name: "policyType"; type: { defined: ... } },
                                            { name: "memo"; type: { array: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                            ],
                            DecodedHelper<
                                [
                                    {
                                        name: "byteRangeCheck";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        docs: [
                                            "An event that is thrown when a composable policy is executed",
                                        ];
                                        name: "composableExecuted";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        name: "composablePolicy";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        docs: [
                                            "An event that is thrown when a composable policy is created",
                                        ];
                                        name: "composablePolicyCreated";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                ],
                                EmptyDefined,
                            >,
                        >,
                    >,
                >;
                postValidation: DecodeEnum<
                    {
                        kind: "enum";
                        variants: [
                            { name: "disabled" },
                            {
                                fields: [{ name: "programId"; type: "pubkey" }];
                                name: "programCall";
                            },
                            { fields: [{ name: "reserved"; type: "u8" }]; name: "inline" },
                        ];
                    },
                    DecodedHelper<
                        [
                            {
                                name: "byteRangeCheck";
                                type: {
                                    fields: [
                                        { name: "offset"; type: "u8" },
                                        { name: "length"; type: "u8" },
                                        { name: "expected"; type: { array: [(...), (...)] } },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                docs: [
                                    "An event that is thrown when a composable policy is executed",
                                ];
                                name: "composableExecuted";
                                type: {
                                    fields: [
                                        { name: "composablePolicy"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "targetProgram"; type: "pubkey" },
                                        { name: "inputAmount"; type: "u64" },
                                        { name: "outputAmount"; type: "u64" },
                                        { name: "gatewayFee"; type: "u64" },
                                        { name: "protocolFee"; type: "u64" },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                name: "composablePolicy";
                                type: {
                                    fields: [
                                        { name: "bump"; type: "u8" },
                                        { name: "userPayment"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "status"; type: { defined: { name: ... } } },
                                        { name: "rentPayer"; type: "pubkey" },
                                        { name: "policyType"; type: { defined: { name: ... } } },
                                        { name: "forwardConfig"; type: { defined: { name: ... } } },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                docs: [
                                    "An event that is thrown when a composable policy is created",
                                ];
                                name: "composablePolicyCreated";
                                type: {
                                    fields: [
                                        { name: "composablePolicy"; type: "pubkey" },
                                        { name: "userPayment"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "recipient"; type: "pubkey" },
                                        { name: "policyId"; type: "u32" },
                                        { name: "policyType"; type: { defined: { name: ... } } },
                                        { name: "memo"; type: { array: [(...), (...)] } },
                                    ];
                                    kind: "struct";
                                };
                            },
                        ],
                        DecodedHelper<
                            [
                                {
                                    name: "byteRangeCheck";
                                    type: {
                                        fields: [
                                            { name: "offset"; type: "u8" },
                                            { name: "length"; type: "u8" },
                                            { name: "expected"; type: { array: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    docs: [
                                        "An event that is thrown when a composable policy is executed",
                                    ];
                                    name: "composableExecuted";
                                    type: {
                                        fields: [
                                            { name: "composablePolicy"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "targetProgram"; type: "pubkey" },
                                            { name: "inputAmount"; type: "u64" },
                                            { name: "outputAmount"; type: "u64" },
                                            { name: "gatewayFee"; type: "u64" },
                                            { name: "protocolFee"; type: "u64" },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    name: "composablePolicy";
                                    type: {
                                        fields: [
                                            { name: "bump"; type: "u8" },
                                            { name: "userPayment"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "status"; type: { defined: ... } },
                                            { name: "rentPayer"; type: "pubkey" },
                                            { name: "policyType"; type: { defined: ... } },
                                            { name: "forwardConfig"; type: { defined: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    docs: [
                                        "An event that is thrown when a composable policy is created",
                                    ];
                                    name: "composablePolicyCreated";
                                    type: {
                                        fields: [
                                            { name: "composablePolicy"; type: "pubkey" },
                                            { name: "userPayment"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "recipient"; type: "pubkey" },
                                            { name: "policyId"; type: "u32" },
                                            { name: "policyType"; type: { defined: ... } },
                                            { name: "memo"; type: { array: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                            ],
                            DecodedHelper<
                                [
                                    {
                                        name: "byteRangeCheck";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        docs: [
                                            "An event that is thrown when a composable policy is executed",
                                        ];
                                        name: "composableExecuted";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        name: "composablePolicy";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        docs: [
                                            "An event that is thrown when a composable policy is created",
                                        ];
                                        name: "composablePolicyCreated";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                ],
                                EmptyDefined,
                            >,
                        >,
                    >,
                >;
                preValidation: DecodeEnum<
                    {
                        kind: "enum";
                        variants: [
                            { name: "disabled" },
                            {
                                fields: [{ name: "programId"; type: "pubkey" }];
                                name: "programCall";
                            },
                            { fields: [{ name: "reserved"; type: "u8" }]; name: "inline" },
                        ];
                    },
                    DecodedHelper<
                        [
                            {
                                name: "byteRangeCheck";
                                type: {
                                    fields: [
                                        { name: "offset"; type: "u8" },
                                        { name: "length"; type: "u8" },
                                        { name: "expected"; type: { array: [(...), (...)] } },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                docs: [
                                    "An event that is thrown when a composable policy is executed",
                                ];
                                name: "composableExecuted";
                                type: {
                                    fields: [
                                        { name: "composablePolicy"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "targetProgram"; type: "pubkey" },
                                        { name: "inputAmount"; type: "u64" },
                                        { name: "outputAmount"; type: "u64" },
                                        { name: "gatewayFee"; type: "u64" },
                                        { name: "protocolFee"; type: "u64" },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                name: "composablePolicy";
                                type: {
                                    fields: [
                                        { name: "bump"; type: "u8" },
                                        { name: "userPayment"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "status"; type: { defined: { name: ... } } },
                                        { name: "rentPayer"; type: "pubkey" },
                                        { name: "policyType"; type: { defined: { name: ... } } },
                                        { name: "forwardConfig"; type: { defined: { name: ... } } },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                docs: [
                                    "An event that is thrown when a composable policy is created",
                                ];
                                name: "composablePolicyCreated";
                                type: {
                                    fields: [
                                        { name: "composablePolicy"; type: "pubkey" },
                                        { name: "userPayment"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "recipient"; type: "pubkey" },
                                        { name: "policyId"; type: "u32" },
                                        { name: "policyType"; type: { defined: { name: ... } } },
                                        { name: "memo"; type: { array: [(...), (...)] } },
                                    ];
                                    kind: "struct";
                                };
                            },
                        ],
                        DecodedHelper<
                            [
                                {
                                    name: "byteRangeCheck";
                                    type: {
                                        fields: [
                                            { name: "offset"; type: "u8" },
                                            { name: "length"; type: "u8" },
                                            { name: "expected"; type: { array: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    docs: [
                                        "An event that is thrown when a composable policy is executed",
                                    ];
                                    name: "composableExecuted";
                                    type: {
                                        fields: [
                                            { name: "composablePolicy"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "targetProgram"; type: "pubkey" },
                                            { name: "inputAmount"; type: "u64" },
                                            { name: "outputAmount"; type: "u64" },
                                            { name: "gatewayFee"; type: "u64" },
                                            { name: "protocolFee"; type: "u64" },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    name: "composablePolicy";
                                    type: {
                                        fields: [
                                            { name: "bump"; type: "u8" },
                                            { name: "userPayment"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "status"; type: { defined: ... } },
                                            { name: "rentPayer"; type: "pubkey" },
                                            { name: "policyType"; type: { defined: ... } },
                                            { name: "forwardConfig"; type: { defined: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    docs: [
                                        "An event that is thrown when a composable policy is created",
                                    ];
                                    name: "composablePolicyCreated";
                                    type: {
                                        fields: [
                                            { name: "composablePolicy"; type: "pubkey" },
                                            { name: "userPayment"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "recipient"; type: "pubkey" },
                                            { name: "policyId"; type: "u32" },
                                            { name: "policyType"; type: { defined: ... } },
                                            { name: "memo"; type: { array: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                            ],
                            DecodedHelper<
                                [
                                    {
                                        name: "byteRangeCheck";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        docs: [
                                            "An event that is thrown when a composable policy is executed",
                                        ];
                                        name: "composableExecuted";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        name: "composablePolicy";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        docs: [
                                            "An event that is thrown when a composable policy is created",
                                        ];
                                        name: "composablePolicyCreated";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                ],
                                EmptyDefined,
                            >,
                        >,
                    >,
                >;
                recipient: PublicKey;
                rentPayer: PublicKey;
                status: DecodeEnum<
                    {
                        kind: "enum";
                        variants: [
                            { name: "active" },
                            { name: "paused" },
                            { name: "completed" },
                        ];
                    },
                    DecodedHelper<
                        [
                            {
                                name: "byteRangeCheck";
                                type: {
                                    fields: [
                                        { name: "offset"; type: "u8" },
                                        { name: "length"; type: "u8" },
                                        { name: "expected"; type: { array: [(...), (...)] } },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                docs: [
                                    "An event that is thrown when a composable policy is executed",
                                ];
                                name: "composableExecuted";
                                type: {
                                    fields: [
                                        { name: "composablePolicy"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "targetProgram"; type: "pubkey" },
                                        { name: "inputAmount"; type: "u64" },
                                        { name: "outputAmount"; type: "u64" },
                                        { name: "gatewayFee"; type: "u64" },
                                        { name: "protocolFee"; type: "u64" },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                name: "composablePolicy";
                                type: {
                                    fields: [
                                        { name: "bump"; type: "u8" },
                                        { name: "userPayment"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "status"; type: { defined: { name: ... } } },
                                        { name: "rentPayer"; type: "pubkey" },
                                        { name: "policyType"; type: { defined: { name: ... } } },
                                        { name: "forwardConfig"; type: { defined: { name: ... } } },
                                    ];
                                    kind: "struct";
                                };
                            },
                            {
                                docs: [
                                    "An event that is thrown when a composable policy is created",
                                ];
                                name: "composablePolicyCreated";
                                type: {
                                    fields: [
                                        { name: "composablePolicy"; type: "pubkey" },
                                        { name: "userPayment"; type: "pubkey" },
                                        { name: "gateway"; type: "pubkey" },
                                        { name: "recipient"; type: "pubkey" },
                                        { name: "policyId"; type: "u32" },
                                        { name: "policyType"; type: { defined: { name: ... } } },
                                        { name: "memo"; type: { array: [(...), (...)] } },
                                    ];
                                    kind: "struct";
                                };
                            },
                        ],
                        DecodedHelper<
                            [
                                {
                                    name: "byteRangeCheck";
                                    type: {
                                        fields: [
                                            { name: "offset"; type: "u8" },
                                            { name: "length"; type: "u8" },
                                            { name: "expected"; type: { array: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    docs: [
                                        "An event that is thrown when a composable policy is executed",
                                    ];
                                    name: "composableExecuted";
                                    type: {
                                        fields: [
                                            { name: "composablePolicy"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "targetProgram"; type: "pubkey" },
                                            { name: "inputAmount"; type: "u64" },
                                            { name: "outputAmount"; type: "u64" },
                                            { name: "gatewayFee"; type: "u64" },
                                            { name: "protocolFee"; type: "u64" },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    name: "composablePolicy";
                                    type: {
                                        fields: [
                                            { name: "bump"; type: "u8" },
                                            { name: "userPayment"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "status"; type: { defined: ... } },
                                            { name: "rentPayer"; type: "pubkey" },
                                            { name: "policyType"; type: { defined: ... } },
                                            { name: "forwardConfig"; type: { defined: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                                {
                                    docs: [
                                        "An event that is thrown when a composable policy is created",
                                    ];
                                    name: "composablePolicyCreated";
                                    type: {
                                        fields: [
                                            { name: "composablePolicy"; type: "pubkey" },
                                            { name: "userPayment"; type: "pubkey" },
                                            { name: "gateway"; type: "pubkey" },
                                            { name: "recipient"; type: "pubkey" },
                                            { name: "policyId"; type: "u32" },
                                            { name: "policyType"; type: { defined: ... } },
                                            { name: "memo"; type: { array: ... } },
                                        ];
                                        kind: "struct";
                                    };
                                },
                            ],
                            DecodedHelper<
                                [
                                    {
                                        name: "byteRangeCheck";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        docs: [
                                            "An event that is thrown when a composable policy is executed",
                                        ];
                                        name: "composableExecuted";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        name: "composablePolicy";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                    {
                                        docs: [
                                            "An event that is thrown when a composable policy is created",
                                        ];
                                        name: "composablePolicyCreated";
                                        type: {
                                            fields: [
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                                { name: ...; type: ... },
                                            ];
                                            kind: "struct";
                                        };
                                    },
                                ],
                                EmptyDefined,
                            >,
                        >,
                    >,
                >;
                totalInput: BN;
                totalOutput: BN;
                updatedAt: BN;
                userPayment: PublicKey;
            };
            programId: PublicKey;
        }

      Returns Promise<{ instructionData: Buffer; remainingAccounts: AccountMeta[] }>