Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 59 additions & 40 deletions providers/velas2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions providers/velas2.ls
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,10 @@ export create-transaction = ({ network, account, recipient, amount, amount-fee,
to-wei = -> it `times` dec
to-eth = -> it `div` dec
value = to-wei amount
buffer = {}
err, gas-price <- calc-gas-price { fee-type, network, gas-price }
return cb err if err?
buffer.gas-price = gas-price
err, address <- to-eth-address account.address
return cb err if err?
err, balance <- make-query network, \eth_getBalance , [ address, \latest ]
Expand All @@ -282,6 +284,7 @@ export create-transaction = ({ network, account, recipient, amount, amount-fee,
err, networkId <- make-query network, \net_version , []
return cb err if err?
common = Common.forCustomChain 'mainnet', { networkId }
gas-price = buffer.gas-price
if fee-type is \custom
gas-price = (amount-fee `times` dec) `div` gas-estimate
tx-obj = {
Expand Down