Questions tagged [web3-java]

For the web3j java library and related Java issues

Ethereum client library for Java (web3j). Web3j provides code generation tools for Java and Android applications to deploy and interact with smart contracts on the blockchain.

Documentation: https://docs.web3j.io/latest/

Note - This is NOT for web3js, which is the JavaScript version of the Ethereum client library.

160 questions
0
votes
0 answers

How to use web3j to decode outputParameters for "string[]" return type of ABI

My smart contract has one function balanceOf, and its ABI is as following: { "constant": true, "inputs": [ { "name": "_ss", "type": "string[]" } ], "name":…
Lin Corey
  • 141
  • 11
0
votes
1 answer

How to use existing Contract using web3j in Android

First time I am using BlockChain (using web3j) in Android, I have existing smart contract's value like BINARY and ABI details like below private final String BINARY =…
Siddhpura Amit
  • 14,534
  • 16
  • 91
  • 150
0
votes
1 answer

Java 120 char ECDSA public key to 130 char or Ethereum address

I am given a 120 char ECDSA generated X509 public key by an external system. I now want to use it in Ethereum by converting it to an address. (not the real key but an example of the content (120 chars))…
skword
  • 311
  • 2
  • 11
0
votes
1 answer

Unable to fetch transaction value and senders address in java web3j 's EthBlock.transactionObject

Here is the code snippet below :- while (block_no >= 0) { List txs = web3 .ethGetBlockByNumber(DefaultBlockParameter.valueOf(BigInteger.valueOf(block_no)), true).send() …
Aniket
  • 127
  • 1
  • 11
0
votes
1 answer

Comptablity of web3J with infura

Is it possible to listen to infura events , using web3J ? I am trying to get events , but getting error Caused by: org.web3j.protocol.core.filters.FilterException: Invalid request: The method eth_newFilter does not exist/is not available at…
0
votes
1 answer

Send ERC-20 token using Web3j

What is the best way to send transaction in Ethereum with ERC-20 token and get balance of account using web3j
Ivan Black
  • 175
  • 1
  • 1
  • 7
0
votes
1 answer

How to integrate a erc20 token function, to make transfer token and check balance?

Im using java, web3j library, i am able to create wallet and integrate sendTx and balance checking function with ethereum, but i want to send erc20 token out of it, how can i accomplish it?
Lance Leroy
  • 399
  • 4
  • 7
  • 17
0
votes
1 answer

Get transaction details (amount, gas price, gas limit) from signed transaction

I have a frontend in JavaScript and a backend in Java. I let the user sign a raw transaction with his private key in the frontend with web3js. Afterwards the signed transaction is returned to the Java backend and the backend broadcasts the…
Phil
  • 595
  • 1
  • 3
  • 14
0
votes
1 answer

How do I encode an array of Byte32 values for Web3j to pass to my smart contract?

Contract function is defined as: function createAggregate (string memory key, bytes32[2] memory part_array) public returns (bytes32) and have incoming a list of parts, defined as... List elements so was trying to use: List
owlseeker
  • 43
  • 1
  • 8
0
votes
1 answer

How to get address by password or something else using web3j?

I'm using web3j for Java. I able to create new accounts for my ethereum but i don't understand how i can get the single address using password or something else.
Simone Sorgon
  • 155
  • 1
  • 14
0
votes
1 answer

Web3J to generate Java wrapper automatically

I am trying to generate the wrapper on fly using web3j and invoking a method on the generated class using reflection. But I am getting classNotFound exception on the first try. (When I stop the server and re-run, it works because the class was…
Minisha
  • 2,117
  • 2
  • 25
  • 56
0
votes
1 answer

Web3j ECKeyPair to KeyPair

I'm trying to make an ECC with the generated key using web3j. I have the ECKeyPair object, but cipher.init() requires 2nd parameter to be Key object. ECKeyPair returns BigInteger of private key and public key, how can I convert them to KeyPair which…
Tenten Ponce
  • 2,436
  • 1
  • 13
  • 40
0
votes
1 answer

How to extract data from "RemoteCall" return type function in java/kotlin?

I'm trying to read balance of an address from erc20 token contract using web3j. I've already generated java equivalent contract file. In this file, A function is returning RemoteCall type of object. Now, how to parse this output so that I can simply…
Satan
  • 3
  • 2
0
votes
1 answer

recognizing too high nonce

We have a cluster of servers which run a service. This services are broadcasting transactions from one address to many different addresses. The problem now is, that they work in parallel. This means, that they always need to know the next valid…
Phil
  • 595
  • 1
  • 3
  • 14
0
votes
1 answer

How to resolve exception when creating wallet in web3j?

C:\Users\1636820\Downloads\web3j-3.4.0\web3j-3.4.0\bin>web3j wallet create _ _____ _ _ | | |____ (_) (_) __ _____| |__ / /_ _ ___ \ /\ / / _ \ '_ \ \ \ | | | / _ \ \ V V / __/ |_)…
mani deep
  • 1
  • 1
  • 5