Skip to main content

All Questions

Filter by
Sorted by
Tagged with
9 votes
4 answers
26k views

How to use web3 to send money from wallet A to wallet B?

var myContract = web3.eth.contract(abi); var address = contract address; var contract_data = myContract.at(address); var sender = '0xd3aaa525c087978133abb517593ea334f16abd1f'; var receiver = '...
Anshul Basia's user avatar
6 votes
1 answer
6k views

Web3 retrieving latest transactions [duplicate]

Is there any way in the Web3 Javascript API to retrieve the latest, let's say five, transactions that were done on the blockchain? The only option I can think of, is by using web3.eth.getBlock(web3....
Nickkerd's user avatar
4 votes
1 answer
2k views

how can I get the data returned from solidity function from transaction id in web3js when a solidity function is callled?

I want to get the return data written in solidity function in web3js . I am using the web3.min.js from the truffle pet-shop package as the web3 library . Everything is working fine when calling the ...
Aniketh Saha's user avatar
3 votes
1 answer
727 views

MetaMask blocks Web3 requests

I just set up a Block Explorer to interact with my private blockchain. The private Blockchain runs in a VM. The host system connects to the Block explorer (also on VM). When I have meta mask ...
cqx's user avatar
  • 3,462
3 votes
1 answer
547 views

Difference between .sign and .signTransaction

I have this two kind of codes and I would like to know what is the difference between them: First. .sign() var tx = new Tx(rawtx); tx.sign(privateKey); Second .signTransaction() web3.eth.accounts....
sapiensapiens's user avatar
2 votes
2 answers
3k views

Can anybody Point out the Difference between Web3.eth.sendTransaction and web3.eth.signTransaction?

Do we need to sign the transaction by web3.eth.signTransaction after initiating transaction via web3.eth.sendTransaction. for example: when I do: web3.eth.sendTransaction({ from: accs[0], ...
MYANZIK shrestha's user avatar
2 votes
1 answer
3k views

Difference between `0x01` and `0x1` status code?

Sometimes when running Ganache I receive status code 0x01, sometimes 0x1. Should I treat both as successful executions?
Daniel's user avatar
  • 359
2 votes
1 answer
379 views

sendTransaction from iPhone app

How do I call sendTransaction from within an iPhone app? I was thinking of running a web to Geth proxy where the iPhone app would call the Api exposed by the proxy which in turn calls my self hosted ...
Anderson Tess's user avatar
2 votes
1 answer
1k views

How to simulate buy?

im new in web3js and i got a problem. Would be nice, if you could help me. Ive been trying to solve it myself for days... Im trying to simulate a buy transaction (after its working i will do the sell ...
jonny travalto's user avatar
2 votes
1 answer
1k views

Why do transaction receipts not include the value of Ether transferred?

I'm writing some logic to identify the currency used in an ethereum transaction, and am wondering the following: web3.eth.getTransaction returns a value field that indicates the value transferred in ...
Joël's user avatar
  • 1,720
2 votes
1 answer
373 views

Problem creating my own wallet with multiple accounts

I have a local blockchain where I have deployed a contract. I want to interact with it sending multiple responses at the same time. For this propose, I cannot use Metamask to confirm each transaction. ...
sapiensapiens's user avatar
2 votes
0 answers
329 views

What does sendSignedTransaction return?

I want to call a method in the smart contract (UpdateWeather) that goes through several steps before returning the result (an integer). I use sendSingendTransaction but I have doubts. Is the ...
EMANUEL's user avatar
  • 83
2 votes
0 answers
149 views

(UPDATED) Send signed transaction interacting with a contract [duplicate]

I have a local blockchain where I have deployed a contract. I want to interact with it sending multiple responses at the same time. For this propose, I cannot use Metamask to confirm each transaction. ...
sapiensapiens's user avatar
2 votes
0 answers
315 views

geth taking a long time to mine a block

I'm using the embark framework to deploy some smart contracts to a private Ethereum network. The problem is, the network behaves differently on separate machines, even though they're similarly spec'd -...
glowkeeper's user avatar
1 vote
2 answers
3k views

How do EOAs work and what is their interaction with smart contracts?

After reading and searching online, I still have many doubts about how EOAs work and their relationship with smart contracts. The idea behind my dapp is to allow users to make reservations. It also ...
Mario Roma's user avatar
1 vote
1 answer
77 views

Which component sends a transaction and which component subscribes to an event?

I am working on an ethereum project but I have some doubts. I have a backend that connects to the blockchain via web3.js. To connect to the blockchain I use a geth node. I understand that the sequence ...
EMANUEL's user avatar
  • 83
1 vote
1 answer
4k views

web3.eth.filter({fromBlock:0, toBlock: 'latest', address: account}) not working?

My goal here is to list all transaction from an given account, without any success yet. I wonder why I always have an empty result when I'm using this web3.eth.filter. I know there is a valid ...
FrenchieiSverige's user avatar
1 vote
2 answers
4k views

How to simulate buy / trade transactions on local without submitting them to blockchain?

I'm learning a little about blockchain and there is something i'm stucked with. I'm working with pairs from BSC network, and I'd like to get some information if the token can be bought and sold before ...
Emma's user avatar
  • 21
1 vote
1 answer
1k views

Get time when the transaction was included in your node

Is there any way to obtain the time when you have received a transaction? I would like to know when is a Smart contract included in my node. (local testnet)
sapiensapiens's user avatar
1 vote
0 answers
563 views

How can we get other transactions result like using window.web3.eth.getTransactionReceipt on our own transaction?

If I send a transaction, I can watch the result using window.web3.eth.getTransactionReceipt like this: tradeContract.methods.test(...args).send({ from: pubData.user.address, gas: gasAmount }) ....
xianshenglu's user avatar
1 vote
0 answers
174 views

Interact with a contract using Web3 Wallet

I am trying to interact with a contract without a provider as Metamask/Mist. I know that web3 has an option to create a new Wallet and I have been seeing code examples about that but all of them ...
sapiensapiens's user avatar
0 votes
1 answer
202 views

How do you get the UTXOs a transaction is spending using web3.js?

I'm unsure how to get the UTXOs that a transaction is spending. Here's what I have so far. I get transaction details from txhash web3.eth.getTransaction("...
Sammu Sundar's user avatar
0 votes
1 answer
3k views

Iterating over transactions in a private blockchain using web3.js [duplicate]

This question is similar to this one. I'm trying to iterate through all transactions in a private block chain and look for specific data sent in the 'data' fields of each transactions. Is the ...
Sebi's user avatar
  • 5,284
0 votes
1 answer
3k views

How get estimated gas before sending the transaction?

How do you get the "estimated gas" from a "swapExactETHForTokens" function? As shown in metamask (before one can accept the purchase) Binance Smart Chain (BSC) From the pancakeswap ...
luisbriyan's user avatar
0 votes
1 answer
21 views

What would web3.js respond with in this case?

I have a mapping to a struct in my contract mapping (uint=> Student) students; struct Student { bool passed; } Now I want to call a particular student with a particular ID to see if he has ...
coder123's user avatar
  • 263
0 votes
2 answers
2k views

Check when a block is mined

Is it possible to know when a block is mined? Is there any timestamp or event/subscription?
sapiensapiens's user avatar
0 votes
1 answer
41 views

Is it possible to see changes that have been made by a user on blockchain?

Is it possible to see every changes that have been made to the block chain from various accounts.In other words is it possible to see what changes have been done by a user to, say its location(a field ...
Romil jain's user avatar
0 votes
0 answers
680 views

How to get and decode logs of all transactions of a block in web3?

How to get and decode logs of all transactions of a block in web3? My question is very similar to: Is there a way to get the logs for all transactions in a block? But the suggestions were given using ...
Alison Silva's user avatar
0 votes
1 answer
194 views

Await ethereum transaction in javascript by only knowing the transaction hash

Is there a way to check if a transaction was mined/it's being mined by only knowing the transaction hash? I'm using ethers.js
Agilulfo's user avatar
0 votes
0 answers
52 views

Is it possible to schedule a transaction to execute after a certain amount of time in ethereum? [duplicate]

Is it possible to schedule a transaction to execute after a certain amount of time in ethereum? For example, I have a dapp where after two weeks I want to call a getRefund function on the smart ...
EMANUEL's user avatar
  • 83
0 votes
2 answers
343 views

Unable to send ether to account

I am trying to send ehter using this code web3.eth.accounts.wallet.add(privateKey); web3.eth.sendTransaction({ to:someAddress, from:onwer, value:amount*1, ...
Albert's user avatar
  • 39
0 votes
0 answers
41 views

Latest Block Number 0 [duplicate]

I am running geth with this command : geth --fast --cache=512 --ws --wsorigins="*" --rpc --rpccorsdomain="*" --wsapi "db,eth.subscribe,net,ssh,miner,web3,personal,admin" --datadir /media/username/...
Farhan's user avatar
  • 205