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

    Class Tributary

    Main SDK class for interacting with the Tributary recurring payments protocol on Solana. Provides methods to create payment gateways, user accounts, payment policies, and execute payments.

    const connection = new Connection("https://api.mainnet-beta.solana.com");
    const wallet = new Wallet(Keypair.generate());
    const sdk = new Tributary(connection, wallet);

    // Initialize the protocol (admin only)
    const initIx = await sdk.initialize(adminPublicKey);
    Index

    Constructors

    Properties

    Methods

    buildReferralRemainingAccounts calculateComposableApproval changeComposablePolicyStatus changeGatewayFeeBps changeGatewayFeeRecipient changeGatewaySigner changePaymentPolicyStatus changeProgramAuthority confirmTransactionWithStatus createComposable createComposableWithMetadata createMilestone createOneTimePayment createPayAsYouGo createPayAsYouGoWithMetadata createPaymentGateway createReferralAccount createSubscription createSubscriptionWithMetadata createUpToAuthorization createUserPayment deleteComposablePolicy deletePaymentGateway deletePaymentPolicy deleteUserPayment disableGatewayFeature enableGatewayFeature executeComposable executePayment getAllComposablePolicies getAllPaymentGateway getAllPaymentPolicies getAllUserPayments getAllUserPaymentsByOwner getComposablePolicies getComposablePoliciesByGateway getComposablePoliciesByUserPayment getComposablePolicy getComposablePolicyPda getConfigPda getCreateComposablePolicyInstruction getCreateMilestonePolicyInstruction getCreateOneTimePolicyInstruction getCreatePayAsYouGoPolicyInstruction getCreateSubscriptionPolicyInstruction getCreateUpToPolicyInstruction getGatewayPda getPaymentGateway getPaymentGatewaysBySigner getPaymentPolicies getPaymentPoliciesByGateway getPaymentPoliciesByGatewayOwnerAndMint getPaymentPoliciesByRecipient getPaymentPoliciesByUser getPaymentPoliciesByUserPayment getPaymentPolicy getPaymentPolicyPda getPaymentsDelegatePda getProgramConfig getReferralAccount getReferralAccountAddressByOwner getReferralAccountByCode getReferralAccountByOwner getReferralChain getReferralPda getUserPayment getUserPaymentPda initialize migrateDelegate requiredDelegatedAmount setEmergencyPause settleUpTo transfer updateGatewayFeatureFlags updateGatewayProtocolFee updateGatewayReferralSettings updateGatewaySchedulerShare updateWallet validateReferralCode

    Constructors

    • Creates a new Tributary SDK instance.

      Parameters

      • connection: Connection

        Solana RPC connection to use for all operations

      • wallet: IWallet | Keypair

        Wallet containing the keypair for signing transactions

      Returns Tributary

    Properties

    connection: Connection

    Solana RPC connection

    program: Program<Tributary>

    Anchor program instance for the Recurring Payments contract

    programId: PublicKey

    Public key of the deployed program

    provider: AnchorProvider

    Anchor provider with wallet and connection

    Methods

    • Build the ordered remaining_accounts list for executePayment / transfer referral reward distribution.

      Returns null if the user has no ReferralAccount at all (caller should invoke the instruction without any remaining accounts). Otherwise returns a non-empty array whose first entry is the payer's own ReferralAccount (read-only), followed by the writable ancestor chain and their matching ATAs.

      Layout (matches parse_and_validate_referral_accounts on-chain):

        [payer_referral,
      L1, L2, L3,
      ATA_L1, ATA_L2, ATA_L3]

      Parameters

      • user: PublicKey
      • gateway: PublicKey
      • tokenMint: PublicKey

      Returns Promise<{ isSigner: boolean; isWritable: boolean; pubkey: PublicKey }[] | null>

    • Composable gross approval sizing — wraps the face-only calculatePolicyApprovalAmount in requiredDelegatedAmount so the delegate covers fees across the policy's whole life (ADR-0026: composable is NET-on-pull, every execution pulls face + fee, and the SPL delegated_amount is a total cap decremented per pull).

      Cap policy for unbounded variants (subscription with maxRenewals: null, PayAsYouGo): deliberately matches the payment-policy helpers — 1 year. One mental model across both policy families; the approval is re-issued on every create/approve and trivially topped up, so 1yr parity is sufficient. 2yr was considered and rejected as YAGNI; if composables in practice need longer, callers pass an explicit approvalAmount (or the helper's year-multiplier changes in one place).

      Parameters

      • policyType: DecodeEnum

        The policy configuration (any of the 5 variants)

      • gateway:
            | {
                authority: PublicKey;
                bump: number;
                createdAt: BN;
                customProtocolShareBps: number;
                featureFlags: number;
                feeRecipient: PublicKey;
                gatewayFeeBps: number;
                isActive: boolean;
                name: number[];
                padding: number[];
                padding1: BN;
                referralAllocationBps: number;
                referralTiersBps: number[];
                schedulerShareBps: number;
                signer: PublicKey;
                url: number[];
            }
            | null

        The gateway account (carries gatewayFeeBps), or null if not fetched/unknown — degrades to face-only (0 bps).

      Returns BN

      Gross approval amount (face_total + total_fee), face-only when the gateway is unknown.

    • Changes the status of a composable policy (active, paused, or completed). Only the policy owner can change the status.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • policyId: number

        ID of the composable policy to modify

      • newStatus: DecodeEnum

        New status for the policy

      Returns Promise<TransactionInstruction>

      Transaction instruction to change the composable policy status

    • Changes the gateway fee in basis points for a payment gateway. Only the gateway authority can change the fee.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      • newFeeBps: number

        New gateway fee in basis points (0-10000)

      Returns Promise<TransactionInstruction>

      Transaction instruction to change the gateway fee bps

    • Changes the fee recipient for a payment gateway. Only the gateway authority can change the fee recipient.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      • newFeeRecipient: PublicKey

        Public key of the new fee recipient

      Returns Promise<TransactionInstruction>

      Transaction instruction to change the gateway fee recipient

    • Changes the signer authorized to execute payments for a gateway. Only the gateway authority can change the signer.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the current gateway authority

      • newSigner: PublicKey

        Public key of the new signer

      Returns Promise<TransactionInstruction>

      Transaction instruction to change the gateway signer

    • Changes the status of a payment policy. Only Active <-> Paused is allowed for owner-initiated transitions; completed is a program-internal terminal state (subscription max_renewals reached, or all milestones released) and is rejected on-chain with InvalidPolicyStatusTransition. Only the policy owner can change the status.

      The param type accepts the full PolicyStatus (including completed) for parity with changeComposablePolicyStatus; callers passing { active: {} } / { paused: {} } are unaffected.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • policyId: number

        ID of the policy to modify

      • newStatus: DecodeEnum

        New status for the policy (completed rejected on-chain)

      Returns Promise<TransactionInstruction>

      Transaction instruction to change the policy status

    • Rotates the protocol admin (ADR-0028). The current admin must sign. fee_recipient is left untouched; the new admin can rotate it via the existing admin-gated paths afterwards.

      Parameters

      • newAdmin: PublicKey

        Public key of the new protocol admin

      Returns Promise<TransactionInstruction>

      Transaction instruction to change the program authority

    • Parameters

      • signature: string
      • commitment: "processed" | "confirmed" | "finalized" = "confirmed"
      • interval: number = 150
      • timeout: number = 60000

      Returns Promise<SignatureStatus>

    • Creates a composable payment policy with full setup: owner input-mint ATA ensure, UserPayment ensure, the policy instruction, and delegate approve wiring. Mirrors createSubscription() for the composable family, with two carve-outs — composable has no referrals, and execute cannot be auto-called at create time (it needs caller-supplied forward instructionData + remainingAccounts).

      Use getCreateComposablePolicyInstruction() for just the policy ix.

      Parameters

      • tokenMint: PublicKey

        Public key of the input token

      • recipient: PublicKey

        Public key receiving the payment

      • gateway: PublicKey

        Public key of the payment gateway

      • policyType: DecodeEnum

        Policy configuration (subscription/milestone/payAsYouGo/oneTime/upTo)

      • memo: string

        Memo string (max 32 bytes)

      • 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;
        }

        Token forwarding configuration (output_mint sentinel = act mode)

      • preValidation: DecodeEnum = ...

        Pre-validation spec (disabled by default)

      • prePinnedAccounts: PublicKey[] = []

        Owner-pinned Lighthouse targets for pre-validation

      • preValidationData: Buffer = ...

        Pre-validation assertion data

      • postValidation: DecodeEnum = ...

        Post-validation spec (disabled by default)

      • postPinnedAccounts: PublicKey[] = []

        Owner-pinned Lighthouse targets for post-validation

      • postValidationData: Buffer = ...

        Post-validation assertion data

      • OptionalfeePayer: PublicKey

        Optional fee payer (defaults to provider wallet)

      • OptionalapprovalAmount: BN

        Optional explicit approval (defaults to face-only sizing)

      Returns Promise<TransactionInstruction[]>

      Ordered transaction instructions: [ownerATA?, userPayment?, policy, approve?]

    • Parameters

      • tokenMint: PublicKey
      • recipient: PublicKey
      • gateway: PublicKey
      • policyType: DecodeEnum
      • memo: string
      • 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;
        }
      • preValidation: DecodeEnum = ...
      • prePinnedAccounts: PublicKey[] = []
      • preValidationData: Buffer = ...
      • postValidation: DecodeEnum = ...
      • postPinnedAccounts: PublicKey[] = []
      • postValidationData: Buffer = ...
      • OptionalfeePayer: PublicKey
      • OptionalapprovalAmount: BN

      Returns Promise<SetupResult>

    • Creates a milestone payment policy with full setup including ATAs, user payment account, and token approvals. Use getCreateMilestonePolicyInstruction() for just the instruction without setup.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • recipient: PublicKey

        Public key of the payment recipient

      • gateway: PublicKey

        Public key of the payment gateway

      • milestoneAmounts: BN[]

        Array of amounts for each milestone (up to 4)

      • milestoneTimestamps: BN[]

        Array of timestamps when each milestone is due

      • releaseCondition: number

        Bitmap: bit0=check due date, bit1=gateway signer, bit2=owner signer, bit3=recipient signer. Bits 1-3 mutually exclusive.

      • memo: number[]

        Memo bytes for the payment policy

      • OptionalapprovalAmount: BN

        Optional specific approval amount (calculated automatically if not provided)

      • OptionalexecuteImmediately: boolean

        Whether to execute the first milestone immediately if due

      • OptionalreferralCode: string
      • OptionalfeePayer: PublicKey

      Returns Promise<TransactionInstruction[]>

      Array of transaction instructions for complete setup

    • Creates a complete one-time payment setup including ATAs, user payment account, policy, and token approvals. One-time policies fire exactly once then transition to Completed. See ADR-0019.

      Use getCreateOneTimePolicyInstruction() for just the instruction without setup.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • recipient: PublicKey

        Public key of the payment recipient

      • gateway: PublicKey

        Public key of the payment gateway

      • amount: BN

        Fixed amount to pay (in smallest token units), must be > 0

      • memo: number[]

        Memo bytes for the payment policy

      • OptionaldueDate: BN | null

        Earliest execution timestamp; null/omitted means immediate

      • OptionalexpiryDate: BN | null

        Hard deadline after which execution is rejected; null = never expires

      • OptionalapprovalAmount: BN

        Optional specific approval amount (defaults to amount)

      • OptionalreferralCode: string

        Optional 6-character referral code

      • OptionalfeePayer: PublicKey

        Optional explicit fee payer

      Returns Promise<TransactionInstruction[]>

      Array of transaction instructions for the complete setup

    • Creates a pay-as-you-go payment policy with full setup including ATAs, user payment account, and token approvals. Use getCreatePayAsYouGoPolicyInstruction() for just the instruction without setup.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • recipient: PublicKey

        Public key of the payment recipient

      • gateway: PublicKey

        Public key of the payment gateway

      • maxAmountPerPeriod: BN

        Maximum amount allowed per period

      • maxChunkAmount: BN

        Maximum amount that can be claimed in one go

      • periodLengthSeconds: BN

        Length of each period in seconds

      • memo: number[]

        Memo bytes for the payment policy

      • OptionalapprovalAmount: BN

        Optional specific approval amount (calculated automatically if not provided)

      • OptionalreferralCode: string

        Optional referral code

      • OptionalexpiryDate: BN | null

        Optional hard deadline (unix seconds); null/omitted = never expires (ADR-0024)

      • OptionalfeePayer: PublicKey

      Returns Promise<TransactionInstruction[]>

      Array of transaction instructions for complete setup

    • Parameters

      • tokenMint: PublicKey
      • recipient: PublicKey
      • gateway: PublicKey
      • maxAmountPerPeriod: BN
      • maxChunkAmount: BN
      • periodLengthSeconds: BN
      • memo: number[]
      • OptionalapprovalAmount: BN
      • OptionalreferralCode: string
      • OptionalexpiryDate: BN | null
      • OptionalfeePayer: PublicKey

      Returns Promise<SetupResult>

    • Creates a new payment gateway for processing recurring payments. Gateways can charge fees and execute payments on behalf of users.

      Parameters

      • authority: PublicKey

        Public key that controls the gateway

      • gatewayFeeBps: number

        Total fee in basis points (100 bps = 1%) charged by the gateway, decomposed into protocol/scheduler/referral/residual shares (ADR-0017).

      • schedulerShareBps: number

        Share of the gateway fee routed to the scheduler (execute-tx signer). Constraint: protocol_share + scheduler_share + referral_allocation ≤ 10000 bps.

      • gatewayFeeRecipient: PublicKey

        Public key that receives gateway fees

      • name: string

        Display name for the gateway (max 32 characters)

      • url: string

        Website URL for the gateway (max 64 characters)

      • initialFeatureFlags: number = 0

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the payment gateway

    • Creates a referral account for the current user within a specific gateway. The referral account stores the user's referral code and tracks their referrer (who referred them).

      Parameters

      • gateway: PublicKey

        Public key of the gateway this referral account belongs to

      • referralCode: string

        6-character alphanumeric referral code for this user

      • Optionalreferrer: PublicKey

        Optional public key of the user who referred this user (L1 referrer)

      • OptionalfeePayer: PublicKey

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the referral account

    • Creates a complete subscription setup including ATAs, user payment account, policy, and token approvals. This is the high-level method for creating subscriptions that handles all the setup automatically.

      Parameters

      • tokenMint: PublicKey

        Public key of the token to be paid

      • recipient: PublicKey

        Public key that receives the payments

      • gateway: PublicKey

        Public key of the gateway that will execute payments

      • amount: BN

        Amount to pay per interval (in smallest token units)

      • autoRenew: boolean

        Whether the subscription should auto-renew

      • maxRenewals: number | null

        Maximum number of renewals allowed (null for unlimited)

      • paymentFrequency: DecodeEnum

        How often payments should occur

      • memo: number[]

        Memo bytes to include with payments (max 64 bytes)

      • OptionalstartTime: BN | null

        When the first payment should occur (defaults to now)

      • OptionalapprovalAmount: BN

        Amount to approve for token delegation (calculated automatically if not provided)

      • OptionalexecuteImmediately: boolean

        Whether to execute the first payment immediately

      • OptionalreferralCode: string

        Optional 6-character referral code to associate with this subscription

      • OptionalfeePayer: PublicKey

      Returns Promise<TransactionInstruction[]>

      Array of transaction instructions for the complete subscription setup

    • Parameters

      • tokenMint: PublicKey
      • recipient: PublicKey
      • gateway: PublicKey
      • amount: BN
      • autoRenew: boolean
      • maxRenewals: number | null
      • paymentFrequency: DecodeEnum
      • memo: number[]
      • OptionalstartTime: BN | null
      • OptionalapprovalAmount: BN
      • OptionalexecuteImmediately: boolean
      • OptionalreferralCode: string
      • OptionalfeePayer: PublicKey

      Returns Promise<SetupResult>

    • Creates a complete upto authorization setup including ATAs, user payment account, policy, and token approvals. The authorization lets the resource server / facilitator settle up to maxAmount once, within [validAfter, deadline]. See ADR-0020.

      Use getCreateUpToPolicyInstruction() for just the instruction without setup.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • recipient: PublicKey

        Public key of the payment recipient

      • gateway: PublicKey

        Public key of the payment gateway

      • maxAmount: BN

        Ceiling on the settlement amount (smallest token units)

      • deadline: BN

        Hard expiry timestamp; MUST be > 0

      • memo: number[]

        Memo bytes for the payment policy

      • OptionalvalidAfter: BN | null

        Earliest settlement timestamp; omitted/null means immediate

      • OptionalapprovalAmount: BN

        Optional specific approval amount (defaults to maxAmount)

      • OptionalreferralCode: string

        Optional 6-character referral code

      • OptionalfeePayer: PublicKey

        Optional explicit fee payer

      Returns Promise<TransactionInstruction[]>

      Array of transaction instructions for the complete setup

    • Creates a user payment account for tracking payments in a specific token. Each user needs one account per token mint they want to use for payments.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint for payments

      • OptionalfeePayer: PublicKey

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the user payment account

    • Deletes a composable policy permanently. Only the policy owner can delete their composable policies.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • policyId: number

        ID of the composable policy to delete

      Returns Promise<TransactionInstruction>

      Transaction instruction to delete the composable policy

    • Deletes a payment gateway. Only the protocol admin can delete gateways.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      Returns Promise<TransactionInstruction>

      Transaction instruction to delete the payment gateway

    • Deletes a payment policy permanently. Only the policy owner can delete their policies.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • policyId: number

        ID of the policy to delete

      Returns Promise<TransactionInstruction>

      Transaction instruction to delete the payment policy

    • Deletes a user payment account, closing it and refunding rent to the owner. Only the owner can delete their own user payment account, and only when it has no active policies or composables. Blocked while the program is paused.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      Returns Promise<TransactionInstruction>

      Transaction instruction to delete the user payment account

    • Disables a specific feature flag on a gateway.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      • flag: number

        One of GATEWAY_FEATURES values

      Returns Promise<TransactionInstruction>

      Transaction instruction

    • Enables a specific feature flag on a gateway.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      • flag: number

        One of GATEWAY_FEATURES values

      Returns Promise<TransactionInstruction>

      Transaction instruction

    • Builds the full instruction bundle to execute a composable payment, prepending create-ATA ensures for the recipient and the two fee recipients (all input-side per ADR-0026). Mirrors executePayment().

      The two intermediate ATAs are owned + created on-chain by the program (create_ata guards on zero lamports) — they are NEVER ensured here.

      Parameters

      • composablePolicy: PublicKey

        Public key of the composable policy account

      • instructionData: Buffer

        Buffer containing the forward instruction data

      • OptionalforwardAmount: BN | null

        Optional amount to forward (null if no forward)

      • OptionalremainingAccounts: AccountMeta[]

        Additional accounts for validation/forward

      Returns Promise<TransactionInstruction[]>

      Ordered instructions: [recipientATA?, gatewayFeeATA?, protocolFeeATA?, execute]

    • Executes a payment for a given payment policy. This method handles the complete payment execution flow including fee calculations and token transfers.

      Parameters

      • paymentPolicyPda: PublicKey

        Public key of the payment policy account

      • OptionalpaymentAmount: BN

        Amount to pay (optional for subscription/milestone, required for pay-as-you-go)

      • Optionalrecipient: PublicKey

        Public key of the payment recipient (optional if in policy)

      • OptionaltokenMint: PublicKey

        Public key of the token mint (optional if in policy)

      • Optionalgateway: PublicKey

        Public key of the payment gateway (optional if in policy)

      • Optionaluser: PublicKey

        Public key of the payment user (optional if in policy)

      Returns Promise<TransactionInstruction[]>

      Array of transaction instructions including ATA creation and payment execution

    • Retrieves all composable policies.

      Returns Promise<
          {
              account: {
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  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: ...; 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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  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: ...; 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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalInput: BN;
                  totalOutput: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of all composable policies

    • Retrieves all payment gateways in the protocol.

      Returns Promise<
          {
              account: {
                  authority: PublicKey;
                  bump: number;
                  createdAt: BN;
                  customProtocolShareBps: number;
                  featureFlags: number;
                  feeRecipient: PublicKey;
                  gatewayFeeBps: number;
                  isActive: boolean;
                  name: number[];
                  padding: number[];
                  padding1: BN;
                  referralAllocationBps: number;
                  referralTiersBps: number[];
                  schedulerShareBps: number;
                  signer: PublicKey;
                  url: number[];
              };
              publicKey: PublicKey;
          }[],
      >

      Array of payment gateway accounts with their public keys

    • Retrieves all payment policies in the protocol.

      Returns Promise<
          {
              account: {
                  bump: number;
                  createdAt: BN;
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalPaid: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of payment policy accounts with their public keys

    • Retrieves all user payment accounts in the protocol.

      Returns Promise<
          {
              account: {
                  activeComposableCount: number;
                  activePoliciesCount: number;
                  bump: number;
                  createdAt: BN;
                  createdComposableCount: number;
                  createdPoliciesCount: number;
                  isActive: boolean;
                  owner: PublicKey;
                  padding: number[];
                  rentPayer: PublicKey;
                  tokenAccount: PublicKey;
                  tokenMint: PublicKey;
                  updatedAt: BN;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of user payment accounts with their public keys

    • Retrieves all user payment accounts owned by a specific user.

      Parameters

      • owner: PublicKey

        Public key of the user

      Returns Promise<
          {
              account: {
                  activeComposableCount: number;
                  activePoliciesCount: number;
                  bump: number;
                  createdAt: BN;
                  createdComposableCount: number;
                  createdPoliciesCount: number;
                  isActive: boolean;
                  owner: PublicKey;
                  padding: number[];
                  rentPayer: PublicKey;
                  tokenAccount: PublicKey;
                  tokenMint: PublicKey;
                  updatedAt: BN;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of user payment accounts owned by the specified user

    • Retrieve ComposablePolicy accounts with a combined memcmp filter set.

      Parameters

      • Optionalfilters: {
            gateway?: PublicKey;
            recipient?: PublicKey;
            trackingId?: string;
            userPayment?: PublicKey;
        }

        userPayment, gateway, recipient, trackingId

      Returns Promise<
          {
              account: {
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  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: ...; 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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  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: ...; 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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalInput: BN;
                  totalOutput: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

    • Retrieves all composable policies executed by the specified gateway.

      Parameters

      • gateway: PublicKey

        Public key of the payment gateway

      Returns Promise<
          {
              account: {
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  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: ...; 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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  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: ...; 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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalInput: BN;
                  totalOutput: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of composable policies executed by the gateway

    • Retrieves all composable policies belonging to the specified user payment account.

      Parameters

      • userPayment: PublicKey

        Public key of the user payment PDA

      Returns Promise<
          {
              account: {
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  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: ...; 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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  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: ...; 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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalInput: BN;
                  totalOutput: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of composable policies for the user payment account

    • Fetches a specific composable policy account by its address.

      Parameters

      • policyAddress: PublicKey

        Public key of the composable policy account

      Returns Promise<
          | {
              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: ... } } },
                                  { name: "nextPaymentDue"; type: "i64" },
                                  { name: "padding"; type: { array: [(...), (...)] } },
                              ];
                              name: "subscription";
                          },
                          {
                              fields: [
                                  { name: "milestoneAmounts"; type: { array: [(...), (...)] } },
                                  { name: "milestoneTimestamps"; type: { array: [(...), (...)] } },
                                  { name: "currentMilestone"; type: "u8" },
                                  { name: "releaseCondition"; type: "u8" },
                                  { name: "totalMilestones"; type: "u8" },
                                  { name: "escrowAmount"; type: "u64" },
                                  { name: "padding"; type: { array: [(...), (...)] } },
                              ];
                              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: [(...), (...)] } },
                              ];
                              name: "payAsYouGo";
                          },
                          {
                              fields: [
                                  { name: "amount"; type: "u64" },
                                  { name: "dueDate"; type: "i64" },
                                  { name: "expiryDate"; type: { option: "i64" } },
                                  { name: "padding"; type: { array: [(...), (...)] } },
                              ];
                              name: "oneTime";
                          },
                          {
                              fields: [
                                  { name: "maxAmount"; type: "u64" },
                                  { name: "validAfter"; type: "i64" },
                                  { name: "deadline"; type: "i64" },
                                  { name: "padding"; type: { array: [(...), (...)] } },
                              ];
                              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: "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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          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: "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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          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: "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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          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: "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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              EmptyDefined,
                          >,
                      >,
                  >,
              >;
              totalInput: BN;
              totalOutput: BN;
              updatedAt: BN;
              userPayment: PublicKey;
          }
          | null,
      >

      The composable policy account data or null if not found

    • Gets a Composable Policy PDA for the specified user payment and policy ID.

      Parameters

      • userPayment: PublicKey

        Public key of the user's payment PDA

      • policyId: number

        Unique identifier for the composable policy

      Returns PdaResult

      PdaResult containing the PDA address and bump

    • Gets a transaction instruction to create a composable payment policy. Composable policies allow execution of arbitrary instructions alongside optional token forwards, enabling use cases like automated DCA, liquidation protection, and cross-protocol interactions.

      The validation target accounts are owner-pinned at creation (ADR-0016, closes validation-gaming vector d): pinnedAccounts is stored in the on-chain ValidationPda and replay-validated at execute — a relayer cannot substitute a positional slot to trip the assertion against the wrong state. Pass exactly the Lighthouse builder's .accounts pubkeys here (arity derived from the array length; max 2).

      Parameters

      • tokenMint: PublicKey

        Public key of the token to be paid

      • recipient: PublicKey

        Public key that receives the payments

      • gateway: PublicKey

        Public key of the gateway that will execute payments

      • policyType: DecodeEnum

        Policy configuration defining execution timing

      • memo: string

        Memo string to include with the policy (max 32 bytes)

      • 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;
        }

        Token forwarding configuration. In act mode (ADR-0026) set outputMint to PublicKey.default (sentinel) and the program treats the forward as consuming input without producing a fungible output token (e.g. Velocity subaccount deposit). In deliver modes, outputMint is a real SPL Mint (== inputMint for deliver-no-transform, distinct for deliver-transform).

      • preValidation: DecodeEnum = ...
      • prePinnedAccounts: PublicKey[] = []
      • preValidationData: Buffer = ...
      • postValidation: DecodeEnum = ...
      • postPinnedAccounts: PublicKey[] = []
      • postValidationData: Buffer = ...
      • OptionalfeePayer: PublicKey

        Optional fee payer (defaults to provider wallet)

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the composable policy

    • Gets a transaction instruction to create a milestone payment policy. This is a low-level method that returns only the instruction. Use createMilestonePayment() for the full setup including ATAs and approvals.

      Parameters

      • tokenMint: PublicKey

        Public key of the token to be paid

      • recipient: PublicKey

        Public key that receives the payments

      • gateway: PublicKey

        Public key of the gateway that will execute payments

      • milestoneAmounts: BN[]

        Array of amounts for each milestone (up to 4)

      • milestoneTimestamps: BN[]

        Array of timestamps when each milestone is due

      • releaseCondition: number

        Bitmap: bit0=check due date, bit1=gateway signer, bit2=owner signer, bit3=recipient signer. Bits 1-3 mutually exclusive.

      • memo: number[]

        Memo bytes to include with payments (max 64 bytes)

      • OptionalfeePayer: PublicKey

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the milestone payment policy

    • Gets a transaction instruction to create a one-time payment policy. This is a low-level method that returns only the instruction. Use createOneTimePayment() for the full setup including ATAs and approvals.

      One-time policies fire exactly once, then transition to Completed. They flow through the full gateway machinery (fees, referrals, composable hooks) — see ADR-0019.

      Parameters

      • tokenMint: PublicKey

        Public key of the token to be paid

      • recipient: PublicKey

        Public key that receives the payment

      • gateway: PublicKey

        Public key of the gateway that will execute the payment

      • amount: BN

        Fixed amount to pay (in smallest token units), must be > 0

      • dueDate: BN | null

        Earliest execution timestamp; null/<= 0 means immediate

      • expiryDate: BN | null

        Hard deadline after which execution is rejected; null = never expires

      • memo: number[]

        Memo bytes to include with payments (max 64 bytes)

      • OptionalfeePayer: PublicKey

        Optional explicit fee payer (defaults to the provider wallet)

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the one-time payment policy

    • Gets a transaction instruction to create a pay-as-you-go payment policy. This is a low-level method that returns only the instruction. Use createPayAsYouGoPayment() for the full setup including ATAs and approvals.

      Parameters

      • tokenMint: PublicKey

        Public key of the token to be paid

      • recipient: PublicKey

        Public key that receives the payments

      • gateway: PublicKey

        Public key of the gateway that will execute payments

      • maxAmountPerPeriod: BN

        Maximum amount allowed per period

      • maxChunkAmount: BN

        Maximum amount that can be claimed in a single payment

      • periodLengthSeconds: BN

        Length of each period in seconds

      • memo: number[]

        Memo bytes to include with payments (max 64 bytes)

      • OptionalexpiryDate: BN | null

        Optional hard deadline (unix seconds); when current_time > expiryDate execution is rejected. null/omitted = never expires (ADR-0024).

      • OptionalfeePayer: PublicKey

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the pay-as-you-go payment policy

    • Gets a transaction instruction to create a subscription payment policy. This is a low-level method that returns only the instruction. Use createSubscription() for the full setup including ATAs and approvals.

      Parameters

      • tokenMint: PublicKey

        Public key of the token to be paid

      • recipient: PublicKey

        Public key that receives the payments

      • gateway: PublicKey

        Public key of the gateway that will execute payments

      • amount: BN

        Amount to pay per interval (in smallest token units)

      • autoRenew: boolean

        Whether the subscription should auto-renew

      • maxRenewals: number | null

        Maximum number of renewals allowed (null for unlimited)

      • paymentFrequency: DecodeEnum

        How often payments should occur

      • memo: number[]

        Memo bytes to include with payments (max 64 bytes)

      • OptionalstartTime: BN | null

        When the first payment should occur (defaults to now)

      • OptionalfeePayer: PublicKey

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the subscription payment policy

    • Gets a transaction instruction to create an upto authorization policy. Single-use, time-bound: the actual settled amount is caller-supplied at execute time, bounded by maxAmount. See ADR-0020.

      Use createUpToAuthorization() for the full setup including ATAs and approvals.

      Parameters

      • tokenMint: PublicKey

        Public key of the token to be paid

      • recipient: PublicKey

        Public key that receives the payment

      • gateway: PublicKey

        Public key of the gateway that will execute the payment

      • maxAmount: BN

        Ceiling on the settlement amount (smallest token units), must be > 0

      • validAfter: BN | null

        Earliest settlement timestamp; null/<= 0 means immediate

      • deadline: BN

        Hard expiry (strict < at execute time); MUST be > 0 and > validAfter

      • memo: number[]

        Memo bytes to include with payments (max 64 bytes)

      • OptionalfeePayer: PublicKey

        Optional explicit fee payer (defaults to the provider wallet)

      Returns Promise<TransactionInstruction>

      Transaction instruction to create the upto policy

    • Gets a Payment Gateway PDA for the specified authority.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      Returns PdaResult

      PdaResult containing the PDA address and bump

    • Fetches a specific payment gateway account by its address.

      Parameters

      • gatewayAddress: PublicKey

        Public key of the payment gateway account

      Returns Promise<
          | {
              authority: PublicKey;
              bump: number;
              createdAt: BN;
              customProtocolShareBps: number;
              featureFlags: number;
              feeRecipient: PublicKey;
              gatewayFeeBps: number;
              isActive: boolean;
              name: number[];
              padding: number[];
              padding1: BN;
              referralAllocationBps: number;
              referralTiersBps: number[];
              schedulerShareBps: number;
              signer: PublicKey;
              url: number[];
          }
          | null,
      >

      The payment gateway account data or null if not found

    • Retrieves all payment gateways where the specified key is the authorized signer. Unlike the authority (which is unique per gateway PDA), a single signer key can manage multiple gateways — this returns all of them.

      Parameters

      • signer: PublicKey

        Public key of the gateway signer

      Returns Promise<
          {
              account: {
                  authority: PublicKey;
                  bump: number;
                  createdAt: BN;
                  customProtocolShareBps: number;
                  featureFlags: number;
                  feeRecipient: PublicKey;
                  gatewayFeeBps: number;
                  isActive: boolean;
                  name: number[];
                  padding: number[];
                  padding1: BN;
                  referralAllocationBps: number;
                  referralTiersBps: number[];
                  schedulerShareBps: number;
                  signer: PublicKey;
                  url: number[];
              };
              publicKey: PublicKey;
          }[],
      >

      Array of payment gateway accounts with their public keys

    • Retrieve PaymentPolicy accounts with a combined memcmp filter set.

      Every field is optional; omitting all returns every PaymentPolicy (subject to RPC limits).

      Parameters

      • Optionalfilters: {
            gateway?: PublicKey;
            recipient?: PublicKey;
            trackingId?: string;
            userPayment?: PublicKey;
        }

        userPayment, gateway, recipient, trackingId

      Returns Promise<
          {
              account: {
                  bump: number;
                  createdAt: BN;
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalPaid: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

    • Retrieves all payment policies executed by the specified gateway.

      Parameters

      • gateway: PublicKey

        Public key of the payment gateway

      Returns Promise<
          {
              account: {
                  bump: number;
                  createdAt: BN;
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalPaid: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of payment policies executed by the gateway

    • Retrieves all payment policies belonging to the specified user payment account.

      Parameters

      • walletPublicKey: PublicKey
      • tokenMint: PublicKey
      • gateway: PublicKey

      Returns Promise<
          {
              account: {
                  bump: number;
                  createdAt: BN;
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalPaid: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of payment policies for the user payment account

    • Retrieves all payment policies where the specified user is the recipient.

      Parameters

      • user: PublicKey

        Public key of the payment recipient

      Returns Promise<
          {
              account: {
                  bump: number;
                  createdAt: BN;
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalPaid: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of payment policies where the user is the recipient

    • Retrieves all payment policies where the specified user is the payer.

      Parameters

      • user: PublicKey

        Public key of the payment user

      Returns Promise<
          {
              account: {
                  bump: number;
                  createdAt: BN;
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalPaid: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of payment policies where the user is the payer

      Use getPaymentPoliciesByUserPayment instead!

    • Retrieves all payment policies belonging to the specified user payment account.

      Parameters

      • userPayment: PublicKey

        Public key of the user payment PDA

      Returns Promise<
          {
              account: {
                  bump: number;
                  createdAt: BN;
                  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: ... } },
                                      { name: "paymentFrequency"; type: { defined: ... } },
                                      { name: "nextPaymentDue"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "subscription";
                              },
                              {
                                  fields: [
                                      { name: "milestoneAmounts"; type: { array: ... } },
                                      { name: "milestoneTimestamps"; type: { array: ... } },
                                      { name: "currentMilestone"; type: "u8" },
                                      { name: "releaseCondition"; type: "u8" },
                                      { name: "totalMilestones"; type: "u8" },
                                      { name: "escrowAmount"; type: "u64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  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: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "payAsYouGo";
                              },
                              {
                                  fields: [
                                      { name: "amount"; type: "u64" },
                                      { name: "dueDate"; type: "i64" },
                                      { name: "expiryDate"; type: { option: ... } },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "oneTime";
                              },
                              {
                                  fields: [
                                      { name: "maxAmount"; type: "u64" },
                                      { name: "validAfter"; type: "i64" },
                                      { name: "deadline"; type: "i64" },
                                      { name: "padding"; type: { array: ... } },
                                  ];
                                  name: "upTo";
                              },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  recipient: PublicKey;
                  rentPayer: PublicKey;
                  status: DecodeEnum<
                      {
                          kind: "enum";
                          variants: [
                              { name: "active" },
                              { name: "paused" },
                              { name: "completed" },
                          ];
                      },
                      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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              DecodedHelper<
                                  [
                                      { name: "byteRangeCheck"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composableExecuted";
                                          type: { fields: ...; kind: ... };
                                      },
                                      { name: "composablePolicy"; type: { fields: ...; kind: ... } },
                                      {
                                          docs: [(...)];
                                          name: "composablePolicyCreated";
                                          type: { fields: ...; kind: ... };
                                      },
                                  ],
                                  EmptyDefined,
                              >,
                          >,
                      >,
                  >;
                  totalPaid: BN;
                  updatedAt: BN;
                  userPayment: PublicKey;
              };
              publicKey: PublicKey;
          }[],
      >

      Array of payment policies for the user payment account

    • Fetches a specific payment policy account by its address.

      Parameters

      • policyAddress: PublicKey

        Public key of the payment policy account

      Returns Promise<
          | {
              bump: number;
              createdAt: BN;
              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: ... } } },
                                  { name: "nextPaymentDue"; type: "i64" },
                                  { name: "padding"; type: { array: [(...), (...)] } },
                              ];
                              name: "subscription";
                          },
                          {
                              fields: [
                                  { name: "milestoneAmounts"; type: { array: [(...), (...)] } },
                                  { name: "milestoneTimestamps"; type: { array: [(...), (...)] } },
                                  { name: "currentMilestone"; type: "u8" },
                                  { name: "releaseCondition"; type: "u8" },
                                  { name: "totalMilestones"; type: "u8" },
                                  { name: "escrowAmount"; type: "u64" },
                                  { name: "padding"; type: { array: [(...), (...)] } },
                              ];
                              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: [(...), (...)] } },
                              ];
                              name: "payAsYouGo";
                          },
                          {
                              fields: [
                                  { name: "amount"; type: "u64" },
                                  { name: "dueDate"; type: "i64" },
                                  { name: "expiryDate"; type: { option: "i64" } },
                                  { name: "padding"; type: { array: [(...), (...)] } },
                              ];
                              name: "oneTime";
                          },
                          {
                              fields: [
                                  { name: "maxAmount"; type: "u64" },
                                  { name: "validAfter"; type: "i64" },
                                  { name: "deadline"; type: "i64" },
                                  { name: "padding"; type: { array: [(...), (...)] } },
                              ];
                              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: "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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          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: "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";
                                  };
                              },
                          ],
                          DecodedHelper<
                              [
                                  {
                                      name: "byteRangeCheck";
                                      type: { fields: [(...), (...), (...)]; kind: "struct" };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is executed",
                                      ];
                                      name: "composableExecuted";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      name: "composablePolicy";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                                  {
                                      docs: [
                                          "An event that is thrown when a composable policy is created",
                                      ];
                                      name: "composablePolicyCreated";
                                      type: {
                                          fields: [(...), (...), (...), (...), (...), (...), (...)];
                                          kind: "struct";
                                      };
                                  },
                              ],
                              EmptyDefined,
                          >,
                      >,
                  >,
              >;
              totalPaid: BN;
              updatedAt: BN;
              userPayment: PublicKey;
          }
          | null,
      >

      The payment policy account data or null if not found

    • Gets a Payment Policy PDA for the specified user payment and policy ID.

      Parameters

      • userPayment: PublicKey

        Public key of the user's payment PDA

      • policyId: number

        Unique identifier for the policy within the user's account

      Returns PdaResult

      PdaResult containing the PDA address and bump

    • Gets the Payments Delegate PDA used for token delegation (legacy).

      Returns PdaResult

      PdaResult containing the PDA address and bump

      Use UserPayment PDA as delegate instead. This is kept for backward compatibility.

    • Fetches the program configuration account.

      Parameters

      • configAddress: PublicKey

        Public key of the program config account

      Returns Promise<
          | {
              admin: PublicKey;
              bump: number;
              deprecated: number;
              emergencyPause: boolean;
              feeRecipient: PublicKey;
              padding: number[];
              protocolShareBps: number;
          }
          | null,
      >

      The program configuration data or null if not found

    • Fetches a specific referral account by its address.

      Parameters

      • referralAccountAddress: PublicKey

        Public key of the referral account

      Returns Promise<
          | {
              bump: number;
              createdAt: BN;
              gateway: PublicKey;
              owner: PublicKey;
              padding: BN[];
              paddingBump: number[];
              paddingCode: number[];
              referralCode: number[];
              referrer: PublicKey;
              totalEarned: BN;
          }
          | null,
      >

      The referral account data or null if not found

    • Same as getReferralAccountByOwner but also returns the on-chain address of the ReferralAccount PDA. Required by C-02 remediation so the caller can pass the payer's ReferralAccount as the first entry in remaining_accounts for executePayment / transfer.

      Parameters

      • gateway: PublicKey
      • owner: PublicKey

      Returns Promise<
          | {
              account: {
                  bump: number;
                  createdAt: BN;
                  gateway: PublicKey;
                  owner: PublicKey;
                  padding: BN[];
                  paddingBump: number[];
                  paddingCode: number[];
                  referralCode: number[];
                  referrer: PublicKey;
                  totalEarned: BN;
              };
              publicKey: PublicKey;
          }
          | null,
      >

    • Fetches a referral account by gateway and referral code.

      Parameters

      • gateway: PublicKey

        Public key of the gateway

      • code: string

        6-character alphanumeric referral code

      Returns Promise<
          | {
              bump: number;
              createdAt: BN;
              gateway: PublicKey;
              owner: PublicKey;
              padding: BN[];
              paddingBump: number[];
              paddingCode: number[];
              referralCode: number[];
              referrer: PublicKey;
              totalEarned: BN;
          }
          | null,
      >

      The referral account data or null if not found

    • Fetches a specific referral account by the owner's public key and gateway. This is a convenience method that finds the referral account for an owner within a specific gateway.

      Parameters

      • gateway: PublicKey

        Public key of the gateway

      • owner: PublicKey

        Public key of the referral account owner

      Returns Promise<
          | {
              bump: number;
              createdAt: BN;
              gateway: PublicKey;
              owner: PublicKey;
              padding: BN[];
              paddingBump: number[];
              paddingCode: number[];
              referralCode: number[];
              referrer: PublicKey;
              totalEarned: BN;
          }
          | null,
      >

      The referral account data or null if not found

    • Builds the referral chain for a given user and gateway. This method traverses the referral chain up to 3 levels deep. We replace the default PublicKey by null here!

      C-02 remediation: the caller MUST also pass the payer's own ReferralAccount to executePayment / transfer as the FIRST entry in remaining_accounts. Use getReferralAccountAddressByOwner to obtain it, or use buildReferralRemainingAccounts which returns the full ordered list ready for remainingAccounts(...).

      Parameters

      • user: PublicKey

        Public key of the user to find the referral chain for

      • gateway: PublicKey

        Public key of the gateway

      Returns Promise<(PublicKey | null)[]>

      Array of referral account addresses [L1, L2, L3] (may contain nulls)

    • Gets a Referral Account PDA for the specified gateway and referral code.

      Parameters

      • gateway: PublicKey

        Public key of the gateway

      • referralCode: Buffer

        6-byte buffer of the referral code

      Returns PdaResult

      PdaResult containing the PDA address and bump

    • Fetches a specific user payment account by its address.

      Parameters

      • userPaymentAddress: PublicKey

        Public key of the user payment account

      Returns Promise<
          | {
              activeComposableCount: number;
              activePoliciesCount: number;
              bump: number;
              createdAt: BN;
              createdComposableCount: number;
              createdPoliciesCount: number;
              isActive: boolean;
              owner: PublicKey;
              padding: number[];
              rentPayer: PublicKey;
              tokenAccount: PublicKey;
              tokenMint: PublicKey;
              updatedAt: BN;
          }
          | null,
      >

      The user payment account data or null if not found

    • Gets a User Payment PDA for the specified user and token mint.

      Parameters

      • user: PublicKey

        Public key of the user

      • tokenMint: PublicKey

        Public key of the token mint

      Returns PdaResult

      PdaResult containing the PDA address and bump

    • Initializes the Tributary protocol by creating the program configuration account. This is a one-time setup that must be performed by the protocol admin.

      Parameters

      • authority: PublicKey
      • admin: PublicKey

        Public key of the protocol administrator

      Returns Promise<TransactionInstruction>

      Transaction instruction to initialize the protocol

    • Migrates token delegation from the legacy global payments_delegate PDA to the per-user UserPayment PDA. Approves the new one with the specified amount.

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • approvalAmount: BN

        Amount to approve for the new delegate

      Returns Promise<TransactionInstruction[]>

      Array of [approve] transaction instructions

    • Compute the gross amount a composable policy will pull from the user's token account for a given face amount and gateway (ADR-0026).

      Composable fees are NET-on-pull (hardcoded): the pull moves face + fee. The delegate approval on the user's token account must cover this gross amount, and the user's balance must be ≥ gross.

      Use this to size the approve instruction issued alongside createComposablePolicy / createUserPayment, and to re-check after a gateway fee-bps change (a hike can fail execution at the delegate).

      Parameters

      • face: BN

        The policy face amount (what the forward consumes / what the recipient is owed before fees). For PayAsYouGo this is the chunk.

      • gateway: {
            authority: PublicKey;
            bump: number;
            createdAt: BN;
            customProtocolShareBps: number;
            featureFlags: number;
            feeRecipient: PublicKey;
            gatewayFeeBps: number;
            isActive: boolean;
            name: number[];
            padding: number[];
            padding1: BN;
            referralAllocationBps: number;
            referralTiersBps: number[];
            schedulerShareBps: number;
            signer: PublicKey;
            url: number[];
        }

        The gateway account (carries gatewayFeeBps).

      • OptionalprotocolShareBps: number

        The global protocol share from ProgramConfig, unless the gateway has FEATURE_CUSTOM_PROTOCOL_FEE set.

      Returns BN

      The gross pull amount (face + total_fee).

    • Toggles the emergency pause kill-switch (AUDIT-2026-07-09 L-01). When paused, all execute_payment / execute_composable / transfer calls fail. Only the protocol admin can call this.

      Parameters

      • paused: boolean

        true to pause, false to resume

      Returns Promise<TransactionInstruction>

      Transaction instruction to set the emergency pause flag

    • Settle an upto authorization with the actual amount (determined by the resource server after usage). Thin wrapper over executePayment that pins the caller-supplied amount — on-chain enforces 0 <= actual <= max and the [validAfter, deadline) window. See ADR-0020.

      Parameters

      • paymentPolicyPda: PublicKey

        Public key of the upto payment policy

      • actualAmount: BN

        Actual settle amount (smallest token units); MAY be 0

      • Optionalrecipient: PublicKey

        Public key of the payment recipient (optional if in policy)

      • OptionaltokenMint: PublicKey

        Public key of the token mint (optional if in policy)

      • Optionalgateway: PublicKey

        Public key of the payment gateway (optional if in policy)

      • Optionaluser: PublicKey

        Public key of the payment user (optional if in policy)

      Returns Promise<TransactionInstruction[]>

      Array of transaction instructions including ATA creation and settlement

    • Executes a one-time token transfer with protocol and gateway fee distribution. The amount parameter is the GROSS amount - the total that leaves the user's wallet. Fees are deducted from this amount: recipient gets (amount - gateway_fee - protocol_fee).

      Parameters

      • tokenMint: PublicKey

        Public key of the token mint

      • recipient: PublicKey

        Public key of the payment recipient

      • gateway: PublicKey

        Public key of the payment gateway account (PDA)

      • amount: BN

        GROSS amount to transfer (total leaving user's wallet, fees included)

      • memo: string | number[]

        Memo string or 64-byte array to include with the payment

      • OptionalreferralCode: string

        Optional 6-character referral code for referral rewards

      Returns Promise<TransactionInstruction[]>

      Array of transaction instructions (ATA creation + transfer)

    • Sets the raw feature_flags byte on a gateway (authority-only). Bit 2 (CUSTOM_PROTOCOL_FEE) is protected and cannot be changed here — use updateGatewayCustomProtocolFee for that.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      • featureFlags: number

        Raw feature flags byte (only bits 0-1 are applied)

      Returns Promise<TransactionInstruction>

      Transaction instruction

    • Updates the custom protocol share settings for a payment gateway (ADR-0017). Only the protocol admin can modify these settings. This allows setting a gateway-specific protocol share that overrides the global default.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      • useCustomProtocolFee: boolean

        Whether to use custom protocol share (true) or global default (false)

      • customProtocolShareBps: number

        Custom protocol share in basis points (0-10000). Only used if useCustomProtocolFee is true.

      Returns Promise<TransactionInstruction>

      Transaction instruction to update gateway protocol share settings

    • Updates the referral settings for a payment gateway. Only the gateway authority can update these settings.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority

      • featureFlags: number

        Bit flags to enable/disable features (bit 0 = referral enabled)

      • referralAllocationBps: number

        Basis points of gateway fee allocated to referral rewards (0-2500)

      • referralTiersBps: [number, number, number]

        Array of 3 values [L1, L2, L3] summing to 10000 bps

      Returns Promise<TransactionInstruction>

      Transaction instruction to update gateway referral settings

    • Updates the scheduler share of the gateway fee (ADR-0017). Gateway-authority-only. The scheduler share pays the execute-tx signer; when the gateway signer self-executes it merges into fee_recipient. Constraint: protocol_share + scheduler_share + referral_allocation ≤ 10000 bps, validated on-chain against the current ProgramConfig.

      Parameters

      • gatewayAuthority: PublicKey

        Public key of the gateway authority (must sign)

      • schedulerShareBps: number

        Share of the gateway fee routed to the scheduler (0-10000)

      Returns Promise<TransactionInstruction>

      Transaction instruction to update gateway scheduler share

    • Updates the wallet used by the SDK instance. Useful for changing the signer without creating a new SDK instance.

      Parameters

      • wallet: IWallet | Keypair

        New wallet to use for signing transactions

      Returns Promise<void>

    • Validates a referral code format. Referral codes must be exactly 6 alphanumeric characters.

      Parameters

      • code: string

        The referral code to validate

      Returns boolean

      true if valid, false otherwise