@zoralabs/protocol-sdk 0.4.3 → 0.5.1

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 (39) hide show
  1. package/.turbo/turbo-build.log +15 -14
  2. package/CHANGELOG.md +28 -1
  3. package/README.md +1 -1
  4. package/dist/anvil.d.ts +6 -2
  5. package/dist/anvil.d.ts.map +1 -1
  6. package/dist/apis/chain-constants.d.ts +4 -12
  7. package/dist/apis/chain-constants.d.ts.map +1 -1
  8. package/dist/index.cjs +55 -66
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.js +58 -71
  11. package/dist/index.js.map +1 -1
  12. package/dist/premint/conversions.d.ts +1 -1
  13. package/dist/premint/conversions.d.ts.map +1 -1
  14. package/dist/premint/premint-client.d.ts +4 -4
  15. package/dist/premint/premint-client.d.ts.map +1 -1
  16. package/dist/premint/preminter.d.ts +3 -3
  17. package/dist/premint/preminter.d.ts.map +1 -1
  18. package/package.json +10 -8
  19. package/src/anvil.ts +10 -3
  20. package/src/apis/chain-constants.ts +31 -32
  21. package/src/mint/mint-client.test.ts +1 -1
  22. package/src/premint/conversions.ts +12 -6
  23. package/src/premint/premint-client.test.ts +14 -64
  24. package/src/premint/premint-client.ts +25 -27
  25. package/src/premint/preminter.test.ts +1 -1
  26. package/src/premint/preminter.ts +9 -23
  27. package/test-integration/premint-client.test.ts +146 -0
  28. package/tsconfig.build.json +10 -0
  29. package/tsconfig.json +1 -1
  30. package/tsup.config.js +2 -1
  31. package/.turbo/turbo-lint.log +0 -5
  32. package/dist/create/1155-create-helper.test.d.ts +0 -2
  33. package/dist/create/1155-create-helper.test.d.ts.map +0 -1
  34. package/dist/mint/mint-client.test.d.ts +0 -2
  35. package/dist/mint/mint-client.test.d.ts.map +0 -1
  36. package/dist/premint/premint-client.test.d.ts +0 -2
  37. package/dist/premint/premint-client.test.d.ts.map +0 -1
  38. package/dist/premint/preminter.test.d.ts +0 -2
  39. package/dist/premint/preminter.test.d.ts.map +0 -1
@@ -1,15 +1,16 @@
1
+ warning package.json: "dependencies" has dependency "vite" with range "4.5.0" that collides with a dependency in "devDependencies" of the same name with version "^4.5.0"
1
2
  $ tsup
2
- CLI Building entry: src/index.ts
3
- CLI Using tsconfig: tsconfig.json
4
- CLI tsup v7.2.0
5
- CLI Using tsup config: /Users/danovedzora/source/zora-protocol/packages/protocol-sdk/tsup.config.js
6
- CLI Target: es2021
7
- CLI Cleaning output folder
8
- CJS Build start
9
- ESM Build start
10
- ESM dist/index.js 46.74 KB
11
- ESM dist/index.js.map 97.90 KB
12
- ESM ⚡️ Build success in 18ms
13
- CJS dist/index.cjs 50.59 KB
14
- CJS dist/index.cjs.map 97.83 KB
15
- CJS ⚡️ Build success in 18ms
3
+ CLI Building entry: src/index.ts
4
+ CLI Using tsconfig: tsconfig.build.json
5
+ CLI tsup v7.3.0
6
+ CLI Using tsup config: /home/runner/work/zora-protocol-private/zora-protocol-private/packages/protocol-sdk/tsup.config.js
7
+ CLI Target: es2021
8
+ CLI Cleaning output folder
9
+ CJS Build start
10
+ ESM Build start
11
+ CJS dist/index.cjs 50.09 KB
12
+ CJS dist/index.cjs.map 96.94 KB
13
+ CJS ⚡️ Build success in 54ms
14
+ ESM dist/index.js 46.17 KB
15
+ ESM dist/index.js.map 97.00 KB
16
+ ESM ⚡️ Build success in 54ms
package/CHANGELOG.md CHANGED
@@ -1,10 +1,37 @@
1
1
  # @zoralabs/protocol-sdk
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 73070c0:
8
+ - Fix types export - make sure that types are exported to the correct directory. Broken by commit 627f8c37716f0b5c201f75ab1d025ae878be0ae29e7a269d21185fa04e4bcf93
9
+ - Exclude tests from built bundle
10
+ - Fixes #396
11
+
12
+ ## 0.5.0
13
+
14
+ ### Minor Changes
15
+
16
+ - a52d245: Fix premint v2 support in premint client and add support for sepolia to SDK:
17
+
18
+ - Fix chain constants config for Zora Goerli.
19
+ - Support Zora-Sepolia for premint client.
20
+ - Fix passing of `config_version` to and from the backend API.
21
+ - Change parameter on `makeMintParameters` from `account` to `minterAccount`.
22
+ - Fix price minter address for premint client by chain, since it is not the same on all chains (yet).
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [3af77cf]
27
+ - Updated dependencies [23dba1c]
28
+ - @zoralabs/protocol-deployments@0.0.12
29
+
3
30
  ## 0.4.3
4
31
 
5
32
  ### Patch Changes
6
33
 
7
- - 5e1273b: Export premint conversions
34
+ - 92b1b0e: Export premint conversions
8
35
 
9
36
  ## 0.4.2
10
37
 
package/README.md CHANGED
@@ -300,7 +300,7 @@ async function mintCreatedForFreeToken(walletClient: WalletClient, publicClient:
300
300
  const premintClient = createPremintClient({chain: walletClient.chain!});
301
301
 
302
302
  const simulateContractParameters = await premintClient.makeMintParameters({
303
- account: minterAccount,
303
+ minterAccount,
304
304
  tokenContract: "0xf8dA7f53c283d898818af7FB9d98103F559bDac2",
305
305
  uid: 3,
306
306
  mintArguments: {
package/dist/anvil.d.ts CHANGED
@@ -1,20 +1,23 @@
1
- import { PublicClient, TestClient, WalletClient } from "viem";
1
+ import { Chain, PublicClient, TestClient, WalletClient } from "viem";
2
2
  export interface AnvilViemClientsTest {
3
3
  viemClients: {
4
4
  walletClient: WalletClient;
5
5
  publicClient: PublicClient;
6
6
  testClient: TestClient;
7
+ chain: Chain;
7
8
  };
8
9
  }
9
10
  export type AnvilTestForkSettings = {
10
11
  forkUrl: string;
11
12
  forkBlockNumber: number;
13
+ anvilChainId?: number;
12
14
  };
13
- export declare const makeAnvilTest: ({ forkUrl, forkBlockNumber, }: AnvilTestForkSettings) => import("@vitest/runner/dist/tasks-e594cd24").e<{
15
+ export declare const makeAnvilTest: ({ forkUrl, forkBlockNumber, anvilChainId, }: AnvilTestForkSettings) => import("@vitest/runner/dist/tasks-e594cd24").e<{
14
16
  viemClients: {
15
17
  walletClient: WalletClient;
16
18
  publicClient: PublicClient;
17
19
  testClient: TestClient;
20
+ chain: Chain;
18
21
  };
19
22
  }>;
20
23
  export declare const forkUrls: {
@@ -27,6 +30,7 @@ export declare const anvilTest: import("@vitest/runner/dist/tasks-e594cd24").e<{
27
30
  walletClient: WalletClient;
28
31
  publicClient: PublicClient;
29
32
  testClient: TestClient;
33
+ chain: Chain;
30
34
  };
31
35
  }>;
32
36
  //# sourceMappingURL=anvil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anvil.d.ts","sourceRoot":"","sources":["../src/anvil.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EAKb,MAAM,MAAM,CAAC;AAGd,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE;QACX,YAAY,EAAE,YAAY,CAAC;QAC3B,YAAY,EAAE,YAAY,CAAC;QAC3B,UAAU,EAAE,UAAU,CAAC;KACxB,CAAC;CACH;AAUD,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,aAAa,kCAGvB,qBAAqB;;sBAtBN,YAAY;sBACZ,YAAY;oBACd,UAAU;;EA0EtB,CAAC;AAEL,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,eAAO,MAAM,SAAS;;sBApFJ,YAAY;sBACZ,YAAY;oBACd,UAAU;;EAqFxB,CAAC"}
1
+ {"version":3,"file":"anvil.d.ts","sourceRoot":"","sources":["../src/anvil.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EAKb,MAAM,MAAM,CAAC;AAGd,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE;QACX,YAAY,EAAE,YAAY,CAAC;QAC3B,YAAY,EAAE,YAAY,CAAC;QAC3B,UAAU,EAAE,UAAU,CAAC;QACvB,KAAK,EAAE,KAAK,CAAC;KACd,CAAC;CACH;AAUD,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,aAAa,gDAIvB,qBAAqB;;sBAzBN,YAAY;sBACZ,YAAY;oBACd,UAAU;eACf,KAAK;;EA8EZ,CAAC;AAEL,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,eAAO,MAAM,SAAS;;sBAzFJ,YAAY;sBACZ,YAAY;oBACd,UAAU;eACf,KAAK;;EA0Fd,CAAC"}
@@ -1,21 +1,13 @@
1
1
  import type { components } from "./generated/premint-api-types";
2
+ type BackendChainName = components["schemas"]["ChainName"];
2
3
  export type NetworkConfig = {
3
4
  chainId: number;
4
- zoraPathChainName: string;
5
- zoraBackendChainName: components["schemas"]["ChainName"];
5
+ zoraCollectPathChainName: string;
6
+ zoraBackendChainName: BackendChainName;
6
7
  isTestnet: boolean;
7
8
  subgraphUrl: string;
8
9
  };
9
10
  export declare const REWARD_PER_TOKEN: bigint;
10
- export declare const BackendChainNamesLookup: {
11
- readonly ZORA_MAINNET: "ZORA-MAINNET";
12
- readonly ZORA_GOERLI: "ZORA-GOERLI";
13
- readonly OPTIMISM_MAINNET: "OPTIMISM-MAINNET";
14
- readonly OPTIMISM_GOERLI: "OPTIMISM-GOERLI";
15
- readonly ETHEREUM_MAINNET: "ETHEREUM-MAINNET";
16
- readonly ETHEREUM_GOERLI: "ETHEREUM-GOERLI";
17
- readonly BASE_MAINNET: "BASE-MAINNET";
18
- readonly BASE_GOERLI: "BASE-GOERLI";
19
- };
20
11
  export declare const networkConfigByChain: Record<number, NetworkConfig>;
12
+ export {};
21
13
  //# sourceMappingURL=chain-constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chain-constants.d.ts","sourceRoot":"","sources":["../../src/apis/chain-constants.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAIhE,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC;IACzD,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAyB,CAAC;AAEvD,eAAO,MAAM,uBAAuB;;;;;;;;;CAS1B,CAAC;AAEX,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAgE9D,CAAC"}
1
+ {"version":3,"file":"chain-constants.d.ts","sourceRoot":"","sources":["../../src/apis/chain-constants.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAIhE,KAAK,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,wBAAwB,EAAE,MAAM,CAAC;IACjC,oBAAoB,EAAE,gBAAgB,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAyB,CAAC;AAEvD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAuE9D,CAAC"}
package/dist/index.cjs CHANGED
@@ -40,6 +40,7 @@ __export(src_exports, {
40
40
  encodePostSignatureInput: () => encodePostSignatureInput,
41
41
  encodePremintForAPI: () => encodePremintForAPI,
42
42
  getApiNetworkConfigForChain: () => getApiNetworkConfigForChain,
43
+ getDefaultFixedPriceMinterAddress: () => getDefaultFixedPriceMinterAddress,
43
44
  getMintCosts: () => getMintCosts,
44
45
  getPremintCollectionAddress: () => getPremintCollectionAddress,
45
46
  getPremintExecutorAddress: () => getPremintExecutorAddress,
@@ -163,20 +164,8 @@ async function isAuthorizedToCreatePremint({
163
164
  collection,
164
165
  collectionAddress,
165
166
  publicClient,
166
- premintConfig,
167
- premintConfigVersion,
168
- signature,
169
167
  signer
170
168
  }) {
171
- if (premintConfigVersion === "1" /* V1 */) {
172
- const [isValidSignature2] = await publicClient.readContract({
173
- abi: import_protocol_deployments.zoraCreator1155PremintExecutorImplABI,
174
- address: getPremintExecutorAddress(),
175
- functionName: "isValidSignature",
176
- args: [collection, premintConfig, signature]
177
- });
178
- return isValidSignature2;
179
- }
180
169
  return await publicClient.readContract({
181
170
  abi: import_protocol_deployments.zoraCreator1155PremintExecutorImplABI,
182
171
  address: getPremintExecutorAddress(),
@@ -228,9 +217,7 @@ async function isValidSignature({
228
217
  signer: recoveredAddress,
229
218
  collection,
230
219
  collectionAddress: tokenContract,
231
- publicClient,
232
- signature,
233
- ...premintConfigAndVersion
220
+ publicClient
234
221
  });
235
222
  return {
236
223
  isAuthorized,
@@ -391,6 +378,9 @@ function makeMintRewardsRecipient({
391
378
  }) {
392
379
  return [mintReferral, platformReferral];
393
380
  }
381
+ function getDefaultFixedPriceMinterAddress(chainId) {
382
+ return import_protocol_deployments.zoraCreatorFixedPriceSaleStrategyAddress[chainId];
383
+ }
394
384
 
395
385
  // src/apis/http-api-base.ts
396
386
  var BadResponseError = class extends Error {
@@ -483,78 +473,75 @@ var zora721Abi = (0, import_viem2.parseAbi)([
483
473
  var import_chains = require("viem/chains");
484
474
  var import_viem3 = require("viem");
485
475
  var REWARD_PER_TOKEN = (0, import_viem3.parseEther)("0.000777");
486
- var BackendChainNamesLookup = {
487
- ZORA_MAINNET: "ZORA-MAINNET",
488
- ZORA_GOERLI: "ZORA-GOERLI",
489
- OPTIMISM_MAINNET: "OPTIMISM-MAINNET",
490
- OPTIMISM_GOERLI: "OPTIMISM-GOERLI",
491
- ETHEREUM_MAINNET: "ETHEREUM-MAINNET",
492
- ETHEREUM_GOERLI: "ETHEREUM-GOERLI",
493
- BASE_MAINNET: "BASE-MAINNET",
494
- BASE_GOERLI: "BASE-GOERLI"
495
- };
496
476
  var networkConfigByChain = {
497
477
  [import_chains.mainnet.id]: {
498
478
  chainId: import_chains.mainnet.id,
499
479
  isTestnet: false,
500
- zoraPathChainName: "eth",
501
- zoraBackendChainName: BackendChainNamesLookup.ETHEREUM_MAINNET,
480
+ zoraCollectPathChainName: "eth",
481
+ zoraBackendChainName: "ETHEREUM-MAINNET",
502
482
  subgraphUrl: getSubgraph("zora-create-mainnet", "stable")
503
483
  },
504
484
  [import_chains.goerli.id]: {
505
485
  chainId: import_chains.goerli.id,
506
486
  isTestnet: true,
507
- zoraPathChainName: "gor",
508
- zoraBackendChainName: BackendChainNamesLookup.ETHEREUM_GOERLI,
487
+ zoraCollectPathChainName: "gor",
488
+ zoraBackendChainName: "ETHEREUM-GOERLI",
509
489
  subgraphUrl: getSubgraph("zora-create-goerli", "stable")
510
490
  },
511
491
  [import_chains.zora.id]: {
512
492
  chainId: import_chains.zora.id,
513
493
  isTestnet: false,
514
- zoraPathChainName: "zora",
515
- zoraBackendChainName: BackendChainNamesLookup.ZORA_MAINNET,
494
+ zoraCollectPathChainName: "zora",
495
+ zoraBackendChainName: "ZORA-MAINNET",
516
496
  subgraphUrl: getSubgraph("zora-create-zora-mainnet", "stable")
517
497
  },
518
498
  [import_chains.zoraTestnet.id]: {
519
- chainId: import_chains.zora.id,
499
+ chainId: import_chains.zoraTestnet.id,
520
500
  isTestnet: true,
521
- zoraPathChainName: "zgor",
522
- zoraBackendChainName: BackendChainNamesLookup.ZORA_GOERLI,
501
+ zoraCollectPathChainName: "zgor",
502
+ zoraBackendChainName: "ZORA-GOERLI",
523
503
  subgraphUrl: getSubgraph("zora-create-zora-testnet", "stable")
524
504
  },
505
+ [import_chains.zoraSepolia.id]: {
506
+ chainId: import_chains.zoraSepolia.id,
507
+ isTestnet: true,
508
+ zoraCollectPathChainName: "zsep",
509
+ zoraBackendChainName: "ZORA-SEPOLIA",
510
+ subgraphUrl: getSubgraph("zora-create-zora-sepolia", "stable")
511
+ },
525
512
  [import_chains.optimism.id]: {
526
513
  chainId: import_chains.optimism.id,
527
514
  isTestnet: false,
528
- zoraPathChainName: "opt",
529
- zoraBackendChainName: BackendChainNamesLookup.OPTIMISM_MAINNET,
515
+ zoraCollectPathChainName: "opt",
516
+ zoraBackendChainName: "OPTIMISM-MAINNET",
530
517
  subgraphUrl: getSubgraph("zora-create-optimism", "stable")
531
518
  },
532
519
  [import_chains.optimismGoerli.id]: {
533
520
  chainId: import_chains.optimismGoerli.id,
534
521
  isTestnet: true,
535
- zoraPathChainName: "ogor",
536
- zoraBackendChainName: BackendChainNamesLookup.OPTIMISM_GOERLI,
522
+ zoraCollectPathChainName: "ogor",
523
+ zoraBackendChainName: "OPTIMISM-GOERLI",
537
524
  subgraphUrl: getSubgraph("zora-create-optimism-goerli", "stable")
538
525
  },
539
526
  [import_chains.base.id]: {
540
527
  chainId: import_chains.base.id,
541
528
  isTestnet: false,
542
- zoraPathChainName: "base",
543
- zoraBackendChainName: BackendChainNamesLookup.BASE_MAINNET,
529
+ zoraCollectPathChainName: "base",
530
+ zoraBackendChainName: "BASE-MAINNET",
544
531
  subgraphUrl: getSubgraph("zora-create-base-mainnet", "stable")
545
532
  },
546
533
  [import_chains.baseGoerli.id]: {
547
534
  chainId: import_chains.baseGoerli.id,
548
535
  isTestnet: true,
549
- zoraPathChainName: "bgor",
550
- zoraBackendChainName: BackendChainNamesLookup.BASE_GOERLI,
536
+ zoraCollectPathChainName: "bgor",
537
+ zoraBackendChainName: "BASE-GOERLI",
551
538
  subgraphUrl: getSubgraph("zora-create-base-goerli", "stable")
552
539
  },
553
540
  [import_chains.foundry.id]: {
554
541
  chainId: import_chains.foundry.id,
555
542
  isTestnet: true,
556
- zoraPathChainName: "zgor",
557
- zoraBackendChainName: BackendChainNamesLookup.ZORA_GOERLI,
543
+ zoraCollectPathChainName: "zgor",
544
+ zoraBackendChainName: "ZORA-GOERLI",
558
545
  subgraphUrl: getSubgraph("zora-create-zora-testnet", "stable")
559
546
  }
560
547
  };
@@ -642,7 +629,9 @@ var convertPremintFromApi = (premint) => {
642
629
  return {
643
630
  premintConfigVersion: "1" /* V1 */,
644
631
  premintConfig: {
645
- ...premint,
632
+ deleted: premint.deleted,
633
+ uid: premint.uid,
634
+ version: premint.version,
646
635
  tokenConfig: {
647
636
  ...tokenConfig,
648
637
  fixedPriceMinter: tokenConfig.fixedPriceMinter,
@@ -660,7 +649,9 @@ var convertPremintFromApi = (premint) => {
660
649
  return {
661
650
  premintConfigVersion: "2" /* V2 */,
662
651
  premintConfig: {
663
- ...premint,
652
+ deleted: premint.deleted,
653
+ uid: premint.uid,
654
+ version: premint.version,
664
655
  tokenConfig: {
665
656
  ...tokenConfig,
666
657
  fixedPriceMinter: tokenConfig.fixedPriceMinter,
@@ -686,6 +677,7 @@ var encodePremintV1ForAPI = ({
686
677
  ...premint
687
678
  }) => ({
688
679
  ...premint,
680
+ config_version: "1",
689
681
  tokenConfig: {
690
682
  ...tokenConfig,
691
683
  maxSupply: tokenConfig.maxSupply.toString(),
@@ -700,6 +692,7 @@ var encodePremintV2ForAPI = ({
700
692
  ...premint
701
693
  }) => ({
702
694
  ...premint,
695
+ config_version: "2",
703
696
  tokenConfig: {
704
697
  ...tokenConfig,
705
698
  maxSupply: tokenConfig.maxSupply.toString(),
@@ -829,11 +822,12 @@ var defaultTokenConfigV2MintArguments = () => ({
829
822
  // 10%,
830
823
  });
831
824
  var makeTokenConfigWithDefaults = ({
825
+ chainId,
832
826
  premintConfigVersion,
833
827
  tokenCreationConfig,
834
828
  creatorAccount
835
829
  }) => {
836
- const fixedPriceMinter = tokenCreationConfig.fixedPriceMinter || getDefaultFixedPriceMinterAddress();
830
+ const fixedPriceMinter = tokenCreationConfig.fixedPriceMinter || getDefaultFixedPriceMinterAddress(chainId);
837
831
  if (premintConfigVersion === "1" /* V1 */) {
838
832
  return {
839
833
  fixedPriceMinter,
@@ -1035,7 +1029,8 @@ var PremintClient = class {
1035
1029
  tokenConfig: makeTokenConfigWithDefaults({
1036
1030
  premintConfigVersion: actualVersion,
1037
1031
  tokenCreationConfig,
1038
- creatorAccount
1032
+ creatorAccount,
1033
+ chainId: this.chain.id
1039
1034
  }),
1040
1035
  uid: uidToUse
1041
1036
  });
@@ -1113,13 +1108,13 @@ var PremintClient = class {
1113
1108
  async getMintCosts({
1114
1109
  tokenContract,
1115
1110
  quantityToMint,
1116
- tokenCreationConfig
1111
+ pricePerToken
1117
1112
  }) {
1118
1113
  return await getPremintMintCosts({
1119
1114
  publicClient: this.publicClient,
1120
1115
  quantityToMint,
1121
1116
  tokenContract,
1122
- tokenPrice: tokenCreationConfig.pricePerToken
1117
+ tokenPrice: pricePerToken
1123
1118
  });
1124
1119
  }
1125
1120
  /**
@@ -1137,13 +1132,13 @@ var PremintClient = class {
1137
1132
  async makeMintParameters({
1138
1133
  uid,
1139
1134
  tokenContract,
1140
- account,
1135
+ minterAccount,
1141
1136
  mintArguments
1142
1137
  }) {
1143
1138
  if (mintArguments && mintArguments?.quantityToMint < 1) {
1144
1139
  throw new Error("Quantity to mint cannot be below 1");
1145
1140
  }
1146
- if (!account) {
1141
+ if (!minterAccount) {
1147
1142
  throw new Error("Wallet not passed in");
1148
1143
  }
1149
1144
  const { premintConfig, premintConfigVersion, collection, signature } = await this.getPremintSignature({
@@ -1159,7 +1154,7 @@ var PremintClient = class {
1159
1154
  })).totalCost;
1160
1155
  const mintArgumentsContract = {
1161
1156
  mintComment: mintArguments?.mintComment || "",
1162
- mintRecipient: mintArguments?.mintRecipient || (typeof account === "string" ? account : account.address),
1157
+ mintRecipient: mintArguments?.mintRecipient || (typeof minterAccount === "string" ? minterAccount : minterAccount.address),
1163
1158
  mintRewardsRecipients: makeMintRewardsRecipient({
1164
1159
  mintReferral: mintArguments?.mintReferral,
1165
1160
  platformReferral: mintArguments?.platformReferral
@@ -1167,7 +1162,7 @@ var PremintClient = class {
1167
1162
  };
1168
1163
  if (premintConfigVersion === "1" /* V1 */) {
1169
1164
  return {
1170
- account,
1165
+ account: minterAccount,
1171
1166
  abi: import_protocol_deployments2.zoraCreator1155PremintExecutorImplABI,
1172
1167
  functionName: "premintV1",
1173
1168
  value,
@@ -1181,17 +1176,15 @@ var PremintClient = class {
1181
1176
  ]
1182
1177
  };
1183
1178
  } else if (premintConfigVersion === "2" /* V2 */) {
1184
- const toPost = premintConfig;
1185
1179
  return {
1186
- account,
1180
+ account: minterAccount,
1187
1181
  abi: import_protocol_deployments2.zoraCreator1155PremintExecutorImplABI,
1188
1182
  functionName: "premintV2",
1189
1183
  value,
1190
1184
  address: getPremintExecutorAddress(),
1191
- // args are: ContractCreationConfig calldata contractConfig, PremintConfigV2 calldata premintConfig, bytes calldata signature, uint256 quantityToMint, MintArguments calldata mintArguments
1192
1185
  args: [
1193
1186
  collection,
1194
- toPost,
1187
+ premintConfig,
1195
1188
  signature,
1196
1189
  numberToMint,
1197
1190
  mintArgumentsContract
@@ -1221,8 +1214,8 @@ function makeUrls({
1221
1214
  const network = getApiNetworkConfigForChain(chain.id);
1222
1215
  return {
1223
1216
  explorer: tokenId ? `https://${chain.blockExplorers?.default.url}/token/${address}/instance/${tokenId}` : null,
1224
- zoraCollect: `https://${network.isTestnet ? "testnet." : ""}zora.co/collect/${network.zoraPathChainName}:${address}/${zoraTokenPath}`,
1225
- zoraManage: `https://${network.isTestnet ? "testnet." : ""}zora.co/collect/${network.zoraPathChainName}:${address}/${zoraTokenPath}`
1217
+ zoraCollect: `https://${network.isTestnet ? "testnet." : ""}zora.co/collect/${network.zoraCollectPathChainName}:${address}/${zoraTokenPath}`,
1218
+ zoraManage: `https://${network.isTestnet ? "testnet." : ""}zora.co/collect/${network.zoraCollectPathChainName}:${address}/${zoraTokenPath}`
1226
1219
  };
1227
1220
  }
1228
1221
  async function signAndSubmitPremint({
@@ -1253,14 +1246,12 @@ async function signAndSubmitPremint({
1253
1246
  if (checkSignature) {
1254
1247
  const isAuthorized = await isAuthorizedToCreatePremint({
1255
1248
  collection,
1256
- signature,
1257
1249
  publicClient,
1258
1250
  signer: typeof account === "string" ? account : account.address,
1259
1251
  collectionAddress: await getPremintCollectionAddress({
1260
1252
  collection,
1261
1253
  publicClient
1262
- }),
1263
- ...premintConfigAndVersion
1254
+ })
1264
1255
  });
1265
1256
  if (!isAuthorized) {
1266
1257
  throw new Error("Not authorized to create premint");
@@ -1273,9 +1264,6 @@ async function signAndSubmitPremint({
1273
1264
  });
1274
1265
  return { premint, verifyingContract };
1275
1266
  }
1276
- function getDefaultFixedPriceMinterAddress() {
1277
- return import_protocol_deployments2.zoraCreatorFixedPriceSaleStrategyAddress[999];
1278
- }
1279
1267
 
1280
1268
  // src/mint/mint-client.ts
1281
1269
  var import_viem5 = require("viem");
@@ -1680,6 +1668,7 @@ function create1155CreatorClient({
1680
1668
  encodePostSignatureInput,
1681
1669
  encodePremintForAPI,
1682
1670
  getApiNetworkConfigForChain,
1671
+ getDefaultFixedPriceMinterAddress,
1683
1672
  getMintCosts,
1684
1673
  getPremintCollectionAddress,
1685
1674
  getPremintExecutorAddress,