Hello everyone !
Is there any example of how to send ether between 2 accounts on the backend using MainNet?
Is there any example of how to send ether between 2 accounts on the backend using MainNet?
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Web3Ropsten As Web3X
Private Utils As W3Utils
Private InfuraRopstenLink As String = "https://ropsten.infura.io/v3/MY_INFURA_ID"
End Sub
Public Sub Initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
B4XPages.GetManager.LogEvents = True
Root = Root1
Root.LoadLayout("MainPage")
Utils.Initialize
Web3Ropsten = Utils.BuildWeb3Infura(InfuraRopstenLink)
Dim Path As String = "D:\wallet\UTC--2022-04-18T20-06-35.daksdkas8das7da7sdha8sj2d931kj8d7agehdajd8.json"
Wait For (Utils.LoadWallet(Path, "MY_PASSWORD")) Complete (Result As W3AsyncResult)
If Result.Success Then
Dim Credentials As W3Credentials = Result.Value
Log(Credentials.Address) ' on this line show my wallet address, works fine ...
End If
' send funds dont work ;-;
Dim ToAddress As String = "0xaas8dha89dhnas8da76sgdffda6ygs69999eg"
Dim Amount As BigInteger = Utils.BigIntFromUnit("0.01", "ether")
Dim MaxPriorityFeePerGas As BigInteger = Utils.BigIntFromUnit("3", "gwei")
Dim MaxFeePerGas As BigInteger = Utils.BigIntFromUnit("200", "gwei")
Dim ChainId As Int = Utils.CHAINID_ROPSTEN
Wait For (Web3Ropsten.SendFunds(ChainId, Credentials, ToAddress, Amount, MaxPriorityFeePerGas, MaxFeePerGas)) Complete (Result As W3AsyncResult)
If Result.Success Then
Dim hash As W3TransactionHash = Result.Value
Log("Transaction sent successfully: ")
Log(hash.Hash)
Dim Timeout As Int = 300 'seconds
Wait For (Web3Ropsten.EthGetTransactionReceipt(hash, Timeout)) Complete (Result As W3AsyncResult)
If Result.Success Then
Dim tr As W3TransactionReceipt = Result.Value
If tr.Pending Then
Log("Transaction still pending")
Else
Log("Transaction completed, ok? " & tr.StatusOk)
Log(tr)
End If
Else
Log("Error getting receipt: " & Result.Error)
End If
End If
End Sub
*** mainpage: B4XPage_Appear
*** mainpage: B4XPage_Resize [mainpage]
0xdhfyr293jdh8aus929jdasak01923jdajjsldas 'my wallet
*** mainpage: B4XPage_Resize [mainpage]
*** mainpage: B4XPage_Resize [mainpage]
*** mainpage: B4XPage_Resize [mainpage]
Is not reachedIs it reached?
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Web3Ropsten As Web3X
Private Utils As W3Utils
Private InfuraRopstenLink As String = "https://ropsten.infura.io/v3/MY_INFURA_ID"
End Sub
Public Sub Initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
B4XPages.GetManager.LogEvents = True
Root = Root1
Root.LoadLayout("MainPage")
Utils.Initialize
Web3Ropsten = Utils.BuildWeb3Infura(InfuraRopstenLink)
Log("Web3Ropsten = "&Web3Ropsten)
Dim Path As String = "D:\wallet\UTC--2022-04-18T20-06-35.daksdkas8das7da7sdha8sj2d931kj8d7agehdajd8.json"
Wait For (Utils.LoadWallet(Path, "MY_PASSWORD")) Complete (Result As W3AsyncResult)
If Result.Success Then
Dim Credentials As W3Credentials = Result.Value
Log(Credentials.Address) ' on this line show my wallet address, works fine ...
End If
' send funds dont work ;-;
Dim ToAddress As String = "0xaas8dha89dhnas8da76sgdffda6ygs69999eg"
Dim Amount As BigInteger = Utils.BigIntFromUnit("0.01", "ether")
Dim MaxPriorityFeePerGas As BigInteger = Utils.BigIntFromUnit("3", "gwei")
Dim MaxFeePerGas As BigInteger = Utils.BigIntFromUnit("200", "gwei")
Dim ChainId As Int = Utils.CHAINID_ROPSTEN
Log("bp1 ") ' <<<<<<< got here, below does not run.
Wait For (Web3Ropsten.EthChainId) Complete (Resultc As W3AsyncResult)
Log("bp2 = "&Resultc)
Wait For (Web3Ropsten.SendFunds(ChainId, Credentials, ToAddress, Amount, MaxPriorityFeePerGas, MaxFeePerGas)) Complete (Result As W3AsyncResult)
Log("bp3 = "&Result)
If Result.Success Then
Dim hash As W3TransactionHash = Result.Value
Log("Transaction sent successfully: ")
Log(hash.Hash)
Dim Timeout As Int = 300 'seconds
Wait For (Web3Ropsten.EthGetTransactionReceipt(hash, Timeout)) Complete (Result As W3AsyncResult)
If Result.Success Then
Dim tr As W3TransactionReceipt = Result.Value
If tr.Pending Then
Log("Transaction still pending")
Else
Log("Transaction completed, ok? " & tr.StatusOk)
Log(tr)
End If
Else
Log("Error getting receipt: " & Result.Error)
End If
End If
End Sub
Web3Ropsten = [w3=(JsonRpc2_0Web3j) org.web3j.protocol.core.JsonRpc2_0Web3j@94949d3, mutils=[jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) [jme=(w3utils) , block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], block_earliest=EARLIEST, block_latest=LATEST
, block_pending=PENDING, units=(MyMap) {wei=wei, kwei=kwei, mwei=mwei, gwei=gwei, szabo=szabo, finney=finney, ether=ether}, signclass=(Class) class org.web3j.crypto.Sign
, numericclass=(Class) class org.web3j.utils.Numeric, hashclass=(Class) class org.web3j.crypto.Hash, keysclass=(Class) class org.web3j.crypto.Keys
, chainid_mainnet=1, chainid_ropsten=3, chainid_rinkeby=4
, chainid_goerli=5, chainid_kotti=6, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
], jme=(web3x)
, ensresolver=(EnsResolver) org.web3j.ens.EnsResolver@66a5bb64, transactionmanagers=(MyMap) {}, bc=anywheresoftware.b4a.agraham.byteconverter.ByteConverter@256161b2
, sendfundslock=false, pollingduration=10000, main=null
, b4xpages=null, b4xcollections=null, httputils2service=null
]
*** mainpage: B4XPage_Appear
*** mainpage: B4XPage_Resize [mainpage]
0x29KDSAK9DK09DKA0991K9D90190K90DA ' my wallet address
bp1
Private Sub B4XPage_Created (Root1 As B4XView)
B4XPages.GetManager.LogEvents = True
Root = Root1
Root.LoadLayout("MainPage")
Utils.Initialize
Web3Ropsten = Utils.BuildWeb3Infura(InfuraRopstenLink)
Dim credentials As W3Credentials = Utils.CreateCredentialsFromPrivateKey(Utils.BigIntFromHex(pk).ToByteArray)
Wait For (Web3Ropsten.EthChainId) Complete (Result As W3AsyncResult)
Log(Result.Value)
Wait For (Web3Ropsten.EthGetBalance(credentials.Address, Utils.BLOCK_LATEST)) Complete (Result As W3AsyncResult)
Log(Result)
End Sub
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private Web3Ropsten As Web3X
Private Utils As W3Utils
Private InfuraRopstenLink As String = "https://ropsten.infura.io/v3/your_project_id_here"
End Sub
Public Sub Initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Utils.Initialize
Web3Ropsten = Utils.BuildWeb3Infura(InfuraRopstenLink)
Wait For (Web3Ropsten.EthBlockNumber) Complete (Result As W3AsyncResult)
If Result.Success Then
Log("Current block: " & Result.Value)
End If
End Sub