8
votes
Trying to understand the difference between trace_call and debug_traceCall methods
API methods trace_* namespace was originally used in the openethereum client (which is currently unmaintained), some other clients such as erigon also provide this namespace.
While debug_* namespace ...
4
votes
Accepted
How to use the alchemy api on a local hardhat node?
You can't use Alchemy as your local hardhat node.
There are a lot of things that Alchemy does, but it would have a really hard time indexing your local hardhat chain, especially since it doesn't have ...
4
votes
Accepted
window.ethereum.isConnected() always returns true
window.ethereum.isConnected() not refers to connection about user account!
In details, this function refers if the provider can make RPC requests to the current chain.
From documentation:
Note that ...
4
votes
Accepted
StateDiff in trace_call report invalid balance
Alchemist here.
Thanks for asking the question! We've checked your queries internally and it seems these responses are coming directly from our Ethereum client. So the incorrect numbers are not due to ...
4
votes
Trying to understand the difference between trace_call and debug_traceCall methods
trace_call is an API method that allows you to execute the given call and returns the number of possible traces for it. These traces include transactions that have been mined or hypothetical ones not ...
3
votes
ethers contract call for value of state variable reverts with "missing revert data"
In case anyone comes across this trying to hunt down a reason for "missing revert data in call exception" in this case it was the result of calling a function that existed in the ABI I was ...
3
votes
Accepted
When trying to deploy a smart contract, I keep getting `Error HH100: Network ropsten doesn't exist` -- how do I resolve?
This hardhat error happens when you are trying to interact with a network that is not defined in the config file.
Specifically, because you are using the --network ropsten flag, the config file ...
3
votes
Accepted
Web3 Chainstack Guide to Batch Transactions gives Error: This contract object doesn't have address set yet, please set an address first
new versions of web3js have been released with changes in the API so you have to make sure to run the code in the article with the specific versions.
On the other hand, we've released an updated ...
3
votes
Fetch last 10 blocks using Alchemy Transfers API
Alchemist here 💙
To fetch all NFT mint events within the last 10 blocks, you can use:
ethers.js to fetch block num, and then
use the Alchemy getAssetTransfers request to search "erc721" ...
3
votes
Accepted
How to instantiate contract instances with ethers.js and alchemy-sdk
Try this example of using the alchemy-sdk to connect to eth mainnet to load a contract instance.
I think the key difference is that you should use await alchemy.config.getProvider() instead of what ...
3
votes
Accepted
How Can I Connect Alchemy as a Custom RPC Node Provider in MetaMask?
First, you'll need to sign up for an Alchemy endpoint, and hit "create app".
Set it up as a polygon network. Once up, you can click on the app and hit "view key" to see the HTTP ...
3
votes
Accepted
If `provider` is essential in communicating with the blockchain, how is this following code working?
Acutally, when you running the script by hardhat command, it's automatic assigned by a provider into your erc instance contract. You can check it inside erc.provider
For example
npx hardhat run ...
3
votes
How to find total value in ETH of all NFTs owned by a user
If you like to get the user's NFT portfolio value, then you can use Moralis to provide you with such data.
Simply sign up to Moralis to get the API key and install the SDK:
npm install moralis
Then, ...
2
votes
Accepted
Etherscan sends back garbage values through API for the same query that works on the website
The problem is that the address 0xc6845a5c768bf8d7681249f8927877efda425baf is the proxy bytecode contract. It doesn't store any data.
To make it work you have call ...
2
votes
web3.eth - getBlock FetchError: request to https://eth-mainnet.g.alchemy.io/v2/api_key failed, reason: getaddrinfo ENOTFOUND eth-mainnet.g.alchemy.io
this is the code you can run in web3.js. In this case this is eth_getBlockByNumber.
var Web3 = require('web3');
var node_URL = 'CHAINSTACK_NODE_URL';
var web3 = new Web3(node_URL);
web3.eth.getBlock('...
2
votes
How to instantiate contract instances with ethers.js and alchemy-sdk
instead of passing alchemy.core, pass return value of this
const ethersProvider = await alchemy.config.getProvider()
final:
const CompoundorContract = new
ethers.Contract(
CONSTANTS.ADDRESSES....
2
votes
window.ethereum.isConnected() always returns true
the problem is you are only toggling once in the if-statement (if: true / isConnected = true) but not the other way around (isConncted = false) does not trigger toggleConnect.
In effect, you are just ...
2
votes
Accepted
What do I need to consider to choose Ethereum Client?
Hi dev advocate at Chainstack here!
Answer to question 1)
Geth is definitely the most used for now. There are a few reasons why. Still, the main one is that Go Ethereum (Geth) is the official Go land ...
2
votes
Accepted
Does Alchemy "getAssetTransfers" get all transactions or just all asset transfers?
Heya 👋🏼 Full disclosure: Alchemy Developer Advocate speaking :)
getAssetTransfers gets all transaction types that you specify in your query, including "transactions even if no value is sent&...
2
votes
When I try to deploy my smart contract to the goerli network, nothing happens
I would have just commented to the original question, but I do not have enough reputation to comment.
I have experienced the same issue. Lately the Goerli network is super busy in US day time and it ...
2
votes
Accepted
Getting NFTs of an address in a specific collection
(1) Get all the NFTs of an address owned within a specific network by ( You have to do the network configuration earlier ):
await alchemy.nft.getNftsForOwner(address)
(2) Then store the response ( It'...
2
votes
Accepted
Can someone explain me providers and the different types of it?
The main difference between then is the infrastructure they use to connect to the Ethereum network - they also offer different features. Think of them as different services that will allow you to ...
1
vote
Accepted
Minting NFT...do I need to specify something to perform proof-of-stake instead of proof of work?
No, you don't need to specify something to perform Pos instead of PoW. The transaction type (0x0 Legacy) is an old transaction format that is still valid for new transactions on the Ethereum network.
...
1
vote
Unable to mint an NFT with new contract,. Error: 'Returned error: execution reverted: Ownable: caller is not the owner'
Hi dev advocate at Chainstack here!
The mintNftfunction has the onlyOwner modifier declared in it. This means that that function can only be called by the owner of the smart contract, which is the ...
1
vote
Get all Nfts of a collection owned by a wallet using alchemy sdk
alchemy sdk changed something and so if you need, you can add pageKey to your sdk parameter.
...
alchemy.nft.getNftsForOwner("0xshah.eth", {pageKey: '88434286-7eaa-472d-8739-32a0497c2a18'})....
1
vote
Get all Nfts of a collection owned by a wallet using alchemy sdk
getNftsForOwner() accepts two parameters: owner and options (optional). Try passing any extra params as an object for options
Getting only nfts of a certain contract for an owner would look something ...
1
vote
Why use node providers? Is it necessary to use them for small project?
Overall running your node is very labor and resource intensive, especially for a small project. You'll end up spending thousands for the hardware and weeks to sync up a new node.
This article about ...
1
vote
Im trying to deploy contract on Polygon Mumbai but cant
Found the solution. If your deploy script's (in hardhat-deploy atleast) gas limit is higher than the network's block gas limit then you will receive that error.
1
vote
Accepted
Does an ERC721A mint call count as a "external transaction" or a "token transfer" (on etherscan)?
The semantics of Alchemy Notify for address activity are that it matches on the from/to address of the given category to the address you are subscribed to. In this case, you are subscribed to events ...
1
vote
Alchemy - replacement transaction underpriced
Polygon's Bor client (currently a modification of Geth) uses the same default value setting for replacement transactions that you can view here.
What this means any Polygon node running in the default ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
alchemy × 132hardhat × 26
nft × 21
solidity × 20
ethers.js × 17
web3js × 16
polygon × 11
blockchain × 10
alchemy-sdk × 9
goerli × 8
transactions × 7
metamask × 7
infura × 7
sepolia × 6
contract-development × 5
etherscan × 5
nodejs × 5
web3-providers × 5
hardhat-deploy × 5
dapps × 4
javascript × 4
events × 4
react × 4
go-ethereum × 3
remix × 3