Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Work with USDT from web3j

How can I work with USDT tokens from web3j? I have node from https://www.ethernodes.org/nodes
0
votes
1answer
15 views

How to reliably send transaction via web3j while connection is poor?

I use Transfer.sendFunds(Web3j, Credentials, BigDecimal, Convert.Unit) to transfer money. Usually I convert it to flowable. Flowable/RemoteCall completes when transaction is included in block (...
0
votes
1answer
14 views

What is the equivalent of “buildTransaction” of web3Py in web3JS?

I'm using Node to interact with my smart contract. I understand that I need to first sign my transaction before sending it. In one of the StackExchange answers I see that it can be done using ...
0
votes
1answer
26 views

web3j - Java - Resolve ENS Name to Contract Address

I am trying to Resolve my ENS Name to the corresponding Contract Address. But so far I get the error org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract I am using ...
1
vote
0answers
38 views

How can I calculate gas price and gas limit programmatically using web3j [duplicate]

I am using following code to deploy my smart contract but now my transaction is taking too much time to mine on my private blockchain. String contractAddress = myContract.deploy(web3j, credentials, ...
1
vote
1answer
24 views

transaction receipt was not generated after 600 seconds for transaction

I am running private ethereum blockchain using geth and I am using web3j to send transactions. Since yesterday I am not able to deploy my contract, In my java console I am getting "transaction ...
0
votes
0answers
24 views

Web3j 5.0.0 and event listener

I'm using Web3j 5.0.0. I would listen to events of a smart contract. So, I write this.getContract().tokenMintedEventFlowable(DefaultBlockParameterName.EARLIEST, ...
0
votes
0answers
34 views

Filter Not Found Exception Thrown randomly with TransactionFlowable

Web3J version - 5.0.0 Geth version - 1.9.14 -Stable Ubuntu 18.04 - 64-bit 32GB RAM 1.9 TB HDD Geth fully synced and running JDK - 1.8 Spring - 1.5 I have two subscription ...
0
votes
0answers
17 views

How to access event log data using web3j

In my smart contract, I have defined following event: event logDomainFilter(uint128 indexed _campaignId, uint128 indexed _flightId, uint128 indexed _siteId, string _siteName, string _whiteListDomains,...
0
votes
0answers
17 views

web3j version 4.5.16 is not generating payable function properly

I am using web3j 4.5.16 version to generate my wrapper. For a payable function it is generating the following. // With out input argument to enter weiValue public RemoteFunctionCall<...
0
votes
0answers
21 views

How to filter an indexed event parameter using web3j?

I am planning to use ethereum logs as a data storage on my private blockchain. I have defined event in my contract like this: event logDomainFilter(uint128 indexed _campaignId, uint128 indexed ...
0
votes
0answers
13 views

Return parameters is not getting translated to java using web3j cli

When using newest version of solidity compiler "pragma" solidity ^0.6.9 The program compilation is successful. I'm just using this code Contract Counter{ unit public Variable_name; ...
0
votes
0answers
11 views

org.web3j 4.5.18 ethGetBalance get stuck

I'm using the following simple code in order to obtain the wallet balance: Credentials credentials = Credentials.create(privateKey); web3.ethGetBalance(credentials.getAddress(), ...
0
votes
1answer
30 views

Deploying a smart contract using transaction manager in web3j

I am new to web3j and smart contract deployment. Consider a scenario where a user is too scared to give his wallet credential file or username/password or private key in a piece of code(the code is ...
1
vote
0answers
16 views

Simple way to balance web3j connections between nodes

Context: I have a client that can connect to 3 local-network nodes to distribute query-loads and be more resilient to network/software issues. I have managed to create a -simple- watch-dog with a ...
1
vote
0answers
40 views

Transaction receipt was not generated after 600 seconds for contract transaction

I use SimpleMultiSig to generate java code with web3j. When I call the execute() function after 600s throw the error org.web3j.protocol.exceptions.TransactionException: Transaction receipt was not ...
0
votes
0answers
18 views

Convert X509 ECDSA public key into Ehtereum Address

I have been given an X509 ECDSA public key that I want to use to assosicate data with. However, when I use Base64.getDecoder().decode(X509PublicKey) I end up with 88 bytes. What do I do to ...
1
vote
0answers
21 views

Not able to fetch custom token after mint from Infura

I am using web3j library with an Infura Websocket connection. I set up a subscribe method where I listen to transfer events of my custom ERC20 Token. When a transfer event occurs on the blockchain I ...
1
vote
1answer
54 views

org.web3j.abi.datatypes.Utf8String cannot be cast to java.lang.String

I have a problem when get string value from smart contact: pragma solidity >=0.4.22 <0.7.0; pragma experimental ABIEncoderV2; contract Election { // Model a Candidate struct Candidate {...
0
votes
0answers
26 views

TransactionException: Transaction has failed with status: 0x0. Gas used: 50434. (not-enough gas?)

I’m new to ethereum and have small experiance with write contracts (in solidity). I think I have a very simple question but is very hard for me. I wrote a contract to manage erc20 tokens. Most ...
1
vote
1answer
112 views

Web3 hex conversion - Reading Events Output

Using the following code in Nodejs - Web3 to catch event from Solidity Smart Contract: const cron = require("node-cron"); const Web3 = require("web3"); const ABISimpleStorage = require("./build/...
0
votes
0answers
39 views

Web3j and Ganache stack underflow error

I'm experiencing the error "Error processing transaction request: VM Exception while processing transaction: stack underflow" basically with any contract. I'm using Ganache v2.1.2 and Web3j 4.5.15. ...
0
votes
0answers
29 views

App freezes when using any Web3j sendAsync function

I'm developing an app using Web3j and Java Kotlin in Android Studio. However, I'm not sure why anytime I call a web3j function with sendAsync the app freezes. if(preferences.applicationPreferences....
0
votes
1answer
67 views

Not able to add 'replayPastTransactionsFlowable' transaction logs result into an collection List object using Web3j java?

I'm trying to create an api where i have to provide transaction logs in json objects but im unable to add result of replayPastTransactionsFlowable into an collection object @GetMapping("/test") ...
0
votes
0answers
22 views

Reading all ERC20 token balances

I am aware that the ERC20 balance is easily obtained in web3js by calling token.methods.balanceOf(ADDRESS); However, I was wondering if there are any new developments or API that can now be used ...
0
votes
0answers
128 views

How to get Ethereum transaction list by address in java web3j quickly?

Im trying to fetch transaction logs from ganache using web3j library to send it as an api ,is there any way where i can get all transactions from ganache quickly? @GetMapping("/test") public List&...
0
votes
1answer
49 views

How to use gas price for faster transaction in erc20 transafer event?

I'm trying to provide a customised gas price for faster transaction ,how can achieve that ? Web3j web3 = Web3j.build(new HttpService("http://")); ERC20 javaToken = ERC20.load(contractAddress,...
0
votes
0answers
55 views

Invalid response received: 404; 404 page not found on Infura

Since I changed my version of web3j from 4.5.11 to 4.5.14 all of my http requests to Infura lead to Invalid response received: 404; 404 page not found response. I saw that they upgraded okHttp in ...
0
votes
0answers
25 views

Contract is not deploying properly on Geth private network using web3j SDK

I am new to Ethereum. I have created private blockchain using Geth on my local and trying to deploy my smart contract using java web3j SDK. I am able to deploy my contract using java and getting ...
0
votes
0answers
22 views

call array params in web3j

I want to call contract method like this: function airdrop(address source, address[] dests, uint[] values) how can i sendTransaction in web3j by java? i sign like this: Function function = new ...
1
vote
0answers
51 views

Not able to decode the input data from transaction using web3j (Java)

I am creating transactions using web3j and passing some private data in that transaction. The transaction is also getting mined . I have subscribed to the mined blocks, where I am fetching the ...
1
vote
1answer
127 views

How to decode InputValue of ethereum using java web3j

**I'm trying to decode the inputValue of an transaction using web3j without using any contract abi and wrapper class,Im loading the contract using its contract address ,is there any way/inbuilt ...
1
vote
1answer
148 views

raw transactions to send ERC20 token fails on private network(POA)

I am trying to transfer ERC20 tokens on private ethereum network(POA) Transaction flow: raw tx object creation on backend. { "gasLimit": 37000, "gasPrice": 4000000000, "...
1
vote
2answers
143 views

Unable to invoke smart contract function from Web3j contract wrapper

I've been learning about interacting with smart contracts through Android and the Web3j framework but have run into an issue. I'm trying to mint an ERC721 token and send it to an address but it doesn'...
1
vote
1answer
41 views

how can i fetch all the tokens from ethereum network to my wallet ?using web3js(nodejs) or web3j(java)?

I'm trying to fetch all the available tokens from ethereum network into my android wallet but could not able to find an suitable solution other than web scrapping
0
votes
0answers
28 views

Web3J Java Android SendAsync Error

I am trying to interact with a method in my smart contract. The method is a simple method where you send a string value to a global variable. I end up using a SendAsync which appears to initially work,...
0
votes
1answer
212 views

Installing Web3 stuck on fetchMetadata: sill resolveWithNewModule http-https@1.0

I am trying to install web3 for ethereum but it keeps sticking on this fetchMetadata
0
votes
1answer
99 views

Not able to generate java wrapper class from solidity smart contract using truffle

I'm trying to generate java wrapper class of solidity smart contract using truffle but not getting wrapperclass.java file Here is an command which i've used to generate abi/Json of that contract ...
1
vote
1answer
308 views

How estimate GAS from a contract call with Web3j

I'm trying to estimate gas cost of a contract call, i need to send a string to a contract, but i need to see if i overtook the GAS limit. I'm trying like this: Transaction t = Transaction....
1
vote
1answer
73 views

Unable to load smart contract using web3j on android

What I'my trying to do is to load already deployed smart contract and interact with it. The problem is that after my credentials are being created properly, the error is being catched but the message ...
0
votes
1answer
79 views

Listen to Ethereum transactions

I need to listen ethereum transactions for current count of addresses using web3j. I know that I can use subscribe to get transactions, but how can I add some filter to listen a certain number of ...
1
vote
0answers
53 views

Web3J - how to perform two identical transactions in a row?

I have a contract being an ERC-20 token. I want to perform two idendical transfers (sender, receiver and amounts are the same). I am using the contract objects from Web3j: MyToken token = MyToken....
0
votes
0answers
71 views

Send ERC-20 token using Web3j

What is the best way to get balance and send ERC-20 token using web3j?
1
vote
1answer
71 views

How to get events on android with infura?

I am developing an app on Android, but Web3j does not support events on infura ( Should I use Infura with Web3j for Event filter? ) . What are the options, I did not find any alternative library?
1
vote
0answers
61 views

How to achieve inheritance support using web3j wrapper?

I have two types of smart contracts. One parent contract to store the type and other child contracts which inherits the parent contract. The problem is, I can't generate java wrapper class (...
0
votes
1answer
212 views

How to use web3j to check the balance of an ERC20 custom Token and transfer the token to another wallet?

I'm studying to create wallets using infura, web3j, and android studio. I am using ropsten testnet. I have been able to check the amount of ethereum in my wallet and send ethereum to another account. ...
2
votes
2answers
781 views

How to create a RawTransaction for contract interaction Web3j

I want to sign a transaction that calls a smart contract function and send it to the Rinkeby network. I found on Web3j documentation the RawTransaction class that supports the methods for the ...
1
vote
1answer
87 views

getWeb3ClientVersion() returns null

I'm trying to create an android Dapp by using the web3j library. I'm using connection to a local private Ethereum blockchain. When I'm trying to display the Client version it returns null. This is the ...
1
vote
1answer
41 views

Using contract to create Child contracts (web3j Java wrapper)

I have a simple Parent contract that creates child contracts and stores their address. contract Parent { address[] public registry; function createChild () public { address newChild =...
0
votes
0answers
35 views

JVM waits for some timeout every time when I load a Smart Contract using Web3j In Java

Initially I had a problem with the Web3j object, but after explicitly calling its shutdown method everything works fine (JVM quits immediately, so my application closes). The problem occurs when I ...

1
2 3 4 5
7