Drips docs

Drips docs

    ›Splitting

    Intro and Basics

    • What's a Drip?
    • Drips v2 Features
    • Accessing Drips
    • FAQ

    The Drips App

    • Getting Started
    • Manage funds

      • Add funds
      • Withdraw funds
      • Collect earnings

      Streams

      • Create a stream
      • Edit, pause or delete a stream

      Splits

      • Set up & manage splits

      Explore the network

      • Drips profiles

      Advanced

      • Connecting to a Safe

    The Protocol

    • Overview
    • User Identities In Drips
    • Smart Contract and Subgraph Details
    • Security

    For Developers

    • The Drips JS SDK
    • Installing the SDK and Running the Example App
    • Initializing the SDK
    • Accounts

      • Intro to Accounts
      • Create an Account
      • List Sub-Accounts
      • Add Funds

      Streams

      • Start a Stream
      • Update a Stream
      • Scheduling

      Splitting

      • Create User Splits
      • Edit User Splits
      • List User Splits
      • Immutable Splits

      Collecting

      • How to Collect
      • Squeezing Drips

      Advanced Topics

      • Caller
      • Account Metadata
      • Dripping Fractional Amounts
      • Drips inner workings

    Get Involved

    • Join the Drips Community

    List User Splits

    Using the SDK, it's straightforward to retrieve a list of the splits that are currently configured for a Drips given account. To do so, use the DripsSubgraphClient.getSplitsConfigByUserId method:

    getSplitsConfigByUserId(
        userId: string)
    : Promise<SplitsEntry[]>
    

    To use this method you will first need to create a DripsSubgraphClient.

    When given the user ID of the Drips account that you wish to query the splits configuration for, this method returns an array of SplitsEntries:

    SplitsEntry: { 
        id: string; 
        senderId: string; 
        userId: string; 
        weight: bigint
    }
    

    Take a look at this code sample, which shows how you can retrieve the list of splits that are currently configured for a user ID and display them. If you would like to see this code sample in action, you can do so by [running the NFTDriverClient examples app][in].

    ← Edit User SplitsImmutable Splits →