@zoralabs/protocol-sdk 0.5.12 → 0.5.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.
package/dist/index.js CHANGED
@@ -6811,55 +6811,6 @@ import {
6811
6811
  } from "viem";
6812
6812
 
6813
6813
  // src/premint/contract-types.ts
6814
- var v1Types = {
6815
- CreatorAttribution: [
6816
- { name: "tokenConfig", type: "TokenCreationConfig" },
6817
- // unique id scoped to the contract and token to create.
6818
- // ensure that a signature can be replaced, as long as the replacement
6819
- // has the same uid, and a newer version.
6820
- { name: "uid", type: "uint32" },
6821
- { name: "version", type: "uint32" },
6822
- // if this update should result in the signature being deleted.
6823
- { name: "deleted", type: "bool" }
6824
- ],
6825
- TokenCreationConfig: [
6826
- { name: "tokenURI", type: "string" },
6827
- { name: "maxSupply", type: "uint256" },
6828
- { name: "maxTokensPerAddress", type: "uint64" },
6829
- { name: "pricePerToken", type: "uint96" },
6830
- { name: "mintStart", type: "uint64" },
6831
- { name: "mintDuration", type: "uint64" },
6832
- { name: "royaltyMintSchedule", type: "uint32" },
6833
- { name: "royaltyBPS", type: "uint32" },
6834
- { name: "royaltyRecipient", type: "address" },
6835
- { name: "fixedPriceMinter", type: "address" }
6836
- ]
6837
- };
6838
- var v2Types = {
6839
- CreatorAttribution: [
6840
- { name: "tokenConfig", type: "TokenCreationConfig" },
6841
- // unique id scoped to the contract and token to create.
6842
- // ensure that a signature can be replaced, as long as the replacement
6843
- // has the same uid, and a newer version.
6844
- { name: "uid", type: "uint32" },
6845
- { name: "version", type: "uint32" },
6846
- // if this update should result in the signature being deleted.
6847
- { name: "deleted", type: "bool" }
6848
- ],
6849
- TokenCreationConfig: [
6850
- { name: "tokenURI", type: "string" },
6851
- { name: "maxSupply", type: "uint256" },
6852
- { name: "maxTokensPerAddress", type: "uint64" },
6853
- { name: "pricePerToken", type: "uint96" },
6854
- { name: "mintStart", type: "uint64" },
6855
- { name: "mintDuration", type: "uint64" },
6856
- { name: "royaltyBPS", type: "uint32" },
6857
- { name: "payoutRecipient", type: "address" },
6858
- { name: "fixedPriceMinter", type: "address" },
6859
- { name: "createReferral", type: "address" }
6860
- ]
6861
- };
6862
- var PreminterDomain = "Preminter";
6863
6814
  var PremintConfigVersion = /* @__PURE__ */ ((PremintConfigVersion2) => {
6864
6815
  PremintConfigVersion2["V1"] = "1";
6865
6816
  PremintConfigVersion2["V2"] = "2";
@@ -6867,6 +6818,10 @@ var PremintConfigVersion = /* @__PURE__ */ ((PremintConfigVersion2) => {
6867
6818
  })(PremintConfigVersion || {});
6868
6819
 
6869
6820
  // src/premint/preminter.ts
6821
+ import {
6822
+ premintV1TypedDataDefinition,
6823
+ premintV2TypedDataDefinition
6824
+ } from "@zoralabs/protocol-deployments";
6870
6825
  var getPremintExecutorAddress = () => zoraCreator1155PremintExecutorImplAddress[999];
6871
6826
  var premintTypedDataDefinition = ({
6872
6827
  verifyingContract,
@@ -6874,26 +6829,18 @@ var premintTypedDataDefinition = ({
6874
6829
  premintConfigVersion: version,
6875
6830
  premintConfig
6876
6831
  }) => {
6877
- const domain = {
6878
- chainId,
6879
- name: PreminterDomain,
6880
- version,
6881
- verifyingContract
6882
- };
6883
6832
  if (version === "1" /* V1 */)
6884
- return {
6885
- domain,
6886
- types: v1Types,
6887
- message: premintConfig,
6888
- primaryType: "CreatorAttribution"
6889
- };
6833
+ return premintV1TypedDataDefinition({
6834
+ chainId,
6835
+ creator1155Contract: verifyingContract,
6836
+ message: premintConfig
6837
+ });
6890
6838
  if (version === "2" /* V2 */) {
6891
- return {
6892
- domain,
6893
- types: v2Types,
6894
- message: premintConfig,
6895
- primaryType: "CreatorAttribution"
6896
- };
6839
+ return premintV2TypedDataDefinition({
6840
+ chainId,
6841
+ creator1155Contract: verifyingContract,
6842
+ message: premintConfig
6843
+ });
6897
6844
  }
6898
6845
  throw new Error(`Invalid version ${version}`);
6899
6846
  };
@@ -11718,6 +11665,8 @@ var sumBalances = (mintAccountBalances) => {
11718
11665
 
11719
11666
  // src/mints/mints-contracts.ts
11720
11667
  import {
11668
+ mintsSafeTransferBatchTypedDataDefinition,
11669
+ mintsSafeTransferTypedDataDefinition,
11721
11670
  zoraMints1155Config,
11722
11671
  zoraMintsManagerImplABI,
11723
11672
  zoraMintsManagerImplAddress,
@@ -11834,11 +11783,13 @@ function makePermitTransferBatchAndTypeData({
11834
11783
  nonce,
11835
11784
  safeTransferData
11836
11785
  };
11837
- const typedData = permitBatchTypedDataDefinition({
11838
- chainId,
11839
- permit,
11786
+ const typedData = {
11787
+ ...mintsSafeTransferBatchTypedDataDefinition({
11788
+ chainId,
11789
+ message: permit
11790
+ }),
11840
11791
  account: mintsOwner
11841
- });
11792
+ };
11842
11793
  return {
11843
11794
  permit,
11844
11795
  typedData
@@ -11863,11 +11814,13 @@ function makePermitTransferTypeData({
11863
11814
  nonce,
11864
11815
  safeTransferData
11865
11816
  };
11866
- const typedData = permitTransferTypedDataDefinition({
11867
- chainId,
11868
- permit,
11817
+ const typedData = {
11818
+ ...mintsSafeTransferTypedDataDefinition({
11819
+ chainId,
11820
+ message: permit
11821
+ }),
11869
11822
  account: mintsOwner
11870
- });
11823
+ };
11871
11824
  return {
11872
11825
  permit,
11873
11826
  typedData
@@ -11942,109 +11895,6 @@ function collectPremintV2WithMintsParams({
11942
11895
  account
11943
11896
  });
11944
11897
  }
11945
- function makeTypeData(args) {
11946
- return args;
11947
- }
11948
- function permitBatchTypedDataDefinition({
11949
- permit,
11950
- chainId,
11951
- account
11952
- }) {
11953
- return makeTypeData({
11954
- primaryType: "Permit",
11955
- types: {
11956
- Permit: [
11957
- {
11958
- name: "owner",
11959
- type: "address"
11960
- },
11961
- {
11962
- name: "to",
11963
- type: "address"
11964
- },
11965
- {
11966
- name: "tokenIds",
11967
- type: "uint256[]"
11968
- },
11969
- {
11970
- name: "quantities",
11971
- type: "uint256[]"
11972
- },
11973
- {
11974
- name: "safeTransferData",
11975
- type: "bytes"
11976
- },
11977
- {
11978
- name: "nonce",
11979
- type: "uint256"
11980
- },
11981
- {
11982
- name: "deadline",
11983
- type: "uint256"
11984
- }
11985
- ]
11986
- },
11987
- message: permit,
11988
- domain: {
11989
- chainId,
11990
- name: "Mints",
11991
- version: "1",
11992
- verifyingContract: zoraMints1155Config.address[chainId]
11993
- },
11994
- // signing account must be permit owner
11995
- account
11996
- });
11997
- }
11998
- function permitTransferTypedDataDefinition({
11999
- permit,
12000
- chainId,
12001
- account
12002
- }) {
12003
- return makeTypeData({
12004
- primaryType: "PermitSafeTransfer",
12005
- types: {
12006
- PermitSafeTransfer: [
12007
- {
12008
- name: "owner",
12009
- type: "address"
12010
- },
12011
- {
12012
- name: "to",
12013
- type: "address"
12014
- },
12015
- {
12016
- name: "tokenId",
12017
- type: "uint256"
12018
- },
12019
- {
12020
- name: "quantity",
12021
- type: "uint256"
12022
- },
12023
- {
12024
- name: "safeTransferData",
12025
- type: "bytes"
12026
- },
12027
- {
12028
- name: "nonce",
12029
- type: "uint256"
12030
- },
12031
- {
12032
- name: "deadline",
12033
- type: "uint256"
12034
- }
12035
- ]
12036
- },
12037
- message: permit,
12038
- domain: {
12039
- chainId,
12040
- name: "Mints",
12041
- version: "1",
12042
- verifyingContract: zoraMints1155Config.address[chainId]
12043
- },
12044
- // signing account must be permit owner
12045
- account
12046
- });
12047
- }
12048
11898
  function decodeCallFailedError(error) {
12049
11899
  if (error.data?.errorName !== "CallFailed")
12050
11900
  throw new Error("Not a CallFailed error");
@@ -12095,7 +11945,6 @@ export {
12095
11945
  MintAPIClient,
12096
11946
  PremintAPIClient,
12097
11947
  PremintConfigVersion,
12098
- PreminterDomain,
12099
11948
  ZORA_API_BASE,
12100
11949
  applyUpdateToPremint,
12101
11950
  collectPremintV2WithMintsParams,
@@ -12136,8 +11985,6 @@ export {
12136
11985
  migratePremintConfigToV2,
12137
11986
  mintWithEthParams,
12138
11987
  mintsBalanceOfAccountParams,
12139
- permitBatchTypedDataDefinition,
12140
- permitTransferTypedDataDefinition,
12141
11988
  premintTypedDataDefinition,
12142
11989
  recoverCreatorFromCreatorAttribution,
12143
11990
  recoverPremintSigner,
@@ -12146,8 +11993,6 @@ export {
12146
11993
  supportedPremintVersions,
12147
11994
  supportsPremintVersion,
12148
11995
  tryRecoverPremintSigner,
12149
- unwrapAndForwardEthPermitAndTypedDataDefinition,
12150
- v1Types,
12151
- v2Types
11996
+ unwrapAndForwardEthPermitAndTypedDataDefinition
12152
11997
  };
12153
11998
  //# sourceMappingURL=index.js.map