@cowprotocol/permit-utils 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/1inchPermitUtils-BDO_CqjL.cjs +1 -0
  2. package/1inchPermitUtils-CXu6m1-9.js +4 -0
  3. package/const.d.ts +24 -0
  4. package/index.cjs +1 -0
  5. package/index.js +547 -0
  6. package/{src/lib → lib}/checkIsCallDataAValidPermit.d.ts +1 -1
  7. package/{src/lib → lib}/getPermitUtilsInstance.d.ts +2 -2
  8. package/package.json +16 -26
  9. package/{src/types.d.ts → types.d.ts} +3 -3
  10. package/{src/utils → utils}/PermitProviderConnector.d.ts +2 -2
  11. package/{src/utils → utils}/getContract.d.ts +1 -1
  12. package/{src/utils → utils}/getEip712Domain.d.ts +1 -1
  13. package/{src/utils → utils}/getTokenName.d.ts +1 -1
  14. package/{src/utils → utils}/getTokenPermitVersion.d.ts +1 -1
  15. package/CHANGELOG.md +0 -322
  16. package/src/abi/erc20.json +0 -59
  17. package/src/abi/versionAbis.js +0 -41
  18. package/src/abi/versionAbis.js.map +0 -1
  19. package/src/const.d.ts +0 -24
  20. package/src/const.js +0 -18
  21. package/src/const.js.map +0 -1
  22. package/src/consts/1inchPermitUtils.js +0 -68
  23. package/src/consts/1inchPermitUtils.js.map +0 -1
  24. package/src/imports/1inchPermitUtils.js +0 -14
  25. package/src/imports/1inchPermitUtils.js.map +0 -1
  26. package/src/index.js +0 -20
  27. package/src/index.js.map +0 -1
  28. package/src/lib/checkIsCallDataAValidPermit.js +0 -47
  29. package/src/lib/checkIsCallDataAValidPermit.js.map +0 -1
  30. package/src/lib/generatePermitHook.js +0 -106
  31. package/src/lib/generatePermitHook.js.map +0 -1
  32. package/src/lib/getPermitUtilsInstance.js +0 -71
  33. package/src/lib/getPermitUtilsInstance.js.map +0 -1
  34. package/src/lib/getTokenPermitInfo.js +0 -204
  35. package/src/lib/getTokenPermitInfo.js.map +0 -1
  36. package/src/types.js +0 -3
  37. package/src/types.js.map +0 -1
  38. package/src/utils/PermitProviderConnector.js +0 -64
  39. package/src/utils/PermitProviderConnector.js.map +0 -1
  40. package/src/utils/buildPermitCallData.js +0 -20
  41. package/src/utils/buildPermitCallData.js.map +0 -1
  42. package/src/utils/getContract.js +0 -8
  43. package/src/utils/getContract.js.map +0 -1
  44. package/src/utils/getEip712Domain.js +0 -44
  45. package/src/utils/getEip712Domain.js.map +0 -1
  46. package/src/utils/getPermitDeadline.js +0 -10
  47. package/src/utils/getPermitDeadline.js.map +0 -1
  48. package/src/utils/getTokenName.js +0 -13
  49. package/src/utils/getTokenName.js.map +0 -1
  50. package/src/utils/getTokenPermitVersion.js +0 -28
  51. package/src/utils/getTokenPermitVersion.js.map +0 -1
  52. package/src/utils/isSupportedPermitInfo.js +0 -7
  53. package/src/utils/isSupportedPermitInfo.js.map +0 -1
  54. /package/{src/abi → abi}/versionAbis.d.ts +0 -0
  55. /package/{src/consts → consts}/1inchPermitUtils.d.ts +0 -0
  56. /package/{src/imports → imports}/1inchPermitUtils.d.ts +0 -0
  57. /package/{src/index.d.ts → index.d.ts} +0 -0
  58. /package/{src/lib → lib}/generatePermitHook.d.ts +0 -0
  59. /package/{src/lib → lib}/getTokenPermitInfo.d.ts +0 -0
  60. /package/{src/utils → utils}/buildPermitCallData.d.ts +0 -0
  61. /package/{src/utils → utils}/getPermitDeadline.d.ts +0 -0
  62. /package/{src/utils → utils}/isSupportedPermitInfo.d.ts +0 -0
@@ -1,6 +1,6 @@
1
- import type { JsonRpcProvider } from '@ethersproject/providers';
1
+ import { JsonRpcProvider } from '@ethersproject/providers';
2
2
  import { Wallet } from '@ethersproject/wallet';
3
- import type { AbiInput, AbiItem, EIP712TypedData, ProviderConnector } from '@1inch/permit-signed-approvals-utils';
3
+ import { AbiInput, AbiItem, EIP712TypedData, ProviderConnector } from '@1inch/permit-signed-approvals-utils';
4
4
  export declare class PermitProviderConnector implements ProviderConnector {
5
5
  private provider;
6
6
  private walletSigner?;
@@ -1,3 +1,3 @@
1
1
  import { Contract, ContractInterface } from '@ethersproject/contracts';
2
- import type { JsonRpcProvider } from '@ethersproject/providers';
2
+ import { JsonRpcProvider } from '@ethersproject/providers';
3
3
  export declare function getContract(address: string, abi: ContractInterface, provider: JsonRpcProvider): Contract;
@@ -1,4 +1,4 @@
1
- import type { JsonRpcProvider } from '@ethersproject/providers';
1
+ import { JsonRpcProvider } from '@ethersproject/providers';
2
2
  export declare function getEip712Domain(tokenAddress: string, chainId: number, provider: JsonRpcProvider): Promise<Eip712Domain>;
3
3
  type Eip5267Return = {
4
4
  fields: string;
@@ -1,2 +1,2 @@
1
- import type { JsonRpcProvider } from '@ethersproject/providers';
1
+ import { JsonRpcProvider } from '@ethersproject/providers';
2
2
  export declare function getTokenName(tokenAddress: string, chainId: number, provider: JsonRpcProvider): Promise<string>;
@@ -1,2 +1,2 @@
1
- import type { JsonRpcProvider } from '@ethersproject/providers';
1
+ import { JsonRpcProvider } from '@ethersproject/providers';
2
2
  export declare function getTokenPermitVersion(tokenAddress: string, provider: JsonRpcProvider, index?: number): Promise<string>;
package/CHANGELOG.md DELETED
@@ -1,322 +0,0 @@
1
- # Changelog
2
-
3
- ## [3.0.1](https://github.com/cowprotocol/cowswap/compare/permit-utils-v3.0.0...permit-utils-v3.0.1) (2026-03-18)
4
-
5
-
6
- ### 🐛 Bug Fixes
7
-
8
- * update libs publising and bundling ([#7173](https://github.com/cowprotocol/cowswap/issues/7173)) ([e3bc5f1](https://github.com/cowprotocol/cowswap/commit/e3bc5f179124c11590a992789db43d912f8ee4a6))
9
-
10
-
11
- ### Dependencies
12
-
13
- * The following workspace dependencies were updated
14
- * dependencies
15
- * @cowprotocol/hook-dapp-lib bumped to 2.0.9
16
-
17
- ## [3.0.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v2.4.0...permit-utils-v3.0.0) (2026-03-11)
18
-
19
-
20
- ### ⚠ BREAKING CHANGES
21
-
22
- * Remove support for Lens network ([#7128](https://github.com/cowprotocol/cowswap/issues/7128))
23
-
24
- ### ✨ Features
25
-
26
- * remove support for Lens network ([#7128](https://github.com/cowprotocol/cowswap/issues/7128)) ([ffdd36d](https://github.com/cowprotocol/cowswap/commit/ffdd36db765eb1feb7fc675347de40b1e6df2bdd))
27
-
28
-
29
- ### 🔧 Miscellaneous
30
-
31
- * **hotfix:** 2026-03-10 ([8c831f7](https://github.com/cowprotocol/cowswap/commit/8c831f70685c058f460d7a0fabbf2941163b9fba))
32
-
33
-
34
- ### Dependencies
35
-
36
- * The following workspace dependencies were updated
37
- * dependencies
38
- * @cowprotocol/hook-dapp-lib bumped to 2.0.8
39
-
40
- ## [2.4.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v2.3.2...permit-utils-v2.4.0) (2026-03-10)
41
-
42
-
43
- ### ✨ Features
44
-
45
- * integrate non-evm sdk changes ([#7085](https://github.com/cowprotocol/cowswap/issues/7085)) ([674602e](https://github.com/cowprotocol/cowswap/commit/674602e19bd97197a98733da51cda186d256384e))
46
-
47
-
48
- ### 🐛 Bug Fixes
49
-
50
- * use correct amounts to sign instead of afterSlippage ([#7022](https://github.com/cowprotocol/cowswap/issues/7022)) ([b1020c4](https://github.com/cowprotocol/cowswap/commit/b1020c44615b49c5f05f0a6dcf0d21b96b628846))
51
-
52
-
53
- ### 🔧 Miscellaneous
54
-
55
- * **release:** 2026-03-04 ([5612b59](https://github.com/cowprotocol/cowswap/commit/5612b59d690f9081e62d9efc5ea80774428f0366))
56
-
57
-
58
- ### Dependencies
59
-
60
- * The following workspace dependencies were updated
61
- * dependencies
62
- * @cowprotocol/hook-dapp-lib bumped to 2.0.7
63
-
64
- ## [2.3.2](https://github.com/cowprotocol/cowswap/compare/permit-utils-v2.3.1...permit-utils-v2.3.2) (2026-02-25)
65
-
66
-
67
- ### 🔧 Miscellaneous
68
-
69
- * main -&gt; dev ([9c6611e](https://github.com/cowprotocol/cowswap/commit/9c6611e90a4b23e23f6aaadc513de3c6d7f3b562))
70
-
71
-
72
- ### Dependencies
73
-
74
- * The following workspace dependencies were updated
75
- * dependencies
76
- * @cowprotocol/hook-dapp-lib bumped to 2.0.6
77
-
78
- ## [2.3.1](https://github.com/cowprotocol/cowswap/compare/permit-utils-v2.3.0...permit-utils-v2.3.1) (2026-02-24)
79
-
80
-
81
- ### 🔧 Miscellaneous
82
-
83
- * merge main into dev 23 02 ([#7062](https://github.com/cowprotocol/cowswap/issues/7062)) ([ac48c9c](https://github.com/cowprotocol/cowswap/commit/ac48c9c83284c6228ba71392edc1c1e0483b53ff))
84
-
85
-
86
- ### Dependencies
87
-
88
- * The following workspace dependencies were updated
89
- * dependencies
90
- * @cowprotocol/hook-dapp-lib bumped to 2.0.5
91
-
92
- ## [2.3.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v2.2.0...permit-utils-v2.3.0) (2026-02-20)
93
-
94
-
95
- ### ✨ Features
96
-
97
- * **chains:** disable Lens and support deprecating networks ([#7028](https://github.com/cowprotocol/cowswap/issues/7028)) ([c12d6c2](https://github.com/cowprotocol/cowswap/commit/c12d6c21ad69258c587378add9da86d72ff755b2))
98
-
99
-
100
- ### Dependencies
101
-
102
- * The following workspace dependencies were updated
103
- * dependencies
104
- * @cowprotocol/hook-dapp-lib bumped to 2.0.4
105
-
106
- ## [2.2.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v2.1.0...permit-utils-v2.2.0) (2026-02-13)
107
-
108
-
109
- ### ✨ Features
110
-
111
- * replace toLowerCase on getAddressKey ([#6866](https://github.com/cowprotocol/cowswap/issues/6866)) ([a41b23c](https://github.com/cowprotocol/cowswap/commit/a41b23c4384cdbcde9534abcdde37441121381e7))
112
-
113
-
114
- ### Dependencies
115
-
116
- * The following workspace dependencies were updated
117
- * dependencies
118
- * @cowprotocol/hook-dapp-lib bumped to 2.0.3
119
-
120
- ## [2.1.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v2.0.1...permit-utils-v2.1.0) (2026-02-05)
121
-
122
-
123
- ### ✨ Features
124
-
125
- * **trade:** upload appData to IPFS before signing ([#6922](https://github.com/cowprotocol/cowswap/issues/6922)) ([cb94104](https://github.com/cowprotocol/cowswap/commit/cb9410470c549bd5453a7933a0a224ba706ec2c2))
126
-
127
-
128
- ### 🔧 Miscellaneous
129
-
130
- * update sdk ([a20814b](https://github.com/cowprotocol/cowswap/commit/a20814b7caf16f495cd0292d5f3469bc552e4d97))
131
-
132
-
133
- ### Dependencies
134
-
135
- * The following workspace dependencies were updated
136
- * dependencies
137
- * @cowprotocol/hook-dapp-lib bumped to 2.0.2
138
-
139
- ## [2.0.1](https://github.com/cowprotocol/cowswap/compare/permit-utils-v2.0.0...permit-utils-v2.0.1) (2026-02-02)
140
-
141
-
142
- ### Bug Fixes
143
-
144
- * **protocol-fee:** support decimals in protocol fee ([#6948](https://github.com/cowprotocol/cowswap/issues/6948)) ([a572bbe](https://github.com/cowprotocol/cowswap/commit/a572bbe2899b0a48b2c0891922442a4420f6c3ef))
145
-
146
-
147
- ### Dependencies
148
-
149
- * The following workspace dependencies were updated
150
- * dependencies
151
- * @cowprotocol/hook-dapp-lib bumped to 2.0.1
152
-
153
- ## [2.0.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v1.0.1...permit-utils-v2.0.0) (2026-01-28)
154
-
155
-
156
- ### ⚠ BREAKING CHANGES
157
-
158
- * migrate from yarn to pnpm ([#6847](https://github.com/cowprotocol/cowswap/issues/6847))
159
-
160
- ### Features
161
-
162
- * migrate from yarn to pnpm ([#6847](https://github.com/cowprotocol/cowswap/issues/6847)) ([1c5d115](https://github.com/cowprotocol/cowswap/commit/1c5d11516d0ddb997b0ebbb4eee4adcb491204a4))
163
-
164
-
165
- ### Bug Fixes
166
-
167
- * optimize bundle size ([#6775](https://github.com/cowprotocol/cowswap/issues/6775)) ([287a94e](https://github.com/cowprotocol/cowswap/commit/287a94e807b3672dbbd291768fb2ad80dbd288e5))
168
-
169
-
170
- ### Dependencies
171
-
172
- * The following workspace dependencies were updated
173
- * dependencies
174
- * @cowprotocol/hook-dapp-lib bumped to 2.0.0
175
-
176
- ## [1.0.1](https://github.com/cowprotocol/cowswap/compare/permit-utils-v1.0.0...permit-utils-v1.0.1) (2025-12-16)
177
-
178
-
179
- ### Bug Fixes
180
-
181
- * update schema reference for app data ([#6626](https://github.com/cowprotocol/cowswap/issues/6626)) ([93e78e6](https://github.com/cowprotocol/cowswap/commit/93e78e69454039fc89eeeb170f076a7957db604f))
182
-
183
- ## [1.0.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.10.0...permit-utils-v1.0.0) (2025-09-12)
184
-
185
-
186
- ### ⚠ BREAKING CHANGES
187
-
188
- * add cow-sdk v7 ([#6165](https://github.com/cowprotocol/cowswap/issues/6165))
189
-
190
- ### Features
191
-
192
- * add cow-sdk v7 ([#6165](https://github.com/cowprotocol/cowswap/issues/6165)) ([46d7afe](https://github.com/cowprotocol/cowswap/commit/46d7afeab94c172dbad975f39b25033abd966498))
193
-
194
- ## [0.10.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.9.0...permit-utils-v0.10.0) (2025-08-28)
195
-
196
-
197
- ### Features
198
-
199
- * **trade:** implement partial approve ([#6139](https://github.com/cowprotocol/cowswap/issues/6139)) ([6f9d6b0](https://github.com/cowprotocol/cowswap/commit/6f9d6b055323d25705ee88a533f71190944be6e2))
200
-
201
- ## [0.9.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.8.0...permit-utils-v0.9.0) (2025-08-21)
202
-
203
-
204
- ### Features
205
-
206
- * **new-networks:** lens and bnb ([#5992](https://github.com/cowprotocol/cowswap/issues/5992)) ([19ac060](https://github.com/cowprotocol/cowswap/commit/19ac060f94088e7a1f6a2a891ef11d2c1ded4525))
207
-
208
- ## [0.8.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.7.0...permit-utils-v0.8.0) (2025-08-12)
209
-
210
-
211
- ### Features
212
-
213
- * rename Permit hook dapp id ([#6138](https://github.com/cowprotocol/cowswap/issues/6138)) ([41b0b18](https://github.com/cowprotocol/cowswap/commit/41b0b182d4a673bb1799a699ea83029ee8c6d73b))
214
-
215
-
216
- ### Bug Fixes
217
-
218
- * **dev-deps-update:** bump the dev-deps group with 76 updates ([#5663](https://github.com/cowprotocol/cowswap/issues/5663)) ([552b349](https://github.com/cowprotocol/cowswap/commit/552b349f53762a01ccf008e9a2083248424cbafa))
219
- * **permit:** dai permit issues ([#5680](https://github.com/cowprotocol/cowswap/issues/5680)) ([a9e2da0](https://github.com/cowprotocol/cowswap/commit/a9e2da026cab2b0e001adc7fb0ebf11d1b028089))
220
- * **permit:** nonce not supported [#5653](https://github.com/cowprotocol/cowswap/issues/5653) ([#5672](https://github.com/cowprotocol/cowswap/issues/5672)) ([a526222](https://github.com/cowprotocol/cowswap/commit/a526222e115c28540d68addd2476070815975846))
221
- * **trade:** use salt for eip712 if it's needed ([#6086](https://github.com/cowprotocol/cowswap/issues/6086)) ([bb6f26c](https://github.com/cowprotocol/cowswap/commit/bb6f26c72781df087e018ec14d9fefcbc225baa3))
222
-
223
- ## [0.7.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.6.2...permit-utils-v0.7.0) (2025-08-07)
224
-
225
-
226
- ### Bug Fixes
227
-
228
- * **trade:** use salt for eip712 if it's needed ([#6086](https://github.com/cowprotocol/cowswap/issues/6086)) ([bb6f26c](https://github.com/cowprotocol/cowswap/commit/bb6f26c72781df087e018ec14d9fefcbc225baa3))
229
-
230
- ## [0.6.2](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.6.1...permit-utils-v0.6.2) (2025-05-16)
231
-
232
-
233
- ### Bug Fixes
234
-
235
- * **permit:** dai permit issues ([#5680](https://github.com/cowprotocol/cowswap/issues/5680)) ([a9e2da0](https://github.com/cowprotocol/cowswap/commit/a9e2da026cab2b0e001adc7fb0ebf11d1b028089))
236
-
237
- ## [0.6.1](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.6.0...permit-utils-v0.6.1) (2025-05-08)
238
-
239
-
240
- ### Bug Fixes
241
-
242
- * **permit:** nonce not supported [#5653](https://github.com/cowprotocol/cowswap/issues/5653) ([#5672](https://github.com/cowprotocol/cowswap/issues/5672)) ([a526222](https://github.com/cowprotocol/cowswap/commit/a526222e115c28540d68addd2476070815975846))
243
-
244
- ## [0.6.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.5.0...permit-utils-v0.6.0) (2025-01-09)
245
-
246
-
247
- ### Features
248
-
249
- * **swap:** partial approve ([#5256](https://github.com/cowprotocol/cowswap/issues/5256)) ([f080ffd](https://github.com/cowprotocol/cowswap/commit/f080ffdb098612e729f3a3f829410ce78697979f))
250
-
251
- ## [0.5.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.4.0...permit-utils-v0.5.0) (2024-12-03)
252
-
253
-
254
- ### Features
255
-
256
- * **base:** add base chain support ([#5044](https://github.com/cowprotocol/cowswap/issues/5044)) ([4cf0c91](https://github.com/cowprotocol/cowswap/commit/4cf0c91a300d6fcdc026364e74c45e5b2f729f2b))
257
-
258
- ## [0.4.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.3.1...permit-utils-v0.4.0) (2024-10-10)
259
-
260
-
261
- ### Features
262
-
263
- * **hooks-store:** use dappId from hook model to match with dapp ([#4938](https://github.com/cowprotocol/cowswap/issues/4938)) ([46699cb](https://github.com/cowprotocol/cowswap/commit/46699cbe6df02b0f7a3c6c380a04842e9f403a88))
264
-
265
- ## [0.3.1](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.3.0...permit-utils-v0.3.1) (2024-07-17)
266
-
267
-
268
- ### Bug Fixes
269
-
270
- * **permit:** filter out permit signer and rotate it ([#4719](https://github.com/cowprotocol/cowswap/issues/4719)) ([bfb1f29](https://github.com/cowprotocol/cowswap/commit/bfb1f295997ba8cf16744afce45dbd19eb8990c6))
271
-
272
- ## [0.3.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.2.1...permit-utils-v0.3.0) (2024-05-29)
273
-
274
-
275
- ### Features
276
-
277
- * **arbitrum:** add arbitrum_one ([#4407](https://github.com/cowprotocol/cowswap/issues/4407)) ([166e33f](https://github.com/cowprotocol/cowswap/commit/166e33f3c494972738b154cf844584dd78e12c7d))
278
-
279
- ## [0.2.1](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.2.0...permit-utils-v0.2.1) (2024-05-02)
280
-
281
-
282
- ### Bug Fixes
283
-
284
- * **sentry:** fix unhandled permit failure ([#4275](https://github.com/cowprotocol/cowswap/issues/4275)) ([a774983](https://github.com/cowprotocol/cowswap/commit/a7749831a4874536423d6f65b1e17bfae8571d27))
285
-
286
- ## [0.2.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.1.2...permit-utils-v0.2.0) (2024-04-11)
287
-
288
-
289
- ### Features
290
-
291
- * **widget:** customize images ([#4159](https://github.com/cowprotocol/cowswap/issues/4159)) ([0b14b2b](https://github.com/cowprotocol/cowswap/commit/0b14b2b19279a1688f75dc4f2954b8c267e57c40))
292
-
293
-
294
- ### Bug Fixes
295
-
296
- * **permit:** gnosis chain permits ([#4152](https://github.com/cowprotocol/cowswap/issues/4152)) ([26b703f](https://github.com/cowprotocol/cowswap/commit/26b703f2a45715fce0c4418d1f45fdceab2a716e))
297
-
298
- ## [0.1.2](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.1.1...permit-utils-v0.1.2) (2024-02-01)
299
-
300
-
301
- ### Bug Fixes
302
-
303
- * **permit-utils:** aave permit ([#3684](https://github.com/cowprotocol/cowswap/issues/3684)) ([68566d8](https://github.com/cowprotocol/cowswap/commit/68566d882f0c0bebde93b8228645a59d76c2120d))
304
-
305
- ## [0.1.1](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.1.0...permit-utils-v0.1.1) (2024-01-24)
306
-
307
-
308
- ### Bug Fixes
309
-
310
- * **permit:** replace permit signer account ([#3691](https://github.com/cowprotocol/cowswap/issues/3691)) ([3ae286f](https://github.com/cowprotocol/cowswap/commit/3ae286f7e0f239a2843ce2a30138d23eceb1577f))
311
-
312
- ## [0.1.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.0.2...permit-utils-v0.1.0) (2024-01-17)
313
-
314
-
315
- ### Features
316
-
317
- * **networks:** support Sepolia ([#3558](https://github.com/cowprotocol/cowswap/issues/3558)) ([ab8b179](https://github.com/cowprotocol/cowswap/commit/ab8b1794fb60da851f3fccdd861ebef4b18df30e))
318
-
319
-
320
- ### Bug Fixes
321
-
322
- * **permit:** replace permit signer used for quoting ([#3562](https://github.com/cowprotocol/cowswap/issues/3562)) ([907d908](https://github.com/cowprotocol/cowswap/commit/907d90825643a5ad5824ed4ff5d24a9227f96f71))
@@ -1,59 +0,0 @@
1
- [
2
- {
3
- "constant": true,
4
- "inputs": [],
5
- "name": "name",
6
- "outputs": [
7
- {
8
- "name": "",
9
- "type": "string"
10
- }
11
- ],
12
- "payable": false,
13
- "stateMutability": "view",
14
- "type": "function"
15
- },
16
- {
17
- "inputs": [],
18
- "name": "eip712Domain",
19
- "outputs": [
20
- {
21
- "internalType": "bytes1",
22
- "name": "fields",
23
- "type": "bytes1"
24
- },
25
- {
26
- "internalType": "string",
27
- "name": "name",
28
- "type": "string"
29
- },
30
- {
31
- "internalType": "string",
32
- "name": "version",
33
- "type": "string"
34
- },
35
- {
36
- "internalType": "uint256",
37
- "name": "chainId",
38
- "type": "uint256"
39
- },
40
- {
41
- "internalType": "address",
42
- "name": "verifyingContract",
43
- "type": "address"
44
- },
45
- {
46
- "internalType": "bytes32",
47
- "name": "salt",
48
- "type": "bytes32"
49
- },
50
- {
51
- "internalType": "uint256[]",
52
- "name": "extensions",
53
- "type": "uint256[]"
54
- }
55
- ],
56
- "stateMutability": "view",
57
- "type": "function"
58
- }
59
- ]
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VERSION_ABIS = void 0;
4
- /**
5
- * ABIs for fetching the version of different permit flavours
6
- */
7
- exports.VERSION_ABIS = [
8
- [
9
- {
10
- constant: true,
11
- inputs: [],
12
- name: 'version',
13
- outputs: [
14
- {
15
- name: '',
16
- type: 'string',
17
- },
18
- ],
19
- payable: false,
20
- stateMutability: 'view',
21
- type: 'function',
22
- },
23
- ],
24
- [
25
- {
26
- constant: true,
27
- inputs: [],
28
- name: 'ERC712_VERSION',
29
- outputs: [
30
- {
31
- name: '',
32
- type: 'string',
33
- },
34
- ],
35
- payable: false,
36
- stateMutability: 'view',
37
- type: 'function',
38
- },
39
- ],
40
- ];
41
- //# sourceMappingURL=versionAbis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versionAbis.js","sourceRoot":"","sources":["../../../../../libs/permit-utils/src/abi/versionAbis.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,YAAY,GAAG;IAC1B;QACE;YACE,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,OAAO,EAAE,KAAK;YACd,eAAe,EAAE,MAAM;YACvB,IAAI,EAAE,UAAU;SACjB;KACF;IACD;QACE;YACE,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,EAAE;oBACR,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,OAAO,EAAE,KAAK;YACd,eAAe,EAAE,MAAM;YACvB,IAAI,EAAE,UAAU;SACjB;KACF;CACF,CAAA"}
package/src/const.d.ts DELETED
@@ -1,24 +0,0 @@
1
- import { Wallet } from '@ethersproject/wallet';
2
- export declare const PERMIT_ACCOUNT: {
3
- address: import("viem/accounts").Address;
4
- nonceManager?: import("viem/accounts").NonceManager | undefined;
5
- sign: (parameters: {
6
- hash: import("viem").Hash;
7
- }) => Promise<import("viem").Hex>;
8
- signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
9
- signMessage: ({ message }: {
10
- message: import("viem").SignableMessage;
11
- }) => Promise<import("viem").Hex>;
12
- signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
13
- serializer?: serializer | undefined;
14
- } | undefined) => Promise<import("viem").Hex>;
15
- signTypedData: <const typedData extends import("viem").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<import("viem").Hex>;
16
- publicKey: import("viem").Hex;
17
- source: "privateKey";
18
- type: "local";
19
- };
20
- export declare const PERMIT_SIGNER: Wallet;
21
- export declare const DEFAULT_MIN_GAS_LIMIT = 55000;
22
- export declare const DEFAULT_PERMIT_GAS_LIMIT = "80000";
23
- export declare const DEFAULT_PERMIT_VALUE: bigint;
24
- export declare const DEFAULT_PERMIT_DURATION: number;
package/src/const.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_PERMIT_DURATION = exports.DEFAULT_PERMIT_VALUE = exports.DEFAULT_PERMIT_GAS_LIMIT = exports.DEFAULT_MIN_GAS_LIMIT = exports.PERMIT_SIGNER = exports.PERMIT_ACCOUNT = void 0;
4
- const tslib_1 = require("tslib");
5
- const constants_1 = require("@ethersproject/constants");
6
- const wallet_1 = require("@ethersproject/wallet");
7
- const ms_macro_1 = tslib_1.__importDefault(require("ms.macro"));
8
- const accounts_1 = require("viem/accounts");
9
- // PK used only for signing permit requests for quoting and identifying token 'permittability'
10
- // Do not use or try to send funds to it. Or do. It'll be your funds 🤷
11
- const PERMIT_PK = '0xa50dc0f7fc051309434deb3b1c71e927dbb711759231d8ecbf630c85d94a42fe'; // address: 0xDa5F16F4ab0410096a4403e7223988649fac38cF
12
- exports.PERMIT_ACCOUNT = (0, accounts_1.privateKeyToAccount)(PERMIT_PK);
13
- exports.PERMIT_SIGNER = new wallet_1.Wallet(PERMIT_PK);
14
- exports.DEFAULT_MIN_GAS_LIMIT = 55_000;
15
- exports.DEFAULT_PERMIT_GAS_LIMIT = '80000';
16
- exports.DEFAULT_PERMIT_VALUE = constants_1.MaxUint256.toBigInt();
17
- exports.DEFAULT_PERMIT_DURATION = (0, ms_macro_1.default) `5 years`;
18
- //# sourceMappingURL=const.js.map
package/src/const.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../libs/permit-utils/src/const.ts"],"names":[],"mappings":";;;;AAAA,wDAAqD;AACrD,kDAA8C;AAE9C,gEAAyB;AACzB,4CAAmD;AAEnD,8FAA8F;AAC9F,uEAAuE;AACvE,MAAM,SAAS,GAAG,oEAAoE,CAAA,CAAC,sDAAsD;AAEhI,QAAA,cAAc,GAAG,IAAA,8BAAmB,EAAC,SAAS,CAAC,CAAA;AAC/C,QAAA,aAAa,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,CAAA;AAErC,QAAA,qBAAqB,GAAG,MAAM,CAAA;AAE9B,QAAA,wBAAwB,GAAG,OAAO,CAAA;AAElC,QAAA,oBAAoB,GAAG,sBAAU,CAAC,QAAQ,EAAE,CAAA;AAE5C,QAAA,uBAAuB,GAAG,IAAA,kBAAE,EAAA,SAAS,CAAA"}
@@ -1,68 +0,0 @@
1
- "use strict";
2
- /**
3
- * @1inch/permit-signed-approvals-utils has a lot of extra variables and increases bundle size.
4
- *
5
- * At the same time it's repo is archived.
6
- *
7
- * Therefore we just copied needed constants, and when it's not possible, we should use import(...)
8
- *
9
- * You also can use `import type ... from '@1inch/permit-signed-approvals-utils'`
10
- */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DAI_LIKE_PERMIT_TYPEHASH = exports.DAI_PERMIT_SELECTOR = exports.EIP_2612_PERMIT_SELECTOR = exports.DAI_EIP_2612_PERMIT_ABI = void 0;
13
- exports.DAI_EIP_2612_PERMIT_ABI = [
14
- {
15
- constant: false,
16
- inputs: [
17
- {
18
- internalType: 'address',
19
- name: 'holder',
20
- type: 'address',
21
- },
22
- {
23
- internalType: 'address',
24
- name: 'spender',
25
- type: 'address',
26
- },
27
- {
28
- internalType: 'uint256',
29
- name: 'nonce',
30
- type: 'uint256',
31
- },
32
- {
33
- internalType: 'uint256',
34
- name: 'expiry',
35
- type: 'uint256',
36
- },
37
- {
38
- internalType: 'bool',
39
- name: 'allowed',
40
- type: 'bool',
41
- },
42
- {
43
- internalType: 'uint8',
44
- name: 'v',
45
- type: 'uint8',
46
- },
47
- {
48
- internalType: 'bytes32',
49
- name: 'r',
50
- type: 'bytes32',
51
- },
52
- {
53
- internalType: 'bytes32',
54
- name: 's',
55
- type: 'bytes32',
56
- },
57
- ],
58
- name: 'permit',
59
- outputs: [],
60
- payable: false,
61
- stateMutability: 'nonpayable',
62
- type: 'function',
63
- },
64
- ];
65
- exports.EIP_2612_PERMIT_SELECTOR = '0xd505accf';
66
- exports.DAI_PERMIT_SELECTOR = '0x8fcbaf0c';
67
- exports.DAI_LIKE_PERMIT_TYPEHASH = '0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb';
68
- //# sourceMappingURL=1inchPermitUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1inchPermitUtils.js","sourceRoot":"","sources":["../../../../../libs/permit-utils/src/consts/1inchPermitUtils.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEU,QAAA,uBAAuB,GAAG;IACrC;QACE,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,MAAM;gBACpB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,MAAM;aACb;YACD;gBACE,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,OAAO;aACd;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;CACF,CAAA;AAEY,QAAA,wBAAwB,GAAG,YAAY,CAAA;AAEvC,QAAA,mBAAmB,GAAG,YAAY,CAAA;AAElC,QAAA,wBAAwB,GAAG,oEAAoE,CAAA"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- /**
3
- * @1inch/permit-signed-approvals-utils has a lot of extra variables and increases bundle size, we should import in dynamically.
4
- *
5
- * It uses esm, but dymaic import breaks tree shaking, so we re-export here only used variables (642kb -> 256kb).
6
- *
7
- * You also can use `import type ... from '@1inch/permit-signed-approvals-utils'`
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.Eip2612PermitUtils = void 0;
11
- // eslint-disable-next-line @typescript-eslint/no-restricted-imports
12
- var permit_signed_approvals_utils_1 = require("@1inch/permit-signed-approvals-utils");
13
- Object.defineProperty(exports, "Eip2612PermitUtils", { enumerable: true, get: function () { return permit_signed_approvals_utils_1.Eip2612PermitUtils; } });
14
- //# sourceMappingURL=1inchPermitUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1inchPermitUtils.js","sourceRoot":"","sources":["../../../../../libs/permit-utils/src/imports/1inchPermitUtils.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,oEAAoE;AACpE,sFAAyE;AAAhE,mIAAA,kBAAkB,OAAA"}
package/src/index.js DELETED
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.oneInchPermitUtilsConsts = exports.isSupportedPermitInfo = exports.getTokenPermitInfo = exports.getPermitUtilsInstance = exports.generatePermitHook = exports.checkIsCallDataAValidPermit = exports.PERMIT_SIGNER = exports.PERMIT_ACCOUNT = exports.DEFAULT_MIN_GAS_LIMIT = void 0;
4
- const tslib_1 = require("tslib");
5
- var const_1 = require("./const");
6
- Object.defineProperty(exports, "DEFAULT_MIN_GAS_LIMIT", { enumerable: true, get: function () { return const_1.DEFAULT_MIN_GAS_LIMIT; } });
7
- Object.defineProperty(exports, "PERMIT_ACCOUNT", { enumerable: true, get: function () { return const_1.PERMIT_ACCOUNT; } });
8
- Object.defineProperty(exports, "PERMIT_SIGNER", { enumerable: true, get: function () { return const_1.PERMIT_SIGNER; } });
9
- var checkIsCallDataAValidPermit_1 = require("./lib/checkIsCallDataAValidPermit");
10
- Object.defineProperty(exports, "checkIsCallDataAValidPermit", { enumerable: true, get: function () { return checkIsCallDataAValidPermit_1.checkIsCallDataAValidPermit; } });
11
- var generatePermitHook_1 = require("./lib/generatePermitHook");
12
- Object.defineProperty(exports, "generatePermitHook", { enumerable: true, get: function () { return generatePermitHook_1.generatePermitHook; } });
13
- var getPermitUtilsInstance_1 = require("./lib/getPermitUtilsInstance");
14
- Object.defineProperty(exports, "getPermitUtilsInstance", { enumerable: true, get: function () { return getPermitUtilsInstance_1.getPermitUtilsInstance; } });
15
- var getTokenPermitInfo_1 = require("./lib/getTokenPermitInfo");
16
- Object.defineProperty(exports, "getTokenPermitInfo", { enumerable: true, get: function () { return getTokenPermitInfo_1.getTokenPermitInfo; } });
17
- var isSupportedPermitInfo_1 = require("./utils/isSupportedPermitInfo");
18
- Object.defineProperty(exports, "isSupportedPermitInfo", { enumerable: true, get: function () { return isSupportedPermitInfo_1.isSupportedPermitInfo; } });
19
- exports.oneInchPermitUtilsConsts = tslib_1.__importStar(require("./consts/1inchPermitUtils"));
20
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/permit-utils/src/index.ts"],"names":[],"mappings":";;;;AAAA,iCAA8E;AAArE,8GAAA,qBAAqB,OAAA;AAAE,uGAAA,cAAc,OAAA;AAAE,sGAAA,aAAa,OAAA;AAE7D,iFAA+E;AAAtE,0IAAA,2BAA2B,OAAA;AACpC,+DAA6D;AAApD,wHAAA,kBAAkB,OAAA;AAC3B,uEAAqE;AAA5D,gIAAA,sBAAsB,OAAA;AAC/B,+DAA6D;AAApD,wHAAA,kBAAkB,OAAA;AAC3B,uEAAqE;AAA5D,8HAAA,qBAAqB,OAAA;AAE9B,8FAAqE"}