Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ImmutableSplitsDriverClient

A client for creating immutable splits configurations.

Anybody can create a new userId and configure its splits configuration, but nobody can update its configuration afterwards, it's immutable.

see

ImmutableSplitsDriver contract.

Hierarchy

  • ImmutableSplitsDriverClient

Index

Constructors

Properties

#driver: ImmutableSplitsDriver
#driverAddress: string
#provider: Provider
#signer: Signer

Accessors

  • get driverAddress(): string
  • get provider(): Provider
  • get signer(): Signer

Methods

  • Creates a new user ID, configures its splits configuration and emits its metadata. The configuration is immutable and nobody can control the user ID after its creation. Calling this function is the only way and the only chance to emit metadata for that user.

    throws

    {@link DripsErrors.argumentMissingError} if the receivers are missing.

    throws

    {@link DripsErrors.splitsReceiverError} if any of the receivers is not valid.

    throws

    {@link DripsErrors.txEventNotFound} if the expected transaction event is not found.

    Parameters

    • receivers: SplitsReceiverStruct[]

      The splits receivers.

    • userMetadata: UserMetadata[]

      The list of user metadata to emit for the created user. Note that a metadata key needs to be 32bytes.

      Tip: you might want to use Utils.UserMetadata.createFromStrings to easily create metadata instances from string inputs.

    Returns Promise<string>

    A Promise which resolves to the new user ID.

  • Creates a new immutable ImmutableSplitsDriverClient instance.

    throws

    {@link DripsErrors.initializationError} if the client initialization fails.

    Parameters

    • provider: Provider

      The network provider. It cannot be changed after creation.

      The provider must be connected to one of the following supported networks:

      • 'mainnet': chain ID 1
      • 'goerli': chain ID 5
      • 'polygon-mumbai': chain ID 80001
    • signer: Signer

      The singer used to sign transactions. It cannot be changed after creation.

      Important: If the signer is not connected to a provider it will try to connect to the provider, else it will use the signer.provider.

    • Optional customDriverAddress: string

      Overrides the NFTDriver contract address. If it's undefined (default value), the address will be automatically selected based on the provider's network.

    Returns Promise<ImmutableSplitsDriverClient>

    A Promise which resolves to the new client instance.

Generated using TypeDoc