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

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 (84) hide show
  1. package/.turbo/turbo-build.log +48 -48
  2. package/CHANGELOG.md +16 -0
  3. package/dist/ccip-TLVKUNHE.js +15 -0
  4. package/dist/chunk-IB365BT5.js +3957 -0
  5. package/dist/generated/wagmi.d.ts +228 -59
  6. package/dist/generated/wagmi.d.ts.map +1 -1
  7. package/dist/index.cjs +190 -16
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.js +176 -17
  10. package/dist/index.js.map +1 -1
  11. package/dist/typedData.d.ts +137 -1
  12. package/dist/typedData.d.ts.map +1 -1
  13. package/dist/types.d.ts +18 -0
  14. package/dist/types.d.ts.map +1 -1
  15. package/json/1155.json +212 -0
  16. package/json/mints.json +46 -0
  17. package/package/.turbo/turbo-build.log +48 -0
  18. package/package/dist/_esm-KB2T7G46.js +3923 -0
  19. package/package/dist/_esm-KB2T7G46.js.map +1 -0
  20. package/package/dist/ccip-42FQPB7J.js.map +1 -0
  21. package/package/dist/chunk-3EJPJMEH.js +44 -0
  22. package/package/dist/chunk-3EJPJMEH.js.map +1 -0
  23. package/package/dist/chunk-5JV63AHR.js +129 -0
  24. package/package/dist/chunk-5JV63AHR.js.map +1 -0
  25. package/package/dist/chunk-YMRS2KON.js.map +1 -0
  26. package/package/dist/encoding.d.ts +15 -0
  27. package/package/dist/encoding.d.ts.map +1 -0
  28. package/package/dist/generated/1155.d.ts +232 -0
  29. package/package/dist/generated/1155.d.ts.map +1 -0
  30. package/package/dist/generated/sparks.d.ts +85 -0
  31. package/package/dist/generated/sparks.d.ts.map +1 -0
  32. package/package/dist/generated/wagmi.d.ts +27548 -0
  33. package/package/dist/generated/wagmi.d.ts.map +1 -0
  34. package/package/dist/index.cjs +12957 -0
  35. package/package/dist/index.cjs.map +1 -0
  36. package/package/dist/index.d.ts +7 -0
  37. package/package/dist/index.d.ts.map +1 -0
  38. package/package/dist/index.js +11268 -0
  39. package/package/dist/index.js.map +1 -0
  40. package/package/dist/secp256k1-5CEPNAX3.js +2244 -0
  41. package/package/dist/secp256k1-5CEPNAX3.js.map +1 -0
  42. package/package/dist/typedData.d.ts +234 -0
  43. package/package/dist/typedData.d.ts.map +1 -0
  44. package/package/dist/types.d.ts +45 -0
  45. package/package/dist/types.d.ts.map +1 -0
  46. package/package/package/.turbo/turbo-build.log +48 -0
  47. package/package/package/dist/_esm-KB2T7G46.js +3923 -0
  48. package/package/package/dist/_esm-KB2T7G46.js.map +1 -0
  49. package/package/package/dist/ccip-42FQPB7J.js +15 -0
  50. package/package/package/dist/ccip-42FQPB7J.js.map +1 -0
  51. package/package/package/dist/chunk-3EJPJMEH.js +44 -0
  52. package/package/package/dist/chunk-3EJPJMEH.js.map +1 -0
  53. package/package/package/dist/chunk-5JV63AHR.js +129 -0
  54. package/package/package/dist/chunk-5JV63AHR.js.map +1 -0
  55. package/package/package/dist/chunk-YMRS2KON.js +3956 -0
  56. package/package/package/dist/chunk-YMRS2KON.js.map +1 -0
  57. package/package/package/dist/encoding.d.ts +15 -0
  58. package/package/package/dist/encoding.d.ts.map +1 -0
  59. package/package/package/dist/generated/1155.d.ts +232 -0
  60. package/package/package/dist/generated/1155.d.ts.map +1 -0
  61. package/package/package/dist/generated/sparks.d.ts +85 -0
  62. package/package/package/dist/generated/sparks.d.ts.map +1 -0
  63. package/package/package/dist/generated/wagmi.d.ts +27548 -0
  64. package/package/package/dist/generated/wagmi.d.ts.map +1 -0
  65. package/package/package/dist/index.cjs +12957 -0
  66. package/package/package/dist/index.cjs.map +1 -0
  67. package/package/package/dist/index.d.ts +7 -0
  68. package/package/package/dist/index.d.ts.map +1 -0
  69. package/package/package/dist/index.js +11268 -0
  70. package/package/package/dist/index.js.map +1 -0
  71. package/package/package/dist/secp256k1-5CEPNAX3.js +2244 -0
  72. package/package/package/dist/secp256k1-5CEPNAX3.js.map +1 -0
  73. package/package/package/dist/typedData.d.ts +234 -0
  74. package/package/package/dist/typedData.d.ts.map +1 -0
  75. package/package/package/dist/types.d.ts +45 -0
  76. package/package/package/dist/types.d.ts.map +1 -0
  77. package/package.json +1 -1
  78. package/src/generated/wagmi.ts +74 -19
  79. package/src/typedData.ts +133 -0
  80. package/src/types.ts +24 -0
  81. /package/dist/{ccip-42FQPB7J.js.map → ccip-TLVKUNHE.js.map} +0 -0
  82. /package/dist/{chunk-YMRS2KON.js.map → chunk-IB365BT5.js.map} +0 -0
  83. /package/{dist → package/dist}/ccip-42FQPB7J.js +0 -0
  84. /package/{dist → package/dist}/chunk-YMRS2KON.js +0 -0
@@ -0,0 +1,234 @@
1
+ import { Address, TypedDataToPrimitiveTypes } from "abitype";
2
+ import { TypedDataDefinition } from "viem";
3
+ import { zoraMints1155Address, sponsoredSparksSpenderAddress } from "./generated/wagmi";
4
+ import { PremintConfigEncoded, PremintConfigV1, PremintConfigV2, PremintConfigVersion, PremintConfigWithVersion } from "./types";
5
+ declare const premintV1TypedDataType: {
6
+ readonly CreatorAttribution: readonly [{
7
+ readonly name: "tokenConfig";
8
+ readonly type: "TokenCreationConfig";
9
+ }, {
10
+ readonly name: "uid";
11
+ readonly type: "uint32";
12
+ }, {
13
+ readonly name: "version";
14
+ readonly type: "uint32";
15
+ }, {
16
+ readonly name: "deleted";
17
+ readonly type: "bool";
18
+ }];
19
+ readonly TokenCreationConfig: readonly [{
20
+ readonly name: "tokenURI";
21
+ readonly type: "string";
22
+ }, {
23
+ readonly name: "maxSupply";
24
+ readonly type: "uint256";
25
+ }, {
26
+ readonly name: "maxTokensPerAddress";
27
+ readonly type: "uint64";
28
+ }, {
29
+ readonly name: "pricePerToken";
30
+ readonly type: "uint96";
31
+ }, {
32
+ readonly name: "mintStart";
33
+ readonly type: "uint64";
34
+ }, {
35
+ readonly name: "mintDuration";
36
+ readonly type: "uint64";
37
+ }, {
38
+ readonly name: "royaltyMintSchedule";
39
+ readonly type: "uint32";
40
+ }, {
41
+ readonly name: "royaltyBPS";
42
+ readonly type: "uint32";
43
+ }, {
44
+ readonly name: "royaltyRecipient";
45
+ readonly type: "address";
46
+ }, {
47
+ readonly name: "fixedPriceMinter";
48
+ readonly type: "address";
49
+ }];
50
+ };
51
+ export declare const encodePremintConfig: <T extends PremintConfigVersion>({ premintConfig, premintConfigVersion, }: PremintConfigWithVersion<T>) => PremintConfigEncoded;
52
+ /**
53
+ * Builds a typed data definition for a PremintConfigV1 to be signed
54
+ * @returns
55
+ */
56
+ export declare const premintV1TypedDataDefinition: ({ chainId, creator1155Contract, message, }: {
57
+ chainId: number;
58
+ creator1155Contract: Address;
59
+ message: PremintConfigV1;
60
+ }) => TypedDataDefinition<typeof premintV1TypedDataType, "CreatorAttribution">;
61
+ declare const premintV2TypedDataType: {
62
+ readonly CreatorAttribution: readonly [{
63
+ readonly name: "tokenConfig";
64
+ readonly type: "TokenCreationConfig";
65
+ }, {
66
+ readonly name: "uid";
67
+ readonly type: "uint32";
68
+ }, {
69
+ readonly name: "version";
70
+ readonly type: "uint32";
71
+ }, {
72
+ readonly name: "deleted";
73
+ readonly type: "bool";
74
+ }];
75
+ readonly TokenCreationConfig: readonly [{
76
+ readonly name: "tokenURI";
77
+ readonly type: "string";
78
+ }, {
79
+ readonly name: "maxSupply";
80
+ readonly type: "uint256";
81
+ }, {
82
+ readonly name: "maxTokensPerAddress";
83
+ readonly type: "uint64";
84
+ }, {
85
+ readonly name: "pricePerToken";
86
+ readonly type: "uint96";
87
+ }, {
88
+ readonly name: "mintStart";
89
+ readonly type: "uint64";
90
+ }, {
91
+ readonly name: "mintDuration";
92
+ readonly type: "uint64";
93
+ }, {
94
+ readonly name: "royaltyBPS";
95
+ readonly type: "uint32";
96
+ }, {
97
+ readonly name: "payoutRecipient";
98
+ readonly type: "address";
99
+ }, {
100
+ readonly name: "fixedPriceMinter";
101
+ readonly type: "address";
102
+ }, {
103
+ readonly name: "createReferral";
104
+ readonly type: "address";
105
+ }];
106
+ };
107
+ /**
108
+ * Builds a typed data definition for a PremintConfigV2 to be signed
109
+ */
110
+ export declare const premintV2TypedDataDefinition: ({ chainId, creator1155Contract, message, }: {
111
+ chainId: number;
112
+ creator1155Contract: Address;
113
+ message: PremintConfigV2;
114
+ }) => TypedDataDefinition<typeof premintV2TypedDataType, "CreatorAttribution">;
115
+ export type PremintTypeDataDefinitionParams<T extends PremintConfigVersion> = {
116
+ verifyingContract: Address;
117
+ chainId: number;
118
+ } & PremintConfigWithVersion<T>;
119
+ /**
120
+ * Creates a typed data definition for a premint config. Works for all versions of the premint config by specifying the premintConfigVersion.
121
+ *
122
+ * @param params.verifyingContract the address of the 1155 contract
123
+ * @param params.chainId the chain id the premint is signed for
124
+ * @param params.premintConfigVersion the version of the premint config
125
+ * @param params.premintConfig the premint config
126
+ * @returns
127
+ */
128
+ export declare const premintTypedDataDefinition: <T extends PremintConfigVersion>({ verifyingContract, chainId, premintConfigVersion: version, premintConfig, }: PremintTypeDataDefinitionParams<T>) => TypedDataDefinition;
129
+ declare const permitSafeTransferTypedDataType: {
130
+ readonly PermitSafeTransfer: readonly [{
131
+ readonly name: "owner";
132
+ readonly type: "address";
133
+ }, {
134
+ readonly name: "to";
135
+ readonly type: "address";
136
+ }, {
137
+ readonly name: "tokenId";
138
+ readonly type: "uint256";
139
+ }, {
140
+ readonly name: "quantity";
141
+ readonly type: "uint256";
142
+ }, {
143
+ readonly name: "safeTransferData";
144
+ readonly type: "bytes";
145
+ }, {
146
+ readonly name: "nonce";
147
+ readonly type: "uint256";
148
+ }, {
149
+ readonly name: "deadline";
150
+ readonly type: "uint256";
151
+ }];
152
+ };
153
+ /**
154
+ * Builds a typed data definition for a PermitSafeTransfer on the Mints1155 contract to be signed
155
+ */
156
+ export declare const mintsSafeTransferTypedDataDefinition: ({ chainId, message, }: {
157
+ chainId: keyof typeof zoraMints1155Address;
158
+ message: TypedDataToPrimitiveTypes<typeof permitSafeTransferTypedDataType>["PermitSafeTransfer"];
159
+ }) => TypedDataDefinition<typeof permitSafeTransferTypedDataType, "PermitSafeTransfer">;
160
+ declare const permitSafeBatchTransferTypedDataType: {
161
+ readonly Permit: readonly [{
162
+ readonly name: "owner";
163
+ readonly type: "address";
164
+ }, {
165
+ readonly name: "to";
166
+ readonly type: "address";
167
+ }, {
168
+ readonly name: "tokenIds";
169
+ readonly type: "uint256[]";
170
+ }, {
171
+ readonly name: "quantities";
172
+ readonly type: "uint256[]";
173
+ }, {
174
+ readonly name: "safeTransferData";
175
+ readonly type: "bytes";
176
+ }, {
177
+ readonly name: "nonce";
178
+ readonly type: "uint256";
179
+ }, {
180
+ readonly name: "deadline";
181
+ readonly type: "uint256";
182
+ }];
183
+ };
184
+ /**
185
+ * Builds a typed data definition for a PermitSafeTransferBatch on the Mints1155 contract to be signed
186
+ * @returns
187
+ */
188
+ export declare const mintsSafeTransferBatchTypedDataDefinition: ({ chainId, message, }: {
189
+ chainId: keyof typeof zoraMints1155Address;
190
+ message: TypedDataToPrimitiveTypes<typeof permitSafeBatchTransferTypedDataType>["Permit"];
191
+ }) => TypedDataDefinition<typeof permitSafeBatchTransferTypedDataType, "Permit">;
192
+ export declare const sponsoredSparksBatchTransferTypedDataType: {
193
+ readonly SponsoredMintBatch: readonly [{
194
+ readonly name: "verifier";
195
+ readonly type: "address";
196
+ }, {
197
+ readonly name: "from";
198
+ readonly type: "address";
199
+ }, {
200
+ readonly name: "destination";
201
+ readonly type: "address";
202
+ }, {
203
+ readonly name: "data";
204
+ readonly type: "bytes";
205
+ }, {
206
+ readonly name: "expectedRedeemAmount";
207
+ readonly type: "uint256";
208
+ }, {
209
+ readonly name: "totalAmount";
210
+ readonly type: "uint256";
211
+ }, {
212
+ readonly name: "ids";
213
+ readonly type: "uint256[]";
214
+ }, {
215
+ readonly name: "quantities";
216
+ readonly type: "uint256[]";
217
+ }, {
218
+ readonly name: "nonce";
219
+ readonly type: "uint256";
220
+ }, {
221
+ readonly name: "deadline";
222
+ readonly type: "uint256";
223
+ }];
224
+ };
225
+ /**
226
+ * Builds a typed data definition for a PermitSafeTransferBatch on the Mints1155 contract to be signed
227
+ * @returns
228
+ */
229
+ export declare const sponsoredSparksBatchTypedDataDefinition: ({ chainId, message, }: {
230
+ chainId: keyof typeof sponsoredSparksSpenderAddress;
231
+ message: TypedDataToPrimitiveTypes<typeof sponsoredSparksBatchTransferTypedDataType>["SponsoredMintBatch"];
232
+ }) => TypedDataDefinition<typeof sponsoredSparksBatchTransferTypedDataType, "SponsoredMintBatch">;
233
+ export {};
234
+ //# sourceMappingURL=typedData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../src/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAGP,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,mBAAmB,EAKpB,MAAM,MAAM,CAAC;AACd,OAAO,EACL,oBAAoB,EAEpB,6BAA6B,EAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EAKzB,MAAM,SAAS,CAAC;AAiBjB,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBE,CAAC;AA8C/B,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,oBAAoB,4CAG/D,wBAAwB,CAAC,CAAC,CAAC,KAAG,oBAahC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,+CAItC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,OAAO,EAAE,eAAe,CAAC;CAC1B,KAAG,mBAAmB,CACrB,OAAO,sBAAsB,EAC7B,oBAAoB,CAUpB,CAAC;AAEH,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBE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AAM,uCAAuC,0BAGjD;IACD,OAAO,EAAE,MAAM,OAAO,6BAA6B,CAAC;IACpD,OAAO,EAAE,yBAAyB,CAChC,OAAO,yCAAyC,CACjD,CAAC,oBAAoB,CAAC,CAAC;CACzB,KAAG,mBAAmB,CACrB,OAAO,yCAAyC,EAChD,oBAAoB,CAWpB,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { ExtractAbiFunction, AbiParametersToPrimitiveTypes } from "abitype";
2
+ import { zoraCreator1155PremintExecutorImplABI, iPremintDefinitionsABI, sponsoredSparksSpenderABI } from "./generated/wagmi";
3
+ import { Address } from "viem";
4
+ export declare enum PremintConfigVersion {
5
+ V1 = "1",
6
+ V2 = "2",
7
+ V3 = "3"
8
+ }
9
+ export type ContractCreationConfig = Omit<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof zoraCreator1155PremintExecutorImplABI, "premint">["inputs"]>[0], "additionalAdmins"> & {
10
+ additionalAdmins: Address[];
11
+ };
12
+ export type TokenCreationConfigV1 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iPremintDefinitionsABI, "tokenConfigV1Definition">["inputs"]>[0];
13
+ export type TokenCreationConfigV2 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iPremintDefinitionsABI, "tokenConfigV2Definition">["inputs"]>[0];
14
+ export type TokenCreationConfigV3 = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iPremintDefinitionsABI, "tokenConfigV3Definition">["inputs"]>[0];
15
+ export type PremintConfigEncoded = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof zoraCreator1155PremintExecutorImplABI, "premint">["inputs"]>[2];
16
+ type PremintConfigCommon = Pick<PremintConfigEncoded, "deleted" | "uid" | "version">;
17
+ export type PremintConfigV1 = PremintConfigCommon & {
18
+ tokenConfig: TokenCreationConfigV1;
19
+ };
20
+ export type PremintConfigV2 = PremintConfigCommon & {
21
+ tokenConfig: TokenCreationConfigV2;
22
+ };
23
+ export type PremintConfigV3 = PremintConfigCommon & {
24
+ tokenConfig: TokenCreationConfigV3;
25
+ };
26
+ export type PremintMintArguments = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof zoraCreator1155PremintExecutorImplABI, "premint">["inputs"]>[5];
27
+ export type PremintConfigForVersion<T extends PremintConfigVersion> = T extends PremintConfigVersion.V1 ? PremintConfigV1 : T extends PremintConfigVersion.V2 ? PremintConfigV2 : PremintConfigV3;
28
+ export type PremintConfigWithVersion<T extends PremintConfigVersion> = {
29
+ /** Premint Config */
30
+ premintConfig: PremintConfigForVersion<T>;
31
+ /** PremintConfigVersion of the premint */
32
+ premintConfigVersion: T;
33
+ };
34
+ export type PremintConfigAndVersion = PremintConfigWithVersion<PremintConfigVersion.V1> | PremintConfigWithVersion<PremintConfigVersion.V2> | PremintConfigWithVersion<PremintConfigVersion.V3>;
35
+ export type PremintConfig = PremintConfigV1 | PremintConfigV2;
36
+ export type TokenCreationConfig = TokenCreationConfigV1 | TokenCreationConfigV2 | TokenCreationConfigV3;
37
+ export type PremintConfigForTokenCreationConfig<T extends TokenCreationConfig> = T extends TokenCreationConfigV1 ? PremintConfigV1 : T extends TokenCreationConfigV2 ? PremintConfigV2 : PremintConfigV3;
38
+ export type TokenConfigForVersion<T extends PremintConfigVersion> = PremintConfigForVersion<T>["tokenConfig"];
39
+ export type TokenConfigWithVersion<T extends PremintConfigVersion> = {
40
+ tokenConfig: TokenConfigForVersion<T>;
41
+ premintConfigVersion: T;
42
+ };
43
+ export type SponsoredSparksBatch = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof sponsoredSparksSpenderABI, "hashSponsoredMint">["inputs"]>[0];
44
+ export {};
45
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE5E,OAAO,EACL,qCAAqC,EACrC,sB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AC,SAAS,oBAAoB,IAAI;IACnE,WAAW,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACtC,oBAAoB,EAAE,CAAC,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,CAC9D,kBAAkB,CAChB,OAAO,yBAAyB,EAChC,mBAAmB,CACpB,CAAC,QAAQ,CAAC,CACZ,CAAC,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoralabs/protocol-deployments",
3
- "version": "0.3.5-COMMENTS.0",
3
+ "version": "0.3.5-COMMENTS.2",
4
4
  "repository": "https://github.com/ourzora/zora-protocol",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -3,7 +3,8 @@
3
3
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4
4
 
5
5
  /**
6
- * [__View Contract on Zora Sepolia Zora Sepolia Explorer__](https://sepolia.explorer.zora.energy//address/0x7777777bE14a1F7Fd6896B5FBDa5ceD5FC6e501a)
6
+ * - [__View Contract on Zora Explorer__](https://explorer.zora.energy/address/0x8C0757EFfD2Cc68F00810d2d144F729F6ed5CdA3)
7
+ * - [__View Contract on Zora Sepolia Zora Sepolia Explorer__](https://sepolia.explorer.zora.energy//address/0x7777777C2B3132e03a65721a41745C07170a5877)
7
8
  */
8
9
  export const commentsABI = [
9
10
  {
@@ -129,6 +130,11 @@ export const commentsABI = [
129
130
  { name: 'nonce', internalType: 'bytes32', type: 'bytes32' },
130
131
  ],
131
132
  },
133
+ {
134
+ name: 'commenterSmartWallet',
135
+ internalType: 'address',
136
+ type: 'address',
137
+ },
132
138
  { name: 'referrer', internalType: 'address', type: 'address' },
133
139
  ],
134
140
  name: 'comment',
@@ -149,7 +155,19 @@ export const commentsABI = [
149
155
  {
150
156
  stateMutability: 'view',
151
157
  type: 'function',
152
- inputs: [{ name: 'commentId', internalType: 'bytes32', type: 'bytes32' }],
158
+ inputs: [
159
+ {
160
+ name: 'commentIdentifier',
161
+ internalType: 'struct IComments.CommentIdentifier',
162
+ type: 'tuple',
163
+ components: [
164
+ { name: 'commenter', internalType: 'address', type: 'address' },
165
+ { name: 'contractAddress', internalType: 'address', type: 'address' },
166
+ { name: 'tokenId', internalType: 'uint256', type: 'uint256' },
167
+ { name: 'nonce', internalType: 'bytes32', type: 'bytes32' },
168
+ ],
169
+ },
170
+ ],
153
171
  name: 'commentSparksQuantity',
154
172
  outputs: [{ name: '', internalType: 'uint64', type: 'uint64' }],
155
173
  },
@@ -202,6 +220,21 @@ export const commentsABI = [
202
220
  },
203
221
  ],
204
222
  },
223
+ {
224
+ stateMutability: 'view',
225
+ type: 'function',
226
+ inputs: [],
227
+ name: 'eip712Domain',
228
+ outputs: [
229
+ { name: 'fields', internalType: 'bytes1', type: 'bytes1' },
230
+ { name: 'name', internalType: 'string', type: 'string' },
231
+ { name: 'version', internalType: 'string', type: 'string' },
232
+ { name: 'chainId', internalType: 'uint256', type: 'uint256' },
233
+ { name: 'verifyingContract', internalType: 'address', type: 'address' },
234
+ { name: 'salt', internalType: 'bytes32', type: 'bytes32' },
235
+ { name: 'extensions', internalType: 'uint256[]', type: 'uint256[]' },
236
+ ],
237
+ },
205
238
  {
206
239
  stateMutability: 'view',
207
240
  type: 'function',
@@ -317,15 +350,19 @@ export const commentsABI = [
317
350
  ],
318
351
  },
319
352
  { name: 'text', internalType: 'string', type: 'string' },
320
- { name: 'sparksQuantity', internalType: 'uint64', type: 'uint64' },
321
353
  { name: 'deadline', internalType: 'uint256', type: 'uint256' },
322
354
  { name: 'nonce', internalType: 'bytes32', type: 'bytes32' },
323
355
  { name: 'referrer', internalType: 'address', type: 'address' },
324
- { name: 'sourceChainId', internalType: 'uint256', type: 'uint256' },
356
+ { name: 'sourceChainId', internalType: 'uint32', type: 'uint32' },
325
357
  {
326
358
  name: 'destinationChainId',
327
- internalType: 'uint256',
328
- type: 'uint256',
359
+ internalType: 'uint32',
360
+ type: 'uint32',
361
+ },
362
+ {
363
+ name: 'commenterSmartWallet',
364
+ internalType: 'address',
365
+ type: 'address',
329
366
  },
330
367
  ],
331
368
  },
@@ -362,11 +399,11 @@ export const commentsABI = [
362
399
  { name: 'deadline', internalType: 'uint256', type: 'uint256' },
363
400
  { name: 'nonce', internalType: 'bytes32', type: 'bytes32' },
364
401
  { name: 'referrer', internalType: 'address', type: 'address' },
365
- { name: 'sourceChainId', internalType: 'uint256', type: 'uint256' },
402
+ { name: 'sourceChainId', internalType: 'uint32', type: 'uint32' },
366
403
  {
367
404
  name: 'destinationChainId',
368
- internalType: 'uint256',
369
- type: 'uint256',
405
+ internalType: 'uint32',
406
+ type: 'uint32',
370
407
  },
371
408
  ],
372
409
  },
@@ -374,6 +411,13 @@ export const commentsABI = [
374
411
  name: 'hashPermitSparkComment',
375
412
  outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
376
413
  },
414
+ {
415
+ stateMutability: 'view',
416
+ type: 'function',
417
+ inputs: [],
418
+ name: 'implementation',
419
+ outputs: [{ name: '', internalType: 'address', type: 'address' }],
420
+ },
377
421
  {
378
422
  stateMutability: 'nonpayable',
379
423
  type: 'function',
@@ -435,15 +479,19 @@ export const commentsABI = [
435
479
  ],
436
480
  },
437
481
  { name: 'text', internalType: 'string', type: 'string' },
438
- { name: 'sparksQuantity', internalType: 'uint64', type: 'uint64' },
439
482
  { name: 'deadline', internalType: 'uint256', type: 'uint256' },
440
483
  { name: 'nonce', internalType: 'bytes32', type: 'bytes32' },
441
484
  { name: 'referrer', internalType: 'address', type: 'address' },
442
- { name: 'sourceChainId', internalType: 'uint256', type: 'uint256' },
485
+ { name: 'sourceChainId', internalType: 'uint32', type: 'uint32' },
443
486
  {
444
487
  name: 'destinationChainId',
445
- internalType: 'uint256',
446
- type: 'uint256',
488
+ internalType: 'uint32',
489
+ type: 'uint32',
490
+ },
491
+ {
492
+ name: 'commenterSmartWallet',
493
+ internalType: 'address',
494
+ type: 'address',
447
495
  },
448
496
  ],
449
497
  },
@@ -481,11 +529,11 @@ export const commentsABI = [
481
529
  { name: 'deadline', internalType: 'uint256', type: 'uint256' },
482
530
  { name: 'nonce', internalType: 'bytes32', type: 'bytes32' },
483
531
  { name: 'referrer', internalType: 'address', type: 'address' },
484
- { name: 'sourceChainId', internalType: 'uint256', type: 'uint256' },
532
+ { name: 'sourceChainId', internalType: 'uint32', type: 'uint32' },
485
533
  {
486
534
  name: 'destinationChainId',
487
- internalType: 'uint256',
488
- type: 'uint256',
535
+ internalType: 'uint32',
536
+ type: 'uint32',
489
537
  },
490
538
  ],
491
539
  },
@@ -675,6 +723,7 @@ export const commentsABI = [
675
723
  ],
676
724
  name: 'Commented',
677
725
  },
726
+ { type: 'event', anonymous: false, inputs: [], name: 'EIP712DomainChanged' },
678
727
  {
679
728
  type: 'event',
680
729
  anonymous: false,
@@ -889,7 +938,10 @@ export const commentsABI = [
889
938
  { type: 'error', inputs: [], name: 'InvalidInitialization' },
890
939
  { type: 'error', inputs: [], name: 'InvalidSignature' },
891
940
  { type: 'error', inputs: [], name: 'MustSendAtLeastOneSpark' },
941
+ { type: 'error', inputs: [], name: 'NoFundsRecipient' },
892
942
  { type: 'error', inputs: [], name: 'NotInitializing' },
943
+ { type: 'error', inputs: [], name: 'NotSmartWallet' },
944
+ { type: 'error', inputs: [], name: 'NotSmartWalletOwner' },
893
945
  { type: 'error', inputs: [], name: 'NotTokenHolderOrAdmin' },
894
946
  { type: 'error', inputs: [], name: 'OnlySparksContract' },
895
947
  { type: 'error', inputs: [], name: 'TransferFailed' },
@@ -910,14 +962,17 @@ export const commentsABI = [
910
962
  ] as const
911
963
 
912
964
  /**
913
- * [__View Contract on Zora Sepolia Zora Sepolia Explorer__](https://sepolia.explorer.zora.energy//address/0x7777777bE14a1F7Fd6896B5FBDa5ceD5FC6e501a)
965
+ * - [__View Contract on Zora Explorer__](https://explorer.zora.energy/address/0x8C0757EFfD2Cc68F00810d2d144F729F6ed5CdA3)
966
+ * - [__View Contract on Zora Sepolia Zora Sepolia Explorer__](https://sepolia.explorer.zora.energy//address/0x7777777C2B3132e03a65721a41745C07170a5877)
914
967
  */
915
968
  export const commentsAddress = {
916
- 999999999: '0x7777777bE14a1F7Fd6896B5FBDa5ceD5FC6e501a',
969
+ 7777777: '0x8C0757EFfD2Cc68F00810d2d144F729F6ed5CdA3',
970
+ 999999999: '0x7777777C2B3132e03a65721a41745C07170a5877',
917
971
  } as const
918
972
 
919
973
  /**
920
- * [__View Contract on Zora Sepolia Zora Sepolia Explorer__](https://sepolia.explorer.zora.energy//address/0x7777777bE14a1F7Fd6896B5FBDa5ceD5FC6e501a)
974
+ * - [__View Contract on Zora Explorer__](https://explorer.zora.energy/address/0x8C0757EFfD2Cc68F00810d2d144F729F6ed5CdA3)
975
+ * - [__View Contract on Zora Sepolia Zora Sepolia Explorer__](https://sepolia.explorer.zora.energy//address/0x7777777C2B3132e03a65721a41745C07170a5877)
921
976
  */
922
977
  export const commentsConfig = {
923
978
  address: commentsAddress,
package/src/typedData.ts CHANGED
@@ -11,11 +11,13 @@ import {
11
11
  getAbiItem,
12
12
  keccak256,
13
13
  toHex,
14
+ parseEther,
14
15
  } from "viem";
15
16
  import {
16
17
  zoraMints1155Address,
17
18
  iPremintDefinitionsABI,
18
19
  sponsoredSparksSpenderAddress,
20
+ commentsAddress,
19
21
  } from "./generated/wagmi";
20
22
  import {
21
23
  PremintConfigEncoded,
@@ -27,6 +29,8 @@ import {
27
29
  TokenCreationConfigV1,
28
30
  TokenCreationConfigV2,
29
31
  TokenCreationConfigV3,
32
+ PermitComment,
33
+ PermitSparkComment,
30
34
  } from "./types";
31
35
 
32
36
  const premintTypedDataDomain = ({
@@ -413,3 +417,132 @@ export const sponsoredSparksBatchTypedDataDefinition = ({
413
417
  verifyingContract: sponsoredSparksSpenderAddress[chainId],
414
418
  },
415
419
  });
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");