Questions tagged [web3j]
Lightweight Java and Android library for integration with Ethereum clients
422
questions
0
votes
1
answer
24
views
How to identify pending transactions that call a specific contract function in Ethereum?
I need to monitor pending transactions in the Ethereum network to identify if any of them call a specific function in a contract. The function could be called directly by a transaction or indirectly ...
0
votes
0
answers
36
views
Having Problems with Multiple Contract Methods calls
i'm makin 3 method calls at same time in web3j like:
contract.mint(mintParams).sendAsync()
contract.mint(mintParams).sendAsync()
contract.mint(mintParams).sendAsync()
The exception thrown is ...
0
votes
0
answers
24
views
How can I create new accounts and interact with the blockchain using Ganache (or other testnets)?
I am developing an Android app with kotlin and I want to create new accounts in the blockchain. I am using Ganache as a testnet. I am creating a new Bip32ECKeyPair for every user in the app and I want ...
0
votes
0
answers
8
views
Forking project
Currently im trying to fork a project, im experiencing a alot of compilation error specifically the versions.
What I did is just downloading the contract to remix, the issue comes up with the ...
0
votes
0
answers
62
views
How to sign a UserOperation using Java and Web3j in alchemy API
I am using Java and Web3j to create code to execute a UserOperation using Alchemy's API.
In order to sign the UserOperation, the following code was created and signed, resulting in the following ...
1
vote
1
answer
99
views
Java Web3j - How to solve the error `invalid sender`?
I am web3j beginner. Now I am trying to send transaction and faced this error: invalid sender. It's related credentials, I think.
ECKeyPair keyPair = walletService.keysFromWallet(password, ...
1
vote
1
answer
471
views
backend based signature verification
I'm new in web3 and I'm trying to develop a way to authenticate users in my dapp. I'm used to using the old and safe method with email + password to do that, but recently I realised that I could use ...
1
vote
1
answer
133
views
Is web3j version 5.0.0 discontinued?
On maven's release page, web3j 5.0.0 is the highest release version for web3j, which was released in May 2020.
The most recent releases of web3j are in 4.x version series. Interestingly, the web3j ...
0
votes
1
answer
56
views
How To Withdraw From A Smart Contract
I have a smart contract with the below method:
function send(address payable _to) public payable isOwner{
(bool sent, bytes memory data) = _to.call{value: msg.value}("");...
1
vote
1
answer
565
views
How to call smart contracts in Web3j
I wrote this code in TS using web3 library:
// ABI = my deployed SmartContract as json ABI
const daiToken = new web3.eth.Contract(Abi as AbiItem[], smartContractAdress)
const smartContractFunction = ...
1
vote
1
answer
128
views
Extract complete Transaction Details of every single transaction
I am creating a Java Backend using Web3J and subscribing to replayPastAndFutureBlocksFlowable from block 1 to latest, and then all subsequent new blocks.
From this, I get all the transactions, which ...
0
votes
1
answer
129
views
Blockchain Android application
I want to create blockchain based android application. So someone please help me with which language I should code for smart contracts and all. Also tell me that can I run blockchain application in ...
1
vote
1
answer
406
views
How to get hash and signature of payload parameters using java
I want to use openSea's api, but I don't know how to get the hash and signature of this json object using java.
https://docs.opensea.io/reference/create-an-order
{
"parameters": {
"...
0
votes
1
answer
108
views
Supporting networks different than Ethereum in Web3j
I'm currently developing Java app that interacts with various networks. I searched it in docs, but without an effect. I would like to know if Web3j supports any other network besides Ethereum like BSC,...
0
votes
1
answer
386
views
Help with RPC call on Polygon Network
I've developed an app to generate random wallet addresses and PvtK using a phrase seed file.
My code will check on a list of RPC addresses to verify if some wallet have some balance. The strange is ...
1
vote
1
answer
343
views
FilterException when creating an EthFilter in web3j
I'm using web3j to create a filter to listen to events.
Specifically, I want to listen to events of a specific contract between a certain block number and now.
This is my code:
Web3j web3j = ...
...
1
vote
1
answer
167
views
MetaTransactions - MinimalForwarder and Web3j
I'm trying to sign a smart contract function with UserA and send the transaction to the Blockchain with UserB, using web3j.
I've tried with web3js and everything worked fine, following the example of ...
1
vote
2
answers
460
views
indexing all Ethereum fullnode data in a relational database
I want to develop a web app like etherscan.
I realized I have to extract and index all datas in a relational database.
I have chosen Posturesql.
All Datas I want to save are:
block
uncle
transaction ...
0
votes
2
answers
55
views
what is the best technique to encrypt any document before storing (uploading) on IPFS?
I want to encrypt document before uploading to IPFS and enable more than user to decrypt it and note that the number of users may increase or decrease in any time?
0
votes
1
answer
302
views
How to get hash of transaction **before** it has been mined in web3j?
I have been working on my project where I use web3j. I work with ledger over contract wrappers where the actual call to the ledger is encapsulated over variety of layers.
The issue is I need to get a ...
0
votes
1
answer
65
views
Web3j fails to deploy simple Vyper Contract to Ganache
I have a simple hello world contract, compiled with Vyper. I use Web3j CLI to make a Java wrapper class from the contract's abi and bin files. When I deploy it, I get a stack underflow error.
I know ...
1
vote
3
answers
126
views
How to get all transactons of a specific address?
I am trying to retrieve all transactions for a particular address at once.
My current approach is to collect all transactions of all blocks in MySQL DB and issue a query like "SELECT * FROM table ...
2
votes
0
answers
163
views
Filter events with multiple allowed topic values
I'm building a contract listener. I am only interested in 1 particular contract, let's say at address 0x123...789.
final EthFilter filter = new EthFilter(DefaultBlockParameterName.LATEST, null, "...
1
vote
1
answer
114
views
Adding topics to EthFilter throws an invalid argument length error
I am attempting to create an EthFilter which will listen for events from a specific contract
final EthFilter filter = new EthFilter(DefaultBlockParameterName.LATEST, null, "0x123...789");
I ...
0
votes
1
answer
906
views
Where are the transactions in the genesis block?
When I query the genesis block I get this:
AttributeDict({'difficulty': 17179869184, 'extraData': HexBytes('0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa'), 'gasLimit': 5000, '...
1
vote
0
answers
61
views
org.web3j.protocol.exceptions.TransactionException: {"stack":"TXRejectedError: Exceeds block gas limit
I'm trying to communicate with my deployed contract using web3j. First I should let you know that I have 0 experience in web3j, I'm using it for the first time.
Goal: I wanted to simply call that ...
-1
votes
1
answer
37
views
Is it possible for the polygon to have different nodes have different data?
I use the eth_log to get the event of nft contract on polygon, and if found that some token id data lost. But when i rescan it after some hours , the event data is full.
so i doubt that is it possible ...
1
vote
0
answers
2k
views
web3j - Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
I am trying to create java wrappers for smart contracts, but my web3j installation is not working correctly. If I try to create a new web3j project using web3j new I get following error message:
...
1
vote
0
answers
430
views
Get the transaction list from an address using Web3j
I'm trying to fetch all transaction list using WEB3J (JAVA).
I know I can get it from Etherscan or Bscscan, but the request is limited to the free plan, (which is just 5 calls per second)
I need to ...
0
votes
1
answer
158
views
Web3j listen event from a contract
I want to listen to event Sync from a contract.
In javascript, I managed like this (this is to understand better what I want):
const contract = new web3.eth.Contract(abi, contractAddress);
const ...
1
vote
1
answer
130
views
How to stop watching events (web3j)
I am using the following code to listen/watch contract events(web3j):
Event TRANSFER_EVENT = new Event("Transfer", Arrays.<TypeReference<?>>asList(new TypeReference<Address>...
0
votes
0
answers
149
views
java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value
My contract is already deployed on BSC testnet.
val web3j = Web3j.build(HttpService("https://data-seed-prebsc-1-s1.binance.org:8545/"))
val keyPair = ECKeyPair.create(BigInteger("1234&...
1
vote
0
answers
64
views
java.lang.RuntimeException: Error processing transaction request: transaction underpriced
My contact is already deployed.
Then I am trying to call ERC20 Approve method like
val greeting: Future<TransactionReceipt> = greeterErc20.approve(BuildConfig.CONTRACT_ADDRESS_10COLOR, amt)....
1
vote
0
answers
286
views
Web3j listening to events with struct as parameter
I've tried to listen my contract event, that contains struct as parameter in my solidity contract:
contract ExampleNFT is ERC721URIStorage, Ownable{
using Counters for Counters.Counter;
Counters....
0
votes
1
answer
397
views
How to fix "Unsupported type encountered: tuple" when trying to create smart contract wrapper
I am trying to create Java Wrappers from a Smart Contract, but I always get this error message when trying to create the Java wrappers.
Unsupported type encountered: tuple
I use web3j for generating ...
0
votes
1
answer
161
views
Change ganache Owner Account in WEB3J from account[0] to account[1]or account[2]
I'm looking for a way to change owner of the smart contracts in java web3j as we do in web3 javascript using from:
//using account for transaction in javascript
await contract.function(param1, param2, ...
2
votes
0
answers
299
views
Keccak256 hashing of types and values in Java
I'm trying to use the Web3j library (or any other library for that matter) to Keccak256-hash a list of types and a list of values to sign a quote. Specifically, I need to implement the second code ...
3
votes
1
answer
70
views
Problem publishing ethereum transaction after signing
I am trying to publish ethereum raw transaction after signing, with proper gas fees, and chainID.
Unexpectedly, some signatures are published but some others fail to publish with error Invalid Sender. ...
0
votes
1
answer
176
views
java.util.concurrent.ExecutionException: org.web3j.tx.exceptions.ContractCallException: Unable to convert response
I'm having some trouble with web3j and calling getter functions for structs in java.
As per the title, whenever I call the function in web3j, e.g.:
Metadata _metadata = complianceContract....
0
votes
1
answer
304
views
Call a solidity function which accepts a struct type using Web3J
We are trying to use web3j for encoding the parameters for calling the solidity functions which are deployed in the private ethereum network. Call is done using JSON-RPC.
We are able to encode the ...
5
votes
1
answer
604
views
web3j is not generating struct inside my solidity contract
I have a struct Question in my smart contract. After generating the java wrapper class of my smart contract using web3j, Inside the wrapper class Question is not recognized, looks like web3j is not ...
0
votes
0
answers
94
views
counter value is always 0 in web3j
I've checked the following getCounter() method in Remix, it's doing what its supposed to do.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
struct User{
uint counter;
bool ...
4
votes
2
answers
1k
views
How do i read the value returned by a method in my smart contract in web3j
I'm following a tutorial in which the instructor is calling contract.getConuter().send this returns the value of the counter on smart-contract but in my case, it's returning TranscriptReciept object.
...
0
votes
1
answer
471
views
how to decode a hex string query from ether chain? web3.hexToString is not work
000000200000000000000000000000000000000000000000000000007c73b258cd46ecc90000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000023020033f77feefa7cb2b
...
0
votes
1
answer
361
views
Can I read ERC-20 token address from token Symbol?
I am able to read token's details directly from the token address using web3py library, however, I want to achieve the vice-versa where I can read the token's address just from the token symbol using ...
0
votes
1
answer
50
views
Unable to deploy smartcontract using web3j and Rinkbey infura
I'm trying to deploy a smartcontract on Rinkbey. I've followed the official documentation and some tutorials. I implemented the following code in my android studio but contract.deploy returns nothing.
...
0
votes
1
answer
518
views
Why does web3j and javascript keccak256 return different hashes if '0x' is at the start of the string?
We are trying to build a merkle tree in web3j and put the root for verification into the smart contract. Due to this problem we can't generate the same route between web3j and solidity/js...
In ...
1
vote
1
answer
556
views
How to find a pancake pair creation date using web3 library?
For eg, in the PancakePair of CAKE/WBNB, the creator's address and transaction hash of the contact creation (which contains the timestamp of the pair's creation) can be found on the top right of this ...
1
vote
1
answer
335
views
insufficient funds for gas * price + value in ropsten network with web3j (java)
I have a wallet in metamask in ropsten test network, and I try to send a transaction to another wallet in metamask ropsten network, using Web3j library with java.
First, I build a httpServer with ...
2
votes
1
answer
667
views
Why does Web3j listen to events every 15 seconds?
I use web3j in my Java application. In the smart contract, an event is defined.
event sendEvent(string name);
I subscribed to that event in my app.
contract.sendEventEventFlowable(filter)
....