The Elder Helper class provides a convenient way to interact with rollups through a simple, object-oriented interface. This guide explains how to use the Elder Helper class in your applications to connect to the Elder network and send transactions to your rollup.
The Elder Helper class encapsulates the functionality needed to interact with rollups, including connecting to the Elder network, managing Elder addresses and public keys, sending transactions, and handling configuration parameters.

Class Structure

How to Use the Elder Helper

Setting Up Environment Variables

Before using the Elder Helper class, make sure to set up the required environment variables:

Connecting to the Elder Network

Sending Transactions

Benefits of Using the Elder Helper Class

  1. Simplified Interface: The Elder Helper provides a clean, object-oriented interface for interacting with rollups.
  2. State Management: The class maintains the state of your connection, including Elder address and public key.
  3. Configuration Handling: The class manages configuration parameters and provides sensible defaults.
  4. Error Handling: Built-in validation ensures that required parameters are provided before sending transactions.

Complete Example

useElder React Hook

The useElder React hook provides a convenient way to manage Elder network connections and transactions in your React components.

Implementation

Using the useElder Hook in React Components

Sending Transactions with useElder

Next Steps

Now that you understand how to use the Elder Helper class and the useElder React hook, you can:
  • Integrate them into your dApps
  • Create reusable transaction patterns
  • Build higher-level abstractions on top of these tools

The Elder Helper class and React hook make it easy to build powerful, user-friendly rollup integrations on Shib Alpha Layer. Start building today and unlock the full potential of your rollup!