status-lib/status/eth/eth.nim

23 lines
601 B
Nim
Raw Normal View History

2021-09-08 18:05:39 +00:00
import
web3/ethtypes
import
transactions, ../types/[rpc_response, transaction]
2021-09-08 18:05:39 +00:00
2021-09-10 17:27:49 +00:00
proc sendTransaction*(tx: var TransactionData, password: string, success: var bool): string =
2021-09-08 18:05:39 +00:00
success = true
try:
let response = transactions.sendTransaction(tx, password)
result = response.result
except RpcException as e:
success = false
result = e.msg
2021-09-10 17:27:49 +00:00
proc estimateGas*(tx: var TransactionData, success: var bool): string =
2021-09-08 18:05:39 +00:00
success = true
try:
let response = transactions.estimateGas(tx)
result = response.result
except RpcException as e:
success = false
result = e.msg