-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from hollow-leaf/fix/publicClient
feat: change public client
- Loading branch information
Showing
6 changed files
with
53 additions
and
28 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,17 +1,30 @@ | ||
import { createWalletClient, createPublicClient, http } from 'viem' | ||
import { fallback, createPublicClient, http } from 'viem' | ||
import { privateKeyToAccount } from 'viem/accounts' | ||
import { goerli, sepolia } from 'viem/chains' | ||
|
||
// This is example | ||
export const account = privateKeyToAccount(`0x${process.env.NEXT_PUBLIC_PRIVATE_KEY}`) | ||
|
||
export const publicClient: any = createPublicClient({ | ||
const sepoliaProvider = [ | ||
http('https://api.zan.top/node/v1/eth/sepolia/public'), | ||
http('https://rpc.notadegen.com/eth/sepolia'), | ||
http('https://rpc-sepolia.rockx.com'), | ||
http('https://rpc.notadegen.com/eth/sepolia') | ||
] | ||
|
||
const goerliProvider = [ | ||
http('https://eth-goerli.api.onfinality.io/public'), | ||
http('https://goerli.blockpi.network/v1/rpc/public'), | ||
http('https://ethereum-goerli.publicnode.com'), | ||
http('https://api.zan.top/node/v1/eth/goerli/public') | ||
] | ||
|
||
export const sepoliaClient: any = createPublicClient({ | ||
chain: sepolia, | ||
transport: http(`https://sepolia.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_API_KEY}`) | ||
transport: fallback(sepoliaProvider) | ||
}) | ||
|
||
export const walletClient: any = createWalletClient({ | ||
account, | ||
chain: sepolia, | ||
transport: http(`https://sepolia.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_API_KEY}`) | ||
export const goerliClient: any = createPublicClient({ | ||
chain: goerli, | ||
transport: fallback(goerliProvider) | ||
}) |
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,8 +1,8 @@ | ||
{ | ||
"_format": "hh-sol-cache-2", | ||
"files": { | ||
"/Users/eric/Workspace/hackathon/hollowleaf/tobi/packages/zk-circuits/contracts/CircuitsVerifier.sol": { | ||
"lastModificationDate": 1692714895344, | ||
"/Users/cfh00890942/Workspace/hackathon/tobi/tobi/packages/zk-circuits/contracts/CircuitsVerifier.sol": { | ||
"lastModificationDate": 1692676198788, | ||
"contentHash": "a1cd466008240a0102cf704daf699062", | ||
"sourceName": "contracts/CircuitsVerifier.sol", | ||
"solcConfig": { | ||
|
@@ -37,8 +37,8 @@ | |
"Verifier" | ||
] | ||
}, | ||
"/Users/eric/Workspace/hackathon/hollowleaf/tobi/packages/zk-circuits/contracts/KamuiField.sol": { | ||
"lastModificationDate": 1692803139535, | ||
"/Users/cfh00890942/Workspace/hackathon/tobi/tobi/packages/zk-circuits/contracts/KamuiField.sol": { | ||
"lastModificationDate": 1692839634797, | ||
"contentHash": "2623c233915cd7f0088dc81ee90882fd", | ||
"sourceName": "contracts/KamuiField.sol", | ||
"solcConfig": { | ||
|
@@ -75,8 +75,8 @@ | |
"KamuiField" | ||
] | ||
}, | ||
"/Users/eric/Workspace/hackathon/hollowleaf/tobi/packages/zk-circuits/contracts/interface/ICircuitsVerifier.sol": { | ||
"lastModificationDate": 1692803131438, | ||
"/Users/cfh00890942/Workspace/hackathon/tobi/tobi/packages/zk-circuits/contracts/interface/ICircuitsVerifier.sol": { | ||
"lastModificationDate": 1692839634798, | ||
"contentHash": "8414b18f6719c8db16c5484ac9265015", | ||
"sourceName": "contracts/interface/ICircuitsVerifier.sol", | ||
"solcConfig": { | ||
|
@@ -110,8 +110,8 @@ | |
"ICircuitsVerifier" | ||
] | ||
}, | ||
"/Users/eric/Workspace/hackathon/hollowleaf/tobi/node_modules/.pnpm/@[email protected]/node_modules/@openzeppelin/contracts/access/Ownable.sol": { | ||
"lastModificationDate": 1692715035066, | ||
"/Users/cfh00890942/Workspace/hackathon/tobi/tobi/node_modules/.pnpm/@[email protected]/node_modules/@openzeppelin/contracts/access/Ownable.sol": { | ||
"lastModificationDate": 1692672501304, | ||
"contentHash": "5a20b2cad87ddb61c7a3a6af21289e28", | ||
"sourceName": "@openzeppelin/contracts/access/Ownable.sol", | ||
"solcConfig": { | ||
|
@@ -147,8 +147,8 @@ | |
"Ownable" | ||
] | ||
}, | ||
"/Users/eric/Workspace/hackathon/hollowleaf/tobi/node_modules/.pnpm/@[email protected]/node_modules/@openzeppelin/contracts/utils/Context.sol": { | ||
"lastModificationDate": 1692715035039, | ||
"/Users/cfh00890942/Workspace/hackathon/tobi/tobi/node_modules/.pnpm/@[email protected]/node_modules/@openzeppelin/contracts/utils/Context.sol": { | ||
"lastModificationDate": 1692672501254, | ||
"contentHash": "5f2c5c4b6af2dd4551027144797bc8be", | ||
"sourceName": "@openzeppelin/contracts/utils/Context.sol", | ||
"solcConfig": { | ||
|
2 changes: 1 addition & 1 deletion
2
packages/zk-circuits/scripts/address/sepolia/CircuitsVerifier.json
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 +1 @@ | ||
{"main":"0x461Cd208b91D65e2E1d5549ee5A5c6dcbCBfE1E1"} | ||
{"main":"0x950798121c8A4d647Fc156334cCF09c59F038Eb5"} |
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 +1 @@ | ||
{"main":"0xfC0A4C89D8B94ea81654DaEd99E3C40Ae51fb5d6"} | ||
{"main":"0x621cA77D5501ceD495a792988C450e1Ca639a962"} |