@cancore/contracts 0.1.0 → 0.2.0-rc.13

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/README.md +522 -10
  2. package/dist/abi.d.ts +6598 -1675
  3. package/dist/abi.js +1 -1
  4. package/dist/chunk-2ELHDMZ7.js +9911 -0
  5. package/dist/chunk-2ELHDMZ7.js.map +1 -0
  6. package/dist/{chunk-CIBYXHSX.js → chunk-IAPV7XWJ.js} +2 -2
  7. package/dist/chunk-IAPV7XWJ.js.map +1 -0
  8. package/dist/index.d.ts +1774 -29
  9. package/dist/index.js +3692 -21
  10. package/dist/index.js.map +1 -1
  11. package/dist/networks.d.ts +2 -2
  12. package/dist/networks.js +1 -1
  13. package/package.json +10 -8
  14. package/spec/abi/AttestorSet.json +476 -0
  15. package/spec/abi/CNRX.json +1294 -0
  16. package/spec/abi/CNRXStaking.json +510 -0
  17. package/spec/abi/CancoreRouter.json +2666 -0
  18. package/spec/abi/FeeVault.json +604 -0
  19. package/spec/abi/HTLC.json +717 -0
  20. package/spec/abi/IAttribute.json +110 -0
  21. package/spec/abi/IBurnMintERC20.json +252 -0
  22. package/spec/abi/ICancoreRouter.json +1361 -0
  23. package/spec/abi/IFormula.json +28 -0
  24. package/spec/abi/IHTLC.json +382 -0
  25. package/spec/abi/IPayment.json +40 -0
  26. package/spec/abi/IPermit2.json +150 -0
  27. package/spec/abi/IResolver.json +55 -0
  28. package/spec/abi/IStep.json +30 -0
  29. package/spec/abi/IVariableRole.json +141 -0
  30. package/spec/abi/MultiBalanceChecker.json +34 -0
  31. package/spec/abi/PointsClaim.json +791 -0
  32. package/spec/constants.json +66 -0
  33. package/spec/protocol/asyncapi.json +1587 -0
  34. package/spec/protocol/messages.schema.json +906 -0
  35. package/spec/protocol/records.schema.json +94 -0
  36. package/spec/protocol/rest.schema.json +193 -0
  37. package/spec/protocol/typed-data/CantonTicketReceipt.json +77 -0
  38. package/spec/protocol/typed-data/FillerAuth.json +58 -0
  39. package/spec/protocol/typed-data/FillerKeyRegistration.json +69 -0
  40. package/spec/protocol/typed-data/FillerMessage.json +115 -0
  41. package/spec/protocol/typed-data/FillerQuote.json +75 -0
  42. package/spec/protocol/typed-data/GatewayMessage.json +95 -0
  43. package/spec/protocol/typed-data/StakeBinding.json +75 -0
  44. package/spec/protocol/typed-data/TicketIntent.json +113 -0
  45. package/spec/protocol/typed-data/TicketReceipt.json +51 -0
  46. package/spec/protocol/vectors/draw.json +61 -0
  47. package/spec/protocol/vectors/jcs.json +59 -0
  48. package/spec/protocol/vectors/messages.json +743 -0
  49. package/spec/protocol/vectors/records.json +81 -0
  50. package/spec/protocol/vectors/settle-attestations.json +544 -0
  51. package/spec/typed-data/FillProof.json +227 -0
  52. package/spec/typed-data/FillTicket.json +116 -0
  53. package/spec/typed-data/Order.json +169 -0
  54. package/spec/typed-data/Quote.json +79 -0
  55. package/spec/vectors/canton-destination.json +60 -0
  56. package/spec/vectors/canton-order.json +70 -0
  57. package/spec/vectors/evm-order.json +50 -0
  58. package/spec/vectors/fee-split.json +179 -0
  59. package/spec/vectors/permit-witness.json +150 -0
  60. package/dist/chunk-CIBYXHSX.js.map +0 -1
  61. package/dist/chunk-ZSX67S72.js +0 -3423
  62. package/dist/chunk-ZSX67S72.js.map +0 -1
@@ -8,8 +8,8 @@
8
8
  * branches on `kind` instead of on the id keeps working when a chain is added.
9
9
  *
10
10
  * Contract addresses live next door in `DEPLOYMENTS`, keyed by environment —
11
- * dev, testnet and mainnet each have their own HTLC — and `BYTECODE_HASHES`
12
- * (from `.`) is how a deployment at any of those addresses is verified.
11
+ * dev, testnet and mainnet each have their own HTLC. `BUILD_HASHES` (from `.`)
12
+ * pins the build of a release, not what an address runs (see `DEPLOYMENTS`).
13
13
  */
14
14
  type NetworkKind = 'evm' | 'tron' | 'canton';
15
15
  interface Network {
package/dist/networks.js CHANGED
@@ -1,3 +1,3 @@
1
- export { NETWORKS, NETWORK_ALIASES, networkByChainId, networkKindOf, networkOf } from './chunk-CIBYXHSX.js';
1
+ export { NETWORKS, NETWORK_ALIASES, networkByChainId, networkKindOf, networkOf } from './chunk-IAPV7XWJ.js';
2
2
  //# sourceMappingURL=networks.js.map
3
3
  //# sourceMappingURL=networks.js.map
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@cancore/contracts",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-rc.13",
4
4
  "type": "module",
5
- "description": "The Cancore EVM contracts as data: ABIs of the deployed HTLC, FeeVault and CNRX contracts, their custom-error selectors, the EIP-712 FeeClaim voucher, the network registry. No runtime code, no dependencies.",
5
+ "description": "The Cancore EVM contracts as data: the ABIs of the Cancore EVM contracts and their custom-error selectors, the EIP-712 FeeClaim voucher and FillProof, the network registry; and the filler protocol v1: EIP-712 types and domains, hashing helpers, JSON Schemas, AsyncAPI, golden vectors.",
6
6
  "exports": {
7
7
  ".": {
8
8
  "types": "./dist/index.d.ts",
@@ -18,7 +18,8 @@
18
18
  "types": "./dist/networks.d.ts",
19
19
  "import": "./dist/networks.js",
20
20
  "default": "./dist/networks.js"
21
- }
21
+ },
22
+ "./spec/*": "./spec/*"
22
23
  },
23
24
  "main": "./dist/index.js",
24
25
  "types": "./dist/index.d.ts",
@@ -33,17 +34,18 @@
33
34
  "bugs": {
34
35
  "url": "https://github.com/Cancore-io/sdk/issues"
35
36
  },
36
- "keywords": ["canton", "cancore", "abi", "htlc", "evm", "eip-712", "contracts"],
37
- "files": ["dist", "README.md", "LICENSE"],
37
+ "keywords": ["canton", "cancore", "abi", "htlc", "evm", "eip-712", "contracts", "filler-protocol", "asyncapi", "json-schema"],
38
+ "files": ["dist", "spec", "README.md", "LICENSE"],
38
39
  "publishConfig": { "access": "public" },
39
40
  "engines": { "node": ">=20" },
40
41
  "scripts": {
41
42
  "build": "tsup",
42
43
  "prepack": "tsup --silent",
43
44
  "prepublishOnly": "npm run build",
44
- "sync": "node scripts/sync.mjs"
45
+ "sync": "node scripts/sync.mjs && node scripts/sync-typed-data.mjs",
46
+ "vectors": "node scripts/gen-protocol-vectors.mjs && node scripts/gen-settle-attestations.mjs && node scripts/gen-protocol-docs.mjs && node scripts/gen-router-vectors.mjs"
45
47
  },
46
- "devDependencies": {
47
- "@noble/hashes": "^1.3.2"
48
+ "dependencies": {
49
+ "@noble/hashes": "^1.8.0"
48
50
  }
49
51
  }
@@ -0,0 +1,476 @@
1
+ [
2
+ {
3
+ "inputs": [],
4
+ "name": "AttestorRevoked",
5
+ "type": "error"
6
+ },
7
+ {
8
+ "inputs": [],
9
+ "name": "AttestorSetNotActive",
10
+ "type": "error"
11
+ },
12
+ {
13
+ "inputs": [],
14
+ "name": "EmptySet",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [],
19
+ "name": "InsufficientRedundancy",
20
+ "type": "error"
21
+ },
22
+ {
23
+ "inputs": [],
24
+ "name": "InsufficientSignatures",
25
+ "type": "error"
26
+ },
27
+ {
28
+ "inputs": [],
29
+ "name": "InvalidThreshold",
30
+ "type": "error"
31
+ },
32
+ {
33
+ "inputs": [],
34
+ "name": "NoPendingProposal",
35
+ "type": "error"
36
+ },
37
+ {
38
+ "inputs": [],
39
+ "name": "NotAttestor",
40
+ "type": "error"
41
+ },
42
+ {
43
+ "inputs": [
44
+ {
45
+ "internalType": "address",
46
+ "name": "owner",
47
+ "type": "address"
48
+ }
49
+ ],
50
+ "name": "OwnableInvalidOwner",
51
+ "type": "error"
52
+ },
53
+ {
54
+ "inputs": [
55
+ {
56
+ "internalType": "address",
57
+ "name": "account",
58
+ "type": "address"
59
+ }
60
+ ],
61
+ "name": "OwnableUnauthorizedAccount",
62
+ "type": "error"
63
+ },
64
+ {
65
+ "inputs": [],
66
+ "name": "ProposalPending",
67
+ "type": "error"
68
+ },
69
+ {
70
+ "inputs": [],
71
+ "name": "ThresholdBelowMinimum",
72
+ "type": "error"
73
+ },
74
+ {
75
+ "inputs": [],
76
+ "name": "UnsortedMembers",
77
+ "type": "error"
78
+ },
79
+ {
80
+ "inputs": [],
81
+ "name": "UnsortedSigners",
82
+ "type": "error"
83
+ },
84
+ {
85
+ "anonymous": false,
86
+ "inputs": [
87
+ {
88
+ "indexed": true,
89
+ "internalType": "address",
90
+ "name": "attestor",
91
+ "type": "address"
92
+ }
93
+ ],
94
+ "name": "AttestorRevocation",
95
+ "type": "event"
96
+ },
97
+ {
98
+ "anonymous": false,
99
+ "inputs": [
100
+ {
101
+ "indexed": true,
102
+ "internalType": "uint32",
103
+ "name": "setId",
104
+ "type": "uint32"
105
+ }
106
+ ],
107
+ "name": "AttestorSetCancelled",
108
+ "type": "event"
109
+ },
110
+ {
111
+ "anonymous": false,
112
+ "inputs": [
113
+ {
114
+ "indexed": true,
115
+ "internalType": "uint32",
116
+ "name": "setId",
117
+ "type": "uint32"
118
+ },
119
+ {
120
+ "indexed": false,
121
+ "internalType": "address[]",
122
+ "name": "members",
123
+ "type": "address[]"
124
+ },
125
+ {
126
+ "indexed": false,
127
+ "internalType": "uint8",
128
+ "name": "threshold",
129
+ "type": "uint8"
130
+ },
131
+ {
132
+ "indexed": false,
133
+ "internalType": "uint64",
134
+ "name": "activeFrom",
135
+ "type": "uint64"
136
+ }
137
+ ],
138
+ "name": "AttestorSetProposed",
139
+ "type": "event"
140
+ },
141
+ {
142
+ "anonymous": false,
143
+ "inputs": [
144
+ {
145
+ "indexed": true,
146
+ "internalType": "uint32",
147
+ "name": "setId",
148
+ "type": "uint32"
149
+ },
150
+ {
151
+ "indexed": false,
152
+ "internalType": "uint64",
153
+ "name": "retiredAt",
154
+ "type": "uint64"
155
+ }
156
+ ],
157
+ "name": "AttestorSetRetired",
158
+ "type": "event"
159
+ },
160
+ {
161
+ "anonymous": false,
162
+ "inputs": [
163
+ {
164
+ "indexed": true,
165
+ "internalType": "address",
166
+ "name": "previousOwner",
167
+ "type": "address"
168
+ },
169
+ {
170
+ "indexed": true,
171
+ "internalType": "address",
172
+ "name": "newOwner",
173
+ "type": "address"
174
+ }
175
+ ],
176
+ "name": "OwnershipTransferStarted",
177
+ "type": "event"
178
+ },
179
+ {
180
+ "anonymous": false,
181
+ "inputs": [
182
+ {
183
+ "indexed": true,
184
+ "internalType": "address",
185
+ "name": "previousOwner",
186
+ "type": "address"
187
+ },
188
+ {
189
+ "indexed": true,
190
+ "internalType": "address",
191
+ "name": "newOwner",
192
+ "type": "address"
193
+ }
194
+ ],
195
+ "name": "OwnershipTransferred",
196
+ "type": "event"
197
+ },
198
+ {
199
+ "inputs": [],
200
+ "name": "GRACE",
201
+ "outputs": [
202
+ {
203
+ "internalType": "uint64",
204
+ "name": "",
205
+ "type": "uint64"
206
+ }
207
+ ],
208
+ "stateMutability": "view",
209
+ "type": "function"
210
+ },
211
+ {
212
+ "inputs": [],
213
+ "name": "MAX_FILL_TTL",
214
+ "outputs": [
215
+ {
216
+ "internalType": "uint64",
217
+ "name": "",
218
+ "type": "uint64"
219
+ }
220
+ ],
221
+ "stateMutability": "view",
222
+ "type": "function"
223
+ },
224
+ {
225
+ "inputs": [],
226
+ "name": "MAX_PROOF_WINDOW",
227
+ "outputs": [
228
+ {
229
+ "internalType": "uint64",
230
+ "name": "",
231
+ "type": "uint64"
232
+ }
233
+ ],
234
+ "stateMutability": "view",
235
+ "type": "function"
236
+ },
237
+ {
238
+ "inputs": [],
239
+ "name": "MAX_SIG_TTL",
240
+ "outputs": [
241
+ {
242
+ "internalType": "uint64",
243
+ "name": "",
244
+ "type": "uint64"
245
+ }
246
+ ],
247
+ "stateMutability": "view",
248
+ "type": "function"
249
+ },
250
+ {
251
+ "inputs": [],
252
+ "name": "MIN_THRESHOLD",
253
+ "outputs": [
254
+ {
255
+ "internalType": "uint8",
256
+ "name": "",
257
+ "type": "uint8"
258
+ }
259
+ ],
260
+ "stateMutability": "view",
261
+ "type": "function"
262
+ },
263
+ {
264
+ "inputs": [],
265
+ "name": "SET_DELAY",
266
+ "outputs": [
267
+ {
268
+ "internalType": "uint64",
269
+ "name": "",
270
+ "type": "uint64"
271
+ }
272
+ ],
273
+ "stateMutability": "view",
274
+ "type": "function"
275
+ },
276
+ {
277
+ "inputs": [],
278
+ "name": "acceptOwnership",
279
+ "outputs": [],
280
+ "stateMutability": "nonpayable",
281
+ "type": "function"
282
+ },
283
+ {
284
+ "inputs": [],
285
+ "name": "cancelProposal",
286
+ "outputs": [],
287
+ "stateMutability": "nonpayable",
288
+ "type": "function"
289
+ },
290
+ {
291
+ "inputs": [],
292
+ "name": "currentSetId",
293
+ "outputs": [
294
+ {
295
+ "internalType": "uint32",
296
+ "name": "",
297
+ "type": "uint32"
298
+ }
299
+ ],
300
+ "stateMutability": "view",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "inputs": [
305
+ {
306
+ "internalType": "uint32",
307
+ "name": "setId",
308
+ "type": "uint32"
309
+ }
310
+ ],
311
+ "name": "getAttestorSet",
312
+ "outputs": [
313
+ {
314
+ "internalType": "address[]",
315
+ "name": "members",
316
+ "type": "address[]"
317
+ },
318
+ {
319
+ "internalType": "uint8",
320
+ "name": "threshold",
321
+ "type": "uint8"
322
+ },
323
+ {
324
+ "internalType": "uint64",
325
+ "name": "activeFrom",
326
+ "type": "uint64"
327
+ },
328
+ {
329
+ "internalType": "uint64",
330
+ "name": "retiredAt",
331
+ "type": "uint64"
332
+ }
333
+ ],
334
+ "stateMutability": "view",
335
+ "type": "function"
336
+ },
337
+ {
338
+ "inputs": [
339
+ {
340
+ "internalType": "uint32",
341
+ "name": "",
342
+ "type": "uint32"
343
+ },
344
+ {
345
+ "internalType": "address",
346
+ "name": "",
347
+ "type": "address"
348
+ }
349
+ ],
350
+ "name": "isMember",
351
+ "outputs": [
352
+ {
353
+ "internalType": "bool",
354
+ "name": "",
355
+ "type": "bool"
356
+ }
357
+ ],
358
+ "stateMutability": "view",
359
+ "type": "function"
360
+ },
361
+ {
362
+ "inputs": [
363
+ {
364
+ "internalType": "uint32",
365
+ "name": "setId",
366
+ "type": "uint32"
367
+ }
368
+ ],
369
+ "name": "isSetActive",
370
+ "outputs": [
371
+ {
372
+ "internalType": "bool",
373
+ "name": "",
374
+ "type": "bool"
375
+ }
376
+ ],
377
+ "stateMutability": "view",
378
+ "type": "function"
379
+ },
380
+ {
381
+ "inputs": [],
382
+ "name": "owner",
383
+ "outputs": [
384
+ {
385
+ "internalType": "address",
386
+ "name": "",
387
+ "type": "address"
388
+ }
389
+ ],
390
+ "stateMutability": "view",
391
+ "type": "function"
392
+ },
393
+ {
394
+ "inputs": [],
395
+ "name": "pendingOwner",
396
+ "outputs": [
397
+ {
398
+ "internalType": "address",
399
+ "name": "",
400
+ "type": "address"
401
+ }
402
+ ],
403
+ "stateMutability": "view",
404
+ "type": "function"
405
+ },
406
+ {
407
+ "inputs": [
408
+ {
409
+ "internalType": "address[]",
410
+ "name": "members",
411
+ "type": "address[]"
412
+ },
413
+ {
414
+ "internalType": "uint8",
415
+ "name": "threshold",
416
+ "type": "uint8"
417
+ }
418
+ ],
419
+ "name": "proposeAttestorSet",
420
+ "outputs": [],
421
+ "stateMutability": "nonpayable",
422
+ "type": "function"
423
+ },
424
+ {
425
+ "inputs": [],
426
+ "name": "renounceOwnership",
427
+ "outputs": [],
428
+ "stateMutability": "nonpayable",
429
+ "type": "function"
430
+ },
431
+ {
432
+ "inputs": [
433
+ {
434
+ "internalType": "address",
435
+ "name": "attestor",
436
+ "type": "address"
437
+ }
438
+ ],
439
+ "name": "revokeAttestor",
440
+ "outputs": [],
441
+ "stateMutability": "nonpayable",
442
+ "type": "function"
443
+ },
444
+ {
445
+ "inputs": [
446
+ {
447
+ "internalType": "address",
448
+ "name": "",
449
+ "type": "address"
450
+ }
451
+ ],
452
+ "name": "revokedAttestors",
453
+ "outputs": [
454
+ {
455
+ "internalType": "bool",
456
+ "name": "",
457
+ "type": "bool"
458
+ }
459
+ ],
460
+ "stateMutability": "view",
461
+ "type": "function"
462
+ },
463
+ {
464
+ "inputs": [
465
+ {
466
+ "internalType": "address",
467
+ "name": "newOwner",
468
+ "type": "address"
469
+ }
470
+ ],
471
+ "name": "transferOwnership",
472
+ "outputs": [],
473
+ "stateMutability": "nonpayable",
474
+ "type": "function"
475
+ }
476
+ ]