Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve undefined gasPrice #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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