Skip to content

Commit 1bea260

Browse files
committed
feat(lib): utils.getEvmNetworkId
1 parent bb6bd90 commit 1bea260

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@witnet/solidity",
3-
"version": "3.0.12",
3+
"version": "3.0.13",
44
"description": "Wit/Oracle Solidity Framework for EVM-compatible chains",
55
"author": "Witnet Foundation <info@witnet.foundation>",
66
"license": "MIT",
@@ -81,6 +81,8 @@
8181
"fmt!": "pnpm run fmt!:js && pnpm run fmt!:sol",
8282
"fmt": "pnpm run fmt:js && pnpm run fmt:sol",
8383
"deploy": "npx truffle migrate --config ./truffle-config.cjs",
84+
"ops:wrb:acls": "npx truffle migrate --config ./truffle-config.cjs --migrations_directory ./migrations/ops/wrb/acls --compile-none --network",
85+
"ops:curator": "npx truffle migrate --config ./truffle-config.cjs --migrations_directory ./migrations/ops/wrb/curator --compile-none --network",
8486
"postinstall": "node ./scripts/postinstall.cjs",
8587
"prepare": "npx truffle compile --all --config ./truffle-config.cjs && npx hardhat compile --no-tests --force && npm run build && node ./scripts/prepare.cjs",
8688
"verify": "npx hardhat run ./scripts/verify.js 2>&1",

src/lib/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ export function getEvmNetworkByChainId(chainId: number): string | undefined {
221221
else return undefined
222222
}
223223

224+
export function getEvmNetworkId(network: string): number | undefined {
225+
const found = Object.entries(helpers.supportedNetworks()).find(
226+
([key]: [string, any]) => key.toLowerCase() === network.toLowerCase(),
227+
)
228+
if (found) return (found[1] as any)?.network_id;
229+
else return undefined;
230+
}
231+
224232
export function getEvmNetworkSymbol(network: string): string {
225233
const found = Object.entries(helpers.supportedNetworks()).find(
226234
([key]: [string, any]) => key.toLowerCase() === network.toLowerCase(),

0 commit comments

Comments
 (0)