Skip to content

Commit 72726b7

Browse files
committed
chore: add account index for data-edge hardhat config
1 parent 3eb16c8 commit 72726b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/data-edge/hardhat.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ function getAccountMnemonic() {
6161
return process.env.MNEMONIC || ''
6262
}
6363

64+
function getAccountPath() {
65+
const index = process.env.ACCOUNT_INDEX ? parseInt(process.env.ACCOUNT_INDEX) : 0
66+
const hdPath = `m/44'/60'/0'/0/${index}`
67+
return hdPath
68+
}
69+
6470
function getDefaultProviderURL(network: string) {
6571
return `https://${network}.infura.io/v3/${process.env.INFURA_KEY}`
6672
}
@@ -74,6 +80,7 @@ function setupDefaultNetworkProviders(buidlerConfig) {
7480
gasPrice: netConfig.gasPrice || 'auto',
7581
accounts: {
7682
mnemonic: getAccountMnemonic(),
83+
path: getAccountPath(),
7784
},
7885
}
7986
}

0 commit comments

Comments
 (0)