Skip to content

Commit

Permalink
chore: fixed merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Julink-eth committed Apr 11, 2023
2 parents 6aacbb8 + 5de00e0 commit 9ffe2fb
Show file tree
Hide file tree
Showing 7 changed files with 7,070 additions and 177 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ ethAddress 0xF110a41f75edEb224227747b64Be7f6A7f140abc

## Deployed contracts

- Linea goerli resolver = [...]
- Linea goerli resolver = 0x176569440293dF1fA85D0Eb342A92c6470D662f9
- goerli (gateway points to '[...]' ) = [...]
- goerli test domain = [...]
- goerli test domain = linearesolver.eth

## Deploy gateway

Expand All @@ -107,3 +107,5 @@ Deploy to app engine:
```
gcloud app deploy goeril.app.yml
```

yarn start --l2_resolver_address $L2_RESOLVER_ADDRESS --helper_address $HELPER_ADDRESS --l1_provider_url https://goerli.infura.io/v3/<INFURA_KEY> --l2_provider_url https://goerli.infura.io/v3/<INFURA_KEY> --l1_chain_id 5 --l2_chain_id 5
4 changes: 2 additions & 2 deletions packages/client/abi/LineaResolverStub.json

Large diffs are not rendered by default.

53 changes: 49 additions & 4 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,62 @@
{
"name": "linea-resolver-client",
"version": "1.0.0",
"main": "index.ts",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"src"
],
"engines": {
"node": ">=10"
},
"scripts": {
"start": "yarn ts-node src/index.ts"
"start": "node dist/index.js",
"build": "tsdx build",
"lint": "tsdx lint",
"prepare": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why",
"clean": "rm -fr node_modules dist",
"test": "echo No tests"
},
"peerDependencies": {},
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"module": "dist/client.esm.js",
"size-limit": [
{
"path": "dist/client.cjs.production.min.js",
"limit": "10 KB"
},
{
"path": "dist/client.esm.js",
"limit": "10 KB"
}
],
"devDependencies": {
"@size-limit/preset-small-lib": "^7.0.5",
"husky": "^7.0.4",
"size-limit": "^7.0.5",
"tsdx": "^0.14.1",
"tslib": "^2.3.1",
"typescript": "^4.9.4"
},
"dependencies": {
"@types/node": "^18.11.17",
"commander": "^9.4.1",
"dotenv": "^16.0.3",
"ethers": "^5.7.2",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
"ts-node": "^10.9.1"
}
}
36 changes: 18 additions & 18 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import { Command } from "commander";
import { ethers } from "ethers";
import { REGISTRY_ADDRESS } from "./constants";
import { Command } from 'commander';
import { ethers } from 'ethers';
import { REGISTRY_ADDRESS } from './constants';

const program = new Command();
program
.requiredOption(
"-r --registry <address>",
"ENS registry address",
'-r --registry <address>',
'ENS registry address',
REGISTRY_ADDRESS
)
.option(
"-l1 --l1_provider_url <url1>",
"L1_PROVIDER_URL",
"http://127.0.0.1:8545/"
'-l1 --l1_provider_url <url1>',
'L1_PROVIDER_URL',
'http://127.0.0.1:8545/'
)
.option("-i --chainId <chainId>", "chainId", "31337")
.option("-n --chainName <chainName>", "chainName", "unknown")
.option("-d --debug", "debug", false)
.argument("<name>");
.option('-i --chainId <chainId>', 'chainId', '31337')
.option('-n --chainName <chainName>', 'chainName', 'unknown')
.option('-d --debug', 'debug', false)
.argument('<name>');

program.parse(process.argv);
const options = program.opts();
const ensAddress = options.registry;
const chainId = parseInt(options.chainId);
const { chainName, l1_provider_url, debug } = options;
console.log("options", {
console.log('options', {
l1_provider_url,
ensAddress,
chainId,
Expand All @@ -40,16 +40,16 @@ const provider = new ethers.providers.JsonRpcProvider(l1_provider_url, {

(async () => {
const name = program.args[0];
console.log("name", name);
console.log('name', name);
const resolverFound = await provider.getResolver(name);
console.log("resolverFound address", resolverFound?.address);
console.log('resolverFound address', resolverFound?.address);
const node = ethers.utils.namehash(name);
console.log("node", node);
console.log('node', node);

if (resolverFound) {
let ethAddress = await resolverFound.getAddress();
console.log("ethAddress", ethAddress);
console.log('ethAddress', ethAddress);
} else {
console.log("No resolver found for:", name);
console.log('No resolver found for:', name);
}
})();
36 changes: 36 additions & 0 deletions packages/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
"include": ["src", "types"],
"compilerOptions": {
"module": "ES2015",
// "lib": ["dom", "commonjs"],
"importHelpers": true,
// output .d.ts declaration files for consumers
"declaration": true,
// output .js.map sourcemap files for consumers
"sourceMap": true,
// match output dir to input dir. e.g. dist/index instead of dist/src/index
"rootDir": "./src",
// stricter type-checking for stronger correctness. Recommended by TS
"strict": true,
// linter checks for common issues
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
// noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// use Node's module resolution algorithm, instead of the legacy TS one
"moduleResolution": "node",
// transpile JSX to React.createElement
"jsx": "react",
// interop between ESM and CJS modules. Recommended by TS
"esModuleInterop": true,
// significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS
"skipLibCheck": true,
// error out if import and file system have a casing mismatch. Recommended by TS
"forceConsistentCasingInFileNames": true,
// `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc`
"noEmit": true,
"resolveJsonModule": true
}
}
Loading

0 comments on commit 9ffe2fb

Please sign in to comment.