-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(billboard): add slack notifiers
- Loading branch information
Showing
3 changed files
with
67 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
import { createPublicClient, createWalletClient, http } from "viem"; | ||
import { polygon, polygonMumbai } from "viem/chains"; | ||
import { privateKeyToAccount } from "viem/accounts"; | ||
import { createPublicClient, createWalletClient, http } from 'viem' | ||
import { optimism, optimismSepolia, polygon, polygonMumbai } from 'viem/chains' | ||
import { privateKeyToAccount } from 'viem/accounts' | ||
|
||
export const chains = { | ||
"polygon-mainnet": polygon, | ||
"polygon-mumbai": polygonMumbai, | ||
}; | ||
'polygon-mainnet': polygon, | ||
'polygon-mumbai': polygonMumbai, | ||
'op-sepolia': optimismSepolia, | ||
'op-mainnet': optimism, | ||
} | ||
|
||
export const network = process.env.NETWORK as keyof typeof chains; | ||
export const network = process.env.NETWORK as keyof typeof chains | ||
|
||
const alchemyAPIKey = process.env.ALCHEMY_API_KEY | ||
export const rpcs: { [chain in keyof typeof chains]: string } = { | ||
'polygon-mainnet': `https://polygon-mainnet.g.alchemy.com/v2/${alchemyAPIKey}`, | ||
'polygon-mumbai': `https://polygon-mumbai.g.alchemy.com/v2/${alchemyAPIKey}`, | ||
'op-sepolia': `https://opt-sepolia.g.alchemy.com/v2/${alchemyAPIKey}`, | ||
'op-mainnet': `https://opt-mainnet.g.alchemy.com/v2/${alchemyAPIKey}`, | ||
} | ||
|
||
export const account = privateKeyToAccount( | ||
process.env.ACCOUNT_PRIVATE_KEY as `0x${string}`, | ||
); | ||
process.env.ACCOUNT_PRIVATE_KEY as `0x${string}` | ||
) | ||
|
||
export const publicClient = createPublicClient({ | ||
chain: chains[network], | ||
transport: http(process.env.ALCHEMY_API_URL), | ||
transport: http(rpcs[network]), | ||
cacheTime: 0, | ||
}); | ||
}) | ||
|
||
export const walletClient = createWalletClient({ | ||
chain: chains[network], | ||
transport: http(process.env.ALCHEMY_API_URL), | ||
transport: http(rpcs[network]), | ||
cacheTime: 0, | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters