@zoralabs/protocol-sdk 0.7.1 → 0.7.2-ALLOWLIST.0

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 (55) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/allow-list/allow-list-client.d.ts +25 -0
  3. package/dist/allow-list/allow-list-client.d.ts.map +1 -0
  4. package/dist/allow-list/types.d.ts +14 -0
  5. package/dist/allow-list/types.d.ts.map +1 -0
  6. package/dist/apis/generated/allow-list-api-types.d.ts +288 -0
  7. package/dist/apis/generated/allow-list-api-types.d.ts.map +1 -0
  8. package/dist/apis/http-api-base.d.ts.map +1 -1
  9. package/dist/create/1155-create-helper.d.ts +1 -0
  10. package/dist/create/1155-create-helper.d.ts.map +1 -1
  11. package/dist/create/token-setup.d.ts +3 -4
  12. package/dist/create/token-setup.d.ts.map +1 -1
  13. package/dist/create/types.d.ts +24 -4
  14. package/dist/create/types.d.ts.map +1 -1
  15. package/dist/index.cjs +219 -39
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +220 -40
  20. package/dist/index.js.map +1 -1
  21. package/dist/mint/mint-queries.d.ts +3 -1
  22. package/dist/mint/mint-queries.d.ts.map +1 -1
  23. package/dist/mint/mint-transactions.d.ts +5 -3
  24. package/dist/mint/mint-transactions.d.ts.map +1 -1
  25. package/dist/mint/subgraph-mint-getter.d.ts.map +1 -1
  26. package/dist/mint/subgraph-queries.d.ts +27 -13
  27. package/dist/mint/subgraph-queries.d.ts.map +1 -1
  28. package/dist/mint/types.d.ts +22 -11
  29. package/dist/mint/types.d.ts.map +1 -1
  30. package/package.json +2 -1
  31. package/src/allow-list/allow-list-client.ts +102 -0
  32. package/src/allow-list/types.ts +15 -0
  33. package/src/apis/generated/allow-list-api-types.ts +288 -0
  34. package/src/apis/http-api-base.ts +12 -0
  35. package/src/create/1155-create-helper.ts +17 -0
  36. package/src/create/token-setup.ts +116 -19
  37. package/src/create/types.ts +32 -4
  38. package/src/index.ts +4 -0
  39. package/src/mint/mint-queries.ts +6 -0
  40. package/src/mint/mint-transactions.ts +72 -6
  41. package/src/mint/subgraph-mint-getter.ts +12 -3
  42. package/src/mint/subgraph-queries.ts +39 -17
  43. package/src/mint/types.ts +38 -12
  44. package/yarn-error.log +8602 -0
  45. package/.turbo/turbo-build.log +0 -15
  46. package/src/create/1155-create-helper.test.ts +0 -325
  47. package/src/mint/mint-client.test.ts +0 -263
  48. package/src/mints/mints-contracts.test.ts +0 -529
  49. package/src/mints/mints-eth-unwrapper-and-caller.test.ts +0 -467
  50. package/src/mints/mints-queries.test.ts +0 -105
  51. package/src/premint/premint-client.test.ts +0 -290
  52. package/src/premint/preminter.test.ts +0 -866
  53. package/test-integration/setup-test-contracts.ts +0 -96
  54. package/tsconfig.build.json +0 -10
  55. package/tsup.config.ts +0 -12
package/src/mint/types.ts CHANGED
@@ -3,6 +3,7 @@ import {
3
3
  GenericTokenIdTypes,
4
4
  SimulateContractParametersWithAccount,
5
5
  } from "src/types";
6
+ import { AllowListEntry } from "src/allow-list/types";
6
7
 
7
8
  export type MintParameters<MintType> = {
8
9
  /** Type of the collection to be minted. */
@@ -25,7 +26,7 @@ export type PremintMintParameters = MintParameters<"premint"> & {
25
26
  uid: number;
26
27
  };
27
28
 
28
- export type MintType = "1155" | "721" | "premint";
29
+ export type MintType = "1155" | "721" | "allowlist" | "premint";
29
30
 
30
31
  export type MintTypes =
31
32
  | Erc1155MintParameters
@@ -63,6 +64,8 @@ export type MintParametersBase = {
63
64
  mintRecipient?: Address;
64
65
  /** If this is a premint, the address to get the first minter reward */
65
66
  firstMinter?: Address;
67
+ /** If this is an allow list mint, the info for the allow list entry */
68
+ allowListEntry?: AllowListEntry;
66
69
  };
67
70
 
68
71
  export type MakeMintParametersArgumentsBase = MintParametersBase & {
@@ -99,40 +102,60 @@ export type GetMintCostsParameters = {
99
102
  quantityMinted: number | bigint;
100
103
  } & MintTypes;
101
104
 
102
- export type SaleType = "fixedPrice" | "erc20" | "premint";
105
+ export type SaleType = "fixedPrice" | "erc20" | "allowlist" | "premint";
103
106
 
104
107
  type SaleStrategy<T extends SaleType> = {
105
108
  saleType: T;
109
+ };
110
+
111
+ type PricedSaleStrategy = {
106
112
  pricePerToken: bigint;
107
113
  maxTokensPerAddress: bigint;
108
114
  };
109
115
 
110
- type FixedPriceSaleStrategy = SaleStrategy<"fixedPrice"> & {
111
- address: Address;
116
+ export type StartAndEnd = {
112
117
  saleStart: string;
113
118
  saleEnd: string;
114
119
  };
115
120
 
116
- type ERC20SaleStrategy = SaleStrategy<"erc20"> & {
121
+ type FixedPriceSaleStrategy = SaleStrategy<"fixedPrice"> &
122
+ PricedSaleStrategy &
123
+ StartAndEnd & {
124
+ address: Address;
125
+ };
126
+
127
+ type ERC20SaleStrategy = SaleStrategy<"erc20"> &
128
+ PricedSaleStrategy &
129
+ StartAndEnd & {
130
+ address: Address;
131
+ currency: Address;
132
+ };
133
+
134
+ type AllowListSaleStrategy = SaleStrategy<"allowlist"> & {
117
135
  address: Address;
118
136
  saleStart: string;
119
137
  saleEnd: string;
120
- currency: Address;
138
+ merkleRoot: string;
121
139
  };
122
140
 
123
- type PremintSaleStrategy = SaleStrategy<"premint"> & {
124
- duration: bigint;
125
- };
141
+ type PremintSaleStrategy = SaleStrategy<"premint"> &
142
+ PricedSaleStrategy & {
143
+ duration: bigint;
144
+ };
126
145
 
127
146
  export type SaleStrategies =
128
147
  | FixedPriceSaleStrategy
129
148
  | ERC20SaleStrategy
149
+ | AllowListSaleStrategy
130
150
  | PremintSaleStrategy;
131
151
 
132
- export type OnchainSalesStrategies = FixedPriceSaleStrategy | ERC20SaleStrategy;
152
+ export type OnchainSalesStrategies =
153
+ | FixedPriceSaleStrategy
154
+ | ERC20SaleStrategy
155
+ | AllowListSaleStrategy;
133
156
 
134
157
  export function isErc20SaleStrategy(
135
- salesConfig: FixedPriceSaleStrategy | ERC20SaleStrategy | PremintSaleStrategy,
158
+ salesConfig: SaleStrategies,
136
159
  ): salesConfig is ERC20SaleStrategy {
137
160
  return salesConfig.saleType === "erc20";
138
161
  }
@@ -173,7 +196,10 @@ export type PremintMintable = MintableBase & {
173
196
  };
174
197
 
175
198
  export type OnchainSalesConfigAndTokenInfo = {
176
- salesConfig: FixedPriceSaleStrategy | ERC20SaleStrategy;
199
+ salesConfig:
200
+ | FixedPriceSaleStrategy
201
+ | ERC20SaleStrategy
202
+ | AllowListSaleStrategy;
177
203
  } & OnchainMintable;
178
204
 
179
205
  export type PremintSalesConfigAndTokenInfo = {