From bc8fde02c43577b965182512e71753c87d962aa1 Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Wed, 16 Oct 2024 17:51:12 +0700 Subject: [PATCH] feat: support filecoin calibration deployment --- package.json | 2 +- pnpm-lock.yaml | 28 +++++++++++++++++++++++----- src/constants.ts | 5 +++++ src/types/client.ts | 2 +- src/utils/config.ts | 1 + 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index da7aa12..5daa965 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.9", + "@hypercerts-org/contracts": "2.0.0-alpha.10", "@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 f9d2c72..7d78558 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.9 - version: 2.0.0-alpha.9(@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.10 + version: 2.0.0-alpha.10(@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.9': - resolution: {integrity: sha512-bhYtN0hnO/MGbkyHtikMSzY5IVXFZ16FCsbonZBxglZeg0XUZHHzA7DokZkQOmFydG3MBmg5QewLCXwOHp3T7A==} + '@hypercerts-org/contracts@2.0.0-alpha.10': + resolution: {integrity: sha512-brdrWaRbB8+n+hGQQJ97HUmW82/OnN3+HGbdeJZ9X915AqJPsoQjACyOt+r2hNsTrstXjIjK2xCwM4Rjje2/mA==} '@ibm-cloud/openapi-ruleset-utilities@1.3.2': resolution: {integrity: sha512-pDZ+YTawZBAMgxfGG0JeCizh7Brmz8h4WRQaJvfJaRfgfdFmp5xZ64oqvnpJQ16XjCdNMBkTB6NJCZjQzq1gpQ==} @@ -1158,6 +1158,11 @@ packages: resolution: {integrity: sha512-IxvBBCTFDHbVoK7zIxqA1ZOdc4QfM5HM7rGleCuHi7L1wnKv5Pn69xXJQ9hgxH60ZVygH9/JG0jRgtUncE3QUA==} engines: {node: '>=16.0.0'} + '@starboardventures/hardhat-verify@1.0.1': + resolution: {integrity: sha512-/FO3wMmUSrL8PsYwuxA233+3iwLzmjI2z39MiZCgki0uJXtDELhO9YXDI9qoUR2jHxvHiBa1gKd/ZIpC9tpuKw==} + peerDependencies: + hardhat: ^2.0.0 + '@stoplight/better-ajv-errors@1.0.3': resolution: {integrity: sha512-0p9uXkuB22qGdNfy3VeEhxkU5uwvp/KrBTAbrLBURv6ilxIVwanKwjMc41lQfIVgPGcOkmLbTolfFrSsueu7zA==} engines: {node: ^12.20 || >= 14.13} @@ -3127,6 +3132,10 @@ packages: resolution: {integrity: sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==} engines: {node: 4.x || >=6.0.0} + node-fetch@2.0.0: + resolution: {integrity: sha512-bici2HCWFnAghTYMcy12WPxrEwJ5qK7GQJOTwTfyEZjyL99ECWxbYQfabZ2U1zrHMKkOBE97Z9iHIuKQfCMdzQ==} + engines: {node: 4.x || >=6.0.0} + node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -4902,8 +4911,9 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} - '@hypercerts-org/contracts@2.0.0-alpha.9(@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.10(@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: + '@starboardventures/hardhat-verify': 1.0.1(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)) '@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) transitivePeerDependencies: @@ -5506,6 +5516,12 @@ snapshots: dependencies: tslib: 2.6.3 + '@starboardventures/hardhat-verify@1.0.1(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))': + dependencies: + fs-extra: 11.2.0 + 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) + node-fetch: 2.0.0 + '@stoplight/better-ajv-errors@1.0.3(ajv@8.17.1)': dependencies: ajv: 8.17.1 @@ -7912,6 +7928,8 @@ snapshots: dependencies: http2-client: 1.3.5 + node-fetch@2.0.0: {} + node-fetch@2.7.0: dependencies: whatwg-url: 5.0.0 diff --git a/src/constants.ts b/src/constants.ts index bf08378..b1042a7 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -51,6 +51,11 @@ const DEPLOYMENTS: { [key in SupportedChainIds]: Deployment } = { addresses: deployments[421614], isTestnet: true, } as const, + 314159: { + chainId: 314159, + addresses: deployments[314159], + isTestnet: true, + } as const, }; export { ENDPOINTS, DEPLOYMENTS }; diff --git a/src/types/client.ts b/src/types/client.ts index ec792db..765f638 100644 --- a/src/types/client.ts +++ b/src/types/client.ts @@ -4,7 +4,7 @@ import { HypercertMetadata } from "./metadata"; import { ByteArray, Hex, PublicClient, WalletClient } from "viem"; import { AxiosRequestConfig } from "axios"; -export type TestChainIds = 11155111 | 84532 | 421614; +export type TestChainIds = 11155111 | 84532 | 421614 | 314159; export type ProductionChainIds = 10 | 42220 | 8453 | 42161; /** diff --git a/src/utils/config.ts b/src/utils/config.ts index b4ac2a8..e3db90e 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -19,6 +19,7 @@ import { createPublicClient, http } from "viem"; * - 8453: Base Mainnet * - 42161: Arbitrum One * - 421614: Arbitrum Sepolia + * - 314159: Filecoin Calibration * * @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.