Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Use current chainIds
Browse files Browse the repository at this point in the history
  • Loading branch information
boredland committed Oct 28, 2024
1 parent 91d64be commit 863766d
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 18 deletions.
4 changes: 2 additions & 2 deletions dist/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -23679,7 +23679,7 @@ var ChainId = {
gnosis: gnosis.id,
zkEVM: polygonZkEvm.id,
celo: celo.id,
zkSync: zksync.id
zksync: zksync.id
};

// src/lib.ts
Expand Down Expand Up @@ -23747,7 +23747,7 @@ var networkEnv = {
[ChainId.gnosis]: "RPC_GNOSIS",
[ChainId.polygon]: "RPC_POLYGON",
[ChainId.fantom]: "RPC_FANTOM",
[ChainId.zkSync]: "RPC_ZKSYNC",
[ChainId.zksync]: "RPC_ZKSYNC",
[ChainId.metis]: "RPC_METIS",
[ChainId.base]: "RPC_BASE",
[ChainId.arbitrum_one]: "RPC_ARBITRUM",
Expand Down
4 changes: 2 additions & 2 deletions dist/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23684,7 +23684,7 @@ var ChainId = {
gnosis: gnosis.id,
zkEVM: polygonZkEvm.id,
celo: celo.id,
zkSync: zksync.id
zksync: zksync.id
};

// src/lib.ts
Expand Down Expand Up @@ -23752,7 +23752,7 @@ var networkEnv = {
[ChainId.gnosis]: "RPC_GNOSIS",
[ChainId.polygon]: "RPC_POLYGON",
[ChainId.fantom]: "RPC_FANTOM",
[ChainId.zkSync]: "RPC_ZKSYNC",
[ChainId.zksync]: "RPC_ZKSYNC",
[ChainId.metis]: "RPC_METIS",
[ChainId.base]: "RPC_BASE",
[ChainId.arbitrum_one]: "RPC_ARBITRUM",
Expand Down
31 changes: 30 additions & 1 deletion dist/lib.d.mts
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
declare const ChainId: {
readonly mainnet: 1;
readonly goerli: 5;
readonly polygon: 137;
readonly mumbai: 80001;
readonly avalanche: 43114;
readonly fuji: 43113;
readonly arbitrum_one: 42161;
readonly arbitrum_goerli: 421613;
readonly arbitrum_sepolia: 421614;
readonly fantom: 250;
readonly fantom_testnet: 4002;
readonly optimism: 10;
readonly optimism_sepolia: 11155420;
readonly optimism_goerli: 420;
readonly harmony: 1666600000;
readonly sepolia: 11155111;
readonly scroll: 534352;
readonly scroll_sepolia: 534351;
readonly metis: 1088;
readonly base: 8453;
readonly base_sepolia: 84532;
readonly bnb: 56;
readonly gnosis: 100;
readonly zkEVM: 1101;
readonly celo: 42220;
readonly zksync: 324;
};

declare const networkEnv: {
readonly 1: "RPC_MAINNET";
readonly 10: "RPC_OPTIMISM";
Expand All @@ -23,4 +52,4 @@ declare const supportedChainIds: (keyof typeof networkEnv)[];
*/
declare const getRPCUrl: (chainId: keyof typeof networkEnv, alchemyKey?: string) => string | undefined;

export { getRPCUrl, networkEnv, supportedChainIds };
export { ChainId, getRPCUrl, networkEnv, supportedChainIds };
31 changes: 30 additions & 1 deletion dist/lib.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
declare const ChainId: {
readonly mainnet: 1;
readonly goerli: 5;
readonly polygon: 137;
readonly mumbai: 80001;
readonly avalanche: 43114;
readonly fuji: 43113;
readonly arbitrum_one: 42161;
readonly arbitrum_goerli: 421613;
readonly arbitrum_sepolia: 421614;
readonly fantom: 250;
readonly fantom_testnet: 4002;
readonly optimism: 10;
readonly optimism_sepolia: 11155420;
readonly optimism_goerli: 420;
readonly harmony: 1666600000;
readonly sepolia: 11155111;
readonly scroll: 534352;
readonly scroll_sepolia: 534351;
readonly metis: 1088;
readonly base: 8453;
readonly base_sepolia: 84532;
readonly bnb: 56;
readonly gnosis: 100;
readonly zkEVM: 1101;
readonly celo: 42220;
readonly zksync: 324;
};

declare const networkEnv: {
readonly 1: "RPC_MAINNET";
readonly 10: "RPC_OPTIMISM";
Expand All @@ -23,4 +52,4 @@ declare const supportedChainIds: (keyof typeof networkEnv)[];
*/
declare const getRPCUrl: (chainId: keyof typeof networkEnv, alchemyKey?: string) => string | undefined;

export { getRPCUrl, networkEnv, supportedChainIds };
export { ChainId, getRPCUrl, networkEnv, supportedChainIds };
6 changes: 4 additions & 2 deletions dist/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ var init_sha256 = __esm({
// src/lib.ts
var lib_exports = {};
__export(lib_exports, {
ChainId: () => ChainId,
getRPCUrl: () => getRPCUrl,
networkEnv: () => networkEnv,
supportedChainIds: () => supportedChainIds
Expand Down Expand Up @@ -3848,7 +3849,7 @@ var ChainId = {
gnosis: gnosis.id,
zkEVM: polygonZkEvm.id,
celo: celo.id,
zkSync: zksync.id
zksync: zksync.id
};

// src/lib.ts
Expand Down Expand Up @@ -3916,7 +3917,7 @@ var networkEnv = {
[ChainId.gnosis]: "RPC_GNOSIS",
[ChainId.polygon]: "RPC_POLYGON",
[ChainId.fantom]: "RPC_FANTOM",
[ChainId.zkSync]: "RPC_ZKSYNC",
[ChainId.zksync]: "RPC_ZKSYNC",
[ChainId.metis]: "RPC_METIS",
[ChainId.base]: "RPC_BASE",
[ChainId.arbitrum_one]: "RPC_ARBITRUM",
Expand All @@ -3936,6 +3937,7 @@ var getRPCUrl = (chainId, alchemyKey) => {
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ChainId,
getRPCUrl,
networkEnv,
supportedChainIds
Expand Down
5 changes: 3 additions & 2 deletions dist/lib.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3822,7 +3822,7 @@ var ChainId = {
gnosis: gnosis.id,
zkEVM: polygonZkEvm.id,
celo: celo.id,
zkSync: zksync.id
zksync: zksync.id
};

// src/lib.ts
Expand Down Expand Up @@ -3890,7 +3890,7 @@ var networkEnv = {
[ChainId.gnosis]: "RPC_GNOSIS",
[ChainId.polygon]: "RPC_POLYGON",
[ChainId.fantom]: "RPC_FANTOM",
[ChainId.zkSync]: "RPC_ZKSYNC",
[ChainId.zksync]: "RPC_ZKSYNC",
[ChainId.metis]: "RPC_METIS",
[ChainId.base]: "RPC_BASE",
[ChainId.arbitrum_one]: "RPC_ARBITRUM",
Expand All @@ -3909,6 +3909,7 @@ var getRPCUrl = (chainId, alchemyKey) => {
}
};
export {
ChainId,
getRPCUrl,
networkEnv,
supportedChainIds
Expand Down
10 changes: 5 additions & 5 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pre-commit:
parallel: true
commands:
format:
glob: "*.{ts,json,md}"
run: npm run format
stage_fixed: true
build:
glob: "*.{ts,package-lock.json}"
run: npm run build
run: npm run build && git add dist/*
# yes we're actually committing the build output, because github actions works like that
stage_fixed: true
format:
glob: "*.{ts,json,md}"
run: npm run format
stage_fixed: true
4 changes: 2 additions & 2 deletions src/chainIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
scroll,
scrollSepolia,
sepolia,
zkSync,
zksync,
} from "viem/chains";

export const ChainId = {
Expand Down Expand Up @@ -53,5 +53,5 @@ export const ChainId = {
gnosis: gnosis.id,
zkEVM: polygonZkEvm.id,
celo: celo.id,
zkSync: zkSync.id,
zksync: zksync.id,
} as const;
4 changes: 3 additions & 1 deletion src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const networkEnv = {
[ChainId.gnosis]: "RPC_GNOSIS",
[ChainId.polygon]: "RPC_POLYGON",
[ChainId.fantom]: "RPC_FANTOM",
[ChainId.zkSync]: "RPC_ZKSYNC",
[ChainId.zksync]: "RPC_ZKSYNC",
[ChainId.metis]: "RPC_METIS",
[ChainId.base]: "RPC_BASE",
[ChainId.arbitrum_one]: "RPC_ARBITRUM",
Expand Down Expand Up @@ -106,3 +106,5 @@ export const getRPCUrl = (
return `https://${alchemyNetworks[chainId]}.g.alchemy.com/v2/${alchemyKey}`;
}
};

export { ChainId };

0 comments on commit 863766d

Please sign in to comment.