@zoralabs/protocol-sdk 0.5.3 → 0.5.4-exports.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/CHANGELOG.md +7 -0
- package/package.json +10 -2
- package/src/preminter.ts +1 -1
- package/.turbo/turbo-build.log +0 -16
- package/dist/anvil.d.ts +0 -36
- package/dist/anvil.d.ts.map +0 -1
- package/dist/apis/chain-constants.d.ts +0 -13
- package/dist/apis/chain-constants.d.ts.map +0 -1
- package/dist/apis/client-base.d.ts +0 -15
- package/dist/apis/client-base.d.ts.map +0 -1
- package/dist/apis/generated/premint-api-types.d.ts +0 -460
- package/dist/apis/generated/premint-api-types.d.ts.map +0 -1
- package/dist/apis/http-api-base.d.ts +0 -32
- package/dist/apis/http-api-base.d.ts.map +0 -1
- package/dist/constants.d.ts +0 -36
- package/dist/constants.d.ts.map +0 -1
- package/dist/create/1155-create-helper.d.ts +0 -62
- package/dist/create/1155-create-helper.d.ts.map +0 -1
- package/dist/index.cjs +0 -1694
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -1664
- package/dist/index.js.map +0 -1
- package/dist/mint/mint-api-client.d.ts +0 -27
- package/dist/mint/mint-api-client.d.ts.map +0 -1
- package/dist/mint/mint-client.d.ts +0 -61
- package/dist/mint/mint-client.d.ts.map +0 -1
- package/dist/premint/contract-types.d.ts +0 -125
- package/dist/premint/contract-types.d.ts.map +0 -1
- package/dist/premint/conversions.d.ts +0 -78
- package/dist/premint/conversions.d.ts.map +0 -1
- package/dist/premint/premint-api-client.d.ts +0 -32
- package/dist/premint/premint-api-client.d.ts.map +0 -1
- package/dist/premint/premint-client.d.ts +0 -203
- package/dist/premint/premint-client.d.ts.map +0 -1
- package/dist/premint/preminter.d.ts +0 -121
- package/dist/premint/preminter.d.ts.map +0 -1
- package/dist/preminter.d.ts +0 -36
- package/dist/preminter.d.ts.map +0 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.d.ts.map +0 -1
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import type { Account, Address, Chain, Hex, PublicClient, SimulateContractParameters, TransactionReceipt, WalletClient } from "viem";
|
|
2
|
-
import { zoraCreator1155PremintExecutorImplABI } from "@zoralabs/protocol-deployments";
|
|
3
|
-
import { PremintConfigVersion, ContractCreationConfig, TokenConfigForVersion, TokenCreationConfigV1, TokenCreationConfigV2, TokenCreationConfig, PremintConfigForVersion } from "./contract-types";
|
|
4
|
-
import { PremintAPIClient } from "./premint-api-client";
|
|
5
|
-
import type { DecodeEventLogReturnType } from "viem";
|
|
6
|
-
import { IHttpClient } from "src/apis/http-api-base";
|
|
7
|
-
import { MintCosts } from "src/mint/mint-client";
|
|
8
|
-
type PremintedV2LogType = DecodeEventLogReturnType<typeof zoraCreator1155PremintExecutorImplABI, "PremintedV2">["args"];
|
|
9
|
-
type URLSReturnType = {
|
|
10
|
-
explorer: null | string;
|
|
11
|
-
zoraCollect: null | string;
|
|
12
|
-
zoraManage: null | string;
|
|
13
|
-
};
|
|
14
|
-
type SignedPremintResponse = {
|
|
15
|
-
urls: URLSReturnType;
|
|
16
|
-
uid: number;
|
|
17
|
-
verifyingContract: Address;
|
|
18
|
-
};
|
|
19
|
-
export declare const defaultTokenConfigV1MintArguments: () => Omit<TokenCreationConfigV1, "fixedPriceMinter" | "tokenURI" | "royaltyRecipient">;
|
|
20
|
-
export declare const defaultTokenConfigV2MintArguments: () => Omit<TokenCreationConfigV2, "fixedPriceMinter" | "tokenURI" | "payoutRecipient" | "createReferral">;
|
|
21
|
-
/**
|
|
22
|
-
* Gets the preminted log from receipt
|
|
23
|
-
*
|
|
24
|
-
* @param receipt Preminted log from receipt
|
|
25
|
-
* @returns Premint event arguments
|
|
26
|
-
*/
|
|
27
|
-
export declare function getPremintedLogFromReceipt(receipt: TransactionReceipt): PremintedV2LogType | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Preminter API to access ZORA Premint functionality.
|
|
30
|
-
* Currently only supports V1 premints.
|
|
31
|
-
*/
|
|
32
|
-
declare class PremintClient {
|
|
33
|
-
readonly apiClient: PremintAPIClient;
|
|
34
|
-
readonly publicClient: PublicClient;
|
|
35
|
-
readonly chain: Chain;
|
|
36
|
-
constructor(chain: Chain, publicClient?: PublicClient, httpClient?: IHttpClient);
|
|
37
|
-
getDataFromPremintReceipt(receipt: TransactionReceipt): {
|
|
38
|
-
premintedLog: {
|
|
39
|
-
contractAddress: `0x${string}`;
|
|
40
|
-
tokenId: bigint;
|
|
41
|
-
createdNewContract: boolean;
|
|
42
|
-
uid: number;
|
|
43
|
-
minter: `0x${string}`;
|
|
44
|
-
quantityMinted: bigint;
|
|
45
|
-
} | undefined;
|
|
46
|
-
urls: URLSReturnType;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Update existing premint given collection address and UID of existing premint.
|
|
50
|
-
*
|
|
51
|
-
* 1. Loads existing premint token
|
|
52
|
-
* 2. Updates with settings passed into function
|
|
53
|
-
* 3. Increments the version field
|
|
54
|
-
* 4. Re-signs the premint
|
|
55
|
-
* 5. Uploads the premint to the ZORA API
|
|
56
|
-
*
|
|
57
|
-
* Updates existing premint
|
|
58
|
-
* @param settings Settings for the new premint
|
|
59
|
-
* @param settings.account Account to sign the premint update from. Taken from walletClient if none passed in.
|
|
60
|
-
* @param settings.collection Collection information for the mint
|
|
61
|
-
* @param settings.walletClient viem wallet client to use to sign
|
|
62
|
-
* @param settings.uid UID
|
|
63
|
-
* @param settings.token Mint argument settings, optional settings are overridden with sensible defaults.
|
|
64
|
-
*
|
|
65
|
-
*/
|
|
66
|
-
updatePremint({ walletClient, uid, collection, account, tokenConfigUpdates, }: {
|
|
67
|
-
walletClient: WalletClient;
|
|
68
|
-
uid: number;
|
|
69
|
-
account?: Account | Address;
|
|
70
|
-
collection: Address;
|
|
71
|
-
tokenConfigUpdates: Partial<TokenCreationConfig>;
|
|
72
|
-
}): Promise<SignedPremintResponse>;
|
|
73
|
-
/**
|
|
74
|
-
* Delete premint.
|
|
75
|
-
*
|
|
76
|
-
* 1. Loads current premint from collection address with UID
|
|
77
|
-
* 2. Increments version and marks as deleted
|
|
78
|
-
* 3. Signs new premint version
|
|
79
|
-
* 4. Sends to ZORA Premint API
|
|
80
|
-
*
|
|
81
|
-
* Deletes existing premint
|
|
82
|
-
* @param settings.collection collection address
|
|
83
|
-
* @param settings.uid UID
|
|
84
|
-
* @param settings.walletClient viem wallet client to use to sign
|
|
85
|
-
*
|
|
86
|
-
*/
|
|
87
|
-
deletePremint({ walletClient, uid, account, collection, }: {
|
|
88
|
-
walletClient: WalletClient;
|
|
89
|
-
uid: number;
|
|
90
|
-
account?: Account | Address;
|
|
91
|
-
collection: Address;
|
|
92
|
-
}): Promise<SignedPremintResponse>;
|
|
93
|
-
/**
|
|
94
|
-
* Internal function to sign and submit a premint request.
|
|
95
|
-
*
|
|
96
|
-
* @param premintArguments Arguments to premint
|
|
97
|
-
* @returns
|
|
98
|
-
*/
|
|
99
|
-
private signAndSubmitPremint;
|
|
100
|
-
/**
|
|
101
|
-
* Create premint
|
|
102
|
-
*
|
|
103
|
-
* @param settings Settings for the new premint
|
|
104
|
-
* @param settings.account Account to sign the premint with. Taken from walletClient if none passed in.
|
|
105
|
-
* @param settings.collection Collection information for the mint
|
|
106
|
-
* @param settings.tokenCreationConfig Mint argument settings, optional settings are overridden with sensible defaults.
|
|
107
|
-
* @param setings.premintConfigVersion Premint config version to use, defaults to V2
|
|
108
|
-
* @param settings.uid the UID to use – optional and retrieved as a fresh UID from ZORA by default.
|
|
109
|
-
* @param settings.checkSignature if the signature should have a pre-flight check. Not required but helpful for debugging.
|
|
110
|
-
* @returns premint url, uid, newContractAddress, and premint object
|
|
111
|
-
*/
|
|
112
|
-
createPremint<T extends PremintConfigVersion = PremintConfigVersion.V1>({ creatorAccount, collection, tokenCreationConfig, premintConfigVersion, walletClient, uid, checkSignature, }: {
|
|
113
|
-
creatorAccount: Address | Account;
|
|
114
|
-
checkSignature?: boolean;
|
|
115
|
-
walletClient: WalletClient;
|
|
116
|
-
collection: ContractCreationConfig;
|
|
117
|
-
tokenCreationConfig: Partial<TokenConfigForVersion<T>> & {
|
|
118
|
-
tokenURI: string;
|
|
119
|
-
};
|
|
120
|
-
premintConfigVersion?: T;
|
|
121
|
-
uid?: number;
|
|
122
|
-
}): Promise<SignedPremintResponse>;
|
|
123
|
-
/**
|
|
124
|
-
* Fetches given premint data from the ZORA API.
|
|
125
|
-
*
|
|
126
|
-
* @param address Address for the premint contract
|
|
127
|
-
* @param uid UID for the desired premint
|
|
128
|
-
* @returns PremintSignatureGetResponse of premint data from the API
|
|
129
|
-
*/
|
|
130
|
-
getPremintSignature({ address, uid, }: {
|
|
131
|
-
address: Address;
|
|
132
|
-
uid: number;
|
|
133
|
-
}): Promise<{
|
|
134
|
-
signature: `0x${string}`;
|
|
135
|
-
collection: {
|
|
136
|
-
contractAdmin: `0x${string}`;
|
|
137
|
-
contractURI: string;
|
|
138
|
-
contractName: string;
|
|
139
|
-
};
|
|
140
|
-
} & import("./contract-types").PremintConfigAndVersion>;
|
|
141
|
-
/**
|
|
142
|
-
* Gets the deterministic contract address for a premint collection
|
|
143
|
-
* @param collection Collection to get the address for
|
|
144
|
-
* @returns deterministic contract address
|
|
145
|
-
*/
|
|
146
|
-
getCollectionAddress(collection: ContractCreationConfig): Promise<`0x${string}`>;
|
|
147
|
-
/**
|
|
148
|
-
* Check user signature for v1
|
|
149
|
-
*
|
|
150
|
-
* @param data Signature data from the API
|
|
151
|
-
* @returns isValid = signature is valid or not, recoveredSigner = signer from contract
|
|
152
|
-
*/
|
|
153
|
-
isValidSignature<T extends PremintConfigVersion>({ signature, collection, premintConfig, premintConfigVersion, }: {
|
|
154
|
-
signature: Hex;
|
|
155
|
-
collection: ContractCreationConfig;
|
|
156
|
-
premintConfig: PremintConfigForVersion<T>;
|
|
157
|
-
premintConfigVersion?: T;
|
|
158
|
-
}): Promise<{
|
|
159
|
-
isValid: boolean;
|
|
160
|
-
recoveredSigner: Address | undefined;
|
|
161
|
-
}>;
|
|
162
|
-
protected makeUrls({ uid, address, tokenId, }: {
|
|
163
|
-
uid?: number;
|
|
164
|
-
tokenId?: bigint;
|
|
165
|
-
address?: Address;
|
|
166
|
-
}): URLSReturnType;
|
|
167
|
-
getMintCosts({ tokenContract, quantityToMint, pricePerToken, }: {
|
|
168
|
-
quantityToMint: bigint;
|
|
169
|
-
tokenContract: Address;
|
|
170
|
-
pricePerToken: bigint;
|
|
171
|
-
}): Promise<MintCosts>;
|
|
172
|
-
/**
|
|
173
|
-
* Execute premint on-chain
|
|
174
|
-
*
|
|
175
|
-
* @param settings.data Data from the API for the mint
|
|
176
|
-
* @param settings.account Optional account (if omitted taken from wallet client) for the account executing the premint.
|
|
177
|
-
* @param settings.walletClient WalletClient to send execution from.
|
|
178
|
-
* @param settings.mintArguments User minting arguments.
|
|
179
|
-
* @param settings.mintArguments.quantityToMint Quantity to mint, optional, defaults to 1.
|
|
180
|
-
* @param settings.mintArguments.mintComment Optional mint comment, optional, omits when not included.
|
|
181
|
-
* @param settings.publicClient Optional public client for preflight checks.
|
|
182
|
-
* @returns receipt, log, zoraURL
|
|
183
|
-
*/
|
|
184
|
-
makeMintParameters({ uid, tokenContract, minterAccount, mintArguments, }: {
|
|
185
|
-
uid: number;
|
|
186
|
-
tokenContract: Address;
|
|
187
|
-
minterAccount: Account | Address;
|
|
188
|
-
mintArguments?: {
|
|
189
|
-
quantityToMint: number;
|
|
190
|
-
mintComment?: string;
|
|
191
|
-
mintReferral?: Address;
|
|
192
|
-
platformReferral?: Address;
|
|
193
|
-
mintRecipient?: Address;
|
|
194
|
-
};
|
|
195
|
-
}): Promise<SimulateContractParameters>;
|
|
196
|
-
}
|
|
197
|
-
export declare function createPremintClient({ chain, httpClient, publicClient, }: {
|
|
198
|
-
chain: Chain;
|
|
199
|
-
publicClient?: PublicClient;
|
|
200
|
-
httpClient?: IHttpClient;
|
|
201
|
-
}): PremintClient;
|
|
202
|
-
export {};
|
|
203
|
-
//# sourceMappingURL=premint-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,YAAY,EACb,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,qCAAqC,EAAE,MAAM,gCAAgC,CAAC;AAevF,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EAErB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EAExB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,KAAK,kBAAkB,GAAG,wBAAwB,CAChD,OAAO,qCAAqC,EAC5C,aAAa,CACd,CAAC,MAAM,CAAC,CAAC;AAEV,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,iCAAiC,QAAO,KACnD,qBAAqB,EACrB,kBAAkB,GAAG,UAAU,GAAG,kBAAkB,CASpD,CAAC;AAEH,eAAO,MAAM,iCAA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AAa,EACb,cAAc,EACd,aAAa,GACd,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,SAAS,CAAC;IAStB;;;;;;;;;;;OAWG;IACG,kBAAkB,CAAC,EACvB,GAAG,EACH,aAAa,EACb,aAAa,EACb,aAAa,GACd,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC;QACjC,aAAa,CAAC,EAAE;YACd,cAAc,EAAE,MAAM,CAAC;YACvB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,YAAY,CAAC,EAAE,OAAO,CAAC;YACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;YAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;SACzB,CAAC;KACH,GAAG,OAAO,CAAC,0BAA0B,CAAC;CA+ExC;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,121 +0,0 @@
|
|
|
1
|
-
import { Address } from "abitype";
|
|
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
|
-
import { MintCosts } from "src/mint/mint-client";
|
|
6
|
-
export declare const getPremintExecutorAddress: () => "0x7777773606e7e46C8Ba8B98C08f5cD218e31d340";
|
|
7
|
-
/**
|
|
8
|
-
* Creates a typed data definition for a premint config. Works for all versions of the premint config by specifying the premintConfigVersion.
|
|
9
|
-
*
|
|
10
|
-
* @param params.verifyingContract the address of the 1155 contract
|
|
11
|
-
* @param params.chainId the chain id the premint is signed for
|
|
12
|
-
* @param params.premintConfigVersion the version of the premint config
|
|
13
|
-
* @param params.premintConfig the premint config
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export declare const premintTypedDataDefinition: <T extends PremintConfigVersion>({ verifyingContract, chainId, premintConfigVersion: version, premintConfig, }: {
|
|
17
|
-
verifyingContract: Address;
|
|
18
|
-
chainId: number;
|
|
19
|
-
} & PremintConfigWithVersion<T>) => TypedDataDefinition;
|
|
20
|
-
export type IsValidSignatureReturn = {
|
|
21
|
-
isAuthorized: boolean;
|
|
22
|
-
recoveredAddress?: Address;
|
|
23
|
-
};
|
|
24
|
-
export declare function isAuthorizedToCreatePremint({ collection, collectionAddress, publicClient, signer, }: {
|
|
25
|
-
collection: ContractCreationConfig;
|
|
26
|
-
collectionAddress: Address;
|
|
27
|
-
publicClient: PublicClient;
|
|
28
|
-
signer: Address;
|
|
29
|
-
}): 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>;
|
|
106
|
-
export declare function getPremintMintFee({ tokenContract, publicClient, }: {
|
|
107
|
-
tokenContract: Address;
|
|
108
|
-
publicClient: PublicClient;
|
|
109
|
-
}): Promise<bigint>;
|
|
110
|
-
export declare function getPremintMintCosts({ publicClient, tokenContract, tokenPrice, quantityToMint, }: {
|
|
111
|
-
tokenContract: Address;
|
|
112
|
-
tokenPrice: bigint;
|
|
113
|
-
quantityToMint: bigint;
|
|
114
|
-
publicClient: PublicClient;
|
|
115
|
-
}): Promise<MintCosts>;
|
|
116
|
-
export declare function makeMintRewardsRecipient({ mintReferral, platformReferral, }: {
|
|
117
|
-
mintReferral?: Address;
|
|
118
|
-
platformReferral?: Address;
|
|
119
|
-
}): Address[];
|
|
120
|
-
export declare function getDefaultFixedPriceMinterAddress(chainId: number): Address;
|
|
121
|
-
//# sourceMappingURL=preminter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAIvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBAAmB,EAEnB,GAAG,EACH,YAAY,EAMZ,YAAY,EAEb,MAAM,MAAM,CAAC;AACd,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,mCAAmC,EACnC,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EAExB,mBAAmB,EAGpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,eAAO,MAAM,yBAAyB,oDACU,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;uBAMlB,OAAO;aACjB,MAAM;oCACiB,mBAyBjC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,wBAAsB,2BAA2B,CAAC,EAChD,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,MAAM,GACP,EAAE;IACD,UAAU,EAAE,sBAAsB,CAAC;IACnC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;CACjB,oBAQA;AAED,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,oBAAoB,EAAE,EACzE,SAAS,EACT,GAAG,IAAI,EACR,EAAE;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EAAE,CAEZ;AAED,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI1E"}
|
package/dist/preminter.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Address } from "abitype";
|
|
2
|
-
import { ExtractAbiFunction, AbiParametersToPrimitiveTypes } from "abitype";
|
|
3
|
-
import { zoraCreator1155PremintExecutorImplABI as preminterAbi } from "@zoralabs/protocol-deployments";
|
|
4
|
-
import { TypedDataDefinition, Hex, PublicClient } from "viem";
|
|
5
|
-
type PremintInputs = ExtractAbiFunction<typeof preminterAbi, "premint">["inputs"];
|
|
6
|
-
type PreminterHashDataTypes = AbiParametersToPrimitiveTypes<PremintInputs>;
|
|
7
|
-
export type ContractCreationConfig = PreminterHashDataTypes[0];
|
|
8
|
-
export type PremintConfig = PreminterHashDataTypes[1];
|
|
9
|
-
export type TokenCreationConfig = PremintConfig["tokenConfig"];
|
|
10
|
-
export declare const preminterTypedDataDefinition: ({ verifyingContract, premintConfig, chainId, }: {
|
|
11
|
-
verifyingContract: Address;
|
|
12
|
-
premintConfig: PremintConfig;
|
|
13
|
-
chainId: number;
|
|
14
|
-
}) => TypedDataDefinition<{
|
|
15
|
-
CreatorAttribution: {
|
|
16
|
-
name: string;
|
|
17
|
-
type: string;
|
|
18
|
-
}[];
|
|
19
|
-
TokenCreationConfig: {
|
|
20
|
-
name: string;
|
|
21
|
-
type: string;
|
|
22
|
-
}[];
|
|
23
|
-
}, "CreatorAttribution">;
|
|
24
|
-
export declare function isValidSignatureV1({ contractAddress, originalContractAdmin, premintConfig, signature, chainId, publicClient, }: {
|
|
25
|
-
contractAddress: Address;
|
|
26
|
-
originalContractAdmin: Address;
|
|
27
|
-
premintConfig: PremintConfig;
|
|
28
|
-
signature: Hex;
|
|
29
|
-
chainId: number;
|
|
30
|
-
publicClient: PublicClient;
|
|
31
|
-
}): Promise<{
|
|
32
|
-
isAuthorized: boolean;
|
|
33
|
-
recoveredAddress?: Address;
|
|
34
|
-
}>;
|
|
35
|
-
export {};
|
|
36
|
-
//# sourceMappingURL=preminter.d.ts.map
|
package/dist/preminter.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preminter.d.ts","sourceRoot":"","sources":["../src/preminter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EACL,qCAAqC,IAAI,YAAY,EAEtD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBAAmB,EAEnB,GAAG,EACH,YAAY,EACb,MAAM,MAAM,CAAC;AAEd,KAAK,aAAa,GAAG,kBAAkB,CACrC,OAAO,YAAY,EACnB,SAAS,CACV,CAAC,QAAQ,CAAC,CAAC;AAEZ,KAAK,sBAAsB,GAAG,6BAA6B,CAAC,aAAa,CAAC,CAAC;AAE3E,MAAM,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAC/D,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AACtD,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AAI/D,eAAO,MAAM,4BAA4B;uBAKpB,OAAO;mBACX,aAAa;aACnB,MAAM;;;;;;;;;;wBA8ChB,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,EACvC,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,OAAO,EACP,YAAY,GACb,EAAE;IACD,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,GAAG,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,YAAY,CAAC;CAC5B,GAAG,OAAO,CAAC;IACV,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC,CAqCD"}
|
package/dist/types.d.ts
DELETED
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|