Features
- NFT API - Ownership, metadata, sales, spam detection
- Prices API - Token prices by symbol/address, historical data
- Portfolio API - Multi-chain token balances and NFT holdings
- Token API - ERC-20 balances, metadata, allowances
- Transfers API - Historical transaction data
- Debug API - Transaction and block tracing
- Trace API - Parity-style tracing
- Simulation API - Simulate transactions and asset changes
- Bundler API - ERC-4337 Account Abstraction
- Gas Manager API - Gas sponsorship and policy management
- Wallet API - Smart wallet operations
- Accounts API - Authentication (email, passkey, JWT)
- Notify API - Webhook management
- Beacon API - Ethereum consensus layer
- Solana DAS API - Digital Asset Standard queries
Installation
[]
= "0.1"
= { = "1", = ["full"] }
Quick Start
use ;
async
Supported Networks
Ethereum, Polygon, Arbitrum, Optimism, Base, zkSync, Solana, and 20+ more networks.
use Network;
let client = new?;
let client = new?;
let client = new?;
let client = new?;
let client = new?;
API Examples
NFT API
// Get NFTs for owner
let nfts = client.nft.get_nfts_for_owner.await?;
// Get NFT metadata
let nft = client.nft.get_nft_metadata.await?;
// Check if address owns NFT from collection
let is_holder = client.nft.is_holder_of_contract.await?;
// Get floor price
let floor = client.nft.get_floor_price.await?;
Token API
// Get ERC-20 balances
let balances = client.token.get_token_balances.await?;
// Get token metadata
let metadata = client.token.get_token_metadata.await?;
println!;
// Get allowance
let allowance = client.token.get_token_allowance.await?;
Transfers API
use AssetTransfersOptions;
// Get transfers from an address
let transfers = client.transfers.get_transfers_from.await?;
// Get transfers with options
let options = from_address
.category
.with_metadata
.exclude_zero_value;
let transfers = client.transfers.get_asset_transfers.await?;
Debug API
// Trace a transaction
let trace = client.debug.trace_transaction.await?;
// Trace a call
let call = new.data;
let trace = client.debug.trace_call.await?;
Simulation API
use SimulationTransaction;
// Simulate asset changes
let tx = new
.data
.value;
let result = client.simulation.simulate_asset_changes.await?;
for change in result.changes
Bundler API (ERC-4337)
// Get supported entry points
let entry_points = client.bundler.supported_entry_points.await?;
// Estimate gas for UserOperation
let gas = client.bundler.estimate_user_operation_gas.await?;
// Send UserOperation
let hash = client.bundler.send_user_operation.await?;
// Get UserOperation receipt
let receipt = client.bundler.get_user_operation_receipt.await?;
Beacon API
// Get genesis info
let genesis = client.beacon.get_genesis.await?;
// Get validators
let validators = client.beacon.get_validators.await?;
// Get block
let block = client.beacon.get_block.await?;
Solana DAS API
// Get asset by ID
let asset = client.solana.get_asset.await?;
// Get assets by owner
let assets = client.solana.get_assets_by_owner.await?;
// Search assets
let request = new.owner.collection;
let results = client.solana.search_assets.await?;
Terms of Service
This is an unofficial client. By using this library, you agree to comply with Alchemy's Terms of Service.
Disclaimer
This crate is not affiliated with or endorsed by Alchemy.
License
MIT