diff --git a/.github/workflows/dryrun-release-ci-sdk.yml b/.github/workflows/dryrun-release-ci-sdk.yml new file mode 100644 index 0000000..4d7ea10 --- /dev/null +++ b/.github/workflows/dryrun-release-ci-sdk.yml @@ -0,0 +1,88 @@ +name: Build and release - staging + +on: + pull_request: + +jobs: + build-and-test: + name: Build and test + runs-on: ubuntu-latest + environment: test + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Run tests + run: pnpm test + + semantic-release: + needs: build-and-test + if: "!contains(github.event.head_commit.message, '[skip ci]')" + + name: Semantic Release + runs-on: ubuntu-latest + environment: staging + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Prepare prerelease semantic + if: github.ref != 'refs/heads/main' + run: mv .releaserc.prerelease.yaml .releaserc.yaml + + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v4 + id: semantic # Need an `id` for output variables + with: + dry_run: true + extra_plugins: | + @semantic-release/commit-analyzer + @semantic-release/release-notes-generator + @semantic-release/changelog + @semantic-release/github + @semantic-release/npm + env: + GITHUB_TOKEN: ${{ secrets.GH_PA_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Do something when a new release published + if: steps.semantic.outputs.new_release_published == 'true' + run: | + echo ${{ steps.semantic.outputs.new_release_version }} + echo ${{ steps.semantic.outputs.new_release_major_version }} + echo ${{ steps.semantic.outputs.new_release_minor_version }} + echo ${{ steps.semantic.outputs.new_release_patch_version }} \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs index d9fa4b0..158f6de 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -4,8 +4,8 @@ import tseslint from "typescript-eslint"; export default [ - {files: ["**/*.{js,mjs,cjs,ts}"]}, - {languageOptions: { globals: {...globals.browser, ...globals.node} }}, + { files: ["**/*.{js,mjs,cjs,ts}"] }, + { languageOptions: { globals: { ...globals.browser, ...globals.node } } }, pluginJs.configs.recommended, ...tseslint.configs.recommended, ]; \ No newline at end of file diff --git a/package.json b/package.json index 5c5cf71..909146b 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ ], "dependencies": { "@graphql-typed-document-node/core": "^3.2.0", - "@hypercerts-org/contracts": "2.0.0-alpha.7", + "@hypercerts-org/contracts": "2.0.0-alpha.8", "@openzeppelin/merkle-tree": "^1.0.7", "@swc/core": "^1.6.3", "ajv": "^8.11.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed88ba5..91d9ac2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^3.2.0 version: 3.2.0(graphql@16.9.0) '@hypercerts-org/contracts': - specifier: 2.0.0-alpha.7 - version: 2.0.0-alpha.7(@nomicfoundation/hardhat-ethers@3.0.6(ethers@5.7.2)(hardhat@2.22.8(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5)))(@swc/core@1.7.10)(@types/node@20.14.15)(ethers@5.7.2)(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5) + specifier: 2.0.0-alpha.8 + version: 2.0.0-alpha.8(@nomicfoundation/hardhat-ethers@3.0.6(ethers@5.7.2)(hardhat@2.22.8(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5)))(@swc/core@1.7.10)(@types/node@20.14.15)(ethers@5.7.2)(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5) '@openzeppelin/merkle-tree': specifier: ^1.0.7 version: 1.0.7 @@ -693,8 +693,8 @@ packages: resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} engines: {node: '>=18.18'} - '@hypercerts-org/contracts@2.0.0-alpha.7': - resolution: {integrity: sha512-rnITsv1vcRsVtJxYCaHWXT9xk+5xjRRub1hJ9XqOrs0+HAvZTwBzTsoNWjjUlrW37loYHGxm5pRD+omFfeBbsw==} + '@hypercerts-org/contracts@2.0.0-alpha.8': + resolution: {integrity: sha512-ZOZ2ByLeoc2rkvSAivyF/cZE6NYSUNYLE4oDgNHN+J/ONmxTCJCBYi92EDh+efnM/KFwsksdsIcA3TLw86bigA==} '@ibm-cloud/openapi-ruleset-utilities@1.3.2': resolution: {integrity: sha512-pDZ+YTawZBAMgxfGG0JeCizh7Brmz8h4WRQaJvfJaRfgfdFmp5xZ64oqvnpJQ16XjCdNMBkTB6NJCZjQzq1gpQ==} @@ -4902,7 +4902,7 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} - '@hypercerts-org/contracts@2.0.0-alpha.7(@nomicfoundation/hardhat-ethers@3.0.6(ethers@5.7.2)(hardhat@2.22.8(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5)))(@swc/core@1.7.10)(@types/node@20.14.15)(ethers@5.7.2)(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5)': + '@hypercerts-org/contracts@2.0.0-alpha.8(@nomicfoundation/hardhat-ethers@3.0.6(ethers@5.7.2)(hardhat@2.22.8(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5)))(@swc/core@1.7.10)(@types/node@20.14.15)(ethers@5.7.2)(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5)': dependencies: '@tenderly/hardhat-tenderly': 2.3.0(@nomicfoundation/hardhat-ethers@3.0.6(ethers@5.7.2)(hardhat@2.22.8(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5)))(@swc/core@1.7.10)(@types/node@20.14.15)(ethers@5.7.2)(hardhat@2.22.8(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5)) hardhat: 2.22.8(ts-node@10.9.2(@swc/core@1.7.10)(@types/node@20.14.15)(typescript@5.4.5))(typescript@5.4.5) diff --git a/src/constants.ts b/src/constants.ts index 7ffc6c2..bf08378 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -41,6 +41,11 @@ const DEPLOYMENTS: { [key in SupportedChainIds]: Deployment } = { addresses: deployments[84532], isTestnet: true, } as const, + 42161: { + chainId: 42161, + addresses: deployments[42161], + isTestnet: false, + } as const, 421614: { chainId: 421614, addresses: deployments[421614], diff --git a/src/types/client.ts b/src/types/client.ts index 7b25abc..ec792db 100644 --- a/src/types/client.ts +++ b/src/types/client.ts @@ -5,7 +5,7 @@ import { ByteArray, Hex, PublicClient, WalletClient } from "viem"; import { AxiosRequestConfig } from "axios"; export type TestChainIds = 11155111 | 84532 | 421614; -export type ProductionChainIds = 10 | 42220 | 8453; +export type ProductionChainIds = 10 | 42220 | 8453 | 42161; /** * Enum to verify the supported chainIds diff --git a/src/utils/config.ts b/src/utils/config.ts index 3db836b..b4ac2a8 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -17,7 +17,8 @@ import { createPublicClient, http } from "viem"; * - 11155111: Sepolia * - 84532: Base Sepolia * - 8453: Base Mainnet - * - 421613: Arbitrum Sepolia + * - 42161: Arbitrum One + * - 421614: Arbitrum Sepolia * * @param config - An object containing any configuration values to override. This should be a partial HypercertClientConfig object. * @returns The final configuration object for the Hypercert client. @@ -39,6 +40,7 @@ export const getConfig = ( }; const chainId = _config.walletClient?.chain?.id; + // eslint-disable-next-line @typescript-eslint/no-unused-vars const writeAbleChainIds = Object.entries(_config.deployments).map(([_, deployment]) => deployment.chainId); if (!_config.walletClient) { @@ -73,6 +75,7 @@ export const getConfig = ( */ export const getDeploymentsForEnvironment = (environment: Environment) => { const deployments = Object.fromEntries( + // eslint-disable-next-line @typescript-eslint/no-unused-vars Object.entries(DEPLOYMENTS).filter(([_, deployment]) => { if (deployment.isTestnet && environment === "test") { return deployment; @@ -105,6 +108,7 @@ export const getDeploymentsForChainId = (chainId: SupportedChainIds) => { logger.info("Indexer", "getDeploymentsForChainId", { chainId }); const deployments = Object.fromEntries( + // eslint-disable-next-line @typescript-eslint/no-unused-vars Object.entries(DEPLOYMENTS).filter(([_, deployment]) => { if (deployment.chainId === chainId) { return deployment;