A list of all Alchemy SDK methods and their corresponding General API methods
Alchemy SDK Methods | Raw API Methods | Use Case |
---|---|---|
SDK Core | ||
call | eth_call - Also available on Polygon, Arbitrum, Optimism, Astar. | Executes a new message call immediately without creating a transaction on the block chain. |
estimateGas | eth_estimateGas - Also available on Polygon, Arbitrum, Optimism, Astar. | Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. |
findContractDeployer | Finds the address that deployed the provided contract and block number it was deployed in. | |
getAssetTransfers | alchemy_getAssetTransfers - Transfers API | The Transfers API allows you to easily fetch historical transactions for any address across Ethereum and supported L2s including Polygon, Arbitrum, and Optimism. |
getBalance | eth_getBalance, getBalance (Solana) - Also available on Arbitrum, Polygon. | Returns the balance of the account of a given address. |
getBlock | getBlock (Solana), eth_getBlockByHash, eth_getBlockByNumber | Returns the block from the network based on the provided block number or hash. |
getBlockNumber | eth_blockNumber - Also available on Polygon, Arbitrum, Optimism, Astar. | Returns the number of the most recent block. |
getBlockWithTransactions | eth_getBlockTransactionCountByHash, eth_getBlockTransactionCountByNumber | Returns the block from the network based on the provided block number or hash. Includes fully transactions from the block. |
getCode | eth_getCode - Also available on Polygon, Arbitrum, Optimism. | Returns code at a given address. |
feeData | eth_maxPriorityFeePerGas - Also available on Arbitrum, Astar. | Returns the recommended fee data to use in a transaction. For an EIP-1559 transaction, the maxFeePerGas and maxPriorityFeePerGas should be used. For legacy transactions and networks which do not support EIP-1559, the gasPrice should be used. |
getGasPrice | eth_gasPrice - Also available on Polygon, Arbitrum, Optimism, Astar. | Returns the current price per gas in wei. |
getLogs | eth_getLogs - Also available on Polygon, Arbitrum, Optimism. | Returns an array of all logs matching a given filter object. |
getStorageAt | eth_getStorageAt - Also available on Polygon, Arbitrum, Optimism. | Returns the value from a storage position at a given address, or in other words, returns the state of the contract's storage, which may not be exposed via the contract's methods. |
getTokenBalances | alchemy_getTokenBalances - Token API | Returns token balances for a specific address given a list of contracts. |
getTokenMetadata | alchemy_getTokenMetadata - Token API | Returns metadata (name, symbol, decimals, logo) for a given token contract address. |
getTransactionCount | eth_getTransactionCount - Also available on Polygon, Arbitrum, Optimism. | Returns the number of transactions sent from an address. |
getTransactionReceipt | eth_getTransactionReceipt - Also available on Polygon. | Returns the receipt of a transaction by transaction hash. |
getTransactionReceipts | eth_getTransactionReceiptsByBlock, alchemy_getTransactionReceipts | An Alchemy Enhanced API that gets all transaction receipts for a given block by number or block hash. Supported on all networks for Ethereum, Polygon, and Arbitrum. |
send | Allows sending a raw message to the Alchemy backend. | |
SDK NFTs | NFT API | |
getNftsForOwner | getNFTs | Gets all NFTs currently owned by a given address. |
getNftMetadata | getNFTMetadata | Gets the metadata associated with a given NFT. |
getContractMetadata | getContractMetadata | Queries NFT high-level collection/contract level information. |
getNftsForContract | getNFTsForCollection | Gets all NFTs for a given NFT contract. |
getOwnersForNft | getOwnersForToken | Get the owner(s) for a token. |
getOwnersForContract | getOwnersForCollection | Gets all owners for a given NFT contract. |
getSpamContracts | getSpamContracts | Returns a list of all spam contracts marked by Alchemy. |
isSpamContract | isSpamContract | Returns whether a contract is marked as spam or not by Alchemy. |
refreshContract | reingestContract | Triggers metadata refresh for an entire NFT collection and refreshes stale metadata after a collection reveal/collection changes. |
getFloorPrice | getFloorPrice | Returns the floor prices of a NFT collection by marketplace. |
computeRarity | computeRarity | Computes the rarity of each attribute of an NFT. |
SDK Transact | ||
getTransaction | eth_getTransactionByHash - Also available on Polygon, Arbitrum, Optimism, Astar. getTransaction (Solana) | Returns the information about a transaction requested by transaction hash or number. In the response object, blockHash, blockNumber, and transactionIndex are null when the transaction is pending. |
sendTransaction | eth_sendRawTransaction - Also available on Polygon, Arbitrum, Optimism, Astar. sendTransaction (Solana) | Creates a new message call transaction or a contract creation for signed transactions. |
sendPrivateTransaction | eth_sendPrivateTransaction | Send a single private transaction through Flashbots. Private transactions are sent directly to miners and not included in the public mempool. |
cancelPrivateTransaction | eth_cancelPrivateTransaction | Request to cancel private transactions on Ethereum that are sent via eth_sendPrivateTransaction. |
waitForTransaction | Returns a promise which will not resolve until specified transaction hash is mined. If confirmations is 0, this method is non-blocking and if the transaction has not been mined returns null. Otherwise, this method will block until the transaction has confirmed blocks mined on top of the block in which it was mined. | |
SDK Notify | Notify API | |
getAllWebhooks | team-webhooks | This endpoint allows you to get all webhooks from every app on your team. |
getAddresses | webhook-addresses | Paginated endpoint to list all of the addresses a given Address Activity webhook is subscribed to. |
getNftFilters | webhook-nft-filters | Paginated endpoint to list all of the NFT filter objects a given webhook is subscribed to. |
updateWebhook | update-webhook | Allows you to update the state of an existing webhook. Input parameters is a webhook ID or object, followed by exactly one of the Update objects listed below. |
createWebhook | create-webhook | This endpoint allows you to create a webhook. |
deleteWebhook | delete-webhook | Allows you to delete a webhook. |