Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

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

When exactly do events fire

I have a web3J application that is supposed to deploy a contract (by calling a function on another contract) then listen for the contractCreatedEvent that is fired by the factoryContract and then call ...
0
votes
0answers
206 views

web3.js-1.0.0 General Availability (GA) Date ?

When will web3js 1.0.0 be General Available? i.e., web3 GA date
0
votes
1answer
714 views

Subscribing to event using web3j

I'm trying to subscribe to a smart contract event from my java app using web3j. I deployed my contract to truffle, here it is: pragma solidity ^0.4.24; contract MyContract { string message; ...
1
vote
2answers
1k views

How to get public key from private key in Web3j

I am developing Dapp by web3j and I attempt to convert private key to public key. I found this question this question that provides a way converting private key to public key in class ECKey, but I ...
0
votes
1answer
407 views

Web3j Signature and Solidity Ecrecover

I'm trying to understand how to sign a message in Java and recover the public key in a Solidity smart contract however my public keys don't seem to match. Here's my Java code to generate the ...
0
votes
1answer
51 views

ethereum javascript webpack smart contract

I'm trying to send the value from html dropdown to the smart contract, the value is extracted from the js function but I'm not able to add it to SetVote function, the execution breaks there. Html: &...
0
votes
1answer
150 views

reject transaction in metamask from code after few minutes

Can anyone tell me if it is possible to reject transaction in metamask from javascript or java code after few minutes, if user didn't submit or reject it by himself? The problem is that the user of ...
0
votes
2answers
73 views

How to prevent unwanted parties pushing data to a private chain?

For example, if a private chain genesis is distributed to a group of approved peers, however a peer makes this genesis block publicly available. How can one prevent unwanted users from joining the ...
0
votes
1answer
243 views

incorrect transaction count

I am trying to find the transaction count of an address using ethGetTransactionCount method but it's returning 0 value. What the issue over here. I'm using infura mainnet and web3j in maven /Find the ...
0
votes
1answer
326 views

Error while retrieving transaction count

I am trying to retrieve the total transaction count of an address using java, web3j and Infura as the Ethereum client. My code is as below: EthGetTransactionCount txnCount = web3j....
2
votes
0answers
384 views

JsonParseException while generating java wrapper object with web3j

so a few weeks ago I created a java wrapper object with web3j for a smart contract and was able to work with it with no problems. following exactly what I did a few weeks ago I keep getting a ...
2
votes
2answers
362 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
0
votes
1answer
295 views

Getting exception when trying get balance using web3j

I use code above to get balance using web3j: Web3j web3 = Web3j.build(new HttpService("https://ropsten.etherscan.io/address/0xAccountAddress")); EthGetBalance ethGetBalance = null; try { ...
1
vote
1answer
403 views

How to call a deployed smart contract methods from android

I deployed a smart contract into my private network using truffle framework. After deployed the contract I implemented a client interface using android from android I want to call the methods of ...
0
votes
1answer
495 views

Web3j decode function from TransactionReceipt

I'm connecting to a testnet using a Geth node running version 1.8.8-stable, and also I'm using the web3j lib version 3.4.0. I deployed a Smart Contract and also used the web3j wrapper tools to ...
0
votes
1answer
243 views

Not getting any results from Web3j querying of ERC20 token's balanceOf() function

I am trying to use Web3j to query the balanceOf() function of a standard ERC20 token as shown in the code below: try { String encodedFunction = FunctionEncoder.encode(function); ...
0
votes
4answers
956 views

web3j-android error: static interface method calls are not supported at language level 1.7

I get this error static interface method calls are not supported at language level 1.7 when having Web3j web3j = Web3j.build(new HttpService(url)); documentation here says for Android you should ...
0
votes
2answers
359 views

Web3.eth.accounts[0] never updating

I'm trying to use Web3 to access the current account I have selected on Metamask by doing web3.eth.accounts[0] in order to display it on my UI (in VueJS). However web3.eth.accounts[0] always returns ...
2
votes
1answer
43 views

Unable to print event without JSONstringify

I am trying to understand the difference among following cases while printing the event: At web3.js listenToEvent: function(){ Contract.deployed().then(function(instance){ instance....
0
votes
1answer
60 views

How to return the change to the sender?

In this answer, @pabloruiz55 provides the following code for sending ether. SmartContract.sol function transferToOwner() payable returns (bool) { //Sender should forward at least 1 ether. ...
1
vote
5answers
1k views

How to invoke functions of Smart Contract from Android phone?

I deployed a smart contract with solidity along with a GUI by Javascript and HTML. This project works well on my computer. Now I want to invoke functions of Smart Contract from Android phone. Is ...
0
votes
1answer
399 views

How to compute ethereum contract address with java?

I'm looking for the java version of the solution of this question. How is the address of an Ethereum contract computed? Actually I want have a solution of the problem below. I have a master ...
1
vote
1answer
449 views

Access Ethereum smart contract in Java application

I have developed smart contract in solidity using truffle and ganache. Now, I want to access that smart contract using some API. So how to do it ? Should I need to use web3j compulsory or is there any ...
4
votes
1answer
1k views

send() or sendAsync() while using Web3j to call functions

I built a java web application which connects using Web3j with my smart contract deployed on Ropsten Network. My web application provides a control panel to allow the user to send transactions to the ...
0
votes
1answer
193 views

How can I show on web3j a list of all the instructors added on my blockchain?

I need to show on an html a list of all the instructors that are set up on the list pragma solidity ^0.4.18; contract Owned { address owner; function Owned() public { owner = msg.sender; } ...
0
votes
1answer
224 views

How to do asynchronous callback in web3j?

My application is dealing with high speed RPC requests, so it cannot reply on synchronous blocking call to process requests. It wants web3j RPC calls to return tx hash immediately without blocking and ...
1
vote
0answers
225 views

Getting ClassCastException while creating wallet

Always getting this exception when I am creating new wallet file java.lang.ClassCastException org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey cannot be cast to org.bouncycastle.jcajce....
2
votes
1answer
249 views

Why would Ganache behave differently depending on geth, web3j, web3js and web3.py?

I have a smart contract token deployed in a Ganache instance. My dapp written with React and web3.js shows the same 10 accounts for eth.accounts as running the same command in the geth console. If I ...
0
votes
1answer
55 views

I am transfering ethereum but showing 0 value and the transaction is successful

I am using web3j method sendFunds to transfer ether deducting the fee the transaction successful but showing 0 value in etherscan Here is the link
0
votes
1answer
286 views

Web3j send ether transaction pending forever

i'm trying to send ether to a smart contract with a specified amount of gas usage, the transaction sending works fine and it propagates to the network but remains pending forever not being executed as ...
1
vote
1answer
467 views

How to get deposits confirmation

I am using Web3j and I want confirmation for deposits in user wallet. Is it possible if yes how can I do this using Web3j
0
votes
1answer
315 views

Serious problem! web3j-android EckeyPair returning Private Key length of 63 characters, not 64

So this is a pretty huge problem I've run into once before: I'm using web3j-android and I'm going through the process of generating random private keys and public keys using the ECKeyPair class Now ...
2
votes
0answers
1k views

How to integrate smart contracts with android app using web3j

I want to integrate smart contracts with the android app. I wrote a simple smart contract and I want to call that smart contract from android app. For example, in UI part of Android, I put one ...
0
votes
1answer
75 views

Invoke smart contract by address, from another contract

I'm trying out a publisher-subscriber smart contracts in ganache. Both the publisher and subscriber work independently, but when I try to invoke the subscriber from publisher through the contract ...
0
votes
1answer
544 views

Is there a “gas price oracle” method in Web3j?

I read about the Gas Price Oracle in Geth, but I need to use it outside the Geth client. Is there something similar in Web3j? If not can I call the oracle programatically somehow (in Java)?
4
votes
2answers
880 views

Ethereum remix web3 connection problem

I tried to connect to an ethereum node by using remix. It means that I am using http and not https. However, I receive same error message: Not possible to connect to the Web3 provider. Make sure the ...
1
vote
0answers
372 views

How to subscribe to future incoming ERC-20 token events?

I'm using web3j to subscribe to my ERC-20 token transfer events with transferEventObservable: humanStandardToken.transferEventObservable(DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName....
0
votes
1answer
907 views

Generating a BIP-39 compatible Ethereum wallet results in IndexOutOfBoundsException?

Trying to configure android app to use a master seed phrase instead of individual private key generation. Using the new(ish) generatebip39wallet results in an indexoutofboundsexception. Offending ...
0
votes
1answer
607 views

Webj3 erc20 specify nonce for token transfer

How do you specify a nonce when sending erc20 tokens using web3j?
1
vote
0answers
131 views

Can deploy Smart contract from Main thread but not from a class

I have a contract: pragma solidity ^0.4.0; contract qualification { address owner; /* This function is executed at initialization and sets the owner of the contract */ function qualification() { ...
1
vote
0answers
285 views

Get and Set values of Contract remotely via Web3j returns 0 and null

I have my two Quorum nodes setup on two different machines A(X.X.X.1) and B(X.X.X.3) and I am trying to interact with the smart contract from a different machine C(X.X.X.4) via Web3j. Below is the ...
0
votes
2answers
680 views

A bit confused. How do I send ether using Web3j to an address (Android)

EDIT: I am using android platform I think I'm a bit confused conceptually. I would appreciate it if someone could answer these few questions for me as I'm trying to make an app so that I can be ...
1
vote
0answers
261 views

String returned from mapping of struct array

I want to store some details from every transaction. These are the struct and the variable: struct MoneyTransfer{ address sender; string comment; uint creationTime; uint quantity; } ...
0
votes
1answer
442 views

How is it possible that Web3j is send Transaction over Infura.io?

Infura can't unlock Accounts over JSON RPC/web3.js infura FAQ. How is it possible that Web3j can send Transaction over Infura.io? Web3js uses also JSON RPC to communicate with the Blockchain. So ...
0
votes
1answer
598 views

Web3j - Transfer.sendFunds wait forever

After struggling with issue from Geth (then I decided to use Geth 1.8.2, magically it solve the problem). I found 2 approaches to send ether : The First approach are the codes following ...
0
votes
1answer
305 views

Interacting with the smart contract from Java application (We3j)

I have many questions about the workflow ( sequence ) of interacting with the smart contract from Java application, so I will first explain what I have done and then put my questions, and if something ...
1
vote
4answers
969 views

How to access ethereum smart contract(already deployed) in a Java application via its address using web3j?

I have an existing Smart contract address,abi,binary code. I need to access it from a Java application.Is it possible to do this without creating a java wrapper class?
3
votes
2answers
2k views

Web3j - sending erc20 token

I would like to ask how to correctly send ERC20 Token from a wallet to another wallet , followings are my codes : public static void main(String[] args) throws Exception { Web3j web3 = Web3j....
3
votes
1answer
3k views

web3.eth.getBalance returns me the strange values ?

i am trying to get the balance of a wallet, the method is working but the returned result is a json object - { c:(2) [484895,26495000000000],e:19, s: 1}. In which the value - 484895 corresponds to ...
1
vote
2answers
2k views

How to make transaction using private key and address using web3j

I have a private key and address . Is it possible to make transaction with these parameter using web3j.