@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
|
@@ -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"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ExtractAbiFunction, AbiParametersToPrimitiveTypes } from "abitype";
|
|
2
|
+
import { zoraCreator1155PremintExecutorImplABI as preminterAbi } from "@zoralabs/protocol-deployments";
|
|
3
|
+
type PremintV1Inputs = ExtractAbiFunction<typeof preminterAbi, "premintV1">["inputs"];
|
|
4
|
+
type PremintV1HashDataTypes = AbiParametersToPrimitiveTypes<PremintV1Inputs>;
|
|
5
|
+
export type ContractCreationConfig = PremintV1HashDataTypes[0];
|
|
6
|
+
export type PremintConfigV1 = PremintV1HashDataTypes[1];
|
|
7
|
+
export type TokenCreationConfigV1 = PremintConfigV1["tokenConfig"];
|
|
8
|
+
export type MintArguments = PremintV1HashDataTypes[4];
|
|
9
|
+
type PremintV2Inputs = ExtractAbiFunction<typeof preminterAbi, "premintV2">["inputs"];
|
|
10
|
+
type PremintV2HashDataTypes = AbiParametersToPrimitiveTypes<PremintV2Inputs>;
|
|
11
|
+
export type PremintConfigV2 = PremintV2HashDataTypes[1];
|
|
12
|
+
export type TokenCreationConfigV2 = PremintConfigV2["tokenConfig"];
|
|
13
|
+
export declare const v1Types: {
|
|
14
|
+
readonly CreatorAttribution: readonly [{
|
|
15
|
+
readonly name: "tokenConfig";
|
|
16
|
+
readonly type: "TokenCreationConfig";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "uid";
|
|
19
|
+
readonly type: "uint32";
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "version";
|
|
22
|
+
readonly type: "uint32";
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "deleted";
|
|
25
|
+
readonly type: "bool";
|
|
26
|
+
}];
|
|
27
|
+
readonly TokenCreationConfig: readonly [{
|
|
28
|
+
readonly name: "tokenURI";
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
}, {
|
|
31
|
+
readonly name: "maxSupply";
|
|
32
|
+
readonly type: "uint256";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "maxTokensPerAddress";
|
|
35
|
+
readonly type: "uint64";
|
|
36
|
+
}, {
|
|
37
|
+
readonly name: "pricePerToken";
|
|
38
|
+
readonly type: "uint96";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "mintStart";
|
|
41
|
+
readonly type: "uint64";
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "mintDuration";
|
|
44
|
+
readonly type: "uint64";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "royaltyMintSchedule";
|
|
47
|
+
readonly type: "uint32";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "royaltyBPS";
|
|
50
|
+
readonly type: "uint32";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "royaltyRecipient";
|
|
53
|
+
readonly type: "address";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "fixedPriceMinter";
|
|
56
|
+
readonly type: "address";
|
|
57
|
+
}];
|
|
58
|
+
};
|
|
59
|
+
export declare const v2Types: {
|
|
60
|
+
readonly CreatorAttribution: readonly [{
|
|
61
|
+
readonly name: "tokenConfig";
|
|
62
|
+
readonly type: "TokenCreationConfig";
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "uid";
|
|
65
|
+
readonly type: "uint32";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "version";
|
|
68
|
+
readonly type: "uint32";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "deleted";
|
|
71
|
+
readonly type: "bool";
|
|
72
|
+
}];
|
|
73
|
+
readonly TokenCreationConfig: readonly [{
|
|
74
|
+
readonly name: "tokenURI";
|
|
75
|
+
readonly type: "string";
|
|
76
|
+
}, {
|
|
77
|
+
readonly name: "maxSupply";
|
|
78
|
+
readonly type: "uint256";
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: "maxTokensPerAddress";
|
|
81
|
+
readonly type: "uint64";
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "pricePerToken";
|
|
84
|
+
readonly type: "uint96";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "mintStart";
|
|
87
|
+
readonly type: "uint64";
|
|
88
|
+
}, {
|
|
89
|
+
readonly name: "mintDuration";
|
|
90
|
+
readonly type: "uint64";
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "royaltyBPS";
|
|
93
|
+
readonly type: "uint32";
|
|
94
|
+
}, {
|
|
95
|
+
readonly name: "payoutRecipient";
|
|
96
|
+
readonly type: "address";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "fixedPriceMinter";
|
|
99
|
+
readonly type: "address";
|
|
100
|
+
}, {
|
|
101
|
+
readonly name: "createReferral";
|
|
102
|
+
readonly type: "address";
|
|
103
|
+
}];
|
|
104
|
+
};
|
|
105
|
+
export declare const PreminterDomain = "Preminter";
|
|
106
|
+
export declare enum PremintConfigVersion {
|
|
107
|
+
V1 = "1",
|
|
108
|
+
V2 = "2"
|
|
109
|
+
}
|
|
110
|
+
export type PremintConfigForVersion<T extends PremintConfigVersion> = T extends PremintConfigVersion.V1 ? PremintConfigV1 : PremintConfigV2;
|
|
111
|
+
export type PremintConfigWithVersion<T extends PremintConfigVersion> = {
|
|
112
|
+
premintConfig: PremintConfigForVersion<T>;
|
|
113
|
+
premintConfigVersion: T;
|
|
114
|
+
};
|
|
115
|
+
export type PremintConfigAndVersion = PremintConfigWithVersion<PremintConfigVersion.V1> | PremintConfigWithVersion<PremintConfigVersion.V2>;
|
|
116
|
+
export type PremintConfig = PremintConfigV1 | PremintConfigV2;
|
|
117
|
+
export type TokenCreationConfig = TokenCreationConfigV1 | TokenCreationConfigV2;
|
|
118
|
+
export type PremintConfigForTokenCreationConfig<T extends TokenCreationConfig> = T extends TokenCreationConfigV1 ? PremintConfigV1 : PremintConfigV2;
|
|
119
|
+
export type TokenConfigForVersion<T extends PremintConfigVersion> = PremintConfigForVersion<T>["tokenConfig"];
|
|
120
|
+
export type TokenConfigWithVersion<T extends PremintConfigVersion> = {
|
|
121
|
+
tokenConfig: TokenConfigForVersion<T>;
|
|
122
|
+
premintConfigVersion: T;
|
|
123
|
+
};
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=contract-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-types.d.ts","sourceRoot":"","sources":["../../src/premint/contract-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,qCAAqC,IAAI,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEvG,KAAK,eAAe,GAAG,kBAAkB,CACvC,OAAO,YAAY,EACnB,WAAW,CACZ,CAAC,QAAQ,CAAC,CAAC;AAEZ,KAAK,sBAAsB,GAAG,6BAA6B,CAAC,eAAe,CAAC,CAAC;AAE7E,MAAM,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AACxD,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAEtD,KAAK,eAAe,GAAG,kBAAkB,CACvC,OAAO,YAAY,EACnB,WAAW,CACZ,CAAC,QAAQ,CAAC,CAAC;AAEZ,KAAK,sBAAsB,GAAG,6BAA6B,CAAC,eAAe,CAAC,CAAC;AAE7E,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AACxD,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;AAEnE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBV,CAAC;AAEX,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBV,CAAC;AAEX,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,oBAAY,oBAAoB;IAC9B,EAAE,MAAM;IACR,EAAE,MAAM;CACT;AAED,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,oBAAoB,IAChE,CAAC,SAAS,oBAAoB,CAAC,EAAE,GAAG,eAAe,GAAG,eAAe,CAAC;AAExE,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,oBAAoB,IAAI;IACrE,aAAa,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAC1C,oBAAoB,EAAE,CAAC,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAC/B,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,CAAC,GACjD,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,eAAe,CAAC;AAC9D,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,GAAG,qBAAqB,CAAC;AAEhF,MAAM,MAAM,mCAAmC,CAAC,CAAC,SAAS,mBAAmB,IAC3E,CAAC,SAAS,qBAAqB,GAAG,eAAe,GAAG,eAAe,CAAC;AAEtE,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,IAC9D,uBAAuB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;AAE5C,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,oBAAoB,IAAI;IACnE,WAAW,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACtC,oBAAoB,EAAE,CAAC,CAAC;CACzB,CAAC"}
|