@zoralabs/protocol-sdk 0.3.4 → 0.3.5
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 +22 -0
- package/README.md +7 -26
- 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 +470 -338
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +441 -313
- 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/premint-client.d.ts +63 -17
- package/dist/premint/premint-client.d.ts.map +1 -1
- package/dist/premint/preminter.d.ts +106 -19
- 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/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/premint-client.test.ts +9 -8
- package/src/premint/premint-client.ts +113 -61
- package/src/premint/preminter.test.ts +207 -130
- package/src/premint/preminter.ts +388 -51
- 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
|
@@ -1,227 +1,27 @@
|
|
|
1
1
|
import { IHttpClient } from "../apis/http-api-base";
|
|
2
|
-
import { paths } from "../apis/generated/discover-api-types";
|
|
3
2
|
import { NetworkConfig } from "src/apis/chain-constants";
|
|
3
|
+
import { GenericTokenIdTypes } from "src/types";
|
|
4
4
|
import { Address } from "viem";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
type FixedPriceSaleStrategyResult = {
|
|
6
|
+
address: Address;
|
|
7
|
+
pricePerToken: string;
|
|
8
|
+
saleEnd: string;
|
|
9
|
+
saleStart: string;
|
|
10
|
+
maxTokensPerAddress: string;
|
|
11
|
+
};
|
|
12
|
+
export type SalesConfigAndTokenInfo = {
|
|
13
|
+
fixedPrice: FixedPriceSaleStrategyResult;
|
|
14
|
+
mintFeePerQuantity: bigint;
|
|
15
|
+
};
|
|
9
16
|
export declare const getApiNetworkConfigForChain: (chainId: number) => NetworkConfig;
|
|
10
17
|
export declare class MintAPIClient {
|
|
11
18
|
httpClient: IHttpClient;
|
|
12
19
|
networkConfig: NetworkConfig;
|
|
13
20
|
constructor(chainId: number, httpClient?: IHttpClient);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}): Promise<undefined | {
|
|
19
|
-
address: Address;
|
|
20
|
-
pricePerToken: bigint;
|
|
21
|
-
}>;
|
|
22
|
-
getMintableForToken({ tokenContract, tokenId, }: {
|
|
23
|
-
tokenContract: Address;
|
|
24
|
-
tokenId?: bigint | number | string;
|
|
25
|
-
}): Promise<{
|
|
26
|
-
chain_name: "ETHEREUM-MAINNET" | "ETHEREUM-ROPSTEN" | "ETHEREUM-RINKEBY" | "ETHEREUM-GOERLI" | "ETHEREUM-SEPOLIA" | "OPTIMISM-MAINNET" | "OPTIMISM-GOERLI" | "ZORA-GOERLI" | "ZORA-MAINNET" | "BASE-MAINNET" | "BASE-GOERLI" | "PGN-MAINNET";
|
|
27
|
-
mintable_type: "FOUNDATION_DROP_COLLECTION" | "FOUNDATION_TIMED_EDITION" | "MANIFOLD_ERC1155" | "MANIFOLD_ERC721" | "ZORA_CREATE" | "ZORA_CREATE_1155" | "ZORA_CREATE_1155_B2R_REDEEM_TOKEN" | "ZORA_CREATE_1155_PREMINT_TOKEN" | "ZORA_EDITION" | "ZORA_DROP" | "INFERRED";
|
|
28
|
-
token_standard: "ERC721" | "ERC1155";
|
|
29
|
-
contract_address: string;
|
|
30
|
-
creator_address?: string | undefined;
|
|
31
|
-
token_creator?: string | undefined;
|
|
32
|
-
collection: {
|
|
33
|
-
address: string;
|
|
34
|
-
name?: string | undefined;
|
|
35
|
-
symbol?: string | undefined;
|
|
36
|
-
token_standard?: "ERC721" | "ERC1155" | undefined;
|
|
37
|
-
description?: string | undefined;
|
|
38
|
-
image?: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
token_id?: string | undefined;
|
|
41
|
-
token_name?: string | undefined;
|
|
42
|
-
mint_context?: {
|
|
43
|
-
mint_context_type?: "foundation" | undefined;
|
|
44
|
-
} | {
|
|
45
|
-
reference_tx?: string | undefined;
|
|
46
|
-
price_per_token: string;
|
|
47
|
-
function_abi: Record<string, never>;
|
|
48
|
-
function_name: string;
|
|
49
|
-
contract_address: string;
|
|
50
|
-
default_eth_value: string;
|
|
51
|
-
default_args: (string | number)[];
|
|
52
|
-
expected_tokens_returned: number;
|
|
53
|
-
user_address_arg_index?: number | undefined;
|
|
54
|
-
quantity_arg_index?: number | undefined;
|
|
55
|
-
use_proxy_contract?: boolean | undefined;
|
|
56
|
-
mint_context_type?: "inferred" | undefined;
|
|
57
|
-
} | {
|
|
58
|
-
mint_context_type?: "manifold" | undefined;
|
|
59
|
-
creator_contract_address: string;
|
|
60
|
-
claim_index: number;
|
|
61
|
-
mint_index: number;
|
|
62
|
-
merkle_proof: string;
|
|
63
|
-
} | {
|
|
64
|
-
mint_context_type?: "zora_create" | undefined;
|
|
65
|
-
purchase: string;
|
|
66
|
-
price_per_token?: string | undefined;
|
|
67
|
-
purchase_presale?: number | undefined;
|
|
68
|
-
presale_merkle_root?: string | undefined;
|
|
69
|
-
max_sale_purchase_per_address?: string | undefined;
|
|
70
|
-
contract_version?: string | undefined;
|
|
71
|
-
} | {
|
|
72
|
-
mint_context_type?: "zora_create_1155" | undefined;
|
|
73
|
-
renderer_contract?: string | undefined;
|
|
74
|
-
permissions: {
|
|
75
|
-
user?: string | undefined;
|
|
76
|
-
token_id?: number | undefined;
|
|
77
|
-
is_admin?: boolean | undefined;
|
|
78
|
-
is_minter?: boolean | undefined;
|
|
79
|
-
is_sales_manager?: boolean | undefined;
|
|
80
|
-
is_metadata_manager?: boolean | undefined;
|
|
81
|
-
is_funds_manager?: boolean | undefined;
|
|
82
|
-
}[];
|
|
83
|
-
sale_strategies: {
|
|
84
|
-
sale_strategies_type?: string | undefined;
|
|
85
|
-
fixed_price?: {
|
|
86
|
-
token_id?: number | undefined;
|
|
87
|
-
sale_start?: string | undefined;
|
|
88
|
-
sale_end?: string | undefined;
|
|
89
|
-
max_tokens_per_address?: string | undefined;
|
|
90
|
-
price_per_token?: string | undefined;
|
|
91
|
-
funds_recipient?: string | undefined;
|
|
92
|
-
} | undefined;
|
|
93
|
-
presale?: {
|
|
94
|
-
token_id?: number | undefined;
|
|
95
|
-
presale_start?: string | undefined;
|
|
96
|
-
presale_end?: string | undefined;
|
|
97
|
-
merkle_root?: string | undefined;
|
|
98
|
-
funds_recipient?: string | undefined;
|
|
99
|
-
} | undefined;
|
|
100
|
-
redeem_minter?: boolean | undefined;
|
|
101
|
-
}[];
|
|
102
|
-
royalties: {
|
|
103
|
-
token_id?: number | undefined;
|
|
104
|
-
user?: string | undefined;
|
|
105
|
-
royalty_bps?: string | undefined;
|
|
106
|
-
royaltyRecipient?: string | undefined;
|
|
107
|
-
royalty_mint_schedule?: number | undefined;
|
|
108
|
-
}[];
|
|
109
|
-
contract_version: string;
|
|
110
|
-
created_at_block: number;
|
|
111
|
-
uri?: string | undefined;
|
|
112
|
-
b2r_redeemable?: boolean | undefined;
|
|
113
|
-
} | {
|
|
114
|
-
mint_context_type?: "zora_create_premint" | undefined;
|
|
115
|
-
collection: {
|
|
116
|
-
contractAdmin: string;
|
|
117
|
-
contractURI: string;
|
|
118
|
-
contractName: string;
|
|
119
|
-
};
|
|
120
|
-
premint: {
|
|
121
|
-
tokenConfig: {
|
|
122
|
-
tokenURI: string;
|
|
123
|
-
maxSupply: string;
|
|
124
|
-
maxTokensPerAddress: string;
|
|
125
|
-
pricePerToken: string;
|
|
126
|
-
mintStart: string;
|
|
127
|
-
mintDuration: string;
|
|
128
|
-
royaltyMintSchedule: number;
|
|
129
|
-
royaltyBPS: number;
|
|
130
|
-
royaltyRecipient: string;
|
|
131
|
-
fixedPriceMinter: string;
|
|
132
|
-
};
|
|
133
|
-
uid: number;
|
|
134
|
-
version: number;
|
|
135
|
-
deleted: boolean;
|
|
136
|
-
};
|
|
137
|
-
chain_name: "ETHEREUM-MAINNET" | "ETHEREUM-ROPSTEN" | "ETHEREUM-RINKEBY" | "ETHEREUM-GOERLI" | "ETHEREUM-SEPOLIA" | "OPTIMISM-MAINNET" | "OPTIMISM-GOERLI" | "ZORA-GOERLI" | "ZORA-MAINNET" | "BASE-MAINNET" | "BASE-GOERLI" | "PGN-MAINNET";
|
|
138
|
-
signature: string;
|
|
139
|
-
} | undefined;
|
|
140
|
-
is_active: boolean;
|
|
141
|
-
cost: {
|
|
142
|
-
native_price: {
|
|
143
|
-
currency: {
|
|
144
|
-
name?: string | undefined;
|
|
145
|
-
address: string;
|
|
146
|
-
decimals?: number | undefined;
|
|
147
|
-
};
|
|
148
|
-
raw: string;
|
|
149
|
-
decimal: number;
|
|
150
|
-
};
|
|
151
|
-
block_number: number;
|
|
152
|
-
eth_price?: {
|
|
153
|
-
currency: {
|
|
154
|
-
name?: string | undefined;
|
|
155
|
-
address: string;
|
|
156
|
-
decimals?: number | undefined;
|
|
157
|
-
};
|
|
158
|
-
raw: string;
|
|
159
|
-
decimal: number;
|
|
160
|
-
} | undefined;
|
|
161
|
-
usdc_price?: {
|
|
162
|
-
currency: {
|
|
163
|
-
name?: string | undefined;
|
|
164
|
-
address: string;
|
|
165
|
-
decimals?: number | undefined;
|
|
166
|
-
};
|
|
167
|
-
raw: string;
|
|
168
|
-
decimal: number;
|
|
169
|
-
} | undefined;
|
|
170
|
-
};
|
|
171
|
-
total_mint_volume: {
|
|
172
|
-
native_price: {
|
|
173
|
-
currency: {
|
|
174
|
-
name?: string | undefined;
|
|
175
|
-
address: string;
|
|
176
|
-
decimals?: number | undefined;
|
|
177
|
-
};
|
|
178
|
-
raw: string;
|
|
179
|
-
decimal: number;
|
|
180
|
-
};
|
|
181
|
-
block_number: number;
|
|
182
|
-
eth_price?: {
|
|
183
|
-
currency: {
|
|
184
|
-
name?: string | undefined;
|
|
185
|
-
address: string;
|
|
186
|
-
decimals?: number | undefined;
|
|
187
|
-
};
|
|
188
|
-
raw: string;
|
|
189
|
-
decimal: number;
|
|
190
|
-
} | undefined;
|
|
191
|
-
usdc_price?: {
|
|
192
|
-
currency: {
|
|
193
|
-
name?: string | undefined;
|
|
194
|
-
address: string;
|
|
195
|
-
decimals?: number | undefined;
|
|
196
|
-
};
|
|
197
|
-
raw: string;
|
|
198
|
-
decimal: number;
|
|
199
|
-
} | undefined;
|
|
200
|
-
};
|
|
201
|
-
total_supply?: number | undefined;
|
|
202
|
-
total_minted: number;
|
|
203
|
-
wallet_max?: number | undefined;
|
|
204
|
-
start_datetime?: string | undefined;
|
|
205
|
-
end_datetime?: string | undefined;
|
|
206
|
-
collector_summary: {
|
|
207
|
-
num_unique_collectors: number;
|
|
208
|
-
collector_previews: {
|
|
209
|
-
address: string;
|
|
210
|
-
ens_name?: string | undefined;
|
|
211
|
-
}[];
|
|
212
|
-
};
|
|
213
|
-
metadata?: {
|
|
214
|
-
name?: string | undefined;
|
|
215
|
-
description?: string | undefined;
|
|
216
|
-
attributes: {
|
|
217
|
-
trait_type?: string | undefined;
|
|
218
|
-
value?: string | undefined;
|
|
219
|
-
display_type?: string | undefined;
|
|
220
|
-
}[];
|
|
221
|
-
} | undefined;
|
|
222
|
-
status?: "ACTIVE" | "BLOCKED" | "EXPIRED" | "INVALID_MEDIA" | "MINTED_OUT" | "DELETED" | undefined;
|
|
223
|
-
uuid?: string | undefined;
|
|
224
|
-
}>;
|
|
21
|
+
getSalesConfigAndTokenInfo({ tokenAddress, tokenId, }: {
|
|
22
|
+
tokenAddress: Address;
|
|
23
|
+
tokenId?: GenericTokenIdTypes;
|
|
24
|
+
}): Promise<SalesConfigAndTokenInfo>;
|
|
225
25
|
}
|
|
226
26
|
export {};
|
|
227
27
|
//# sourceMappingURL=mint-api-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mint-api-client.d.ts","sourceRoot":"","sources":["../../src/mint/mint-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mint-api-client.d.ts","sourceRoot":"","sources":["../../src/mint/mint-api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAwB,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,KAAK,4BAA4B,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAMF,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,4BAA4B,CAAC;IACzC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAAa,MAAM,KAAG,aAK7D,CAAC;AAEF,qBAAa,aAAa;IACxB,UAAU,EAAE,WAAW,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,WAAW;IAK/C,0BAA0B,CAAC,EAC/B,YAAY,EACZ,OAAO,GACR,EAAE;QACD,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;KAC/B,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAmErC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Address, Chain, PublicClient } from "viem";
|
|
2
2
|
import { IHttpClient } from "../apis/http-api-base";
|
|
3
|
-
import { MintAPIClient,
|
|
3
|
+
import { MintAPIClient, SalesConfigAndTokenInfo } from "./mint-api-client";
|
|
4
4
|
import { SimulateContractParameters } from "viem";
|
|
5
|
+
import { GenericTokenIdTypes } from "src/types";
|
|
5
6
|
declare class MintError extends Error {
|
|
6
7
|
}
|
|
7
8
|
declare class MintInactiveError extends Error {
|
|
@@ -20,215 +21,6 @@ declare class MintClient {
|
|
|
20
21
|
readonly apiClient: MintAPIClient;
|
|
21
22
|
readonly publicClient: PublicClient;
|
|
22
23
|
constructor(chain: Chain, publicClient?: PublicClient, httpClient?: IHttpClient);
|
|
23
|
-
/**
|
|
24
|
-
* Gets mintable information for a given token
|
|
25
|
-
* @param param0.tokenContract The contract address of the token to mint.
|
|
26
|
-
* @param param0.tokenId The token id to mint.
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
getMintable({ tokenContract, tokenId, }: {
|
|
30
|
-
tokenContract: Address;
|
|
31
|
-
tokenId?: bigint | number | string;
|
|
32
|
-
}): Promise<{
|
|
33
|
-
chain_name: "ETHEREUM-MAINNET" | "ETHEREUM-ROPSTEN" | "ETHEREUM-RINKEBY" | "ETHEREUM-GOERLI" | "ETHEREUM-SEPOLIA" | "OPTIMISM-MAINNET" | "OPTIMISM-GOERLI" | "ZORA-GOERLI" | "ZORA-MAINNET" | "BASE-MAINNET" | "BASE-GOERLI" | "PGN-MAINNET";
|
|
34
|
-
mintable_type: "FOUNDATION_DROP_COLLECTION" | "FOUNDATION_TIMED_EDITION" | "MANIFOLD_ERC1155" | "MANIFOLD_ERC721" | "ZORA_CREATE" | "ZORA_CREATE_1155" | "ZORA_CREATE_1155_B2R_REDEEM_TOKEN" | "ZORA_CREATE_1155_PREMINT_TOKEN" | "ZORA_EDITION" | "ZORA_DROP" | "INFERRED";
|
|
35
|
-
token_standard: "ERC721" | "ERC1155";
|
|
36
|
-
contract_address: string;
|
|
37
|
-
creator_address?: string | undefined;
|
|
38
|
-
token_creator?: string | undefined;
|
|
39
|
-
collection: {
|
|
40
|
-
address: string;
|
|
41
|
-
name?: string | undefined;
|
|
42
|
-
symbol?: string | undefined;
|
|
43
|
-
token_standard?: "ERC721" | "ERC1155" | undefined;
|
|
44
|
-
description?: string | undefined;
|
|
45
|
-
image?: string | undefined;
|
|
46
|
-
};
|
|
47
|
-
token_id?: string | undefined;
|
|
48
|
-
token_name?: string | undefined;
|
|
49
|
-
mint_context?: {
|
|
50
|
-
mint_context_type?: "foundation" | undefined;
|
|
51
|
-
} | {
|
|
52
|
-
reference_tx?: string | undefined;
|
|
53
|
-
price_per_token: string;
|
|
54
|
-
function_abi: Record<string, never>;
|
|
55
|
-
function_name: string;
|
|
56
|
-
contract_address: string;
|
|
57
|
-
default_eth_value: string;
|
|
58
|
-
default_args: (string | number)[];
|
|
59
|
-
expected_tokens_returned: number;
|
|
60
|
-
user_address_arg_index?: number | undefined;
|
|
61
|
-
quantity_arg_index?: number | undefined;
|
|
62
|
-
use_proxy_contract?: boolean | undefined;
|
|
63
|
-
mint_context_type?: "inferred" | undefined;
|
|
64
|
-
} | {
|
|
65
|
-
mint_context_type?: "manifold" | undefined;
|
|
66
|
-
creator_contract_address: string;
|
|
67
|
-
claim_index: number;
|
|
68
|
-
mint_index: number;
|
|
69
|
-
merkle_proof: string;
|
|
70
|
-
} | {
|
|
71
|
-
mint_context_type?: "zora_create" | undefined;
|
|
72
|
-
purchase: string;
|
|
73
|
-
price_per_token?: string | undefined;
|
|
74
|
-
purchase_presale?: number | undefined;
|
|
75
|
-
presale_merkle_root?: string | undefined;
|
|
76
|
-
max_sale_purchase_per_address?: string | undefined;
|
|
77
|
-
contract_version?: string | undefined;
|
|
78
|
-
} | {
|
|
79
|
-
mint_context_type?: "zora_create_1155" | undefined;
|
|
80
|
-
renderer_contract?: string | undefined;
|
|
81
|
-
permissions: {
|
|
82
|
-
user?: string | undefined;
|
|
83
|
-
token_id?: number | undefined;
|
|
84
|
-
is_admin?: boolean | undefined;
|
|
85
|
-
is_minter?: boolean | undefined;
|
|
86
|
-
is_sales_manager?: boolean | undefined;
|
|
87
|
-
is_metadata_manager?: boolean | undefined;
|
|
88
|
-
is_funds_manager?: boolean | undefined;
|
|
89
|
-
}[];
|
|
90
|
-
sale_strategies: {
|
|
91
|
-
sale_strategies_type?: string | undefined;
|
|
92
|
-
fixed_price?: {
|
|
93
|
-
token_id?: number | undefined;
|
|
94
|
-
sale_start?: string | undefined;
|
|
95
|
-
sale_end?: string | undefined;
|
|
96
|
-
max_tokens_per_address?: string | undefined;
|
|
97
|
-
price_per_token?: string | undefined;
|
|
98
|
-
funds_recipient?: string | undefined;
|
|
99
|
-
} | undefined;
|
|
100
|
-
presale?: {
|
|
101
|
-
token_id?: number | undefined;
|
|
102
|
-
presale_start?: string | undefined;
|
|
103
|
-
presale_end?: string | undefined;
|
|
104
|
-
merkle_root?: string | undefined;
|
|
105
|
-
funds_recipient?: string | undefined;
|
|
106
|
-
} | undefined;
|
|
107
|
-
redeem_minter?: boolean | undefined;
|
|
108
|
-
}[];
|
|
109
|
-
royalties: {
|
|
110
|
-
token_id?: number | undefined;
|
|
111
|
-
user?: string | undefined;
|
|
112
|
-
royalty_bps?: string | undefined;
|
|
113
|
-
royaltyRecipient?: string | undefined;
|
|
114
|
-
royalty_mint_schedule?: number | undefined;
|
|
115
|
-
}[];
|
|
116
|
-
contract_version: string;
|
|
117
|
-
created_at_block: number;
|
|
118
|
-
uri?: string | undefined;
|
|
119
|
-
b2r_redeemable?: boolean | undefined;
|
|
120
|
-
} | {
|
|
121
|
-
mint_context_type?: "zora_create_premint" | undefined;
|
|
122
|
-
collection: {
|
|
123
|
-
contractAdmin: string;
|
|
124
|
-
contractURI: string;
|
|
125
|
-
contractName: string;
|
|
126
|
-
};
|
|
127
|
-
premint: {
|
|
128
|
-
tokenConfig: {
|
|
129
|
-
tokenURI: string;
|
|
130
|
-
maxSupply: string;
|
|
131
|
-
maxTokensPerAddress: string;
|
|
132
|
-
pricePerToken: string;
|
|
133
|
-
mintStart: string;
|
|
134
|
-
mintDuration: string;
|
|
135
|
-
royaltyMintSchedule: number;
|
|
136
|
-
royaltyBPS: number;
|
|
137
|
-
royaltyRecipient: string;
|
|
138
|
-
fixedPriceMinter: string;
|
|
139
|
-
};
|
|
140
|
-
uid: number;
|
|
141
|
-
version: number;
|
|
142
|
-
deleted: boolean;
|
|
143
|
-
};
|
|
144
|
-
chain_name: "ETHEREUM-MAINNET" | "ETHEREUM-ROPSTEN" | "ETHEREUM-RINKEBY" | "ETHEREUM-GOERLI" | "ETHEREUM-SEPOLIA" | "OPTIMISM-MAINNET" | "OPTIMISM-GOERLI" | "ZORA-GOERLI" | "ZORA-MAINNET" | "BASE-MAINNET" | "BASE-GOERLI" | "PGN-MAINNET";
|
|
145
|
-
signature: string;
|
|
146
|
-
} | undefined;
|
|
147
|
-
is_active: boolean;
|
|
148
|
-
cost: {
|
|
149
|
-
native_price: {
|
|
150
|
-
currency: {
|
|
151
|
-
name?: string | undefined;
|
|
152
|
-
address: string;
|
|
153
|
-
decimals?: number | undefined;
|
|
154
|
-
};
|
|
155
|
-
raw: string;
|
|
156
|
-
decimal: number;
|
|
157
|
-
};
|
|
158
|
-
block_number: number;
|
|
159
|
-
eth_price?: {
|
|
160
|
-
currency: {
|
|
161
|
-
name?: string | undefined;
|
|
162
|
-
address: string;
|
|
163
|
-
decimals?: number | undefined;
|
|
164
|
-
};
|
|
165
|
-
raw: string;
|
|
166
|
-
decimal: number;
|
|
167
|
-
} | undefined;
|
|
168
|
-
usdc_price?: {
|
|
169
|
-
currency: {
|
|
170
|
-
name?: string | undefined;
|
|
171
|
-
address: string;
|
|
172
|
-
decimals?: number | undefined;
|
|
173
|
-
};
|
|
174
|
-
raw: string;
|
|
175
|
-
decimal: number;
|
|
176
|
-
} | undefined;
|
|
177
|
-
};
|
|
178
|
-
total_mint_volume: {
|
|
179
|
-
native_price: {
|
|
180
|
-
currency: {
|
|
181
|
-
name?: string | undefined;
|
|
182
|
-
address: string;
|
|
183
|
-
decimals?: number | undefined;
|
|
184
|
-
};
|
|
185
|
-
raw: string;
|
|
186
|
-
decimal: number;
|
|
187
|
-
};
|
|
188
|
-
block_number: number;
|
|
189
|
-
eth_price?: {
|
|
190
|
-
currency: {
|
|
191
|
-
name?: string | undefined;
|
|
192
|
-
address: string;
|
|
193
|
-
decimals?: number | undefined;
|
|
194
|
-
};
|
|
195
|
-
raw: string;
|
|
196
|
-
decimal: number;
|
|
197
|
-
} | undefined;
|
|
198
|
-
usdc_price?: {
|
|
199
|
-
currency: {
|
|
200
|
-
name?: string | undefined;
|
|
201
|
-
address: string;
|
|
202
|
-
decimals?: number | undefined;
|
|
203
|
-
};
|
|
204
|
-
raw: string;
|
|
205
|
-
decimal: number;
|
|
206
|
-
} | undefined;
|
|
207
|
-
};
|
|
208
|
-
total_supply?: number | undefined;
|
|
209
|
-
total_minted: number;
|
|
210
|
-
wallet_max?: number | undefined;
|
|
211
|
-
start_datetime?: string | undefined;
|
|
212
|
-
end_datetime?: string | undefined;
|
|
213
|
-
collector_summary: {
|
|
214
|
-
num_unique_collectors: number;
|
|
215
|
-
collector_previews: {
|
|
216
|
-
address: string;
|
|
217
|
-
ens_name?: string | undefined;
|
|
218
|
-
}[];
|
|
219
|
-
};
|
|
220
|
-
metadata?: {
|
|
221
|
-
name?: string | undefined;
|
|
222
|
-
description?: string | undefined;
|
|
223
|
-
attributes: {
|
|
224
|
-
trait_type?: string | undefined;
|
|
225
|
-
value?: string | undefined;
|
|
226
|
-
display_type?: string | undefined;
|
|
227
|
-
}[];
|
|
228
|
-
} | undefined;
|
|
229
|
-
status?: "ACTIVE" | "BLOCKED" | "EXPIRED" | "INVALID_MEDIA" | "MINTED_OUT" | "DELETED" | undefined;
|
|
230
|
-
uuid?: string | undefined;
|
|
231
|
-
}>;
|
|
232
24
|
/**
|
|
233
25
|
* Returns the parameters needed to prepare a transaction mint a token.
|
|
234
26
|
* @param param0.minterAccount The account that will mint the token.
|
|
@@ -238,19 +30,10 @@ declare class MintClient {
|
|
|
238
30
|
*/
|
|
239
31
|
makePrepareMintTokenParams({ ...rest }: {
|
|
240
32
|
minterAccount: Address;
|
|
241
|
-
|
|
33
|
+
tokenAddress: Address;
|
|
34
|
+
tokenId?: GenericTokenIdTypes;
|
|
242
35
|
mintArguments: MintArguments;
|
|
243
36
|
}): Promise<SimulateContractParameters>;
|
|
244
|
-
/**
|
|
245
|
-
* Returns the mintFee, sale fee, and total cost of minting x quantities of a token.
|
|
246
|
-
* @param param0.mintable The mintable token to mint.
|
|
247
|
-
* @param param0.quantityToMint The quantity of tokens to mint.
|
|
248
|
-
* @returns
|
|
249
|
-
*/
|
|
250
|
-
getMintCosts({ mintable, quantityToMint, }: {
|
|
251
|
-
mintable: Mintable;
|
|
252
|
-
quantityToMint: number | bigint;
|
|
253
|
-
}): Promise<MintCosts>;
|
|
254
37
|
}
|
|
255
38
|
/**
|
|
256
39
|
* Creates a new MintClient.
|
|
@@ -270,12 +53,9 @@ export type MintCosts = {
|
|
|
270
53
|
tokenPurchaseCost: bigint;
|
|
271
54
|
totalCost: bigint;
|
|
272
55
|
};
|
|
273
|
-
export declare function
|
|
274
|
-
|
|
275
|
-
price: bigint;
|
|
276
|
-
publicClient: PublicClient;
|
|
56
|
+
export declare function getMintCosts({ salesConfigAndTokenInfo, quantityToMint, }: {
|
|
57
|
+
salesConfigAndTokenInfo: SalesConfigAndTokenInfo;
|
|
277
58
|
quantityToMint: bigint;
|
|
278
|
-
}):
|
|
279
|
-
export type Mintable = MintableGetTokenResponse;
|
|
59
|
+
}): MintCosts;
|
|
280
60
|
export {};
|
|
281
61
|
//# sourceMappingURL=mint-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mint-client.d.ts","sourceRoot":"","sources":["../../src/mint/mint-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"mint-client.d.ts","sourceRoot":"","sources":["../../src/mint/mint-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,EACL,YAAY,EAMb,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,MAAM,CAAC;AAKlD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,cAAM,SAAU,SAAQ,KAAK;CAAG;AAChC,cAAM,iBAAkB,SAAQ,KAAK;CAAG;AAExC,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,cAAM,UAAU;IACd,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;gBAGlC,KAAK,EAAE,KAAK,EACZ,YAAY,CAAC,EAAE,YAAY,EAC3B,UAAU,CAAC,EAAE,WAAW;IAO1B;;;;;;OAMG;IACG,0BAA0B,CAAC,EAC/B,GAAG,IAAI,EACR,EAAE;QACD,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,OAAO,CAAC;QACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;QAC9B,aAAa,EAAE,aAAa,CAAC;KAC9B,GAAG,OAAO,CAAC,0BAA0B,CAAC;CAOxC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,YAAY,EACZ,UAAU,GACX,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B,cAEA;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAsE9D,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC3B,uBAAuB,EACvB,cAAc,GACf,EAAE;IACD,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,cAAc,EAAE,MAAM,CAAC;CACxB,GAAG,SAAS,CAWZ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Account, Address, Chain, PublicClient, SimulateContractParameters, TransactionReceipt, WalletClient } from "viem";
|
|
2
2
|
import { zoraCreator1155PremintExecutorImplABI } from "@zoralabs/protocol-deployments";
|
|
3
|
-
import {
|
|
3
|
+
import { PremintConfigAndVersion, PremintConfigV1, PremintConfigV2, ContractCreationConfig } from "./preminter";
|
|
4
4
|
import type { PremintSignatureGetResponse, PremintSignatureResponse } from "./premint-api-client";
|
|
5
5
|
import { PremintAPIClient } from "./premint-api-client";
|
|
6
6
|
import type { DecodeEventLogReturnType } from "viem";
|
|
@@ -51,7 +51,7 @@ export declare function getPremintedLogFromReceipt(receipt: TransactionReceipt):
|
|
|
51
51
|
* @param premint Premint object from the server to convert to one that's compatible with viem
|
|
52
52
|
* @returns Viem type-compatible premint object
|
|
53
53
|
*/
|
|
54
|
-
export declare const
|
|
54
|
+
export declare const convertPremintV1: (premint: PremintSignatureGetResponse["premint"]) => {
|
|
55
55
|
tokenConfig: {
|
|
56
56
|
fixedPriceMinter: `0x${string}`;
|
|
57
57
|
royaltyRecipient: `0x${string}`;
|
|
@@ -79,7 +79,7 @@ export declare const convertCollection: (collection: PremintSignatureGetResponse
|
|
|
79
79
|
* @param premint Premint object from viem to convert to a JSON compatible type.
|
|
80
80
|
* @returns JSON compatible premint
|
|
81
81
|
*/
|
|
82
|
-
export declare const
|
|
82
|
+
export declare const encodePremintV1ForAPI: ({ tokenConfig, ...premint }: PremintConfigV1) => {
|
|
83
83
|
tokenConfig: {
|
|
84
84
|
maxSupply: string;
|
|
85
85
|
pricePerToken: string;
|
|
@@ -96,6 +96,56 @@ export declare const encodePremintForAPI: ({ tokenConfig, ...premint }: PremintC
|
|
|
96
96
|
version: number;
|
|
97
97
|
deleted: boolean;
|
|
98
98
|
};
|
|
99
|
+
export declare const encodePremintV2ForAPI: ({ tokenConfig, ...premint }: PremintConfigV2) => {
|
|
100
|
+
tokenConfig: {
|
|
101
|
+
maxSupply: string;
|
|
102
|
+
pricePerToken: string;
|
|
103
|
+
mintStart: string;
|
|
104
|
+
mintDuration: string;
|
|
105
|
+
maxTokensPerAddress: string;
|
|
106
|
+
tokenURI: string;
|
|
107
|
+
royaltyBPS: number;
|
|
108
|
+
payoutRecipient: `0x${string}`;
|
|
109
|
+
fixedPriceMinter: `0x${string}`;
|
|
110
|
+
createReferral: `0x${string}`;
|
|
111
|
+
};
|
|
112
|
+
uid: number;
|
|
113
|
+
version: number;
|
|
114
|
+
deleted: boolean;
|
|
115
|
+
};
|
|
116
|
+
export declare const encodePremintForAPI: ({ premintConfig, premintConfigVersion, }: PremintConfigAndVersion) => {
|
|
117
|
+
tokenConfig: {
|
|
118
|
+
maxSupply: string;
|
|
119
|
+
pricePerToken: string;
|
|
120
|
+
mintStart: string;
|
|
121
|
+
mintDuration: string;
|
|
122
|
+
maxTokensPerAddress: string;
|
|
123
|
+
tokenURI: string;
|
|
124
|
+
royaltyMintSchedule: number;
|
|
125
|
+
royaltyBPS: number;
|
|
126
|
+
royaltyRecipient: `0x${string}`;
|
|
127
|
+
fixedPriceMinter: `0x${string}`;
|
|
128
|
+
};
|
|
129
|
+
uid: number;
|
|
130
|
+
version: number;
|
|
131
|
+
deleted: boolean;
|
|
132
|
+
} | {
|
|
133
|
+
tokenConfig: {
|
|
134
|
+
maxSupply: string;
|
|
135
|
+
pricePerToken: string;
|
|
136
|
+
mintStart: string;
|
|
137
|
+
mintDuration: string;
|
|
138
|
+
maxTokensPerAddress: string;
|
|
139
|
+
tokenURI: string;
|
|
140
|
+
royaltyBPS: number;
|
|
141
|
+
payoutRecipient: `0x${string}`;
|
|
142
|
+
fixedPriceMinter: `0x${string}`;
|
|
143
|
+
createReferral: `0x${string}`;
|
|
144
|
+
};
|
|
145
|
+
uid: number;
|
|
146
|
+
version: number;
|
|
147
|
+
deleted: boolean;
|
|
148
|
+
};
|
|
99
149
|
/**
|
|
100
150
|
* Preminter API to access ZORA Premint functionality.
|
|
101
151
|
* Currently only supports V1 premints.
|
|
@@ -105,13 +155,6 @@ declare class PremintClient {
|
|
|
105
155
|
readonly publicClient: PublicClient;
|
|
106
156
|
readonly chain: Chain;
|
|
107
157
|
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
158
|
/**
|
|
116
159
|
* The fixed price minter address is the same across all chains for our current
|
|
117
160
|
* deployer strategy.
|
|
@@ -297,18 +340,21 @@ declare class PremintClient {
|
|
|
297
340
|
address: string;
|
|
298
341
|
uid: number;
|
|
299
342
|
}): Promise<PremintSignatureGetResponse>;
|
|
343
|
+
/**
|
|
344
|
+
* Gets the deterministic contract address for a premint collection
|
|
345
|
+
* @param collection Collection to get the address for
|
|
346
|
+
* @returns deterministic contract address
|
|
347
|
+
*/
|
|
348
|
+
getCollectionAddress(collection: ContractCreationConfig): Promise<`0x${string}`>;
|
|
300
349
|
/**
|
|
301
350
|
* Check user signature for v1
|
|
302
351
|
*
|
|
303
352
|
* @param data Signature data from the API
|
|
304
|
-
* @returns isValid = signature is valid or not,
|
|
353
|
+
* @returns isValid = signature is valid or not, recoveredSigner = signer from contract
|
|
305
354
|
*/
|
|
306
|
-
isValidSignature({
|
|
307
|
-
data: PremintSignatureGetResponse;
|
|
308
|
-
}): Promise<{
|
|
355
|
+
isValidSignature({ signature, premint, collection, }: PremintSignatureResponse): Promise<{
|
|
309
356
|
isValid: boolean;
|
|
310
|
-
|
|
311
|
-
recoveredSigner: Address;
|
|
357
|
+
recoveredSigner: Address | undefined;
|
|
312
358
|
}>;
|
|
313
359
|
protected makeUrls({ uid, address, tokenId, }: {
|
|
314
360
|
uid?: number;
|
|
@@ -334,7 +380,7 @@ declare class PremintClient {
|
|
|
334
380
|
quantityToMint: number;
|
|
335
381
|
mintComment?: string;
|
|
336
382
|
};
|
|
337
|
-
}): Promise<SimulateContractParameters
|
|
383
|
+
}): Promise<SimulateContractParameters<typeof zoraCreator1155PremintExecutorImplABI, "premint">>;
|
|
338
384
|
}
|
|
339
385
|
export declare function createPremintClient({ chain, httpClient, publicClient, }: {
|
|
340
386
|
chain: Chain;
|