Skip to content

Commit

Permalink
Create BlockchainManager.java
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 25, 2024
1 parent 6307bb1 commit 2711878
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.sidra.nexus;

import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.protocol.core.methods.response.Web3ClientVersion;

public class BlockchainManager {
private Web3j web3j;

public BlockchainManager() {
web3j = Web3j.build(new HttpService("https://mainnet.infura.io/v3/YOUR_PROJECT_ID"));
}

public String getBlockNumber() {
Web3ClientVersion web3ClientVersion = web3j.web3ClientVersion().send();
return web3ClientVersion.getWeb3ClientVersion();
}

public TransactionReceipt sendTransaction(String from, String to, String value) {
// Implement transaction sending logic
return null;
}
}

0 comments on commit 2711878

Please sign in to comment.