Hierarchy

  • BaseStreamClient
    • SolanaStreamClient

Constructors

Properties

alignedProxyProgram: Program<StreamflowAlignedUnlocks>

Methods

  • Builds transaction instructions for creating multiple stream/vesting contracts without creating transactions. All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).

    Parameters

    • data: ICreateMultipleStreamData

      Stream base parameters and array of recipients with individual amounts and settings

    • extParams: Omit<ICreateStreamSolanaExt, "sender"> & { senderPublicKey: PublicKey }

      Transaction configuration including sender public key, native token handling, and custom instructions

    Returns Promise<
        {
            instructionsBatch: {
                ixs: TransactionInstruction[];
                metadata: Keypair;
                recipient: string;
            }[];
            metadatas: string[];
            metadataToRecipient: MetadataRecipientHashMap;
            prepareInstructions: TransactionInstruction[];
        },
    >

    Create multiple transaction instructions

  • Builds multiple transactions for creating stream/vesting contracts without signing or executing them. All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).

    IMPORTANT: When using native SOL (isNative: true), you MUST execute the prepareTx FIRST and wait for confirmation before executing the stream creation transactions. Otherwise, stream creation will fail with "InvalidAccountData".

    Parameters

    • data: ICreateMultipleStreamData

      Stream base parameters and array of recipients with individual amounts and settings

    • extParams: Omit<ICreateStreamSolanaExt, "sender"> & { senderPublicKey: PublicKey }

      Transaction configuration including sender public key, native token handling, and custom instructions

    Returns Promise<
        {
            context: any;
            hash: Readonly<{ blockhash: string; lastValidBlockHeight: number }>;
            metadatas: string[];
            metadataToRecipient: MetadataRecipientHashMap;
            prepareTx?: VersionedTransaction;
            transactions: BatchItem[];
        },
    >

    Multiple transaction information

    const result = await streamClient.buildCreateMultipleTransactions(data, { isNative: true, senderPublicKey });

    // CRITICAL: Execute prepareTx first if it exists
    if (result.prepareTx) {
    await connection.sendAndConfirmTransaction(result.prepareTx, [signer]);
    }

    // Only then execute stream creation transactions
    for (const item of result.transactions) {
    await connection.sendAndConfirmTransaction(item.tx, [signer]);
    }
  • Builds a transaction for creating a new stream/vesting contract without signing or executing it. All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).

    For native SOL (isNative: true), SOL wrapping instructions are automatically included in the correct order (before stream creation) to ensure the WSOL account exists when the stream creation instruction executes.

    Parameters

    • data: ICreateStreamData

      Stream parameters including recipient, token, amount, schedule, and permissions

    • extParams: Omit<ICreateStreamSolanaExt, "sender"> & { senderPublicKey: PublicKey }

      Transaction configuration including sender public key, native token handling, and custom instructions

    Returns Promise<
        {
            context: any;
            hash: string;
            metadata?: Keypair;
            metadataId: string;
            tx: VersionedTransaction;
        },
    >

    Transaction and metadata information

  • Builds transaction instructions for creating a new stream/vesting contract without creating a transaction. All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).

    For native SOL (isNative: true), SOL wrapping instructions are automatically included in the correct order (before stream creation) to ensure the WSOL account exists when the stream creation instruction executes.

    Parameters

    • data: ICreateStreamData

      Stream parameters including recipient, token, amount, schedule, and permissions

    • extParams: Omit<ICreateStreamSolanaExt, "sender"> & { senderPublicKey: PublicKey }

      Transaction configuration including sender public key, native token handling, and custom instructions

    Returns Promise<
        {
            ixs: TransactionInstruction[];
            metadata?: Keypair;
            metadataId: string;
        },
    >

    Transaction instructions and metadata ID

  • Creates a new stream/vesting contract using unchecked instruction.

    Unchecked instruction differs from the regular in:

    • does not check for initialized associated token account (wallets with no control over their ATA should not be used as sender/recipient/partner or there are risks of funds being locked in the contract)
    • initialized contract PDA off chain

    If you are not sure if you should use create or create_unchecked, go for create to be safer.

    Parameters

    • data: ICreateStreamData

      Stream parameters including recipient, token, amount, schedule, and permissions

    • extParams: ICreateStreamSolanaExt

      Transaction configuration including sender wallet, metadata keys, and compute settings

    Returns Promise<ICreateResult>

    Create result

  • Extracts error code from an error

    Parameters

    • err: Error

      Error

    Returns string

    Error code

  • Fetch streams/contracts by providing direction. Streams are sorted by start time in ascending order.

    Parameters

    • getData: IGetAllData

      Query parameters including address, stream type filter, and direction filter

    Returns Promise<[string, Stream][]>

    Record of stream data

  • Gets default streamflow fee

    Returns Promise<number>

    Default streamflow fee

  • Returns total fee percent, streamflow fees + partner fees

    Parameters

    • getFeesData: IGetFeesData

      structure with address for which we need to derive fee, either sender or partner usually

    • OptionalchainSpecificParams: any

      additional parameters required by chain client

    Returns Promise<number>

    fee as floating number, so if fee is 0.99%, it will return 0.99

  • Create Transaction instructions for createUnchecked

    Parameters

    Returns Promise<
        {
            ixs: TransactionInstruction[];
            metadata: Keypair;
            metadataPubKey: PublicKey;
        },
    >

  • Attempts changing the stream/vesting contract's recipient (effectively transferring the stream/vesting contract). Potential associated token account rent fee (to make it rent-exempt) is paid by the transaction initiator.

    Parameters

    • transferData: ITransferData

      Transfer parameters including stream ID and new recipient address

    • extParams: IInteractStreamSolanaExt

      Transaction configuration including invoker wallet and compute settings

    Returns Promise<TransactionInstruction[]>

    Transaction instructions