Skip to content

Commit 3904a93

Browse files
Update README.md
Updated Doc
1 parent d4e6441 commit 3904a93

File tree

1 file changed

+18
-27
lines changed

1 file changed

+18
-27
lines changed

README.md

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -220,53 +220,44 @@ return
220220
wethioKeystoreManager = manager
221221
guard let urlStr = URL(string: "Your rpc url here") else { return }
222222
guard let kManager = yourKeystoreManager else { return }
223-
/*
224-
Create Web3Provider Instance with key manager
225-
*/
223+
224+
//Create Web3Provider Instance with key manager
226225
web3ProvideInstance = Web3HttpProvider(urlStr, keystoreManager: kManager)
227226
guard let wProvier = self.web3ProvideInstance else {return}
228227
self.web3Instance = Web3(provider: wProvier) //Set provide instance with web3
229228
guard let wInstance = self.web3Instance else {return}
230229
self.receiverAddressString = self.walletAddressTF.text //get receiver address string
231230
print("Receiver address is : ", self.receiverAddressString ?? " ")
232231
self.etheriumAccountAddress = self.wethioKeystoreManager?.addresses.first?.address //get sender address in string
233-
/*
234-
convert address string into etherium addresss
235-
*/
232+
233+
234+
//convert address string into etherium addresss
236235
let senderEthAddress = EthereumAddress(self.etheriumAccountAddress ?? "")
237236
DispatchQueue.global(qos: .background).async {
238237
do {
239-
/*
240-
Convert receiver address in to etherium address
241-
*/
238+
//Convert receiver address in to etherium address
242239
let toaddress = EthereumAddress(self.receiverAddressString ?? "")
243-
/*
244-
Create web3 options
245-
*/
240+
241+
//Create web3 options
246242
var options = Web3Options.defaultOptions()
247-
/*
248-
Convert amount into BIGINT
249-
*/
243+
244+
//Convert amount into BIGINT
250245
let amountDouble = BigInt((Double(yourCoin) ?? 0.1)*pow(10, 18))
251-
/*
252-
Here i am using 0.1 as an default value please use validation for amount (coin or token)
253-
*/
246+
247+
//Here i am using 0.1 as an default value please use validation for amount (coin or token)
254248
print("Total amount in double value : ", amountDouble)
255-
/*
256-
Convert amount in BIG UI iNt
257-
*/
249+
250+
//Convert amount in BIG UI iNt
258251
var amount = BigUInt.init(amountDouble)
259-
/*
260-
get gas price
261-
*/
252+
253+
//get gas price
262254
let estimateGasPrice = try wInstance.eth.getGasPrice()
263255
guard let eGasReult = self.estimatedGasResult else {
264256
print("Unable to find gas price")
265257
return
266258
}
267-
/*
268-
Get nonce
269-
*/
259+
260+
//Get nonce
270261
let nonce = try wInstance.eth.getTransactionCount(address: senderEthAddress)
271262
print("Is the Transaction count", nonce)
272263
let fee = estimateGasPrice * eGasReult

0 commit comments

Comments
 (0)