Drips docs

Drips docs

    ›Accounts

    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

    Create an Account

    Creating a new account in the Drips protocol means creating a new user ID for your end user or application to control. User IDs are created using identity drivers. See User Identies in Drips for a more detailed discussion of how user IDs and identity drivers work in Drips.

    Most developers building on Drips will likely wish to use NFT-based sub-accounts for their users. To build on NFT-based sub-accounts, you will first need to create a NFTDriverClient and a DripsSubgraphClient.

    Once you have a NFTDriverClient, you can create a new account by calling NFTDriverClient.createAccount():

    createAccount(
        transferToAddress: string,
        associatedApp?: BytesLike,
        userMetadata: UserMetadataStruct[] = []
        ): Promise<string>
    

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

    Calling this method creates a new NFT-based sub-account and transfers that NFT to the Ethereum address that was given in the transferToAddress parameter to the createAccount function call.

    As soon as the NFT is minted, the user who controls transferToAddress will control the new Drips sub-account and can take actions like adding funds, setting Drips and Splits for the account and so on.

    Account creation works differently for each identity driver. For example with AddressDriver, each Ethereum address always has exactly one Drips account associated with it and that account is already "created" by default for each address. In other words, no explict action is required to create an account for an Ethereum address in AddressDriver. Instead, a user with a connected wallet can simply use AddressDriverClient to start adding funds and/or configuring Drips and Splits for the account that corresponds to their address.

    ← Intro to AccountsList Sub-Accounts →