-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
83 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# duplicate this file and rename to .env.local and fill in all items | ||
|
||
# Provider URI (https://... from Alchemy, Quicknode, Infura, etc) | ||
NEXT_PUBLIC_PROVIDER_URI_SEPOLIA= | ||
NEXT_PUBLIC_PROVIDER_URI_11155111= | ||
|
||
# Get your project ID from WalletConnect Cloud https://cloud.walletconnect.com/ | ||
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID= |
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
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,7 +1,8 @@ | ||
import { createPublicClient, http } from 'viem' | ||
import { sepolia } from 'viem/chains' | ||
import { CHAIN_ID, WebappSettings } from './webappSettings'; | ||
import { chainIdToViemChain } from './utils'; | ||
|
||
export const publicClient = createPublicClient({ | ||
chain: sepolia, | ||
transport: http() | ||
}) | ||
chain: chainIdToViemChain(CHAIN_ID), | ||
transport: http(WebappSettings.provider) | ||
}); |
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,13 +1,25 @@ | ||
import compiledCircuit from "../../axiom/data/compiled.json"; | ||
import inputs from "../../axiom/data/inputs.json"; | ||
import AverageBalanceAbi from "./abi/AverageBalance.json"; | ||
import { chainIdToExplorerBaseUrl, getProviderClientSide } from "./utils"; | ||
|
||
export const PROJECT_ID = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID as string; | ||
export const CHAIN_ID = "11155111"; | ||
|
||
export const WebappSettings = { | ||
compiledCircuit, | ||
inputs, | ||
provider: process.env.NEXT_PUBLIC_PROVIDER_URI_SEPOLIA as string, | ||
chainId: "11155111", | ||
provider: getProviderClientSide(CHAIN_ID), | ||
chainId: CHAIN_ID, | ||
callbackTarget: "0x50F2D5c9a4A35cb922a631019287881f56A00ED5", | ||
callbackAbi: AverageBalanceAbi, | ||
explorerBaseUrl: "https://explorer.axiom.xyz/v2/sepolia", | ||
} | ||
explorerBaseUrl: chainIdToExplorerBaseUrl(CHAIN_ID), | ||
} | ||
|
||
if (WebappSettings.provider === "") { | ||
throw new Error(`Please set the NEXT_PUBLIC_PROVIDER_URI_${CHAIN_ID} environment variable to a valid provider URI.`); | ||
} | ||
|
||
if (WebappSettings.callbackTarget === "") { | ||
throw new Error("AverageBalance contract has not yet been deployed on this chain. Deploy it first and insert the deployed contract address into the `WebappSettings.callbackTarget` variable."); | ||
} |