Drips docs

Drips docs

    ›Collecting

    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

    How to Collect

    You can use the SDK to collect funds that were sent to an NFT-based sub-account in completed cycles by calling the function NFTDriverClient.collect:

    collect(
        tokenId: string,
        tokenAddress: string,
        transferToAddress: string)
    : Promise<ContractTransaction>
    

    Take a look at this method's documentation to understand what each parameter represents.

    Note in particular that the tokenId parameter here is the userId for the NFT-based sub-account to collect funds for, since tokenIds are always userIds, as you can see from the tokenId-generation code.

    Calling collect will move all of the funds that have currently been received by the account in past/completed cycles to the wallet at transferToAddress. To collect funds from Drips that have been received during the current cycle, you will need to "squeeze" those Drips - see the next section on Squeezing Drips.

    If the account you are interested in collecting funds from is an address-based account rather than an NFT-based sub-account, you can collect funds by calling the function AddressDriverClient.collect

    ← Immutable SplitsSqueezing Drips →