@zoralabs/protocol-sdk 0.3.4 → 0.4.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.
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +34 -0
- package/README.md +30 -58
- package/dist/anvil.d.ts +4 -2
- package/dist/anvil.d.ts.map +1 -1
- package/dist/constants.d.ts +32 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.cjs +819 -518
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +788 -493
- package/dist/index.js.map +1 -1
- package/dist/mint/mint-api-client.d.ts +16 -216
- package/dist/mint/mint-api-client.d.ts.map +1 -1
- package/dist/mint/mint-client.d.ts +7 -227
- package/dist/mint/mint-client.d.ts.map +1 -1
- package/dist/premint/contract-types.d.ts +125 -0
- package/dist/premint/contract-types.d.ts.map +1 -0
- package/dist/premint/premint-api-client.d.ts +14 -7
- package/dist/premint/premint-api-client.d.ts.map +1 -1
- package/dist/premint/premint-client.d.ts +45 -115
- package/dist/premint/premint-client.d.ts.map +1 -1
- package/dist/premint/preminter.d.ts +102 -21
- package/dist/premint/preminter.d.ts.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/anvil.ts +7 -4
- package/src/constants.ts +7 -0
- package/src/index.ts +2 -0
- package/src/mint/mint-api-client.ts +72 -68
- package/src/mint/mint-client.test.ts +9 -11
- package/src/mint/mint-client.ts +51 -221
- package/src/premint/contract-types.ts +109 -0
- package/src/premint/premint-api-client.ts +162 -22
- package/src/premint/premint-client.test.ts +186 -84
- package/src/premint/premint-client.ts +357 -289
- package/src/premint/preminter.test.ts +209 -130
- package/src/premint/preminter.ts +377 -54
- package/src/types.ts +1 -0
- package/dist/apis/generated/discover-api-types.d.ts +0 -2131
- package/dist/apis/generated/discover-api-types.d.ts.map +0 -1
- package/src/apis/generated/discover-api-types.ts +0 -2180
|
@@ -2,25 +2,32 @@ import { IHttpClient } from "../apis/http-api-base";
|
|
|
2
2
|
import { components, paths } from "../apis/generated/premint-api-types";
|
|
3
3
|
import { ZORA_API_BASE } from "../constants";
|
|
4
4
|
import { NetworkConfig } from "src/apis/chain-constants";
|
|
5
|
+
import { ContractCreationConfig, PremintConfigAndVersion, PremintConfigVersion, PremintConfigWithVersion } from "./contract-types";
|
|
6
|
+
import { Address, Hex } from "viem";
|
|
5
7
|
type SignaturePostType = paths["/signature"]["post"];
|
|
6
|
-
type PremintSignatureRequestBody = SignaturePostType["requestBody"]["content"]["application/json"];
|
|
7
8
|
export type PremintSignatureResponse = SignaturePostType["responses"][200]["content"]["application/json"];
|
|
8
9
|
type PremintNextUIDGetType = paths["/signature/{chain_name}/{collection_address}/next_uid"]["get"];
|
|
9
|
-
type PremintNextUIDGetPathParameters = PremintNextUIDGetType["parameters"]["path"];
|
|
10
10
|
export type PremintNextUIDGetResponse = PremintNextUIDGetType["responses"][200]["content"]["application/json"];
|
|
11
11
|
type SignaturePremintGetType = paths["/signature/{chain_name}/{collection_address}/{uid}"]["get"];
|
|
12
|
-
type PremintSignatureGetPathParameters = SignaturePremintGetType["parameters"]["path"];
|
|
13
12
|
export type PremintSignatureGetResponse = SignaturePremintGetType["responses"][200]["content"]["application/json"];
|
|
14
13
|
export type PremintCollection = PremintSignatureGetResponse["collection"];
|
|
15
14
|
export type BackendChainNames = components["schemas"]["ChainName"];
|
|
16
|
-
type OmitChainName<T> = Omit<T, "chain_name">;
|
|
17
15
|
declare class PremintAPIClient {
|
|
18
16
|
httpClient: IHttpClient;
|
|
19
17
|
networkConfig: NetworkConfig;
|
|
20
18
|
constructor(chainId: number, httpClient?: IHttpClient);
|
|
21
|
-
postSignature:
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
postSignature: <T extends PremintConfigVersion>({ collection, premintConfigVersion, premintConfig, signature, }: {
|
|
20
|
+
collection: ContractCreationConfig;
|
|
21
|
+
signature: Hex;
|
|
22
|
+
} & PremintConfigWithVersion<T>) => Promise<PremintSignatureResponse>;
|
|
23
|
+
getNextUID: (collectionAddress: Address) => Promise<number>;
|
|
24
|
+
getSignature: ({ collectionAddress, uid, }: {
|
|
25
|
+
collectionAddress: Address;
|
|
26
|
+
uid: number;
|
|
27
|
+
}) => Promise<{
|
|
28
|
+
signature: Hex;
|
|
29
|
+
collection: ContractCreationConfig;
|
|
30
|
+
} & PremintConfigAndVersion>;
|
|
24
31
|
}
|
|
25
32
|
export { ZORA_API_BASE, PremintAPIClient };
|
|
26
33
|
//# sourceMappingURL=premint-api-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"premint-api-client.d.ts","sourceRoot":"","sources":["../../src/premint/premint-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"premint-api-client.d.ts","sourceRoot":"","sources":["../../src/premint/premint-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EAIvB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEpC,KAAK,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAA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icClient, SimulateContractParameters, TransactionReceipt, WalletClient } from "viem";
|
|
1
|
+
import type { Account, Address, Chain, Hex, PublicClient, SimulateContractParameters, TransactionReceipt, WalletClient } from "viem";
|
|
2
2
|
import { zoraCreator1155PremintExecutorImplABI } from "@zoralabs/protocol-deployments";
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
3
|
+
import { PremintConfigVersion, ContractCreationConfig, TokenConfigForVersion, TokenCreationConfigV1, TokenCreationConfigV2, TokenCreationConfig, PremintConfigForVersion } from "./contract-types";
|
|
4
|
+
import type { PremintSignatureResponse } from "./premint-api-client";
|
|
5
5
|
import { PremintAPIClient } from "./premint-api-client";
|
|
6
6
|
import type { DecodeEventLogReturnType } from "viem";
|
|
7
7
|
import { IHttpClient } from "src/apis/http-api-base";
|
|
8
|
-
type MintArgumentsSettings = {
|
|
9
|
-
tokenURI: string;
|
|
10
|
-
maxSupply?: bigint;
|
|
11
|
-
maxTokensPerAddress?: bigint;
|
|
12
|
-
pricePerToken?: bigint;
|
|
13
|
-
mintStart?: bigint;
|
|
14
|
-
mintDuration?: bigint;
|
|
15
|
-
royaltyMintSchedule?: number;
|
|
16
|
-
royaltyBPS?: number;
|
|
17
|
-
royaltyRecipient?: Address;
|
|
18
|
-
fixedPriceMinter?: Address;
|
|
19
|
-
};
|
|
20
8
|
type PremintedLogType = DecodeEventLogReturnType<typeof zoraCreator1155PremintExecutorImplABI, "Preminted">["args"];
|
|
21
9
|
type URLSReturnType = {
|
|
22
10
|
explorer: null | string;
|
|
@@ -29,15 +17,8 @@ type SignedPremintResponse = {
|
|
|
29
17
|
verifyingContract: Address;
|
|
30
18
|
premint: PremintSignatureResponse;
|
|
31
19
|
};
|
|
32
|
-
export declare const
|
|
33
|
-
|
|
34
|
-
maxTokensPerAddress: bigint;
|
|
35
|
-
pricePerToken: bigint;
|
|
36
|
-
mintDuration: bigint;
|
|
37
|
-
mintStart: bigint;
|
|
38
|
-
royaltyMintSchedule: number;
|
|
39
|
-
royaltyBPS: number;
|
|
40
|
-
};
|
|
20
|
+
export declare const defaultTokenConfigV1MintArguments: () => Omit<TokenCreationConfigV1, "fixedPriceMinter" | "tokenURI" | "royaltyRecipient">;
|
|
21
|
+
export declare const defaultTokenConfigV2MintArguments: () => Omit<TokenCreationConfigV2, "fixedPriceMinter" | "tokenURI" | "payoutRecipient" | "createReferral">;
|
|
41
22
|
/**
|
|
42
23
|
* Gets the preminted log from receipt
|
|
43
24
|
*
|
|
@@ -45,57 +26,6 @@ export declare const DefaultMintArguments: {
|
|
|
45
26
|
* @returns Premint event arguments
|
|
46
27
|
*/
|
|
47
28
|
export declare function getPremintedLogFromReceipt(receipt: TransactionReceipt): PremintedLogType | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Convert server to on-chain types for a premint
|
|
50
|
-
*
|
|
51
|
-
* @param premint Premint object from the server to convert to one that's compatible with viem
|
|
52
|
-
* @returns Viem type-compatible premint object
|
|
53
|
-
*/
|
|
54
|
-
export declare const convertPremint: (premint: PremintSignatureGetResponse["premint"]) => {
|
|
55
|
-
tokenConfig: {
|
|
56
|
-
fixedPriceMinter: `0x${string}`;
|
|
57
|
-
royaltyRecipient: `0x${string}`;
|
|
58
|
-
maxSupply: bigint;
|
|
59
|
-
pricePerToken: bigint;
|
|
60
|
-
mintStart: bigint;
|
|
61
|
-
mintDuration: bigint;
|
|
62
|
-
maxTokensPerAddress: bigint;
|
|
63
|
-
tokenURI: string;
|
|
64
|
-
royaltyMintSchedule: number;
|
|
65
|
-
royaltyBPS: number;
|
|
66
|
-
};
|
|
67
|
-
uid: number;
|
|
68
|
-
version: number;
|
|
69
|
-
deleted: boolean;
|
|
70
|
-
};
|
|
71
|
-
export declare const convertCollection: (collection: PremintSignatureGetResponse["collection"]) => {
|
|
72
|
-
contractAdmin: `0x${string}`;
|
|
73
|
-
contractURI: string;
|
|
74
|
-
contractName: string;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Convert on-chain types for a premint to a server safe type
|
|
78
|
-
*
|
|
79
|
-
* @param premint Premint object from viem to convert to a JSON compatible type.
|
|
80
|
-
* @returns JSON compatible premint
|
|
81
|
-
*/
|
|
82
|
-
export declare const encodePremintForAPI: ({ tokenConfig, ...premint }: PremintConfig) => {
|
|
83
|
-
tokenConfig: {
|
|
84
|
-
maxSupply: string;
|
|
85
|
-
pricePerToken: string;
|
|
86
|
-
mintStart: string;
|
|
87
|
-
mintDuration: string;
|
|
88
|
-
maxTokensPerAddress: string;
|
|
89
|
-
tokenURI: string;
|
|
90
|
-
royaltyMintSchedule: number;
|
|
91
|
-
royaltyBPS: number;
|
|
92
|
-
royaltyRecipient: `0x${string}`;
|
|
93
|
-
fixedPriceMinter: `0x${string}`;
|
|
94
|
-
};
|
|
95
|
-
uid: number;
|
|
96
|
-
version: number;
|
|
97
|
-
deleted: boolean;
|
|
98
|
-
};
|
|
99
29
|
/**
|
|
100
30
|
* Preminter API to access ZORA Premint functionality.
|
|
101
31
|
* Currently only supports V1 premints.
|
|
@@ -105,21 +35,6 @@ declare class PremintClient {
|
|
|
105
35
|
readonly publicClient: PublicClient;
|
|
106
36
|
readonly chain: Chain;
|
|
107
37
|
constructor(chain: Chain, publicClient?: PublicClient, httpClient?: IHttpClient);
|
|
108
|
-
/**
|
|
109
|
-
* The premint executor address is deployed to the same address across all chains.
|
|
110
|
-
* Can be overridden as needed by making a parent class.
|
|
111
|
-
*
|
|
112
|
-
* @returns Executor address for premints
|
|
113
|
-
*/
|
|
114
|
-
getExecutorAddress(): "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340";
|
|
115
|
-
/**
|
|
116
|
-
* The fixed price minter address is the same across all chains for our current
|
|
117
|
-
* deployer strategy.
|
|
118
|
-
* Can be overridden as needed by making a parent class.
|
|
119
|
-
*
|
|
120
|
-
* @returns Fixed price sale strategy
|
|
121
|
-
*/
|
|
122
|
-
getFixedPriceMinterAddress(): "0x04E2516A2c207E84a1839755675dfd8eF6302F0a";
|
|
123
38
|
getDataFromPremintReceipt(receipt: TransactionReceipt): {
|
|
124
39
|
premintedLog: {
|
|
125
40
|
contractAddress: `0x${string}`;
|
|
@@ -166,12 +81,12 @@ declare class PremintClient {
|
|
|
166
81
|
* @param settings.token Mint argument settings, optional settings are overridden with sensible defaults.
|
|
167
82
|
*
|
|
168
83
|
*/
|
|
169
|
-
updatePremint({ walletClient, uid, collection,
|
|
84
|
+
updatePremint({ walletClient, uid, collection, account, tokenConfigUpdates, }: {
|
|
170
85
|
walletClient: WalletClient;
|
|
171
86
|
uid: number;
|
|
172
|
-
token: MintArgumentsSettings;
|
|
173
87
|
account?: Account | Address;
|
|
174
88
|
collection: Address;
|
|
89
|
+
tokenConfigUpdates: Partial<TokenCreationConfig>;
|
|
175
90
|
}): Promise<SignedPremintResponse>;
|
|
176
91
|
/**
|
|
177
92
|
* Delete premint.
|
|
@@ -236,25 +151,22 @@ declare class PremintClient {
|
|
|
236
151
|
* @param settings Settings for the new premint
|
|
237
152
|
* @param settings.account Account to sign the premint with. Taken from walletClient if none passed in.
|
|
238
153
|
* @param settings.collection Collection information for the mint
|
|
239
|
-
* @param settings.
|
|
240
|
-
* @param
|
|
241
|
-
* @param settings.
|
|
242
|
-
* @param settings.executionSettings Execution settings for premint options
|
|
243
|
-
* @param settings.executionSettings.deleted If this UID should be deleted. If omitted, set to false.
|
|
244
|
-
* @param settings.executionSettings.uid the UID to use – optional and retrieved as a fresh UID from ZORA by default.
|
|
154
|
+
* @param settings.tokenCreationConfig Mint argument settings, optional settings are overridden with sensible defaults.
|
|
155
|
+
* @param setings.premintConfigVersion Premint config version to use, defaults to V2
|
|
156
|
+
* @param settings.uid the UID to use – optional and retrieved as a fresh UID from ZORA by default.
|
|
245
157
|
* @param settings.checkSignature if the signature should have a pre-flight check. Not required but helpful for debugging.
|
|
246
158
|
* @returns premint url, uid, newContractAddress, and premint object
|
|
247
159
|
*/
|
|
248
|
-
createPremint({
|
|
249
|
-
|
|
160
|
+
createPremint<T extends PremintConfigVersion = PremintConfigVersion.V1>({ creatorAccount, collection, tokenCreationConfig, premintConfigVersion, walletClient, uid, checkSignature, }: {
|
|
161
|
+
creatorAccount: Address;
|
|
250
162
|
checkSignature?: boolean;
|
|
251
163
|
walletClient: WalletClient;
|
|
252
|
-
collection:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
deleted?: boolean;
|
|
256
|
-
uid?: number;
|
|
164
|
+
collection: ContractCreationConfig;
|
|
165
|
+
tokenCreationConfig: Partial<TokenConfigForVersion<T>> & {
|
|
166
|
+
tokenURI: string;
|
|
257
167
|
};
|
|
168
|
+
premintConfigVersion?: T;
|
|
169
|
+
uid?: number;
|
|
258
170
|
}): Promise<{
|
|
259
171
|
urls: URLSReturnType;
|
|
260
172
|
uid: number;
|
|
@@ -293,22 +205,37 @@ declare class PremintClient {
|
|
|
293
205
|
* @param uid UID for the desired premint
|
|
294
206
|
* @returns PremintSignatureGetResponse of premint data from the API
|
|
295
207
|
*/
|
|
296
|
-
|
|
297
|
-
address:
|
|
208
|
+
getPremintSignature({ address, uid, }: {
|
|
209
|
+
address: Address;
|
|
298
210
|
uid: number;
|
|
299
|
-
}): Promise<
|
|
211
|
+
}): Promise<{
|
|
212
|
+
signature: `0x${string}`;
|
|
213
|
+
collection: {
|
|
214
|
+
contractAdmin: `0x${string}`;
|
|
215
|
+
contractURI: string;
|
|
216
|
+
contractName: string;
|
|
217
|
+
};
|
|
218
|
+
} & import("./contract-types").PremintConfigAndVersion>;
|
|
219
|
+
/**
|
|
220
|
+
* Gets the deterministic contract address for a premint collection
|
|
221
|
+
* @param collection Collection to get the address for
|
|
222
|
+
* @returns deterministic contract address
|
|
223
|
+
*/
|
|
224
|
+
getCollectionAddress(collection: ContractCreationConfig): Promise<`0x${string}`>;
|
|
300
225
|
/**
|
|
301
226
|
* Check user signature for v1
|
|
302
227
|
*
|
|
303
228
|
* @param data Signature data from the API
|
|
304
|
-
* @returns isValid = signature is valid or not,
|
|
229
|
+
* @returns isValid = signature is valid or not, recoveredSigner = signer from contract
|
|
305
230
|
*/
|
|
306
|
-
isValidSignature({
|
|
307
|
-
|
|
231
|
+
isValidSignature<T extends PremintConfigVersion>({ signature, collection, premintConfig, premintConfigVersion, }: {
|
|
232
|
+
signature: Hex;
|
|
233
|
+
collection: ContractCreationConfig;
|
|
234
|
+
premintConfig: PremintConfigForVersion<T>;
|
|
235
|
+
premintConfigVersion?: T;
|
|
308
236
|
}): Promise<{
|
|
309
237
|
isValid: boolean;
|
|
310
|
-
|
|
311
|
-
recoveredSigner: Address;
|
|
238
|
+
recoveredSigner: Address | undefined;
|
|
312
239
|
}>;
|
|
313
240
|
protected makeUrls({ uid, address, tokenId, }: {
|
|
314
241
|
uid?: number;
|
|
@@ -327,12 +254,15 @@ declare class PremintClient {
|
|
|
327
254
|
* @param settings.publicClient Optional public client for preflight checks.
|
|
328
255
|
* @returns receipt, log, zoraURL
|
|
329
256
|
*/
|
|
330
|
-
makeMintParameters({
|
|
331
|
-
|
|
257
|
+
makeMintParameters({ uid, tokenContract, account, mintArguments, }: {
|
|
258
|
+
uid: number;
|
|
259
|
+
tokenContract: Address;
|
|
332
260
|
account: Account | Address;
|
|
333
261
|
mintArguments?: {
|
|
334
262
|
quantityToMint: number;
|
|
335
263
|
mintComment?: string;
|
|
264
|
+
mintReferral?: Address;
|
|
265
|
+
mintRecipient?: Address;
|
|
336
266
|
};
|
|
337
267
|
}): Promise<SimulateContractParameters>;
|
|
338
268
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"premint-client.d.ts","sourceRoot":"","sources":["../../src/premint/premint-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,KAAK,
|
|
1
|
+
{"version":3,"file":"premint-client.d.ts","sourceRoot":"","sources":["../../src/premint/premint-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,KAAK,EACL,GAAG,EACH,YAAY,EACZ,0BAA0B,EAC1B,kBAAkB,EAClB,YA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O,GAAG,OAAO,CAAC;QAC3B,aAAa,CAAC,EAAE;YACd,cAAc,EAAE,MAAM,CAAC;YACvB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,YAAY,CAAC,EAAE,OAAO,CAAC;YACvB,aAAa,CAAC,EAAE,OAAO,CAAC;SACzB,CAAC;KACH,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAoExC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,UAAU,EACV,YAAY,GACb,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B,iBAEA"}
|
|
@@ -1,25 +1,106 @@
|
|
|
1
1
|
import { Address } from "abitype";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { zoraCreator1155ImplABI } from "@zoralabs/protocol-deployments";
|
|
3
|
+
import { TypedDataDefinition, Hex, PublicClient, GetEventArgs } from "viem";
|
|
4
|
+
import { ContractCreationConfig, PremintConfig, PremintConfigForTokenCreationConfig, PremintConfigV1, PremintConfigV2, PremintConfigVersion, PremintConfigWithVersion, TokenCreationConfig } from "./contract-types";
|
|
5
|
+
export declare const getPremintExecutorAddress: () => "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340";
|
|
6
|
+
/**
|
|
7
|
+
* Creates a typed data definition for a premint config. Works for all versions of the premint config by specifying the premintConfigVersion.
|
|
8
|
+
*
|
|
9
|
+
* @param params.verifyingContract the address of the 1155 contract
|
|
10
|
+
* @param params.chainId the chain id the premint is signed for
|
|
11
|
+
* @param params.premintConfigVersion the version of the premint config
|
|
12
|
+
* @param params.premintConfig the premint config
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const premintTypedDataDefinition: <T extends PremintConfigVersion>({ verifyingContract, chainId, premintConfigVersion: version, premintConfig, }: {
|
|
11
16
|
verifyingContract: Address;
|
|
12
|
-
premintConfig: PremintConfig;
|
|
13
17
|
chainId: number;
|
|
14
|
-
}) => TypedDataDefinition
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
} & PremintConfigWithVersion<T>) => TypedDataDefinition;
|
|
19
|
+
export type IsValidSignatureReturn = {
|
|
20
|
+
isAuthorized: boolean;
|
|
21
|
+
recoveredAddress?: Address;
|
|
22
|
+
};
|
|
23
|
+
export declare function isAuthorizedToCreatePremint<T extends PremintConfigVersion>({ collection, collectionAddress, publicClient, premintConfig, premintConfigVersion, signature, signer, }: {
|
|
24
|
+
collection: ContractCreationConfig;
|
|
25
|
+
collectionAddress: Address;
|
|
26
|
+
publicClient: PublicClient;
|
|
27
|
+
signature: Hex;
|
|
28
|
+
signer: Address;
|
|
29
|
+
} & PremintConfigWithVersion<T>): Promise<boolean>;
|
|
30
|
+
export declare function recoverPremintSigner<T extends PremintConfigVersion>({ signature, ...rest }: {
|
|
31
|
+
signature: Hex;
|
|
32
|
+
chainId: number;
|
|
33
|
+
verifyingContract: Address;
|
|
34
|
+
} & PremintConfigWithVersion<T>): Promise<Address>;
|
|
35
|
+
export declare function tryRecoverPremintSigner(params: Parameters<typeof recoverPremintSigner>[0]): Promise<`0x${string}` | undefined>;
|
|
36
|
+
/**
|
|
37
|
+
* Recovers the address from a typed data signature and then checks if the recovered address is authorized to create a premint
|
|
38
|
+
*
|
|
39
|
+
* @param params validationProperties
|
|
40
|
+
* @param params.typedData typed data definition for premint config
|
|
41
|
+
* @param params.signature signature to validate
|
|
42
|
+
* @param params.publicClient public rpc read-only client
|
|
43
|
+
* @param params.premintConfigContractAdmin the original contractAdmin on the ContractCreationConfig for the premint; this is usually the original creator of the premint
|
|
44
|
+
* @param params.tokenContract the address of the 1155 contract
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
export declare function isValidSignature<T extends PremintConfigVersion>({ signature, publicClient, collection, chainId, ...premintConfigAndVersion }: {
|
|
48
|
+
collection: ContractCreationConfig;
|
|
49
|
+
signature: Hex;
|
|
50
|
+
chainId: number;
|
|
51
|
+
publicClient: PublicClient;
|
|
52
|
+
} & PremintConfigWithVersion<T>): Promise<IsValidSignatureReturn>;
|
|
53
|
+
/**
|
|
54
|
+
* Converts a premint config from v1 to v2
|
|
55
|
+
*
|
|
56
|
+
* @param premintConfig premint config to convert
|
|
57
|
+
* @param createReferral address that referred the creator, that will receive create referral rewards for the created token
|
|
58
|
+
*/
|
|
59
|
+
export declare function migratePremintConfigToV2({ premintConfig, createReferral, }: {
|
|
60
|
+
premintConfig: PremintConfigV1;
|
|
61
|
+
createReferral: Address;
|
|
62
|
+
}): PremintConfigV2;
|
|
63
|
+
export type CreatorAttributionEventParams = GetEventArgs<typeof zoraCreator1155ImplABI, "CreatorAttribution", {
|
|
64
|
+
EnableUnion: false;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Recovers the address from a CreatorAttribution event emitted from a ZoraCreator1155 contract
|
|
68
|
+
* Useful for verifying that the creator of a token is the one who signed a premint for its creation.
|
|
69
|
+
*
|
|
70
|
+
|
|
71
|
+
* @param creatorAttribution parameters from the CreatorAttribution event
|
|
72
|
+
* @param chainId the chain id of the current chain
|
|
73
|
+
* @param tokenContract the address of the 1155 contract
|
|
74
|
+
* @returns the address of the signer
|
|
75
|
+
*/
|
|
76
|
+
export declare const recoverCreatorFromCreatorAttribution: ({ creatorAttribution: { version, domainName, structHash, signature }, chainId, tokenContract, }: {
|
|
77
|
+
creatorAttribution: CreatorAttributionEventParams;
|
|
78
|
+
tokenContract: Address;
|
|
79
|
+
chainId: number;
|
|
80
|
+
}) => Promise<`0x${string}`>;
|
|
81
|
+
export declare const supportedPremintVersions: ({ tokenContract, publicClient, }: {
|
|
82
|
+
tokenContract: Address;
|
|
83
|
+
publicClient: PublicClient;
|
|
84
|
+
}) => Promise<readonly string[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Checks if the 1155 contract at that address supports the given version of the premint config.
|
|
87
|
+
*/
|
|
88
|
+
export declare const supportsPremintVersion: ({ version, tokenContract, publicClient, }: {
|
|
89
|
+
version: PremintConfigVersion;
|
|
90
|
+
tokenContract: Address;
|
|
91
|
+
publicClient: PublicClient;
|
|
92
|
+
}) => Promise<boolean>;
|
|
93
|
+
export declare function getPremintCollectionAddress({ collection, publicClient, }: {
|
|
94
|
+
collection: ContractCreationConfig;
|
|
95
|
+
publicClient: PublicClient;
|
|
96
|
+
}): Promise<Address>;
|
|
97
|
+
export declare function markPremintDeleted<T extends PremintConfig>(premintConfig: T): T;
|
|
98
|
+
export declare function applyUpdateToPremint({ uid, version, tokenConfig, tokenConfigUpdates, }: {
|
|
99
|
+
tokenConfig: TokenCreationConfig;
|
|
100
|
+
tokenConfigUpdates: Partial<TokenCreationConfig>;
|
|
101
|
+
} & Pick<PremintConfig, "uid" | "version">): PremintConfig;
|
|
102
|
+
export declare function makeNewPremint<T extends TokenCreationConfig>({ tokenConfig, uid, }: {
|
|
103
|
+
tokenConfig: T;
|
|
104
|
+
uid: number;
|
|
105
|
+
}): PremintConfigForTokenCreationConfig<T>;
|
|
25
106
|
//# sourceMappingURL=preminter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preminter.d.ts","sourceRoot":"","sources":["../../src/premint/preminter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"preminter.d.ts","sourceRoot":"","sources":["../../src/premint/preminter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAEL,sBAAsB,EAGvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBA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nB,EAAE;IACD,WAAW,EAAE,mBAAmB,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAClD,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,SAAS,CAAC,GAAG,aAAa,CAczD;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,mBAAmB,EAAE,EAC5D,WAAW,EACX,GAAG,GACJ,EAAE;IACD,WAAW,EAAE,CAAC,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,mCAAmC,CAAC,CAAC,CAAC,CAOzC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
package/package.json
CHANGED
package/src/anvil.ts
CHANGED
|
@@ -28,13 +28,15 @@ async function waitForAnvilInit(anvil: any) {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export type AnvilTestForkSettings = {
|
|
32
|
+
forkUrl: string;
|
|
33
|
+
forkBlockNumber: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
31
36
|
export const makeAnvilTest = ({
|
|
32
37
|
forkUrl,
|
|
33
38
|
forkBlockNumber,
|
|
34
|
-
}:
|
|
35
|
-
forkUrl: string;
|
|
36
|
-
forkBlockNumber: number;
|
|
37
|
-
}) =>
|
|
39
|
+
}: AnvilTestForkSettings) =>
|
|
38
40
|
test.extend<AnvilViemClientsTest>({
|
|
39
41
|
viemClients: async ({ task }, use) => {
|
|
40
42
|
console.log("setting up clients for ", task.name);
|
|
@@ -93,6 +95,7 @@ export const makeAnvilTest = ({
|
|
|
93
95
|
export const forkUrls = {
|
|
94
96
|
zoraMainnet: "https://rpc.zora.co/",
|
|
95
97
|
zoraGoerli: "https://testnet.rpc.zora.co",
|
|
98
|
+
zoraSepolia: "https://sepolia.rpc.zora.energy",
|
|
96
99
|
};
|
|
97
100
|
|
|
98
101
|
export const anvilTest = makeAnvilTest({
|
package/src/constants.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { parseAbi } from "viem";
|
|
2
|
+
|
|
1
3
|
export const ZORA_API_BASE = "https://api.zora.co/";
|
|
2
4
|
export const OPEN_EDITION_MINT_SIZE = BigInt("18446744073709551615");
|
|
3
5
|
|
|
@@ -8,3 +10,8 @@ const SUBGRAPH_CONFIG_BASE =
|
|
|
8
10
|
export function getSubgraph(name: string, version: string): string {
|
|
9
11
|
return `${SUBGRAPH_CONFIG_BASE}/${name}/${version}/gn`;
|
|
10
12
|
}
|
|
13
|
+
|
|
14
|
+
export const zora721Abi = parseAbi([
|
|
15
|
+
"function mintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral) external payable",
|
|
16
|
+
"function zoraFeeForAmount(uint256 amount) public view returns (address, uint256)",
|
|
17
|
+
] as const);
|