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

    Interface ForwardBuilder

    Builds the forward-program instruction for a composable execution.

    The builder receives face (the amount the forward consumes; the caller resolves it via resolveDefaultForwardAmount or a manual override) and returns the instruction data + the forward-program account list with per-account writability.

    Concrete implementations (e.g. MeteoraDlmmForward) live in @tributary-so/forward-builders, keeping the SDK's dependency surface free of forward-program crates.

    interface ForwardBuilder {
        build(
            ctx: {
                composablePolicyPda: PublicKey;
                connection: Connection;
                face: BN;
                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;
                };
            },
        ): Promise<ForwardBuildResult>;
    }
    Index

    Methods

    Methods

    • Parameters

      • ctx: {
            composablePolicyPda: PublicKey;
            connection: Connection;
            face: BN;
            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;
            };
        }

      Returns Promise<ForwardBuildResult>