Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

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

Listen to latest event emitted by smart contract with web3j API in JAVA

I'm having a smart contract: pragma solidity ^0.4.21; contract NodeServie{ event triggerEvent(address indexed _sender, string randomStr); function callEventFunc(string str) public{ ...
0
votes
1answer
23 views

Revert error on delegated transfer function

Here is my code base, first I am deploying the tokenPS contract on the tesnet which generates an addr(0xaddr) and then I am deploying the caller contract. In caller contract when I am trying to ...
1
vote
1answer
26 views

How to subscribe to transaction with a smart contract in web3js?

I am trying to write a web3js code. I have already written it using web3j (java) and now i want to do exactly same thing but using web3js. I have seen documentation and stuff, but i am not able to ...
1
vote
1answer
105 views

How to get contract object using ABI json and address with web3j?

I worked with web3js(JavaScript) and used web3.eth.Contract with 2 params (json, address) and successfully got contract object. Now I started to work with web3j(Java) and don`t understand how I have ...
0
votes
1answer
51 views

Attempting to transfer erc20 token, but keep encountering insufficient funds for gas * price + value

I'm attempting to transfer an erc20 token, but keep running into insufficiant funds for gas * price + value, regardles of how much eth I have, I also have an estimate function which returns a value ...
0
votes
1answer
21 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
24 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
36 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
42 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
26 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
33 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
59 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
40 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
27 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
25 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
61 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
21 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
56 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
21 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
22 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
82 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
37 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
194 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
45 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
32 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
81 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
29 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
174 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
68 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
66 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
28 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
25 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
70 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
176 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
189 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
188 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
29 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
236 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
128 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
428 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
79 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
93 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
58 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
73 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
81 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
63 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
249 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. ...

1
2 3 4 5
7