@zoralabs/protocol-deployments 0.3.5-COMMENTS.2 → 0.3.5

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 (94) hide show
  1. package/.turbo/turbo-build.log +48 -48
  2. package/CHANGELOG.md +2 -18
  3. package/dist/{_esm-KB2T7G46.js → _esm-JXHAY2EM.js} +192 -85
  4. package/dist/_esm-JXHAY2EM.js.map +1 -0
  5. package/{package/dist/ccip-42FQPB7J.js → dist/ccip-E7SRWW2U.js} +3 -3
  6. package/{package/dist/chunk-YMRS2KON.js → dist/chunk-BKKE6NTH.js} +332 -453
  7. package/dist/chunk-BKKE6NTH.js.map +1 -0
  8. package/dist/{chunk-5JV63AHR.js → chunk-FJ2PMLO3.js} +8 -5
  9. package/dist/chunk-FJ2PMLO3.js.map +1 -0
  10. package/dist/generated/wagmi.d.ts +131 -3118
  11. package/dist/generated/wagmi.d.ts.map +1 -1
  12. package/dist/index.cjs +285 -1507
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.js +3 -1152
  15. package/dist/index.js.map +1 -1
  16. package/{package/package/dist/secp256k1-5CEPNAX3.js → dist/secp256k1-NJATWSDZ.js} +402 -251
  17. package/dist/secp256k1-NJATWSDZ.js.map +1 -0
  18. package/dist/typedData.d.ts +1 -137
  19. package/dist/typedData.d.ts.map +1 -1
  20. package/dist/types.d.ts +0 -21
  21. package/dist/types.d.ts.map +1 -1
  22. package/package.json +4 -5
  23. package/src/generated/wagmi.ts +130 -1120
  24. package/src/typedData.ts +0 -133
  25. package/src/types.ts +0 -42
  26. package/dist/_esm-KB2T7G46.js.map +0 -1
  27. package/dist/ccip-TLVKUNHE.js +0 -15
  28. package/dist/chunk-5JV63AHR.js.map +0 -1
  29. package/dist/chunk-IB365BT5.js +0 -3957
  30. package/dist/chunk-IB365BT5.js.map +0 -1
  31. package/dist/secp256k1-5CEPNAX3.js +0 -2244
  32. package/dist/secp256k1-5CEPNAX3.js.map +0 -1
  33. package/json/1155.json +0 -212
  34. package/json/mints.json +0 -46
  35. package/package/.turbo/turbo-build.log +0 -48
  36. package/package/dist/_esm-KB2T7G46.js +0 -3923
  37. package/package/dist/_esm-KB2T7G46.js.map +0 -1
  38. package/package/dist/ccip-42FQPB7J.js.map +0 -1
  39. package/package/dist/chunk-3EJPJMEH.js +0 -44
  40. package/package/dist/chunk-3EJPJMEH.js.map +0 -1
  41. package/package/dist/chunk-5JV63AHR.js +0 -129
  42. package/package/dist/chunk-5JV63AHR.js.map +0 -1
  43. package/package/dist/chunk-YMRS2KON.js.map +0 -1
  44. package/package/dist/encoding.d.ts +0 -15
  45. package/package/dist/encoding.d.ts.map +0 -1
  46. package/package/dist/generated/1155.d.ts +0 -232
  47. package/package/dist/generated/1155.d.ts.map +0 -1
  48. package/package/dist/generated/sparks.d.ts +0 -85
  49. package/package/dist/generated/sparks.d.ts.map +0 -1
  50. package/package/dist/generated/wagmi.d.ts +0 -27548
  51. package/package/dist/generated/wagmi.d.ts.map +0 -1
  52. package/package/dist/index.cjs +0 -12957
  53. package/package/dist/index.cjs.map +0 -1
  54. package/package/dist/index.d.ts +0 -7
  55. package/package/dist/index.d.ts.map +0 -1
  56. package/package/dist/index.js +0 -11268
  57. package/package/dist/index.js.map +0 -1
  58. package/package/dist/secp256k1-5CEPNAX3.js +0 -2244
  59. package/package/dist/secp256k1-5CEPNAX3.js.map +0 -1
  60. package/package/dist/typedData.d.ts +0 -234
  61. package/package/dist/typedData.d.ts.map +0 -1
  62. package/package/dist/types.d.ts +0 -45
  63. package/package/dist/types.d.ts.map +0 -1
  64. package/package/package/.turbo/turbo-build.log +0 -48
  65. package/package/package/dist/_esm-KB2T7G46.js +0 -3923
  66. package/package/package/dist/_esm-KB2T7G46.js.map +0 -1
  67. package/package/package/dist/ccip-42FQPB7J.js +0 -15
  68. package/package/package/dist/ccip-42FQPB7J.js.map +0 -1
  69. package/package/package/dist/chunk-3EJPJMEH.js +0 -44
  70. package/package/package/dist/chunk-3EJPJMEH.js.map +0 -1
  71. package/package/package/dist/chunk-5JV63AHR.js +0 -129
  72. package/package/package/dist/chunk-5JV63AHR.js.map +0 -1
  73. package/package/package/dist/chunk-YMRS2KON.js +0 -3956
  74. package/package/package/dist/chunk-YMRS2KON.js.map +0 -1
  75. package/package/package/dist/encoding.d.ts +0 -15
  76. package/package/package/dist/encoding.d.ts.map +0 -1
  77. package/package/package/dist/generated/1155.d.ts +0 -232
  78. package/package/package/dist/generated/1155.d.ts.map +0 -1
  79. package/package/package/dist/generated/sparks.d.ts +0 -85
  80. package/package/package/dist/generated/sparks.d.ts.map +0 -1
  81. package/package/package/dist/generated/wagmi.d.ts +0 -27548
  82. package/package/package/dist/generated/wagmi.d.ts.map +0 -1
  83. package/package/package/dist/index.cjs +0 -12957
  84. package/package/package/dist/index.cjs.map +0 -1
  85. package/package/package/dist/index.d.ts +0 -7
  86. package/package/package/dist/index.d.ts.map +0 -1
  87. package/package/package/dist/index.js +0 -11268
  88. package/package/package/dist/index.js.map +0 -1
  89. package/package/package/dist/secp256k1-5CEPNAX3.js.map +0 -1
  90. package/package/package/dist/typedData.d.ts +0 -234
  91. package/package/package/dist/typedData.d.ts.map +0 -1
  92. package/package/package/dist/types.d.ts +0 -45
  93. package/package/package/dist/types.d.ts.map +0 -1
  94. /package/dist/{ccip-TLVKUNHE.js.map → ccip-E7SRWW2U.js.map} +0 -0
package/src/typedData.ts CHANGED
@@ -11,13 +11,11 @@ import {
11
11
  getAbiItem,
12
12
  keccak256,
13
13
  toHex,
14
- parseEther,
15
14
  } from "viem";
16
15
  import {
17
16
  zoraMints1155Address,
18
17
  iPremintDefinitionsABI,
19
18
  sponsoredSparksSpenderAddress,
20
- commentsAddress,
21
19
  } from "./generated/wagmi";
22
20
  import {
23
21
  PremintConfigEncoded,
@@ -29,8 +27,6 @@ import {
29
27
  TokenCreationConfigV1,
30
28
  TokenCreationConfigV2,
31
29
  TokenCreationConfigV3,
32
- PermitComment,
33
- PermitSparkComment,
34
30
  } from "./types";
35
31
 
36
32
  const premintTypedDataDomain = ({
@@ -417,132 +413,3 @@ export const sponsoredSparksBatchTypedDataDefinition = ({
417
413
  verifyingContract: sponsoredSparksSpenderAddress[chainId],
418
414
  },
419
415
  });
420
-
421
- const commentIdentifierType = [
422
- { name: "contractAddress", type: "address" },
423
- { name: "tokenId", type: "uint256" },
424
- { name: "commenter", type: "address" },
425
- { name: "nonce", type: "bytes32" },
426
- ] as const;
427
-
428
- const permitCommentTypedDataType = {
429
- PermitComment: [
430
- { name: "contractAddress", type: "address" },
431
- { name: "tokenId", type: "uint256" },
432
- { name: "commenter", type: "address" },
433
- { name: "replyTo", type: "CommentIdentifier" },
434
- { name: "text", type: "string" },
435
- { name: "deadline", type: "uint256" },
436
- { name: "nonce", type: "bytes32" },
437
- { name: "commenterSmartWallet", type: "address" },
438
- { name: "referrer", type: "address" },
439
- { name: "sourceChainId", type: "uint32" },
440
- { name: "destinationChainId", type: "uint32" },
441
- ],
442
- CommentIdentifier: commentIdentifierType,
443
- } as const;
444
-
445
- const permitSparkCommentTypedDataType = {
446
- PermitSparkComment: [
447
- { name: "comment", type: "CommentIdentifier" },
448
- { name: "sparker", type: "address" },
449
- { name: "sparksQuantity", type: "uint64" },
450
- { name: "deadline", type: "uint256" },
451
- { name: "nonce", type: "bytes32" },
452
- { name: "referrer", type: "address" },
453
- { name: "sourceChainId", type: "uint32" },
454
- { name: "destinationChainId", type: "uint32" },
455
- ],
456
- CommentIdentifier: commentIdentifierType,
457
- } as const;
458
-
459
- const commentsDomain = ({
460
- signingChainId,
461
- destinationChainId,
462
- }: {
463
- signingChainId: number;
464
- destinationChainId: keyof typeof commentsAddress;
465
- }): TypedDataDomain => ({
466
- chainId: signingChainId,
467
- name: "Comments",
468
- version: "1",
469
- verifyingContract: commentsAddress[destinationChainId]!,
470
- });
471
-
472
- /**
473
- * Generates the typed data definition for a permit comment, for cross-chain commenting.
474
- *
475
- * The permit allows a user to sign a comment message on one chain, which can then be
476
- * submitted by anyone on the destination chain to execute the comment action.
477
- *
478
- * The permit includes details such as the comment text, the commenter's address,
479
- * the comment being replied to, and chain IDs for the source and destination chains.
480
- *
481
- * The typed data is generated in a way that makes the signature happen on the source chain
482
- * but be valid to be executed on the destination chain.
483
- *
484
- * @param message - The {@link PermitComment} containing the details of the comment permit.
485
- * @param signingAccount - (optional) The account that is signing the message, if different thatn the commentor.
486
- * Only needed if the commentor is a smart wallet; in this case the signing account should be an account
487
- * that is one of the smart wallet owners.
488
- * @returns A {@link TypedDataDefinition} object compatible with EIP-712 for structured data hashing and signing,
489
- * including types, message, primary type, domain, and the signer's account address, which is
490
- * the commenter's address.
491
- */
492
- export const permitCommentTypedDataDefinition = (
493
- message: PermitComment,
494
- signingAccount?: Address,
495
- ): TypedDataDefinition<typeof permitCommentTypedDataType, "PermitComment"> & {
496
- account: Address;
497
- } => ({
498
- types: permitCommentTypedDataType,
499
- message,
500
- primaryType: "PermitComment",
501
- domain: commentsDomain({
502
- signingChainId: message.sourceChainId,
503
- destinationChainId:
504
- message.destinationChainId as keyof typeof commentsAddress,
505
- }),
506
- account: signingAccount || message.commenter,
507
- });
508
-
509
- /**
510
- * Generates the typed data definition for a permit spark comment, for cross-chain sparking (liking with value) of comments.
511
- *
512
- * The permit allows a user to sign a spark comment message on one chain, which can then be
513
- * submitted by anyone on the destination chain to execute the spark action.
514
- *
515
- * The permit includes details such as the comment to be sparked, the sparker's address,
516
- * the quantity of sparks, and the source and destination chain ids.
517
- *
518
- * The typed data is generated in a way that makes the signature happen on the source chain
519
- * but be valid to be executed on the destination chain.
520
- *
521
- * @param message - The {@link PermitSparkComment} containing the details of the spark comment permit.
522
- * @param signingAccount - (optional) The account that is signing the message, if different than the commenter.
523
- * Only needed if the commenter is a smart wallet; in this case the signing account should be an account
524
- * that is one of the smart wallet owners.
525
- * @returns A {@link TypedDataDefinition} object compatible with EIP-712 for structured data hashing and signing,
526
- * including types, message, primary type, domain, and the signer's account address, which is
527
- * the sparker's address.
528
- */
529
- export const permitSparkCommentTypedDataDefinition = (
530
- message: PermitSparkComment,
531
- signingAccount?: Address,
532
- ): TypedDataDefinition<
533
- typeof permitSparkCommentTypedDataType,
534
- "PermitSparkComment"
535
- > & { account: Address } => ({
536
- types: permitSparkCommentTypedDataType,
537
- message,
538
- primaryType: "PermitSparkComment",
539
- domain: commentsDomain({
540
- signingChainId: message.sourceChainId,
541
- destinationChainId:
542
- message.destinationChainId as keyof typeof commentsAddress,
543
- }),
544
- account: signingAccount || message.sparker,
545
- });
546
-
547
- // todo: explain
548
- export const sparkValue = () => parseEther("0.000001");
package/src/types.ts CHANGED
@@ -7,8 +7,6 @@ import {
7
7
  } from "./generated/wagmi";
8
8
  import { Address } from "viem";
9
9
 
10
- import { commentsABI } from "./generated/wagmi";
11
-
12
10
  export enum PremintConfigVersion {
13
11
  V1 = "1",
14
12
  V2 = "2",
@@ -123,43 +121,3 @@ export type SponsoredSparksBatch = AbiParametersToPrimitiveTypes<
123
121
  "hashSponsoredMint"
124
122
  >["inputs"]
125
123
  >[0];
126
-
127
- export type CommentIdentifier = AbiParametersToPrimitiveTypes<
128
- ExtractAbiFunction<typeof commentsABI, "hashCommentIdentifier">["inputs"]
129
- >[0];
130
-
131
- export const emptyCommentIdentifier = (): CommentIdentifier => {
132
- const zeroAddress = "0x0000000000000000000000000000000000000000";
133
- const zeroHash =
134
- "0x0000000000000000000000000000000000000000000000000000000000000000";
135
- return {
136
- commenter: zeroAddress,
137
- contractAddress: zeroAddress,
138
- tokenId: 0n,
139
- nonce: zeroHash,
140
- };
141
- };
142
-
143
- /**
144
- * The PermitComment type represents the data structure for a permit comment,
145
- * for cross-chain commenting, where a user can sign a comment message on one chain,
146
- * which can then be submitted by anyone on the destination chain to execute the comment action.
147
- *
148
- * The permit includes details such as the comment text, the commenter's address,
149
- * the comment being replied to, and chain IDs for the source and destination chains.
150
- */
151
- export type PermitComment = AbiParametersToPrimitiveTypes<
152
- ExtractAbiFunction<typeof commentsABI, "hashPermitComment">["inputs"]
153
- >[0];
154
-
155
- /**
156
- * The PermitSparkComment type represents the data structure for a permit spark comment,
157
- * for cross-chain sparking (liking with value) of comments, where a user can sign a spark comment message on one chain,
158
- * which can then be submitted by anyone on the destination chain to execute the spark action.
159
- *
160
- * The permit includes details such as the comment to be sparked, the sparker's address,
161
- * the quantity of sparks, and chain IDs for the source and destination chains.
162
- */
163
- export type PermitSparkComment = AbiParametersToPrimitiveTypes<
164
- ExtractAbiFunction<typeof commentsABI, "hashPermitSparkComment">["inputs"]
165
- >[0];