Hemera Doc
  • 👋Welcome
    • Introduction
    • Quick Start
    • Account Centric Indexing Protocol
      • What is Account-Centric Indexing?
      • Why "account-centric" indexing?
      • The advantages of Account-Centric Indexing
      • What's next for account-centric indexing?
      • Why create a new protocol here?
      • The Hemera Network
        • Network Roles
        • Indexers
        • Validators
        • Proprietary models & knowledge
        • Proprietary data and labels
        • Smart Contracts
        • Key roadmap items
        • Supported blockchains
      • Example Hemera use cases
        • SocialScan Explorers
        • Anti-sybil UML algorithm
        • Ethereum long term DA
        • EVM chain history preservation
        • Ecosystem AI Agents
        • User-defined AI Agents
  • 👩‍💻Developer Resources
    • Smart Contract Developers
    • EVM-compatible chains
      • Blockchain explorers
      • SocialScan explorer API doc
      • Ecosystem AI Agents
    • Dapp developers
    • User-defined Agent creators
    • AVS Operator
  • 🖥️Hemera Indexer
    • Introduction
    • Installation
      • Prerequisites
      • Install & Run
      • Export Result
    • Configurations
    • Benchmark
    • Data Class
      • Raw Data Tables
        • Blocks
        • Transactions
        • Logs
        • Traces
      • Generated Tables
        • Contract Internal Transactions
        • ERC20 Token Transfers
        • Tokens
        • ERC20 Token Holders
        • ERC721 Token Transfers
        • ERC721 Token Holders
        • ERC1155 Token Transfers
        • ERC1155 Token Holders
        • Address Coin Balances
        • Address Token Balances
        • Address Current Token Balances
        • Daily Wallet Address Stats
        • Contracts
      • Other Tables
        • Inscriptions
        • Bridges
          • L1 to L2 Transactions
          • L2 to L1 Transactions
          • Optimistic Rollup Data Availability Batches
          • Optimistic Rollup State Batches
    • Use Cases
      • UniSwap V3
        • Data Class
        • Trigger and Function
        • Run & Query
      • ENS
        • Data Class
        • Trigger and Function
        • Run & Query
      • OpenSea
        • Data Class
        • Trigger and Function
        • Run & Query
      • Deposit to L2
        • Data Class
        • Trigger and Function
        • Run & Query
      • User Profile
  • UDFs - User Defined Functions
    • Introduction
    • Components of UDFs
    • Building User Defined Functions(UDF)
    • Testing and Running UDF
    • Troubleshooting and Support
    • Supported UDFs
    • FAQs
  • 😄About us
    • The story behind building Hemera
    • Partners & Backers
    • Partnership inquiries
    • Hemera Powered Explorers
    • Active Developer Hackathons
    • Developer Contribution
  • Documentation feedback
Powered by GitBook
On this page
  • How to Run
  • Token name Configuration
  • ABI Function Specifics
  • Public API
  • GET /v1/aci/{wallet_address}/deposit/current
  • GET /v1/aci/deposit/transactions
  1. Hemera Indexer
  2. Use Cases
  3. Deposit to L2

Run & Query

How to Run

  • You can start the deposit_to_l2_job by adding the following arguments:

-O TokenDepositTransaction,TokenDepositTransaction --force-filter-mode true
or
-E DEPOSIT_TO_L2 --force-filter-mode true

Before starting job, user needs to configure the monitored l2 chain contract.

Here's the template for the configuration file.

Token name Configuration

The configuration table includes a {token_type} configuration item. In the current program, this is an enumerated value with the following options:

  • eth

  • usdc

  • Custom field

The custom field option matches the name field in the decode section of the abi_function. This tells the program which field represents the deposit token after decoding. Note: eth and usdc are internal configuration values. Typically, the deposit contract methods for these two tokens do not record the token address separately in the input data.

ABI Function Specifics

In the abi_function, the field name representing the deposit amount after decoding should be recorded as _amount.

[chain_deposit_info]
contract_info=
    {
        "{chain_id}":[{
            "contract": "{contract_address}",
            "ABIFunction": [
            {
                "token": "{token_name}",
                "json": {full json of abi function}
            },
            ……
            ]
        }],
        ……
    }

Here are part of the configuration information that are currently running

[chain_deposit_info]
contract_info=
    {
        "8453":[{
            "contract": "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
            "ABIFunction": [
            {
                "token": "eth",
                "json": {"inputs":[{"internalType":"uint32","name":"_minGasLimit","type":"uint32"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"}
            },
            {
                "token": "eth",
                "json":{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint32","name":"_minGasLimit","type":"uint32"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"bridgeETHTo","outputs":[],"stateMutability":"payable","type":"function"}
            }]
        }],
        "10":[{
            "contract": "0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1",
            "ABIFunction": [
            {
                "token": "eth",
                "json": {"inputs":[{"internalType":"uint32","name":"_minGasLimit","type":"uint32"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"}
            },
            {
                "token": "eth",
                "json":{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint32","name":"_minGasLimit","type":"uint32"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"bridgeETHTo","outputs":[],"stateMutability":"payable","type":"function"}
            },
            {
                "token": "_l1Token",
                "json": {"inputs":[{"internalType":"address","name":"_l1Token","type":"address"},{"internalType":"address","name":"_l2Token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint32","name":"_minGasLimit","type":"uint32"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"depositERC20To","outputs":[],"stateMutability":"nonpayable","type":"function"}
            }]
        }]
    }

Public API

GET /v1/aci/{wallet_address}/deposit/current

Get the total amount of deposits on each monitoring l2 chain for the current address

{
    "wallet_address": "0x07AE8551BE970CB1CCA11DD7A11F47AE82E70E67",
    "deposit_times": 35,
    "chain_list": [
        "arbitrum",
        "linea"
    ],
    "asset_list": [
        {
            "chain": "linea",
            "bridge": "0x051f1d88f0af5763fb888ec4378b4d8b29ea3319",
            "token": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
            "token_name": null,
            "token_symbol": null,
            "token_icon_url": null,
            "token_type": null,
            "amount": 113891426.0
        },
        {
            "chain": "arbitrum",
            "bridge": "0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef",
            "token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "token_name": null,
            "token_symbol": null,
            "token_icon_url": null,
            "token_type": null,
            "amount": 389739663425.0
        },
        {
            "chain": "arbitrum",
            "bridge": "0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef",
            "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "token_name": null,
            "token_symbol": null,
            "token_icon_url": null,
            "token_type": null,
            "amount": 632746985369.0
        },
        {
            "chain": "arbitrum",
            "bridge": "0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef",
            "token": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
            "token_name": null,
            "token_symbol": null,
            "token_icon_url": null,
            "token_type": null,
            "amount": 628399963.0
        },
        {
            "chain": "linea",
            "bridge": "0x504a330327a089d8364c4ab3811ee26976d388ce",
            "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
            "token_name": null,
            "token_symbol": null,
            "token_icon_url": null,
            "token_type": null,
            "amount": 59479591975.0
        },
        {
            "chain": "arbitrum",
            "bridge": "0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef",
            "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "token_name": null,
            "token_symbol": null,
            "token_icon_url": null,
            "token_type": null,
            "amount": 1.8289342516725786e+21
        },
        {
            "chain": "arbitrum",
            "bridge": "0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef",
            "token": "0x6b175474e89094c44da98b954eedeac495271d0f",
            "token_name": null,
            "token_symbol": null,
            "token_icon_url": null,
            "token_type": null,
            "amount": 3.095182829935051e+23
        }
    ]
}

GET /v1/aci/deposit/transactions

Query the detailed data of the deposit transaction according to the filter criteria

Response:

{
  "data": [
    {
      "transaction_hash": "0x4769f88dfe3a7aaafffd180837e71a10c29a9ad8d6a3b1481224de7646ab78d0",
      "wallet_address": "0x07ae8551be970cb1cca11dd7a11f47ae82e70e67",
      "chain_id": 42161,
      "contract_address": "0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef",
      "token_address": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "value": "31856.204529119157086825",
      "block_number": 20686814,
      "block_timestamp": "2024-09-05T20:35:47+08:00",
      "chain_name": "arbitrum",
      "name": null,
      "symbol": null,
      "icon_url": null,
      "token_type": null
    },
    {
      "transaction_hash": "0x07f0757d788ae9779c1958b4f3c5dbff0f2b6f5be4023252d612bd7d01fb2b8c",
      "wallet_address": "0x07ae8551be970cb1cca11dd7a11f47ae82e70e67",
      "chain_id": 42161,
      "contract_address": "0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef",
      "token_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "value": "0.000000060012277694",
      "block_number": 20686447,
      "block_timestamp": "2024-09-05T19:22:11+08:00",
      "chain_name": "arbitrum",
      "name": null,
      "symbol": null,
      "icon_url": null,
      "token_type": null
    }
  ],
  "total": 35,
  "max_display": 35,
  "page": 1,
  "size": 25
}
PreviousTrigger and FunctionNextUser Profile

Last updated 8 months ago

🖥️