mirror of
https://github.com/status-im/status-lib.git
synced 2025-01-12 21:44:57 +00:00
23 lines
604 B
Nim
23 lines
604 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 |