@zoralabs/protocol-deployments 0.2.0 → 0.2.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.
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // the below files are auto-generated and will be
2
2
  // built at build time. They are not checked in to git.
3
- // The can be generated by running `yarn prepack` in the root
3
+ // The can be generated by running `pnpm run prepack` in the root
4
4
  export * from "./generated/wagmi";
5
5
  export * from "./typedData";
6
6
  export * from "./types";
package/src/typedData.ts CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  import {
16
16
  zoraMints1155Address,
17
17
  iPremintDefinitionsABI,
18
+ sponsoredSparksSpenderAddress,
18
19
  } from "./generated/wagmi";
19
20
  import {
20
21
  PremintConfigEncoded,
@@ -340,3 +341,75 @@ export const mintsSafeTransferBatchTypedDataDefinition = ({
340
341
  verifyingContract: zoraMints1155Address[chainId],
341
342
  },
342
343
  });
344
+
345
+ export const sponsoredSparksBatchTransferTypedDataType = {
346
+ SponsoredMintBatch: [
347
+ {
348
+ name: "verifier",
349
+ type: "address",
350
+ },
351
+ {
352
+ name: "from",
353
+ type: "address",
354
+ },
355
+ {
356
+ name: "destination",
357
+ type: "address",
358
+ },
359
+ {
360
+ name: "data",
361
+ type: "bytes",
362
+ },
363
+ {
364
+ name: "expectedRedeemAmount",
365
+ type: "uint256",
366
+ },
367
+ {
368
+ name: "totalAmount",
369
+ type: "uint256",
370
+ },
371
+ {
372
+ name: "ids",
373
+ type: "uint256[]",
374
+ },
375
+ {
376
+ name: "quantities",
377
+ type: "uint256[]",
378
+ },
379
+ {
380
+ name: "nonce",
381
+ type: "uint256",
382
+ },
383
+ {
384
+ name: "deadline",
385
+ type: "uint256",
386
+ },
387
+ ],
388
+ } as const;
389
+
390
+ /**
391
+ * Builds a typed data definition for a PermitSafeTransferBatch on the Mints1155 contract to be signed
392
+ * @returns
393
+ */
394
+ export const sponsoredSparksBatchTypedDataDefinition = ({
395
+ chainId,
396
+ message,
397
+ }: {
398
+ chainId: keyof typeof sponsoredSparksSpenderAddress;
399
+ message: TypedDataToPrimitiveTypes<
400
+ typeof sponsoredSparksBatchTransferTypedDataType
401
+ >["SponsoredMintBatch"];
402
+ }): TypedDataDefinition<
403
+ typeof sponsoredSparksBatchTransferTypedDataType,
404
+ "SponsoredMintBatch"
405
+ > => ({
406
+ types: sponsoredSparksBatchTransferTypedDataType,
407
+ message,
408
+ primaryType: "SponsoredMintBatch",
409
+ domain: {
410
+ chainId,
411
+ name: "SponsoredSparksSpender",
412
+ version: "1",
413
+ verifyingContract: sponsoredSparksSpenderAddress[chainId],
414
+ },
415
+ });
package/src/types.ts CHANGED
@@ -3,6 +3,7 @@ import { ExtractAbiFunction, AbiParametersToPrimitiveTypes } from "abitype";
3
3
  import {
4
4
  zoraCreator1155PremintExecutorImplABI,
5
5
  iPremintDefinitionsABI,
6
+ sponsoredSparksSpenderABI,
6
7
  } from "./generated/wagmi";
7
8
  import { Address } from "viem";
8
9
 
@@ -113,3 +114,10 @@ export type TokenConfigWithVersion<T extends PremintConfigVersion> = {
113
114
  tokenConfig: TokenConfigForVersion<T>;
114
115
  premintConfigVersion: T;
115
116
  };
117
+
118
+ export type SponsoredSparksBatch = AbiParametersToPrimitiveTypes<
119
+ ExtractAbiFunction<
120
+ typeof sponsoredSparksSpenderABI,
121
+ "hashSponsoredMint"
122
+ >["inputs"]
123
+ >[0];
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "zoralabs-tsconfig/tsconfig.json",
2
+ "extends": "@zoralabs/tsconfig/tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "lib": ["es2021", "DOM"],
5
5
  "baseUrl": ".",
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "zoralabs-tsconfig/tsconfig.json",
2
+ "extends": "@zoralabs/tsconfig/tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "baseUrl": ".",
5
5
  "outDir": "dist"