var options = Web3Options.defaultOptions()
options.gasLimit = BigUInt(21000)
options.from = self.bip32keystore?.addresses?.first!
let amountDouble = Int((Double(amount) ?? 0.0)*pow(10, 18))
let am = BigUInt.init(amountDouble)
options.value = am
let estimatedGasResult = self.web3Rinkeby?.contract(Web3.Utils.coldWalletABI, at: toaddress)!.method(options: options)!.estimateGas(options: nil)
guard case .success(let estimatedGas)? = estimatedGasResult else {return}
options.gasLimit = estimatedGas
var intermediateSend = self.web3Rinkeby?.contract(Web3.Utils.coldWalletABI, at: toaddress, abiVersion: 2)!.method(options: options)!
intermediateSend = self.web3Rinkeby?.contract(Web3.Utils.coldWalletABI, at: toaddress, abiVersion: 2)!.method(options: options)!
let sendResult = intermediateSend?.send(password: pass)
switch sendResult {
case .success(let r)?:
print("Sucess",r)
case .failure(let err)?:
print("Eroor",err)
case .none:
print("sendResultBip32",sendResult)
}