Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
0
votes
1answer
34 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
34 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
20 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
37 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
17 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
42 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
31 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
36 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
20 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
18 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
33 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
52 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
93 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
66 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
33 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
20 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
123 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
78 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 ...
0
votes
1answer
132 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
61 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
50 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
44 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
59 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
53 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?
0
votes
0answers
271 views

how to integrate USDT erc20 token to make transfer and check balanceof?

I want to integrate USDT token to make transfer and check balance of USDT in my java with the use of web3j, how can i accomplish this? i able to create wallet and use of ethereum, but i dont know how ...
1
vote
0answers
57 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
132 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. ...
0
votes
0answers
64 views

Generated code using web3j contains errors

This is the smart contract pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; import "./sharedLib.sol"; import "./clientSC.sol"; import "./projetSC.sol"; contract ...
0
votes
0answers
31 views

How to send Extra data with smart contact transaction on geth server which data I will get after mining?

I have created smart contract in solidity using Remix IDE. I am doing smart contract transaction using geth server and it is working fine. But I want to send some keys (data) on geth server with ...
2
votes
2answers
481 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 ...
0
votes
0answers
31 views

How does remix decode a contract response without the ABI?

Remix seems to be able to decode the output of a contract to a block of JSON without having the ABI (say I just specify the contract address). How is this achieved - I'm interested in doing something ...
0
votes
0answers
47 views

web3j - getter for array of addresses

I have a contract which has a field registry which is an array of addresses, Also have a getter for this field: function getRegistry() view public returns (address[] memory){ return ...
1
vote
1answer
74 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
33 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
172 views

SocketTimeoutException timeout In Java Web3j

Im developing some test in a little project with Web3j. I have a little for that loop generating new accounts. Doing single request works fine. The issue appear when I try to make more than X ...
0
votes
0answers
29 views

Geth node from private network freezes and Web3j fails with timeout

I have a private network, and something very weird happens when I try to start the mining via RPC: the node just simply freezes. I attached using geth.ipc and even when I tried to start the miner via ...
0
votes
0answers
28 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 ...
0
votes
0answers
246 views

Why does the error Invalid response received: 403;?

Develop a java project to connect to ethereum blockchain and until now no error has been presented, but now this error appeared:   org.web3j.protocol.exceptions.ClientConnectionException: Invalid ...
1
vote
0answers
78 views

Using web3j with infura returns null

I've used web3.js to handle my contracts, and it worked very well. But web3j is pretty hard for me since the beginning. I'm using android studio, infura, web3j. Since I don't know very much about ...
0
votes
1answer
40 views

How do we communicate with contract functionality which is deployed in public test network using web3j [closed]

I would like to write a wepapp for security token contract which is deployed in public Ropsten Test Network using web3j. Need some idea. Thanks in Advance
0
votes
1answer
250 views

How to use eth_newFilter to get pending incoming transactions to a contract?

I'm trying to get pending transactions to a certain contract using Infura. Is it possible to do that using eth_newFilter? Since apparently these filters only "trigger" from contract events, does that ...
1
vote
0answers
70 views

Extra mining fees added in etherbase account

1st scenario - I have set miner.setEtherbase(eth.accounts[1]) and gasPrize is 0. 1 coin Transaction - And done transaction from 0th account to one random account. I expect 0 mining fees will add ...
2
votes
1answer
108 views

Can I send data (e.g. text) in a Transaction with Web3J?

I need to send a transaction from an account to another one via Web3J that includes not only the value field but also the data field (in particular, I need to send text). Is it possible?
0
votes
1answer
99 views

How to create a wallet file for existing account&

I found this way of creating a new ethereum account with web3j. But what if I want to create a wallet file for an already registered account? I need this because most of the web3j functions require a ...
1
vote
0answers
32 views

Trouble with personalUnlockAccount,web3j

I am creating android dapp for votings I am trying to check if user's credentials are right,so i use object of PersonalUnlockAccount class and function accountUnlocked().So the problem is that when i ...
0
votes
1answer
96 views

org.web3j.protocol.exceptions.TransactionException: Transaction receipt was not generated after 600 seconds for transaction

I am sending a transaction through this code public String transferEthByPk(String amount, String toAddress, String privateKey, Web3j web3j) { BigDecimal value = new BigDecimal(amount); ...
0
votes
0answers
23 views

Java class generated with web3j has a “deploy” method wherein initialWeiValue, initialSupply have to be both specified. Isn't it the same amount?

Method in the java class generated by web3j is like this: public static RemoteCall<Crowdfunding> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, ...
0
votes
0answers
24 views

Read contract value from Android

I have deployed successfully a smartcontract onto Rinkeby at the address : 0x69cfa9009Bf2c7a9945a4f8b381db21b26b662d7 It is a tutorial smartcontract that enables an election between 2 candidate. I ...
0
votes
0answers
161 views

Get Array from a call in Web3j

I have a solidity function that returns an array. I'm trying to read the values inside this array from web3j but it gives me stage results. My solidity function function getAllSubTokenByTokenID(...
0
votes
2answers
37 views

How to find out if a wallet (an address) contains a token from a contract using web3js?

Is this possible with and without knowing the private key of the wallet.

1
2 3 4 5
7