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

Feat/1.8.1 #66

Merged
merged 9 commits into from
Oct 9, 2023
Merged
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
2 changes: 1 addition & 1 deletion .env_example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ W3GW_SEED_PHRASE=""

# W3GW: accesory
W3GW_LOG_LEVEL=debug
W3GW_NUM_WALLETS=
W3GW_SEED_PHRASE_WALLETS=
W3GW_PROVIDER_URL=
W3GW_PROVIDER_KEY=
W3GW_PORT
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Optional environment variables:
- `INFURA_GAS_PRICE`: default gas price, if not specified by the client; or maximum gas price threshold if either estimated by the provider, or provided by the client.
- `INFURA_GAS_PRICE_FACTOR`: multiplier applied to gas prices estimated by provider.
- `W3GW_LOG_LEVEL`: max log level to be traced, can be any of the following: `error`, `warn`, `info`, `http`, `verbose`, `debug`, `silly`. If not specified, `verbose` will apply.
- `W3GW_NUM_WALLETS`: number of wallet addresses to be handled by the gateway, derived from path '`m/44'/60'/0'/0/*`'.
- `W3GW_SEED_PHRASE_WALLETS`: number of wallet addresses to be handled by the gateway, derived from path '`m/44'/60'/0'/0/*`'.

### Celo-compatible destination providers:

Expand Down Expand Up @@ -91,7 +91,7 @@ Required environment variables:
Optional environment variables:

- `W3GW_LOG_LEVEL`: max log level to be traced, can be any of the following: `error`, `warn`, `info`, `http`, `verbose`, `debug`, `silly`. If not specified, `verbose` will apply.
- `W3GW_NUM_WALLETS`: number of EVM wallet addresses to be handled by the gateway. EVM addresses will be default ones attached to respective Reef addresses. First Reef address will be derived from '`${W3GW_SEED_PHRASE}`', while the following one from '`${W3GW_SEED_PHRASE}//${j}`' (with `j > 0`).
- `W3GW_SEED_PHRASE_WALLETS`: number of EVM wallet addresses to be handled by the gateway. EVM addresses will be default ones attached to respective Reef addresses. First Reef address will be derived from '`${W3GW_SEED_PHRASE}`', while the following one from '`${W3GW_SEED_PHRASE}//${j}`' (with `j > 0`).

### Generic destination providers:

Expand All @@ -113,7 +113,7 @@ Required environment variables:
Optional environment variables:

- `W3GW_NETWORK`: the network name to connect with.
- `W3GW_NUM_WALLETS`: number of wallet addresses to be handled by the gateway, derived from path '`m/44'/60'/0'/0/*`'.
- `W3GW_SEED_PHRASE_WALLETS`: number of wallet addresses to be handled by the gateway, derived from path '`m/44'/60'/0'/0/*`'.
- `W3GW_LOG_LEVEL`: max log level to be traced, can be any of the following: `error`, `warn`, `info`, `http`, `verbose`, `debug`, `silly`. If not specified, `verbose` will apply.
- `ETHERS_ALWAYS_SYNCED`: if set to `true`, the gateway will intercept calls to `eth_syncing` as to return `false` in all cases..
- `ETHERS_ESTIMATE_GAS_LIMIT`: if set to `true`, the provider will be asked to estimate the gas limit, before signing the transaction; if the provider-estimated gas limit is greater than `ETHERS_GAS_LIMIT`, the transaction will be rejected by the gateway.
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-jsonrpc-gateway",
"version": "1.7.27",
"version": "1.8.1",
"description": "A Web3 provider that handles accounts on its own but delegates chain queries to a 3rd party service",
"main": "dist/bin/w3gw.js",
"files": [
Expand Down Expand Up @@ -42,7 +42,7 @@
"cronos:mainnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ALWAYS_SYNC=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_GAS_PRICE=5000000000000 ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=47500000 ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://cronosrpc-1.xstaking.sg 9530",
"dogechain:testnet": "cross-env-shell ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=150000000000 ETHERS_GAS_LIMIT=15000000 node dist/bin/ethers https://rpc-testnet.dogechain.dog/ 8519",
"dogechain:mainnet": "cross-env-shell ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=750000000000 ETHERS_GAS_PRICE_FACTOR=1.25 node dist/bin/ethers https://rpc01.dogechain.dog/ 9519",
"elastos:testnet": "cross-env-shell ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=50000000000 ETHERS_GAS_LIMIT=8000000 node dist/bin/ethers https://api-testnet.elastos.io/esc 8513",
"elastos:testnet": "cross-env-shell ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=175000000000 ETHERS_GAS_LIMIT=8000000 node dist/bin/ethers https://api-testnet.elastos.io/esc 8513",
"elastos:mainnet": "cross-env-shell ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=50000000000 ETHERS_GAS_LIMIT=8000000 node dist/bin/ethers https://api.elastos.io/esc 9513",
"ethereum:goerli": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_GAS_LIMIT=10000000 ETHERS_GAS_PRICE=100000000000 ETHERS_GAS_PRICE_FACTOR=1.5 node dist/bin/ethers https://eth-goerli.public.blastapi.io 8545",
"ethereum:mainnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true node dist/bin/ethers/infura 9545",
Expand All @@ -52,14 +52,14 @@
"kava:mainnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=10000000000 node dist/bin/ethers https://evm.kava.io 9526",
"kcc:testnet": "cross-env-shell ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_FORCE_EIP_155=true ETHERS_GAS_PRICE=500000000000 ETHERS_GAS_PRICE_FACTOR=1.25 ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=10000000 EVM_CALL_INTERLEAVE_BLOCKS=0 node dist/bin/ethers https://rpc-testnet.kcc.network 8537",
"kcc:mainnet": "cross-env-shell ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_FORCE_EIP_155=true ETHERS_GAS_PRICE=500000000000 ETHERS_GAS_PRICE_FACTOR=1.25 ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=10000000 node dist/bin/ethers https://rpc-mainnet.kcc.network 9537",
"klaytn:testnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_GAS_LIMIT=15000000 ETHERS_GAS_PRICE=250000000000 ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://public-node-api.klaytnapi.com/v1/baobab 8527",
"klaytn:testnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_GAS_LIMIT=15000000 ETHERS_GAS_PRICE=250000000000 ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://klaytn-baobab.blockpi.network/v1/rpc/public 8527",
"klaytn:mainnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_LIMIT=false ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_GAS_LIMIT=15000000 ETHERS_GAS_PRICE=250000000000 ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://public-node-api.klaytnapi.com/v1/cypress 9527",
"mantle:testnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=30000000 ETHERS_GAS_LIMIT_FACTOR=3.0 node dist/bin/ethers https://rpc.testnet.mantle.xyz/ 8508",
"mantle:mainnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=50000000 ETHERS_GAS_LIMIT_FACTOR=3.0 node dist/bin/ethers https://rpc.mantle.xyz/ 9508",
"meter:testnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_GAS_PRICE=5000000000000 ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=10000000 node dist/bin/ethers https://rpctest.meter.io 8523",
"meter:mainnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_GAS_PRICE=5000000000000 ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=8000000 node dist/bin/ethers https://rpc.meter.io 9523",
"metis:goerli": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=50000000 node dist/bin/ethers https://goerli.gateway.metisdevops.link 8536",
"moonbeam:moonbase": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=50000000000 ETHERS_GAS_LIMIT=8000000 ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://moonbase-alpha.public.blastapi.io 8531",
"moonbeam:moonbase": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=50000000000 ETHERS_GAS_LIMIT=15000000 ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://moonbase-alpha.public.blastapi.io 8531",
"moonbeam:moonriver": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=50000000000 ETHERS_GAS_LIMIT=14999999 ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://rpc.api.moonriver.moonbeam.network 7531",
"moonbeam:mainnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_PRICE=100000000000 ETHERS_GAS_LIMIT=14999999 ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://rpc.api.moonbeam.network 9531",
"okxchain:testnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=10000000 ETHERS_GAS_PRICE_FACTOR=1.1 node dist/bin/ethers https://exchaintestrpc.okex.org 8528",
Expand All @@ -71,7 +71,8 @@
"polygon:zkevm:mainnet": "cross-env-shell ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=15000000 ETHERS_GAS_LIMIT_FACTOR=1.1 ETHERS_GAS_PRICE=100000000000 ETHERS_GAS_PRICE_FACTOR=1.1 node dist/bin/ethers https://polygon-zkevm.drpc.org 9512",
"reef:testnet": "cross-env-shell node dist/bin/reef wss://rpc-testnet.reefscan.com/ws https://squid.subsquid.io/reef-explorer-testnet/graphql 8532",
"reef:mainnet": "cross-env-shell node dist/bin/reef wss://rpc.reefscan.info/ws https://squid.subsquid.io/reef-explorer/graphql 9532",
"scroll:goerli": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=8000000 ETHERS_GAS_PRICE_FACTOR=3.0 node dist/bin/ethers https://scroll-alphanet.public.blastapi.io 8514",
"scroll:goerli": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=8000000 ETHERS_GAS_PRICE=555000000000 ETHERS_GAS_PRICE_FACTOR=1.0 node dist/bin/ethers https://scroll-testnet.blockpi.network/v1/rpc/public 8514",
"syscoin:rollux:testnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_GAS_LIMIT=8000000 node dist/bin/ethers https://rpc-tanenbaum.rollux.com 8507",
"syscoin:testnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_FORCE_EIP_1559=true node dist/bin/ethers https://rpc.tanenbaum.io 8521",
"syscoin:mainnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_ESTIMATE_GAS_PRICE=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_FORCE_EIP_1559=true node dist/bin/ethers https://rpc.syscoin.org 9521",
"ultron:testnet": "cross-env-shell EVM_CALL_INTERLEAVE_BLOCKS=0 ETHERS_FORCE_EIP_155=true ETHERS_ESTIMATE_GAS_LIMIT=true ETHERS_MOCK_FILTERS=true node dist/bin/ethers https://ultron-dev.io 8516",
Expand Down Expand Up @@ -111,7 +112,6 @@
"yarn": "^1.22.19"
},
"dependencies": {

"cors": "2.8.5",
"cross-env": "7.0.3",
"dotenv": "^10.0.0",
Expand Down
46 changes: 27 additions & 19 deletions src/bin/ethers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ const packageData = require('../../../package.json')
// Mandatory: the actual URL of the Web3 JSON-RPC provider. Can also be passed as first parameter.
const providerUrl = process.argv[2] || process.env.W3GW_PROVIDER_URL || ''
if (providerUrl.length < 1) {
throw Error(
'No provider URL provided. Please set the `W3GW_PROVIDER_URL` environment variable.'
console.info(
'\n\x1b[1;37mError: No provider URL was specified. Please set the \x1b[33mW3GW_PROVIDER_URL\x1b[33m environment variable.\x1b[0m'
)
process.exit(0)
}

// Mandatory: Listening port for the server. Can also be passed from command-line as second parameter:
Expand All @@ -21,17 +22,31 @@ if (process.argv.length >= 4) {
} else if (process.env.W3GW_PORT) {
port = parseInt(process.env.W3GW_PORT)
} else {
throw Error(
'No listening port provided. Please set the `W3GW_PORT` environment variable.'
console.info(
'\n\x1b[1;37mError: No listening port provided. Please set the \x1b[33mW3GW_PORT\x1b[37m environment variable.\x1b[0m'
)
process.exit(0)
}

// Mandatory: The seed phrase to use for the server's own wrapped wallet, in BIP-39 mnemonics format.
const seed_phrase = process.env.W3GW_SEED_PHRASE
if (!seed_phrase) {
throw Error(
'No mnemonic phrase provided. Please set the `W3GW_SEED_PHRASE` environment variable.'
const seed_phrase = process.env.W3GW_SEED_PHRASE || ""
const private_keys = JSON.parse(process.env.W3GW_PRIVATE_KEYS || "[]")
if (
seed_phrase === ""
&& (!Array.isArray(private_keys) || private_keys.length == 0)
) {
console.info(
'\n\x1b[1;37mError: No mnemonic phrase nor private keys were provided. Please, set either the \x1b[1;33mW3GW_SEED_PHRASE\x1b[37m or the \x1b[33mW3GW_PRIVATE_KEYS\x1b[37m variables, or both.\x1b[0m'
)
process.exit(0)
}

// Optional: number of wallet addresses to be handled by the server, derived from path '`m/44'/60'/0'/0/*`'.
let seed_phrase_wallets
if (process.env.W3GW_SEED_PHRASE_WALLETS) {
seed_phrase_wallets = parseInt(process.env.W3GW_SEED_PHRASE_WALLETS)
} else {
seed_phrase_wallets = 5
}

// Optional: The network name to connect with. Can also be passed as third parameter.
Expand All @@ -55,14 +70,6 @@ if (process.env.ETHERS_GAS_LIMIT) {
gas_limit = parseInt(process.env.ETHERS_GAS_LIMIT)
}

// Optional: number of wallet addresses to be handled by the server, derived from path '`m/44'/60'/0'/0/*`'.
let num_addresses
if (process.env.W3GW_NUM_WALLETS) {
num_addresses = parseInt(process.env.W3GW_NUM_WALLETS)
} else {
num_addresses = 5
}

// Optional: if `true`, let provider estimate gas limit before signing the transaction
let estimate_gas_limit: boolean = false
if (process.env.ETHERS_ESTIMATE_GAS_LIMIT) {
Expand Down Expand Up @@ -121,7 +128,7 @@ if (process.env.ETHERS_ETH_GAS_PRICE_FACTOR) {

console.log('='.repeat(120))
console.log(
`${packageData.name} v${packageData.version} (ethers: ${packageData.devDependencies.ethers})`
`${packageData.name} v${packageData.version} (ethers: ${packageData.dependencies.ethers})`
)
console.log()

Expand All @@ -133,10 +140,11 @@ const destinationProvider = new ethers.providers.StaticJsonRpcProvider(
new WalletMiddlewareServer(
destinationProvider,
seed_phrase,
seed_phrase_wallets,
private_keys,
interleave_blocks,
gas_price,
gas_limit,
num_addresses,
gas_limit,
estimate_gas_limit,
estimate_gas_price,
always_synced,
Expand Down
39 changes: 22 additions & 17 deletions src/bin/ethers/infura.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,38 @@ if (process.argv.length >= 3) {
} else if (process.env.W3GW_PORT) {
port = parseInt(process.env.W3GW_PORT)
} else {
throw Error(
'No listening port provided. Please set the `W3GW_PORT` environment variable.'
console.info(
'\n\x1b[1;37mError: No listening port provided. Please set the \x1b[33mW3GW_PORT\x1b[37m environment variable.\x1b[0m'
)
process.exit(0)
}

// Mandatory: The network name to connect with. Can also be passed as second parameter.
// E.g.: `mainnet`, `ropsten`, `rinkeby`, `kovan` and `goerli`.
const network = process.argv[3] || process.env.W3GW_NETWORK
if (!network) {
throw Error(
'No network specified. Please set the `W3GW_NETWORK` environment variable.'
console.info(
'\n\x1b[1;37mError: No network specified. Please set the \x1b[33mW3GW_NETWORK\x1b[37m environment variable.\x1b[0m'
)
process.exit(0)
}

// Mandatory: The seed phrase to use for the server's own wrapped wallet, in BIP-39 mnemonics format.
const seed_phrase = process.env.W3GW_SEED_PHRASE
if (!seed_phrase) {
throw Error(
'No mnemonic phrase provided. Please set the `W3GW_SEED_PHRASE` environment variable.'
const seed_phrase = process.env.W3GW_SEED_PHRASE || ""
const private_keys = JSON.parse(process.env.W3GW_PRIVATE_KEYS || "")
if (!seed_phrase && !private_keys) {
console.info(
'\n\x1b[1;37mError: No mnemonic phrase nor private keys were provided. Please, set either the \x1b[1;33mW3GW_SEED_PHRASE\x1b[37m or the \x1b[33mW3GW_PRIVATE_KEYS\x1b[37m variables, or both.\x1b[0m'
)
process.exit(0)
}

// Optional: number of wallet addresses to be handled by the server, derived from path '`m/44'/60'/0'/0/*`'.
let seed_phrase_wallets
if (process.env.W3GW_SEED_PHRASE_WALLETS) {
seed_phrase_wallets = parseInt(process.env.W3GW_SEED_PHRASE_WALLETS)
} else {
seed_phrase_wallets = 5
}

// Mandatory: the Infura project ID.
Expand Down Expand Up @@ -61,14 +73,6 @@ if (process.env.INFURA_GAS_LIMIT) {
gas_limit = parseInt(process.env.INFURA_GAS_LIMIT)
}

// Optional: number of wallet addresses to be handled by the server, derived from path '`m/44'/60'/0'/0/*`'.
let num_addresses
if (process.env.W3GW_NUM_WALLETS) {
num_addresses = parseInt(process.env.W3GW_NUM_WALLETS)
} else {
num_addresses = 5
}

// Optional: gas price factor to be applied to when ETHERS_ESTIMATE_GAS_PRICE is true
let gas_price_factor = 1.0
if (process.env.INFURA_GAS_PRICE_FACTOR) {
Expand All @@ -95,10 +99,11 @@ const destinationProvider = new ethers.providers.InfuraProvider(
new WalletMiddlewareServer(
destinationProvider,
seed_phrase,
seed_phrase_wallets, // number of addresses
private_keys,
interleave_blocks,
gas_price,
gas_limit,
num_addresses, // number of addresses
true, // estimate gas limit
true, // estimate gas price
false, // always synced
Expand Down
4 changes: 2 additions & 2 deletions src/bin/reef/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ if (!seedPhrase) {

// Optional: number of wallet addresses to be handled by the server, derived from path '`m/44'/60'/0'/0/*`'.
let numAddresses
if (process.env.W3GW_NUM_WALLETS) {
numAddresses = parseInt(process.env.W3GW_NUM_WALLETS)
if (process.env.W3GW_SEED_PHRASE_WALLETS) {
numAddresses = parseInt(process.env.W3GW_SEED_PHRASE_WALLETS)
} else {
numAddresses = 1
}
Expand Down
Loading
Loading