New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ape-infura

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ape-infura

ape-infura: Infura Provider plugins for Ethereum-based networks

  • 0.8.4
  • PyPI
  • Socket score

Maintainers
3

Quick Start

Use the Metamask Developer (F.K.A. Infura) provider plugin to interact with blockchains via APIs. This plugin supports the following ecosystems:

  • Arbitrum
  • Avalanche
  • Base
  • Blast
  • BSC
  • Celo
  • Ethereum
  • Linea
  • Mantle
  • Optimism
  • Palm
  • Polygon
  • Scroll
  • Starknet
  • Unichain
  • zkSync

Dependencies

Installation

via pip

You can install the latest release via pip:

pip install ape-infura

via setuptools

You can clone the repository and use setuptools for the most up-to-date version:

git clone https://github.com/ApeWorX/ape-infura.git
cd ape-infura
python3 setup.py install

Quick Usage

First, make sure you have one of the following environment variables set (it doesn't matter which one):

  • WEB3_INFURA_PROJECT_ID
  • WEB3_INFURA_API_KEY

Either in your current terminal session or in your root RC file (e.g. .bashrc), add the following:

export WEB3_INFURA_PROJECT_ID=MY_API_TOKEN

# Multple tokens
export WEB3_INFURA_PROJECT_ID=MY_API_TOKEN1, MY_API_TOKEN2

Additionally, if your app requires an API secret as well, use either of the following environment variables:

  • WEB3_INFURA_PROJECT_ID
  • WEB3_INFURA_API_KEY

And each request will use the secret as a form of authentication.

To use the Infura provider plugin in most commands, set it via the --network option:

ape console --network ethereum:sepolia:infura

To connect to Infura from a Python script, use the networks top-level manager:

from ape import networks

with networks.parse_network_choice("ethereum:mainnet:infura") as provider:
    # Also, access the websocket URI:
    print(provider.ws_uri)

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc