Skip to content

Allow subscribing to safe block changes #3921

@cohuebn

Description

@cohuebn

Describe the Feature

Overview

A provider can emit events to facilitate observing interesting things happening on chain. It'd be really nice if we could subscribe to the latest safe block. See #3068 for more details. This would allow applications to respond only when the safe block changes which is a good happy-medium between pending (higher likelihood of reorganization) and finalized (takes up to 15 minutes on networks like Sepolia)

Specific request

  • A new safe event is emitted when the latest safe block becomes available

Code Example

// Typescript example using Ethereum JSON RPC provider
const provider = new JsonRpcProvider("https://rpc.ankr.com/eth");
provider.on("safe", (blockNumber: number) => {
  console.log(`Received new safe block number: ${blockNumber}`);
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement.fixed/completeThis Bug is fixed or Enhancement is complete and published.v6Issues regarding v6

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions