Skip to main content

Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
0 votes
0 answers
22 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 ...
Nacho's user avatar
  • 1
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 ...
Accountforeth's user avatar
0 votes
0 answers
53 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 ...
Ken Yurino's user avatar
1 vote
1 answer
64 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, ...
Pavlo Posternak's user avatar
1 vote
1 answer
354 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 ...
whoami's user avatar
  • 13
1 vote
1 answer
97 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 ...
Kevin's user avatar
  • 75
0 votes
1 answer
49 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}("");...
amelongo's user avatar
1 vote
1 answer
392 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 = ...
Paweł Krupski's user avatar
1 vote
1 answer
91 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 ...
Gladiator9120's user avatar
0 votes
0 answers
24 views

Why web3j wallet address is different than hardhat network address which receives tokens

I am just playing with web3j and hardhat I use web3j to generate wallet . This wallet has some address - let's call it A When I'm testing and I receive token in hardhat and check with getTransaction ...
Ivaylo Tonev's user avatar
0 votes
1 answer
109 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 ...
tikker's user avatar
  • 5
1 vote
1 answer
303 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": { "...
yuta O's user avatar
  • 11
0 votes
1 answer
101 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,...
NET_BOT's user avatar
0 votes
1 answer
342 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 ...
Magno C's user avatar
  • 345
1 vote
1 answer
290 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 = ... ...
Michael's user avatar
  • 235
1 vote
1 answer
153 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 ...
SG87's user avatar
  • 11
1 vote
2 answers
402 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 ...
Shahab's user avatar
  • 11
0 votes
2 answers
50 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?
laravel Developer's user avatar
0 votes
1 answer
272 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 ...
Gleichmut's user avatar
  • 472
0 votes
1 answer
59 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 ...
devdanke's user avatar
  • 174
1 vote
3 answers
116 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 ...
Pierogi's user avatar
  • 203
2 votes
0 answers
148 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, "...
lizardev's user avatar
1 vote
1 answer
96 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 ...
lizardev's user avatar
0 votes
1 answer
798 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, '...
helpme's user avatar
  • 77
1 vote
0 answers
60 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 ...
Maifee Ul Asad's user avatar
-1 votes
1 answer
33 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 ...
1234's user avatar
  • 1
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: ...
Lukas's user avatar
  • 113
1 vote
0 answers
388 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 ...
ronaldoguedess's user avatar
0 votes
0 answers
141 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 ...
KunLun's user avatar
  • 197
1 vote
1 answer
122 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>...
Jeff's user avatar
  • 11
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&...
Pavya's user avatar
  • 111
1 vote
0 answers
63 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)....
Pavya's user avatar
  • 111
1 vote
0 answers
273 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....
Maksim's user avatar
  • 11
0 votes
1 answer
361 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 ...
Lukas's user avatar
  • 113
0 votes
1 answer
155 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, ...
Mustakim Mullick's user avatar
2 votes
0 answers
283 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 ...
Hopscotch's user avatar
3 votes
1 answer
68 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. ...
MJay's user avatar
  • 140
0 votes
1 answer
168 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....
Zi Hang's user avatar
  • 26
0 votes
1 answer
288 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 ...
Ashishkel's user avatar
  • 105
5 votes
1 answer
564 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 ...
Shoaib Kakal's user avatar
0 votes
0 answers
85 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 ...
Shoaib Kakal's user avatar
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. ...
Shoaib Kakal's user avatar
0 votes
1 answer
456 views

how to decode a hex string query from ether chain? web3.hexToString is not work

000000200000000000000000000000000000000000000000000000007c73b258cd46ecc90000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000023020033f77feefa7cb2b ...
hilion c's user avatar
0 votes
1 answer
342 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 ...
Somdip Dey's user avatar
0 votes
1 answer
48 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. ...
Shoaib Kakal's user avatar
0 votes
1 answer
476 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 ...
Neil Collier's user avatar
1 vote
1 answer
534 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 ...
DEEPAK S.V.'s user avatar
1 vote
1 answer
321 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 ...
Mohamadamin's user avatar
2 votes
1 answer
628 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) ....
js developer's user avatar
1 vote
3 answers
1k views

How to load smart contract with web3j [duplicate]

In the documentation of web3j (https://docs.web3j.io/4.8.7/smart_contracts/interacting_with_smart_contract/) it has only the example of calling the contract after deploying. Is there any function in ...
yk.'s user avatar
  • 11

1
2 3 4 5
9