Hi there, did anyone encounter:
A problem was found with the configuration of task ':npmInstall' (type 'NpmInstallTask').
No value has been specified for property 'packageJsonFile'.
The web3j
gradle plugin uses old node
and solidity
gradle plugins, that are only compatible with gradle version 5.x and not 6.x or even 7.x. If you want to be able to use it with at least version 6.x you need to specifically apply newer version of these plugins: node 3.1.1 and solidity 0.3.2
id "org.web3j" version '4.8.8'
id "com.github.node-gradle.node" version '3.1.1'
id "org.web3j.solidity" version '0.3.2'
TransactionReceipt receipt = Transfer.sendFundsEIP1559(
web3j, credentials,
toAddress, //toAddress
BigDecimal.valueOf(1), //value
Convert.Unit.ETHER, //unit
BigInteger.valueOf(8_000_000),
DefaultGasProvider.GAS_LIMIT, //maxPriorityFeePerGas (max fee per gas transaction willing to give to miners)
BigInteger.valueOf(3_100_000_000L) //maxFeePerGas (max fee transaction willing to pay)
).send();
System.out.println(receipt.isStatusOK());
System.out.println(receipt.getTransactionHash());
here is my code , and it doesnot work , it just keep running and not response
`const getHistoryTransactionFromWeb3 = async (
transactionHash: string
) => {
let newAmount;
await web3.eth.getTransactionReceipt(transactionHash, (err, result) => {
newAmount = Number(result.logs[1].data);
});
return newAmount;
};`
Whats the web3j equivalent to this web3js function
web3j-maven-plugin
is going out? I need a fix that available on master at the moment, but it's not released yet, I'd like to avoid forking the repo.
<plugins>
<plugin>
<groupId>org.web3j</groupId>
<artifactId>web3j-maven-plugin</artifactId>
<version>4.8.7</version>
<configuration>
<packageName>mypackage.poc</packageName>
<sourceDestination>src/main/java/generated</sourceDestination>
<nativeJavaType>true</nativeJavaType>
<outputFormat>java,bin</outputFormat>
<soliditySourceFiles>
<directory>src/main/resources</directory>
<includes>
<include>**/*.sol</include>
</includes>
</soliditySourceFiles>
<abiSourceFiles>
<directory>src/main/resources</directory>
<includes>
<include>**/*.json</include>
</includes>
</abiSourceFiles>
<outputDirectory>
<java>src/java/generated</java>
<bin>src/bin/generated</bin>
<abi>src/abi/generated</abi>
</outputDirectory>
<contract>
<includes>
<include>greeter</include>
</includes>
<excludes>
<exclude>mortal</exclude>
</excludes>
</contract>
<pathPrefixes>
<pathPrefix>dep=../dependencies</pathPrefix>
</pathPrefixes>
</configuration>
</plugin>
</plugins>
val contract = Contract.deploy(web3j, Credentials.create(Keys.createEcKeyPair()), DefaultGasProvider(), "Name", "Symbol").send()
java.lang.IllegalStateException: worldState.get(Address.f…String(w3jAddress.value)) must not be null
Hi, with web3j, I'm trying to decode binary data of a simple tuple like (uint256,string)
. Although I can encode like
final Type uint256Type = TypeDecoder.instantiateType("uint256", 12345);
final Type stringType = TypeDecoder.instantiateType("string", "foo");
final DynamicStruct dynamicStruct = new DynamicStruct(List.of(uint256Type, stringType));
final String encoded = TypeEncoder.encode(dynamicStruct);
I cannot decode the data back. Is there a way to decode a tuple without generating classes, etc.