Questions tagged [alchemy]

Used for questions related to Alchemy, a Web3 developer platform that provides supernode infrastructure, enhanced APIs, and other building and monitoring tools for building decentralized blockchain applications.

Filter by
Sorted by
Tagged with
5 votes
3 answers
2k views

Trying to understand the difference between trace_call and debug_traceCall methods

can someone help me understand the difference between trace_call and debug_traceCall? From what I've read, trace_call is to see the opcodes executed and the gas used for a transaction. debug_traceCall ...
Devin Jackson's user avatar
4 votes
2 answers
2k views

How to instantiate contract instances with ethers.js and alchemy-sdk

(Found this from the public Alchemy discord, and wanted to ask the question here so it can get indexed online 💙) I'm trying to instantiate contracts in my javascript code so that I can call ABI ...
thatguyintech's user avatar
4 votes
1 answer
282 views

If `provider` is essential in communicating with the blockchain, how is this following code working?

Here is the smart contract code: // SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; interface Bucket { function drop(...
amit's user avatar
  • 370
4 votes
1 answer
291 views

Goerli Smart Contract Deployment taking way too long because of pending transactions

My deployments are very slow. I've read that I need to override pending transactions by resetting the nonce. I'm using Infura. Is there a way to view pending transactions and their nonce like I would ...
HeeeeSark's user avatar
3 votes
2 answers
739 views

window.ethereum.isConnected() always returns true

I'm currently working on "How to build an NFT Marketplace from Scratch" and, Implementing wallet connection. The wallet connect Button is always shows as "connected" even if I ...
吉川遼's user avatar
3 votes
1 answer
283 views

StateDiff in trace_call report invalid balance

I have a TX that wrap 0.23 ETH to WETH, I'am using trace_replayTransaction to get the stateDiff in this way: curl https://eth-mainnet.alchemyapi.io/v2/<api-key> \ -X POST \ -H "Content-...
0x0smile's user avatar
3 votes
1 answer
3k views

How Can I Connect Alchemy as a Custom RPC Node Provider in MetaMask?

I saw this doc on adding a custom RPC endpoint to MetaMask. I'm wondering what are the steps to fill out the information specifically if I have an Alchemy endpoint available? I would like to use the ...
Patrick Collins's user avatar
3 votes
0 answers
76 views

Contract events not being emitted reliably from ethers

I'm having a problem with contract events being not reliable as in they are mostly not emitted but sometimes are emitted. Events from a smart contract (Gnosis Safe contract, SignMsg but true for other ...
Firatov's user avatar
  • 73
3 votes
1 answer
761 views

Get logs for a transaction without actually sending the transaction

I'm trying to simulate a transaction without actually sending the transaction. The trace_call method (on Alchemy) returns 3 types of traces - vmTrace, trace, stateDiff. The trace object returns all ...
pbsh's user avatar
  • 2,401
2 votes
1 answer
174 views

How to find total value in ETH of all NFTs owned by a user

I am aware that we could find all the NFTs owned by a user using alchemy’s NFTs API. However, I was wondering if there was a way to them compute the value of that particular users portfolio.
datasleuths8648's user avatar
2 votes
1 answer
755 views

Fetch last 10 blocks using Alchemy Transfers API

could someone please elaborate on: fromBlock: the starting time range we want to fetch NFT mints over (defaults to latest) I tried to pass a block but its not working... I have also seen fromBlock&...
Kamo's user avatar
  • 21
2 votes
1 answer
820 views

Can someone explain me providers and the different types of it?

I can make providers using ether-hardhat, alchemy, and metamask. What is the difference between these?
amit's user avatar
  • 370
2 votes
2 answers
94 views

TypeError: Member "push" is not available in uint256[] memory outside of storage

// SPDX-License-Identifier: MIT pragma solidity 0.8.4; contract Contract { function filternEven(uint[] memory arr) external pure returns(uint[] memory a){ for(uint i=0;i<arr....
No Brain's user avatar
2 votes
1 answer
1k views

Alchemy - replacement transaction underpriced

SC: 0x3c445903aCa6c4d1B55357Fb9F8e22252899478A I simply try to mint() on Polygon Mumbai but I had to workaround "replacement transaction underpriced", I still can't see any pending/unmined ...
ibox's user avatar
  • 61
2 votes
1 answer
252 views

How to store Ethereum JSON-RPC node API Key in a React app

So the thing is, by using React I see no way not to expose my API KEY. Is there any best practices on how to store it? Is it dangerous if someone will inspect my code and find this API key? How people ...
Paul's user avatar
  • 114
2 votes
2 answers
1k views

Is Alchemy API key a private information?

I'm checking out Alchemy's tutorial https://docs.alchemy.com/alchemy/tutorials/hello-world-smart-contract/part-4, and it seems that they (and also every repo I have seen on the internet) store the ...
user3799934's user avatar
2 votes
1 answer
22 views

RPC endpoint for production environments

Context For testing environments, I'm spinning up AWS instances with App-chain client nodes and using the AWS ALB to access the exposed RPC endpoint. It is protected by the security group rules, so ...
quantumdust's user avatar
2 votes
1 answer
256 views

Why is Alchemy eth_getLogs not finding event logs for AaveV3 Supply events?

I have created a Node project that connects to Alchemy via ethers. I am trying to capture all Supply events for AaveV3 However, when I use the getLogs function, and use the contract address as the ...
Oscar Chambers's user avatar
2 votes
1 answer
193 views

Does Alchemy support batch requests for getAssetTransfers?

I am trying to make a batch request for getAssetTransfers endpoint. However, when I try to do this, I get this error: jsonrpc: '2.0', id: 1, error: { code: -32600, message: '...
bison's user avatar
  • 21
2 votes
1 answer
82 views

Is dedicated gateway a need for marketplace projects?

I am developing an NFT marketplace. It has a section showing images of NFTs ( NFTCards with some information ) of a specific contract address. Since the number of minted NFTs by the contract is high, ...
Sina Rahimi's user avatar
1 vote
1 answer
482 views

How to use the alchemy api on a local hardhat node?

I am working on a website in which I want to call on different NFTs connected to the currently selected MetaMask account. For testing I am running a local Hardhat node on which I have deployed my ...
rajohs's user avatar
  • 179
1 vote
3 answers
213 views

Getting NFTs of an address in a specific collection

I am using Alchemy API to handle fetching NFTs and their metadata in my platform. It has valuable methods, such as retrieving all issued NFTs of a collection or all owned NFTs of an address within a ...
Sina Rahimi's user avatar
1 vote
1 answer
7k views

ethers contract call for value of state variable reverts with "missing revert data"

I am trying to obtain the value of a state variable in my smart contract declared simply as string public projectName; at the top of my smart contract, which is deployed to the Polygon Mumbai testnet. ...
GGizmos's user avatar
  • 701
1 vote
1 answer
7k views

When trying to deploy a smart contract, I keep getting `Error HH100: Network ropsten doesn't exist` -- how do I resolve?

I'm running through these docs on deploying an NFT and I keep getting the error: Error HH100: Network ropsten doesn't exist The command I'm using can be found at step 16: npx hardhat --network ropsten ...
thatguyintech's user avatar
1 vote
3 answers
807 views

When I try to deploy my smart contract to the goerli network, nothing happens

I finally got to test my smart contract for the first time on the Goerli network through alchemy. It worked twice as I check on Etherscan which is now gone, but when I run the command; 'npx hardhat ...
Slatt's user avatar
  • 11
1 vote
3 answers
1k views

Does Alchemy "getAssetTransfers" get all transactions or just all asset transfers?

I'm working with alchemy's SDK and it looks like the getAssetTransfers API endpoint will return any value transaction from an address. However, it also looks like it can return a list of all ...
Patrick Collins's user avatar
1 vote
4 answers
1k views

Get all Nfts of a collection owned by a wallet using alchemy sdk

I am using alchemy sdk , can u please tell me how I can use getNftsForOwner() to get all the nfts owned by a wallet of a particular contract adddress? I need the exact syntax. Thank u
Blockchain dev's user avatar
1 vote
1 answer
335 views

web3.eth - getBlock FetchError: request to https://eth-mainnet.g.alchemy.io/v2/api_key failed, reason: getaddrinfo ENOTFOUND eth-mainnet.g.alchemy.io

I'm trying to get Eth blocks by blockNum using Alchemy's apis. The docs mention two methods: getBlockByHash and getBlockByNum, but those methods don't exist on the web3.eth object. Here are the ...
T. Young's user avatar
1 vote
2 answers
1k views

Insufficient funds when trying to deploy smart contract at goerli test network with alchemy

When I run the command "npx hardhat run scripts/deploy.js --network goerli" it gives me the error Error: insufficient funds for intrinsic transaction cost. More specifically looks like this:...
User G Amsterdam's user avatar
1 vote
1 answer
439 views

Minting 3D files onto opensea

I am new and I am building an NFT collection on Open Sea for my personal project. I have watched a couple of videos from Alchemy, the ERC721 smart contract video outlined how to upload and host files ...
TheBaby's user avatar
  • 11
1 vote
1 answer
425 views

Im trying to deploy contract on Polygon Mumbai but cant

I get this error when deploying my contract. It only takes 3,600,000 gas to deploy and mumbai gas limit is 20,000,000. deploying "DeqityFactory"exceeds block gas limit {"name":&...
MaximilianFullStack's user avatar
1 vote
1 answer
377 views

How do you import a custom unlocked account from Ganache-CLI into MetaMask?

I'm attempting to write some test contracts that interacts w/ Uniswap and am using the following stack: Remix (Injected Web3) -> MetaMask -> Ganache-CLI -> Alchemy (Fork of Ethereum Mainnet) ...
J Shapiro's user avatar
  • 113
1 vote
1 answer
425 views

estimateGas gets called too early and doesn't return correct value

I am using a alchemy node to calculate the gas limit of a smart contract once the state of the contract has changed to what I am looking for. I monitor this change by calling a read method on the ...
justanotherguy's user avatar
1 vote
1 answer
1k views

What do alchemy and infura actually do?

I deployed a contract via (?) alchemy, then deleted the alchemy app. The contract still works, on etherscan, as it did before — even for writes. This is encouraging, but begs the question: for which ...
hihihihihihihihi's user avatar
1 vote
1 answer
32 views

How to fix invalid sender error using alchemy-sdk?

Trying to send a transaction with Alchemy-sdk, but I keep getting invalid sender. What am I doing wrong or missing, code below: My provider is created using ethers.providers.JSONRPCProvider(...
Maniac_1979's user avatar
1 vote
0 answers
148 views

Alchemy API: How to get transaction history including failed and pending transactions for a specific wallet address?

In React I'm building a transaction history screen to list succeeded, failed and pending Polygon transactions. Using alchemy_getAssetTransfers I can retrieve the transaction history for a specific ...
Operator's user avatar
  • 111
1 vote
0 answers
131 views

Why Alchemy responds eth_getBlockByNumber with wrong data

Network: Polygon Mainnet. I am using the Alchemy RPC in the following manner: I listen for new blocks and then retrieve block data, including transactions, based on the block number. However, today my ...
Alexandr Kalashnikov's user avatar
1 vote
0 answers
23 views

How to filter smart contracts via method signature

is there anyone here who is an expert on dune/ethereum etl/alchemy? the question is - i'm doing research and want to find a quick way to query all smart contracts that implement/have called a certain ...
bilbob2392's user avatar
1 vote
0 answers
86 views

Unable to run concurrent contract executions on polygon mainnet (Alchemy)

I'm currently encountering a peculiar issue on the Polygon Mainnet, which doesn't seem to occur on the Testnet. When running two or more parallel node processes which have two different wallets with ...
Rakesh Bhatt's user avatar
1 vote
1 answer
47 views

before all" hook for "should allow a purchase" error - Chainshot

I am completing series of tutorials on chainshot. Now I am on events 4. - Sale and I am getting an error "before all" hook for "should allow a purchase" and I don't have an idea ...
rad2's user avatar
  • 13
1 vote
2 answers
106 views

getting error as deploy file not found

require('dotenv').config(); require('@nomicfoundation/hardhat-toolbox'); const API_URL = process.env.API_URL; const PRIVATE_KEY = process.env.PRIVATE_KEY; const API_KEY=process.env.API_KEY console....
ATHUL SURESH's user avatar
1 vote
1 answer
53 views

Etherjs "contract.on" method in Reactjs to read events not loading on console

I am trying to display the events that are emitted from a function in my smart contract to the front end of my dApp, and I feel like I am missing a step in the connection process with my dApp. I've ...
OhItsPM's user avatar
  • 75
1 vote
0 answers
79 views

Alchemy notify slack webhook not working properly

I'm trying to get notifications on an address piped to slack, and Alchemy apparently has a free tool for this, but I can't get the webhook to work. Copied it directly from the slack app, but the tests ...
scheherazhaad's user avatar
1 vote
1 answer
482 views

reason: 'execution reverted: Not enough ether to purchase NFTs.', code: 'UNPREDICTABLE_GAS_LIMIT',

I am attempting to deploy a smart contract to the Sepolia testnet. I currently have ~1 Sepolia eth in my wallet. I am using Hardhat and Alchemy and I am following this tutorial Here is my code for ...
That_Coder's user avatar
1 vote
0 answers
95 views

How Can I get both Incoming and Outgoing transactions from "getAssetTransfers" inside one request?

I'm working with alchemy's SDK. And as per the Alchemy SDK documentation, it says we can get all the transactions like this: const config = { apiKey: "<-- ALCHEMY APP API KEY -->", ...
MDIPANJAN's user avatar
1 vote
1 answer
242 views

Not able to send transaction using alchemy sdk

Hey i have to build a ERC20 contract and using alchemy sdk to send transactions onchain For eg mint or burn tokens. But i am not able to send a transaction as its showing an error of cannot estimate ...
Yakshesh Gupta's user avatar
1 vote
1 answer
128 views

Decode eth_call transaction

How to read "data params" and "value result" from eth_call method on Alchemy explorer ? thanks.
adam mr's user avatar
  • 61
1 vote
0 answers
136 views

Alchemy API returning "not found" on endpoints in docs

I have the following code: import requests url = "https://eth-mainnet.g.alchemy.com/v2/<REDACTED_API_KEY>/findContractDeployer" payload = {"contractAddress": "...
Patrick Collins's user avatar
1 vote
0 answers
110 views

During minting of nft ndRestPayload.js:16 if (!url.includes("alchemy")) ^ TypeError: Cannot read properties of undefined (reading 'includes') [closed]

if (!url.includes("alchemy")) { ^ TypeError: Cannot read properties of undefined (reading 'includes') at Object.makeRestPayloadSender (F:\hardhat-nft\node_modules\@alch\...
Abhishek's user avatar
1 vote
1 answer
1k views

Use EthersJS to connect to either Alchemy or Infura depending on availability

I've noticed that relying on one provider API can be problematic at times of heavy server load. I would like to use EthersJS to choose either Infura or Alchemy depending on which network is available ...
Ahmed Ihsan Tawfeeq's user avatar