Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add contracts-periphery to contracts-ts #6298

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/contracts-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@eth-optimism/contracts-bedrock": "workspace:0.15.0",
"@eth-optimism/contracts-bedrock": "workspace:*",
"@eth-optimism/contracts-periphery": "workspace:*",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react-hooks": "^8.0.1",
"@types/glob": "^8.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-ts/src/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by @wagmi/cli@1.3.0 on 7/17/2023 at 7:40:03 PM
// Generated by @wagmi/cli@1.3.0 on 7/17/2023 at 7:42:03 PM
import {
getContract,
GetContractArgs,
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-ts/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by @wagmi/cli@1.3.0 on 7/17/2023 at 7:40:02 PM
// Generated by @wagmi/cli@1.3.0 on 7/17/2023 at 7:42:02 PM

/* eslint-disable */

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-ts/src/react.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated by @wagmi/cli@1.3.0 on 7/17/2023 at 7:40:03 PM
// Generated by @wagmi/cli@1.3.0 on 7/17/2023 at 7:42:04 PM
import {
useNetwork,
useContractRead,
Expand Down
13 changes: 9 additions & 4 deletions packages/contracts-ts/wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ if (!glob.sync('node_modules/*').length) {
)
}

const deployments = {
const bedrockDeployments = {
[1]: glob.sync(
`node_modules/@eth-optimism/contracts-bedrock/deployments/${chains[1]}/*.json`
),
Expand All @@ -152,12 +152,17 @@ const deployments = {
`node_modules/@eth-optimism/contracts-bedrock/deployments/${chains[420]}/*.json`
),
}

Object.entries(deployments).forEach(([chain, deploymentFiles]) => {
Object.entries(bedrockDeployments).forEach(([chain, deploymentFiles]) => {
if (deploymentFiles.length === 0) {
throw new Error(`No deployments found for ${chains[chain]}`)
throw new Error(`No bedrock deployments found for ${chains[chain]}`)
}
})
const deployments = {
[1]: bedrockDeployments[1],
[10]: bedrockDeployments[10],
[5]: bedrockDeployments[5],
[420]: bedrockDeployments[420],
}

const getWagmiContracts = (deploymentFiles: string[]) =>
deploymentFiles.map((artifactPath) => {
Expand Down
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.