1 unstable release

0.1.0 Jun 1, 2024

#21 in #nonce

Download history 107/week @ 2024-07-23 80/week @ 2024-07-30 101/week @ 2024-08-06 112/week @ 2024-08-13 62/week @ 2024-08-20 114/week @ 2024-08-27 158/week @ 2024-09-03 253/week @ 2024-09-10 325/week @ 2024-09-17 202/week @ 2024-09-24 123/week @ 2024-10-01 142/week @ 2024-10-08 140/week @ 2024-10-15 288/week @ 2024-10-22 458/week @ 2024-10-29 532/week @ 2024-11-05

1,441 downloads per month
Used in 6 crates (2 directly)

MIT/Apache

1.5MB
21K SLoC

linera-alloy-provider

Interface with an Ethereum blockchain.

This crate contains the Provider trait, which exposes Ethereum JSON-RPC methods. Providers in alloy are similar to ethers.js providers. They manage an RpcClient and allow other parts of the program to easily make RPC calls.

Unlike an ethers.js Provider, an alloy Provider is network-aware. It is parameterized with a Network from linera-alloy-networks. This allows the Provider to expose a consistent interface to the rest of the program, while adjusting request and response types to match the underlying blockchain.

Providers can be composed via stacking. For example, a Provider that tracks the nonce for a given address can be stacked onto a Provider that signs transactions to create a Provider that can send signed transactions with correct nonces.

The ProviderBuilder struct can quickly create a stacked provider, similar to tower::ServiceBuilder.

Feature flags

  • pubsub - Enable support for subscription methods.
  • ws - Enable WebSocket support. Implictly enables pubsub.
  • ipc - Enable IPC support. Implictly enables pubsub.

Usage

TODO :)

Dependencies

~27–43MB
~836K SLoC