23 lines
601 B
Nim
23 lines
601 B
Nim
import
|
|
web3/ethtypes
|
|
|
|
import
|
|
transactions, ../types/[rpc_response, transaction]
|
|
|
|
proc sendTransaction*(tx: var TransactionData, password: string, success: var bool): string =
|
|
success = true
|
|
try:
|
|
let response = transactions.sendTransaction(tx, password)
|
|
result = response.result
|
|
except RpcException as e:
|
|
success = false
|
|
result = e.msg
|
|
|
|
proc estimateGas*(tx: var TransactionData, success: var bool): string =
|
|
success = true
|
|
try:
|
|
let response = transactions.estimateGas(tx)
|
|
result = response.result
|
|
except RpcException as e:
|
|
success = false
|
|
result = e.msg |