diff --git a/.gitignore b/.gitignore index 11e7c183..0033ce5f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ node_modules/ dist/ archives/ data/ + +*.tsbuildinfo \ No newline at end of file diff --git a/examples/basic-esm/package.json b/examples/basic-esm/package.json new file mode 100644 index 00000000..a40a12c4 --- /dev/null +++ b/examples/basic-esm/package.json @@ -0,0 +1,13 @@ +{ + "name": "basic-esm", + "private": true, + "type": "module", + "version": "0.0.1", + "scripts": { + "start": "node src/index.js" + }, + "dependencies": { + "@ensdomains/ensjs": "workspace:*", + "viem": "^1.2.9" + } +} diff --git a/examples/basic-esm/src/index.js b/examples/basic-esm/src/index.js new file mode 100644 index 00000000..57f919a0 --- /dev/null +++ b/examples/basic-esm/src/index.js @@ -0,0 +1,30 @@ +import { createEnsPublicClient } from '@ensdomains/ensjs' +import { getAddressRecord, getTextRecord } from '@ensdomains/ensjs/public' +import { http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createEnsPublicClient({ + chain: mainnet, + transport: http('https://web3.ens.domains/v1/mainnet'), +}) + +const main = async () => { + const records = await client.getSubgraphRecords({ name: 'ens.eth' }) + const recordData = await client.getRecords({ + name: 'ens.eth', + records: { + abi: true, + contentHash: true, + ...(records || {}), + }, + }) + console.log(recordData) + + const batchData = await client.ensBatch( + getTextRecord.batch({ name: 'ens.eth', key: 'com.twitter' }), + getAddressRecord.batch({ name: 'ens.eth', coin: 'ETH' }), + ) + console.log(batchData) +} + +main() diff --git a/packages/examples/package.json b/examples/basic-tsnode-esm/package.json similarity index 73% rename from packages/examples/package.json rename to examples/basic-tsnode-esm/package.json index 20392867..603a1b21 100644 --- a/packages/examples/package.json +++ b/examples/basic-tsnode-esm/package.json @@ -1,9 +1,10 @@ { - "name": "ensjs-examples", + "name": "basic-tsnode-esm", "private": true, + "type": "module", "version": "0.0.1", "scripts": { - "start": "ts-node --esm --experimentalSpecifierResolution node src/index.ts" + "start": "ts-node-esm src/index.ts" }, "dependencies": { "@ensdomains/ensjs": "workspace:*", diff --git a/packages/examples/src/index.ts b/examples/basic-tsnode-esm/src/index.ts similarity index 83% rename from packages/examples/src/index.ts rename to examples/basic-tsnode-esm/src/index.ts index 40c2b552..57f919a0 100644 --- a/packages/examples/src/index.ts +++ b/examples/basic-tsnode-esm/src/index.ts @@ -1,8 +1,5 @@ -import { - createEnsPublicClient, - getAddressRecord, - getTextRecord, -} from '@ensdomains/ensjs' +import { createEnsPublicClient } from '@ensdomains/ensjs' +import { getAddressRecord, getTextRecord } from '@ensdomains/ensjs/public' import { http } from 'viem' import { mainnet } from 'viem/chains' diff --git a/examples/basic-tsnode-esm/tsconfig.json b/examples/basic-tsnode-esm/tsconfig.json new file mode 100644 index 00000000..992788fc --- /dev/null +++ b/examples/basic-tsnode-esm/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "ts-node": { + "compilerOptions": { + "target": "es2020", + "esModuleInterop": true + } + }, + "include": ["src/**/*.ts"] +} diff --git a/package.json b/package.json index 3fc12306..bf78786b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "eslint-plugin-prettier": "^4.0.0", "prettier": "^2.8.8", "ts-node": "^10.7.0", - "typescript": "^5.0.4" + "typescript": "^5.1.6" }, "resolutions": { "@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.13" diff --git a/packages/ensjs/deploy/00_deploy_bulk_renewal.ts b/packages/ensjs/deploy/00_deploy_bulk_renewal.cjs similarity index 80% rename from packages/ensjs/deploy/00_deploy_bulk_renewal.ts rename to packages/ensjs/deploy/00_deploy_bulk_renewal.cjs index 724e2d00..12cdf07f 100644 --- a/packages/ensjs/deploy/00_deploy_bulk_renewal.ts +++ b/packages/ensjs/deploy/00_deploy_bulk_renewal.cjs @@ -1,23 +1,24 @@ /* eslint-disable import/no-extraneous-dependencies */ - -import { Interface } from 'ethers/lib/utils' -import { ethers } from 'hardhat' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import { namehash } from '../src/utils/normalise' +// eslint-disable-next-line @typescript-eslint/naming-convention +const { Interface } = require('ethers/lib/utils') +const { ethers } = require('hardhat') +const { namehash, labelhash } = require('viem/ens') const { makeInterfaceId } = require('@openzeppelin/test-helpers') -function computeInterfaceId(iface: Interface) { +/** + * @param {import('ethers/lib/utils').Interface} iface + */ +function computeInterfaceId(iface) { return makeInterfaceId.ERC165( Object.values(iface.functions).map((frag) => frag.format('sighash')), ) } -const labelHash = (label: string) => - ethers.utils.keccak256(ethers.utils.toUtf8Bytes(label)) - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const { getNamedAccounts, deployments, network } = hre const { deploy } = deployments const { deployer, owner } = await getNamedAccounts() @@ -49,7 +50,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { }) console.log('Temporarily setting owner of eth tld to owner ') - const tx = await root.setSubnodeOwner(labelHash('eth'), owner) + const tx = await root.setSubnodeOwner(labelhash('eth'), owner) await tx.wait() console.log('Set default resolver for eth tld to public resolver') @@ -81,7 +82,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await tx4.wait() console.log('Set owner of eth tld back to registrar') - const tx11 = await root.setSubnodeOwner(labelHash('eth'), registrar.address) + const tx11 = await root.setSubnodeOwner(labelhash('eth'), registrar.address) await tx11.wait() return true @@ -97,4 +98,4 @@ func.dependencies = [ 'ETHRegistrarController', ] -export default func +module.exports = func diff --git a/packages/ensjs/deploy/00_deploy_multicall.ts b/packages/ensjs/deploy/00_deploy_multicall.cjs similarity index 71% rename from packages/ensjs/deploy/00_deploy_multicall.ts rename to packages/ensjs/deploy/00_deploy_multicall.cjs index f48b1760..1c0addae 100644 --- a/packages/ensjs/deploy/00_deploy_multicall.ts +++ b/packages/ensjs/deploy/00_deploy_multicall.cjs @@ -1,15 +1,16 @@ /* eslint-disable import/no-extraneous-dependencies */ -import { existsSync, mkdirSync } from 'fs' -import { readFile, writeFile } from 'fs/promises' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import { resolve } from 'path' - -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +const { existsSync, mkdirSync } = require('fs') +const { readFile, writeFile } = require('fs/promises') +const { resolve } = require('path') + +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const { getNamedAccounts } = hre const { deployer } = await getNamedAccounts() - let contractJson: any + let contractJson const jsonPath = resolve(__dirname, '../cache/multicall.json') @@ -35,4 +36,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { func.id = 'multicall' -export default func +module.exports = func diff --git a/packages/ensjs/deploy/00_legacy_registry.ts b/packages/ensjs/deploy/00_legacy_registry.cjs similarity index 75% rename from packages/ensjs/deploy/00_legacy_registry.ts rename to packages/ensjs/deploy/00_legacy_registry.cjs index 2521007c..373f8bf2 100644 --- a/packages/ensjs/deploy/00_legacy_registry.ts +++ b/packages/ensjs/deploy/00_legacy_registry.cjs @@ -1,17 +1,16 @@ /* eslint-disable import/no-extraneous-dependencies */ - -import { ethers } from 'hardhat' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import { labelhash } from 'viem' -import { namehash } from '../src/utils/normalise' +const { ethers } = require('hardhat') +const { labelhash, namehash } = require('viem/ens') const ZERO_HASH = '0x0000000000000000000000000000000000000000000000000000000000000000' const names = ['legacy'] -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const { getNamedAccounts } = hre const { owner } = await getNamedAccounts() @@ -43,7 +42,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { func.id = 'legacy-registry-names' func.tags = ['legacy-registry-names'] func.dependencies = ['ENSRegistry'] -func.skip = async function (hre: HardhatRuntimeEnvironment) { +func.skip = async function (hre) { const { getNamedAccounts } = hre const { owner } = await getNamedAccounts() @@ -57,4 +56,4 @@ func.skip = async function (hre: HardhatRuntimeEnvironment) { } func.runAtTheEnd = true -export default func +module.exports = func diff --git a/packages/ensjs/deploy/00_register_legacy.ts b/packages/ensjs/deploy/00_register_legacy.cjs similarity index 91% rename from packages/ensjs/deploy/00_register_legacy.ts rename to packages/ensjs/deploy/00_register_legacy.cjs index 4ac220f8..b5bc47ee 100644 --- a/packages/ensjs/deploy/00_register_legacy.ts +++ b/packages/ensjs/deploy/00_register_legacy.cjs @@ -1,12 +1,9 @@ /* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable no-await-in-loop */ -import cbor from 'cbor' -import { ethers } from 'hardhat' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import pako from 'pako' -import { labelhash, toBytes } from 'viem' -import { namehash } from '../src/utils/normalise' +const cbor = require('cbor') +const { ethers } = require('hardhat') +const pako = require('pako') +const { labelhash, namehash, toBytes } = require('viem') const dummyABI = [ { @@ -127,33 +124,38 @@ const dummyABI = [ }, ] -type Subname = { - label: string - namedOwner: string -} +/** + * @typedef {{ + * label: string + * namedOwner: string + * }} Subname + */ -const names: { - label: string - namedOwner: string - namedAddr: string - records?: { - text?: { - key: string - value: string - }[] - addr?: { - key: number - value: string - }[] - contenthash?: string - abi?: { - contentType: 1 | 2 | 4 | 8 | 256 - data: object | string - } - } - duration?: number - subnames?: Subname[] -}[] = [ +/** + * @type {{ + * label: string + * namedOwner: string + * namedAddr: string + * records?: { + * text?: { + * key: string + * value: string + * }[] + * addr?: { + * key: number + * value: string + * }[] + * contenthash?: string + * abi?: { + * contentType: 1 | 2 | 4 | 8 | 256 + * data: object | string + * } + * } + * duration?: number + * subnames?: Subname[] + * }[]} + */ +const names = [ { label: 'test123', namedOwner: 'owner', @@ -314,7 +316,10 @@ const names: { })), ] -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const { getNamedAccounts, network } = hre const allNamedAccts = await getNamedAccounts() @@ -408,7 +413,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } if (records.abi) { console.log('ABI') - let data: string | Buffer | Uint8Array + /** + * @type {string | Buffer | Uint8Array} + */ + let data if (records.abi.contentType === 1 || records.abi.contentType === 256) { data = JSON.stringify(records.abi.data) } else if (records.abi.contentType === 2) { @@ -416,7 +424,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } else if (records.abi.contentType === 4) { data = cbor.encode(records.abi.data) } else { - data = records.abi.data as string + data = records.abi.data } if (typeof data === 'string') data = toBytes(data) const setABITx = await _publicResolver.setABI( @@ -461,4 +469,4 @@ func.tags = ['register-unwrapped-names'] func.dependencies = ['LegacyETHRegistrarController'] func.runAtTheEnd = true -export default func +module.exports = func diff --git a/packages/ensjs/deploy/00_register_wrapped.ts b/packages/ensjs/deploy/00_register_wrapped.cjs similarity index 85% rename from packages/ensjs/deploy/00_register_wrapped.ts rename to packages/ensjs/deploy/00_register_wrapped.cjs index 0821a1ac..c165139e 100644 --- a/packages/ensjs/deploy/00_register_wrapped.ts +++ b/packages/ensjs/deploy/00_register_wrapped.cjs @@ -1,27 +1,29 @@ /* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable no-await-in-loop */ -import { BigNumber } from 'ethers' -import { ethers } from 'hardhat' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import { MAX_DATE_INT } from '../src/utils/consts' -import { encodeFuses } from '../src/utils/fuses' -import { namehash } from '../src/utils/normalise' +// eslint-disable-next-line @typescript-eslint/naming-convention +const { BigNumber } = require('ethers') +const { ethers } = require('hardhat') +const { namehash } = require('viem/ens') +const { MAX_DATE_INT } = require('../dist/cjs/utils/consts') +const { encodeFuses } = require('../dist/cjs/utils/fuses') -export const names: { - label: string - namedOwner: string - data?: any[] - reverseRecord?: boolean - fuses?: number - subnames?: { - label: string - namedOwner: string - fuses?: number - expiry?: number - }[] - duration?: number | BigNumber -}[] = [ +/** + * @type {{ + * label: string + * namedOwner: string + * data?: any[] + * reverseRecord?: boolean + * fuses?: number + * subnames?: { + * label: string + * namedOwner: string + * fuses?: number + * expiry?: number + * }[] + * duration?: number | BigNumber + * }[]} + */ +const names = [ { label: 'wrapped', namedOwner: 'owner', @@ -92,7 +94,10 @@ export const names: { }, ] -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const { getNamedAccounts, network } = hre const allNamedAccts = await getNamedAccounts() @@ -189,4 +194,4 @@ func.tags = ['register-wrapped-names'] func.dependencies = ['ETHRegistrarController'] func.runAtTheEnd = true -export default func +module.exports = func diff --git a/packages/ensjs/deploy/01_legacy_dnsregistrar.ts b/packages/ensjs/deploy/01_legacy_dnsregistrar.cjs similarity index 87% rename from packages/ensjs/deploy/01_legacy_dnsregistrar.ts rename to packages/ensjs/deploy/01_legacy_dnsregistrar.cjs index bdf07b54..d594c4b0 100644 --- a/packages/ensjs/deploy/01_legacy_dnsregistrar.ts +++ b/packages/ensjs/deploy/01_legacy_dnsregistrar.cjs @@ -1,11 +1,9 @@ /* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable no-await-in-loop */ /* eslint-disable import/no-extraneous-dependencies */ -import { readFile } from 'fs/promises' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import { resolve } from 'path' -import { labelhash } from 'viem' +const { readFile } = require('fs/promises') +const { resolve } = require('path') +const { labelhash } = require('viem') const ensContractsPath = './node_modules/@ensdomains/ens-contracts' const mainnetArtifactsPath = resolve(ensContractsPath, './deployments/mainnet') @@ -14,7 +12,10 @@ const constructorArgs = [ '0x00002b000100000e1000244a5c080249aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb500002b000100000e1000244f660802e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d', ] -const getMainnetArtifact = async (name: string) => { +/** + * @param {string} name + */ +const getMainnetArtifact = async (name) => { const deployment = JSON.parse( await readFile(resolve(mainnetArtifactsPath, `${name}.json`), 'utf8'), ) @@ -30,7 +31,10 @@ const getMainnetArtifact = async (name: string) => { return artifact } -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const { getNamedAccounts, deployments } = hre const { deploy } = deployments const { deployer, owner } = await getNamedAccounts() @@ -47,13 +51,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const dnssec = await hre.ethers.getContract('LegacyDNSSECImpl') - const algorithms: Record = { + const algorithms = { 5: 'RSASHA1Algorithm', 7: 'RSASHA1Algorithm', 8: 'RSASHA256Algorithm', 13: 'P256SHA256Algorithm', } - const digests: Record = { + const digests = { 1: 'SHA1Digest', 2: 'SHA256Digest', } @@ -113,4 +117,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { func.dependencies = ['Root'] -export default func +module.exports = func diff --git a/packages/ensjs/deploy/01_set_legacy_resolver.ts b/packages/ensjs/deploy/01_set_legacy_resolver.cjs similarity index 82% rename from packages/ensjs/deploy/01_set_legacy_resolver.ts rename to packages/ensjs/deploy/01_set_legacy_resolver.cjs index 56f52f85..4956a504 100644 --- a/packages/ensjs/deploy/01_set_legacy_resolver.ts +++ b/packages/ensjs/deploy/01_set_legacy_resolver.cjs @@ -1,11 +1,9 @@ /* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable no-await-in-loop */ -import fs from 'fs/promises' -import { ethers } from 'hardhat' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import { resolve } from 'path' -import { namehash } from '../src/utils/normalise' +const fs = require('fs/promises') +const { ethers } = require('hardhat') +const { resolve } = require('path') +const { namehash } = require('viem') const names = [ { @@ -15,7 +13,10 @@ const names = [ }, ] -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const { getNamedAccounts, deployments } = hre const allNamedAccts = await getNamedAccounts() @@ -67,4 +68,4 @@ func.id = 'set-legacy-resolver' func.tags = ['set-legacy-resolver'] func.runAtTheEnd = true -export default func +module.exports = func diff --git a/packages/ensjs/deploy/01_set_primary.ts b/packages/ensjs/deploy/01_set_primary.cjs similarity index 76% rename from packages/ensjs/deploy/01_set_primary.ts rename to packages/ensjs/deploy/01_set_primary.cjs index 38e70030..9aef47b4 100644 --- a/packages/ensjs/deploy/01_set_primary.ts +++ b/packages/ensjs/deploy/01_set_primary.cjs @@ -1,8 +1,6 @@ /* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable no-await-in-loop */ -import { ethers } from 'hardhat' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' +const { ethers } = require('hardhat') const names = [ { @@ -11,7 +9,10 @@ const names = [ }, ] -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const { getNamedAccounts } = hre const allNamedAccts = await getNamedAccounts() @@ -35,4 +36,4 @@ func.id = 'set-primary' func.tags = ['set-primary'] func.runAtTheEnd = true -export default func +module.exports = func diff --git a/packages/ensjs/deploy/02_get_contract_addresses.ts b/packages/ensjs/deploy/02_get_contract_addresses.cjs similarity index 67% rename from packages/ensjs/deploy/02_get_contract_addresses.ts rename to packages/ensjs/deploy/02_get_contract_addresses.cjs index f307734a..c090f8da 100644 --- a/packages/ensjs/deploy/02_get_contract_addresses.ts +++ b/packages/ensjs/deploy/02_get_contract_addresses.cjs @@ -1,10 +1,11 @@ /* eslint-disable import/no-extraneous-dependencies */ -import { writeFile } from 'fs/promises' -import { DeployFunction } from 'hardhat-deploy/types' -import { HardhatRuntimeEnvironment } from 'hardhat/types' -import { resolve } from 'path' +const { writeFile } = require('fs/promises') +const { resolve } = require('path') -const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { +/** + * @type {import('hardhat-deploy/types').DeployFunction} + */ +const func = async function (hre) { const allDeployments = await hre.deployments.all() const deploymentAddressMap = Object.fromEntries( Object.keys(allDeployments).map((dkey) => [ @@ -25,4 +26,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { func.runAtTheEnd = true func.dependencies = ['set-legacy-resolver'] -export default func +module.exports = func diff --git a/packages/ensjs/ens-test-env.config.js b/packages/ensjs/ens-test-env.config.cjs similarity index 100% rename from packages/ensjs/ens-test-env.config.js rename to packages/ensjs/ens-test-env.config.cjs diff --git a/packages/ensjs/esbuild.js b/packages/ensjs/esbuild.js deleted file mode 100644 index a45c11e7..00000000 --- a/packages/ensjs/esbuild.js +++ /dev/null @@ -1,67 +0,0 @@ -const esbuild = require('esbuild') -const glob = require('glob') -const { renameSync } = require('fs') - -const base = { - entryPoints: [ - ...glob.sync('./src/**/!(*.test.ts|types.ts)', { - nodir: true, - ignore: ['./src/@types/**/*', './src/tests/**/*', './src/ABIs/**/*'], - }), - ], - bundle: false, - sourcemap: false, -} - -const esmDeclarations = glob.sync('./dist/esm/**/*.d.ts') - -for (let i = 0; i < esmDeclarations.length; i++) { - const declaration = esmDeclarations[i] - renameSync(declaration, declaration.replace('.d.ts', '.d.mts')) -} - -esbuild.build({ - ...base, - bundle: true, - plugins: [ - { - name: 'add-mjs', - setup(build) { - build.onResolve({ filter: /.*/ }, (args) => { - if (args.importer) { - if (args.path.startsWith('./') || args.path.startsWith('../')) - return { path: args.path + '.mjs', external: true } - return { path: args.path, external: true } - } - }) - }, - }, - ], - outdir: 'dist/esm', - format: 'esm', - target: ['esnext'], - outExtension: { - '.js': '.mjs', - }, -}) - -esbuild.build({ - ...base, - plugins: [ - { - name: 'add-js', - setup(build) { - build.onResolve({ filter: /.*/ }, (args) => { - if (args.importer) { - if (args.path.startsWith('./') || args.path.startsWith('../')) - return { path: args.path + '.js', external: true } - return { path: args.path, external: true } - } - }) - }, - }, - ], - outdir: 'dist/cjs', - format: 'cjs', - target: ['node16'], -}) diff --git a/packages/ensjs/hardhat.config.ts b/packages/ensjs/hardhat.config.cjs similarity index 67% rename from packages/ensjs/hardhat.config.ts rename to packages/ensjs/hardhat.config.cjs index 4c83605f..499bcd11 100644 --- a/packages/ensjs/hardhat.config.ts +++ b/packages/ensjs/hardhat.config.cjs @@ -1,8 +1,10 @@ -import '@nomiclabs/hardhat-ethers' -import 'dotenv/config' -import 'hardhat-deploy' -import { HardhatUserConfig } from 'hardhat/config' -import { resolve } from 'path' +require('@nomiclabs/hardhat-ethers') +require('dotenv/config') +require('hardhat-deploy') +const { resolve } = require('path') + +const { execSync } = require('child_process') +const { existsSync } = require('fs') process.env.BATCH_GATEWAY_URLS = JSON.stringify([ 'https://universal-offchain-unwrapper.ens-cf.workers.dev/', @@ -10,7 +12,15 @@ process.env.BATCH_GATEWAY_URLS = JSON.stringify([ const ensContractsPath = './node_modules/@ensdomains/ens-contracts' -const config: HardhatUserConfig = { +// check if built package exists +// this is required to use ensjs functions in the deploy scripts (which are written in cjs) +const builtCjsExists = existsSync('./dist/cjs/utils/index.js') +if (!builtCjsExists) execSync('pnpm build', { stdio: 'inherit' }) + +/** + * @type {import('hardhat/config').HardhatUserConfig} + */ +const config = { solidity: { compilers: [ { @@ -63,4 +73,4 @@ const config: HardhatUserConfig = { }, } -export default config +module.exports = config diff --git a/packages/ensjs/jest.config.ts b/packages/ensjs/jest.config.js similarity index 56% rename from packages/ensjs/jest.config.ts rename to packages/ensjs/jest.config.js index 11a51040..a8b2302d 100644 --- a/packages/ensjs/jest.config.ts +++ b/packages/ensjs/jest.config.js @@ -3,10 +3,15 @@ const config = { testEnvironment: 'node', extensionsToTreatAsEsm: ['.ts'], transform: { + // eslint-disable-next-line @typescript-eslint/naming-convention '^.+\\.(t|j)sx?$': ['@swc/jest'], }, setupFilesAfterEnv: ['/jest.setup.ts'], transformIgnorePatterns: [], + moduleNameMapper: { + // eslint-disable-next-line @typescript-eslint/naming-convention + '^(\\.{1,2}/.*)\\.js$': '$1', + }, } export default config diff --git a/packages/ensjs/package.json b/packages/ensjs/package.json index 181e6737..89ffaeff 100644 --- a/packages/ensjs/package.json +++ b/packages/ensjs/package.json @@ -2,52 +2,69 @@ "name": "@ensdomains/ensjs", "version": "3.0.0-beta.0", "description": "ENS javascript library for contract interaction", + "type": "module", "main": "./dist/cjs/index.js", - "module": "./dist/esm/index.mjs", + "module": "./dist/esm/index.js", "types": "./dist/types/index.d.ts", "typings": "./dist/types/index.d.ts", + "sideEffects": false, "exports": { ".": { "types": "./dist/types/index.d.ts", - "import": "./dist/esm/index.mjs", - "require": "./dist/cjs/index.js", - "default": "./dist/esm/index.mjs" + "import": "./dist/esm/index.js", + "default": "./dist/cjs/index.js" }, - "./*.js": { - "types": "./dist/types/*.d.ts", - "import": "./dist/esm/*.mjs", - "require": "./dist/cjs/*.js", - "default": "./dist/esm/*.mjs" + "./contracts": { + "types": "./dist/types/contracts/index.d.ts", + "import": "./dist/esm/contracts/index.js", + "default": "./dist/cjs/contracts/index.js" }, - "./*.mjs": { - "types": "./dist/types/*.d.ts", - "import": "./dist/esm/*.mjs", - "require": "./dist/cjs/*.js", - "default": "./dist/esm/*.mjs" + "./dns": { + "types": "./dist/types/dns.d.ts", + "import": "./dist/esm/dns.js", + "default": "./dist/cjs/dns.js" }, - "./*": { - "types": "./dist/types/*.d.ts", - "import": "./dist/esm/*.mjs", - "require": "./dist/cjs/*.js", - "default": "./dist/esm/*.mjs" - } + "./public": { + "types": "./dist/types/public.d.ts", + "import": "./dist/esm/public.js", + "default": "./dist/cjs/public.js" + }, + "./subgraph": { + "types": "./dist/types/subgraph.d.ts", + "import": "./dist/esm/subgraph.js", + "default": "./dist/cjs/subgraph.js" + }, + "./utils": { + "types": "./dist/types/utils/index.d.ts", + "import": "./dist/esm/utils/index.js", + "default": "./dist/cjs/utils/index.js" + }, + "./wallet": { + "types": "./dist/types/wallet.d.ts", + "import": "./dist/esm/wallet.js", + "default": "./dist/cjs/wallet.js" + }, + "./package.json": "./package.json" }, "typesVersions": { "*": { - "clients/*": [ - "./dist/types/clients/*" + "contracts": [ + "./dist/types/contracts/index.d.ts" + ], + "dns": [ + "./dist/types/dns.d.ts" ], - "contracts/*": [ - "./dist/types/contracts/*" + "public": [ + "./dist/types/public.d.ts" ], - "errors/*": [ - "./dist/types/errors/*" + "subgraph": [ + "./dist/types/subgraph.d.ts" ], - "functions/*": [ - "./dist/types/functions/*" + "utils": [ + "./dist/types/utils/index.d.ts" ], - "utils/*": [ - "./dist/types/utils/*" + "wallet": [ + "./dist/types/wallet.d.ts" ] } }, @@ -60,7 +77,7 @@ "author": "TateB ", "license": "MIT", "scripts": { - "tenv": "ens-test-env -a", + "tenv": "ens-test-env -c ./ens-test-env.config.cjs -a", "denv": "pnpm tenv start -ns -nb --extra-time 11368000 --verbosity 1", "anvil": "pnpm denv --no-graph", "start": "ts-node --files src/index.test.ts", @@ -69,9 +86,12 @@ "test:specific": "ts-node --files ", "clean": "rm -rf ./dist ./README.md ./LICENSE", "lint": "eslint ./src/* --no-error-on-unmatched-pattern", - "build:types": "tsc --emitDeclarationOnly --project tsconfig.build.json", - "build": "pnpm clean && pnpm lint && pnpm build:types && pnpm node esbuild.js", + "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'", + "build:esm": "tsc --project tsconfig.build.json --module es2022 --outDir ./dist/esm && echo > ./dist/esm/package.json '{\"type\":\"module\",\"sideEffects\":false}'", + "build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap", + "build": "pnpm run clean && pnpm run build:cjs && pnpm run build:esm && pnpm run build:types", "prepublish": "pnpm build && cp ../../README.md ../../LICENSE ./", + "prepublishOnly": "ts-node-esm ./scripts/prepublishOnly.ts", "ver": "pnpm version --no-workspaces-update" }, "dependencies": { @@ -97,15 +117,18 @@ "@swc/core": "^1.2.162", "@swc/jest": "^0.2.20", "@types/bn.js": "^5.1.0", + "@types/fs-extra": "^11.0.1", "@types/jest": "^27.4.1", + "@types/node": "^20.3.3", "@types/pako": "^2.0.0", "@types/traverse": "^0.6.32", "dotenv": "^16.0.0", "esbuild": "^0.15.6", "eslint-plugin-jest": "^27.0.1", "ethers": "^5.7.2", + "fs-extra": "^10.0.1", "glob": "^8.0.3", - "hardhat": "2.10.2", + "hardhat": "2.16.1", "hardhat-abi-exporter": "^2.8.0", "hardhat-deploy": "^0.11.12", "jest": "^29.5.0", @@ -114,9 +137,9 @@ "solc": "^0.8.13", "ts-jest": "^29.1.1", "ts-node": "^10.7.0", - "typescript": "^5.0.4", - "wait-on": "^6.0.1", - "viem": "^1.2.9" + "typescript": "^5.1.6", + "viem": "^1.2.9", + "wait-on": "^6.0.1" }, "peerDependencies": { "viem": "^1.2.9" diff --git a/packages/ensjs/scripts/prepublishOnly.ts b/packages/ensjs/scripts/prepublishOnly.ts new file mode 100644 index 00000000..7ec637e8 --- /dev/null +++ b/packages/ensjs/scripts/prepublishOnly.ts @@ -0,0 +1,98 @@ +// from https://github.com/wagmi-dev/viem/blob/main/scripts/prepublishOnly.ts + +/* eslint-disable no-continue */ +import fs from 'fs-extra' +import path from 'path' +import * as url from 'url' + +const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) + +type Exports = { + [key: string]: string | { types?: string; import: string; default: string } +} + +// Generates a package.json to be published to NPM with only the necessary fields. +function generatePackageJson() { + const packageJsonPath = path.join(__dirname, '../package.json') + const tmpPackageJson = fs.readJsonSync(packageJsonPath) + + fs.writeJsonSync(`${packageJsonPath}.tmp`, tmpPackageJson, { spaces: 2 }) + + const { + name, + description, + dependencies, + peerDependencies, + peerDependenciesMeta, + version, + files, + exports: exports_, + // NOTE: We explicitly don't want to publish the type field. We create a separate package.json for `dist/cjs` and `dist/esm` that has the type field. + // type, + main, + module, + types, + typings, + typesVersions, + sideEffects, + license, + repository, + authors, + keywords, + } = tmpPackageJson + + // Generate proxy packages for each export. + const files_ = [...files] + for (const [key, value] of Object.entries(exports_ as Exports)) { + if (typeof value === 'string') continue + if (key === '.') continue + if (!value.default || !value.import) + throw new Error('`default` and `import` are required.') + + fs.outputFileSync( + `${key}/package.json`, + `{ + ${Object.entries(value) + .map(([k, v]) => { + const key_ = (() => { + if (k === 'import') return 'module' + if (k === 'default') return 'main' + if (k === 'types') return 'types' + throw new Error('Invalid key') + })() + return `"${key_}": "${v.replace('./', '../')}"` + }) + .join(',\n ')} +}`, + ) + files_.push(key.replace('./', '')) + } + + fs.writeJsonSync( + packageJsonPath, + { + name, + description, + dependencies, + peerDependencies, + peerDependenciesMeta, + version, + files: files_, + exports: exports_, + // type, + main, + module, + types, + typings, + typesVersions, + sideEffects, + license, + repository, + authors, + keywords, + }, + { spaces: 2 }, + ) +} + +generatePackageJson() diff --git a/packages/ensjs/src/@types/dns-packet/types.d.ts b/packages/ensjs/src/@types/dns-packet/types.d.ts index 1f69298a..d667a12d 100644 --- a/packages/ensjs/src/@types/dns-packet/types.d.ts +++ b/packages/ensjs/src/@types/dns-packet/types.d.ts @@ -1,4 +1,4 @@ -declare module 'dns-packet/types' { +declare module 'dns-packet/types.js' { function toType(type: string): number function toString(type: number): string } diff --git a/packages/ensjs/src/clients/decorators/index.ts b/packages/ensjs/src/clients/decorators/index.ts deleted file mode 100644 index 2ebe68a3..00000000 --- a/packages/ensjs/src/clients/decorators/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './public' -export * from './subgraph' -export * from './wallet' diff --git a/packages/ensjs/src/clients/decorators/public.ts b/packages/ensjs/src/clients/decorators/public.ts index c8c80328..f57aca34 100644 --- a/packages/ensjs/src/clients/decorators/public.ts +++ b/packages/ensjs/src/clients/decorators/public.ts @@ -1,61 +1,61 @@ -import { type Account, type Client, type Transport } from 'viem' -import type { ChainWithEns } from '../../contracts/consts' +import type { Account, Client, Transport } from 'viem' +import type { ChainWithEns } from '../../contracts/consts.js' import batch, { type BatchParameters, type BatchReturnType, -} from '../../functions/public/batch' +} from '../../functions/public/batch.js' import getAbiRecord, { type GetAbiRecordParameters, type GetAbiRecordReturnType, -} from '../../functions/public/getAbiRecord' +} from '../../functions/public/getAbiRecord.js' import getAddressRecord, { type GetAddressRecordParameters, type GetAddressRecordReturnType, -} from '../../functions/public/getAddressRecord' +} from '../../functions/public/getAddressRecord.js' import getAvailable, { type GetAvailableParameters, type GetAvailableReturnType, -} from '../../functions/public/getAvailable' +} from '../../functions/public/getAvailable.js' import getContentHashRecord, { type GetContentHashRecordParameters, type GetContentHashRecordReturnType, -} from '../../functions/public/getContentHashRecord' +} from '../../functions/public/getContentHashRecord.js' import getExpiry, { type GetExpiryParameters, type GetExpiryReturnType, -} from '../../functions/public/getExpiry' +} from '../../functions/public/getExpiry.js' import getName, { type GetNameParameters, type GetNameReturnType, -} from '../../functions/public/getName' +} from '../../functions/public/getName.js' import getOwner, { type GetOwnerParameters, type GetOwnerReturnType, -} from '../../functions/public/getOwner' +} from '../../functions/public/getOwner.js' import getPrice, { type GetPriceParameters, type GetPriceReturnType, -} from '../../functions/public/getPrice' +} from '../../functions/public/getPrice.js' import getRecords, { type GetRecordsParameters, type GetRecordsReturnType, -} from '../../functions/public/getRecords' +} from '../../functions/public/getRecords.js' import getResolver, { type GetResolverParameters, type GetResolverReturnType, -} from '../../functions/public/getResolver' +} from '../../functions/public/getResolver.js' import getTextRecord, { type GetTextRecordParameters, type GetTextRecordReturnType, -} from '../../functions/public/getTextRecord' +} from '../../functions/public/getTextRecord.js' import getWrapperData, { type GetWrapperDataParameters, type GetWrapperDataReturnType, -} from '../../functions/public/getWrapperData' +} from '../../functions/public/getWrapperData.js' import getWrapperName, { type GetWrapperNameParameters, type GetWrapperNameReturnType, -} from '../../functions/public/getWrapperName' +} from '../../functions/public/getWrapperName.js' export type EnsPublicActions = { /** diff --git a/packages/ensjs/src/clients/decorators/subgraph.ts b/packages/ensjs/src/clients/decorators/subgraph.ts index c6c92cc6..186932fb 100644 --- a/packages/ensjs/src/clients/decorators/subgraph.ts +++ b/packages/ensjs/src/clients/decorators/subgraph.ts @@ -1,29 +1,29 @@ -import { type Account, type Client, type Transport } from 'viem' -import { type ChainWithEns } from '../../contracts/consts' +import type { Account, Client, Transport } from 'viem' +import type { ChainWithEns } from '../../contracts/consts.js' import getDecodedName, { type GetDecodedNameParameters, type GetDecodedNameReturnType, -} from '../../functions/subgraph/getDecodedName' +} from '../../functions/subgraph/getDecodedName.js' import getNameHistory, { type GetNameHistoryParameters, type GetNameHistoryReturnType, -} from '../../functions/subgraph/getNameHistory' +} from '../../functions/subgraph/getNameHistory.js' import getNamesForAddress, { type GetNamesForAddressParameters, type GetNamesForAddressReturnType, -} from '../../functions/subgraph/getNamesForAddress' +} from '../../functions/subgraph/getNamesForAddress.js' import getSubgraphRecords, { type GetSubgraphRecordsParameters, type GetSubgraphRecordsReturnType, -} from '../../functions/subgraph/getSubgraphRecords' +} from '../../functions/subgraph/getSubgraphRecords.js' import getSubgraphRegistrant, { type GetSubgraphRegistrantParameters, type GetSubgraphRegistrantReturnType, -} from '../../functions/subgraph/getSubgraphRegistrant' +} from '../../functions/subgraph/getSubgraphRegistrant.js' import getSubnames, { type GetSubnamesParameters, type GetSubnamesReturnType, -} from '../../functions/subgraph/getSubnames' +} from '../../functions/subgraph/getSubnames.js' export type EnsSubgraphActions = { /** diff --git a/packages/ensjs/src/clients/decorators/wallet.ts b/packages/ensjs/src/clients/decorators/wallet.ts index 9ab7e0d6..97e04335 100644 --- a/packages/ensjs/src/clients/decorators/wallet.ts +++ b/packages/ensjs/src/clients/decorators/wallet.ts @@ -1,73 +1,73 @@ -import { type Account, type Transport, type WalletClient } from 'viem' -import { type ChainWithEns } from '../../contracts/consts' +import type { Account, Transport, WalletClient } from 'viem' +import type { ChainWithEns } from '../../contracts/consts.js' import commitName, { type CommitNameParameters, type CommitNameReturnType, -} from '../../functions/wallet/commitName' +} from '../../functions/wallet/commitName.js' import createSubname, { type CreateSubnameParameters, type CreateSubnameReturnType, -} from '../../functions/wallet/createSubname' +} from '../../functions/wallet/createSubname.js' import deleteSubname, { type DeleteSubnameParameters, type DeleteSubnameReturnType, -} from '../../functions/wallet/deleteSubname' +} from '../../functions/wallet/deleteSubname.js' import registerName, { type RegisterNameParameters, type RegisterNameReturnType, -} from '../../functions/wallet/registerName' +} from '../../functions/wallet/registerName.js' import renewNames, { type RenewNamesParameters, type RenewNamesReturnType, -} from '../../functions/wallet/renewNames' +} from '../../functions/wallet/renewNames.js' import setAbiRecord, { type SetAbiRecordParameters, type SetAbiRecordReturnType, -} from '../../functions/wallet/setAbiRecord' +} from '../../functions/wallet/setAbiRecord.js' import setAddressRecord, { type SetAddressRecordParameters, type SetAddressRecordReturnType, -} from '../../functions/wallet/setAddressRecord' +} from '../../functions/wallet/setAddressRecord.js' import setChildFuses, { type SetChildFusesParameters, type SetChildFusesReturnType, -} from '../../functions/wallet/setChildFuses' +} from '../../functions/wallet/setChildFuses.js' import setContentHashRecord, { type SetContentHashRecordParameters, type SetContentHashRecordReturnType, -} from '../../functions/wallet/setContentHashRecord' +} from '../../functions/wallet/setContentHashRecord.js' import setFuses, { type SetFusesParameters, type SetFusesReturnType, -} from '../../functions/wallet/setFuses' +} from '../../functions/wallet/setFuses.js' import setPrimaryName, { type SetPrimaryNameParameters, type SetPrimaryNameReturnType, -} from '../../functions/wallet/setPrimaryName' +} from '../../functions/wallet/setPrimaryName.js' import setRecords, { type SetRecordsParameters, type SetRecordsReturnType, -} from '../../functions/wallet/setRecords' +} from '../../functions/wallet/setRecords.js' import setResolver, { type SetResolverParameters, type SetResolverReturnType, -} from '../../functions/wallet/setResolver' +} from '../../functions/wallet/setResolver.js' import setTextRecord, { type SetTextRecordParameters, type SetTextRecordReturnType, -} from '../../functions/wallet/setTextRecord' +} from '../../functions/wallet/setTextRecord.js' import transferName, { type TransferNameParameters, type TransferNameReturnType, -} from '../../functions/wallet/transferName' +} from '../../functions/wallet/transferName.js' import unwrapName, { type UnwrapNameParameters, type UnwrapNameReturnType, -} from '../../functions/wallet/unwrapName' +} from '../../functions/wallet/unwrapName.js' import wrapName, { type WrapNameParameters, type WrapNameReturnType, -} from '../../functions/wallet/wrapName' +} from '../../functions/wallet/wrapName.js' export type EnsWalletActions< TChain extends ChainWithEns, diff --git a/packages/ensjs/src/clients/index.ts b/packages/ensjs/src/clients/index.ts deleted file mode 100644 index 8c3b370e..00000000 --- a/packages/ensjs/src/clients/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './decorators' -export * from './public' -export * from './subgraph' -export * from './wallet' diff --git a/packages/ensjs/src/clients/public.ts b/packages/ensjs/src/clients/public.ts index 39177006..f54ebf94 100644 --- a/packages/ensjs/src/clients/public.ts +++ b/packages/ensjs/src/clients/public.ts @@ -5,14 +5,14 @@ import { type ClientConfig, type Transport, } from 'viem' -import { addEnsContracts } from '../contracts/addEnsContracts' -import { type ChainWithEns } from '../contracts/consts' -import { type Prettify } from '../types' -import { ensPublicActions, type EnsPublicActions } from './decorators/public' +import { addEnsContracts } from '../contracts/addEnsContracts.js' +import type { ChainWithEns } from '../contracts/consts.js' +import type { Prettify } from '../types.js' +import { ensPublicActions, type EnsPublicActions } from './decorators/public.js' import { ensSubgraphActions, type EnsSubgraphActions, -} from './decorators/subgraph' +} from './decorators/subgraph.js' export type EnsPublicClientConfig< TTransport extends Transport = Transport, diff --git a/packages/ensjs/src/clients/subgraph.ts b/packages/ensjs/src/clients/subgraph.ts index 3200c3e3..c5418490 100644 --- a/packages/ensjs/src/clients/subgraph.ts +++ b/packages/ensjs/src/clients/subgraph.ts @@ -5,13 +5,13 @@ import { type ClientConfig, type Transport, } from 'viem' -import { addEnsContracts } from '../contracts/addEnsContracts' -import { type ChainWithEns } from '../contracts/consts' -import { type Prettify } from '../types' +import { addEnsContracts } from '../contracts/addEnsContracts.js' +import type { ChainWithEns } from '../contracts/consts.js' +import type { Prettify } from '../types.js' import { ensSubgraphActions, type EnsSubgraphActions, -} from './decorators/subgraph' +} from './decorators/subgraph.js' export type EnsSubgraphClientConfig< TTransport extends Transport = Transport, diff --git a/packages/ensjs/src/clients/wallet.ts b/packages/ensjs/src/clients/wallet.ts index 3f23bf1b..3af5179f 100644 --- a/packages/ensjs/src/clients/wallet.ts +++ b/packages/ensjs/src/clients/wallet.ts @@ -1,19 +1,19 @@ import { - Account, - Address, - ParseAccount, - WalletActions, - WalletRpcSchema, createWalletClient, + type Account, + type Address, type Chain, type Client, type ClientConfig, + type ParseAccount, type Transport, + type WalletActions, + type WalletRpcSchema, } from 'viem' -import { addEnsContracts } from '../contracts/addEnsContracts' -import { type ChainWithEns } from '../contracts/consts' -import { type Prettify } from '../types' -import { ensWalletActions, type EnsWalletActions } from './decorators/wallet' +import { addEnsContracts } from '../contracts/addEnsContracts.js' +import type { ChainWithEns } from '../contracts/consts.js' +import type { Prettify } from '../types.js' +import { ensWalletActions, type EnsWalletActions } from './decorators/wallet.js' export type EnsWalletClientConfig< TTransport extends Transport, diff --git a/packages/ensjs/src/contracts/addEnsContracts.ts b/packages/ensjs/src/contracts/addEnsContracts.ts index 5d0ee2c4..68bebdd5 100644 --- a/packages/ensjs/src/contracts/addEnsContracts.ts +++ b/packages/ensjs/src/contracts/addEnsContracts.ts @@ -1,12 +1,12 @@ -import { Chain } from 'viem' -import { NoChainError, UnsupportedNetworkError } from '../errors/contracts' +import type { Chain } from 'viem' +import { NoChainError, UnsupportedNetworkError } from '../errors/contracts.js' import { - ChainWithEns, - SupportedChain, addresses, subgraphs, supportedChains, -} from './consts' + type ChainWithEns, + type SupportedChain, +} from './consts.js' /** * Adds ENS contract addresses to the viem chain diff --git a/packages/ensjs/src/contracts/baseRegistrar.ts b/packages/ensjs/src/contracts/baseRegistrar.ts index 426fdbf4..1235d865 100644 --- a/packages/ensjs/src/contracts/baseRegistrar.ts +++ b/packages/ensjs/src/contracts/baseRegistrar.ts @@ -1,6 +1,11 @@ -export const availableSnippet = [ +import { + erc721OwnerOfSnippet, + erc721SafeTransferFromSnippet, + erc721SafeTransferFromWithDataSnippet, +} from './erc721.js' + +export const baseRegistrarAvailableSnippet = [ { - constant: true, inputs: [ { name: 'id', @@ -14,15 +19,13 @@ export const availableSnippet = [ type: 'bool', }, ], - payable: false, stateMutability: 'view', type: 'function', }, ] as const -export const nameExpiresSnippet = [ +export const baseRegistrarNameExpiresSnippet = [ { - constant: true, inputs: [ { name: 'id', @@ -36,15 +39,13 @@ export const nameExpiresSnippet = [ type: 'uint256', }, ], - payable: false, stateMutability: 'view', type: 'function', }, ] as const -export const gracePeriodSnippet = [ +export const baseRegistrarGracePeriodSnippet = [ { - constant: true, inputs: [], name: 'GRACE_PERIOD', outputs: [ @@ -53,13 +54,12 @@ export const gracePeriodSnippet = [ type: 'uint256', }, ], - payable: false, stateMutability: 'view', type: 'function', }, ] as const -export const reclaimSnippet = [ +export const baseRegistrarReclaimSnippet = [ { inputs: [ { @@ -77,3 +77,13 @@ export const reclaimSnippet = [ type: 'function', }, ] as const + +export const baseRegistrarSafeTransferFromSnippet = [ + ...erc721SafeTransferFromSnippet, +] as const + +export const baseRegistrarSafeTransferFromWithDataSnippet = [ + ...erc721SafeTransferFromWithDataSnippet, +] as const + +export const baseRegistrarOwnerOfSnippet = [...erc721OwnerOfSnippet] as const diff --git a/packages/ensjs/src/contracts/bulkRenewal.ts b/packages/ensjs/src/contracts/bulkRenewal.ts index 2d9c9077..9a0adc82 100644 --- a/packages/ensjs/src/contracts/bulkRenewal.ts +++ b/packages/ensjs/src/contracts/bulkRenewal.ts @@ -1,4 +1,4 @@ -export const rentPriceSnippet = [ +export const bulkRenewalRentPriceSnippet = [ { inputs: [ { @@ -22,7 +22,7 @@ export const rentPriceSnippet = [ }, ] as const -export const renewAllSnippet = [ +export const bulkRenewalRenewAllSnippet = [ { inputs: [ { diff --git a/packages/ensjs/src/contracts/consts.ts b/packages/ensjs/src/contracts/consts.ts index b6ba022e..fa1e7647 100644 --- a/packages/ensjs/src/contracts/consts.ts +++ b/packages/ensjs/src/contracts/consts.ts @@ -1,5 +1,16 @@ -import { Account, Chain, Client, Transport, WalletClient } from 'viem' -import type { ChainContract } from 'viem/src/types/chain' +import type { + Account, + Address, + Chain, + Client, + Transport, + WalletClient, +} from 'viem' + +type ChainContract = { + address: Address + blockCreated?: number +} export const supportedChains = ['homestead', 'goerli'] as const export const supportedContracts = [ diff --git a/packages/ensjs/src/contracts/dnsRegistrar.ts b/packages/ensjs/src/contracts/dnsRegistrar.ts index 7de6e216..1f1aeba2 100644 --- a/packages/ensjs/src/contracts/dnsRegistrar.ts +++ b/packages/ensjs/src/contracts/dnsRegistrar.ts @@ -1,4 +1,4 @@ -export const proveAndClaimSnippet = [ +export const dnsRegistrarProveAndClaimSnippet = [ { inputs: [ { @@ -31,7 +31,7 @@ export const proveAndClaimSnippet = [ }, ] as const -export const proveAndClaimWithResolverSnippet = [ +export const dnsRegistrarProveAndClaimWithResolverSnippet = [ { inputs: [ { diff --git a/packages/ensjs/src/contracts/dnssecImpl.ts b/packages/ensjs/src/contracts/dnssecImpl.ts index fbc6e498..912284d7 100644 --- a/packages/ensjs/src/contracts/dnssecImpl.ts +++ b/packages/ensjs/src/contracts/dnssecImpl.ts @@ -1,4 +1,4 @@ -export const rrDataSnippet = [ +export const dnssecImplRrDataSnippet = [ { inputs: [ { @@ -30,7 +30,7 @@ export const rrDataSnippet = [ }, ] as const -export const anchorsSnippet = [ +export const dnssecImplAnchorsSnippet = [ { inputs: [], name: 'anchors', diff --git a/packages/ensjs/src/contracts/erc1155.ts b/packages/ensjs/src/contracts/erc1155.ts index a3d78aa2..45c5ba71 100644 --- a/packages/ensjs/src/contracts/erc1155.ts +++ b/packages/ensjs/src/contracts/erc1155.ts @@ -1,4 +1,4 @@ -export const safeTransferFromSnippet = [ +export const erc1155SafeTransferFromSnippet = [ { inputs: [ { diff --git a/packages/ensjs/src/contracts/erc165.ts b/packages/ensjs/src/contracts/erc165.ts index 430dd2f9..2d01c30f 100644 --- a/packages/ensjs/src/contracts/erc165.ts +++ b/packages/ensjs/src/contracts/erc165.ts @@ -1,4 +1,4 @@ -export const supportsInterfaceSnippet = [ +export const erc165SupportsInterfaceSnippet = [ { inputs: [ { diff --git a/packages/ensjs/src/contracts/erc721.ts b/packages/ensjs/src/contracts/erc721.ts index 8d324d23..43ad8ab1 100644 --- a/packages/ensjs/src/contracts/erc721.ts +++ b/packages/ensjs/src/contracts/erc721.ts @@ -1,4 +1,4 @@ -export const ownerOfSnippet = [ +export const erc721OwnerOfSnippet = [ { inputs: [ { @@ -18,7 +18,7 @@ export const ownerOfSnippet = [ }, ] as const -export const safeTransferFromSnippet = [ +export const erc721SafeTransferFromSnippet = [ { inputs: [ { @@ -41,7 +41,7 @@ export const safeTransferFromSnippet = [ }, ] as const -export const safeTransferFromWithDataSnippet = [ +export const erc721SafeTransferFromWithDataSnippet = [ { inputs: [ { diff --git a/packages/ensjs/src/contracts/ethRegistrarController.ts b/packages/ensjs/src/contracts/ethRegistrarController.ts index e6e38780..41349ac0 100644 --- a/packages/ensjs/src/contracts/ethRegistrarController.ts +++ b/packages/ensjs/src/contracts/ethRegistrarController.ts @@ -1,4 +1,78 @@ -export const rentPriceSnippet = [ +export const ethRegistrarControllerErrors = [ + { + inputs: [ + { + name: 'commitment', + type: 'bytes32', + }, + ], + name: 'CommitmentTooNew', + type: 'error', + }, + { + inputs: [ + { + name: 'commitment', + type: 'bytes32', + }, + ], + name: 'CommitmentTooOld', + type: 'error', + }, + { + inputs: [ + { + name: 'duration', + type: 'uint256', + }, + ], + name: 'DurationTooShort', + type: 'error', + }, + { + inputs: [], + name: 'InsufficientValue', + type: 'error', + }, + { + inputs: [], + name: 'MaxCommitmentAgeTooHigh', + type: 'error', + }, + { + inputs: [], + name: 'MaxCommitmentAgeTooLow', + type: 'error', + }, + { + inputs: [ + { + name: 'name', + type: 'string', + }, + ], + name: 'NameNotAvailable', + type: 'error', + }, + { + inputs: [], + name: 'ResolverRequiredWhenDataSupplied', + type: 'error', + }, + { + inputs: [ + { + name: 'commitment', + type: 'bytes32', + }, + ], + name: 'UnexpiredCommitmentExists', + type: 'error', + }, +] as const + +export const ethRegistrarControllerRentPriceSnippet = [ + ...ethRegistrarControllerErrors, { inputs: [ { @@ -32,7 +106,8 @@ export const rentPriceSnippet = [ }, ] as const -export const commitSnippet = [ +export const ethRegistrarControllerCommitSnippet = [ + ...ethRegistrarControllerErrors, { inputs: [ { @@ -47,7 +122,8 @@ export const commitSnippet = [ }, ] as const -export const commitmentsSnippet = [ +export const ethRegistrarControllerCommitmentsSnippet = [ + ...ethRegistrarControllerErrors, { inputs: [ { @@ -67,7 +143,8 @@ export const commitmentsSnippet = [ }, ] as const -export const registerSnippet = [ +export const ethRegistrarControllerRegisterSnippet = [ + ...ethRegistrarControllerErrors, { inputs: [ { @@ -110,7 +187,8 @@ export const registerSnippet = [ }, ] as const -export const renewSnippet = [ +export const ethRegistrarControllerRenewSnippet = [ + ...ethRegistrarControllerErrors, { inputs: [ { diff --git a/packages/ensjs/src/contracts/getChainContractAddress.ts b/packages/ensjs/src/contracts/getChainContractAddress.ts index b4ce6ad2..5595a415 100644 --- a/packages/ensjs/src/contracts/getChainContractAddress.ts +++ b/packages/ensjs/src/contracts/getChainContractAddress.ts @@ -1,5 +1,5 @@ import { getChainContractAddress as _getChainContractAddress } from 'viem/utils' -import { ChainWithEns } from './consts' +import type { ChainWithEns } from './consts.js' type ChainClient = { chain: TChain diff --git a/packages/ensjs/src/contracts/index.ts b/packages/ensjs/src/contracts/index.ts index 07fd8aff..3948ee30 100644 --- a/packages/ensjs/src/contracts/index.ts +++ b/packages/ensjs/src/contracts/index.ts @@ -1,2 +1,97 @@ -export { addEnsContracts } from './addEnsContracts' -export { getChainContractAddress } from './getChainContractAddress' +export { + baseRegistrarAvailableSnippet, + baseRegistrarGracePeriodSnippet, + baseRegistrarNameExpiresSnippet, + baseRegistrarOwnerOfSnippet, + baseRegistrarReclaimSnippet, + baseRegistrarSafeTransferFromSnippet, + baseRegistrarSafeTransferFromWithDataSnippet, +} from './baseRegistrar.js' +export { + bulkRenewalRenewAllSnippet, + bulkRenewalRentPriceSnippet, +} from './bulkRenewal.js' +export { + addresses, + subgraphs, + supportedChains, + supportedContracts, + type ChainWithEns, + type CheckedChainWithEns, + type ClientWithEns, + type SupportedChain, + type SupportedContract, + type WalletWithEns, +} from './consts.js' +export { + dnsRegistrarProveAndClaimSnippet, + dnsRegistrarProveAndClaimWithResolverSnippet, +} from './dnsRegistrar.js' +export { + dnssecImplAnchorsSnippet, + dnssecImplRrDataSnippet, +} from './dnssecImpl.js' +export { erc165SupportsInterfaceSnippet } from './erc165.js' +export { + ethRegistrarControllerCommitSnippet, + ethRegistrarControllerCommitmentsSnippet, + ethRegistrarControllerErrors, + ethRegistrarControllerRegisterSnippet, + ethRegistrarControllerRenewSnippet, + ethRegistrarControllerRentPriceSnippet, +} from './ethRegistrarController.js' +export { getChainContractAddress } from './getChainContractAddress.js' +export { + multicallGetCurrentBlockTimestampSnippet, + multicallTryAggregateSnippet, +} from './multicall.js' +export { + nameWrapperErrors, + nameWrapperGetDataSnippet, + nameWrapperNamesSnippet, + nameWrapperOwnerOfSnippet, + nameWrapperSafeTransferFromSnippet, + nameWrapperSetChildFusesSnippet, + nameWrapperSetFusesSnippet, + nameWrapperSetRecordSnippet, + nameWrapperSetResolverSnippet, + nameWrapperSetSubnodeOwnerSnippet, + nameWrapperSetSubnodeRecordSnippet, + nameWrapperUnwrapEth2ldSnippet, + nameWrapperUnwrapSnippet, + nameWrapperWrapSnippet, +} from './nameWrapper.js' +export { + publicResolverAbiSnippet, + publicResolverClearRecordsSnippet, + publicResolverContenthashSnippet, + publicResolverMultiAddrSnippet, + publicResolverMulticallSnippet, + publicResolverSetAbiSnippet, + publicResolverSetAddrSnippet, + publicResolverSetContenthashSnippet, + publicResolverSetTextSnippet, + publicResolverSingleAddrSnippet, + publicResolverTextSnippet, +} from './publicResolver.js' +export { + registryOwnerSnippet, + registryResolverSnippet, + registrySetApprovalForAllSnippet, + registrySetOwnerSnippet, + registrySetRecordSnippet, + registrySetResolverSnippet, + registrySetSubnodeOwnerSnippet, + registrySetSubnodeRecordSnippet, +} from './registry.js' +export { + reverseRegistrarSetNameForAddrSnippet, + reverseRegistrarSetNameSnippet, +} from './reverseRegistrar.js' +export { + universalResolverErrors, + universalResolverFindResolverSnippet, + universalResolverResolveArraySnippet, + universalResolverResolveSnippet, + universalResolverReverseSnippet, +} from './universalResolver.js' diff --git a/packages/ensjs/src/contracts/multicall.ts b/packages/ensjs/src/contracts/multicall.ts index ae12d77b..c48049ba 100644 --- a/packages/ensjs/src/contracts/multicall.ts +++ b/packages/ensjs/src/contracts/multicall.ts @@ -1,4 +1,4 @@ -export const tryAggregateSnippet = [ +export const multicallTryAggregateSnippet = [ { inputs: [ { @@ -42,7 +42,7 @@ export const tryAggregateSnippet = [ }, ] as const -export const getCurrentBlockTimestampSnippet = [ +export const multicallGetCurrentBlockTimestampSnippet = [ { inputs: [], name: 'getCurrentBlockTimestamp', diff --git a/packages/ensjs/src/contracts/nameWrapper.ts b/packages/ensjs/src/contracts/nameWrapper.ts index 2402bfb9..5b944bda 100644 --- a/packages/ensjs/src/contracts/nameWrapper.ts +++ b/packages/ensjs/src/contracts/nameWrapper.ts @@ -1,4 +1,95 @@ -export const getDataSnippet = [ +import { erc1155SafeTransferFromSnippet } from './erc1155.js' +import { erc721OwnerOfSnippet } from './erc721.js' +import { registrySetResolverSnippet } from './registry.js' + +export const nameWrapperErrors = [ + { + inputs: [], + name: 'CannotUpgrade', + type: 'error', + }, + { + inputs: [], + name: 'IncompatibleParent', + type: 'error', + }, + { + inputs: [ + { + name: 'owner', + type: 'address', + }, + ], + name: 'IncorrectTargetOwner', + type: 'error', + }, + { + inputs: [], + name: 'IncorrectTokenType', + type: 'error', + }, + { + inputs: [ + { + name: 'labelHash', + type: 'bytes32', + }, + { + name: 'expectedLabelhash', + type: 'bytes32', + }, + ], + name: 'LabelMismatch', + type: 'error', + }, + { + inputs: [ + { + name: 'label', + type: 'string', + }, + ], + name: 'LabelTooLong', + type: 'error', + }, + { + inputs: [], + name: 'LabelTooShort', + type: 'error', + }, + { + inputs: [], + name: 'NameIsNotWrapped', + type: 'error', + }, + { + inputs: [ + { + name: 'node', + type: 'bytes32', + }, + ], + name: 'OperationProhibited', + type: 'error', + }, + { + inputs: [ + { + name: 'node', + type: 'bytes32', + }, + { + name: 'addr', + type: 'address', + }, + ], + name: 'Unauthorised', + type: 'error', + }, +] as const + +export const nameWrapperGetDataSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -26,7 +117,8 @@ export const getDataSnippet = [ }, ] as const -export const setFusesSnippet = [ +export const nameWrapperSetFusesSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -50,7 +142,8 @@ export const setFusesSnippet = [ }, ] as const -export const setChildFusesSnippet = [ +export const nameWrapperSetChildFusesSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -77,7 +170,8 @@ export const setChildFusesSnippet = [ }, ] as const -export const setSubnodeRecordSnippet = [ +export const nameWrapperSetSubnodeRecordSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -121,7 +215,8 @@ export const setSubnodeRecordSnippet = [ }, ] as const -export const setRecordSnippet = [ +export const nameWrapperSetRecordSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -148,7 +243,8 @@ export const setRecordSnippet = [ }, ] as const -export const setSubnodeOwnerSnippet = [ +export const nameWrapperSetSubnodeOwnerSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -184,7 +280,8 @@ export const setSubnodeOwnerSnippet = [ }, ] as const -export const wrapSnippet = [ +export const nameWrapperWrapSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -207,7 +304,8 @@ export const wrapSnippet = [ }, ] as const -export const unwrapSnippet = [ +export const nameWrapperUnwrapSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -230,7 +328,8 @@ export const unwrapSnippet = [ }, ] as const -export const unwrapEth2ldSnippet = [ +export const nameWrapperUnwrapEth2ldSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -253,7 +352,8 @@ export const unwrapEth2ldSnippet = [ }, ] as const -export const namesSnippet = [ +export const nameWrapperNamesSnippet = [ + ...nameWrapperErrors, { inputs: [ { @@ -272,3 +372,18 @@ export const namesSnippet = [ type: 'function', }, ] as const + +export const nameWrapperSafeTransferFromSnippet = [ + ...nameWrapperErrors, + ...erc1155SafeTransferFromSnippet, +] as const + +export const nameWrapperOwnerOfSnippet = [ + ...nameWrapperErrors, + ...erc721OwnerOfSnippet, +] as const + +export const nameWrapperSetResolverSnippet = [ + ...nameWrapperErrors, + ...registrySetResolverSnippet, +] as const diff --git a/packages/ensjs/src/contracts/publicResolver.ts b/packages/ensjs/src/contracts/publicResolver.ts index 8305fd0d..1764f8aa 100644 --- a/packages/ensjs/src/contracts/publicResolver.ts +++ b/packages/ensjs/src/contracts/publicResolver.ts @@ -1,4 +1,4 @@ -export const singleAddrSnippet = [ +export const publicResolverSingleAddrSnippet = [ { inputs: [ { @@ -18,7 +18,7 @@ export const singleAddrSnippet = [ }, ] as const -export const multiAddrSnippet = [ +export const publicResolverMultiAddrSnippet = [ { inputs: [ { @@ -42,7 +42,7 @@ export const multiAddrSnippet = [ }, ] as const -export const textSnippet = [ +export const publicResolverTextSnippet = [ { inputs: [ { @@ -66,7 +66,7 @@ export const textSnippet = [ }, ] as const -export const contenthashSnippet = [ +export const publicResolverContenthashSnippet = [ { inputs: [ { @@ -88,7 +88,7 @@ export const contenthashSnippet = [ }, ] as const -export const abiSnippet = [ +export const publicResolverAbiSnippet = [ { inputs: [ { @@ -116,7 +116,7 @@ export const abiSnippet = [ }, ] as const -export const setTextSnippet = [ +export const publicResolverSetTextSnippet = [ { inputs: [ { @@ -139,7 +139,7 @@ export const setTextSnippet = [ }, ] as const -export const setAddrSnippet = [ +export const publicResolverSetAddrSnippet = [ { inputs: [ { @@ -162,7 +162,7 @@ export const setAddrSnippet = [ }, ] as const -export const setAbiSnippet = [ +export const publicResolverSetAbiSnippet = [ { inputs: [ { @@ -185,7 +185,7 @@ export const setAbiSnippet = [ }, ] as const -export const setContenthashSnippet = [ +export const publicResolverSetContenthashSnippet = [ { inputs: [ { @@ -204,7 +204,7 @@ export const setContenthashSnippet = [ }, ] as const -export const clearRecordsSnippet = [ +export const publicResolverClearRecordsSnippet = [ { inputs: [ { @@ -220,7 +220,7 @@ export const clearRecordsSnippet = [ }, ] as const -export const multicallSnippet = [ +export const publicResolverMulticallSnippet = [ { inputs: [ { diff --git a/packages/ensjs/src/contracts/registry.ts b/packages/ensjs/src/contracts/registry.ts index bda5f123..583979ca 100644 --- a/packages/ensjs/src/contracts/registry.ts +++ b/packages/ensjs/src/contracts/registry.ts @@ -1,6 +1,5 @@ -export const ownerSnippet = [ +export const registryOwnerSnippet = [ { - constant: true, inputs: [ { name: 'node', @@ -14,15 +13,13 @@ export const ownerSnippet = [ type: 'address', }, ], - payable: false, stateMutability: 'view', type: 'function', }, ] as const -export const setSubnodeRecordSnippet = [ +export const registrySetSubnodeRecordSnippet = [ { - constant: false, inputs: [ { name: 'node', @@ -47,15 +44,13 @@ export const setSubnodeRecordSnippet = [ ], name: 'setSubnodeRecord', outputs: [], - payable: false, stateMutability: 'nonpayable', type: 'function', }, ] as const -export const resolverSnippet = [ +export const registryResolverSnippet = [ { - constant: true, inputs: [ { name: 'node', @@ -69,15 +64,13 @@ export const resolverSnippet = [ type: 'address', }, ], - payable: false, stateMutability: 'view', type: 'function', }, ] as const -export const setApprovalForAllSnippet = [ +export const registrySetApprovalForAllSnippet = [ { - constant: false, inputs: [ { name: 'operator', @@ -90,15 +83,13 @@ export const setApprovalForAllSnippet = [ ], name: 'setApprovalForAll', outputs: [], - payable: false, stateMutability: 'nonpayable', type: 'function', }, ] as const -export const setResolverSnippet = [ +export const registrySetResolverSnippet = [ { - constant: false, inputs: [ { name: 'node', @@ -111,13 +102,12 @@ export const setResolverSnippet = [ ], name: 'setResolver', outputs: [], - payable: false, stateMutability: 'nonpayable', type: 'function', }, ] as const -export const setOwnerSnippet = [ +export const registrySetOwnerSnippet = [ { inputs: [ { @@ -136,7 +126,7 @@ export const setOwnerSnippet = [ }, ] as const -export const setSubnodeOwnerSnippet = [ +export const registrySetSubnodeOwnerSnippet = [ { inputs: [ { @@ -164,9 +154,8 @@ export const setSubnodeOwnerSnippet = [ }, ] as const -export const setRecordSnippet = [ +export const registrySetRecordSnippet = [ { - constant: false, inputs: [ { name: 'node', @@ -187,7 +176,6 @@ export const setRecordSnippet = [ ], name: 'setRecord', outputs: [], - payable: false, stateMutability: 'nonpayable', type: 'function', }, diff --git a/packages/ensjs/src/contracts/reverseRegistrar.ts b/packages/ensjs/src/contracts/reverseRegistrar.ts index 29ea9129..de31823f 100644 --- a/packages/ensjs/src/contracts/reverseRegistrar.ts +++ b/packages/ensjs/src/contracts/reverseRegistrar.ts @@ -1,4 +1,4 @@ -export const setNameForAddrSnippet = [ +export const reverseRegistrarSetNameForAddrSnippet = [ { inputs: [ { @@ -30,7 +30,7 @@ export const setNameForAddrSnippet = [ }, ] as const -export const setNameSnippet = [ +export const reverseRegistrarSetNameSnippet = [ { inputs: [ { diff --git a/packages/ensjs/src/contracts/types.ts b/packages/ensjs/src/contracts/types.ts deleted file mode 100644 index 7d1bf83b..00000000 --- a/packages/ensjs/src/contracts/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -export type SupportedNetworkId = '1' | '3' | '4' | '5' | '1337' - -export type ContractName = - | 'BaseRegistrarImplementation' - | 'ETHRegistrarController' - | 'Multicall' - | 'NameWrapper' - | 'DNSRegistrar' - | 'PublicResolver' - | 'ENSRegistry' - | 'ReverseRegistrar' - | 'UniversalResolver' - | 'BulkRenewal' - | 'DNSSECImpl' - | 'LegacyDNSRegistrar' - | 'LegacyDNSSECImpl' diff --git a/packages/ensjs/src/contracts/universalResolver.ts b/packages/ensjs/src/contracts/universalResolver.ts index 6dcfebcd..525686db 100644 --- a/packages/ensjs/src/contracts/universalResolver.ts +++ b/packages/ensjs/src/contracts/universalResolver.ts @@ -1,4 +1,18 @@ -export const reverseSnippet = [ +export const universalResolverErrors = [ + { + inputs: [], + name: 'ResolverNotFound', + type: 'error', + }, + { + inputs: [], + name: 'ResolverWildcardNotSupported', + type: 'error', + }, +] as const + +export const universalResolverReverseSnippet = [ + ...universalResolverErrors, { inputs: [ { @@ -18,7 +32,8 @@ export const reverseSnippet = [ }, ] as const -export const resolveSnippet = [ +export const universalResolverResolveSnippet = [ + ...universalResolverErrors, { inputs: [ { @@ -46,7 +61,8 @@ export const resolveSnippet = [ }, ] as const -export const resolveArraySnippet = [ +export const universalResolverResolveArraySnippet = [ + ...universalResolverErrors, { inputs: [ { @@ -74,7 +90,8 @@ export const resolveArraySnippet = [ }, ] as const -export const findResolverSnippet = [ +export const universalResolverFindResolverSnippet = [ + ...universalResolverErrors, { inputs: [ { diff --git a/packages/ensjs/src/dns.ts b/packages/ensjs/src/dns.ts new file mode 100644 index 00000000..1c52c8b7 --- /dev/null +++ b/packages/ensjs/src/dns.ts @@ -0,0 +1,16 @@ +export { + default as getDnsOwner, + type GetDnsOwnerParameters, + type GetDnsOwnerReturnType, +} from './functions/dns/getDnsOwner.js' +export { + default as importDnsName, + type ImportDnsNameParameters, + type ImportDnsNameReturnType, +} from './functions/dns/importDnsName.js' +export { + default as prepareDnsImport, + type PrepareDnsImportParameters, + type PrepareDnsImportReturnType, +} from './functions/dns/prepareDnsImport.js' +export type { Endpoint } from './functions/dns/types.js' diff --git a/packages/ensjs/src/errors/base.ts b/packages/ensjs/src/errors/base.ts index 9b408fb2..99c3ed9b 100644 --- a/packages/ensjs/src/errors/base.ts +++ b/packages/ensjs/src/errors/base.ts @@ -1,4 +1,4 @@ -import { getVersion } from './error-utils' +import { getVersion } from './error-utils.js' type BaseErrorParameters = { metaMessages?: string[] diff --git a/packages/ensjs/src/errors/contracts.ts b/packages/ensjs/src/errors/contracts.ts index fc020371..092b38ca 100644 --- a/packages/ensjs/src/errors/contracts.ts +++ b/packages/ensjs/src/errors/contracts.ts @@ -1,4 +1,4 @@ -import { BaseError } from './base' +import { BaseError } from './base.js' export class UnsupportedNetworkError extends BaseError { network: string diff --git a/packages/ensjs/src/errors/dns.ts b/packages/ensjs/src/errors/dns.ts index 249bee97..6e50a55a 100644 --- a/packages/ensjs/src/errors/dns.ts +++ b/packages/ensjs/src/errors/dns.ts @@ -1,4 +1,4 @@ -import { BaseError } from './base' +import { BaseError } from './base.js' export class DnsResponseStatusError extends BaseError { responseStatus: string diff --git a/packages/ensjs/src/errors/error-utils.ts b/packages/ensjs/src/errors/error-utils.ts index 4296544b..faa3b5cc 100644 --- a/packages/ensjs/src/errors/error-utils.ts +++ b/packages/ensjs/src/errors/error-utils.ts @@ -1,3 +1,3 @@ -import { version } from './version' +import { version } from './version.js' export const getVersion = () => `@ensdomains/ensjs@${version}` diff --git a/packages/ensjs/src/errors/general.ts b/packages/ensjs/src/errors/general.ts index 428f6792..608b5bcb 100644 --- a/packages/ensjs/src/errors/general.ts +++ b/packages/ensjs/src/errors/general.ts @@ -1,5 +1,5 @@ -import { NameType } from '../types' -import { BaseError } from './base' +import type { NameType } from '../types.js' +import { BaseError } from './base.js' export class AdditionalParameterSpecifiedError extends BaseError { parameter: string diff --git a/packages/ensjs/src/errors/public.ts b/packages/ensjs/src/errors/public.ts index 9ad1265a..54359210 100644 --- a/packages/ensjs/src/errors/public.ts +++ b/packages/ensjs/src/errors/public.ts @@ -1,4 +1,4 @@ -import { BaseError } from './base' +import { BaseError } from './base.js' export class CoinFormatterNotFoundError extends BaseError { coinType: string | number diff --git a/packages/ensjs/src/errors/subgraph.ts b/packages/ensjs/src/errors/subgraph.ts index d2f8525d..db5a0cbd 100644 --- a/packages/ensjs/src/errors/subgraph.ts +++ b/packages/ensjs/src/errors/subgraph.ts @@ -1,4 +1,4 @@ -import { BaseError } from './base' +import { BaseError } from './base.js' export class InvalidFilterKeyError extends BaseError { filterKey: string diff --git a/packages/ensjs/src/errors/utils.ts b/packages/ensjs/src/errors/utils.ts index 998cc045..2fc115a7 100644 --- a/packages/ensjs/src/errors/utils.ts +++ b/packages/ensjs/src/errors/utils.ts @@ -1,4 +1,4 @@ -import { BaseError } from './base' +import { BaseError } from './base.js' export class FusesOutOfRangeError extends BaseError { override name = 'FusesOutOfRangeError' diff --git a/packages/ensjs/src/functions/dns/getDnsOwner.test.ts b/packages/ensjs/src/functions/dns/getDnsOwner.test.ts index 2a696a2b..25e3a5c5 100644 --- a/packages/ensjs/src/functions/dns/getDnsOwner.test.ts +++ b/packages/ensjs/src/functions/dns/getDnsOwner.test.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type { RequestListener } from 'http' -import { createHttpServer } from '../../tests/createHttpServer' -import getDnsOwner from './getDnsOwner' +import { createHttpServer } from '../../tests/createHttpServer.js' +import getDnsOwner from './getDnsOwner.js' const handler: jest.MockedFunction = jest.fn() let closeServer: () => Promise @@ -75,7 +75,7 @@ it('throws error if >2ld', async () => { `) }) it('returns error if DnsResponseStatus is not NOERROR', async () => { - handler.mockImplementation((req, res) => { + handler.mockImplementation((_req, res) => { res.writeHead(200, { 'Content-Type': 'application/dns-json' }) res.end( JSON.stringify({ @@ -94,7 +94,7 @@ it('returns error if DnsResponseStatus is not NOERROR', async () => { `) }) it('returns error if AD is false', async () => { - handler.mockImplementation((req, res) => { + handler.mockImplementation((_req, res) => { res.writeHead(200, { 'Content-Type': 'application/dns-json' }) res.end( JSON.stringify({ @@ -113,7 +113,7 @@ it('returns error if AD is false', async () => { `) }) it('returns error if no TXT record', async () => { - handler.mockImplementation((req, res) => { + handler.mockImplementation((_req, res) => { res.writeHead(200, { 'Content-Type': 'application/dns-json' }) res.end( JSON.stringify({ @@ -133,7 +133,7 @@ it('returns error if no TXT record', async () => { `) }) it('returns error if TXT record is not formatted correctly', async () => { - handler.mockImplementation((req, res) => { + handler.mockImplementation((_req, res) => { res.writeHead(200, { 'Content-Type': 'application/dns-json' }) res.end( JSON.stringify({ @@ -160,7 +160,7 @@ it('returns error if TXT record is not formatted correctly', async () => { `) }) it('returns error if address is not checksummed', async () => { - handler.mockImplementation((req, res) => { + handler.mockImplementation((_req, res) => { res.writeHead(200, { 'Content-Type': 'application/dns-json' }) res.end( JSON.stringify({ diff --git a/packages/ensjs/src/functions/dns/getDnsOwner.ts b/packages/ensjs/src/functions/dns/getDnsOwner.ts index 56042308..78913145 100644 --- a/packages/ensjs/src/functions/dns/getDnsOwner.ts +++ b/packages/ensjs/src/functions/dns/getDnsOwner.ts @@ -1,14 +1,14 @@ -import { Address, getAddress } from 'viem' +import { getAddress, type Address } from 'viem' import { DnsDnssecVerificationFailedError, DnsInvalidAddressChecksumError, DnsInvalidTxtRecordError, DnsNoTxtRecordError, DnsResponseStatusError, -} from '../../errors/dns' -import { UnsupportedNameTypeError } from '../../errors/general' -import { getNameType } from '../../utils/getNameType' -import { Endpoint } from './types' +} from '../../errors/dns.js' +import { UnsupportedNameTypeError } from '../../errors/general.js' +import { getNameType } from '../../utils/getNameType.js' +import type { Endpoint } from './types.js' export type GetDnsOwnerParameters = { /** Name to get the owner for */ diff --git a/packages/ensjs/src/functions/dns/importDnsName.test.ts b/packages/ensjs/src/functions/dns/importDnsName.test.ts index 468248f9..693da406 100644 --- a/packages/ensjs/src/functions/dns/importDnsName.test.ts +++ b/packages/ensjs/src/functions/dns/importDnsName.test.ts @@ -1,15 +1,15 @@ -import { Address, Hex, parseEther } from 'viem' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' +import { parseEther, type Address, type Hex } from 'viem' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getOwner from '../public/getOwner' -import getResolver from '../public/getResolver' -import importDnsName from './importDnsName' -import prepareDnsImport from './prepareDnsImport' +} from '../../tests/addTestContracts.js' +import getOwner from '../public/getOwner.js' +import getResolver from '../public/getResolver.js' +import importDnsName from './importDnsName.js' +import prepareDnsImport from './prepareDnsImport.js' const name = 'taytems.xyz' const address = '0x8e8Db5CcEF88cca9d624701Db544989C996E3216' diff --git a/packages/ensjs/src/functions/dns/importDnsName.ts b/packages/ensjs/src/functions/dns/importDnsName.ts index e47bef85..fa3c7ea7 100644 --- a/packages/ensjs/src/functions/dns/importDnsName.ts +++ b/packages/ensjs/src/functions/dns/importDnsName.ts @@ -1,27 +1,27 @@ import { - Account, - Address, - Hash, - SendTransactionParameters, - Transport, bytesToHex, encodeFunctionData, toHex, + type Account, + type Address, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { - proveAndClaimSnippet, - proveAndClaimWithResolverSnippet, -} from '../../contracts/dnsRegistrar' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { AdditionalParameterSpecifiedError } from '../../errors/general' +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' import { + dnsRegistrarProveAndClaimSnippet, + dnsRegistrarProveAndClaimWithResolverSnippet, +} from '../../contracts/dnsRegistrar.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { AdditionalParameterSpecifiedError } from '../../errors/general.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { packetToBytes } from '../../utils/hexEncodedName' -import { PrepareDnsImportReturnType } from './prepareDnsImport' +} from '../../types.js' +import { packetToBytes } from '../../utils/hexEncodedName.js' +import type { PrepareDnsImportReturnType } from './prepareDnsImport.js' type BaseImportDnsNameDataParameters = { /** Name to import */ @@ -88,7 +88,7 @@ export const makeFunctionData = < return { to: dnsRegistrarAddress, data: encodeFunctionData({ - abi: proveAndClaimSnippet, + abi: dnsRegistrarProveAndClaimSnippet, functionName: 'proveAndClaim', args: [hexEncodedName, data, bytesToHex(preparedData.proof)], }), @@ -102,7 +102,7 @@ export const makeFunctionData = < return { to: dnsRegistrarAddress, data: encodeFunctionData({ - abi: proveAndClaimWithResolverSnippet, + abi: dnsRegistrarProveAndClaimWithResolverSnippet, functionName: 'proveAndClaimWithResolver', args: [ hexEncodedName, diff --git a/packages/ensjs/src/functions/dns/index.ts b/packages/ensjs/src/functions/dns/index.ts deleted file mode 100644 index 5fd0564c..00000000 --- a/packages/ensjs/src/functions/dns/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export { - GetDnsOwnerParameters, - GetDnsOwnerReturnType, - default as getDnsOwner, -} from './getDnsOwner' -export { - ImportDnsNameParameters, - ImportDnsNameReturnType, - default as importDnsName, -} from './importDnsName' -export { - PrepareDnsImportParameters, - PrepareDnsImportReturnType, - default as prepareDnsImport, -} from './prepareDnsImport' diff --git a/packages/ensjs/src/functions/dns/prepareDnsImport.test.ts b/packages/ensjs/src/functions/dns/prepareDnsImport.test.ts index 8316531d..feef2dac 100644 --- a/packages/ensjs/src/functions/dns/prepareDnsImport.test.ts +++ b/packages/ensjs/src/functions/dns/prepareDnsImport.test.ts @@ -1,13 +1,13 @@ import { SignedSet } from '@ensdomains/dnsprovejs' -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import importDnsName from './importDnsName' -import prepareDnsImport, { RrSetWithSig } from './prepareDnsImport' +} from '../../tests/addTestContracts.js' +import importDnsName from './importDnsName.js' +import prepareDnsImport, { type RrSetWithSig } from './prepareDnsImport.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/dns/prepareDnsImport.ts b/packages/ensjs/src/functions/dns/prepareDnsImport.ts index 3039b0b8..2d79261d 100644 --- a/packages/ensjs/src/functions/dns/prepareDnsImport.ts +++ b/packages/ensjs/src/functions/dns/prepareDnsImport.ts @@ -1,14 +1,17 @@ -import { type ProvableAnswer, type SignedSet } from '@ensdomains/dnsprovejs' +import type { ProvableAnswer, SignedSet } from '@ensdomains/dnsprovejs' import type * as packet from 'dns-packet' -import { toType } from 'dns-packet/types' +import { toType } from 'dns-packet/types.js' import { keccak256, toBytes, toHex } from 'viem' import { readContract } from 'viem/actions' -import { ClientWithEns } from '../../contracts/consts' -import { anchorsSnippet, rrDataSnippet } from '../../contracts/dnssecImpl' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { DnsNewerRecordTypeAvailableError } from '../../errors/dns' -import { packetToBytes } from '../../utils/hexEncodedName' -import { Endpoint } from './types' +import type { ClientWithEns } from '../../contracts/consts.js' +import { + dnssecImplAnchorsSnippet, + dnssecImplRrDataSnippet, +} from '../../contracts/dnssecImpl.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { DnsNewerRecordTypeAvailableError } from '../../errors/dns.js' +import { packetToBytes } from '../../utils/hexEncodedName.js' +import type { Endpoint } from './types.js' export type PrepareDnsImportParameters = { /** Name to prepare for DNS import */ @@ -89,7 +92,7 @@ const prepareDnsImport = async ( const type = toType(proof.signature.data.typeCovered) // eslint-disable-next-line no-await-in-loop const [inception, expiration, hash] = await readContract(client, { - abi: rrDataSnippet, + abi: dnssecImplRrDataSnippet, address: ensDnssecImplAddress, functionName: 'rrdata', args: [type, hexEncodedName], @@ -119,7 +122,7 @@ const prepareDnsImport = async ( rrsets: encodeProofs(allProofs), proof: toBytes( await readContract(client, { - abi: anchorsSnippet, + abi: dnssecImplAnchorsSnippet, address: ensDnssecImplAddress, functionName: 'anchors', }), diff --git a/packages/ensjs/src/functions/index.ts b/packages/ensjs/src/functions/index.ts deleted file mode 100644 index 5d4cd340..00000000 --- a/packages/ensjs/src/functions/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './dns' -export * from './public' -export * from './subgraph' -export * from './wallet' diff --git a/packages/ensjs/src/functions/public/_getAbi.ts b/packages/ensjs/src/functions/public/_getAbi.ts index 69846ebc..787fdbf2 100644 --- a/packages/ensjs/src/functions/public/_getAbi.ts +++ b/packages/ensjs/src/functions/public/_getAbi.ts @@ -1,16 +1,20 @@ import { - Hex, decodeFunctionResult, encodeFunctionData, hexToBytes, hexToString, + type Hex, } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { abiSnippet } from '../../contracts/publicResolver' -import { DecodedAbi, Prettify, SimpleTransactionRequest } from '../../types' -import { EMPTY_ADDRESS } from '../../utils/consts' -import { generateFunction } from '../../utils/generateFunction' -import { namehash } from '../../utils/normalise' +import type { ClientWithEns } from '../../contracts/consts.js' +import { publicResolverAbiSnippet } from '../../contracts/publicResolver.js' +import type { + DecodedAbi, + Prettify, + SimpleTransactionRequest, +} from '../../types.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' +import { generateFunction } from '../../utils/generateFunction.js' +import { namehash } from '../../utils/normalise.js' export type InternalGetAbiParameters = { /** Name to get ABI record for */ @@ -33,7 +37,7 @@ const encode = ( return { to: EMPTY_ADDRESS, data: encodeFunctionData({ - abi: abiSnippet, + abi: publicResolverAbiSnippet, functionName: 'ABI', args: [namehash(name), supportedContentTypes], }), @@ -45,7 +49,7 @@ const decode = async ( data: Hex, ): Promise => { const [bigintContentType, encodedAbiData] = decodeFunctionResult({ - abi: abiSnippet, + abi: publicResolverAbiSnippet, functionName: 'ABI', data, }) diff --git a/packages/ensjs/src/functions/public/_getAddr.ts b/packages/ensjs/src/functions/public/_getAddr.ts index 8f666065..af746d74 100644 --- a/packages/ensjs/src/functions/public/_getAddr.ts +++ b/packages/ensjs/src/functions/public/_getAddr.ts @@ -1,16 +1,20 @@ import { formatsByCoinType, formatsByName } from '@ensdomains/address-encoder' -import { Hex, decodeFunctionResult, encodeFunctionData, trim } from 'viem' -import { namehash } from '../../utils/normalise' +import { decodeFunctionResult, encodeFunctionData, trim, type Hex } from 'viem' +import { namehash } from '../../utils/normalise.js' -import { ClientWithEns } from '../../contracts/consts' +import type { ClientWithEns } from '../../contracts/consts.js' import { - multiAddrSnippet, - singleAddrSnippet, -} from '../../contracts/publicResolver' -import { CoinFormatterNotFoundError } from '../../errors/public' -import { DecodedAddr, Prettify, SimpleTransactionRequest } from '../../types' -import { EMPTY_ADDRESS } from '../../utils/consts' -import { generateFunction } from '../../utils/generateFunction' + publicResolverMultiAddrSnippet, + publicResolverSingleAddrSnippet, +} from '../../contracts/publicResolver.js' +import { CoinFormatterNotFoundError } from '../../errors/public.js' +import type { + DecodedAddr, + Prettify, + SimpleTransactionRequest, +} from '../../types.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' +import { generateFunction } from '../../utils/generateFunction.js' export type InternalGetAddrParameters = { /** Name to get the address record for */ @@ -31,7 +35,7 @@ const encode = ( return { to: EMPTY_ADDRESS, data: encodeFunctionData({ - abi: singleAddrSnippet, + abi: publicResolverSingleAddrSnippet, functionName: 'addr', args: [namehash(name)], }), @@ -42,7 +46,7 @@ const encode = ( return { to: EMPTY_ADDRESS, data: encodeFunctionData({ - abi: multiAddrSnippet, + abi: publicResolverMultiAddrSnippet, functionName: 'addr', args: [namehash(name), BigInt(coin)], }), @@ -58,7 +62,7 @@ const encode = ( return { to: EMPTY_ADDRESS, data: encodeFunctionData({ - abi: multiAddrSnippet, + abi: publicResolverMultiAddrSnippet, functionName: 'addr', args: [namehash(name), BigInt(formatter.coinType)], }), @@ -83,13 +87,13 @@ const decode = async ( if (coin === 60 || coin === '60') { response = decodeFunctionResult({ - abi: singleAddrSnippet, + abi: publicResolverSingleAddrSnippet, functionName: 'addr', data, }) } else { response = decodeFunctionResult({ - abi: multiAddrSnippet, + abi: publicResolverMultiAddrSnippet, functionName: 'addr', data, }) diff --git a/packages/ensjs/src/functions/public/_getContentHash.ts b/packages/ensjs/src/functions/public/_getContentHash.ts index 33b0840c..e7a0c7e9 100644 --- a/packages/ensjs/src/functions/public/_getContentHash.ts +++ b/packages/ensjs/src/functions/public/_getContentHash.ts @@ -1,11 +1,14 @@ -import { Hex, decodeFunctionResult, encodeFunctionData } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { contenthashSnippet } from '../../contracts/publicResolver' -import { Prettify, SimpleTransactionRequest } from '../../types' -import { EMPTY_ADDRESS } from '../../utils/consts' -import { DecodedContentHash, decodeContenthash } from '../../utils/contentHash' -import { generateFunction } from '../../utils/generateFunction' -import { namehash } from '../../utils/normalise' +import { decodeFunctionResult, encodeFunctionData, type Hex } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import { publicResolverContenthashSnippet } from '../../contracts/publicResolver.js' +import type { Prettify, SimpleTransactionRequest } from '../../types.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' +import { + decodeContenthash, + type DecodedContentHash, +} from '../../utils/contentHash.js' +import { generateFunction } from '../../utils/generateFunction.js' +import { namehash } from '../../utils/normalise.js' export type InternalGetContentHashParameters = { /** Name to get content hash record for */ @@ -22,7 +25,7 @@ const encode = ( return { to: EMPTY_ADDRESS, data: encodeFunctionData({ - abi: contenthashSnippet, + abi: publicResolverContenthashSnippet, functionName: 'contenthash', args: [namehash(name)], }), @@ -34,7 +37,7 @@ const decode = async ( data: Hex, ): Promise => { const response = decodeFunctionResult({ - abi: contenthashSnippet, + abi: publicResolverContenthashSnippet, functionName: 'contenthash', data, }) diff --git a/packages/ensjs/src/functions/public/_getText.ts b/packages/ensjs/src/functions/public/_getText.ts index d0e01e5b..bea4ba2e 100644 --- a/packages/ensjs/src/functions/public/_getText.ts +++ b/packages/ensjs/src/functions/public/_getText.ts @@ -1,10 +1,10 @@ -import { Hex, decodeFunctionResult, encodeFunctionData } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { textSnippet } from '../../contracts/publicResolver' -import { SimpleTransactionRequest } from '../../types' -import { EMPTY_ADDRESS } from '../../utils/consts' -import { generateFunction } from '../../utils/generateFunction' -import { namehash } from '../../utils/normalise' +import { decodeFunctionResult, encodeFunctionData, type Hex } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import { publicResolverTextSnippet } from '../../contracts/publicResolver.js' +import type { SimpleTransactionRequest } from '../../types.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' +import { generateFunction } from '../../utils/generateFunction.js' +import { namehash } from '../../utils/normalise.js' export type InternalGetTextParameters = { /** Name to get text record for */ @@ -22,7 +22,7 @@ const encode = ( return { to: EMPTY_ADDRESS, data: encodeFunctionData({ - abi: textSnippet, + abi: publicResolverTextSnippet, functionName: 'text', args: [namehash(name), key], }), @@ -34,7 +34,7 @@ const decode = async ( data: Hex, ): Promise => { const response = decodeFunctionResult({ - abi: textSnippet, + abi: publicResolverTextSnippet, functionName: 'text', data, }) diff --git a/packages/ensjs/src/functions/public/batch.test.ts b/packages/ensjs/src/functions/public/batch.test.ts index 7c9a856c..9430f291 100644 --- a/packages/ensjs/src/functions/public/batch.test.ts +++ b/packages/ensjs/src/functions/public/batch.test.ts @@ -1,11 +1,11 @@ import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' -import { addEnsContracts } from '../../contracts' -import { publicClient } from '../../tests/addTestContracts' -import batch from './batch' -import getAddressRecord from './getAddressRecord' -import getName from './getName' -import getText from './getTextRecord' +import { addEnsContracts } from '../../contracts/addEnsContracts.js' +import { publicClient } from '../../tests/addTestContracts.js' +import batch from './batch.js' +import getAddressRecord from './getAddressRecord.js' +import getName from './getName.js' +import getText from './getTextRecord.js' const mainnetPublicClient = createPublicClient({ chain: addEnsContracts(mainnet), diff --git a/packages/ensjs/src/functions/public/batch.ts b/packages/ensjs/src/functions/public/batch.ts index bd033834..717ff1a0 100644 --- a/packages/ensjs/src/functions/public/batch.ts +++ b/packages/ensjs/src/functions/public/batch.ts @@ -1,16 +1,16 @@ import type { Hex } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { FunctionNotBatchableError } from '../../errors/public' -import { +import type { ClientWithEns } from '../../contracts/consts.js' +import { FunctionNotBatchableError } from '../../errors/public.js' +import type { SimpleTransactionRequest, TransactionRequestWithPassthrough, -} from '../../types' +} from '../../types.js' import { - BatchFunctionResult, - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' -import multicallWrapper from './multicallWrapper' + type BatchFunctionResult, + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import multicallWrapper from './multicallWrapper.js' type ExtractResult = TFunction extends { decode: (...args: any[]) => Promise diff --git a/packages/ensjs/src/functions/public/ccip.test.ts b/packages/ensjs/src/functions/public/ccip.test.ts index 7c377e96..c759395c 100644 --- a/packages/ensjs/src/functions/public/ccip.test.ts +++ b/packages/ensjs/src/functions/public/ccip.test.ts @@ -1,10 +1,10 @@ import { createPublicClient, http } from 'viem' import { goerli } from 'viem/chains' -import { addEnsContracts } from '../../contracts' -import batch from './batch' -import getAddressRecord from './getAddressRecord' -import getRecords from './getRecords' -import getText from './getTextRecord' +import { addEnsContracts } from '../../contracts/addEnsContracts.js' +import batch from './batch.js' +import getAddressRecord from './getAddressRecord.js' +import getRecords from './getRecords.js' +import getText from './getTextRecord.js' const goerliPublicClient = createPublicClient({ chain: addEnsContracts(goerli), diff --git a/packages/ensjs/src/functions/public/getAbiRecord.test.ts b/packages/ensjs/src/functions/public/getAbiRecord.test.ts index b7fbe8fd..dd9046e2 100644 --- a/packages/ensjs/src/functions/public/getAbiRecord.test.ts +++ b/packages/ensjs/src/functions/public/getAbiRecord.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getAbiRecord from './getAbiRecord' +import { publicClient } from '../../tests/addTestContracts.js' +import getAbiRecord from './getAbiRecord.js' const dummyABI = [ { diff --git a/packages/ensjs/src/functions/public/getAbiRecord.ts b/packages/ensjs/src/functions/public/getAbiRecord.ts index 670dbd43..a132c47f 100644 --- a/packages/ensjs/src/functions/public/getAbiRecord.ts +++ b/packages/ensjs/src/functions/public/getAbiRecord.ts @@ -1,15 +1,15 @@ -import { Hex } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { Prettify, SimpleTransactionRequest } from '../../types' +import type { Hex } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import type { Prettify, SimpleTransactionRequest } from '../../types.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' + type GeneratedFunction, +} from '../../utils/generateFunction.js' import _getAbi, { - InternalGetAbiParameters, - InternalGetAbiReturnType, -} from './_getAbi' -import universalWrapper from './universalWrapper' + type InternalGetAbiParameters, + type InternalGetAbiReturnType, +} from './_getAbi.js' +import universalWrapper from './universalWrapper.js' export type GetAbiRecordParameters = Prettify diff --git a/packages/ensjs/src/functions/public/getAddressRecord.test.ts b/packages/ensjs/src/functions/public/getAddressRecord.test.ts index e955f745..2382c048 100644 --- a/packages/ensjs/src/functions/public/getAddressRecord.test.ts +++ b/packages/ensjs/src/functions/public/getAddressRecord.test.ts @@ -1,8 +1,8 @@ import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' -import { addEnsContracts } from '../../contracts' -import { publicClient } from '../../tests/addTestContracts' -import getAddressRecord from './getAddressRecord' +import { addEnsContracts } from '../../contracts/addEnsContracts.js' +import { publicClient } from '../../tests/addTestContracts.js' +import getAddressRecord from './getAddressRecord.js' const mainnetPublicClient = createPublicClient({ chain: addEnsContracts(mainnet), diff --git a/packages/ensjs/src/functions/public/getAddressRecord.ts b/packages/ensjs/src/functions/public/getAddressRecord.ts index 38c24462..18c98544 100644 --- a/packages/ensjs/src/functions/public/getAddressRecord.ts +++ b/packages/ensjs/src/functions/public/getAddressRecord.ts @@ -1,15 +1,15 @@ -import { Hex } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { Prettify, SimpleTransactionRequest } from '../../types' +import type { Hex } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import type { Prettify, SimpleTransactionRequest } from '../../types.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' + type GeneratedFunction, +} from '../../utils/generateFunction.js' import _getAddr, { - InternalGetAddrParameters, - InternalGetAddrReturnType, -} from './_getAddr' -import universalWrapper from './universalWrapper' + type InternalGetAddrParameters, + type InternalGetAddrReturnType, +} from './_getAddr.js' +import universalWrapper from './universalWrapper.js' export type GetAddressRecordParameters = Prettify diff --git a/packages/ensjs/src/functions/public/getAvailable.test.ts b/packages/ensjs/src/functions/public/getAvailable.test.ts index 77e1984f..d856f700 100644 --- a/packages/ensjs/src/functions/public/getAvailable.test.ts +++ b/packages/ensjs/src/functions/public/getAvailable.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getAvailable from './getAvailable' +import { publicClient } from '../../tests/addTestContracts.js' +import getAvailable from './getAvailable.js' describe('getAvailable', () => { it('should return false for a name that is unavailable', async () => { diff --git a/packages/ensjs/src/functions/public/getAvailable.ts b/packages/ensjs/src/functions/public/getAvailable.ts index ff9cd70f..5f558ab5 100644 --- a/packages/ensjs/src/functions/public/getAvailable.ts +++ b/packages/ensjs/src/functions/public/getAvailable.ts @@ -1,14 +1,19 @@ -import { Hex, decodeFunctionResult, encodeFunctionData, labelhash } from 'viem' -import { availableSnippet } from '../../contracts/baseRegistrar' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { UnsupportedNameTypeError } from '../../errors/general' -import { SimpleTransactionRequest } from '../../types' import { - GeneratedFunction, + decodeFunctionResult, + encodeFunctionData, + labelhash, + type Hex, +} from 'viem' +import { baseRegistrarAvailableSnippet } from '../../contracts/baseRegistrar.js' +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { UnsupportedNameTypeError } from '../../errors/general.js' +import type { SimpleTransactionRequest } from '../../types.js' +import { generateFunction, -} from '../../utils/generateFunction' -import { getNameType } from '../../utils/getNameType' + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import { getNameType } from '../../utils/getNameType.js' export type GetAvailableParameters = { /** Name to check availability for, only compatible for eth 2ld */ @@ -36,7 +41,7 @@ const encode = ( contract: 'ensBaseRegistrarImplementation', }), data: encodeFunctionData({ - abi: availableSnippet, + abi: baseRegistrarAvailableSnippet, functionName: 'available', args: [BigInt(labelhash(labels[0]))], }), @@ -48,7 +53,7 @@ const decode = async ( data: Hex, ): Promise => { const result = decodeFunctionResult({ - abi: availableSnippet, + abi: baseRegistrarAvailableSnippet, functionName: 'available', data, }) diff --git a/packages/ensjs/src/functions/public/getContentHashRecord.test.ts b/packages/ensjs/src/functions/public/getContentHashRecord.test.ts index 6b05d5c2..e91f7d92 100644 --- a/packages/ensjs/src/functions/public/getContentHashRecord.test.ts +++ b/packages/ensjs/src/functions/public/getContentHashRecord.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getContentHashRecord from './getContentHashRecord' +import { publicClient } from '../../tests/addTestContracts.js' +import getContentHashRecord from './getContentHashRecord.js' describe('getContentHashRecord', () => { it('should return null for a non-existent name', async () => { diff --git a/packages/ensjs/src/functions/public/getContentHashRecord.ts b/packages/ensjs/src/functions/public/getContentHashRecord.ts index 11a7934a..82f8a405 100644 --- a/packages/ensjs/src/functions/public/getContentHashRecord.ts +++ b/packages/ensjs/src/functions/public/getContentHashRecord.ts @@ -1,15 +1,15 @@ -import { Hex } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { Prettify, SimpleTransactionRequest } from '../../types' +import type { Hex } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import type { Prettify, SimpleTransactionRequest } from '../../types.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' + type GeneratedFunction, +} from '../../utils/generateFunction.js' import _getContentHash, { - InternalGetContentHashParameters, - InternalGetContentHashReturnType, -} from './_getContentHash' -import universalWrapper from './universalWrapper' + type InternalGetContentHashParameters, + type InternalGetContentHashReturnType, +} from './_getContentHash.js' +import universalWrapper from './universalWrapper.js' export type GetContentHashRecordParameters = Prettify diff --git a/packages/ensjs/src/functions/public/getExpiry.test.ts b/packages/ensjs/src/functions/public/getExpiry.test.ts index ae8170bc..55b2a0c1 100644 --- a/packages/ensjs/src/functions/public/getExpiry.test.ts +++ b/packages/ensjs/src/functions/public/getExpiry.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getExpiry from './getExpiry' +import { publicClient } from '../../tests/addTestContracts.js' +import getExpiry from './getExpiry.js' describe('getExpiry', () => { it('should get the expiry for a .eth name with no other args', async () => { diff --git a/packages/ensjs/src/functions/public/getExpiry.ts b/packages/ensjs/src/functions/public/getExpiry.ts index e0524939..3e23b04d 100644 --- a/packages/ensjs/src/functions/public/getExpiry.ts +++ b/packages/ensjs/src/functions/public/getExpiry.ts @@ -1,21 +1,30 @@ -import { Hex, decodeFunctionResult, encodeFunctionData, labelhash } from 'viem' import { - gracePeriodSnippet, - nameExpiresSnippet, -} from '../../contracts/baseRegistrar' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { getCurrentBlockTimestampSnippet } from '../../contracts/multicall' -import { getDataSnippet } from '../../contracts/nameWrapper' -import { DateWithValue, Prettify, SimpleTransactionRequest } from '../../types' + decodeFunctionResult, + encodeFunctionData, + labelhash, + type Hex, +} from 'viem' +import { + baseRegistrarGracePeriodSnippet, + baseRegistrarNameExpiresSnippet, +} from '../../contracts/baseRegistrar.js' +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { multicallGetCurrentBlockTimestampSnippet } from '../../contracts/multicall.js' +import { nameWrapperGetDataSnippet } from '../../contracts/nameWrapper.js' +import type { + DateWithValue, + Prettify, + SimpleTransactionRequest, +} from '../../types.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' -import { makeSafeSecondsDate } from '../../utils/makeSafeSecondsDate' -import { namehash } from '../../utils/normalise' -import { checkIsDotEth } from '../../utils/validation' -import multicallWrapper from './multicallWrapper' + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import { makeSafeSecondsDate } from '../../utils/makeSafeSecondsDate.js' +import { namehash } from '../../utils/normalise.js' +import { checkIsDotEth } from '../../utils/validation.js' +import multicallWrapper from './multicallWrapper.js' type ContractOption = 'registrar' | 'nameWrapper' type ExpiryStatus = 'active' | 'expired' | 'gracePeriod' @@ -59,7 +68,7 @@ const encode = ( { to: getChainContractAddress({ client, contract: 'multicall3' }), data: encodeFunctionData({ - abi: getCurrentBlockTimestampSnippet, + abi: multicallGetCurrentBlockTimestampSnippet, functionName: 'getCurrentBlockTimestamp', }), }, @@ -69,7 +78,7 @@ const encode = ( calls.push({ to: getChainContractAddress({ client, contract: 'ensNameWrapper' }), data: encodeFunctionData({ - abi: getDataSnippet, + abi: nameWrapperGetDataSnippet, functionName: 'getData', args: [BigInt(namehash(labels.join('.')))], }), @@ -82,7 +91,7 @@ const encode = ( calls.push({ to: baseRegistrarImplementationAddress, data: encodeFunctionData({ - abi: nameExpiresSnippet, + abi: baseRegistrarNameExpiresSnippet, functionName: 'nameExpires', args: [BigInt(labelhash(labels[0]))], }), @@ -90,7 +99,7 @@ const encode = ( calls.push({ to: baseRegistrarImplementationAddress, data: encodeFunctionData({ - abi: gracePeriodSnippet, + abi: baseRegistrarGracePeriodSnippet, functionName: 'GRACE_PERIOD', }), }) @@ -108,7 +117,7 @@ const decode = async ( const result = await multicallWrapper.decode(client, data, []) const blockTimestamp = decodeFunctionResult({ - abi: getCurrentBlockTimestampSnippet, + abi: multicallGetCurrentBlockTimestampSnippet, functionName: 'getCurrentBlockTimestamp', data: result[0].returnData, }) @@ -120,18 +129,18 @@ const decode = async ( if (contractToUse === 'nameWrapper') { ;[, , expiry] = decodeFunctionResult({ - abi: getDataSnippet, + abi: nameWrapperGetDataSnippet, functionName: 'getData', data: result[1].returnData, }) } else { expiry = decodeFunctionResult({ - abi: nameExpiresSnippet, + abi: baseRegistrarNameExpiresSnippet, functionName: 'nameExpires', data: result[1].returnData, }) gracePeriod = decodeFunctionResult({ - abi: gracePeriodSnippet, + abi: baseRegistrarGracePeriodSnippet, functionName: 'GRACE_PERIOD', data: result[2].returnData, }) diff --git a/packages/ensjs/src/functions/public/getName.test.ts b/packages/ensjs/src/functions/public/getName.test.ts index 9597f52f..2aa9cb53 100644 --- a/packages/ensjs/src/functions/public/getName.test.ts +++ b/packages/ensjs/src/functions/public/getName.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getName from './getName' +import { publicClient } from '../../tests/addTestContracts.js' +import getName from './getName.js' describe('getName', () => { it('should get a primary name from an address', async () => { diff --git a/packages/ensjs/src/functions/public/getName.ts b/packages/ensjs/src/functions/public/getName.ts index 0e045a19..6a9a8b5a 100644 --- a/packages/ensjs/src/functions/public/getName.ts +++ b/packages/ensjs/src/functions/public/getName.ts @@ -1,19 +1,19 @@ import { - Address, - Hex, decodeFunctionResult, encodeFunctionData, toHex, + type Address, + type Hex, } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { reverseSnippet } from '../../contracts/universalResolver' -import { SimpleTransactionRequest } from '../../types' +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { universalResolverReverseSnippet } from '../../contracts/universalResolver.js' +import type { SimpleTransactionRequest } from '../../types.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' -import { packetToBytes } from '../../utils/hexEncodedName' + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import { packetToBytes } from '../../utils/hexEncodedName.js' export type GetNameParameters = { /** Address to get name for */ @@ -39,7 +39,7 @@ const encode = ( return { to: getChainContractAddress({ client, contract: 'ensUniversalResolver' }), data: encodeFunctionData({ - abi: reverseSnippet, + abi: universalResolverReverseSnippet, functionName: 'reverse', args: [toHex(packetToBytes(reverseNode))], }), @@ -52,7 +52,7 @@ const decode = async ( { address }: GetNameParameters, ): Promise => { const result = decodeFunctionResult({ - abi: reverseSnippet, + abi: universalResolverReverseSnippet, functionName: 'reverse', data, }) diff --git a/packages/ensjs/src/functions/public/getOwner.test.ts b/packages/ensjs/src/functions/public/getOwner.test.ts index 21c2d2c6..bf2e0f4e 100644 --- a/packages/ensjs/src/functions/public/getOwner.test.ts +++ b/packages/ensjs/src/functions/public/getOwner.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getOwner from './getOwner' +import { publicClient } from '../../tests/addTestContracts.js' +import getOwner from './getOwner.js' describe('getOwner', () => { it('should return correct ownership level and values for a wrapped .eth name', async () => { diff --git a/packages/ensjs/src/functions/public/getOwner.ts b/packages/ensjs/src/functions/public/getOwner.ts index 6d9f4bc3..3419823b 100644 --- a/packages/ensjs/src/functions/public/getOwner.ts +++ b/packages/ensjs/src/functions/public/getOwner.ts @@ -1,16 +1,19 @@ -import { Address, Hex, decodeAbiParameters } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { SimpleTransactionRequest } from '../../types' -import { EMPTY_ADDRESS } from '../../utils/consts' +import { decodeAbiParameters, type Address, type Hex } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import type { SimpleTransactionRequest } from '../../types.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' -import { namehash as makeNamehash } from '../../utils/normalise' -import { OwnerContract, ownerFromContract } from '../../utils/ownerFromContract' -import { checkIsDotEth } from '../../utils/validation' -import multicallWrapper from './multicallWrapper' + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import { namehash as makeNamehash } from '../../utils/normalise.js' +import { + ownerFromContract, + type OwnerContract, +} from '../../utils/ownerFromContract.js' +import { checkIsDotEth } from '../../utils/validation.js' +import multicallWrapper from './multicallWrapper.js' export type GetOwnerParameters = { /** Name to get owner for */ diff --git a/packages/ensjs/src/functions/public/getPrice.test.ts b/packages/ensjs/src/functions/public/getPrice.test.ts index 674db3ba..459b451c 100644 --- a/packages/ensjs/src/functions/public/getPrice.test.ts +++ b/packages/ensjs/src/functions/public/getPrice.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getPrice from './getPrice' +import { publicClient } from '../../tests/addTestContracts.js' +import getPrice from './getPrice.js' const yearCost = BigInt('8561643835626') diff --git a/packages/ensjs/src/functions/public/getPrice.ts b/packages/ensjs/src/functions/public/getPrice.ts index 32116ee8..93122512 100644 --- a/packages/ensjs/src/functions/public/getPrice.ts +++ b/packages/ensjs/src/functions/public/getPrice.ts @@ -1,16 +1,16 @@ -import { Hex, decodeFunctionResult, encodeFunctionData } from 'viem' -import { rentPriceSnippet as bulkRentPriceSnippet } from '../../contracts/bulkRenewal' -import { ClientWithEns } from '../../contracts/consts' -import { rentPriceSnippet as controllerRentPriceSnippet } from '../../contracts/ethRegistrarController' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { UnsupportedNameTypeError } from '../../errors/general' -import { SimpleTransactionRequest } from '../../types' +import { decodeFunctionResult, encodeFunctionData, type Hex } from 'viem' +import { bulkRenewalRentPriceSnippet } from '../../contracts/bulkRenewal.js' +import type { ClientWithEns } from '../../contracts/consts.js' +import { ethRegistrarControllerRentPriceSnippet } from '../../contracts/ethRegistrarController.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { UnsupportedNameTypeError } from '../../errors/general.js' +import type { SimpleTransactionRequest } from '../../types.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' -import { getNameType } from '../../utils/getNameType' -import multicallWrapper from './multicallWrapper' + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import { getNameType } from '../../utils/getNameType.js' +import multicallWrapper from './multicallWrapper.js' export type GetPriceParameters = { /** Name, or array of names, to get price for */ @@ -54,7 +54,7 @@ const encode = ( { to: bulkRenewalAddress, data: encodeFunctionData({ - abi: bulkRentPriceSnippet, + abi: bulkRenewalRentPriceSnippet, functionName: 'rentPrice', args: [names, BigInt(duration)], }), @@ -62,7 +62,7 @@ const encode = ( { to: bulkRenewalAddress, data: encodeFunctionData({ - abi: bulkRentPriceSnippet, + abi: bulkRenewalRentPriceSnippet, functionName: 'rentPrice', args: [names, 0n], }), @@ -76,7 +76,7 @@ const encode = ( contract: 'ensEthRegistrarController', }), data: encodeFunctionData({ - abi: controllerRentPriceSnippet, + abi: ethRegistrarControllerRentPriceSnippet, functionName: 'rentPrice', args: [names[0], BigInt(duration)], }), @@ -92,12 +92,12 @@ const decode = async ( if (isBulkRenewal) { const result = await multicallWrapper.decode(client, data, []) const price = decodeFunctionResult({ - abi: bulkRentPriceSnippet, + abi: bulkRenewalRentPriceSnippet, functionName: 'rentPrice', data: result[0].returnData, }) const premium = decodeFunctionResult({ - abi: bulkRentPriceSnippet, + abi: bulkRenewalRentPriceSnippet, functionName: 'rentPrice', data: result[1].returnData, }) @@ -106,7 +106,7 @@ const decode = async ( } return decodeFunctionResult({ - abi: controllerRentPriceSnippet, + abi: ethRegistrarControllerRentPriceSnippet, functionName: 'rentPrice', data, }) diff --git a/packages/ensjs/src/functions/public/getRecords.test.ts b/packages/ensjs/src/functions/public/getRecords.test.ts index 3b7f5a9a..e6d31f33 100644 --- a/packages/ensjs/src/functions/public/getRecords.test.ts +++ b/packages/ensjs/src/functions/public/getRecords.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getRecords from './getRecords' +import { publicClient } from '../../tests/addTestContracts.js' +import getRecords from './getRecords.js' describe('getRecords()', () => { it('works', async () => { diff --git a/packages/ensjs/src/functions/public/getRecords.ts b/packages/ensjs/src/functions/public/getRecords.ts index ddf16b64..10324c74 100644 --- a/packages/ensjs/src/functions/public/getRecords.ts +++ b/packages/ensjs/src/functions/public/getRecords.ts @@ -1,32 +1,32 @@ import { - Address, - Hex, decodeAbiParameters, decodeFunctionResult, encodeFunctionData, labelhash, stringToBytes, toHex, + type Address, + type Hex, } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { resolveArraySnippet } from '../../contracts/universalResolver' -import { +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { universalResolverResolveArraySnippet } from '../../contracts/universalResolver.js' +import type { DecodedAddr, DecodedText, SimpleTransactionRequest, TransactionRequestWithPassthrough, -} from '../../types' -import { generateFunction } from '../../utils/generateFunction' -import { packetToBytes } from '../../utils/hexEncodedName' -import { encodeLabelhash } from '../../utils/labels' -import _getAbi, { InternalGetAbiReturnType } from './_getAbi' -import _getAddr from './_getAddr' +} from '../../types.js' +import { generateFunction } from '../../utils/generateFunction.js' +import { packetToBytes } from '../../utils/hexEncodedName.js' +import { encodeLabelhash } from '../../utils/labels.js' +import _getAbi, { type InternalGetAbiReturnType } from './_getAbi.js' +import _getAddr from './_getAddr.js' import _getContentHash, { - InternalGetContentHashReturnType, -} from './_getContentHash' -import _getText from './_getText' -import multicallWrapper from './multicallWrapper' + type InternalGetContentHashReturnType, +} from './_getContentHash.js' +import _getText from './_getText.js' +import multicallWrapper from './multicallWrapper.js' export type GetRecordsParameters = { /** Name to get records for */ @@ -163,7 +163,7 @@ const encode = ( .join('.') const encoded = encodeFunctionData({ - abi: resolveArraySnippet, + abi: universalResolverResolveArraySnippet, functionName: 'resolve', args: [ toHex(packetToBytes(formattedName)), @@ -198,7 +198,7 @@ const decode = async ( recordData = result.map((r) => r.returnData) } else { const result = decodeFunctionResult({ - abi: resolveArraySnippet, + abi: universalResolverResolveArraySnippet, functionName: 'resolve', data, }) @@ -226,7 +226,7 @@ const decode = async ( const baseItem = { key, type } if (type === 'contentHash') { const decodedFromAbi = decodeAbiParameters( - [{ type: 'bytes' }], + [{ type: 'bytes' }] as const, item, )[0] if (BigInt(decodedFromAbi) === 0n) { diff --git a/packages/ensjs/src/functions/public/getResolver.test.ts b/packages/ensjs/src/functions/public/getResolver.test.ts index 9e3ae16d..416c7a21 100644 --- a/packages/ensjs/src/functions/public/getResolver.test.ts +++ b/packages/ensjs/src/functions/public/getResolver.test.ts @@ -1,5 +1,8 @@ -import { deploymentAddresses, publicClient } from '../../tests/addTestContracts' -import getResolver from './getResolver' +import { + deploymentAddresses, + publicClient, +} from '../../tests/addTestContracts.js' +import getResolver from './getResolver.js' describe('getResolver', () => { it('should find the resolver for a name with a resolver', async () => { diff --git a/packages/ensjs/src/functions/public/getResolver.ts b/packages/ensjs/src/functions/public/getResolver.ts index ee663386..b462f251 100644 --- a/packages/ensjs/src/functions/public/getResolver.ts +++ b/packages/ensjs/src/functions/public/getResolver.ts @@ -1,20 +1,20 @@ import { - Address, - Hex, decodeFunctionResult, encodeFunctionData, toHex, + type Address, + type Hex, } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { findResolverSnippet } from '../../contracts/universalResolver' -import { SimpleTransactionRequest } from '../../types' -import { EMPTY_ADDRESS } from '../../utils/consts' +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { universalResolverFindResolverSnippet } from '../../contracts/universalResolver.js' +import type { SimpleTransactionRequest } from '../../types.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' -import { packetToBytes } from '../../utils/hexEncodedName' + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import { packetToBytes } from '../../utils/hexEncodedName.js' export type GetResolverParameters = { /** Name to get resolver for */ @@ -30,7 +30,7 @@ const encode = ( return { to: getChainContractAddress({ client, contract: 'ensUniversalResolver' }), data: encodeFunctionData({ - abi: findResolverSnippet, + abi: universalResolverFindResolverSnippet, functionName: 'findResolver', args: [toHex(packetToBytes(name))], }), @@ -42,7 +42,7 @@ const decode = async ( data: Hex, ): Promise => { const response = decodeFunctionResult({ - abi: findResolverSnippet, + abi: universalResolverFindResolverSnippet, functionName: 'findResolver', data, }) diff --git a/packages/ensjs/src/functions/public/getSupportedInterfaces.ts b/packages/ensjs/src/functions/public/getSupportedInterfaces.ts index ae3bcd5e..c69b7c94 100644 --- a/packages/ensjs/src/functions/public/getSupportedInterfaces.ts +++ b/packages/ensjs/src/functions/public/getSupportedInterfaces.ts @@ -1,12 +1,12 @@ -import { Address, Hex, encodeFunctionData } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { supportsInterfaceSnippet } from '../../contracts/erc165' -import { +import { encodeFunctionData, type Address, type Hex } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import { erc165SupportsInterfaceSnippet } from '../../contracts/erc165.js' +import type { SimpleTransactionRequest, TransactionRequestWithPassthrough, -} from '../../types' -import { generateFunction } from '../../utils/generateFunction' -import multicallWrapper from './multicallWrapper' +} from '../../types.js' +import { generateFunction } from '../../utils/generateFunction.js' +import multicallWrapper from './multicallWrapper.js' export type GetSupportedInterfacesParameters = { address: Address @@ -17,7 +17,7 @@ export type GetSupportedInterfacesReturnType = boolean[] const encodeInterface = (interfaceId: Hex): Hex => encodeFunctionData({ - abi: supportsInterfaceSnippet, + abi: erc165SupportsInterfaceSnippet, functionName: 'supportsInterface', args: [interfaceId], }) diff --git a/packages/ensjs/src/functions/public/getTextRecord.test.ts b/packages/ensjs/src/functions/public/getTextRecord.test.ts index c44f9aac..c9e1a4a5 100644 --- a/packages/ensjs/src/functions/public/getTextRecord.test.ts +++ b/packages/ensjs/src/functions/public/getTextRecord.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getTextRecord from './getTextRecord' +import { publicClient } from '../../tests/addTestContracts.js' +import getTextRecord from './getTextRecord.js' describe('getTextRecord()', () => { it('should return a record from a key', async () => { diff --git a/packages/ensjs/src/functions/public/getTextRecord.ts b/packages/ensjs/src/functions/public/getTextRecord.ts index 9c26c830..10f0b2b1 100644 --- a/packages/ensjs/src/functions/public/getTextRecord.ts +++ b/packages/ensjs/src/functions/public/getTextRecord.ts @@ -1,15 +1,15 @@ -import { Hex } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { Prettify, SimpleTransactionRequest } from '../../types' +import type { Hex } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import type { Prettify, SimpleTransactionRequest } from '../../types.js' import { - GeneratedFunction, generateFunction, -} from '../../utils/generateFunction' + type GeneratedFunction, +} from '../../utils/generateFunction.js' import _getText, { - InternalGetTextParameters, - InternalGetTextReturnType, -} from './_getText' -import universalWrapper from './universalWrapper' + type InternalGetTextParameters, + type InternalGetTextReturnType, +} from './_getText.js' +import universalWrapper from './universalWrapper.js' export type GetTextRecordParameters = Prettify diff --git a/packages/ensjs/src/functions/public/getWrapperData.test.ts b/packages/ensjs/src/functions/public/getWrapperData.test.ts index 2526425b..3a1301b4 100644 --- a/packages/ensjs/src/functions/public/getWrapperData.test.ts +++ b/packages/ensjs/src/functions/public/getWrapperData.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getWrapperData from './getWrapperData' +import { publicClient } from '../../tests/addTestContracts.js' +import getWrapperData from './getWrapperData.js' describe('getWrapperData', () => { it('should return null for an unwrapped name', async () => { diff --git a/packages/ensjs/src/functions/public/getWrapperData.ts b/packages/ensjs/src/functions/public/getWrapperData.ts index 99269f26..95507f92 100644 --- a/packages/ensjs/src/functions/public/getWrapperData.ts +++ b/packages/ensjs/src/functions/public/getWrapperData.ts @@ -1,16 +1,25 @@ -import { Address, Hex, decodeFunctionResult, encodeFunctionData } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { getDataSnippet } from '../../contracts/nameWrapper' -import { DateWithValue, Prettify, SimpleTransactionRequest } from '../../types' -import { EMPTY_ADDRESS } from '../../utils/consts' -import { decodeFuses } from '../../utils/fuses' import { - GeneratedFunction, + decodeFunctionResult, + encodeFunctionData, + type Address, + type Hex, +} from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperGetDataSnippet } from '../../contracts/nameWrapper.js' +import type { + DateWithValue, + Prettify, + SimpleTransactionRequest, +} from '../../types.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' +import { decodeFuses } from '../../utils/fuses.js' +import { generateFunction, -} from '../../utils/generateFunction' -import { makeSafeSecondsDate } from '../../utils/makeSafeSecondsDate' -import { namehash } from '../../utils/normalise' + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import { makeSafeSecondsDate } from '../../utils/makeSafeSecondsDate.js' +import { namehash } from '../../utils/normalise.js' export type GetWrapperDataParameters = { /** Name to get wrapper data for */ @@ -35,7 +44,7 @@ const encode = ( return { to: getChainContractAddress({ client, contract: 'ensNameWrapper' }), data: encodeFunctionData({ - abi: getDataSnippet, + abi: nameWrapperGetDataSnippet, functionName: 'getData', args: [BigInt(namehash(name))], }), @@ -47,7 +56,7 @@ const decode = async ( data: Hex, ): Promise => { const [owner, fuses, expiry] = decodeFunctionResult({ - abi: getDataSnippet, + abi: nameWrapperGetDataSnippet, functionName: 'getData', data, }) diff --git a/packages/ensjs/src/functions/public/getWrapperName.test.ts b/packages/ensjs/src/functions/public/getWrapperName.test.ts index 1fe73839..75c40eba 100644 --- a/packages/ensjs/src/functions/public/getWrapperName.test.ts +++ b/packages/ensjs/src/functions/public/getWrapperName.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getWrapperName from './getWrapperName' +import { publicClient } from '../../tests/addTestContracts.js' +import getWrapperName from './getWrapperName.js' describe('getWrapperName()', () => { it('should return name for existing name', async () => { diff --git a/packages/ensjs/src/functions/public/getWrapperName.ts b/packages/ensjs/src/functions/public/getWrapperName.ts index deb876cc..4682d289 100644 --- a/packages/ensjs/src/functions/public/getWrapperName.ts +++ b/packages/ensjs/src/functions/public/getWrapperName.ts @@ -1,14 +1,19 @@ -import { Hex, decodeFunctionResult, encodeFunctionData, hexToBytes } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { namesSnippet } from '../../contracts/nameWrapper' -import { SimpleTransactionRequest } from '../../types' import { - GeneratedFunction, + decodeFunctionResult, + encodeFunctionData, + hexToBytes, + type Hex, +} from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperNamesSnippet } from '../../contracts/nameWrapper.js' +import type { SimpleTransactionRequest } from '../../types.js' +import { generateFunction, -} from '../../utils/generateFunction' -import { bytesToPacket } from '../../utils/hexEncodedName' -import { namehash } from '../../utils/normalise' + type GeneratedFunction, +} from '../../utils/generateFunction.js' +import { bytesToPacket } from '../../utils/hexEncodedName.js' +import { namehash } from '../../utils/normalise.js' export type GetWrapperNameParameters = { /** Name with unknown labels, e.g. "[4ca938ec1b323ca71c4fb47a712abb68cce1cabf39ea4d6789e42fbc1f95459b].eth" */ @@ -24,7 +29,7 @@ const encode = ( return { to: getChainContractAddress({ client, contract: 'ensNameWrapper' }), data: encodeFunctionData({ - abi: namesSnippet, + abi: nameWrapperNamesSnippet, functionName: 'names', args: [namehash(name)], }), @@ -36,7 +41,7 @@ const decode = async ( data: Hex, ): Promise => { const result = decodeFunctionResult({ - abi: namesSnippet, + abi: nameWrapperNamesSnippet, functionName: 'names', data, }) diff --git a/packages/ensjs/src/functions/public/index.ts b/packages/ensjs/src/functions/public/index.ts deleted file mode 100644 index 107c1ecc..00000000 --- a/packages/ensjs/src/functions/public/index.ts +++ /dev/null @@ -1,96 +0,0 @@ -export { - InternalGetAbiParameters, - InternalGetAbiReturnType, - default as _getAbi, -} from './_getAbi' -export { - InternalGetAddrParameters, - InternalGetAddrReturnType, - default as _getAddr, -} from './_getAddr' -export { - InternalGetContentHashParameters, - InternalGetContentHashReturnType, - default as _getContentHash, -} from './_getContentHash' -export { - InternalGetTextParameters, - InternalGetTextReturnType, - default as _getText, -} from './_getText' -export { default as batch } from './batch' -export { - GetAbiRecordParameters, - GetAbiRecordReturnType, - default as getAbiRecord, -} from './getAbiRecord' -export { - GetAddressRecordParameters, - GetAddressRecordReturnType, - default as getAddressRecord, -} from './getAddressRecord' -export { - GetAvailableParameters, - GetAvailableReturnType, - default as getAvailable, -} from './getAvailable' -export { - GetContentHashRecordParameters, - GetContentHashRecordReturnType, - default as getContentHashRecord, -} from './getContentHashRecord' -export { - GetExpiryParameters, - GetExpiryReturnType, - default as getExpiry, -} from './getExpiry' -export { - GetNameParameters, - GetNameReturnType, - default as getName, -} from './getName' -export { - GetOwnerParameters, - GetOwnerReturnType, - default as getOwner, -} from './getOwner' -export { - GetPriceParameters, - GetPriceReturnType, - default as getPrice, -} from './getPrice' -export { - GetRecordsParameters, - GetRecordsReturnType, - default as getRecords, -} from './getRecords' -export { - GetResolverParameters, - GetResolverReturnType, - default as getResolver, -} from './getResolver' -export { - GetSupportedInterfacesParameters, - GetSupportedInterfacesReturnType, - default as getSupportedInterfaces, -} from './getSupportedInterfaces' -export { - GetTextRecordParameters, - GetTextRecordReturnType, - default as getTextRecord, -} from './getTextRecord' -export { - GetWrapperDataParameters, - GetWrapperDataReturnType, - default as getWrapperData, -} from './getWrapperData' -export { - MulticallWrapperParameters, - MulticallWrapperReturnType, - default as multicallWrapper, -} from './multicallWrapper' -export { - UniversalWrapperParameters, - UniversalWrapperReturnType, - default as universalWrapper, -} from './universalWrapper' diff --git a/packages/ensjs/src/functions/public/multicallWrapper.ts b/packages/ensjs/src/functions/public/multicallWrapper.ts index 47cb9d18..c7fd2b33 100644 --- a/packages/ensjs/src/functions/public/multicallWrapper.ts +++ b/packages/ensjs/src/functions/public/multicallWrapper.ts @@ -1,17 +1,17 @@ import { - Hex, decodeFunctionResult, encodeFunctionData, offchainLookup, + type Hex, } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { tryAggregateSnippet } from '../../contracts/multicall' -import { +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { multicallTryAggregateSnippet } from '../../contracts/multicall.js' +import type { SimpleTransactionRequest, TransactionRequestWithPassthrough, -} from '../../types' -import { generateFunction } from '../../utils/generateFunction' +} from '../../types.js' +import { generateFunction } from '../../utils/generateFunction.js' export type MulticallWrapperParameters = { transactions: SimpleTransactionRequest[] @@ -30,7 +30,7 @@ const encode = ( return { to: getChainContractAddress({ client, contract: 'multicall3' }), data: encodeFunctionData({ - abi: tryAggregateSnippet, + abi: multicallTryAggregateSnippet, functionName: 'tryAggregate', args: [ requireSuccess, @@ -46,7 +46,7 @@ const decode = async ( transactions: TransactionRequestWithPassthrough[], ): Promise => { const result = decodeFunctionResult({ - abi: tryAggregateSnippet, + abi: multicallTryAggregateSnippet, functionName: 'tryAggregate', data, }) diff --git a/packages/ensjs/src/functions/public/universalWrapper.ts b/packages/ensjs/src/functions/public/universalWrapper.ts index 34c6afb0..26fb9f22 100644 --- a/packages/ensjs/src/functions/public/universalWrapper.ts +++ b/packages/ensjs/src/functions/public/universalWrapper.ts @@ -1,19 +1,19 @@ import { - Address, - Hex, decodeFunctionResult, encodeFunctionData, labelhash, toBytes, toHex, + type Address, + type Hex, } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { resolveSnippet } from '../../contracts/universalResolver' -import { SimpleTransactionRequest } from '../../types' -import { generateFunction } from '../../utils/generateFunction' -import { packetToBytes } from '../../utils/hexEncodedName' -import { encodeLabelhash } from '../../utils/labels' +import type { ClientWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { universalResolverResolveSnippet } from '../../contracts/universalResolver.js' +import type { SimpleTransactionRequest } from '../../types.js' +import { generateFunction } from '../../utils/generateFunction.js' +import { packetToBytes } from '../../utils/hexEncodedName.js' +import { encodeLabelhash } from '../../utils/labels.js' export type UniversalWrapperParameters = { name: string @@ -42,7 +42,7 @@ const encode = ( return { to: getChainContractAddress({ client, contract: 'ensUniversalResolver' }), data: encodeFunctionData({ - abi: resolveSnippet, + abi: universalResolverResolveSnippet, functionName: 'resolve', args: [toHex(packetToBytes(nameWithSizedLabels)), data], }), @@ -54,7 +54,7 @@ const decode = async ( data: Hex, ): Promise => { const result = decodeFunctionResult({ - abi: resolveSnippet, + abi: universalResolverResolveSnippet, functionName: 'resolve', data, }) diff --git a/packages/ensjs/src/functions/subgraph/client.test.ts b/packages/ensjs/src/functions/subgraph/client.test.ts index 03f1a076..a28ae59f 100644 --- a/packages/ensjs/src/functions/subgraph/client.test.ts +++ b/packages/ensjs/src/functions/subgraph/client.test.ts @@ -1,5 +1,5 @@ import { namehash } from 'viem' -import { requestMiddleware, responseMiddleware } from './client' +import { requestMiddleware, responseMiddleware } from './client.js' const queryWithoutId = ` query getNames($id: ID!, $expiryDate: Int) { diff --git a/packages/ensjs/src/functions/subgraph/client.ts b/packages/ensjs/src/functions/subgraph/client.ts index cef7f245..c80e3b6c 100644 --- a/packages/ensjs/src/functions/subgraph/client.ts +++ b/packages/ensjs/src/functions/subgraph/client.ts @@ -1,10 +1,10 @@ import type { Kind, SelectionNode, SelectionSetNode } from 'graphql' import { GraphQLClient } from 'graphql-request' -import { RequestMiddleware, Response } from 'graphql-request/dist/types' -import { parse, print, visit } from 'graphql/language/index' +import type { RequestMiddleware, Response } from 'graphql-request/dist/types.js' +import { parse, print, visit } from 'graphql/language/index.js' import traverse from 'traverse' -import { ClientWithEns } from '../../contracts/consts' -import { namehash } from '../../utils/normalise' +import type { ClientWithEns } from '../../contracts/consts.js' +import { namehash } from '../../utils/normalise.js' const generateSelection = (selection: string): SelectionNode => ({ kind: 'Field' as Kind.FIELD, @@ -34,6 +34,8 @@ const enter = (node: SelectionSetNode) => { node.selections = [...node.selections, generateSelection('id')] return node } + + return undefined } export const requestMiddleware: RequestMiddleware = (request) => { diff --git a/packages/ensjs/src/functions/subgraph/events.ts b/packages/ensjs/src/functions/subgraph/events.ts index 60238f65..db76fe5e 100644 --- a/packages/ensjs/src/functions/subgraph/events.ts +++ b/packages/ensjs/src/functions/subgraph/events.ts @@ -1,4 +1,4 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' export type DomainEventKey = | 'NewOwner' diff --git a/packages/ensjs/src/functions/subgraph/fragments.ts b/packages/ensjs/src/functions/subgraph/fragments.ts index ad7aa619..f5a56a84 100644 --- a/packages/ensjs/src/functions/subgraph/fragments.ts +++ b/packages/ensjs/src/functions/subgraph/fragments.ts @@ -1,5 +1,5 @@ import { gql } from 'graphql-request' -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' export const domainDetailsWithoutParentFragment = gql` fragment DomainDetailsWithoutParent on Domain { diff --git a/packages/ensjs/src/functions/subgraph/getDecodedName.test.ts b/packages/ensjs/src/functions/subgraph/getDecodedName.test.ts index e65ebfd9..b07bd3d3 100644 --- a/packages/ensjs/src/functions/subgraph/getDecodedName.test.ts +++ b/packages/ensjs/src/functions/subgraph/getDecodedName.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getDecodedName from './getDecodedName' +import { publicClient } from '../../tests/addTestContracts.js' +import getDecodedName from './getDecodedName.js' it('should decode a name via namehash lookup', async () => { const result = await getDecodedName(publicClient, { diff --git a/packages/ensjs/src/functions/subgraph/getDecodedName.ts b/packages/ensjs/src/functions/subgraph/getDecodedName.ts index 4c6ebd16..0b0e4550 100644 --- a/packages/ensjs/src/functions/subgraph/getDecodedName.ts +++ b/packages/ensjs/src/functions/subgraph/getDecodedName.ts @@ -1,12 +1,12 @@ import { gql } from 'graphql-request' -import { ClientWithEns } from '../../contracts/consts' +import type { ClientWithEns } from '../../contracts/consts.js' import { checkIsDecrypted, decodeLabelhash, isEncodedLabelhash, -} from '../../utils/labels' -import { namehash } from '../../utils/normalise' -import { createSubgraphClient } from './client' +} from '../../utils/labels.js' +import { namehash } from '../../utils/normalise.js' +import { createSubgraphClient } from './client.js' export type GetDecodedNameParameters = { /** Name with unknown labels */ diff --git a/packages/ensjs/src/functions/subgraph/getNameHistory.test.ts b/packages/ensjs/src/functions/subgraph/getNameHistory.test.ts index ff778422..89e6d7fd 100644 --- a/packages/ensjs/src/functions/subgraph/getNameHistory.test.ts +++ b/packages/ensjs/src/functions/subgraph/getNameHistory.test.ts @@ -1,5 +1,5 @@ -import { publicClient } from '../../tests/addTestContracts' -import getNameHistory from './getNameHistory' +import { publicClient } from '../../tests/addTestContracts.js' +import getNameHistory from './getNameHistory.js' it('returns null for a non-existent name', async () => { const result = await getNameHistory(publicClient, { diff --git a/packages/ensjs/src/functions/subgraph/getNameHistory.ts b/packages/ensjs/src/functions/subgraph/getNameHistory.ts index ddd76b53..6d9b5e95 100644 --- a/packages/ensjs/src/functions/subgraph/getNameHistory.ts +++ b/packages/ensjs/src/functions/subgraph/getNameHistory.ts @@ -1,17 +1,17 @@ import { formatsByCoinType } from '@ensdomains/address-encoder' import { gql } from 'graphql-request' -import { ClientWithEns } from '../../contracts/consts' -import { decodeContenthash } from '../../utils/contentHash' -import { namehash } from '../../utils/normalise' -import { createSubgraphClient } from './client' -import { +import type { ClientWithEns } from '../../contracts/consts.js' +import { decodeContenthash } from '../../utils/contentHash.js' +import { namehash } from '../../utils/normalise.js' +import { createSubgraphClient } from './client.js' +import type { BaseResolverEvent, ContenthashChanged, DomainEvent, MulticoinAddrChanged, RegistrationEvent, ResolverEvent, -} from './events' +} from './events.js' export type GetNameHistoryParameters = { /** Name to get history for */ diff --git a/packages/ensjs/src/functions/subgraph/getNamesForAddress.test.ts b/packages/ensjs/src/functions/subgraph/getNamesForAddress.test.ts index d2e4bdd9..cc29310f 100644 --- a/packages/ensjs/src/functions/subgraph/getNamesForAddress.test.ts +++ b/packages/ensjs/src/functions/subgraph/getNamesForAddress.test.ts @@ -1,8 +1,10 @@ /* eslint-disable no-await-in-loop */ -import { Address } from 'viem' -import { publicClient, walletClient } from '../../tests/addTestContracts' -import getNamesForAddress, { NameWithRelation } from './getNamesForAddress' +import type { Address } from 'viem' +import { publicClient, walletClient } from '../../tests/addTestContracts.js' +import getNamesForAddress, { + type NameWithRelation, +} from './getNamesForAddress.js' let accounts: Address[] diff --git a/packages/ensjs/src/functions/subgraph/getNamesForAddress.ts b/packages/ensjs/src/functions/subgraph/getNamesForAddress.ts index 7d1c8144..7c07554f 100644 --- a/packages/ensjs/src/functions/subgraph/getNamesForAddress.ts +++ b/packages/ensjs/src/functions/subgraph/getNamesForAddress.ts @@ -1,20 +1,20 @@ import { gql } from 'graphql-request' -import { Address } from 'viem' -import { ClientWithEns } from '../../contracts/consts' +import type { Address } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' import { FilterKeyRequiredError, InvalidFilterKeyError, InvalidOrderByError, -} from '../../errors/subgraph' -import { GRACE_PERIOD_SECONDS } from '../../utils/consts' -import { createSubgraphClient } from './client' +} from '../../errors/subgraph.js' +import { GRACE_PERIOD_SECONDS } from '../../utils/consts.js' +import { createSubgraphClient } from './client.js' import { - SubgraphDomain, domainDetailsFragment, registrationDetailsFragment, wrappedDomainDetailsFragment, -} from './fragments' -import { Name, makeNameObject } from './utils' + type SubgraphDomain, +} from './fragments.js' +import { makeNameObject, type Name } from './utils.js' type GetNamesForAddressOrderBy = | 'expiryDate' diff --git a/packages/ensjs/src/functions/subgraph/getSubgraphRecords.test.ts b/packages/ensjs/src/functions/subgraph/getSubgraphRecords.test.ts index 14ec30a9..acb329a5 100644 --- a/packages/ensjs/src/functions/subgraph/getSubgraphRecords.test.ts +++ b/packages/ensjs/src/functions/subgraph/getSubgraphRecords.test.ts @@ -1,5 +1,8 @@ -import { deploymentAddresses, publicClient } from '../../tests/addTestContracts' -import getSubgraphRecords from './getSubgraphRecords' +import { + deploymentAddresses, + publicClient, +} from '../../tests/addTestContracts.js' +import getSubgraphRecords from './getSubgraphRecords.js' it('gets basic records', async () => { const result = await getSubgraphRecords(publicClient, { diff --git a/packages/ensjs/src/functions/subgraph/getSubgraphRecords.ts b/packages/ensjs/src/functions/subgraph/getSubgraphRecords.ts index bcf0c2c7..8c47d0d1 100644 --- a/packages/ensjs/src/functions/subgraph/getSubgraphRecords.ts +++ b/packages/ensjs/src/functions/subgraph/getSubgraphRecords.ts @@ -1,9 +1,9 @@ import { gql } from 'graphql-request' import type { Address } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { DateWithValue } from '../../types' -import { namehash } from '../../utils/normalise' -import { createSubgraphClient } from './client' +import type { ClientWithEns } from '../../contracts/consts.js' +import type { DateWithValue } from '../../types.js' +import { namehash } from '../../utils/normalise.js' +import { createSubgraphClient } from './client.js' export type GetSubgraphRecordsParameters = { /** Name to get records for */ @@ -127,9 +127,9 @@ const getSubgraphRecords = async ( }, ) if (!response || !response.domain) return null - ;({ - domain: { resolver: resolverResult, ...domainResult }, - } = response) + const { resolver, ...domain_ } = response.domain + resolverResult = resolver + domainResult = domain_ } const { isMigrated, createdAt: stringCreatedAt } = domainResult diff --git a/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.test.ts b/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.test.ts index 539fb677..c9ec0b85 100644 --- a/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.test.ts +++ b/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.test.ts @@ -1,5 +1,8 @@ -import { deploymentAddresses, publicClient } from '../../tests/addTestContracts' -import getSubgraphRegistrant from './getSubgraphRegistrant' +import { + deploymentAddresses, + publicClient, +} from '../../tests/addTestContracts.js' +import getSubgraphRegistrant from './getSubgraphRegistrant.js' it('gets the registrant for a 2ld .eth name', async () => { const result = await getSubgraphRegistrant(publicClient, { diff --git a/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.ts b/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.ts index 5e79875b..3a2e7941 100644 --- a/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.ts +++ b/packages/ensjs/src/functions/subgraph/getSubgraphRegistrant.ts @@ -1,9 +1,9 @@ import { gql } from 'graphql-request' -import { Address, getAddress, labelhash } from 'viem' -import { ClientWithEns } from '../../contracts/consts' -import { UnsupportedNameTypeError } from '../../errors/general' -import { getNameType } from '../../utils/getNameType' -import { createSubgraphClient } from './client' +import { getAddress, labelhash, type Address } from 'viem' +import type { ClientWithEns } from '../../contracts/consts.js' +import { UnsupportedNameTypeError } from '../../errors/general.js' +import { getNameType } from '../../utils/getNameType.js' +import { createSubgraphClient } from './client.js' export type GetSubgraphRegistrantParameters = { /** Name to get registrant for */ diff --git a/packages/ensjs/src/functions/subgraph/getSubnames.test.ts b/packages/ensjs/src/functions/subgraph/getSubnames.test.ts index d6e20b7e..36598b06 100644 --- a/packages/ensjs/src/functions/subgraph/getSubnames.test.ts +++ b/packages/ensjs/src/functions/subgraph/getSubnames.test.ts @@ -1,8 +1,8 @@ /* eslint-disable no-await-in-loop */ -import { publicClient } from '../../tests/addTestContracts' -import getSubnames from './getSubnames' -import { Name } from './utils' +import { publicClient } from '../../tests/addTestContracts.js' +import getSubnames from './getSubnames.js' +import type { Name } from './utils.js' it('returns with default values', async () => { const result = await getSubnames(publicClient, { diff --git a/packages/ensjs/src/functions/subgraph/getSubnames.ts b/packages/ensjs/src/functions/subgraph/getSubnames.ts index 62ef61a1..1ca957bd 100644 --- a/packages/ensjs/src/functions/subgraph/getSubnames.ts +++ b/packages/ensjs/src/functions/subgraph/getSubnames.ts @@ -1,16 +1,16 @@ import { gql } from 'graphql-request' -import { ClientWithEns } from '../../contracts/consts' -import { InvalidOrderByError } from '../../errors/subgraph' -import { GRACE_PERIOD_SECONDS } from '../../utils/consts' -import { namehash } from '../../utils/normalise' -import { createSubgraphClient } from './client' +import type { ClientWithEns } from '../../contracts/consts.js' +import { InvalidOrderByError } from '../../errors/subgraph.js' +import { GRACE_PERIOD_SECONDS } from '../../utils/consts.js' +import { namehash } from '../../utils/normalise.js' +import { createSubgraphClient } from './client.js' import { - SubgraphDomain, domainDetailsWithoutParentFragment, registrationDetailsFragment, wrappedDomainDetailsFragment, -} from './fragments' -import { Name, makeNameObject } from './utils' + type SubgraphDomain, +} from './fragments.js' +import { makeNameObject, type Name } from './utils.js' type GetSubnamesOrderBy = 'expiryDate' | 'name' | 'labelName' | 'createdAt' diff --git a/packages/ensjs/src/functions/subgraph/index.ts b/packages/ensjs/src/functions/subgraph/index.ts deleted file mode 100644 index 26fb5b43..00000000 --- a/packages/ensjs/src/functions/subgraph/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -export { createSubgraphClient } from './client' -export { - GetDecodedNameParameters, - GetDecodedNameReturnType, - default as getDecodedName, -} from './getDecodedName' -export { - GetNameHistoryParameters, - GetNameHistoryReturnType, - default as getNameHistory, -} from './getNameHistory' -export { - GetNamesForAddressParameters, - GetNamesForAddressReturnType, - default as getNamesForAddress, -} from './getNamesForAddress' -export { - GetSubgraphRecordsParameters, - GetSubgraphRecordsReturnType, - default as getSubgraphRecords, -} from './getSubgraphRecords' -export { - GetSubgraphRegistrantParameters, - GetSubgraphRegistrantReturnType, - default as getSubgraphRegistrant, -} from './getSubgraphRegistrant' -export { - GetSubnamesParameters, - GetSubnamesReturnType, - default as getSubnames, -} from './getSubnames' diff --git a/packages/ensjs/src/functions/subgraph/utils.ts b/packages/ensjs/src/functions/subgraph/utils.ts index 11515115..01f4fa99 100644 --- a/packages/ensjs/src/functions/subgraph/utils.ts +++ b/packages/ensjs/src/functions/subgraph/utils.ts @@ -1,9 +1,9 @@ -import { Address, Hex, getAddress } from 'viem' -import { DateWithValue } from '../../types' -import { truncateFormat } from '../../utils/format' -import { AllCurrentFuses, decodeFuses } from '../../utils/fuses' -import { decryptName } from '../../utils/labels' -import { SubgraphDomain } from './fragments' +import { getAddress, type Address, type Hex } from 'viem' +import type { DateWithValue } from '../../types.js' +import { truncateFormat } from '../../utils/format.js' +import { decodeFuses, type AllCurrentFuses } from '../../utils/fuses.js' +import { decryptName } from '../../utils/labels.js' +import type { SubgraphDomain } from './fragments.js' export type Name = { /** Id of the name, equal to namehash */ diff --git a/packages/ensjs/src/functions/wallet/commitName.test.ts b/packages/ensjs/src/functions/wallet/commitName.test.ts index 224e6cec..66241382 100644 --- a/packages/ensjs/src/functions/wallet/commitName.test.ts +++ b/packages/ensjs/src/functions/wallet/commitName.test.ts @@ -1,17 +1,17 @@ -import { Address, Hex } from 'viem' -import { commitmentsSnippet } from '../../contracts/ethRegistrarController' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' +import type { Address, Hex } from 'viem' +import { ethRegistrarControllerCommitmentsSnippet } from '../../contracts/ethRegistrarController.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' +} from '../../tests/addTestContracts.js' import { - RegistrationParameters, makeCommitment, -} from '../../utils/registerHelpers' -import commitName from './commitName' + type RegistrationParameters, +} from '../../utils/registerHelpers.js' +import commitName from './commitName.js' let snapshot: Hex let accounts: Address[] @@ -46,7 +46,7 @@ it('should return a commit transaction and succeed', async () => { expect(receipt.status).toBe('success') const commitment = await publicClient.readContract({ - abi: commitmentsSnippet, + abi: ethRegistrarControllerCommitmentsSnippet, functionName: 'commitments', address: getChainContractAddress({ client: publicClient, diff --git a/packages/ensjs/src/functions/wallet/commitName.ts b/packages/ensjs/src/functions/wallet/commitName.ts index 00c10d8c..86f84e47 100644 --- a/packages/ensjs/src/functions/wallet/commitName.ts +++ b/packages/ensjs/src/functions/wallet/commitName.ts @@ -1,25 +1,25 @@ import { - Account, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { commitSnippet } from '../../contracts/ethRegistrarController' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { UnsupportedNameTypeError } from '../../errors/general' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { ethRegistrarControllerCommitSnippet } from '../../contracts/ethRegistrarController.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { UnsupportedNameTypeError } from '../../errors/general.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { getNameType } from '../../utils/getNameType' +} from '../../types.js' +import { getNameType } from '../../utils/getNameType.js' import { - RegistrationParameters, makeCommitment, -} from '../../utils/registerHelpers' -import { wrappedLabelLengthCheck } from '../../utils/wrapper' + type RegistrationParameters, +} from '../../utils/registerHelpers.js' +import { wrappedLabelLengthCheck } from '../../utils/wrapper.js' export type CommitNameDataParameters = RegistrationParameters @@ -58,7 +58,7 @@ export const makeFunctionData = < contract: 'ensEthRegistrarController', }), data: encodeFunctionData({ - abi: commitSnippet, + abi: ethRegistrarControllerCommitSnippet, functionName: 'commit', args: [makeCommitment(args)], }), diff --git a/packages/ensjs/src/functions/wallet/createSubname.test.ts b/packages/ensjs/src/functions/wallet/createSubname.test.ts index 85230bd1..9c26c31d 100644 --- a/packages/ensjs/src/functions/wallet/createSubname.test.ts +++ b/packages/ensjs/src/functions/wallet/createSubname.test.ts @@ -1,15 +1,15 @@ -import { Address, Hex } from 'viem' -import { ownerOfSnippet } from '../../contracts/erc721' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { ownerSnippet } from '../../contracts/registry' +import type { Address, Hex } from 'viem' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperOwnerOfSnippet } from '../../contracts/nameWrapper.js' +import { registryOwnerSnippet } from '../../contracts/registry.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import { namehash } from '../../utils/normalise' -import createSubname from './createSubname' +} from '../../tests/addTestContracts.js' +import { namehash } from '../../utils/normalise.js' +import createSubname from './createSubname.js' let snapshot: Hex let accounts: Address[] @@ -38,7 +38,7 @@ it('should allow creating a subname on the registry', async () => { expect(receipt.status).toBe('success') const owner = await publicClient.readContract({ - abi: ownerSnippet, + abi: registryOwnerSnippet, functionName: 'owner', address: getChainContractAddress({ client: publicClient, @@ -61,7 +61,7 @@ it('should allow creating a subname on the namewrapper', async () => { expect(receipt.status).toBe('success') const owner = await publicClient.readContract({ - abi: ownerOfSnippet, + abi: nameWrapperOwnerOfSnippet, functionName: 'ownerOf', address: getChainContractAddress({ client: publicClient, diff --git a/packages/ensjs/src/functions/wallet/createSubname.ts b/packages/ensjs/src/functions/wallet/createSubname.ts index 9c1ac15b..5ada43b7 100644 --- a/packages/ensjs/src/functions/wallet/createSubname.ts +++ b/packages/ensjs/src/functions/wallet/createSubname.ts @@ -1,33 +1,33 @@ import { - Account, - Address, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Address, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { setSubnodeRecordSnippet as nameWrapperSetSubnodeRecordSnippet } from '../../contracts/nameWrapper' -import { setSubnodeRecordSnippet as registrySetSubnodeRecordSnippet } from '../../contracts/registry' +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperSetSubnodeRecordSnippet } from '../../contracts/nameWrapper.js' +import { registrySetSubnodeRecordSnippet } from '../../contracts/registry.js' import { InvalidContractTypeError, UnsupportedNameTypeError, -} from '../../errors/general' -import { +} from '../../errors/general.js' +import type { AnyDate, Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { CombinedFuseInput, encodeFuses } from '../../utils/fuses' -import { getNameType } from '../../utils/getNameType' -import { makeLabelNodeAndParent } from '../../utils/makeLabelNodeAndParent' +} from '../../types.js' +import { encodeFuses, type CombinedFuseInput } from '../../utils/fuses.js' +import { getNameType } from '../../utils/getNameType.js' +import { makeLabelNodeAndParent } from '../../utils/makeLabelNodeAndParent.js' import { MAX_EXPIRY, expiryToBigInt, wrappedLabelLengthCheck, -} from '../../utils/wrapper' +} from '../../utils/wrapper.js' type BaseCreateSubnameDataParameters = { /** Subname to create */ diff --git a/packages/ensjs/src/functions/wallet/deleteSubname.test.ts b/packages/ensjs/src/functions/wallet/deleteSubname.test.ts index 1406a358..938b530f 100644 --- a/packages/ensjs/src/functions/wallet/deleteSubname.test.ts +++ b/packages/ensjs/src/functions/wallet/deleteSubname.test.ts @@ -1,16 +1,19 @@ -import { Address, Hex } from 'viem' -import { ownerOfSnippet } from '../../contracts/erc721' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { ownerSnippet, resolverSnippet } from '../../contracts/registry' +import type { Address, Hex } from 'viem' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperOwnerOfSnippet } from '../../contracts/nameWrapper.js' +import { + registryOwnerSnippet, + registryResolverSnippet, +} from '../../contracts/registry.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import { EMPTY_ADDRESS } from '../../utils/consts' -import { namehash } from '../../utils/normalise' -import deleteSubname from './deleteSubname' +} from '../../tests/addTestContracts.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' +import { namehash } from '../../utils/normalise.js' +import deleteSubname from './deleteSubname.js' let snapshot: Hex let accounts: Address[] @@ -29,7 +32,7 @@ afterEach(async () => { const getOwner = async (name: string) => { return publicClient.readContract({ - abi: ownerSnippet, + abi: registryOwnerSnippet, functionName: 'owner', address: getChainContractAddress({ client: publicClient, @@ -41,7 +44,7 @@ const getOwner = async (name: string) => { const getNameWrapperOwner = async (name: string) => { return publicClient.readContract({ - abi: ownerOfSnippet, + abi: nameWrapperOwnerOfSnippet, functionName: 'ownerOf', address: getChainContractAddress({ client: publicClient, @@ -53,7 +56,7 @@ const getNameWrapperOwner = async (name: string) => { const getResolver = async (name: string) => { return publicClient.readContract({ - abi: resolverSnippet, + abi: registryResolverSnippet, functionName: 'resolver', address: getChainContractAddress({ client: publicClient, diff --git a/packages/ensjs/src/functions/wallet/deleteSubname.ts b/packages/ensjs/src/functions/wallet/deleteSubname.ts index 7c824eb7..937826f6 100644 --- a/packages/ensjs/src/functions/wallet/deleteSubname.ts +++ b/packages/ensjs/src/functions/wallet/deleteSubname.ts @@ -1,33 +1,33 @@ import { - Account, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' import { - setSubnodeRecordSnippet as nameWrapperSetSubnodeRecordSnippet, - setRecordSnippet, -} from '../../contracts/nameWrapper' + nameWrapperSetRecordSnippet, + nameWrapperSetSubnodeRecordSnippet, +} from '../../contracts/nameWrapper.js' import { - setRecordSnippet as registrySetRecordSnippet, - setSubnodeRecordSnippet as registrySetSubnodeRecordSnippet, -} from '../../contracts/registry' + registrySetRecordSnippet, + registrySetSubnodeRecordSnippet, +} from '../../contracts/registry.js' import { InvalidContractTypeError, UnsupportedNameTypeError, -} from '../../errors/general' -import { +} from '../../errors/general.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { EMPTY_ADDRESS } from '../../utils/consts' -import { getNameType } from '../../utils/getNameType' -import { makeLabelNodeAndParent } from '../../utils/makeLabelNodeAndParent' -import { namehash } from '../../utils/normalise' +} from '../../types.js' +import { EMPTY_ADDRESS } from '../../utils/consts.js' +import { getNameType } from '../../utils/getNameType.js' +import { makeLabelNodeAndParent } from '../../utils/makeLabelNodeAndParent.js' +import { namehash } from '../../utils/normalise.js' export type DeleteSubnameDataParameters = { /** Subname to delete */ @@ -107,7 +107,7 @@ export const makeFunctionData = < return { to: nameWrapperAddress, data: encodeFunctionData({ - abi: setRecordSnippet, + abi: nameWrapperSetRecordSnippet, functionName: 'setRecord', args: [namehash(name), EMPTY_ADDRESS, EMPTY_ADDRESS, BigInt(0)], }), diff --git a/packages/ensjs/src/functions/wallet/index.ts b/packages/ensjs/src/functions/wallet/index.ts deleted file mode 100644 index bc298b69..00000000 --- a/packages/ensjs/src/functions/wallet/index.ts +++ /dev/null @@ -1,85 +0,0 @@ -export { - CommitNameParameters, - CommitNameReturnType, - default as commitName, -} from './commitName' -export { - CreateSubnameParameters, - CreateSubnameReturnType, - default as createSubname, -} from './createSubname' -export { - DeleteSubnameParameters, - DeleteSubnameReturnType, - default as deleteSubname, -} from './deleteSubname' -export { - RegisterNameParameters, - RegisterNameReturnType, - default as registerName, -} from './registerName' -export { - RenewNamesParameters, - RenewNamesReturnType, - default as renewNames, -} from './renewNames' -export { - SetAbiRecordParameters, - SetAbiRecordReturnType, - default as setAbiRecord, -} from './setAbiRecord' -export { - SetAddressRecordParameters, - SetAddressRecordReturnType, - default as setAddressRecord, -} from './setAddressRecord' -export { - SetChildFusesParameters, - SetChildFusesReturnType, - default as setChildFuses, -} from './setChildFuses' -export { - SetContentHashRecordParameters, - SetContentHashRecordReturnType, - default as setContentHashRecord, -} from './setContentHashRecord' -export { - SetFusesParameters, - SetFusesReturnType, - default as setFuses, -} from './setFuses' -export { - SetPrimaryNameParameters, - SetPrimaryNameReturnType, - default as setPrimaryName, -} from './setPrimaryName' -export { - SetRecordsParameters, - SetRecordsReturnType, - default as setRecords, -} from './setRecords' -export { - SetResolverParameters, - SetResolverReturnType, - default as setResolver, -} from './setResolver' -export { - SetTextRecordParameters, - SetTextRecordReturnType, - default as setTextRecord, -} from './setTextRecord' -export { - TransferNameParameters, - TransferNameReturnType, - default as transferName, -} from './transferName' -export { - UnwrapNameParameters, - UnwrapNameReturnType, - default as unwrapName, -} from './unwrapName' -export { - WrapNameParameters, - WrapNameReturnType, - default as wrapName, -} from './wrapName' diff --git a/packages/ensjs/src/functions/wallet/registerName.test.ts b/packages/ensjs/src/functions/wallet/registerName.test.ts index 6a08f386..34164a42 100644 --- a/packages/ensjs/src/functions/wallet/registerName.test.ts +++ b/packages/ensjs/src/functions/wallet/registerName.test.ts @@ -1,17 +1,17 @@ -import { Address, Hex } from 'viem' -import { ownerOfSnippet } from '../../contracts/erc721' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' +import type { Address, Hex } from 'viem' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperOwnerOfSnippet } from '../../contracts/nameWrapper.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import { namehash } from '../../utils/normalise' -import { RegistrationParameters } from '../../utils/registerHelpers' -import getPrice from '../public/getPrice' -import commitName from './commitName' -import registerName from './registerName' +} from '../../tests/addTestContracts.js' +import { namehash } from '../../utils/normalise.js' +import type { RegistrationParameters } from '../../utils/registerHelpers.js' +import getPrice from '../public/getPrice.js' +import commitName from './commitName.js' +import registerName from './registerName.js' let snapshot: Hex let accounts: Address[] @@ -32,7 +32,7 @@ const secret = `0x${'a'.repeat(64)}` as Hex const getNameWrapperOwner = async (name: string) => { return publicClient.readContract({ - abi: ownerOfSnippet, + abi: nameWrapperOwnerOfSnippet, functionName: 'ownerOf', address: getChainContractAddress({ client: publicClient, diff --git a/packages/ensjs/src/functions/wallet/registerName.ts b/packages/ensjs/src/functions/wallet/registerName.ts index 15206d64..26a563fe 100644 --- a/packages/ensjs/src/functions/wallet/registerName.ts +++ b/packages/ensjs/src/functions/wallet/registerName.ts @@ -1,25 +1,25 @@ import { - Account, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { registerSnippet } from '../../contracts/ethRegistrarController' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { UnsupportedNameTypeError } from '../../errors/general' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { ethRegistrarControllerRegisterSnippet } from '../../contracts/ethRegistrarController.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { UnsupportedNameTypeError } from '../../errors/general.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { getNameType } from '../../utils/getNameType' +} from '../../types.js' +import { getNameType } from '../../utils/getNameType.js' import { - RegistrationParameters, makeRegistrationTuple, -} from '../../utils/registerHelpers' -import { wrappedLabelLengthCheck } from '../../utils/wrapper' + type RegistrationParameters, +} from '../../utils/registerHelpers.js' +import { wrappedLabelLengthCheck } from '../../utils/wrapper.js' export type RegisterNameDataParameters = RegistrationParameters & { /** Value of registration */ @@ -65,7 +65,7 @@ export const makeFunctionData = < contract: 'ensEthRegistrarController', }), data: encodeFunctionData({ - abi: registerSnippet, + abi: ethRegistrarControllerRegisterSnippet, functionName: 'register', args: makeRegistrationTuple(args), }), diff --git a/packages/ensjs/src/functions/wallet/renewNames.test.ts b/packages/ensjs/src/functions/wallet/renewNames.test.ts index 8aebbfa4..188275b6 100644 --- a/packages/ensjs/src/functions/wallet/renewNames.test.ts +++ b/packages/ensjs/src/functions/wallet/renewNames.test.ts @@ -1,14 +1,14 @@ -import { Address, Hex, labelhash } from 'viem' -import { nameExpiresSnippet } from '../../contracts/baseRegistrar' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' +import { labelhash, type Address, type Hex } from 'viem' +import { baseRegistrarNameExpiresSnippet } from '../../contracts/baseRegistrar.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getPrice from '../public/getPrice' -import renewNames from './renewNames' +} from '../../tests/addTestContracts.js' +import getPrice from '../public/getPrice.js' +import renewNames from './renewNames.js' let snapshot: Hex let accounts: Address[] @@ -27,7 +27,7 @@ afterEach(async () => { const getExpiry = async (name: string) => { return publicClient.readContract({ - abi: nameExpiresSnippet, + abi: baseRegistrarNameExpiresSnippet, functionName: 'nameExpires', address: getChainContractAddress({ client: publicClient, diff --git a/packages/ensjs/src/functions/wallet/renewNames.ts b/packages/ensjs/src/functions/wallet/renewNames.ts index 0eb3ff8a..9b924016 100644 --- a/packages/ensjs/src/functions/wallet/renewNames.ts +++ b/packages/ensjs/src/functions/wallet/renewNames.ts @@ -1,21 +1,21 @@ import { - Account, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { renewAllSnippet } from '../../contracts/bulkRenewal' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { renewSnippet } from '../../contracts/ethRegistrarController' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { UnsupportedNameTypeError } from '../../errors/general' -import { +import { bulkRenewalRenewAllSnippet } from '../../contracts/bulkRenewal.js' +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { ethRegistrarControllerRenewSnippet } from '../../contracts/ethRegistrarController.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { UnsupportedNameTypeError } from '../../errors/general.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { getNameType } from '../../utils/getNameType' +} from '../../types.js' +import { getNameType } from '../../utils/getNameType.js' export type RenewNamesDataParameters = { /** Name or names to renew */ @@ -68,7 +68,7 @@ export const makeFunctionData = < contract: 'ensEthRegistrarController', }), data: encodeFunctionData({ - abi: renewSnippet, + abi: ethRegistrarControllerRenewSnippet, functionName: 'renew', args: [labels[0], BigInt(duration)], }), @@ -82,7 +82,7 @@ export const makeFunctionData = < contract: 'ensBulkRenewal', }), data: encodeFunctionData({ - abi: renewAllSnippet, + abi: bulkRenewalRenewAllSnippet, functionName: 'renewAll', args: [labels, BigInt(duration)], }), diff --git a/packages/ensjs/src/functions/wallet/setAbiRecord.test.ts b/packages/ensjs/src/functions/wallet/setAbiRecord.test.ts index d5a5da92..e5662fe4 100644 --- a/packages/ensjs/src/functions/wallet/setAbiRecord.test.ts +++ b/packages/ensjs/src/functions/wallet/setAbiRecord.test.ts @@ -1,14 +1,14 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import { encodeAbi } from '../../utils/encoders/encodeAbi' -import getAbiRecord from '../public/getAbiRecord' -import getResolver from '../public/getResolver' -import setAbiRecord from './setAbiRecord' +} from '../../tests/addTestContracts.js' +import { encodeAbi } from '../../utils/encoders/encodeAbi.js' +import getAbiRecord from '../public/getAbiRecord.js' +import getResolver from '../public/getResolver.js' +import setAbiRecord from './setAbiRecord.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/wallet/setAbiRecord.ts b/packages/ensjs/src/functions/wallet/setAbiRecord.ts index 3d446598..9e17a0c5 100644 --- a/packages/ensjs/src/functions/wallet/setAbiRecord.ts +++ b/packages/ensjs/src/functions/wallet/setAbiRecord.ts @@ -1,22 +1,22 @@ -import { +import type { Account, Address, Hash, SendTransactionParameters, Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { EncodedAbi } from '../../utils/encoders/encodeAbi' +} from '../../types.js' +import type { EncodedAbi } from '../../utils/encoders/encodeAbi.js' import { - EncodeSetAbiParameters, encodeSetAbi, -} from '../../utils/encoders/encodeSetAbi' -import { namehash } from '../../utils/normalise' + type EncodeSetAbiParameters, +} from '../../utils/encoders/encodeSetAbi.js' +import { namehash } from '../../utils/normalise.js' export type SetAbiRecordDataParameters = { /** Name to set ABI for */ diff --git a/packages/ensjs/src/functions/wallet/setAddressRecord.test.ts b/packages/ensjs/src/functions/wallet/setAddressRecord.test.ts index 9d93f16f..9d760367 100644 --- a/packages/ensjs/src/functions/wallet/setAddressRecord.test.ts +++ b/packages/ensjs/src/functions/wallet/setAddressRecord.test.ts @@ -1,13 +1,13 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getAddressRecord from '../public/getAddressRecord' -import getResolver from '../public/getResolver' -import setAddressRecord from './setAddressRecord' +} from '../../tests/addTestContracts.js' +import getAddressRecord from '../public/getAddressRecord.js' +import getResolver from '../public/getResolver.js' +import setAddressRecord from './setAddressRecord.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/wallet/setAddressRecord.ts b/packages/ensjs/src/functions/wallet/setAddressRecord.ts index 1e602ba4..99b48757 100644 --- a/packages/ensjs/src/functions/wallet/setAddressRecord.ts +++ b/packages/ensjs/src/functions/wallet/setAddressRecord.ts @@ -1,18 +1,18 @@ -import { +import type { Account, Address, Hash, SendTransactionParameters, Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { encodeSetAddr } from '../../utils/encoders/encodeSetAddr' -import { namehash } from '../../utils/normalise' +} from '../../types.js' +import { encodeSetAddr } from '../../utils/encoders/encodeSetAddr.js' +import { namehash } from '../../utils/normalise.js' export type SetAddressRecordDataParameters = { /** Name to set address record for */ diff --git a/packages/ensjs/src/functions/wallet/setChildFuses.test.ts b/packages/ensjs/src/functions/wallet/setChildFuses.test.ts index 9270f1ef..6ee5f11c 100644 --- a/packages/ensjs/src/functions/wallet/setChildFuses.test.ts +++ b/packages/ensjs/src/functions/wallet/setChildFuses.test.ts @@ -1,16 +1,16 @@ -import { Address, Hex } from 'viem' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { getDataSnippet } from '../../contracts/nameWrapper' +import type { Address, Hex } from 'viem' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperGetDataSnippet } from '../../contracts/nameWrapper.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import { userSettableFuseEnum } from '../../utils/fuses' -import { namehash } from '../../utils/normalise' -import setChildFuses from './setChildFuses' -import setFuses from './setFuses' +} from '../../tests/addTestContracts.js' +import { userSettableFuseEnum } from '../../utils/fuses.js' +import { namehash } from '../../utils/normalise.js' +import setChildFuses from './setChildFuses.js' +import setFuses from './setFuses.js' let snapshot: Hex let accounts: Address[] @@ -55,7 +55,7 @@ const checkFuses = ( const getFuses = async (name: string) => { const [, fuses] = await publicClient.readContract({ - abi: getDataSnippet, + abi: nameWrapperGetDataSnippet, address: getChainContractAddress({ client: publicClient, contract: 'ensNameWrapper', diff --git a/packages/ensjs/src/functions/wallet/setChildFuses.ts b/packages/ensjs/src/functions/wallet/setChildFuses.ts index 75c3f962..d05686fb 100644 --- a/packages/ensjs/src/functions/wallet/setChildFuses.ts +++ b/packages/ensjs/src/functions/wallet/setChildFuses.ts @@ -1,21 +1,21 @@ import { - Account, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, labelhash, + type Account, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { setChildFusesSnippet } from '../../contracts/nameWrapper' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperSetChildFusesSnippet } from '../../contracts/nameWrapper.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { CombinedFuseInput, encodeFuses } from '../../utils/fuses' -import { namehash } from '../../utils/normalise' +} from '../../types.js' +import { encodeFuses, type CombinedFuseInput } from '../../utils/fuses.js' +import { namehash } from '../../utils/normalise.js' export type SetChildFusesDataParameters = { /** Name to set child fuses for */ @@ -53,7 +53,7 @@ export const makeFunctionData = < return { to: getChainContractAddress({ client: wallet, contract: 'ensNameWrapper' }), data: encodeFunctionData({ - abi: setChildFusesSnippet, + abi: nameWrapperSetChildFusesSnippet, functionName: 'setChildFuses', args: [parentNode, labelHash, encodedFuses, BigInt(expiry ?? 0)], }), diff --git a/packages/ensjs/src/functions/wallet/setContentHashRecord.test.ts b/packages/ensjs/src/functions/wallet/setContentHashRecord.test.ts index 75677da3..bd049185 100644 --- a/packages/ensjs/src/functions/wallet/setContentHashRecord.test.ts +++ b/packages/ensjs/src/functions/wallet/setContentHashRecord.test.ts @@ -1,13 +1,13 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getContentHashRecord from '../public/getContentHashRecord' -import getResolver from '../public/getResolver' -import setContentHashRecord from './setContentHashRecord' +} from '../../tests/addTestContracts.js' +import getContentHashRecord from '../public/getContentHashRecord.js' +import getResolver from '../public/getResolver.js' +import setContentHashRecord from './setContentHashRecord.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/wallet/setContentHashRecord.ts b/packages/ensjs/src/functions/wallet/setContentHashRecord.ts index 8cee1933..77b9671b 100644 --- a/packages/ensjs/src/functions/wallet/setContentHashRecord.ts +++ b/packages/ensjs/src/functions/wallet/setContentHashRecord.ts @@ -1,18 +1,18 @@ -import { +import type { Account, Address, Hash, SendTransactionParameters, Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { encodeSetContentHash } from '../../utils/encoders/encodeSetContentHash' -import { namehash } from '../../utils/normalise' +} from '../../types.js' +import { encodeSetContentHash } from '../../utils/encoders/encodeSetContentHash.js' +import { namehash } from '../../utils/normalise.js' export type SetContentHashRecordDataParameters = { /** Name to set content hash for */ diff --git a/packages/ensjs/src/functions/wallet/setFuses.test.ts b/packages/ensjs/src/functions/wallet/setFuses.test.ts index 60f09725..1cdad4a4 100644 --- a/packages/ensjs/src/functions/wallet/setFuses.test.ts +++ b/packages/ensjs/src/functions/wallet/setFuses.test.ts @@ -1,18 +1,18 @@ -import { Address, Hex } from 'viem' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { getDataSnippet } from '../../contracts/nameWrapper' +import type { Address, Hex } from 'viem' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperGetDataSnippet } from '../../contracts/nameWrapper.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' +} from '../../tests/addTestContracts.js' import { unnamedUserSettableFuses, userSettableFuseEnum, -} from '../../utils/fuses' -import { namehash } from '../../utils/normalise' -import setFuses from './setFuses' +} from '../../utils/fuses.js' +import { namehash } from '../../utils/normalise.js' +import setFuses from './setFuses.js' let snapshot: Hex let accounts: Address[] @@ -80,7 +80,7 @@ const checkUnnamedFuses = ( const getFuses = async (name: string) => { const [, fuses] = await publicClient.readContract({ - abi: getDataSnippet, + abi: nameWrapperGetDataSnippet, address: getChainContractAddress({ client: publicClient, contract: 'ensNameWrapper', diff --git a/packages/ensjs/src/functions/wallet/setFuses.ts b/packages/ensjs/src/functions/wallet/setFuses.ts index ab3133ac..57122753 100644 --- a/packages/ensjs/src/functions/wallet/setFuses.ts +++ b/packages/ensjs/src/functions/wallet/setFuses.ts @@ -1,20 +1,20 @@ import { - Account, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { setFusesSnippet } from '../../contracts/nameWrapper' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperSetFusesSnippet } from '../../contracts/nameWrapper.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { CombinedFuseInput, encodeFuses } from '../../utils/fuses' -import { namehash } from '../../utils/normalise' +} from '../../types.js' +import { encodeFuses, type CombinedFuseInput } from '../../utils/fuses.js' +import { namehash } from '../../utils/normalise.js' export type SetFusesDataParameters = { /** Name to set fuses for */ @@ -47,7 +47,7 @@ export const makeFunctionData = < return { to: getChainContractAddress({ client: wallet, contract: 'ensNameWrapper' }), data: encodeFunctionData({ - abi: setFusesSnippet, + abi: nameWrapperSetFusesSnippet, functionName: 'setFuses', args: [namehash(name), encodedFuses], }), diff --git a/packages/ensjs/src/functions/wallet/setPrimaryName.test.ts b/packages/ensjs/src/functions/wallet/setPrimaryName.test.ts index f109962e..5c47d9ee 100644 --- a/packages/ensjs/src/functions/wallet/setPrimaryName.test.ts +++ b/packages/ensjs/src/functions/wallet/setPrimaryName.test.ts @@ -1,14 +1,14 @@ -import { Address, Hex } from 'viem' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { setApprovalForAllSnippet } from '../../contracts/registry' +import type { Address, Hex } from 'viem' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { registrySetApprovalForAllSnippet } from '../../contracts/registry.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getName from '../public/getName' -import setPrimaryName from './setPrimaryName' +} from '../../tests/addTestContracts.js' +import getName from '../public/getName.js' +import setPrimaryName from './setPrimaryName.js' let snapshot: Hex let accounts: Address[] @@ -42,7 +42,7 @@ it('should return a transaction for a name and set successfully', async () => { it("should return a transaction for setting another address' name and succeed", async () => { const setApprovedForAllTx = await walletClient.writeContract({ - abi: setApprovalForAllSnippet, + abi: registrySetApprovalForAllSnippet, functionName: 'setApprovalForAll', address: getChainContractAddress({ client: walletClient, diff --git a/packages/ensjs/src/functions/wallet/setPrimaryName.ts b/packages/ensjs/src/functions/wallet/setPrimaryName.ts index 1a8009b6..044a0ac3 100644 --- a/packages/ensjs/src/functions/wallet/setPrimaryName.ts +++ b/packages/ensjs/src/functions/wallet/setPrimaryName.ts @@ -1,23 +1,23 @@ import { - Account, - Address, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Address, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' import { parseAccount } from 'viem/utils' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { - setNameForAddrSnippet, - setNameSnippet, -} from '../../contracts/reverseRegistrar' +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' import { + reverseRegistrarSetNameForAddrSnippet, + reverseRegistrarSetNameSnippet, +} from '../../contracts/reverseRegistrar.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' +} from '../../types.js' type BaseSetPrimaryNameDataParameters = { /** The name to set as primary */ @@ -76,7 +76,7 @@ export const makeFunctionData = < return { to: reverseRegistrarAddress, data: encodeFunctionData({ - abi: setNameForAddrSnippet, + abi: reverseRegistrarSetNameForAddrSnippet, functionName: 'setNameForAddr', args: [ address, @@ -95,7 +95,7 @@ export const makeFunctionData = < return { to: reverseRegistrarAddress, data: encodeFunctionData({ - abi: setNameSnippet, + abi: reverseRegistrarSetNameSnippet, functionName: 'setName', args: [name], }), diff --git a/packages/ensjs/src/functions/wallet/setRecords.test.ts b/packages/ensjs/src/functions/wallet/setRecords.test.ts index 0d7a8e6f..77fa8adf 100644 --- a/packages/ensjs/src/functions/wallet/setRecords.test.ts +++ b/packages/ensjs/src/functions/wallet/setRecords.test.ts @@ -1,14 +1,14 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import { encodeAbi } from '../../utils/encoders/encodeAbi' -import getRecords from '../public/getRecords' -import getResolver from '../public/getResolver' -import setRecords from './setRecords' +} from '../../tests/addTestContracts.js' +import { encodeAbi } from '../../utils/encoders/encodeAbi.js' +import getRecords from '../public/getRecords.js' +import getResolver from '../public/getResolver.js' +import setRecords from './setRecords.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/wallet/setRecords.ts b/packages/ensjs/src/functions/wallet/setRecords.ts index 9f1fd10d..71715432 100644 --- a/packages/ensjs/src/functions/wallet/setRecords.ts +++ b/packages/ensjs/src/functions/wallet/setRecords.ts @@ -1,24 +1,24 @@ import { - Account, - Address, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Address, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { multicallSnippet } from '../../contracts/publicResolver' -import { NoRecordsSpecifiedError } from '../../errors/public' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { publicResolverMulticallSnippet } from '../../contracts/publicResolver.js' +import { NoRecordsSpecifiedError } from '../../errors/public.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' +} from '../../types.js' import { - RecordOptions, generateRecordCallArray, -} from '../../utils/generateRecordCallArray' -import { namehash } from '../../utils/normalise' + type RecordOptions, +} from '../../utils/generateRecordCallArray.js' +import { namehash } from '../../utils/normalise.js' export type SetRecordsDataParameters = { /** The name to set records for */ @@ -60,7 +60,7 @@ export const makeFunctionData = < return { to: resolverAddress, data: encodeFunctionData({ - abi: multicallSnippet, + abi: publicResolverMulticallSnippet, functionName: 'multicall', args: [callArray], }), diff --git a/packages/ensjs/src/functions/wallet/setResolver.test.ts b/packages/ensjs/src/functions/wallet/setResolver.test.ts index 5d02f3be..6ba0c9ef 100644 --- a/packages/ensjs/src/functions/wallet/setResolver.test.ts +++ b/packages/ensjs/src/functions/wallet/setResolver.test.ts @@ -1,12 +1,12 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getResolver from '../public/getResolver' -import setResolver from './setResolver' +} from '../../tests/addTestContracts.js' +import getResolver from '../public/getResolver.js' +import setResolver from './setResolver.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/wallet/setResolver.ts b/packages/ensjs/src/functions/wallet/setResolver.ts index d07fff11..49bf1e84 100644 --- a/packages/ensjs/src/functions/wallet/setResolver.ts +++ b/packages/ensjs/src/functions/wallet/setResolver.ts @@ -1,20 +1,21 @@ import { - Account, - Address, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Address, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { setResolverSnippet } from '../../contracts/registry' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperSetResolverSnippet } from '../../contracts/nameWrapper.js' +import { registrySetResolverSnippet } from '../../contracts/registry.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { namehash } from '../../utils/normalise' +} from '../../types.js' +import { namehash } from '../../utils/normalise.js' export type SetResolverDataParameters = { /** Name to set resolver for */ @@ -48,15 +49,30 @@ export const makeFunctionData = < if (contract !== 'registry' && contract !== 'nameWrapper') throw new Error(`Unknown contract: ${contract}`) + const to = getChainContractAddress({ + client: wallet, + contract: contract === 'nameWrapper' ? 'ensNameWrapper' : 'ensRegistry', + }) + + const args = [namehash(name), resolverAddress] as const + const functionName = 'setResolver' + + if (contract === 'nameWrapper') + return { + to, + data: encodeFunctionData({ + abi: nameWrapperSetResolverSnippet, + functionName, + args, + }), + } + return { - to: getChainContractAddress({ - client: wallet, - contract: contract === 'nameWrapper' ? 'ensNameWrapper' : 'ensRegistry', - }), + to, data: encodeFunctionData({ - abi: setResolverSnippet, - functionName: 'setResolver', - args: [namehash(name), resolverAddress], + abi: registrySetResolverSnippet, + functionName, + args, }), } } diff --git a/packages/ensjs/src/functions/wallet/setTextRecord.test.ts b/packages/ensjs/src/functions/wallet/setTextRecord.test.ts index 91cd841a..95e3c79f 100644 --- a/packages/ensjs/src/functions/wallet/setTextRecord.test.ts +++ b/packages/ensjs/src/functions/wallet/setTextRecord.test.ts @@ -1,13 +1,13 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getResolver from '../public/getResolver' -import getText from '../public/getTextRecord' -import setTextRecord from './setTextRecord' +} from '../../tests/addTestContracts.js' +import getResolver from '../public/getResolver.js' +import getText from '../public/getTextRecord.js' +import setTextRecord from './setTextRecord.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/wallet/setTextRecord.ts b/packages/ensjs/src/functions/wallet/setTextRecord.ts index c5ef55ff..92839406 100644 --- a/packages/ensjs/src/functions/wallet/setTextRecord.ts +++ b/packages/ensjs/src/functions/wallet/setTextRecord.ts @@ -1,18 +1,18 @@ -import { +import type { Account, Address, Hash, SendTransactionParameters, Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { encodeSetText } from '../../utils/encoders/encodeSetText' -import { namehash } from '../../utils/normalise' +} from '../../types.js' +import { encodeSetText } from '../../utils/encoders/encodeSetText.js' +import { namehash } from '../../utils/normalise.js' export type SetTextRecordDataParameters = { /** The name to set a text record for */ diff --git a/packages/ensjs/src/functions/wallet/transferName.test.ts b/packages/ensjs/src/functions/wallet/transferName.test.ts index f139a65c..97993933 100644 --- a/packages/ensjs/src/functions/wallet/transferName.test.ts +++ b/packages/ensjs/src/functions/wallet/transferName.test.ts @@ -1,12 +1,12 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getOwner from '../public/getOwner' -import transferName from './transferName' +} from '../../tests/addTestContracts.js' +import getOwner from '../public/getOwner.js' +import transferName from './transferName.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/wallet/transferName.ts b/packages/ensjs/src/functions/wallet/transferName.ts index e418735d..9f949630 100644 --- a/packages/ensjs/src/functions/wallet/transferName.ts +++ b/packages/ensjs/src/functions/wallet/transferName.ts @@ -1,36 +1,40 @@ import { - Account, - Address, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, labelhash, + type Account, + type Address, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' import { parseAccount } from 'viem/utils' -import { reclaimSnippet } from '../../contracts/baseRegistrar' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { safeTransferFromSnippet as erc1155SafeTransferFromSnippet } from '../../contracts/erc1155' -import { safeTransferFromSnippet as erc721SafeTransferFromSnippet } from '../../contracts/erc721' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { setSubnodeOwnerSnippet as nameWrapperSetSubnodeOwnerSnippet } from '../../contracts/nameWrapper' import { - setSubnodeOwnerSnippet as registrySetSubnodeOwnerSnippet, - setOwnerSnippet, -} from '../../contracts/registry' + baseRegistrarReclaimSnippet, + baseRegistrarSafeTransferFromSnippet, +} from '../../contracts/baseRegistrar.js' +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { + nameWrapperSafeTransferFromSnippet, + nameWrapperSetSubnodeOwnerSnippet, +} from '../../contracts/nameWrapper.js' +import { + registrySetOwnerSnippet, + registrySetSubnodeOwnerSnippet, +} from '../../contracts/registry.js' import { AdditionalParameterSpecifiedError, InvalidContractTypeError, UnsupportedNameTypeError, -} from '../../errors/general' -import { +} from '../../errors/general.js' +import type { Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { getNameType } from '../../utils/getNameType' -import { makeLabelNodeAndParent } from '../../utils/makeLabelNodeAndParent' -import { namehash } from '../../utils/normalise' +} from '../../types.js' +import { getNameType } from '../../utils/getNameType.js' +import { makeLabelNodeAndParent } from '../../utils/makeLabelNodeAndParent.js' +import { namehash } from '../../utils/normalise.js' type BaseTransferNameDataParameters = { /** Name to transfer */ @@ -116,7 +120,7 @@ export const makeFunctionData = < return { to: registryAddress, data: encodeFunctionData({ - abi: setOwnerSnippet, + abi: registrySetOwnerSnippet, functionName: 'setOwner', args: [namehash(name), newOwnerAddress], }), @@ -146,12 +150,12 @@ export const makeFunctionData = < }), data: reclaim ? encodeFunctionData({ - abi: reclaimSnippet, + abi: baseRegistrarReclaimSnippet, functionName: 'reclaim', args: [tokenId, newOwnerAddress], }) : encodeFunctionData({ - abi: erc721SafeTransferFromSnippet, + abi: baseRegistrarSafeTransferFromSnippet, functionName: 'safeTransferFrom', args: [wallet.account.address, newOwnerAddress, tokenId], }), @@ -176,7 +180,7 @@ export const makeFunctionData = < return { to: nameWrapperAddress, data: encodeFunctionData({ - abi: erc1155SafeTransferFromSnippet, + abi: nameWrapperSafeTransferFromSnippet, functionName: 'safeTransferFrom', args: [ wallet.account.address, diff --git a/packages/ensjs/src/functions/wallet/unwrapName.test.ts b/packages/ensjs/src/functions/wallet/unwrapName.test.ts index 025b2975..26104e04 100644 --- a/packages/ensjs/src/functions/wallet/unwrapName.test.ts +++ b/packages/ensjs/src/functions/wallet/unwrapName.test.ts @@ -1,12 +1,12 @@ -import { Address, Hex } from 'viem' +import type { Address, Hex } from 'viem' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getOwner from '../public/getOwner' -import unwrapName from './unwrapName' +} from '../../tests/addTestContracts.js' +import getOwner from '../public/getOwner.js' +import unwrapName from './unwrapName.js' let snapshot: Hex let accounts: Address[] diff --git a/packages/ensjs/src/functions/wallet/unwrapName.ts b/packages/ensjs/src/functions/wallet/unwrapName.ts index 7e0ef9e1..bf2cffce 100644 --- a/packages/ensjs/src/functions/wallet/unwrapName.ts +++ b/packages/ensjs/src/functions/wallet/unwrapName.ts @@ -1,27 +1,30 @@ import { - Account, - Address, - Hash, - SendTransactionParameters, - Transport, encodeFunctionData, + type Account, + type Address, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { unwrapEth2ldSnippet, unwrapSnippet } from '../../contracts/nameWrapper' +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { + nameWrapperUnwrapEth2ldSnippet, + nameWrapperUnwrapSnippet, +} from '../../contracts/nameWrapper.js' import { AdditionalParameterSpecifiedError, RequiredParameterNotSpecifiedError, -} from '../../errors/general' -import { +} from '../../errors/general.js' +import type { Eth2ldName, Eth2ldNameSpecifier, GetNameType, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { getNameType } from '../../utils/getNameType' -import { makeLabelNodeAndParent } from '../../utils/makeLabelNodeAndParent' +} from '../../types.js' +import { getNameType } from '../../utils/getNameType.js' +import { makeLabelNodeAndParent } from '../../utils/makeLabelNodeAndParent.js' type BaseUnwrapNameDataParameters = { /** The name to unwrap */ @@ -91,7 +94,7 @@ export const makeFunctionData = < return { to: nameWrapperAddress, data: encodeFunctionData({ - abi: unwrapEth2ldSnippet, + abi: nameWrapperUnwrapEth2ldSnippet, functionName: 'unwrapETH2LD', args: [labelhash, newRegistrantAddress, newOwnerAddress], }), @@ -108,7 +111,7 @@ export const makeFunctionData = < return { to: nameWrapperAddress, data: encodeFunctionData({ - abi: unwrapSnippet, + abi: nameWrapperUnwrapSnippet, functionName: 'unwrap', args: [parentNode, labelhash, newOwnerAddress], }), diff --git a/packages/ensjs/src/functions/wallet/wrapName.test.ts b/packages/ensjs/src/functions/wallet/wrapName.test.ts index 14d61e6b..9f971c5d 100644 --- a/packages/ensjs/src/functions/wallet/wrapName.test.ts +++ b/packages/ensjs/src/functions/wallet/wrapName.test.ts @@ -1,16 +1,16 @@ -import { Address, Hex } from 'viem' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { setApprovalForAllSnippet } from '../../contracts/registry' +import type { Address, Hex } from 'viem' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { registrySetApprovalForAllSnippet } from '../../contracts/registry.js' import { publicClient, testClient, waitForTransaction, walletClient, -} from '../../tests/addTestContracts' -import getOwner from '../public/getOwner' -import getResolver from '../public/getResolver' -import getWrapperData from '../public/getWrapperData' -import wrapName from './wrapName' +} from '../../tests/addTestContracts.js' +import getOwner from '../public/getOwner.js' +import getResolver from '../public/getResolver.js' +import getWrapperData from '../public/getWrapperData.js' +import wrapName from './wrapName.js' let snapshot: Hex let accounts: Address[] @@ -29,7 +29,7 @@ afterEach(async () => { const approve = async () => { return walletClient.writeContract({ - abi: setApprovalForAllSnippet, + abi: registrySetApprovalForAllSnippet, address: getChainContractAddress({ client: walletClient, contract: 'ensRegistry', diff --git a/packages/ensjs/src/functions/wallet/wrapName.ts b/packages/ensjs/src/functions/wallet/wrapName.ts index 316bb213..ddfad517 100644 --- a/packages/ensjs/src/functions/wallet/wrapName.ts +++ b/packages/ensjs/src/functions/wallet/wrapName.ts @@ -1,31 +1,31 @@ import { - Account, - Address, - Hash, - SendTransactionParameters, - Transport, encodeAbiParameters, encodeFunctionData, labelhash, toHex, + type Account, + type Address, + type Hash, + type SendTransactionParameters, + type Transport, } from 'viem' import { parseAccount } from 'viem/utils' -import { ChainWithEns, WalletWithEns } from '../../contracts/consts' -import { safeTransferFromWithDataSnippet } from '../../contracts/erc721' -import { getChainContractAddress } from '../../contracts/getChainContractAddress' -import { wrapSnippet } from '../../contracts/nameWrapper' -import { AdditionalParameterSpecifiedError } from '../../errors/general' -import { +import { baseRegistrarSafeTransferFromWithDataSnippet } from '../../contracts/baseRegistrar.js' +import type { ChainWithEns, WalletWithEns } from '../../contracts/consts.js' +import { getChainContractAddress } from '../../contracts/getChainContractAddress.js' +import { nameWrapperWrapSnippet } from '../../contracts/nameWrapper.js' +import { AdditionalParameterSpecifiedError } from '../../errors/general.js' +import type { Eth2ldNameSpecifier, GetNameType, Prettify, SimpleTransactionRequest, WriteTransactionParameters, -} from '../../types' -import { CombinedFuseInput, encodeFuses } from '../../utils/fuses' -import { packetToBytes } from '../../utils/hexEncodedName' -import { checkIsDotEth } from '../../utils/validation' -import { wrappedLabelLengthCheck } from '../../utils/wrapper' +} from '../../types.js' +import { encodeFuses, type CombinedFuseInput } from '../../utils/fuses.js' +import { packetToBytes } from '../../utils/hexEncodedName.js' +import { checkIsDotEth } from '../../utils/validation.js' +import { wrappedLabelLengthCheck } from '../../utils/wrapper.js' export type WrapNameDataParameters< TName extends string, @@ -102,7 +102,7 @@ export const makeFunctionData = < contract: 'ensBaseRegistrarImplementation', }), data: encodeFunctionData({ - abi: safeTransferFromWithDataSnippet, + abi: baseRegistrarSafeTransferFromWithDataSnippet, functionName: 'safeTransferFrom', args: [wallet.account.address, nameWrapperAddress, tokenId, data], }), @@ -120,7 +120,7 @@ export const makeFunctionData = < return { to: nameWrapperAddress, data: encodeFunctionData({ - abi: wrapSnippet, + abi: nameWrapperWrapSnippet, functionName: 'wrap', args: [toHex(packetToBytes(name)), newOwnerAddress, resolverAddress], }), diff --git a/packages/ensjs/src/index.ts b/packages/ensjs/src/index.ts index fa6a70c3..0b0511d3 100644 --- a/packages/ensjs/src/index.ts +++ b/packages/ensjs/src/index.ts @@ -1,4 +1,71 @@ -export * from './clients' -export { addEnsContracts, getChainContractAddress } from './contracts' -export * from './functions' -export * from './utils' +export { + ensPublicActions, + type EnsPublicActions, +} from './clients/decorators/public.js' +export { + ensSubgraphActions, + type EnsSubgraphActions, +} from './clients/decorators/subgraph.js' +export { + ensWalletActions, + type EnsWalletActions, +} from './clients/decorators/wallet.js' +export { + createEnsPublicClient, + type EnsPublicClient, + type EnsPublicClientConfig, +} from './clients/public.js' +export { + createEnsSubgraphClient, + type EnsSubgraphClient, + type EnsSubgraphClientConfig, +} from './clients/subgraph.js' +export { + createEnsWalletClient, + type EnsWalletClient, + type EnsWalletClientConfig, +} from './clients/wallet.js' + +export { addEnsContracts } from './contracts/addEnsContracts.js' +export { BaseError } from './errors/base.js' +export { NoChainError, UnsupportedNetworkError } from './errors/contracts.js' +export { + DnsDnssecVerificationFailedError, + DnsInvalidAddressChecksumError, + DnsInvalidTxtRecordError, + DnsNewerRecordTypeAvailableError, + DnsNoTxtRecordError, + DnsResponseStatusError, +} from './errors/dns.js' +export { + AdditionalParameterSpecifiedError, + InvalidContractTypeError, + RequiredParameterNotSpecifiedError, + UnsupportedNameTypeError, +} from './errors/general.js' +export { + CoinFormatterNotFoundError, + FunctionNotBatchableError, + NoRecordsSpecifiedError, +} from './errors/public.js' +export { + FilterKeyRequiredError, + InvalidFilterKeyError, + InvalidOrderByError, +} from './errors/subgraph.js' +export { + CampaignReferenceTooLargeError, + FusesFuseNotAllowedError, + FusesInvalidFuseObjectError, + FusesInvalidNamedFuseError, + FusesInvalidUnnamedFuseError, + FusesNonIntegerError, + FusesOutOfRangeError, + FusesRestrictionNotAllowedError, + FusesValueRequiredError, + InvalidEncodedLabelError, + InvalidLabelhashError, + NameWithEmptyLabelsError, + RootNameIncludesOtherLabelsError, + WrappedLabelTooLargeError, +} from './errors/utils.js' diff --git a/packages/ensjs/src/public.ts b/packages/ensjs/src/public.ts new file mode 100644 index 00000000..cc00b9fc --- /dev/null +++ b/packages/ensjs/src/public.ts @@ -0,0 +1,100 @@ +export { + default as _getAbi, + type InternalGetAbiParameters, + type InternalGetAbiReturnType, +} from './functions/public/_getAbi.js' +export { + default as _getAddr, + type InternalGetAddrParameters, + type InternalGetAddrReturnType, +} from './functions/public/_getAddr.js' +export { + default as _getContentHash, + type InternalGetContentHashParameters, + type InternalGetContentHashReturnType, +} from './functions/public/_getContentHash.js' +export { + default as _getText, + type InternalGetTextParameters, + type InternalGetTextReturnType, +} from './functions/public/_getText.js' +export { + default as batch, + type BatchParameters, + type BatchReturnType, +} from './functions/public/batch.js' +export { + default as getAbiRecord, + type GetAbiRecordParameters, + type GetAbiRecordReturnType, +} from './functions/public/getAbiRecord.js' +export { + default as getAddressRecord, + type GetAddressRecordParameters, + type GetAddressRecordReturnType, +} from './functions/public/getAddressRecord.js' +export { + default as getAvailable, + type GetAvailableParameters, + type GetAvailableReturnType, +} from './functions/public/getAvailable.js' +export { + default as getContentHashRecord, + type GetContentHashRecordParameters, + type GetContentHashRecordReturnType, +} from './functions/public/getContentHashRecord.js' +export { + default as getExpiry, + type GetExpiryParameters, + type GetExpiryReturnType, +} from './functions/public/getExpiry.js' +export { + default as getName, + type GetNameParameters, + type GetNameReturnType, +} from './functions/public/getName.js' +export { + default as getOwner, + type GetOwnerParameters, + type GetOwnerReturnType, +} from './functions/public/getOwner.js' +export { + default as getPrice, + type GetPriceParameters, + type GetPriceReturnType, +} from './functions/public/getPrice.js' +export { + default as getRecords, + type GetRecordsParameters, + type GetRecordsReturnType, +} from './functions/public/getRecords.js' +export { + default as getResolver, + type GetResolverParameters, + type GetResolverReturnType, +} from './functions/public/getResolver.js' +export { + default as getSupportedInterfaces, + type GetSupportedInterfacesParameters, + type GetSupportedInterfacesReturnType, +} from './functions/public/getSupportedInterfaces.js' +export { + default as getTextRecord, + type GetTextRecordParameters, + type GetTextRecordReturnType, +} from './functions/public/getTextRecord.js' +export { + default as getWrapperData, + type GetWrapperDataParameters, + type GetWrapperDataReturnType, +} from './functions/public/getWrapperData.js' +export { + default as multicallWrapper, + type MulticallWrapperParameters, + type MulticallWrapperReturnType, +} from './functions/public/multicallWrapper.js' +export { + default as universalWrapper, + type UniversalWrapperParameters, + type UniversalWrapperReturnType, +} from './functions/public/universalWrapper.js' diff --git a/packages/ensjs/src/subgraph.ts b/packages/ensjs/src/subgraph.ts new file mode 100644 index 00000000..a4d2f75b --- /dev/null +++ b/packages/ensjs/src/subgraph.ts @@ -0,0 +1,65 @@ +export { createSubgraphClient } from './functions/subgraph/client.js' +export type { + AbiChanged, + AddrChanged, + AuthorisationChanged, + BaseDomainEvent, + BaseRegistrationEvent, + BaseResolverEvent, + ContenthashChanged, + DomainEvent, + DomainEventKey, + ExpiryExtended, + FusesSet, + InterfaceChanged, + MulticoinAddrChanged, + NameChanged, + NameRegistered, + NameRenewed, + NameTransferred, + NameUnwrapped, + NameWrapped, + NewOwner, + NewResolver, + NewTtl, + PubkeyChanged, + RegistrationEvent, + RegistrationEventKey, + ResolverEvent, + ResolverEventKey, + TextChanged, + Transfer, + VersionChanged, + WrappedTransfer, +} from './functions/subgraph/events.js' +export { + default as getDecodedName, + type GetDecodedNameParameters, + type GetDecodedNameReturnType, +} from './functions/subgraph/getDecodedName.js' +export { + default as getNameHistory, + type GetNameHistoryParameters, + type GetNameHistoryReturnType, +} from './functions/subgraph/getNameHistory.js' +export { + default as getNamesForAddress, + type GetNamesForAddressParameters, + type GetNamesForAddressReturnType, + type NameWithRelation, +} from './functions/subgraph/getNamesForAddress.js' +export { + default as getSubgraphRecords, + type GetSubgraphRecordsParameters, + type GetSubgraphRecordsReturnType, +} from './functions/subgraph/getSubgraphRecords.js' +export { + default as getSubgraphRegistrant, + type GetSubgraphRegistrantParameters, + type GetSubgraphRegistrantReturnType, +} from './functions/subgraph/getSubgraphRegistrant.js' +export { + default as getSubnames, + type GetSubnamesParameters, + type GetSubnamesReturnType, +} from './functions/subgraph/getSubnames.js' diff --git a/packages/ensjs/src/tests/addTestContracts.ts b/packages/ensjs/src/tests/addTestContracts.ts index 43a8dcb0..05005345 100644 --- a/packages/ensjs/src/tests/addTestContracts.ts +++ b/packages/ensjs/src/tests/addTestContracts.ts @@ -1,27 +1,41 @@ import { config } from 'dotenv' import { resolve } from 'path' import { - Account, - Address, - Hash, - PublicClient, - TestClient, - TransactionReceipt, TransactionReceiptNotFoundError, - WalletClient, createPublicClient, createTestClient, createWalletClient, http, + type Account, + type Address, + type Hash, + type PublicClient, + type TestClient, + type TransactionReceipt, + type WalletClient, } from 'viem' import { localhost as _localhost } from 'viem/chains' -import { ContractName } from '../contracts/types' config({ path: resolve(__dirname, '../../.env.local'), override: true, }) +type ContractName = + | 'BaseRegistrarImplementation' + | 'ETHRegistrarController' + | 'Multicall' + | 'NameWrapper' + | 'DNSRegistrar' + | 'PublicResolver' + | 'ENSRegistry' + | 'ReverseRegistrar' + | 'UniversalResolver' + | 'BulkRenewal' + | 'DNSSECImpl' + | 'LegacyDNSRegistrar' + | 'LegacyDNSSECImpl' + export const deploymentAddresses = JSON.parse( process.env.DEPLOYMENT_ADDRESSES!, ) as Record< @@ -75,20 +89,16 @@ export const localhost = { const transport = http('http://localhost:8545') -export const publicClient: PublicClient< - typeof transport, - typeof localhost, - true -> = createPublicClient({ - chain: localhost, - transport, -}) +export const publicClient: PublicClient = + createPublicClient({ + chain: localhost, + transport, + }) export const testClient: TestClient< 'anvil', typeof transport, - typeof localhost, - true + typeof localhost > = createTestClient({ chain: localhost, transport, @@ -98,8 +108,7 @@ export const testClient: TestClient< export const walletClient: WalletClient< typeof transport, typeof localhost, - Account, - true + Account > = createWalletClient({ chain: localhost, transport, diff --git a/packages/ensjs/src/types.ts b/packages/ensjs/src/types.ts index d0bc0ff7..e2a78167 100644 --- a/packages/ensjs/src/types.ts +++ b/packages/ensjs/src/types.ts @@ -4,7 +4,7 @@ import type { SendTransactionParameters, TransactionRequest, } from 'viem' -import { ChainWithEns } from './contracts/consts' +import type { ChainWithEns } from './contracts/consts.js' export type Prettify = { [K in keyof T]: T[K] diff --git a/packages/ensjs/src/utils/contentHash.ts b/packages/ensjs/src/utils/contentHash.ts index f801452a..93c113f3 100644 --- a/packages/ensjs/src/utils/contentHash.ts +++ b/packages/ensjs/src/utils/contentHash.ts @@ -1,5 +1,5 @@ import contentHash from '@ensdomains/content-hash' -import { Hex, isHex } from 'viem' +import { isHex, type Hex } from 'viem' export type ProtocolType = | 'ipfs' @@ -75,6 +75,7 @@ export function isValidContenthash(encoded: any) { } catch (e) { console.log(e) } + return false } export function getProtocolType(encoded: any) { @@ -92,6 +93,7 @@ export function getProtocolType(encoded: any) { } catch (e) { console.log(e) } + return } export function encodeContenthash(text: string) { diff --git a/packages/ensjs/src/utils/encoders/encodeAbi.ts b/packages/ensjs/src/utils/encoders/encodeAbi.ts index 44a71e3a..2880ba10 100644 --- a/packages/ensjs/src/utils/encoders/encodeAbi.ts +++ b/packages/ensjs/src/utils/encoders/encodeAbi.ts @@ -1,5 +1,5 @@ -import { Hex, bytesToHex, stringToHex } from 'viem' -import { Prettify } from '../../types' +import { bytesToHex, stringToHex, type Hex } from 'viem' +import type { Prettify } from '../../types.js' type AbiEncodeAs = 'json' | 'zlib' | 'cbor' | 'uri' diff --git a/packages/ensjs/src/utils/encoders/encodeSetAbi.ts b/packages/ensjs/src/utils/encoders/encodeSetAbi.ts index 864e4dea..ea263e85 100644 --- a/packages/ensjs/src/utils/encoders/encodeSetAbi.ts +++ b/packages/ensjs/src/utils/encoders/encodeSetAbi.ts @@ -1,6 +1,6 @@ -import { Hex, encodeFunctionData } from 'viem' -import { setAbiSnippet } from '../../contracts/publicResolver' -import { EncodedAbi } from './encodeAbi' +import { encodeFunctionData, type Hex } from 'viem' +import { publicResolverSetAbiSnippet } from '../../contracts/publicResolver.js' +import type { EncodedAbi } from './encodeAbi.js' export type EncodeSetAbiParameters = { namehash: Hex @@ -14,7 +14,7 @@ export const encodeSetAbi = ({ encodedData, }: EncodeSetAbiParameters): EncodeSetAbiReturnType => { return encodeFunctionData({ - abi: setAbiSnippet, + abi: publicResolverSetAbiSnippet, functionName: 'setABI', args: [namehash, BigInt(contentType), encodedData ?? '0x'], }) diff --git a/packages/ensjs/src/utils/encoders/encodeSetAddr.ts b/packages/ensjs/src/utils/encoders/encodeSetAddr.ts index 54c15ece..7a36193d 100644 --- a/packages/ensjs/src/utils/encoders/encodeSetAddr.ts +++ b/packages/ensjs/src/utils/encoders/encodeSetAddr.ts @@ -1,6 +1,6 @@ import { formatsByCoinType, formatsByName } from '@ensdomains/address-encoder' -import { Address, Hex, bytesToHex, encodeFunctionData } from 'viem' -import { setAddrSnippet } from '../../contracts/publicResolver' +import { bytesToHex, encodeFunctionData, type Address, type Hex } from 'viem' +import { publicResolverSetAddrSnippet } from '../../contracts/publicResolver.js' export type EncodeSetAddrParameters = { namehash: Hex @@ -36,7 +36,7 @@ export const encodeSetAddr = ({ } return encodeFunctionData({ - abi: setAddrSnippet, + abi: publicResolverSetAddrSnippet, functionName: 'setAddr', args: [namehash, BigInt(inputCoinType), encodedAddress], }) diff --git a/packages/ensjs/src/utils/encoders/encodeSetContentHash.ts b/packages/ensjs/src/utils/encoders/encodeSetContentHash.ts index e80e6875..ecbad557 100644 --- a/packages/ensjs/src/utils/encoders/encodeSetContentHash.ts +++ b/packages/ensjs/src/utils/encoders/encodeSetContentHash.ts @@ -1,6 +1,6 @@ -import { Hex, encodeFunctionData } from 'viem' -import { setContenthashSnippet } from '../../contracts/publicResolver' -import { encodeContenthash } from '../contentHash' +import { encodeFunctionData, type Hex } from 'viem' +import { publicResolverSetContenthashSnippet } from '../../contracts/publicResolver.js' +import { encodeContenthash } from '../contentHash.js' export type EncodeSetContentHashParameters = { namehash: Hex @@ -20,7 +20,7 @@ export const encodeSetContentHash = ({ encodedHash = encodedObject.encoded as Hex } return encodeFunctionData({ - abi: setContenthashSnippet, + abi: publicResolverSetContenthashSnippet, functionName: 'setContenthash', args: [namehash, encodedHash], }) diff --git a/packages/ensjs/src/utils/encoders/encodeSetText.ts b/packages/ensjs/src/utils/encoders/encodeSetText.ts index 153478a3..89877384 100644 --- a/packages/ensjs/src/utils/encoders/encodeSetText.ts +++ b/packages/ensjs/src/utils/encoders/encodeSetText.ts @@ -1,5 +1,5 @@ -import { Hex, encodeFunctionData } from 'viem' -import { setTextSnippet } from '../../contracts/publicResolver' +import { encodeFunctionData, type Hex } from 'viem' +import { publicResolverSetTextSnippet } from '../../contracts/publicResolver.js' export type EncodeSetTextParameters = { namehash: Hex @@ -15,7 +15,7 @@ export const encodeSetText = ({ value, }: EncodeSetTextParameters): EncodeSetTextReturnType => { return encodeFunctionData({ - abi: setTextSnippet, + abi: publicResolverSetTextSnippet, functionName: 'setText', args: [namehash, key, value ?? ''], }) diff --git a/packages/ensjs/src/utils/encoders/index.ts b/packages/ensjs/src/utils/encoders/index.ts deleted file mode 100644 index 8acb5b88..00000000 --- a/packages/ensjs/src/utils/encoders/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -export { - EncodeAbiParameters, - EncodeAbiReturnType, - encodeAbi, -} from './encodeAbi' -export { - EncodeSetAbiParameters, - EncodeSetAbiReturnType, - encodeSetAbi, -} from './encodeSetAbi' -export { - EncodeSetAddrParameters, - EncodeSetAddrReturnType, - encodeSetAddr, -} from './encodeSetAddr' -export { - EncodeSetContentHashParameters, - EncodeSetContentHashReturnType, - encodeSetContentHash, -} from './encodeSetContentHash' -export { - EncodeSetTextParameters, - EncodeSetTextReturnType, - encodeSetText, -} from './encodeSetText' diff --git a/packages/ensjs/src/utils/fuses.ts b/packages/ensjs/src/utils/fuses.ts index ed717a3a..f93e84b3 100644 --- a/packages/ensjs/src/utils/fuses.ts +++ b/packages/ensjs/src/utils/fuses.ts @@ -7,7 +7,7 @@ import { FusesOutOfRangeError, FusesRestrictionNotAllowedError, FusesValueRequiredError, -} from '../errors/utils' +} from '../errors/utils.js' // child named fuses const CANNOT_UNWRAP = 1 diff --git a/packages/ensjs/src/utils/generateFunction.ts b/packages/ensjs/src/utils/generateFunction.ts index 9ecba9a3..40fe4313 100644 --- a/packages/ensjs/src/utils/generateFunction.ts +++ b/packages/ensjs/src/utils/generateFunction.ts @@ -1,6 +1,6 @@ import { call } from 'viem/actions' -import { ClientWithEns } from '../contracts/consts' -import { TransactionRequestWithPassthrough } from '../types' +import type { ClientWithEns } from '../contracts/consts.js' +import type { TransactionRequestWithPassthrough } from '../types.js' export type EncoderFunction = ( ...args: any[] diff --git a/packages/ensjs/src/utils/generateRecordCallArray.test.ts b/packages/ensjs/src/utils/generateRecordCallArray.test.ts index 0527c05e..c96142ff 100644 --- a/packages/ensjs/src/utils/generateRecordCallArray.test.ts +++ b/packages/ensjs/src/utils/generateRecordCallArray.test.ts @@ -1,5 +1,5 @@ -import { generateRecordCallArray } from './generateRecordCallArray' -import { namehash } from './normalise' +import { generateRecordCallArray } from './generateRecordCallArray.js' +import { namehash } from './normalise.js' it('generates a record call array', () => { expect( diff --git a/packages/ensjs/src/utils/generateRecordCallArray.ts b/packages/ensjs/src/utils/generateRecordCallArray.ts index 66b0bf24..a35e2f04 100644 --- a/packages/ensjs/src/utils/generateRecordCallArray.ts +++ b/packages/ensjs/src/utils/generateRecordCallArray.ts @@ -1,16 +1,19 @@ -import { Hex, encodeFunctionData } from 'viem' -import { clearRecordsSnippet } from '../contracts/publicResolver' -import { Prettify } from '../types' -import { EncodeSetAbiParameters, encodeSetAbi } from './encoders/encodeSetAbi' +import { encodeFunctionData, type Hex } from 'viem' +import { publicResolverClearRecordsSnippet } from '../contracts/publicResolver.js' +import type { Prettify } from '../types.js' +import { + encodeSetAbi, + type EncodeSetAbiParameters, +} from './encoders/encodeSetAbi.js' import { - EncodeSetAddrParameters, encodeSetAddr, -} from './encoders/encodeSetAddr' -import { encodeSetContentHash } from './encoders/encodeSetContentHash' + type EncodeSetAddrParameters, +} from './encoders/encodeSetAddr.js' +import { encodeSetContentHash } from './encoders/encodeSetContentHash.js' import { - EncodeSetTextParameters, encodeSetText, -} from './encoders/encodeSetText' + type EncodeSetTextParameters, +} from './encoders/encodeSetText.js' export type RecordOptions = Prettify<{ /** Clears all current records */ @@ -38,7 +41,7 @@ export const generateRecordCallArray = ({ if (clearRecords) { calls.push( encodeFunctionData({ - abi: clearRecordsSnippet, + abi: publicResolverClearRecordsSnippet, functionName: 'clearRecords', args: [namehash], }), diff --git a/packages/ensjs/src/utils/getNameType.ts b/packages/ensjs/src/utils/getNameType.ts index 1bedaf6c..ae761486 100644 --- a/packages/ensjs/src/utils/getNameType.ts +++ b/packages/ensjs/src/utils/getNameType.ts @@ -1,4 +1,4 @@ -import { NameType } from '../types' +import type { NameType } from '../types.js' export const getNameType = (name: string): NameType => { const labels = name.split('.') diff --git a/packages/ensjs/src/utils/hexEncodedName.ts b/packages/ensjs/src/utils/hexEncodedName.ts index 1e1b2799..8df957fe 100644 --- a/packages/ensjs/src/utils/hexEncodedName.ts +++ b/packages/ensjs/src/utils/hexEncodedName.ts @@ -1,5 +1,5 @@ // Adapted from https://github.com/mafintosh/dns-packet -import { ByteArray, bytesToString, stringToBytes } from 'viem' +import { bytesToString, stringToBytes, type ByteArray } from 'viem' /* * @description Encodes a DNS packet into a ByteArray containing a UDP payload. diff --git a/packages/ensjs/src/utils/index.ts b/packages/ensjs/src/utils/index.ts index 88776ced..8ce56800 100644 --- a/packages/ensjs/src/utils/index.ts +++ b/packages/ensjs/src/utils/index.ts @@ -1,12 +1,103 @@ -export * from './consts' -export * from './contentHash' -export * from './encoders' -export * from './format' -export * from './generateRecordCallArray' -export * from './hexEncodedName' -export * from './labels' -export * from './makeSafeSecondsDate' -export * from './normalise' -export * from './registerHelpers' -export * from './validation' -export * from './wrapper' +export { + encodeAbi, + type EncodeAbiParameters, + type EncodeAbiReturnType, + type EncodedAbi, +} from './encoders/encodeAbi.js' +export { + encodeSetAbi, + type EncodeSetAbiParameters, + type EncodeSetAbiReturnType, +} from './encoders/encodeSetAbi.js' +export { + encodeSetAddr, + type EncodeSetAddrParameters, + type EncodeSetAddrReturnType, +} from './encoders/encodeSetAddr.js' +export { + encodeSetContentHash, + type EncodeSetContentHashParameters, + type EncodeSetContentHashReturnType, +} from './encoders/encodeSetContentHash.js' +export { + encodeSetText, + type EncodeSetTextParameters, + type EncodeSetTextReturnType, +} from './encoders/encodeSetText.js' + +export { + EMPTY_ADDRESS, + GRACE_PERIOD_SECONDS, + MAX_DATE_INT, + MAX_INT_64, + MINIMUM_DOT_ETH_CHARS, +} from './consts.js' + +export { + decodeContenthash, + encodeContenthash, + getProtocolType, + isValidContenthash, + validateContent, + type DecodedContentHash, + type ProtocolType, +} from './contentHash.js' +export { bracketFormat, formatHashed, truncateFormat } from './format.js' +export { + generateRecordCallArray, + type RecordOptions, +} from './generateRecordCallArray.js' +export { bytesToPacket, packetToBytes } from './hexEncodedName.js' +export { + checkIsDecrypted, + checkLabel, + decodeLabelhash, + decryptName, + encodeLabelhash, + isEncodedLabelhash, + saveLabel, + saveName, +} from './labels.js' +export { makeSafeSecondsDate } from './makeSafeSecondsDate.js' +export { + beautify, + emoji, + isCombiningMark, + namehash, + normalise, + normaliseFragment, + shouldEscape, + split, + tokenise, + type DisallowedToken, + type EmojiToken, + type IgnoredToken, + type Label, + type MappedToken, + type NFCToken, + type StopToken, + type TextToken, + type Token, + type ValidToken, +} from './normalise.js' +export { + makeCommitment, + makeCommitmentFromTuple, + makeCommitmentTuple, + makeRegistrationTuple, + randomSecret, + type CommitmentTuple, + type RegistrationParameters, + type RegistrationTuple, +} from './registerHelpers.js' +export { + checkIsDotEth, + parseInput, + validateName, + type ParsedInputResult, +} from './validation.js' +export { + MAX_EXPIRY, + expiryToBigInt, + wrappedLabelLengthCheck, +} from './wrapper.js' diff --git a/packages/ensjs/src/utils/labels.test.ts b/packages/ensjs/src/utils/labels.test.ts index 7b0e665c..d0983dcb 100644 --- a/packages/ensjs/src/utils/labels.test.ts +++ b/packages/ensjs/src/utils/labels.test.ts @@ -5,7 +5,7 @@ import { isEncodedLabelhash, saveLabel, saveName, -} from './labels' +} from './labels.js' describe('decodeLabelhash()', () => { it('decodes labelhash', () => { diff --git a/packages/ensjs/src/utils/labels.ts b/packages/ensjs/src/utils/labels.ts index 144bd361..6b354ac2 100644 --- a/packages/ensjs/src/utils/labels.ts +++ b/packages/ensjs/src/utils/labels.ts @@ -1,8 +1,8 @@ -import { Hex, labelhash } from 'viem' +import { labelhash, type Hex } from 'viem' import { InvalidEncodedLabelError, InvalidLabelhashError, -} from '../errors/utils' +} from '../errors/utils.js' const hasLocalStorage = typeof localStorage !== 'undefined' diff --git a/packages/ensjs/src/utils/makeLabelNodeAndParent.test.ts b/packages/ensjs/src/utils/makeLabelNodeAndParent.test.ts index c02e3af0..4ab3bde9 100644 --- a/packages/ensjs/src/utils/makeLabelNodeAndParent.test.ts +++ b/packages/ensjs/src/utils/makeLabelNodeAndParent.test.ts @@ -1,4 +1,4 @@ -import { makeLabelNodeAndParent } from './makeLabelNodeAndParent' +import { makeLabelNodeAndParent } from './makeLabelNodeAndParent.js' it('makes label node and parent', () => { expect(makeLabelNodeAndParent('test.eth')).toMatchInlineSnapshot(` diff --git a/packages/ensjs/src/utils/makeLabelNodeAndParent.ts b/packages/ensjs/src/utils/makeLabelNodeAndParent.ts index 97b5ffff..abda8869 100644 --- a/packages/ensjs/src/utils/makeLabelNodeAndParent.ts +++ b/packages/ensjs/src/utils/makeLabelNodeAndParent.ts @@ -1,5 +1,5 @@ import { labelhash } from 'viem' -import { namehash } from './normalise' +import { namehash } from './normalise.js' export const makeLabelNodeAndParent = (name: string) => { const labels = name.split('.') diff --git a/packages/ensjs/src/utils/makeSafeSecondsDate.test.ts b/packages/ensjs/src/utils/makeSafeSecondsDate.test.ts index 9b50aac0..30c38cce 100644 --- a/packages/ensjs/src/utils/makeSafeSecondsDate.test.ts +++ b/packages/ensjs/src/utils/makeSafeSecondsDate.test.ts @@ -1,5 +1,5 @@ -import { MAX_DATE_INT } from './consts' -import { makeSafeSecondsDate } from './makeSafeSecondsDate' +import { MAX_DATE_INT } from './consts.js' +import { makeSafeSecondsDate } from './makeSafeSecondsDate.js' it('makes date from seconds', () => { expect(makeSafeSecondsDate(21000)).toEqual(new Date(21000000)) diff --git a/packages/ensjs/src/utils/makeSafeSecondsDate.ts b/packages/ensjs/src/utils/makeSafeSecondsDate.ts index fe706623..239a13ec 100644 --- a/packages/ensjs/src/utils/makeSafeSecondsDate.ts +++ b/packages/ensjs/src/utils/makeSafeSecondsDate.ts @@ -1,4 +1,4 @@ -import { MAX_DATE_INT } from './consts' +import { MAX_DATE_INT } from './consts.js' export const makeSafeSecondsDate = (seconds: number | bigint) => { const milliseconds = BigInt(seconds) * 1000n diff --git a/packages/ensjs/src/utils/normalise.test.ts b/packages/ensjs/src/utils/normalise.test.ts index 569b827d..ff8d5b96 100644 --- a/packages/ensjs/src/utils/normalise.test.ts +++ b/packages/ensjs/src/utils/normalise.test.ts @@ -1,4 +1,4 @@ -import { namehash } from './normalise' +import { namehash } from './normalise.js' describe('namehash()', () => { it('returns namehash for name', () => { @@ -18,7 +18,7 @@ describe('namehash()', () => { }) it('exports functions from ens-normalize', async () => { - const modules = await import('./normalise') + const modules = await import('./normalise.js') expect(modules).toMatchInlineSnapshot(` { "beautify": [Function], diff --git a/packages/ensjs/src/utils/normalise.ts b/packages/ensjs/src/utils/normalise.ts index e48f5719..53978c38 100644 --- a/packages/ensjs/src/utils/normalise.ts +++ b/packages/ensjs/src/utils/normalise.ts @@ -1,25 +1,25 @@ import { - DisallowedToken, - EmojiToken, ens_beautify, ens_emoji, ens_normalize, ens_normalize_fragment, ens_split, ens_tokenize, - IgnoredToken, is_combining_mark, - Label, - MappedToken, - NFCToken, should_escape, - StopToken, - TextToken, - Token, - ValidToken, + type DisallowedToken, + type EmojiToken, + type IgnoredToken, + type Label, + type MappedToken, + type NFCToken, + type StopToken, + type TextToken, + type Token, + type ValidToken, } from '@adraffy/ens-normalize' import { bytesToHex, concat, hexToBytes, keccak256, stringToBytes } from 'viem' -import { decodeLabelhash, isEncodedLabelhash } from './labels' +import { decodeLabelhash, isEncodedLabelhash } from './labels.js' const zeros = new Uint8Array(32) zeros.fill(0) diff --git a/packages/ensjs/src/utils/ownerFromContract.test.ts b/packages/ensjs/src/utils/ownerFromContract.test.ts index 125a4570..f7efc381 100644 --- a/packages/ensjs/src/utils/ownerFromContract.test.ts +++ b/packages/ensjs/src/utils/ownerFromContract.test.ts @@ -1,6 +1,6 @@ -import { publicClient } from '../tests/addTestContracts' -import { namehash } from './normalise' -import { ownerFromContract } from './ownerFromContract' +import { publicClient } from '../tests/addTestContracts.js' +import { namehash } from './normalise.js' +import { ownerFromContract } from './ownerFromContract.js' const baseParams = { client: publicClient, diff --git a/packages/ensjs/src/utils/ownerFromContract.ts b/packages/ensjs/src/utils/ownerFromContract.ts index f0207002..47109dd9 100644 --- a/packages/ensjs/src/utils/ownerFromContract.ts +++ b/packages/ensjs/src/utils/ownerFromContract.ts @@ -1,9 +1,10 @@ -import { Hex, encodeFunctionData, labelhash } from 'viem' -import { ClientWithEns } from '../contracts/consts' -import { ownerOfSnippet } from '../contracts/erc721' -import { getChainContractAddress } from '../contracts/getChainContractAddress' -import { ownerSnippet } from '../contracts/registry' -import { InvalidContractTypeError } from '../errors/general' +import { encodeFunctionData, labelhash, type Hex } from 'viem' +import { baseRegistrarOwnerOfSnippet } from '../contracts/baseRegistrar.js' +import type { ClientWithEns } from '../contracts/consts.js' +import { getChainContractAddress } from '../contracts/getChainContractAddress.js' +import { nameWrapperOwnerOfSnippet } from '../contracts/nameWrapper.js' +import { registryOwnerSnippet } from '../contracts/registry.js' +import { InvalidContractTypeError } from '../errors/general.js' export type OwnerContract = 'nameWrapper' | 'registry' | 'registrar' @@ -34,7 +35,7 @@ export const ownerFromContract = ({ return { to: getChainContractAddress({ client, contract: 'ensNameWrapper' }), data: encodeFunctionData({ - abi: ownerOfSnippet, + abi: nameWrapperOwnerOfSnippet, functionName: 'ownerOf', args: [BigInt(namehash)], }), @@ -43,7 +44,7 @@ export const ownerFromContract = ({ return { to: getChainContractAddress({ client, contract: 'ensRegistry' }), data: encodeFunctionData({ - abi: ownerSnippet, + abi: registryOwnerSnippet, functionName: 'owner', args: [namehash], }), @@ -55,7 +56,7 @@ export const ownerFromContract = ({ contract: 'ensBaseRegistrarImplementation', }), data: encodeFunctionData({ - abi: ownerOfSnippet, + abi: baseRegistrarOwnerOfSnippet, functionName: 'ownerOf', args: [BigInt(labelhash(labels[0]))], }), diff --git a/packages/ensjs/src/utils/registerHelpers.test.ts b/packages/ensjs/src/utils/registerHelpers.test.ts index 98743778..9d72a4ef 100644 --- a/packages/ensjs/src/utils/registerHelpers.test.ts +++ b/packages/ensjs/src/utils/registerHelpers.test.ts @@ -1,13 +1,13 @@ import { labelhash } from 'viem' -import { namehash } from './normalise' +import { namehash } from './normalise.js' import { - RegistrationParameters, makeCommitment, makeCommitmentFromTuple, makeCommitmentTuple, makeRegistrationTuple, randomSecret, -} from './registerHelpers' + type RegistrationParameters, +} from './registerHelpers.js' describe('randomSecret()', () => { it('generates a random secret with no args', () => { diff --git a/packages/ensjs/src/utils/registerHelpers.ts b/packages/ensjs/src/utils/registerHelpers.ts index f5f26e58..7603dc46 100644 --- a/packages/ensjs/src/utils/registerHelpers.ts +++ b/packages/ensjs/src/utils/registerHelpers.ts @@ -1,21 +1,21 @@ import { - Address, - Hex, encodeAbiParameters, keccak256, labelhash, pad, toBytes, toHex, + type Address, + type Hex, } from 'viem' -import { CampaignReferenceTooLargeError } from '../errors/utils' -import { EMPTY_ADDRESS } from './consts' -import { CombinedFuseInput, encodeFuses, hasFuses } from './fuses' +import { CampaignReferenceTooLargeError } from '../errors/utils.js' +import { EMPTY_ADDRESS } from './consts.js' +import { encodeFuses, hasFuses, type CombinedFuseInput } from './fuses.js' import { - RecordOptions, generateRecordCallArray, -} from './generateRecordCallArray' -import { namehash } from './normalise' + type RecordOptions, +} from './generateRecordCallArray.js' +import { namehash } from './normalise.js' export type RegistrationParameters = { /** Name to register */ diff --git a/packages/ensjs/src/utils/validation.test.ts b/packages/ensjs/src/utils/validation.test.ts index e4a282f5..451eb882 100644 --- a/packages/ensjs/src/utils/validation.test.ts +++ b/packages/ensjs/src/utils/validation.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { parseInput, validateName } from './validation' +import { parseInput, validateName } from './validation.js' declare namespace localStorage { const getItem: jest.MockedFn diff --git a/packages/ensjs/src/utils/validation.ts b/packages/ensjs/src/utils/validation.ts index 6244f3bf..229f14cf 100644 --- a/packages/ensjs/src/utils/validation.ts +++ b/packages/ensjs/src/utils/validation.ts @@ -1,10 +1,10 @@ import { NameWithEmptyLabelsError, RootNameIncludesOtherLabelsError, -} from '../errors/utils' -import { MINIMUM_DOT_ETH_CHARS } from './consts' -import { checkLabel, isEncodedLabelhash, saveName } from './labels' -import { Label, normalise, split } from './normalise' +} from '../errors/utils.js' +import { MINIMUM_DOT_ETH_CHARS } from './consts.js' +import { checkLabel, isEncodedLabelhash, saveName } from './labels.js' +import { normalise, split, type Label } from './normalise.js' export const validateName = (name: string) => { const nameArray = name.split('.') diff --git a/packages/ensjs/src/utils/wrapper.test.ts b/packages/ensjs/src/utils/wrapper.test.ts index 50cf34d7..5ddf8b1b 100644 --- a/packages/ensjs/src/utils/wrapper.test.ts +++ b/packages/ensjs/src/utils/wrapper.test.ts @@ -1,4 +1,4 @@ -import { expiryToBigInt, wrappedLabelLengthCheck } from './wrapper' +import { expiryToBigInt, wrappedLabelLengthCheck } from './wrapper.js' describe('expiryToBigInt', () => { it('returns default value when expiry is undefined', () => { diff --git a/packages/ensjs/src/utils/wrapper.ts b/packages/ensjs/src/utils/wrapper.ts index 8b51323c..1dc14e45 100644 --- a/packages/ensjs/src/utils/wrapper.ts +++ b/packages/ensjs/src/utils/wrapper.ts @@ -1,6 +1,6 @@ import { stringToBytes } from 'viem' -import { WrappedLabelTooLargeError } from '../errors/utils' -import { AnyDate } from '../types' +import { WrappedLabelTooLargeError } from '../errors/utils.js' +import type { AnyDate } from '../types.js' export const MAX_EXPIRY = 2n ** 64n - 1n diff --git a/packages/ensjs/src/wallet.ts b/packages/ensjs/src/wallet.ts new file mode 100644 index 00000000..dbce5389 --- /dev/null +++ b/packages/ensjs/src/wallet.ts @@ -0,0 +1,85 @@ +export { + default as commitName, + type CommitNameParameters, + type CommitNameReturnType, +} from './functions/wallet/commitName.js' +export { + default as createSubname, + type CreateSubnameParameters, + type CreateSubnameReturnType, +} from './functions/wallet/createSubname.js' +export { + default as deleteSubname, + type DeleteSubnameParameters, + type DeleteSubnameReturnType, +} from './functions/wallet/deleteSubname.js' +export { + default as registerName, + type RegisterNameParameters, + type RegisterNameReturnType, +} from './functions/wallet/registerName.js' +export { + default as renewNames, + type RenewNamesParameters, + type RenewNamesReturnType, +} from './functions/wallet/renewNames.js' +export { + default as setAbiRecord, + type SetAbiRecordParameters, + type SetAbiRecordReturnType, +} from './functions/wallet/setAbiRecord.js' +export { + default as setAddressRecord, + type SetAddressRecordParameters, + type SetAddressRecordReturnType, +} from './functions/wallet/setAddressRecord.js' +export { + default as setChildFuses, + type SetChildFusesParameters, + type SetChildFusesReturnType, +} from './functions/wallet/setChildFuses.js' +export { + default as setContentHashRecord, + type SetContentHashRecordParameters, + type SetContentHashRecordReturnType, +} from './functions/wallet/setContentHashRecord.js' +export { + default as setFuses, + type SetFusesParameters, + type SetFusesReturnType, +} from './functions/wallet/setFuses.js' +export { + default as setPrimaryName, + type SetPrimaryNameParameters, + type SetPrimaryNameReturnType, +} from './functions/wallet/setPrimaryName.js' +export { + default as setRecords, + type SetRecordsParameters, + type SetRecordsReturnType, +} from './functions/wallet/setRecords.js' +export { + default as setResolver, + type SetResolverParameters, + type SetResolverReturnType, +} from './functions/wallet/setResolver.js' +export { + default as setTextRecord, + type SetTextRecordParameters, + type SetTextRecordReturnType, +} from './functions/wallet/setTextRecord.js' +export { + default as transferName, + type TransferNameParameters, + type TransferNameReturnType, +} from './functions/wallet/transferName.js' +export { + default as unwrapName, + type UnwrapNameParameters, + type UnwrapNameReturnType, +} from './functions/wallet/unwrapName.js' +export { + default as wrapName, + type WrapNameParameters, + type WrapNameReturnType, +} from './functions/wallet/wrapName.js' diff --git a/packages/ensjs/tsconfig.base.json b/packages/ensjs/tsconfig.base.json new file mode 100644 index 00000000..55ed12f9 --- /dev/null +++ b/packages/ensjs/tsconfig.base.json @@ -0,0 +1,45 @@ +{ + // This tsconfig file contains the shared config for the build (tsconfig.build.json) and type checking (tsconfig.json) config. + "include": [], + "compilerOptions": { + // Incremental builds + // NOTE: Enabling incremental builds speeds up `tsc`. Keep in mind though that it does not reliably bust the cache when the `tsconfig.json` file changes. + "incremental": false, + + // Type checking + "strict": true, + "useDefineForClassFields": true, // Not enabled by default in `strict` mode unless we bump `target` to ES2022. + "noFallthroughCasesInSwitch": true, // Not enabled by default in `strict` mode. + "noImplicitReturns": true, // Not enabled by default in `strict` mode. + "useUnknownInCatchVariables": true, // TODO: This would normally be enabled in `strict` mode but would require some adjustments to the codebase. + "noImplicitOverride": true, // Not enabled by default in `strict` mode. + "noUnusedLocals": true, // Not enabled by default in `strict` mode. + "noUnusedParameters": true, // Not enabled by default in `strict` mode. + // TODO: The following options are also not enabled by default in `strict` mode and would be nice to have but would require some adjustments to the codebase. + // "exactOptionalPropertyTypes": true, + // "noUncheckedIndexedAccess": true, + + // JavaScript support + "allowJs": false, + "checkJs": false, + + // Interop constraints + "esModuleInterop": false, + "allowSyntheticDefaultImports": false, + "forceConsistentCasingInFileNames": true, + "verbatimModuleSyntax": true, + "importHelpers": true, // This is only used for build validation. Since we do not have `tslib` installed, this will fail if we accidentally make use of anything that'd require injection of helpers. + + // Language and environment + "moduleResolution": "NodeNext", + "module": "ESNext", + "target": "ES2021", // Setting this to `ES2021` enables native support for `Node v16+`: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping. + "lib": [ + "ES2022", // By using ES2022 we get access to the `.cause` property on `Error` instances. + "DOM" // We are adding `DOM` here to get the `fetch`, etc. types. This should be removed once these types are available via DefinitelyTyped. + ], + + // Skip type checking for node modules + "skipLibCheck": true + } +} diff --git a/packages/ensjs/tsconfig.build.json b/packages/ensjs/tsconfig.build.json index 3b80195e..83df3a8b 100644 --- a/packages/ensjs/tsconfig.build.json +++ b/packages/ensjs/tsconfig.build.json @@ -1,11 +1,12 @@ { "extends": "./tsconfig.json", - "compilerOptions": { - "module": "ESNext", - "outDir": "dist/types", - "declaration": true, - "emitDeclarationOnly": true - }, "include": ["./src"], - "exclude": ["src/**/*.test.ts", "src/tests/**/*", "./src/ABIs/**/*"] + "exclude": ["src/**/*.test.ts", "src/tests/**/*", "./src/ABIs/**/*"], + "compilerOptions": { + "sourceMap": true, + "rootDir": "./src", + "paths": { + "abitype": ["../node_modules/abitype/dist"] + } + } } diff --git a/packages/ensjs/tsconfig.json b/packages/ensjs/tsconfig.json index d07bdd8d..ac75fdac 100644 --- a/packages/ensjs/tsconfig.json +++ b/packages/ensjs/tsconfig.json @@ -1,24 +1,21 @@ { - "extends": "../../tsconfig.json", + // This configuration is used for local development and type checking. + "extends": "./tsconfig.base.json", "ts-node": { "compilerOptions": { - "target": "es2020", - "module": "commonjs", - "strict": true, - "esModuleInterop": true + "esModuleInterop": true, + "module": "CommonJS", + "allowSyntheticDefaultImports": true } }, + "include": ["src"], + "exclude": [], + "references": [{ "path": "./tsconfig.node.json" }], "compilerOptions": { "types": ["jest"], - "outDir": "./dist", - "declaration": true, - "importsNotUsedAsValues": "remove", - "lib": ["ES2022", "DOM"], - "module": "ES2020", - "moduleResolution": "node", + "resolveJsonModule": true, "paths": { "abitype": ["./node_modules/abitype/dist"] } - }, - "include": ["src/**/*.ts", "./hardhat.config.ts", "./deploy"] + } } diff --git a/packages/ensjs/tsconfig.node.json b/packages/ensjs/tsconfig.node.json new file mode 100644 index 00000000..d10feef5 --- /dev/null +++ b/packages/ensjs/tsconfig.node.json @@ -0,0 +1,17 @@ +{ + // This configuration is used for local development and type checking of configuration and script files that are not part of the build. + "include": [ + "jest.config.js", + "jest.setup.ts", + "scripts", + "hardhat.config.cjs", + "deploy" + ], + "compilerOptions": { + "strict": true, + "composite": true, + "module": "ESNext", + "moduleResolution": "Node", + "allowSyntheticDefaultImports": true + } +} diff --git a/packages/examples/tsconfig.json b/packages/examples/tsconfig.json deleted file mode 100644 index 985bb5e8..00000000 --- a/packages/examples/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "ts-node": { - "compilerOptions": { - "target": "es2020", - "module": "commonjs", - "strict": true, - "esModuleInterop": true - } - }, - "compilerOptions": { - "outDir": "./dist", - "declaration": true, - "importsNotUsedAsValues": "remove", - "lib": ["ES2022", "DOM"], - "module": "ES2020", - "moduleResolution": "node" - }, - "include": ["src/**/*.ts"] -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b5fd4c48..1ea9c0d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,10 +18,10 @@ importers: eslint-plugin-prettier: ^4.0.0 prettier: ^2.8.8 ts-node: ^10.7.0 - typescript: ^5.0.4 + typescript: ^5.1.6 devDependencies: - '@typescript-eslint/eslint-plugin': 5.33.0_ymmwmmrdflnhyagcksjv7xanui - '@typescript-eslint/parser': 5.33.0_udmbka6asohzlu5gmqb54xekz4 + '@typescript-eslint/eslint-plugin': 5.33.0_mfaaqamtz4kktqh5we5yuk2mmq + '@typescript-eslint/parser': 5.33.0_msjcq7hmcrkiyik26g2i2z7uk4 eslint: 8.21.0 eslint-config-airbnb: 19.0.4_jatgrcxl4x7ywe7ak6cnjca2ae eslint-config-airbnb-base: 15.0.0_jatgrcxl4x7ywe7ak6cnjca2ae @@ -30,13 +30,35 @@ importers: eslint-plugin-import: 2.26.0_qfqnhzzittf54udqwes54xx65q eslint-plugin-prettier: 4.2.1_wd2zc6i5zgwlkgicsslt4azlqi prettier: 2.8.8 - ts-node: 10.9.1_typescript@5.0.4 - typescript: 5.0.4 + ts-node: 10.9.1_typescript@5.1.6 + typescript: 5.1.6 dependenciesMeta: ens-contracts: built: false unplugged: true + examples/basic-esm: + specifiers: + '@ensdomains/ensjs': workspace:* + viem: ^1.2.9 + dependencies: + '@ensdomains/ensjs': link:../../packages/ensjs + viem: 1.2.9 + + examples/basic-tsnode-esm: + specifiers: + '@ensdomains/ensjs': workspace:* + node-fetch: 2.6.7 + ts-node: ^10.7.0 + typescript: ^5.0.4 + viem: ^1.2.9 + dependencies: + '@ensdomains/ensjs': link:../../packages/ensjs + node-fetch: 2.6.7 + ts-node: 10.9.1_typescript@5.0.4 + typescript: 5.0.4 + viem: 1.2.9_typescript@5.0.4 + packages/ens-test-env: specifiers: '@ethersproject/wallet': ^5.6.0 @@ -88,7 +110,9 @@ importers: '@swc/core': ^1.2.162 '@swc/jest': ^0.2.20 '@types/bn.js': ^5.1.0 + '@types/fs-extra': ^11.0.1 '@types/jest': ^27.4.1 + '@types/node': ^20.3.3 '@types/pako': ^2.0.0 '@types/traverse': ^0.6.32 abitype: ^0.8.0 @@ -98,10 +122,11 @@ importers: esbuild: ^0.15.6 eslint-plugin-jest: ^27.0.1 ethers: ^5.7.2 + fs-extra: ^10.0.1 glob: ^8.0.3 graphql: ^16.3.0 graphql-request: 5.1.0 - hardhat: 2.10.2 + hardhat: 2.16.1 hardhat-abi-exporter: ^2.8.0 hardhat-deploy: ^0.11.12 jest: ^29.5.0 @@ -112,7 +137,7 @@ importers: traverse: ^0.6.6 ts-jest: ^29.1.1 ts-node: ^10.7.0 - typescript: ^5.0.4 + typescript: ^5.1.6 viem: ^1.2.9 wait-on: ^6.0.1 dependencies: @@ -120,7 +145,7 @@ importers: '@ensdomains/address-encoder': 0.2.18 '@ensdomains/content-hash': 2.5.7 '@ensdomains/dnsprovejs': 0.4.1 - abitype: 0.8.0_typescript@5.0.4 + abitype: 0.8.0_typescript@5.1.6 cbor: 8.1.0 dns-packet: 5.4.0 graphql: 16.6.0 @@ -128,50 +153,39 @@ importers: pako: 2.1.0 traverse: 0.6.6 devDependencies: - '@ensdomains/buffer': 0.0.13_hardhat@2.10.2 - '@ensdomains/ens-contracts': 0.0.17_hardhat@2.10.2 + '@ensdomains/buffer': 0.0.13_hardhat@2.16.1 + '@ensdomains/ens-contracts': 0.0.17_hardhat@2.16.1 '@ensdomains/ens-test-env': link:../ens-test-env - '@nomiclabs/hardhat-ethers': /hardhat-deploy-ethers/0.3.0-beta.13_xk7ts3jleh4tydykqykpb6jvzy + '@nomiclabs/hardhat-ethers': /hardhat-deploy-ethers/0.3.0-beta.13_drbn5rr2wg6skrabufgggpzpcu '@openzeppelin/contracts': 4.7.3 '@openzeppelin/test-helpers': 0.5.16 '@swc/core': 1.2.241 '@swc/jest': 0.2.22_@swc+core@1.2.241 '@types/bn.js': 5.1.0 + '@types/fs-extra': 11.0.1 '@types/jest': 27.5.2 + '@types/node': 20.3.3 '@types/pako': 2.0.0 '@types/traverse': 0.6.32 dotenv: 16.0.1 esbuild: 0.15.6 - eslint-plugin-jest: 27.0.1_tobmchb5uviuq5lwsinkw5fvje + eslint-plugin-jest: 27.0.1_tiloc3ejst55n76oty5rbi22ra ethers: 5.7.2 + fs-extra: 10.1.0 glob: 8.0.3 - hardhat: 2.10.2_pyqfhkbboucpxgvrs7ocxwodkm - hardhat-abi-exporter: 2.10.0_hardhat@2.10.2 + hardhat: 2.16.1_kg5gpyde6u3komamnnl67a6oc4 + hardhat-abi-exporter: 2.10.0_hardhat@2.16.1 hardhat-deploy: 0.11.12 - jest: 29.5.0_ts-node@10.9.1 + jest: 29.5.0_tylgm7ihy6sjibrlzw2t2ezks4 jest-environment-node: 29.5.0 jest-localstorage-mock: 2.4.22 solc: 0.8.16 - ts-jest: 29.1.1_k4loywzeyoudxba33oezutz7em - ts-node: 10.9.1_k7iguhqbtoao35i6waebqvypgi - typescript: 5.0.4 - viem: 1.2.9_typescript@5.0.4 + ts-jest: 29.1.1_2waxxg7y65jrymm3x52phvey74 + ts-node: 10.9.1_mzbeecxiug4t43pxwrx5whvupa + typescript: 5.1.6 + viem: 1.2.9_typescript@5.1.6 wait-on: 6.0.1 - packages/examples: - specifiers: - '@ensdomains/ensjs': workspace:* - node-fetch: 2.6.7 - ts-node: ^10.7.0 - typescript: ^5.0.4 - viem: ^1.2.9 - dependencies: - '@ensdomains/ensjs': link:../ensjs - node-fetch: 2.6.7 - ts-node: 10.9.1_typescript@5.0.4 - typescript: 5.0.4 - viem: 1.2.9_typescript@5.0.4 - packages: /@adraffy/ens-normalize/1.9.0: @@ -528,6 +542,37 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@chainsafe/as-sha256/0.3.1: + resolution: {integrity: sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg==} + dev: true + + /@chainsafe/persistent-merkle-tree/0.4.2: + resolution: {integrity: sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ==} + dependencies: + '@chainsafe/as-sha256': 0.3.1 + dev: true + + /@chainsafe/persistent-merkle-tree/0.5.0: + resolution: {integrity: sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw==} + dependencies: + '@chainsafe/as-sha256': 0.3.1 + dev: true + + /@chainsafe/ssz/0.10.2: + resolution: {integrity: sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg==} + dependencies: + '@chainsafe/as-sha256': 0.3.1 + '@chainsafe/persistent-merkle-tree': 0.5.0 + dev: true + + /@chainsafe/ssz/0.9.4: + resolution: {integrity: sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ==} + dependencies: + '@chainsafe/as-sha256': 0.3.1 + '@chainsafe/persistent-merkle-tree': 0.4.2 + case: 1.6.3 + dev: true + /@cspotcode/source-map-support/0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -562,10 +607,10 @@ packages: sha3: 2.1.4 dev: false - /@ensdomains/buffer/0.0.13_hardhat@2.10.2: + /@ensdomains/buffer/0.0.13_hardhat@2.16.1: resolution: {integrity: sha512-8aA+U/e4S54ebPwcge1HHvvpgXLKxPd6EOSegMlrTvBnKB8RwB3OpNyflaikD6KqzIwDaBaH8bvnTrMcfpV7oQ==} dependencies: - '@nomiclabs/hardhat-truffle5': 2.0.6_hardhat@2.10.2 + '@nomiclabs/hardhat-truffle5': 2.0.6_hardhat@2.16.1 transitivePeerDependencies: - '@nomiclabs/hardhat-web3' - bufferutil @@ -597,10 +642,10 @@ packages: typescript-logging: 1.0.1 dev: false - /@ensdomains/ens-contracts/0.0.17_hardhat@2.10.2: + /@ensdomains/ens-contracts/0.0.17_hardhat@2.16.1: resolution: {integrity: sha512-Dv4y8V5UhswWk/GMwJVu4gV17uoAvSVmzjG4DVSbP7DF3ITtVGwDYclejMQ9JIg8jn84pHSKawzExiC+xJrT3g==} dependencies: - '@ensdomains/buffer': 0.0.13_hardhat@2.10.2 + '@ensdomains/buffer': 0.0.13_hardhat@2.16.1 '@ensdomains/solsha1': 0.0.3 '@openzeppelin/contracts': 4.7.3 dns-packet: 5.4.0 @@ -682,30 +727,6 @@ packages: - supports-color dev: true - /@ethereumjs/block/3.6.3: - resolution: {integrity: sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg==} - dependencies: - '@ethereumjs/common': 2.6.5 - '@ethereumjs/tx': 3.5.2 - ethereumjs-util: 7.1.5 - merkle-patricia-tree: 4.2.4 - dev: true - - /@ethereumjs/blockchain/5.5.3: - resolution: {integrity: sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw==} - dependencies: - '@ethereumjs/block': 3.6.3 - '@ethereumjs/common': 2.6.5 - '@ethereumjs/ethash': 1.1.0 - debug: 4.3.4 - ethereumjs-util: 7.1.5 - level-mem: 5.0.1 - lru-cache: 5.1.1 - semaphore-async-await: 1.5.1 - transitivePeerDependencies: - - supports-color - dev: true - /@ethereumjs/common/2.6.5: resolution: {integrity: sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==} dependencies: @@ -713,16 +734,6 @@ packages: ethereumjs-util: 7.1.5 dev: true - /@ethereumjs/ethash/1.1.0: - resolution: {integrity: sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA==} - dependencies: - '@ethereumjs/block': 3.6.3 - '@types/levelup': 4.3.3 - buffer-xor: 2.0.2 - ethereumjs-util: 7.1.5 - miller-rabin: 4.0.1 - dev: true - /@ethereumjs/tx/3.5.2: resolution: {integrity: sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==} dependencies: @@ -730,25 +741,6 @@ packages: ethereumjs-util: 7.1.5 dev: true - /@ethereumjs/vm/5.9.3: - resolution: {integrity: sha512-Ha04TeF8goEglr8eL7hkkYyjhzdZS0PsoRURzYlTF6I0VVId5KjKb0N7MrA8GMgheN+UeTncfTgYx52D/WhEmg==} - dependencies: - '@ethereumjs/block': 3.6.3 - '@ethereumjs/blockchain': 5.5.3 - '@ethereumjs/common': 2.6.5 - '@ethereumjs/tx': 3.5.2 - async-eventemitter: 0.2.4 - core-js-pure: 3.24.1 - debug: 4.3.4 - ethereumjs-util: 7.1.5 - functional-red-black-tree: 1.0.1 - mcl-wasm: 0.7.9 - merkle-patricia-tree: 4.2.4 - rustbn.js: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - /@ethersproject/abi/5.6.4: resolution: {integrity: sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg==} dependencies: @@ -1221,7 +1213,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 chalk: 4.1.2 jest-message-util: 29.5.0 jest-util: 29.5.0 @@ -1242,14 +1234,14 @@ packages: '@jest/test-result': 29.5.0 '@jest/transform': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.3.2 exit: 0.1.2 graceful-fs: 4.2.10 jest-changed-files: 29.5.0 - jest-config: 29.5.0_ubchvo7cxgdavyfa6mg2b5a4oe + jest-config: 29.5.0_tylgm7ihy6sjibrlzw2t2ezks4 jest-haste-map: 29.5.0 jest-message-util: 29.5.0 jest-regex-util: 29.4.3 @@ -1283,7 +1275,7 @@ packages: dependencies: '@jest/fake-timers': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 jest-mock: 29.5.0 dev: true @@ -1310,7 +1302,7 @@ packages: dependencies: '@jest/types': 29.5.0 '@sinonjs/fake-timers': 10.0.2 - '@types/node': 18.6.5 + '@types/node': 20.3.3 jest-message-util: 29.5.0 jest-mock: 29.5.0 jest-util: 29.5.0 @@ -1343,7 +1335,7 @@ packages: '@jest/transform': 29.5.0 '@jest/types': 29.5.0 '@jridgewell/trace-mapping': 0.3.18 - '@types/node': 18.6.5 + '@types/node': 20.3.3 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -1430,7 +1422,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.6.5 + '@types/node': 20.3.3 '@types/yargs': 16.0.4 chalk: 4.1.2 dev: true @@ -1442,7 +1434,7 @@ packages: '@jest/schemas': 29.4.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.6.5 + '@types/node': 20.3.3 '@types/yargs': 17.0.24 chalk: 4.1.2 dev: true @@ -1461,7 +1453,7 @@ packages: dependencies: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.14 - '@jridgewell/trace-mapping': 0.3.9 + '@jridgewell/trace-mapping': 0.3.18 dev: true /@jridgewell/resolve-uri/3.1.0: @@ -1544,7 +1536,271 @@ packages: fastq: 1.13.0 dev: true - /@nomiclabs/hardhat-truffle5/2.0.6_hardhat@2.10.2: + /@nomicfoundation/ethereumjs-block/5.0.1: + resolution: {integrity: sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + ethereum-cryptography: 0.1.3 + ethers: 5.7.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-blockchain/7.0.1: + resolution: {integrity: sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-ethash': 3.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + abstract-level: 1.0.3 + debug: 4.3.4 + ethereum-cryptography: 0.1.3 + level: 8.0.0 + lru-cache: 5.1.1 + memory-level: 1.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-common/4.0.1: + resolution: {integrity: sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==} + dependencies: + '@nomicfoundation/ethereumjs-util': 9.0.1 + crc-32: 1.2.2 + dev: true + + /@nomicfoundation/ethereumjs-ethash/3.0.1: + resolution: {integrity: sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + abstract-level: 1.0.3 + bigint-crypto-utils: 3.3.0 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-evm/2.0.1: + resolution: {integrity: sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==} + engines: {node: '>=14'} + dependencies: + '@ethersproject/providers': 5.7.2 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + debug: 4.3.4 + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-rlp/5.0.1: + resolution: {integrity: sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /@nomicfoundation/ethereumjs-statemanager/2.0.1: + resolution: {integrity: sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==} + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + debug: 4.3.4 + ethereum-cryptography: 0.1.3 + ethers: 5.7.2 + js-sdsl: 4.4.1 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-trie/6.0.1: + resolution: {integrity: sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@types/readable-stream': 2.3.15 + ethereum-cryptography: 0.1.3 + readable-stream: 3.6.0 + dev: true + + /@nomicfoundation/ethereumjs-tx/5.0.1: + resolution: {integrity: sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.9.4 + '@ethersproject/providers': 5.7.2 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + + /@nomicfoundation/ethereumjs-util/9.0.1: + resolution: {integrity: sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.10.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + ethereum-cryptography: 0.1.3 + dev: true + + /@nomicfoundation/ethereumjs-vm/7.0.1: + resolution: {integrity: sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-blockchain': 7.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + debug: 4.3.4 + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + + /@nomicfoundation/solidity-analyzer-darwin-arm64/0.1.1: + resolution: {integrity: sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-darwin-x64/0.1.1: + resolution: {integrity: sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-freebsd-x64/0.1.1: + resolution: {integrity: sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-linux-arm64-gnu/0.1.1: + resolution: {integrity: sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-linux-arm64-musl/0.1.1: + resolution: {integrity: sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-linux-x64-gnu/0.1.1: + resolution: {integrity: sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-linux-x64-musl/0.1.1: + resolution: {integrity: sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-win32-arm64-msvc/0.1.1: + resolution: {integrity: sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-win32-ia32-msvc/0.1.1: + resolution: {integrity: sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer-win32-x64-msvc/0.1.1: + resolution: {integrity: sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@nomicfoundation/solidity-analyzer/0.1.1: + resolution: {integrity: sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg==} + engines: {node: '>= 12'} + optionalDependencies: + '@nomicfoundation/solidity-analyzer-darwin-arm64': 0.1.1 + '@nomicfoundation/solidity-analyzer-darwin-x64': 0.1.1 + '@nomicfoundation/solidity-analyzer-freebsd-x64': 0.1.1 + '@nomicfoundation/solidity-analyzer-linux-arm64-gnu': 0.1.1 + '@nomicfoundation/solidity-analyzer-linux-arm64-musl': 0.1.1 + '@nomicfoundation/solidity-analyzer-linux-x64-gnu': 0.1.1 + '@nomicfoundation/solidity-analyzer-linux-x64-musl': 0.1.1 + '@nomicfoundation/solidity-analyzer-win32-arm64-msvc': 0.1.1 + '@nomicfoundation/solidity-analyzer-win32-ia32-msvc': 0.1.1 + '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.1 + dev: true + + /@nomiclabs/hardhat-truffle5/2.0.6_hardhat@2.16.1: resolution: {integrity: sha512-kzkpVEX36yOmdhCJHesu+1nB+fiaKpMrvUSVd0Ox6Jila+8aSxeHTC4bbEBOIqJcvOQZ3sj5fzuE5VjhNkZkvw==} peerDependencies: '@nomiclabs/hardhat-web3': ^2.0.0 @@ -1556,7 +1812,7 @@ packages: chai: 4.3.6 ethereumjs-util: 7.1.5 fs-extra: 7.0.1 - hardhat: 2.10.2_pyqfhkbboucpxgvrs7ocxwodkm + hardhat: 2.16.1_kg5gpyde6u3komamnnl67a6oc4 transitivePeerDependencies: - bufferutil - encoding @@ -1769,12 +2025,6 @@ packages: '@sinonjs/commons': 2.0.0 dev: true - /@solidity-parser/parser/0.14.3: - resolution: {integrity: sha512-29g2SZ29HtsqA58pLCtopI1P/cPy5/UAzlcAXO6T/CNJimG6yA8kx4NaseMyJULiC+TEs02Y9/yeHzClqoA0hw==} - dependencies: - antlr4ts: 0.5.0-alpha.4 - dev: true - /@swc/core-android-arm-eabi/1.2.241: resolution: {integrity: sha512-VfbyFAQ+JT4kl4a7kPFM4pUSLHXnJ/bKIW0gAsVngBIcu73cz59HlylKiOtmx3UtXPsYu0Ort/qfC/UJfeEgrQ==} engines: {node: '>=10'} @@ -2090,10 +2340,6 @@ packages: /@tsconfig/node16/1.0.3: resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} - /@types/abstract-leveldown/7.2.0: - resolution: {integrity: sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ==} - dev: true - /@types/babel__core/7.1.19: resolution: {integrity: sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==} dependencies: @@ -2126,30 +2372,37 @@ packages: /@types/bn.js/4.11.6: resolution: {integrity: sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==} dependencies: - '@types/node': 18.6.5 + '@types/node': 20.3.3 dev: true /@types/bn.js/5.1.0: resolution: {integrity: sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==} dependencies: - '@types/node': 18.6.5 + '@types/node': 20.3.3 /@types/cacheable-request/6.0.2: resolution: {integrity: sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==} dependencies: '@types/http-cache-semantics': 4.0.1 '@types/keyv': 3.1.4 - '@types/node': 18.6.5 + '@types/node': 20.3.3 '@types/responselike': 1.0.0 /@types/chai/4.3.3: resolution: {integrity: sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==} dev: true + /@types/fs-extra/11.0.1: + resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} + dependencies: + '@types/jsonfile': 6.1.1 + '@types/node': 20.3.3 + dev: true + /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 18.6.5 + '@types/node': 20.3.3 dev: true /@types/http-cache-semantics/4.0.1: @@ -2189,22 +2442,16 @@ packages: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true - /@types/keyv/3.1.4: - resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} + /@types/jsonfile/6.1.1: + resolution: {integrity: sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==} dependencies: - '@types/node': 18.6.5 - - /@types/level-errors/3.0.0: - resolution: {integrity: sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ==} + '@types/node': 20.3.3 dev: true - /@types/levelup/4.3.3: - resolution: {integrity: sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==} + /@types/keyv/3.1.4: + resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/abstract-leveldown': 7.2.0 - '@types/level-errors': 3.0.0 - '@types/node': 18.6.5 - dev: true + '@types/node': 20.3.3 /@types/lru-cache/5.1.1: resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==} @@ -2213,8 +2460,8 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node/18.6.5: - resolution: {integrity: sha512-Xjt5ZGUa5WusGZJ4WJPbOT8QOqp6nDynVFRKcUt32bOgvXEoc6o085WNkYTMO7ifAj2isEfQQ2cseE+wT6jsRw==} + /@types/node/20.3.3: + resolution: {integrity: sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==} /@types/pako/2.0.0: resolution: {integrity: sha512-10+iaz93qR5WYxTo+PMifD5TSxiOtdRaxBf7INGGXMQgTCu8Z/7GYWYFUOS3q/G0nE5boj1r4FEB+WSy7s5gbA==} @@ -2223,7 +2470,7 @@ packages: /@types/pbkdf2/3.1.0: resolution: {integrity: sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==} dependencies: - '@types/node': 18.6.5 + '@types/node': 20.3.3 /@types/prettier/2.7.0: resolution: {integrity: sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==} @@ -2233,15 +2480,22 @@ packages: resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} dev: true + /@types/readable-stream/2.3.15: + resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} + dependencies: + '@types/node': 20.3.3 + safe-buffer: 5.1.2 + dev: true + /@types/responselike/1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: - '@types/node': 18.6.5 + '@types/node': 20.3.3 /@types/secp256k1/4.0.3: resolution: {integrity: sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==} dependencies: - '@types/node': 18.6.5 + '@types/node': 20.3.3 /@types/seedrandom/3.0.1: resolution: {integrity: sha512-giB9gzDeiCeloIXDgzFBCgjj1k4WxcDrZtGl6h1IqmUPlxF+Nx8Ve+96QCyDZ/HseB/uvDsKbpib9hU5cU53pw==} @@ -2271,7 +2525,7 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin/5.33.0_ymmwmmrdflnhyagcksjv7xanui: + /@typescript-eslint/eslint-plugin/5.33.0_mfaaqamtz4kktqh5we5yuk2mmq: resolution: {integrity: sha512-jHvZNSW2WZ31OPJ3enhLrEKvAZNyAFWZ6rx9tUwaessTc4sx9KmgMNhVcqVAl1ETnT5rU5fpXTLmY9YvC1DCNg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2282,23 +2536,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.33.0_udmbka6asohzlu5gmqb54xekz4 + '@typescript-eslint/parser': 5.33.0_msjcq7hmcrkiyik26g2i2z7uk4 '@typescript-eslint/scope-manager': 5.33.0 - '@typescript-eslint/type-utils': 5.33.0_udmbka6asohzlu5gmqb54xekz4 - '@typescript-eslint/utils': 5.33.0_udmbka6asohzlu5gmqb54xekz4 + '@typescript-eslint/type-utils': 5.33.0_msjcq7hmcrkiyik26g2i2z7uk4 + '@typescript-eslint/utils': 5.33.0_msjcq7hmcrkiyik26g2i2z7uk4 debug: 4.3.4 eslint: 8.21.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.7 - tsutils: 3.21.0_typescript@5.0.4 - typescript: 5.0.4 + tsutils: 3.21.0_typescript@5.1.6 + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser/5.33.0_udmbka6asohzlu5gmqb54xekz4: + /@typescript-eslint/parser/5.33.0_msjcq7hmcrkiyik26g2i2z7uk4: resolution: {integrity: sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2310,10 +2564,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.33.0 '@typescript-eslint/types': 5.33.0 - '@typescript-eslint/typescript-estree': 5.33.0_typescript@5.0.4 + '@typescript-eslint/typescript-estree': 5.33.0_typescript@5.1.6 debug: 4.3.4 eslint: 8.21.0 - typescript: 5.0.4 + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true @@ -2326,7 +2580,7 @@ packages: '@typescript-eslint/visitor-keys': 5.33.0 dev: true - /@typescript-eslint/type-utils/5.33.0_udmbka6asohzlu5gmqb54xekz4: + /@typescript-eslint/type-utils/5.33.0_msjcq7hmcrkiyik26g2i2z7uk4: resolution: {integrity: sha512-2zB8uEn7hEH2pBeyk3NpzX1p3lF9dKrEbnXq1F7YkpZ6hlyqb2yZujqgRGqXgRBTHWIUG3NGx/WeZk224UKlIA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2336,11 +2590,11 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.33.0_udmbka6asohzlu5gmqb54xekz4 + '@typescript-eslint/utils': 5.33.0_msjcq7hmcrkiyik26g2i2z7uk4 debug: 4.3.4 eslint: 8.21.0 - tsutils: 3.21.0_typescript@5.0.4 - typescript: 5.0.4 + tsutils: 3.21.0_typescript@5.1.6 + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true @@ -2350,7 +2604,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.33.0_typescript@5.0.4: + /@typescript-eslint/typescript-estree/5.33.0_typescript@5.1.6: resolution: {integrity: sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2365,13 +2619,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.7 - tsutils: 3.21.0_typescript@5.0.4 - typescript: 5.0.4 + tsutils: 3.21.0_typescript@5.1.6 + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils/5.33.0_typescript@5.0.4: + /@typescript-eslint/utils/5.33.0_msjcq7hmcrkiyik26g2i2z7uk4: resolution: {integrity: sha512-JxOAnXt9oZjXLIiXb5ZIcZXiwVHCkqZgof0O8KPgz7C7y0HS42gi75PdPlqh1Tf109M0fyUw45Ao6JLo7S5AHw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2380,15 +2634,16 @@ packages: '@types/json-schema': 7.0.11 '@typescript-eslint/scope-manager': 5.33.0 '@typescript-eslint/types': 5.33.0 - '@typescript-eslint/typescript-estree': 5.33.0_typescript@5.0.4 + '@typescript-eslint/typescript-estree': 5.33.0_typescript@5.1.6 + eslint: 8.21.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0 + eslint-utils: 3.0.0_eslint@8.21.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/utils/5.33.0_udmbka6asohzlu5gmqb54xekz4: + /@typescript-eslint/utils/5.33.0_typescript@5.1.6: resolution: {integrity: sha512-JxOAnXt9oZjXLIiXb5ZIcZXiwVHCkqZgof0O8KPgz7C7y0HS42gi75PdPlqh1Tf109M0fyUw45Ao6JLo7S5AHw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2397,10 +2652,9 @@ packages: '@types/json-schema': 7.0.11 '@typescript-eslint/scope-manager': 5.33.0 '@typescript-eslint/types': 5.33.0 - '@typescript-eslint/typescript-estree': 5.33.0_typescript@5.0.4 - eslint: 8.21.0 + '@typescript-eslint/typescript-estree': 5.33.0_typescript@5.1.6 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.21.0 + eslint-utils: 3.0.0 transitivePeerDependencies: - supports-color - typescript @@ -2418,6 +2672,15 @@ packages: resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} dev: true + /@wagmi/chains/1.2.0: + resolution: {integrity: sha512-dmDRipsE54JfyudOBkuhEexqQWcrZqxn/qiujG8SBzMh/az/AH5xlJSA+j1CPWTx9+QofSMF3B7A4gb6XRmSaQ==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dev: false + /@wagmi/chains/1.2.0_typescript@5.0.4: resolution: {integrity: sha512-dmDRipsE54JfyudOBkuhEexqQWcrZqxn/qiujG8SBzMh/az/AH5xlJSA+j1CPWTx9+QofSMF3B7A4gb6XRmSaQ==} peerDependencies: @@ -2427,6 +2690,18 @@ packages: optional: true dependencies: typescript: 5.0.4 + dev: false + + /@wagmi/chains/1.2.0_typescript@5.1.6: + resolution: {integrity: sha512-dmDRipsE54JfyudOBkuhEexqQWcrZqxn/qiujG8SBzMh/az/AH5xlJSA+j1CPWTx9+QofSMF3B7A4gb6XRmSaQ==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + typescript: 5.1.6 + dev: true /@zxing/text-encoding/0.9.0: resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} @@ -2434,7 +2709,7 @@ packages: dev: false optional: true - /abitype/0.8.0_typescript@5.0.4: + /abitype/0.8.0_typescript@5.1.6: resolution: {integrity: sha512-QqBuwc2trtaNd/kp4k0dSjVu3OQIYRAB4ww4LCPwfSECXcCGTD3imYovNYNjx0SyN3OHV0XUOzUVwnXP1kLsVQ==} peerDependencies: typescript: '>=4.9.4' @@ -2443,7 +2718,17 @@ packages: zod: optional: true dependencies: - typescript: 5.0.4 + typescript: 5.1.6 + dev: false + + /abitype/0.8.11: + resolution: {integrity: sha512-bM4v2dKvX08sZ9IU38IN5BKmN+ZkOSd2oI4a9f0ejHYZQYV6cDr7j+d95ga0z2XHG36Y4jzoG5Z7qDqxp7fi/A==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + zod: + optional: true dev: false /abitype/0.8.11_typescript@5.0.4: @@ -2456,6 +2741,19 @@ packages: optional: true dependencies: typescript: 5.0.4 + dev: false + + /abitype/0.8.11_typescript@5.1.6: + resolution: {integrity: sha512-bM4v2dKvX08sZ9IU38IN5BKmN+ZkOSd2oI4a9f0ejHYZQYV6cDr7j+d95ga0z2XHG36Y4jzoG5Z7qDqxp7fi/A==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.19.1 + peerDependenciesMeta: + zod: + optional: true + dependencies: + typescript: 5.1.6 + dev: true /abort-controller/3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} @@ -2468,26 +2766,17 @@ packages: resolution: {integrity: sha512-zetDJxd89y3X99Kvo4qFx8GKlt6GsvN3UcRZHwU6iFA/0KiOmhkTVhe8oRoTBiTVPZu09x3vCra47+w8Yz1+2Q==} dev: true - /abstract-leveldown/6.2.3: - resolution: {integrity: sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==} - engines: {node: '>=6'} - dependencies: - buffer: 5.7.1 - immediate: 3.3.0 - level-concat-iterator: 2.0.1 - level-supports: 1.0.1 - xtend: 4.0.2 - dev: true - - /abstract-leveldown/6.3.0: - resolution: {integrity: sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==} - engines: {node: '>=6'} + /abstract-level/1.0.3: + resolution: {integrity: sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==} + engines: {node: '>=12'} dependencies: - buffer: 5.7.1 - immediate: 3.3.0 - level-concat-iterator: 2.0.1 - level-supports: 1.0.1 - xtend: 4.0.2 + buffer: 6.0.3 + catering: 2.1.1 + is-buffer: 2.0.5 + level-supports: 4.0.1 + level-transcoder: 1.0.1 + module-error: 1.0.2 + queue-microtask: 1.2.3 dev: true /abstract-leveldown/7.2.0: @@ -2611,11 +2900,7 @@ packages: /ansi-styles/5.2.0: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - dev: true - - /antlr4ts/0.5.0-alpha.4: - resolution: {integrity: sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==} + engines: {node: '>=10'} dev: true /anymatch/3.1.2: @@ -2692,22 +2977,10 @@ packages: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true - /async-eventemitter/0.2.4: - resolution: {integrity: sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==} - dependencies: - async: 2.6.4 - dev: true - /async-limiter/1.0.1: resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==} dev: true - /async/2.6.4: - resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==} - dependencies: - lodash: 4.17.21 - dev: true - /asynckit/0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -2844,6 +3117,11 @@ packages: resolution: {integrity: sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ==} dev: true + /bigint-crypto-utils/3.3.0: + resolution: {integrity: sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==} + engines: {node: '>=14.0.0'} + dev: true + /bignumber.js/7.2.1: resolution: {integrity: sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==} dev: true @@ -2929,6 +3207,15 @@ packages: /brorand/1.1.0: resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} + /browser-level/1.0.1: + resolution: {integrity: sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==} + dependencies: + abstract-level: 1.0.3 + catering: 2.1.1 + module-error: 1.0.2 + run-parallel-limit: 1.1.0 + dev: true + /browser-stdout/1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} dev: true @@ -3028,12 +3315,6 @@ packages: /buffer-xor/1.0.3: resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} - /buffer-xor/2.0.2: - resolution: {integrity: sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==} - dependencies: - safe-buffer: 5.2.1 - dev: true - /buffer/5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} dependencies: @@ -3063,6 +3344,13 @@ packages: node-gyp-build: 4.5.0 dev: true + /busboy/1.6.0: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + dependencies: + streamsearch: 1.1.0 + dev: true + /bytes/3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} @@ -3139,6 +3427,11 @@ packages: resolution: {integrity: sha512-OO+pPubxx16lkI7TVrbFpde8XHz66SMwstl1YWpg6uMGw56XnhYVwtPIjvX4kYpzwMwQKr4DDce394E03dQPGg==} dev: true + /case/1.6.3: + resolution: {integrity: sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==} + engines: {node: '>= 0.8.0'} + dev: true + /caseless/0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} dev: true @@ -3146,7 +3439,6 @@ packages: /catering/2.1.1: resolution: {integrity: sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==} engines: {node: '>=6'} - dev: false /cbor/5.2.0: resolution: {integrity: sha512-5IMhi9e1QU76ppa5/ajP1BmMWZ2FHkhAhjeVKQ/EFCgYSEaeVaoGtL7cxJskf9oCCk+XjzaIdc3IuU/dbA/o2A==} @@ -3320,6 +3612,18 @@ packages: resolution: {integrity: sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==} dev: true + /classic-level/1.3.0: + resolution: {integrity: sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==} + engines: {node: '>=12'} + requiresBuild: true + dependencies: + abstract-level: 1.0.3 + catering: 2.1.1 + module-error: 1.0.2 + napi-macros: 2.2.2 + node-gyp-build: 4.5.0 + dev: true + /clean-stack/2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -3500,11 +3804,6 @@ packages: resolution: {integrity: sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==} dev: true - /core-js-pure/3.24.1: - resolution: {integrity: sha512-r1nJk41QLLPyozHUUPmILCEMtMw24NG4oWK6RbsDdjzQgg9ZvrUsPBj1MnG0wXXp1DCDU6j+wUvEmBSrtRbLXg==} - requiresBuild: true - dev: true - /core-util-is/1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} dev: true @@ -3745,14 +4044,6 @@ packages: resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==} engines: {node: '>=10'} - /deferred-leveldown/5.3.0: - resolution: {integrity: sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==} - engines: {node: '>=6'} - dependencies: - abstract-leveldown: 6.2.3 - inherits: 2.0.4 - dev: true - /define-properties/1.1.4: resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} engines: {node: '>= 0.4'} @@ -3956,16 +4247,6 @@ packages: engines: {node: '>= 0.8'} dev: true - /encoding-down/6.3.0: - resolution: {integrity: sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==} - engines: {node: '>=6'} - dependencies: - abstract-leveldown: 6.3.0 - inherits: 2.0.4 - level-codec: 9.0.2 - level-errors: 2.0.1 - dev: true - /end-of-stream/1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} dependencies: @@ -3988,13 +4269,6 @@ packages: engines: {node: '>=6'} dev: true - /errno/0.1.8: - resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} - hasBin: true - dependencies: - prr: 1.0.1 - dev: true - /error-ex/1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -4333,8 +4607,8 @@ packages: eslint: ^7.32.0 || ^8.2.0 eslint-plugin-import: ^2.25.3 dependencies: - '@typescript-eslint/eslint-plugin': 5.33.0_ymmwmmrdflnhyagcksjv7xanui - '@typescript-eslint/parser': 5.33.0_udmbka6asohzlu5gmqb54xekz4 + '@typescript-eslint/eslint-plugin': 5.33.0_mfaaqamtz4kktqh5we5yuk2mmq + '@typescript-eslint/parser': 5.33.0_msjcq7hmcrkiyik26g2i2z7uk4 eslint: 8.21.0 eslint-config-airbnb-base: 15.0.0_jatgrcxl4x7ywe7ak6cnjca2ae eslint-plugin-import: 2.26.0_qfqnhzzittf54udqwes54xx65q @@ -4396,7 +4670,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.33.0_udmbka6asohzlu5gmqb54xekz4 + '@typescript-eslint/parser': 5.33.0_msjcq7hmcrkiyik26g2i2z7uk4 debug: 3.2.7 eslint: 8.21.0 eslint-import-resolver-node: 0.3.6 @@ -4414,7 +4688,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.33.0_udmbka6asohzlu5gmqb54xekz4 + '@typescript-eslint/parser': 5.33.0_msjcq7hmcrkiyik26g2i2z7uk4 array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 @@ -4435,7 +4709,7 @@ packages: - supports-color dev: true - /eslint-plugin-jest/27.0.1_tobmchb5uviuq5lwsinkw5fvje: + /eslint-plugin-jest/27.0.1_tiloc3ejst55n76oty5rbi22ra: resolution: {integrity: sha512-LosUsrkwVSs/8Z/I8Hqn5vWgTEsHrfIquDEKOsV8/cl+gbFR4tiRCE1AimEotsHjSC0Rx1tYm6vPhw8C3ktmmg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -4448,8 +4722,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/utils': 5.33.0_typescript@5.0.4 - jest: 29.5.0_ts-node@10.9.1 + '@typescript-eslint/utils': 5.33.0_typescript@5.1.6 + jest: 29.5.0_tylgm7ihy6sjibrlzw2t2ezks4 transitivePeerDependencies: - supports-color - typescript @@ -5489,7 +5763,7 @@ packages: har-schema: 2.0.0 dev: true - /hardhat-abi-exporter/2.10.0_hardhat@2.10.2: + /hardhat-abi-exporter/2.10.0_hardhat@2.16.1: resolution: {integrity: sha512-ynYGUptkal3leyUNGP3aJ6GRYtSHed3lHcfMv6imawqEd7MERueEkeFy+X4kWH3Vf5w4k6xeeCJHJsegGBJUPA==} engines: {node: '>=14.14.0'} peerDependencies: @@ -5497,17 +5771,17 @@ packages: dependencies: '@ethersproject/abi': 5.6.4 delete-empty: 3.0.0 - hardhat: 2.10.2_pyqfhkbboucpxgvrs7ocxwodkm + hardhat: 2.16.1_kg5gpyde6u3komamnnl67a6oc4 dev: true - /hardhat-deploy-ethers/0.3.0-beta.13_xk7ts3jleh4tydykqykpb6jvzy: + /hardhat-deploy-ethers/0.3.0-beta.13_drbn5rr2wg6skrabufgggpzpcu: resolution: {integrity: sha512-PdWVcKB9coqWV1L7JTpfXRCI91Cgwsm7KLmBcwZ8f0COSm1xtABHZTyz3fvF6p42cTnz1VM0QnfDvMFlIRkSNw==} peerDependencies: ethers: ^5.0.0 hardhat: ^2.0.0 dependencies: ethers: 5.7.2 - hardhat: 2.10.2_pyqfhkbboucpxgvrs7ocxwodkm + hardhat: 2.16.1_kg5gpyde6u3komamnnl67a6oc4 dev: true /hardhat-deploy/0.11.12: @@ -5532,9 +5806,9 @@ packages: - utf-8-validate dev: true - /hardhat/2.10.2_pyqfhkbboucpxgvrs7ocxwodkm: - resolution: {integrity: sha512-L/KvDDT/MA6332uAtYTqdcHoSABljw4pPjHQe5SHdIJ+xKfaSc6vDKw03CmrQ5Xup0gHs8XnVSBpZo1AbbIW7g==} - engines: {node: ^14.0.0 || ^16.0.0 || ^18.0.0} + /hardhat/2.16.1_kg5gpyde6u3komamnnl67a6oc4: + resolution: {integrity: sha512-QpBjGXFhhSYoYBGEHyoau/A63crZOP+i3GbNxzLGkL6IklzT+piN14+wGnINNCg5BLSKisQI/RAySPzaWRcx/g==} + engines: {node: '>=14.0.0'} hasBin: true peerDependencies: ts-node: '*' @@ -5545,15 +5819,20 @@ packages: typescript: optional: true dependencies: - '@ethereumjs/block': 3.6.3 - '@ethereumjs/blockchain': 5.5.3 - '@ethereumjs/common': 2.6.5 - '@ethereumjs/tx': 3.5.2 - '@ethereumjs/vm': 5.9.3 - '@ethersproject/abi': 5.6.4 + '@ethersproject/abi': 5.7.0 '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-blockchain': 7.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@nomicfoundation/ethereumjs-vm': 7.0.1 + '@nomicfoundation/solidity-analyzer': 0.1.1 '@sentry/node': 5.30.0 - '@solidity-parser/parser': 0.14.3 '@types/bn.js': 5.1.0 '@types/lru-cache': 5.1.1 abort-controller: 3.0.0 @@ -5568,31 +5847,27 @@ packages: env-paths: 2.2.1 ethereum-cryptography: 1.1.2 ethereumjs-abi: 0.6.8 - ethereumjs-util: 7.1.5 find-up: 2.1.0 fp-ts: 1.19.3 fs-extra: 7.0.1 glob: 7.2.0 immutable: 4.1.0 io-ts: 1.10.4 + keccak: 3.0.2 lodash: 4.17.21 - merkle-patricia-tree: 4.2.4 mnemonist: 0.38.5 mocha: 10.0.0 p-map: 4.0.0 - qs: 6.11.0 raw-body: 2.5.1 resolve: 1.17.0 semver: 6.3.0 - slash: 3.0.0 solc: 0.7.3_debug@4.3.4 source-map-support: 0.5.21 stacktrace-parser: 0.1.10 - true-case-path: 2.2.1 - ts-node: 10.9.1_k7iguhqbtoao35i6waebqvypgi + ts-node: 10.9.1_mzbeecxiug4t43pxwrx5whvupa tsort: 0.0.1 - typescript: 5.0.4 - undici: 5.9.1 + typescript: 5.1.6 + undici: 5.22.1 uuid: 8.3.2 ws: 7.4.6 transitivePeerDependencies: @@ -5784,14 +6059,6 @@ packages: engines: {node: '>= 4'} dev: true - /immediate/3.2.3: - resolution: {integrity: sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==} - dev: true - - /immediate/3.3.0: - resolution: {integrity: sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==} - dev: true - /immutable/4.1.0: resolution: {integrity: sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==} dev: true @@ -5895,7 +6162,6 @@ packages: /is-buffer/2.0.5: resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} engines: {node: '>=4'} - dev: false /is-callable/1.2.4: resolution: {integrity: sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==} @@ -6157,7 +6423,7 @@ packages: '@jest/expect': 29.5.0 '@jest/test-result': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -6177,7 +6443,7 @@ packages: - supports-color dev: true - /jest-cli/29.5.0_ts-node@10.9.1: + /jest-cli/29.5.0_tylgm7ihy6sjibrlzw2t2ezks4: resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6194,7 +6460,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.10 import-local: 3.1.0 - jest-config: 29.5.0_ts-node@10.9.1 + jest-config: 29.5.0_tylgm7ihy6sjibrlzw2t2ezks4 jest-util: 29.5.0 jest-validate: 29.5.0 prompts: 2.4.2 @@ -6205,46 +6471,7 @@ packages: - ts-node dev: true - /jest-config/29.5.0_ts-node@10.9.1: - resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - dependencies: - '@babel/core': 7.18.10 - '@jest/test-sequencer': 29.5.0 - '@jest/types': 29.5.0 - babel-jest: 29.5.0_@babel+core@7.18.10 - chalk: 4.1.2 - ci-info: 3.3.2 - deepmerge: 4.2.2 - glob: 7.2.3 - graceful-fs: 4.2.10 - jest-circus: 29.5.0 - jest-environment-node: 29.5.0 - jest-get-type: 29.4.3 - jest-regex-util: 29.4.3 - jest-resolve: 29.5.0 - jest-runner: 29.5.0 - jest-util: 29.5.0 - jest-validate: 29.5.0 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 29.5.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - ts-node: 10.9.1_k7iguhqbtoao35i6waebqvypgi - transitivePeerDependencies: - - supports-color - dev: true - - /jest-config/29.5.0_ubchvo7cxgdavyfa6mg2b5a4oe: + /jest-config/29.5.0_tylgm7ihy6sjibrlzw2t2ezks4: resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -6259,7 +6486,7 @@ packages: '@babel/core': 7.18.10 '@jest/test-sequencer': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 babel-jest: 29.5.0_@babel+core@7.18.10 chalk: 4.1.2 ci-info: 3.3.2 @@ -6279,7 +6506,7 @@ packages: pretty-format: 29.5.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_k7iguhqbtoao35i6waebqvypgi + ts-node: 10.9.1_mzbeecxiug4t43pxwrx5whvupa transitivePeerDependencies: - supports-color dev: true @@ -6329,7 +6556,7 @@ packages: '@jest/environment': 29.5.0 '@jest/fake-timers': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 jest-mock: 29.5.0 jest-util: 29.5.0 dev: true @@ -6350,7 +6577,7 @@ packages: dependencies: '@jest/types': 29.5.0 '@types/graceful-fs': 4.1.5 - '@types/node': 18.6.5 + '@types/node': 20.3.3 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 @@ -6416,7 +6643,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 jest-util: 29.5.0 dev: true @@ -6471,7 +6698,7 @@ packages: '@jest/test-result': 29.5.0 '@jest/transform': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.10 @@ -6502,7 +6729,7 @@ packages: '@jest/test-result': 29.5.0 '@jest/transform': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 @@ -6557,7 +6784,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.10 @@ -6582,7 +6809,7 @@ packages: dependencies: '@jest/test-result': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.6.5 + '@types/node': 20.3.3 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -6594,13 +6821,13 @@ packages: resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 18.6.5 + '@types/node': 20.3.3 jest-util: 29.5.0 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest/29.5.0_ts-node@10.9.1: + /jest/29.5.0_tylgm7ihy6sjibrlzw2t2ezks4: resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6613,7 +6840,7 @@ packages: '@jest/core': 29.5.0_ts-node@10.9.1 '@jest/types': 29.5.0 import-local: 3.1.0 - jest-cli: 29.5.0_ts-node@10.9.1 + jest-cli: 29.5.0_tylgm7ihy6sjibrlzw2t2ezks4 transitivePeerDependencies: - '@types/node' - supports-color @@ -6637,6 +6864,10 @@ packages: resolution: {integrity: sha512-8DdCSAOACpF8WDAjyDFBC2rj8OS4HUP9mNZBDfl8jCiPCnJG+2bkuycalxwZh6heFy6PrMvoWTp47lp6gzT65A==} dev: false + /js-sdsl/4.4.1: + resolution: {integrity: sha512-6Gsx8R0RucyePbWqPssR8DyfuXmLBooYN5cZFZKjHGnQuaf7pEzhtpceagJxVu4LqhYY5EYA7nko3FmeHZ1KbA==} + dev: true + /js-sha256/0.9.0: resolution: {integrity: sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==} dev: false @@ -6801,18 +7032,6 @@ packages: invert-kv: 1.0.0 dev: true - /level-codec/9.0.2: - resolution: {integrity: sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==} - engines: {node: '>=6'} - dependencies: - buffer: 5.7.1 - dev: true - - /level-concat-iterator/2.0.1: - resolution: {integrity: sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==} - engines: {node: '>=6'} - dev: true - /level-concat-iterator/3.1.0: resolution: {integrity: sha512-BWRCMHBxbIqPxJ8vHOvKUsaO0v1sLYZtjN3K2iZJsRBYtp+ONsY6Jfi6hy9K3+zolgQRryhIn2NRZjZnWJ9NmQ==} engines: {node: '>=10'} @@ -6820,57 +7039,30 @@ packages: catering: 2.1.1 dev: false - /level-errors/2.0.1: - resolution: {integrity: sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==} - engines: {node: '>=6'} - dependencies: - errno: 0.1.8 - dev: true - - /level-iterator-stream/4.0.2: - resolution: {integrity: sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==} - engines: {node: '>=6'} - dependencies: - inherits: 2.0.4 - readable-stream: 3.6.0 - xtend: 4.0.2 - dev: true - - /level-mem/5.0.1: - resolution: {integrity: sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==} - engines: {node: '>=6'} - dependencies: - level-packager: 5.1.1 - memdown: 5.1.0 - dev: true + /level-supports/2.1.0: + resolution: {integrity: sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA==} + engines: {node: '>=10'} + dev: false - /level-packager/5.1.1: - resolution: {integrity: sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==} - engines: {node: '>=6'} - dependencies: - encoding-down: 6.3.0 - levelup: 4.4.0 + /level-supports/4.0.1: + resolution: {integrity: sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==} + engines: {node: '>=12'} dev: true - /level-supports/1.0.1: - resolution: {integrity: sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==} - engines: {node: '>=6'} + /level-transcoder/1.0.1: + resolution: {integrity: sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==} + engines: {node: '>=12'} dependencies: - xtend: 4.0.2 + buffer: 6.0.3 + module-error: 1.0.2 dev: true - /level-supports/2.1.0: - resolution: {integrity: sha512-E486g1NCjW5cF78KGPrMDRBYzPuueMZ6VBXHT6gC7A8UYWGiM14fGgp+s/L1oFfDWSPV/+SFkYCmZ0SiESkRKA==} - engines: {node: '>=10'} - dev: false - - /level-ws/2.0.0: - resolution: {integrity: sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==} - engines: {node: '>=6'} + /level/8.0.0: + resolution: {integrity: sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ==} + engines: {node: '>=12'} dependencies: - inherits: 2.0.4 - readable-stream: 3.6.0 - xtend: 4.0.2 + browser-level: 1.0.1 + classic-level: 1.3.0 dev: true /leveldown/6.1.0: @@ -6883,17 +7075,6 @@ packages: node-gyp-build: 4.5.0 dev: false - /levelup/4.4.0: - resolution: {integrity: sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==} - engines: {node: '>=6'} - dependencies: - deferred-leveldown: 5.3.0 - level-errors: 2.0.1 - level-iterator-stream: 4.0.2 - level-supports: 1.0.1 - xtend: 4.0.2 - dev: true - /leven/3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -7017,10 +7198,6 @@ packages: resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==} dev: true - /ltgt/2.2.1: - resolution: {integrity: sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==} - dev: true - /lz4/0.6.5: resolution: {integrity: sha512-KSZcJU49QZOlJSItaeIU3p8WoAvkTmD9fJqeahQXNu1iQ/kR0/mQLdbrK8JY9MY8f6AhJoMrihp1nu1xDbscSQ==} engines: {node: '>= 0.10'} @@ -7069,16 +7246,13 @@ packages: engines: {node: '>= 0.6'} dev: true - /memdown/5.1.0: - resolution: {integrity: sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==} - engines: {node: '>=6'} + /memory-level/1.0.0: + resolution: {integrity: sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==} + engines: {node: '>=12'} dependencies: - abstract-leveldown: 6.2.3 + abstract-level: 1.0.3 functional-red-black-tree: 1.0.1 - immediate: 3.2.3 - inherits: 2.0.4 - ltgt: 2.2.1 - safe-buffer: 5.2.1 + module-error: 1.0.2 dev: true /memorystream/0.3.1: @@ -7099,17 +7273,6 @@ packages: engines: {node: '>= 8'} dev: true - /merkle-patricia-tree/4.2.4: - resolution: {integrity: sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w==} - dependencies: - '@types/levelup': 4.3.3 - ethereumjs-util: 7.1.5 - level-mem: 5.0.1 - level-ws: 2.0.0 - readable-stream: 3.6.0 - semaphore-async-await: 1.5.1 - dev: true - /methods/1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} @@ -7265,6 +7428,11 @@ packages: resolution: {integrity: sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==} dev: true + /module-error/1.0.2: + resolution: {integrity: sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==} + engines: {node: '>=10'} + dev: true + /ms/2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: true @@ -7394,6 +7562,10 @@ packages: resolution: {integrity: sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==} dev: false + /napi-macros/2.2.2: + resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==} + dev: true + /natural-compare/1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true @@ -7969,10 +8141,6 @@ packages: ipaddr.js: 1.9.1 dev: true - /prr/1.0.1: - resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} - dev: true - /psl/1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} dev: true @@ -8274,6 +8442,12 @@ packages: dependencies: bn.js: 5.2.1 + /run-parallel-limit/1.1.0: + resolution: {integrity: sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==} + dependencies: + queue-microtask: 1.2.3 + dev: true + /run-parallel/1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -8325,11 +8499,6 @@ packages: node-addon-api: 2.0.2 node-gyp-build: 4.5.0 - /semaphore-async-await/1.5.1: - resolution: {integrity: sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg==} - engines: {node: '>=4.1'} - dev: true - /semver/5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true @@ -8663,6 +8832,11 @@ packages: engines: {node: '>= 0.8'} dev: true + /streamsearch/1.1.0: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + dev: true + /strict-uri-encode/1.1.0: resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==} engines: {node: '>=0.10.0'} @@ -8951,11 +9125,7 @@ packages: hasBin: true dev: false - /true-case-path/2.2.1: - resolution: {integrity: sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q==} - dev: true - - /ts-jest/29.1.1_k4loywzeyoudxba33oezutz7em: + /ts-jest/29.1.1_2waxxg7y65jrymm3x52phvey74: resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -8979,17 +9149,17 @@ packages: bs-logger: 0.2.6 esbuild: 0.15.6 fast-json-stable-stringify: 2.1.0 - jest: 29.5.0_ts-node@10.9.1 + jest: 29.5.0_tylgm7ihy6sjibrlzw2t2ezks4 jest-util: 29.5.0 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.5.3 - typescript: 5.0.4 + typescript: 5.1.6 yargs-parser: 21.1.1 dev: true - /ts-node/10.9.1_k7iguhqbtoao35i6waebqvypgi: + /ts-node/10.9.1_mzbeecxiug4t43pxwrx5whvupa: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -9009,13 +9179,14 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 + '@types/node': 20.3.3 acorn: 8.8.0 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.0.4 + typescript: 5.1.6 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -9048,6 +9219,37 @@ packages: typescript: 5.0.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + dev: false + + /ts-node/10.9.1_typescript@5.1.6: + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + acorn: 8.8.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.1.6 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true /tsconfig-paths/3.14.1: resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} @@ -9069,14 +9271,14 @@ packages: resolution: {integrity: sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==} dev: true - /tsutils/3.21.0_typescript@5.0.4: + /tsutils/3.21.0_typescript@5.1.6: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.0.4 + typescript: 5.1.6 dev: true /tunnel-agent/0.6.0: @@ -9156,6 +9358,12 @@ packages: resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} engines: {node: '>=12.20'} hasBin: true + dev: false + + /typescript/5.1.6: + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + engines: {node: '>=14.17'} + hasBin: true /uint8arrays/3.1.0: resolution: {integrity: sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==} @@ -9179,9 +9387,11 @@ packages: resolution: {integrity: sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ==} dev: true - /undici/5.9.1: - resolution: {integrity: sha512-6fB3a+SNnWEm4CJbgo0/CWR8RGcOCQP68SF4X0mxtYTq2VNN8T88NYrWVBAeSX+zb7bny2dx2iYhP3XHi00omg==} - engines: {node: '>=12.18'} + /undici/5.22.1: + resolution: {integrity: sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw==} + engines: {node: '>=14.0'} + dependencies: + busboy: 1.6.0 dev: true /universalify/0.1.2: @@ -9353,6 +9563,29 @@ packages: extsprintf: 1.3.0 dev: true + /viem/1.2.9: + resolution: {integrity: sha512-EnEbTuAAHv43unUgMISdQXbD9mrhZLvOdmf6eRGbDFl+XwP/PEzZAT79RaWAuDPnLXGMP1gBCJF++NFjSMukUw==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.9.0 + '@noble/curves': 1.0.0 + '@noble/hashes': 1.3.0 + '@scure/bip32': 1.3.0 + '@scure/bip39': 1.2.0 + '@wagmi/chains': 1.2.0 + abitype: 0.8.11 + isomorphic-ws: 5.0.0_ws@8.12.0 + ws: 8.12.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + dev: false + /viem/1.2.9_typescript@5.0.4: resolution: {integrity: sha512-EnEbTuAAHv43unUgMISdQXbD9mrhZLvOdmf6eRGbDFl+XwP/PEzZAT79RaWAuDPnLXGMP1gBCJF++NFjSMukUw==} peerDependencies: @@ -9375,6 +9608,31 @@ packages: - bufferutil - utf-8-validate - zod + dev: false + + /viem/1.2.9_typescript@5.1.6: + resolution: {integrity: sha512-EnEbTuAAHv43unUgMISdQXbD9mrhZLvOdmf6eRGbDFl+XwP/PEzZAT79RaWAuDPnLXGMP1gBCJF++NFjSMukUw==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.9.0 + '@noble/curves': 1.0.0 + '@noble/hashes': 1.3.0 + '@scure/bip32': 1.3.0 + '@scure/bip39': 1.2.0 + '@wagmi/chains': 1.2.0_typescript@5.1.6 + abitype: 0.8.11_typescript@5.1.6 + isomorphic-ws: 5.0.0_ws@8.12.0 + typescript: 5.1.6 + ws: 8.12.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + dev: true /wait-on/6.0.1: resolution: {integrity: sha512-zht+KASY3usTY5u2LgaNqn/Cd8MukxLGjdcZxT2ns5QzDmTFc4XoWBgC+C/na+sMRZTuVygQoMYwdcVjHnYIVw==} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 18ec407e..ed54ecd0 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ packages: - 'packages/*' + - 'examples/*' \ No newline at end of file