Skip to content

Commit d5773ae

Browse files
Updated deps (prettier, ethers, hardhat)
1 parent 247fb94 commit d5773ae

File tree

141 files changed

+6305
-2873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+6305
-2873
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
'simple-import-sort/imports': 'error',
2323
'simple-import-sort/exports': 'error',
2424
'@typescript-eslint/no-use-before-define': 'off',
25+
'@typescript-eslint/no-invalid-this': 'off',
2526
'@typescript-eslint/no-useless-constructor': 'error',
2627
'accessor-pairs': 'error',
2728
'constructor-super': 'error',

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,9 @@ _Take note, that code generated by TypeChain requires TypeScript version 4.3 or
5555
| Package | Version | Description | Examples |
5656
| ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
5757
| [`typechain`](/packages/typechain) | [![npm](https://img.shields.io/npm/v/typechain.svg)](https://www.npmjs.com/package/typechain) | Core package | - |
58-
| [`@typechain/ethers-v5`](/packages/target-ethers-v5) | [![npm](https://img.shields.io/npm/v/@typechain/ethers-v5.svg)](https://www.npmjs.com/package/@typechain/ethers-v5) | Ethers ver 5 support (⚠️ requires TS 4.0 >=) | [example](./examples/ethers-v5) |
5958
| [`@typechain/ethers-v6`](/packages/target-ethers-v6) | [![npm](https://img.shields.io/npm/v/@typechain/ethers-v6.svg)](https://www.npmjs.com/package/@typechain/ethers-v6) | Ethers ver 6 support (⚠️ requires TS 4.0 >=) | [example](./examples/ethers-v6) |
60-
| [`@typechain/starknet.js`](/packages/target-starknet) | [![npm](https://img.shields.io/npm/v/@typechain/starknet.svg)](https://www.npmjs.com/package/@typechain/starknet) | Starknet.js ver 3.9 | |
61-
| [`@typechain/truffle-v5`](/packages/target-truffle-v5) | [![npm](https://img.shields.io/npm/v/@typechain/truffle-v5.svg)](https://www.npmjs.com/package/@typechain/truffle-v5) | Truffle ver 5 support | [example](./examples/truffle-v5) |
62-
| [`@typechain/web3-v1`](/packages/target-web3-v1) | [![npm](https://img.shields.io/npm/v/@typechain/web3-v1.svg)](https://www.npmjs.com/package/@typechain/web3-v1) | Web3 ver 1 support | [example](./examples/web3-v1) |
6359
| [`@typechain/hardhat`](/packages/hardhat) | [![npm](https://img.shields.io/npm/v/@typechain/hardhat.svg)](https://www.npmjs.com/package/@typechain/hardhat) | Hardhat plugin | [example-ethers](./examples/hardhat) [example-truffle](./examples/hardhat-truffle) |
64-
| [`@typechain/truffle-v4`](https://github.com/dethcrypto/TypeChain/tree/fb96e1cf06c8c4c17cd79a1743362bd3d34eab76/packages/target-truffle-v4) | [![npm](https://img.shields.io/npm/v/@typechain/truffle-v4.svg)](https://www.npmjs.com/package/@typechain/truffle-v4) | Truffle ver 4 support **(deprecated)** | [example](https://github.com/dethcrypto/TypeChain/tree/fb96e1cf06c8c4c17cd79a1743362bd3d34eab76/examples/truffle-v4) |
65-
| [`@typechain/ethers-v4`](/packages/target-ethers-v4) | [![npm](https://img.shields.io/npm/v/@typechain/ethers-v4.svg)](https://www.npmjs.com/package/@typechain/ethers-v4) | Ethers ver 4 support **(deprecated)** | [example](https://github.com/dethcrypto/TypeChain/tree/db551b5c5f70e86f3ca342551e9e0369d099cfa2/examples/ethers-v4) |
60+
|
6661

6762
### eth-sdk
6863

@@ -143,20 +138,6 @@ If you're using Ethers.js v4, you can find legacy `@typechain/ethers-v4` target
143138
[npm](https://www.npmjs.com/package/@typechain/ethers-v4) and commit
144139
[`db551b5`](https://github.com/dethcrypto/TypeChain/tree/db551b5c5f70e86f3ca342551e9e0369d099cfa2).
145140

146-
### Truffle v5
147-
148-
Truffle target is great when you use truffle contracts already. Check out
149-
[truffle-typechain-example](https://github.com/dethcrypto/TypeChain/tree/master/examples/truffle-v5) for more details.
150-
151-
Now you can simply use your contracts as you did before and get full type safety, yay!
152-
153-
### Web3 v1
154-
155-
Generates typings for contracts compatible with latest stable Web3.js version. Typings for library itself are now part
156-
of the `Web3 1.0.0` library so nothing additional is needed. For now it needs explicit cast as shown
157-
[here](https://github.com/krzkaczor/TypeChain/pull/88/files#diff-540a9b8840419be93ddb8d4b53325637R8), this will be fixed
158-
after improving official typings.
159-
160141
### NatSpec support
161142

162143
If you provide solidity artifacts rather than plain ABIs as an input, TypeChain can generate NatSpec comments directly

examples/ethers-v6-nodenext/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"typecheck": "pnpm generate-types && tsc --noEmit"
1212
},
1313
"devDependencies": {
14-
"@typechain/ethers-v6": "workspace:^0.5.1",
14+
"@typechain/ethers-v6": "workspace:@arowanadao/typechain-ethers-v6@^0.5.1",
1515
"@types/bn.js": "^5.1.0",
1616
"ts-node": "^10.7.0",
17-
"typechain": "workspace:^8.3.2",
17+
"typechain": "workspace:@arowanadao/typechain@^8.3.2",
1818
"typescript": "^4.7"
1919
},
2020
"dependencies": {

examples/ethers-v6/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"typecheck": "pnpm generate-types && tsc --noEmit"
1111
},
1212
"devDependencies": {
13-
"@typechain/ethers-v6": "workspace:^0.5.1",
13+
"@typechain/ethers-v6": "workspace:@arowanadao/typechain-ethers-v6@^0.5.1",
1414
"@types/bn.js": "^5.1.0",
1515
"ts-node": "^10.7.0",
16-
"typechain": "workspace:^8.3.2",
16+
"typechain": "workspace:@arowanadao/typechain@^8.3.2",
1717
"typescript": "^4.7"
1818
},
1919
"dependencies": {

examples/ethers-v6/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"compilerOptions": {
33
"lib": ["ES2018", "DOM"],
44
"module": "CommonJS",
5-
"moduleResolution": "node16",
65
"strict": true,
76
"target": "ES2018",
87
"sourceMap": true,

examples/hardhat/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"devDependencies": {
1414
"@nomicfoundation/hardhat-ethers": "^3.0.4",
1515
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
16-
"@typechain/ethers-v6": "workspace:^0.5.1",
17-
"@typechain/hardhat": "workspace:^9.1.0",
16+
"@typechain/ethers-v6": "workspace:@arowanadao/typechain-ethers-v6@^0.5.1",
17+
"@typechain/hardhat": "workspace:@arowanadao/typechain-hardhat@^9.1.0",
1818
"@types/chai": "^4.2.15",
1919
"@types/chai-as-promised": "^7.1.3",
2020
"@types/mocha": "^8.2.0",
@@ -29,7 +29,7 @@
2929
"@ethersproject/abi": "5.4.0",
3030
"hardhat": "^2.9.9",
3131
"ts-node": "^10.7.0",
32-
"typechain": "workspace:^8.3.2",
32+
"typechain": "workspace:@arowanadao/typechain@^8.3.2",
3333
"typescript": "^4.9.5"
3434
},
3535
"dependencies": {}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@
2727
},
2828
"devDependencies": {
2929
"@changesets/cli": "^2.22.0",
30-
"@types/mocha": "^8.2.1",
31-
"@types/node": "18.14.0",
30+
"@types/mocha": "^10.0.10",
31+
"@types/node": "24.0.10",
3232
"@typescript-eslint/eslint-plugin": "4.15.1",
3333
"@typescript-eslint/parser": "4.15.1",
34-
"earljs": "0.2.2",
34+
"earljs": "0.2.3",
3535
"eslint": "^7.29.0",
3636
"eslint-config-typestrict": "^1.0.3",
3737
"eslint-plugin-import": "^2.23.4",
3838
"eslint-plugin-no-only-tests": "^2.6.0",
3939
"eslint-plugin-simple-import-sort": "^7.0.0",
4040
"eslint-plugin-sonarjs": "^0.13.0",
4141
"eslint-plugin-unused-imports": "^1.1.1",
42-
"mocha": "^8.2.0",
43-
"prettier": "^2.3.1",
42+
"mocha": "^11.7.1",
43+
"prettier": "^3.6.2",
4444
"ts-node": "^10.7.0",
45-
"typescript": "^4.9.5"
45+
"typescript": "^5.8.3"
4646
},
4747
"pnpm": {
4848
"peerDependencyRules": {

packages/hardhat-test/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@typechain/hardhat-test",
2+
"name": "@arowanadao/typechain-hardhat-test",
33
"private": true,
44
"version": "1.0.0",
55
"license": "MIT",
@@ -18,11 +18,11 @@
1818
"@ethersproject/providers": "^5.4.7",
1919
"@ethersproject/abi": "^5.4.7",
2020
"@nomicfoundation/hardhat-ethers": "^3.0.0",
21-
"@typechain/ethers-v6": "workspace:^0.5.1",
22-
"@typechain/hardhat": "workspace:^9.1.0",
21+
"@typechain/ethers-v6": "workspace:@arowanadao/typechain-ethers-v6@^0.5.1",
22+
"@typechain/hardhat": "workspace:@arowanadao/typechain-hardhat@^9.1.0",
2323
"ethers": "~6.3.0",
2424
"hardhat": "^2.9.9",
25-
"test-utils": "1.0.0",
26-
"typechain": "workspace:^8.3.2"
25+
"test-utils": "workspace:*",
26+
"typechain": "workspace:@arowanadao/typechain@^8.3.2"
2727
}
2828
}

packages/hardhat-test/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"include": ["./typechain-types", "./test", "./hardhat.config.ts"],
44
"compilerOptions": {
55
"esModuleInterop": true,
6-
"skipLibCheck": true,
7-
"importsNotUsedAsValues": "error"
6+
"skipLibCheck": true
87
}
98
}

packages/hardhat-test/typechain-types/Counter.ts renamed to packages/hardhat-test/typechain-types/Counter.sol/Counter.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import type {
2020
TypedLogDescription,
2121
TypedListener,
2222
TypedContractMethod,
23-
} from "./common";
23+
} from "../common";
2424

2525
export interface CounterInterface extends Interface {
2626
getFunction(
27-
nameOrSignature: "countDown" | "countUp" | "getCount"
27+
nameOrSignature: "countDown" | "countUp" | "getCount",
2828
): FunctionFragment;
2929

3030
getEvent(nameOrSignatureOrTopic: "CountedTo"): EventFragment;
@@ -59,38 +59,38 @@ export interface Counter extends BaseContract {
5959
queryFilter<TCEvent extends TypedContractEvent>(
6060
event: TCEvent,
6161
fromBlockOrBlockhash?: string | number | undefined,
62-
toBlock?: string | number | undefined
62+
toBlock?: string | number | undefined,
6363
): Promise<Array<TypedEventLog<TCEvent>>>;
6464
queryFilter<TCEvent extends TypedContractEvent>(
6565
filter: TypedDeferredTopicFilter<TCEvent>,
6666
fromBlockOrBlockhash?: string | number | undefined,
67-
toBlock?: string | number | undefined
67+
toBlock?: string | number | undefined,
6868
): Promise<Array<TypedEventLog<TCEvent>>>;
6969

7070
on<TCEvent extends TypedContractEvent>(
7171
event: TCEvent,
72-
listener: TypedListener<TCEvent>
72+
listener: TypedListener<TCEvent>,
7373
): Promise<this>;
7474
on<TCEvent extends TypedContractEvent>(
7575
filter: TypedDeferredTopicFilter<TCEvent>,
76-
listener: TypedListener<TCEvent>
76+
listener: TypedListener<TCEvent>,
7777
): Promise<this>;
7878

7979
once<TCEvent extends TypedContractEvent>(
8080
event: TCEvent,
81-
listener: TypedListener<TCEvent>
81+
listener: TypedListener<TCEvent>,
8282
): Promise<this>;
8383
once<TCEvent extends TypedContractEvent>(
8484
filter: TypedDeferredTopicFilter<TCEvent>,
85-
listener: TypedListener<TCEvent>
85+
listener: TypedListener<TCEvent>,
8686
): Promise<this>;
8787

8888
listeners<TCEvent extends TypedContractEvent>(
89-
event: TCEvent
89+
event: TCEvent,
9090
): Promise<Array<TypedListener<TCEvent>>>;
9191
listeners(eventName?: string): Promise<Array<Listener>>;
9292
removeAllListeners<TCEvent extends TypedContractEvent>(
93-
event?: TCEvent
93+
event?: TCEvent,
9494
): Promise<this>;
9595

9696
countDown: TypedContractMethod<[], [bigint], "nonpayable">;
@@ -100,21 +100,21 @@ export interface Counter extends BaseContract {
100100
getCount: TypedContractMethod<[], [bigint], "view">;
101101

102102
getFunction<T extends ContractMethod = ContractMethod>(
103-
key: string | FunctionFragment
103+
key: string | FunctionFragment,
104104
): T;
105105

106106
getFunction(
107-
nameOrSignature: "countDown"
107+
nameOrSignature: "countDown",
108108
): TypedContractMethod<[], [bigint], "nonpayable">;
109109
getFunction(
110-
nameOrSignature: "countUp"
110+
nameOrSignature: "countUp",
111111
): TypedContractMethod<[], [bigint], "nonpayable">;
112112
getFunction(
113-
nameOrSignature: "getCount"
113+
nameOrSignature: "getCount",
114114
): TypedContractMethod<[], [bigint], "view">;
115115

116116
getEvent(
117-
key: "CountedTo"
117+
key: "CountedTo",
118118
): TypedContractEvent<
119119
CountedToEvent.InputTuple,
120120
CountedToEvent.OutputTuple,

0 commit comments

Comments
 (0)