Drips docs

Drips docs

    ›For Developers

    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

    Initializing the SDK

    The Drips SDK provides two main types for interacting with the Drips Protocol. First, there is DripsSubgraphClient, which provides "read" functionality and, in particular, allows developers to query the Drips subgraph.

    You can create a DripsSubgraphClient like this:

    // Pass the `chainID` of the network you want to connect to.
    const dripsSubgraphClient = DripsSubgraphClient.create(chainId);
    

    For the list of supported networks see here.

    The second type of client is 'NFTDriverClient'. This client provides "write" functionality and more specifically it allows application code to send transactions to the NFTDriver smart contract and perform actions like setting Drips or Splits and collecting funds from an NFT-based sub-account.

    Because NFTDriverClient will send transactions to the blockchain, a provider instance is required to instantiate it. This provider could come from a wallet connected by one of your application's end-users, or from a wallet controlled by the application itself.

    Once you have a provider, you can create an NFTDriverClient like this:

    // Assuming you have your wallet connected you should have a `provider` instance.
    const nftDriverClient = await NFTDriverClient.create(provider);
    

    Once you've instantiated a DripsSubgraphClient or an NFTDriverClient or both, your app is ready to interact with Drips!

    ← Installing the SDK and Running the Example AppIntro to Accounts →