Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CallerClient

A generic call executor that increases the flexibility of other contracts' APIs.

see

Caller contract.

Hierarchy

  • CallerClient

Index

Constructors

Properties

#caller: Caller
#callerAddress: string
#provider: Provider
#signer: Signer

Accessors

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

Methods

  • callBatched(calls: CallStruct[]): Promise<ContractTransaction>
  • callBatched(calls: Preset): Promise<ContractTransaction>
  • callBatched(calls: PopulatedTransaction[]): Promise<ContractTransaction>
  • Executes a batch of calls.

    Reverts if any of the calls reverts or any of the called addresses is not a contract.

    Important: If the called contract is Caller-aware and trusts that instance of Caller (e.g., the official Drips Drivers contracts) the msg.sender will be set to the address of the wallet which called the Caller. If not, msg.sender will be set to the address of the Caller.

    Parameters

    Returns Promise<ContractTransaction>

    A Promise which resolves to the contract transaction.

  • Executes a batch of calls.

    Reverts if any of the calls reverts or any of the called addresses is not a contract.

    Important: If the called contract is Caller-aware and trusts that instance of Caller (e.g., the official Drips Drivers contracts) the msg.sender will be set to the address of the wallet which called the Caller. If not, msg.sender will be set to the address of the Caller.

    Parameters

    • calls: Preset

      The calls to perform.

    Returns Promise<ContractTransaction>

    A Promise which resolves to the contract transaction.

  • Executes a batch of calls.

    Reverts if any of the calls reverts or any of the called addresses is not a contract.

    Important: If the called contract is Caller-aware and trusts that instance of Caller (e.g., the official Drips Drivers contracts) the msg.sender will be set to the address of the wallet which called the Caller. If not, msg.sender will be set to the address of the Caller.

    Parameters

    • calls: PopulatedTransaction[]

      The calls to perform.

    Returns Promise<ContractTransaction>

    A Promise which resolves to the contract transaction.

  • create(provider: Provider, signer: Signer, customCallerAddress?: string): Promise<CallerClient>
  • Creates a new immutable CallerClient instance.

    throws

    {@link DripsErrors.argumentError.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 customCallerAddress: 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<CallerClient>

    A Promise which resolves to the new client instance.

Generated using TypeDoc