@medialane/sdk 0.202.0 → 0.204.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/README.md +0 -1
- package/dist/index.cjs +2 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -19
- package/dist/index.d.ts +1 -19
- package/dist/index.js +3 -72
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -283,7 +283,6 @@ const metadata: IpNftMetadata = {
|
|
|
283
283
|
{ trait_type: "AI Policy", value: "Not Allowed" },
|
|
284
284
|
{ trait_type: "Royalty", value: "10%" },
|
|
285
285
|
{ trait_type: "Standard", value: "Berne Convention" },
|
|
286
|
-
{ trait_type: "Registration", value: "2026-03-06" },
|
|
287
286
|
],
|
|
288
287
|
};
|
|
289
288
|
|
package/dist/index.cjs
CHANGED
|
@@ -108,8 +108,7 @@ var RESERVED_TRAITS = /* @__PURE__ */ new Set([
|
|
|
108
108
|
"AI Policy",
|
|
109
109
|
"Royalty",
|
|
110
110
|
"Edition",
|
|
111
|
-
"Standard"
|
|
112
|
-
"Registration"
|
|
111
|
+
"Standard"
|
|
113
112
|
]);
|
|
114
113
|
var RESERVED_TRAITS_NORMALIZED = new Set([...RESERVED_TRAITS].map((t) => t.toLowerCase()));
|
|
115
114
|
function buildAssetMetadata(input) {
|
|
@@ -133,13 +132,7 @@ function buildAssetMetadata(input) {
|
|
|
133
132
|
if (!traitType || !traitValue || RESERVED_TRAITS_NORMALIZED.has(traitType.toLowerCase())) continue;
|
|
134
133
|
attributes.push({ trait_type: traitType, value: traitValue });
|
|
135
134
|
}
|
|
136
|
-
if (input.licenseType) {
|
|
137
|
-
attributes.push({ trait_type: "Standard", value: "Berne Convention" });
|
|
138
|
-
attributes.push({
|
|
139
|
-
trait_type: "Registration",
|
|
140
|
-
value: input.registrationDate ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
|
|
141
|
-
});
|
|
142
|
-
}
|
|
135
|
+
if (input.licenseType) attributes.push({ trait_type: "Standard", value: "Berne Convention" });
|
|
143
136
|
return {
|
|
144
137
|
name: input.name,
|
|
145
138
|
description: input.description ?? "",
|
|
@@ -173,56 +166,9 @@ function resolveRemixPolicy(input) {
|
|
|
173
166
|
return { ...input, canRemixDirect, showDealOption };
|
|
174
167
|
}
|
|
175
168
|
|
|
176
|
-
// src/field-limits.ts
|
|
177
|
-
var FIELD_LIMITS = {
|
|
178
|
-
name: 255,
|
|
179
|
-
symbol: 10,
|
|
180
|
-
description: 2e3
|
|
181
|
-
};
|
|
182
|
-
|
|
183
169
|
// src/uploads.ts
|
|
184
170
|
var MB = 1024 * 1024;
|
|
185
171
|
var MAX_UPLOAD_BYTES = 90 * MB;
|
|
186
|
-
var IMAGE_EXTENSIONS = [".jpg", ".jpeg", ".png", ".gif", ".svg", ".webp", ".avif"];
|
|
187
|
-
var UPLOAD_LIMITS = {
|
|
188
|
-
image: {
|
|
189
|
-
mimeTypes: ["image/jpeg", "image/png", "image/gif", "image/svg+xml", "image/webp", "image/avif"],
|
|
190
|
-
extensions: IMAGE_EXTENSIONS
|
|
191
|
-
},
|
|
192
|
-
document: {
|
|
193
|
-
mimeTypes: [
|
|
194
|
-
"application/pdf",
|
|
195
|
-
"application/msword",
|
|
196
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
197
|
-
"application/vnd.oasis.opendocument.text",
|
|
198
|
-
"application/rtf",
|
|
199
|
-
"text/plain",
|
|
200
|
-
"text/markdown",
|
|
201
|
-
"application/octet-stream"
|
|
202
|
-
],
|
|
203
|
-
extensions: [".pdf", ".doc", ".docx", ".odt", ".rtf", ".txt", ".md"]
|
|
204
|
-
},
|
|
205
|
-
media: {
|
|
206
|
-
mimeTypes: [
|
|
207
|
-
"image/jpeg",
|
|
208
|
-
"image/png",
|
|
209
|
-
"image/gif",
|
|
210
|
-
"image/webp",
|
|
211
|
-
"image/svg+xml",
|
|
212
|
-
"image/avif",
|
|
213
|
-
"video/mp4",
|
|
214
|
-
"video/webm",
|
|
215
|
-
"video/ogg",
|
|
216
|
-
"audio/mpeg",
|
|
217
|
-
"audio/ogg",
|
|
218
|
-
"audio/wav",
|
|
219
|
-
"audio/webm",
|
|
220
|
-
"audio/flac",
|
|
221
|
-
"application/pdf"
|
|
222
|
-
],
|
|
223
|
-
extensions: [...IMAGE_EXTENSIONS, ".mp4", ".webm", ".ogv", ".ogg", ".mp3", ".wav", ".flac", ".pdf"]
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
172
|
function formatFileSize(bytes) {
|
|
227
173
|
const mb = bytes / MB;
|
|
228
174
|
return `${Number.isInteger(mb) ? mb : mb.toFixed(1)} MB`;
|
|
@@ -232,21 +178,6 @@ function uploadSizeError(file, kind = "image") {
|
|
|
232
178
|
const noun = kind === "image" ? "image" : "file";
|
|
233
179
|
return `That ${noun} is ${formatFileSize(file.size)}. Please choose one under ${formatFileSize(MAX_UPLOAD_BYTES)}.`;
|
|
234
180
|
}
|
|
235
|
-
function acceptFor(kind) {
|
|
236
|
-
const { mimeTypes, extensions } = UPLOAD_LIMITS[kind];
|
|
237
|
-
return [...mimeTypes, ...extensions].join(",");
|
|
238
|
-
}
|
|
239
|
-
function typeList(extensions) {
|
|
240
|
-
const names = extensions.map((ext) => ext.slice(1).toUpperCase());
|
|
241
|
-
return names.length > 1 ? `${names.slice(0, -1).join(", ")} or ${names[names.length - 1]}` : names.join("");
|
|
242
|
-
}
|
|
243
|
-
function uploadError(file, kind = "image") {
|
|
244
|
-
const { mimeTypes, extensions } = UPLOAD_LIMITS[kind];
|
|
245
|
-
const name = (file.name ?? "").toLowerCase();
|
|
246
|
-
const allowed = mimeTypes.includes(file.type) || file.type === "" && extensions.some((ext) => name.endsWith(ext));
|
|
247
|
-
if (!allowed) return `Choose ${kind === "image" ? "an image" : "a file"} in ${typeList(extensions)}.`;
|
|
248
|
-
return uploadSizeError(file, kind);
|
|
249
|
-
}
|
|
250
181
|
|
|
251
182
|
Object.defineProperty(exports, "SUPPORTED_URL_CHAINS", {
|
|
252
183
|
enumerable: true,
|
|
@@ -576,13 +507,10 @@ Object.defineProperty(exports, "getStarknetCoordinates", {
|
|
|
576
507
|
enumerable: true,
|
|
577
508
|
get: function () { return chunkH2NJB3AK_cjs.getStarknetCoordinates; }
|
|
578
509
|
});
|
|
579
|
-
exports.FIELD_LIMITS = FIELD_LIMITS;
|
|
580
510
|
exports.MAX_UPLOAD_BYTES = MAX_UPLOAD_BYTES;
|
|
581
511
|
exports.OPEN_LICENSES = OPEN_LICENSES;
|
|
582
512
|
exports.RESERVED_TRAITS = RESERVED_TRAITS;
|
|
583
513
|
exports.RunRequestError = RunRequestError;
|
|
584
|
-
exports.UPLOAD_LIMITS = UPLOAD_LIMITS;
|
|
585
|
-
exports.acceptFor = acceptFor;
|
|
586
514
|
exports.accountPageUrl = accountPageUrl;
|
|
587
515
|
exports.buildAssetMetadata = buildAssetMetadata;
|
|
588
516
|
exports.buildCollectionMetadata = buildCollectionMetadata;
|
|
@@ -593,7 +521,6 @@ exports.isCertificateEmissionRun = isCertificateEmissionRun;
|
|
|
593
521
|
exports.isDataTokenizationRun = isDataTokenizationRun;
|
|
594
522
|
exports.isTicketingRun = isTicketingRun;
|
|
595
523
|
exports.resolveRemixPolicy = resolveRemixPolicy;
|
|
596
|
-
exports.uploadError = uploadError;
|
|
597
524
|
exports.uploadSizeError = uploadSizeError;
|
|
598
525
|
//# sourceMappingURL=index.cjs.map
|
|
599
526
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/launchpad-runs.ts","../src/types/api.ts","../src/metadata.ts","../src/remix-policy.ts","../src/field-limits.ts","../src/uploads.ts"],"names":[],"mappings":";;;;;;;;;;AAoEO,IAAM,qBAAA,GAAwB,CAAC,GAAA,KACpC,GAAA,CAAI,OAAA,KAAY;AAEX,IAAM,cAAA,GAAiB,CAAC,GAAA,K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face RunQuoteLine {\n action: string;\n units: number;\n unitCredits: number;\n credits: number;\n}\n\nexport interface RunQuote {\n lines: RunQuoteLine[];\n total: number;\n}\n\nexport type NextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"metadata\"; items: number[] }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport type TicketingNextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"ticket-metadata\" }\n | { kind: \"tier\" }\n | { kind: \"wait-tier\" }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport type CertificateEmissionNextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"certificate-metadata\" }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport interface WalletRequest {\n recipient: string;\n}\n\ninterface LaunchpadRunBase {\n id: string;\n status: RunStatus;\n spec: unknown;\n quote: RunQuote | null;\n creditsHeld: number;\n creditsSpent: number;\n progress: unknown;\n createdAt: string;\n updatedAt: string;\n}\n\nexport type DataTokenizationRun = LaunchpadRunBase & { service: \"data-tokenization-erc721\"; next?: NextStep };\nexport type TicketingRun = LaunchpadRunBase & { service: \"ip-ticketing\"; next?: TicketingNextStep };\nexport type CertificateEmissionRun = LaunchpadRunBase & { service: \"certificate-emission\"; next?: CertificateEmissionNextStep };\nexport type LaunchpadRun = DataTokenizationRun | TicketingRun | CertificateEmissionRun;\n\nexport const isDataTokenizationRun = (run: LaunchpadRun): run is DataTokenizationRun =>\n run.service === \"data-tokenization-erc721\";\n\nexport const isTicketingRun = (run: LaunchpadRun): run is TicketingRun => run.service === \"ip-ticketing\";\n\nexport const isCertificateEmissionRun = (run: LaunchpadRun): run is CertificateEmissionRun =>\n run.service === \"certificate-emission\";\n\nexport interface ConfirmResult {\n pending: boolean;\n status: string;\n completed?: boolean;\n}\n\nexport class RunRequestError extends Error {\n constructor(\n message: string,\n readonly status: number,\n readonly body: Record<string, unknown>,\n ) {\n super(message);\n }\n}\n\nexport interface LaunchpadRunsClientOptions {\n baseUrl: string;\n fetchImpl?: FetchLike;\n}\n\nexport function createLaunchpadRunsClient({ baseUrl, fetchImpl = fetch }: LaunchpadRunsClientOptions) {\n const runsUrl = `${baseUrl.replace(/\\/$/, \"\")}/v1/portal/runs`;\n const runBase = (id: string): string => `${runsUrl}/${id}`;\n const runBatchBase = (id: string, index: number): string => `${runBase(id)}/batches/${index}`;\n const runCollectionBase = (id: string): string => `${runBase(id)}/collection`;\n const runTierBase = (id: string): string => `${runBase(id)}/tier`;\n\n const runFetch: FetchLike = (input, init) => fetchImpl(input, { ...init, cache: \"no-store\" });\n\n async function call<T>(url: string, init?: RequestInit): Promise<{ status: number; data: T }> {\n const res = await runFetch(url, {\n ...init,\n headers: { \"content-type\": \"application/json\", ...(init?.headers as Record<string, string> | undefined) },\n });\n const body = (await res.json().catch(() => ({}))) as Record<string, unknown>;\n if (!res.ok) {\n throw new RunRequestError(String(body.error ?? \"Something went wrong with this run\"), res.status, body);\n }\n return { status: res.status, data: body.data as T };\n }\n\n const post = <T>(url: string, body?: unknown) =>\n call<T>(url, { method: \"POST\", body: body === undefined ? undefined : JSON.stringify(body) });\n\n const confirm = async (url: string): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string; completed?: boolean }>(url);\n return { pending: status === 202, status: data.status, completed: data.completed };\n };\n\n const ticketing = {\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n metadata: async (id: string, userAddress: string) =>\n (await post<{ tokenUri: string }>(`${runBase(id)}/metadata`, { userAddress })).data,\n\n resolveWallets: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/wallets/resolve`)).data.pending,\n\n registerWallet: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/wallets`, request)).data,\n\n confirmCollection: (id: string) => confirm(`${runCollectionBase(id)}/confirm`),\n confirmTier: (id: string) => confirm(`${runTierBase(id)}/confirm`),\n confirmBatch: (id: string, index: number) => confirm(`${runBatchBase(id, index)}/confirm`),\n };\n\n const certificateEmission = {\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n metadata: async (id: string, userAddress: string) =>\n (await post<{ tokenUri: string }>(`${runBase(id)}/certificate-metadata`, { userAddress })).data,\n\n resolveWallets: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/recipients/resolve`)).data.pending,\n\n registerWallet: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/recipients`, request)).data,\n\n confirmCollection: (id: string) => confirm(`${runCollectionBase(id)}/confirm`),\n confirmBatch: (id: string, index: number) => confirm(`${runBatchBase(id, index)}/confirm`),\n };\n\n return {\n fetch: runFetch,\n runBase,\n runBatchBase,\n runCollectionBase,\n runTierBase,\n ticketing,\n certificateEmission,\n\n list: async () => (await call<LaunchpadRun[]>(runsUrl)).data,\n\n get: async (id: string) => (await call<LaunchpadRun>(`${runBase(id)}`)).data,\n\n create: async (service: string, spec: unknown) =>\n (await post<LaunchpadRun>(runsUrl, { service, spec })).data,\n\n update: async (id: string, spec: unknown) =>\n (await call<LaunchpadRun>(`${runBase(id)}`, { method: \"PATCH\", body: JSON.stringify({ spec }) })).data,\n\n cancel: async (id: string) => (await post<LaunchpadRun>(`${runBase(id)}/cancel`)).data,\n\n checkoutWithCredits: async (id: string) =>\n (await post<LaunchpadRun>(`${runBase(id)}/checkout`, { method: \"credits\" })).data,\n\n checkoutFromWallet: async (id: string, intentId: string) =>\n (await post<LaunchpadRun>(`${runBase(id)}/checkout`, { method: \"wallet\", intentId })).data,\n\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n itemMetadata: async (id: string, index: number, userAddress: string) =>\n (await post<{ index: number; tokenUri: string }>(`${runBase(id)}/items/${index}/metadata`, { userAddress })).data,\n\n resolveGuests: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/guests/resolve`)).data.pending,\n\n registerGuest: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/guests`, request)).data,\n\n confirmBatch: async (id: string, index: number): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string; completed?: boolean }>(\n `${runBase(id)}/batches/${index}/confirm`,\n );\n return { pending: status === 202, status: data.status, completed: data.completed };\n },\n\n confirmCollection: async (id: string): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string }>(`${runBase(id)}/collection/confirm`);\n return { pending: status === 202, status: data.status };\n },\n };\n}\n\nexport type LaunchpadRunsClient = ReturnType<typeof createLaunchpadRunsClient>;\n","import type { z } from \"zod\";\nimport type * as intents from \"../contract/intents.js\";\nimport type * as issuance from \"../contract/issuance.js\";\nimport type * as orders from \"../contract/orders.js\";\nimport type * as profiles from \"../contract/profiles.js\";\nimport type * as responses from \"../contract/responses.js\";\n\nexport type IPType =\n | \"Audio\"\n | \"Art\"\n | \"Documents\"\n | \"NFT\"\n | \"Video\"\n | \"Photography\"\n | \"Patents\"\n | \"Posts\"\n | \"Publications\"\n | \"RWA\"\n | \"Software\"\n | \"Custom\";\n\nexport type CollectionSort = \"recent\" | \"supply\" | \"floor\" | \"volume\" | \"name\";\n\nexport type CollectionTokensSort = \"recent\" | \"oldest\" | \"name\" | \"price\";\n\nexport type ServiceCapability =\n | \"list\" | \"buy\" | \"make_offer\" | \"cancel\"\n | \"transfer\" | \"burn\"\n | \"mint\" | \"claim\" | \"airdrop\"\n | \"remix\" | \"license\"\n | \"subscribe\" | \"redeem\"\n | \"launch\" | \"swap\"\n | \"sponsor\";\n\nexport interface EnforcementDeclaration {\n royalty?: \"erc2981\" | \"service-split\" | \"none\";\n escrow?: boolean;\n timeLock?: boolean;\n revocable?: boolean;\n}\n\nexport interface ServiceEventDeclaration {\n\n name: string;\n\n emittedBy: \"factory\" | \"instance\";\n\n poll?: \"fast\" | \"slow\";\n}\n\nexport interface ServiceDefinition {\n\n id: string;\n displayName: string;\n description: string;\n standard: \"ERC721\" | \"ERC1155\" | \"ERC20\" | \"UNKNOWN\";\n provenance: \"MEDIALANE\" | \"EXTERNAL\";\n onchain?: Partial<Record<import(\"../chains.js\").Chain, {\n factoryAddress?: string;\n classHash?: string;\n startBlock?: number;\n }>>;\n\n uiVariant: string;\n capabilities: ServiceCapability[];\n\n events?: ServiceEventDeclaration[];\n metadataSchema?: {\n requiredTraits?: string[];\n\n licenseDefault?: string;\n enforcement?: EnforcementDeclaration;\n };\n}\n\nexport interface ApiCollectionsQuery {\n page?: number;\n limit?: number;\n isKnown?: boolean;\n sort?: CollectionSort;\n owner?: string;\n\n service?: string;\n}\n\nexport type OrderStatus = \"ACTIVE\" | \"FULFILLED\" | \"CANCELLED\" | \"EXPIRED\";\nexport type SortOrder = \"price_asc\" | \"price_desc\" | \"recent\";\nexport type ActivityType = \"mint\" | \"transfer\" | \"sale\" | \"listing\" | \"offer\" | \"cancelled\";\nexport type IntentType = \"CREATE_LISTING\" | \"MAKE_OFFER\" | \"FULFILL_ORDER\" | \"CANCEL_ORDER\" | \"MINT\" | \"CREATE_COLLECTION\" | \"COUNTER_OFFER\";\nexport type IntentStatus = \"PENDING\" | \"SIGNED\" | \"SUBMITTED\" | \"CONFIRMED\" | \"FAILED\" | \"EXPIRED\";\n\nexport interface ApiMeta {\n page: number;\n limit: number;\n total?: number;\n\n counts?: Record<string, number>;\n}\n\nexport interface ApiResponse<T> {\n data: T;\n meta?: ApiMeta;\n}\n\nexport type ChainFilter = import(\"../chains.js\").Chain | \"all\";\n\nexport type ApiOrdersQuery = z.input<typeof orders.ordersListQuery> & { chain?: ChainFilter };\n\nexport interface ApiOrderOffer {\n itemType: string;\n token: string;\n identifier: string;\n startAmount: string;\n endAmount: string;\n}\n\nexport interface ApiOrderConsideration extends ApiOrderOffer {\n recipient: string;\n}\n\nexport interface ApiOrderPrice {\n raw: string | null;\n formatted: string | null;\n currency: string | null;\n decimals: number;\n}\n\nexport interface ApiOrderTxHash {\n created: string | null;\n fulfilled: string | null;\n cancelled: string | null;\n}\n\nexport interface ApiOrderTokenMeta {\n name: string | null;\n image: string | null;\n description: string | null;\n animationUrl: string | null;\n}\n\nexport type ApiOrder = z.output<typeof responses.orderSchema>;\n\nexport type IpAttribute = z.output<typeof responses.tokenAttributeSchema>;\n\nexport interface IpNftMetadata {\n name: string;\n description?: string;\n image?: string | null;\n external_url?: string;\n attributes?: IpAttribute[];\n\n ipType?: string | null;\n licenseType?: string | null;\n commercialUse?: string | null;\n derivatives?: string | null;\n attribution?: string | null;\n territory?: string | null;\n aiPolicy?: string | null;\n royalty?: string | null;\n registration?: string | null;\n}\n\nexport type ApiTokenMetadata = ApiToken[\"metadata\"];\n\nexport interface ApiTokenBalance {\n owner: string;\n\n amount: string;\n}\n\nexport type ApiToken = z.output<typeof responses.tokenSchema>;\n\nexport type ApiCollection = z.output<typeof responses.collectionSchema>;\n\nexport interface ApiCoin {\n id: string;\n chain: string;\n contractAddress: string;\n standard: \"ERC20\";\n\n service: string;\n name: string | null;\n symbol: string | null;\n decimals: number;\n\n totalSupply: string | null;\n description: string | null;\n image: string | null;\n creator: string | null;\n\n isLaunched?: boolean | null;\n startBlock: string;\n isHidden: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ApiCoinPrice {\n\n usdc: number;\n}\n\nexport type ApiCoinPrices = Record<string, ApiCoinPrice | null>;\n\nexport type ApiCoinClaimResult =\n | { verified: true; coin: ApiCoin | null }\n | { verified: false; reason: \"owner_mismatch\" | \"owner_check_failed\" | \"not_erc20\" | \"no_total_supply\" };\n\nexport interface ApiCoinsQuery {\n chain?: ChainFilter;\n page?: number;\n limit?: number;\n service?: string;\n sort?: string;\n creator?: string;\n}\n\nexport interface ApiActivityPrice {\n raw: string | null;\n formatted: string | null;\n currency: string | null;\n}\n\nexport interface ApiActivity {\n type: ActivityType;\n chain: import(\"../chains.js\").Chain;\n\n contractAddress?: string;\n tokenId?: string;\n from?: string;\n to?: string;\n blockNumber?: string;\n\n amount?: string;\n\n orderHash?: string;\n nftContract?: string;\n nftTokenId?: string;\n offerer?: string;\n fulfiller?: string | null;\n price?: ApiActivityPrice;\n\n tokenStandard?: \"ERC721\" | \"ERC1155\";\n txHash: string | null;\n timestamp: string;\n\n token?: { name: string | null; image: string | null; animationUrl: string | null } | null;\n}\n\nexport interface ApiActivitiesQuery {\n chain?: ChainFilter;\n type?: ActivityType;\n\n contract?: string;\n page?: number;\n limit?: number;\n}\n\nexport interface ApiComment {\n id: string;\n chain: string;\n contractAddress: string;\n tokenId: string;\n author: string;\n content: string;\n txHash: string | null;\n blockNumber: string;\n postedAt: string;\n}\n\nexport interface ApiSearchTokenResult {\n contractAddress: string;\n tokenId: string;\n name: string | null;\n image: string | null;\n owner: string;\n metadataStatus: string;\n}\n\nexport interface ApiSearchCollectionResult {\n contractAddress: string;\n name: string | null;\n image: string | null;\n totalSupply: number | null;\n floorPrice: string | null;\n holderCount: number | null;\n}\n\nexport interface ApiSearchCreatorResult {\n walletAddress: string;\n username: string | null;\n name: string | null;\n bio: string | null;\n avatarImage: string | null;\n}\n\nexport interface ApiSearchResult {\n tokens: ApiSearchTokenResult[];\n collections: ApiSearchCollectionResult[];\n creators: ApiSearchCreatorResult[];\n}\n\nexport interface ApiIntent {\n id: string;\n chain: string;\n type: IntentType;\n status: IntentStatus;\n requester: string;\n typedData: unknown;\n calls: unknown;\n signature: string[];\n txHash: string | null;\n orderHash: string | null;\n\n parentOrderHash?: string | null;\n\n counterOfferMessage?: string | null;\n expiresAt: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IntentCall {\n contractAddress: string;\n entrypoint: string;\n calldata: string[];\n}\n\nexport type ApiIntentCreated =\n | { id: string; expiresAt: string; requiresSignature: true; typedData: unknown }\n | { id: string; expiresAt: string; requiresSignature: false; calls: IntentCall[] };\n\nexport interface ApiTxSyncResult {\n applied: number;\n contracts?: string[];\n pending: boolean;\n}\n\nexport type CreateListingIntentParams = z.input<typeof intents.listingSchema>;\n\nexport type MakeOfferIntentParams = z.input<typeof intents.offerSchema>;\n\nexport type FulfillOrderIntentParams = z.input<typeof intents.fulfillSchema>;\n\nexport type CancelOrderIntentParams = z.input<typeof intents.cancelSchema>;\n\nexport type FactoryFamilyServiceId = (typeof intents.FACTORY_FAMILY_SERVICE_IDS)[number];\n\nexport type TierServiceId = (typeof intents.TIER_SERVICE_IDS)[number];\n\nexport type CollectionServiceId = (typeof intents.COLLECTION_SERVICE_IDS)[number];\n\nexport type CreateMintIntentParams = z.input<typeof intents.mintSchema>;\n\n/** Drop sale terms on the wire: amounts as decimal strings in the token's smallest unit. */\nexport interface DropTermsBody {\n /** Unix seconds; 0 = open from creation. */\n startTime: number;\n /** Unix seconds; 0 = never closes. */\n endTime: number;\n /** Per token; \"0\" = free. */\n price: string;\n paymentToken: string;\n /** \"0\" = unlimited. */\n maxPerWallet: string;\n}\n\nexport type ApiDropListStatus = \"live\" | \"upcoming\" | \"ended\";\n\nexport interface ApiDrop {\n contractAddress: string;\n dropId: string;\n organizer: string;\n name: string | null;\n symbol: string | null;\n description: string | null;\n image: string | null;\n /** Token URI = baseUri + token id. */\n baseUri: string | null;\n /** \"0\" = no cap. */\n maxSupply: string;\n minted: string;\n /** Total paid to the organizer, in the payment token's smallest unit. */\n revenue: string;\n collectors: number;\n terms: DropTermsBody;\n /** \"0x0\" = open to everyone. */\n allowlistRoot: string;\n createdBlock: string;\n}\n\nexport interface ApiDropFee {\n /** Platform fee added to a mint, in basis points; 0 when none applies. */\n launchpadBps: number;\n}\n\nexport interface ApiDropMint {\n kind: \"claim\" | \"issue\";\n wallet: string;\n quantity: string;\n firstTokenId: string;\n totalPaid: string;\n txHash: string;\n blockNumber: string;\n createdAt: string;\n}\n\nexport type CreateCollectionIntentParams = z.input<typeof intents.createCollectionSchema>;\n\nexport interface CheckoutIntentItem {\n orderHash: string;\n\n quantity?: string;\n}\n\nexport type CreateCheckoutIntentParams = z.input<typeof intents.checkoutBodySchema>;\n\nexport interface ApiCheckoutIntentResult {\n id?: string;\n orderHash: string;\n requiresSignature?: false;\n calls?: unknown;\n expiresAt?: string;\n\n error?: string;\n}\n\nexport type CreateTierIntentParams = z.output<typeof intents.createTierSchema>;\n\nexport type EmissionParams = z.input<typeof issuance.emissionSchema>;\n\nexport interface ApiEmissionCall {\n contractAddress: string;\n entrypoint: string;\n calldata: string[];\n}\n\nexport interface ApiEmissionResult {\n service: string;\n recipientCount: number;\n callCount: number;\n batches: ApiEmissionCall[][];\n}\n\nexport type CreateCoinIntentParams = z.input<typeof intents.createCoinSchema>;\n\nexport type LaunchCoinIntentParams = z.output<typeof intents.launchCoinSchema>;\n\nexport type CreateSponsorshipOfferIntentParams = z.output<typeof intents.sponsorshipOfferSchema>;\n\nexport type SetSponsorshipOfferOpenIntentParams = z.input<typeof intents.sponsorshipOfferOpenSchema>;\n\nexport type PlaceSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidSchema>;\n\nexport type RetractSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidRetractSchema>;\n\nexport type AcceptSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidAcceptSchema>;\n\nexport type CreateSponsorshipProposalIntentParams = z.output<typeof intents.sponsorshipProposalSchema>;\n\nexport type WithdrawSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalWithdrawSchema>;\n\nexport type AcceptSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalAcceptSchema>;\n\nexport type RejectSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalRejectSchema>;\n\nexport type CreateCounterOfferIntentParams = z.input<typeof intents.counterOfferSchema>;\n\nexport interface ApiCounterOffersQuery {\n\n originalOrderHash?: string;\n\n sellerAddress?: string;\n page?: number;\n limit?: number;\n}\n\nexport const OPEN_LICENSES = [\"CC0\", \"CC BY\", \"CC BY-SA\", \"CC BY-NC\"] as const;\nexport type OpenLicense = (typeof OPEN_LICENSES)[number];\n\nexport type RemixOfferStatus =\n | \"PENDING\"\n | \"AUTO_PENDING\"\n | \"APPROVED\"\n | \"COMPLETED\"\n | \"REJECTED\"\n | \"EXPIRED\"\n | \"SELF_MINTED\";\n\nexport interface ApiRemixOfferPrice {\n raw: string;\n formatted: string;\n currency: string;\n decimals: number;\n}\n\nexport interface ApiRemixOffer {\n id: string;\n status: RemixOfferStatus;\n originalContract: string;\n originalTokenId: string;\n creatorAddress: string;\n requesterAddress: string | null;\n message?: string | null;\n\n price?: ApiRemixOfferPrice;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct: number | null;\n approvedCollection: string | null;\n remixContract: string | null;\n remixTokenId: string | null;\n orderHash: string | null;\n createdAt: string;\n expiresAt: string;\n updatedAt: string;\n}\n\nexport interface ApiPublicRemix {\n id: string;\n remixContract: string | null;\n remixTokenId: string | null;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n createdAt: string;\n}\n\nexport interface CreateRemixOfferParams {\n originalContract: string;\n originalTokenId: string;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct?: number;\n proposedPrice?: string;\n proposedCurrency?: string;\n message?: string;\n\n expiresInDays?: number;\n}\n\nexport interface AutoRemixOfferParams {\n originalContract: string;\n originalTokenId: string;\n licenseType: string;\n}\n\nexport interface ConfirmSelfRemixParams {\n originalContract: string;\n originalTokenId: string;\n remixContract: string;\n remixTokenId: string;\n\n txHash?: string;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct?: number;\n}\n\nexport interface ConfirmRemixOfferParams {\n approvedCollection: string;\n remixContract: string;\n remixTokenId: string;\n orderHash?: string;\n}\n\nexport interface ApiRemixOffersQuery {\n\n role: \"creator\" | \"requester\";\n status?: string;\n page?: number;\n limit?: number;\n}\n\nexport interface ApiMetadataSignedUrl {\n url: string;\n}\n\nexport interface ApiMetadataUpload {\n cid: string;\n url: string;\n}\n\nexport interface ApiPortalMe {\n id: string;\n accountId: string;\n status: string;\n creditBalance: number;\n}\n\nexport interface ApiPortalKey {\n id: string;\n prefix: string;\n label: string | null;\n lastUsedAt: string | null;\n createdAt: string;\n}\n\nexport interface ApiPortalKeyCreated {\n id: string;\n prefix: string;\n label: string | null;\n\n plaintext: string;\n}\n\nexport interface ApiCreditPayment {\n id: string;\n asset: string;\n amountAtomic: string;\n creditedAmount: number;\n mdlnMultiplier: number;\n txHash: string;\n status: string;\n createdAt: string;\n}\n\nexport interface ApiFundingMethod {\n id: string;\n [detail: string]: unknown;\n}\n\nexport type ApiFundingStatus = \"PENDING\" | \"SETTLED\" | \"FAILED\" | \"EXPIRED\";\n\nexport interface ApiFundingIntent {\n id: string;\n method: string;\n status: ApiFundingStatus;\n expiresAt: string;\n payer?: string | null;\n}\n\nexport interface ApiFundingInstructions {\n chain: string;\n payTo: string;\n asset: string;\n amountAtomic: string;\n}\n\nexport type ApiFundingSubmit =\n | { status: \"SETTLED\"; credited?: number }\n | { status: \"PENDING\"; reason: string };\n\nexport interface ApiSpendByAction {\n actionKey: string;\n credits: number;\n units: number;\n}\n\nexport interface ApiPortalSpend {\n recent: Array<{ actionKey: string; credits: number; createdAt: string }>;\n byAction: ApiSpendByAction[];\n spent: number;\n credited: number;\n drift: number;\n}\n\nexport interface ApiCollectionProfile {\n contractAddress: string;\n chain: string;\n displayName: string | null;\n description: string | null;\n image: string | null;\n bannerImage: string | null;\n websiteUrl: string | null;\n twitterUrl: string | null;\n discordUrl: string | null;\n telegramUrl: string | null;\n hasGatedContent: boolean;\n gatedContentTitle: string | null;\n slug: string | null;\n updatedBy: string | null;\n updatedAt: string;\n}\n\nexport type UpdateCollectionProfileInput = z.output<typeof profiles.collectionProfileSchema>;\n\nexport interface ApiCollectionSlugClaim {\n id: string;\n slug: string;\n contractAddress: string;\n chain: string;\n walletAddress: string;\n status: \"PENDING\" | \"APPROVED\" | \"REJECTED\";\n adminNotes: string | null;\n notifyEmail: string | null;\n reviewedAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ApiCreatorProfile {\n walletAddress: string;\n chain: string;\n username: string | null;\n name: string | null;\n bio: string | null;\n avatarImage: string | null;\n\n collectionImage?: string | null;\n websiteUrl: string | null;\n twitterUrl: string | null;\n discordUrl: string | null;\n telegramUrl: string | null;\n updatedAt: string;\n}\n\nexport interface ApiCreatorListResult {\n creators: ApiCreatorProfile[];\n total: number;\n page: number;\n limit: number;\n}\n\nexport type ApiChain = \"STARKNET\" | \"ETHEREUM\" | \"SOLANA\" | \"BASE\" | \"BITCOIN\";\n\nexport interface ApiSession {\n accountId: string;\n publicId: string;\n walletAddress: string | null;\n email: string | null;\n emailDeadline: string | null;\n}\n\nexport interface ApiUserWallet {\n walletAddress: string;\n email?: string | null;\n emailDeadline?: string | null;\n}\n\nexport interface ApiCollectionClaim {\n id: string;\n contractAddress: string;\n chain: string;\n claimantAddress: string | null;\n status: \"PENDING\" | \"AUTO_APPROVED\" | \"APPROVED\" | \"REJECTED\";\n verificationMethod: \"ONCHAIN\" | \"SIGNATURE\" | \"MANUAL\";\n createdAt: string;\n}\n\nexport interface ApiAdminCollectionClaim extends ApiCollectionClaim {\n claimantEmail: string | null;\n notes: string | null;\n adminNotes: string | null;\n reviewedBy: string | null;\n reviewedAt: string | null;\n updatedAt: string;\n}\n\nexport interface ApiBusinessProvisioning {\n chain: string;\n walletAddress: string;\n}\n\nexport interface ApiWalletActivity {\n id: string;\n chain: string;\n accountAddress: string;\n type: \"SEND\" | \"RECEIVE\" | \"SWAP\" | \"DEPLOY\" | \"GUARDIAN_SET\" | \"GUARDIAN_TRIGGER_ESCAPE\" | \"GUARDIAN_COMPLETE_ESCAPE\" | \"GUARDIAN_CANCEL_ESCAPE\";\n txHash: string;\n blockNumber: string;\n timestamp: string;\n tokenAddress: string | null;\n amount: string | null;\n counterparty: string | null;\n tokenInAddress: string | null;\n amountIn: string | null;\n tokenOutAddress: string | null;\n amountOut: string | null;\n}\n\nexport interface ApiRewardsBadge {\n key: string;\n name: string;\n description: string;\n icon: string;\n color: string;\n category: string;\n}\n\nexport interface ApiRewardsLevel {\n level: number;\n name: string;\n xpRequired: number;\n badgeColor: string;\n description: string | null;\n}\n\nexport interface ApiUserRewards {\n address: string;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n nextLevel: { level: number; name: string; xpRequired: number } | null;\n progressPct: number;\n breakdown: Record<string, number>;\n badges: ApiRewardsBadge[];\n computedAt: string | null;\n}\n\nexport interface ApiRewardsLeaderboardEntry {\n rank: number;\n address: string;\n accountId: string | null;\n publicId: string | null;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n}\n\nexport interface ApiRewardsConfig {\n levels: ApiRewardsLevel[];\n actions: { type: string; label: string; xp: number; dailyCap: number | null }[];\n badges: ApiRewardsBadge[];\n}\n\nexport interface ApiRewardsBatchEntry {\n address: string;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n}\n\nexport interface ApiPointEvent {\n id: string;\n actionType: string;\n xp: number;\n multiplier: number;\n finalXp: number;\n txHash: string | null;\n createdAt: string;\n}\n\nexport interface ApiPlatformStats {\n collections: number;\n tokens: number;\n sales: number;\n}\n\nexport interface ApiTierOnchain {\n maxSupply: string;\n minted: string;\n startTime: number | null;\n endTime: number | null;\n royaltyBps: number;\n}\n\nexport interface ApiSwapQuoteRequest {\n sellSymbol?: string;\n buySymbol?: string;\n sellTokenAddress?: string;\n buyTokenAddress?: string;\n sellAmountRaw?: string;\n buyAmountRaw?: string;\n takerAddress?: string;\n}\n\nexport interface ApiSwapQuote {\n quoteId: string;\n sellTokenAddress: string;\n sellAmount: string;\n buyTokenAddress: string;\n buyAmount: string;\n}\n\nexport interface ApiIpNftTokenData {\n owner: string;\n metadataUri: string;\n originalCreator: string;\n registeredAt: number;\n}\n\nexport interface ApiTokensQuery {\n page?: number;\n limit?: number;\n sort?: string;\n ipType?: string;\n derivatives?: \"allowed\";\n}\n\nexport interface ApiUsernameClaim {\n id: string;\n username: string;\n walletAddress: string;\n status: \"PENDING\" | \"APPROVED\" | \"REJECTED\";\n adminNotes: string | null;\n reviewedAt: string | null;\n createdAt: string;\n}\n\nexport type ApiReportTargetType = \"COLLECTION\" | \"TOKEN\" | \"CREATOR\" | \"COMMENT\";\n\nexport interface ApiSubmitReport {\n targetType: ApiReportTargetType;\n targetContract?: string;\n targetTokenId?: string;\n targetAddress?: string;\n targetId?: string;\n categories: string[];\n description?: string;\n}\n\nexport interface ApiSponsorshipOffer {\n id: string;\n chain: string;\n contractAddress: string;\n offerId: string;\n author: string;\n nftContract: string;\n tokenId: string;\n minAmount: string;\n duration: number;\n paymentToken: string;\n licenseTermsUri: string;\n transferable: boolean;\n royaltyBps: number;\n specificSponsor: string | null;\n open: boolean;\n createdAtChain: string;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipBid {\n id: string;\n chain: string;\n contractAddress: string;\n offerId: string;\n sponsor: string;\n amount: string;\n placedAtChain: string;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipProposal {\n id: string;\n chain: string;\n contractAddress: string;\n proposalId: string;\n proposer: string;\n nftContract: string;\n tokenId: string;\n amount: string;\n duration: number;\n validUntil: string | null;\n paymentToken: string;\n licenseTermsUri: string;\n transferable: boolean;\n royaltyBps: number;\n open: boolean;\n accepted: boolean | null;\n createdAtChain: string;\n closedAtChain: string | null;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipLicense {\n id: string;\n chain: string;\n contractAddress: string;\n tokenId: string;\n author: string;\n recipient: string;\n assetContract: string;\n assetTokenId: string;\n expiresAt: string;\n transferable: boolean;\n royaltyBps: number;\n licenseTermsUri: string;\n offerId: string | null;\n proposalId: string | null;\n mintedAtChain: string;\n currentHolder?: string | null;\n}\n\nexport interface ApiSponsorshipOffersQuery {\n limit?: number;\n nftContract?: string;\n author?: string;\n owner?: string;\n open?: boolean;\n}\n\nexport interface ApiSponsorshipProposalsQuery {\n limit?: number;\n nftContract?: string;\n proposer?: string;\n owner?: string;\n open?: boolean;\n}\n\nexport interface ApiSponsorshipLicensesQuery {\n limit?: number;\n holder?: string;\n author?: string;\n}\n\nexport interface ApiCollectionsListQuery {\n page?: number;\n limit?: number;\n owner?: string;\n service?: string;\n sort?: CollectionSort;\n isFeatured?: boolean;\n hideEmpty?: boolean;\n standard?: string;\n chain?: ChainFilter;\n}\n\nexport interface ApiPricingRule {\n actionKey: string;\n chain: string;\n service: string;\n credits: number;\n}\n\nexport interface ApiPricing {\n creditsPerUsdc: number;\n mdln?: { contract: string | null; tiers: { minWholeTokens: number; multiplier: number }[] };\n pricing: { default: number; rules: ApiPricingRule[] };\n}\n\nexport type CreateTransferTokenIntentParams = z.input<typeof intents.transferTokenSchema>;\n\nexport type CreateTransferNftIntentParams = z.input<typeof intents.transferNftSchema>;\n\nexport type CreateTransferCollectionOwnershipIntentParams = z.input<typeof intents.transferCollectionOwnershipSchema>;\n\nexport type CreateCommentIntentParams = z.input<typeof intents.commentSchema>;\n\nexport type CreateGenesisMintIntentParams = z.input<typeof intents.genesisMintSchema>;\n\nexport type CreatePopClaimIntentParams = z.input<typeof intents.popClaimSchema>;\n\nexport type CreatePopBurnIntentParams = z.input<typeof intents.popBurnSchema>;\n\nexport type CreateDropClaimIntentParams = z.input<typeof intents.dropClaimSchema>;\n\nexport type WalletManageAction = \"add_owner\" | \"remove_owner\" | \"cancel_escape\" | \"set_first_guardian\" | \"trigger_escape\" | \"complete_escape\";\n\nexport type CreateWalletManageIntentParams = z.input<typeof intents.walletManageSchema>;\n\nexport type CreateSwapIntentParams = z.input<typeof intents.swapIntentSchema>;\n\nexport type CreateFundingTransferIntentParams = z.input<typeof intents.fundingTransferSchema>;\n\nexport type DropManageAction = \"issue\" | \"set_allowlist_root\";\n\nexport type CreateDropManageIntentParams = z.input<typeof intents.dropManageSchema>;\n\nexport type PopManageAction = \"issue\" | \"set_allowlist_root\";\n\nexport type CreatePopManageIntentParams = z.input<typeof intents.popManageSchema>;\n\nexport interface IntentParamsByKind {\n listing: CreateListingIntentParams;\n offer: MakeOfferIntentParams;\n fulfill: FulfillOrderIntentParams;\n cancel: CancelOrderIntentParams;\n mint: CreateMintIntentParams;\n \"transfer-token\": CreateTransferTokenIntentParams;\n \"transfer-nft\": CreateTransferNftIntentParams;\n \"transfer-collection-ownership\": CreateTransferCollectionOwnershipIntentParams;\n comment: CreateCommentIntentParams;\n \"genesis-mint\": CreateGenesisMintIntentParams;\n \"pop-claim\": CreatePopClaimIntentParams;\n \"pop-burn\": CreatePopBurnIntentParams;\n \"drop-claim\": CreateDropClaimIntentParams;\n \"wallet-manage\": CreateWalletManageIntentParams;\n swap: CreateSwapIntentParams;\n \"funding-transfer\": CreateFundingTransferIntentParams;\n \"drop-manage\": CreateDropManageIntentParams;\n \"pop-manage\": CreatePopManageIntentParams;\n \"create-collection\": CreateCollectionIntentParams;\n \"create-tier\": CreateTierIntentParams;\n \"create-coin\": CreateCoinIntentParams;\n \"launch-coin\": LaunchCoinIntentParams;\n \"sponsorship-offer\": CreateSponsorshipOfferIntentParams;\n \"sponsorship-offer-open\": SetSponsorshipOfferOpenIntentParams;\n \"sponsorship-bid\": PlaceSponsorshipBidIntentParams;\n \"sponsorship-bid-retract\": RetractSponsorshipBidIntentParams;\n \"sponsorship-bid-accept\": AcceptSponsorshipBidIntentParams;\n \"sponsorship-proposal\": CreateSponsorshipProposalIntentParams;\n \"sponsorship-proposal-withdraw\": WithdrawSponsorshipProposalIntentParams;\n \"sponsorship-proposal-accept\": AcceptSponsorshipProposalIntentParams;\n \"sponsorship-proposal-reject\": RejectSponsorshipProposalIntentParams;\n \"counter-offer\": CreateCounterOfferIntentParams;\n}\n","\n\nexport type AssetAttribute = { trait_type: string; value: string };\n\nexport interface AssetMetadata {\n name: string;\n description: string;\n image: string | null;\n external_url: string;\n attributes: AssetAttribute[];\n}\n\nexport interface BuildAssetMetadataInput {\n name: string;\n description?: string | null;\n externalUrl?: string | null;\n imageUri?: string | null;\n creator?: string | null;\n ipType?: string | null;\n licenseType?: string | null;\n commercialUse?: string | null;\n derivatives?: string | null;\n attribution?: string | null;\n geographicScope?: string | null;\n aiPolicy?: string | null;\n royalty?: string | null;\n edition?: string | null;\n\n templateTraits?: { traitType: string; value: string }[];\n\n registrationDate?: string;\n}\n\nexport const RESERVED_TRAITS = new Set([\n \"Creator\", \"IP Type\", \"License\", \"Commercial Use\", \"Derivatives\",\n \"Attribution\", \"Territory\", \"AI Policy\", \"Royalty\", \"Edition\",\n \"Standard\", \"Registration\",\n]);\nconst RESERVED_TRAITS_NORMALIZED = new Set([...RESERVED_TRAITS].map((t) => t.toLowerCase()));\n\nexport function buildAssetMetadata(input: BuildAssetMetadataInput): AssetMetadata {\n const attributes: AssetAttribute[] = [];\n\n if (input.creator) attributes.push({ trait_type: \"Creator\", value: input.creator });\n if (input.ipType) attributes.push({ trait_type: \"IP Type\", value: input.ipType });\n if (input.licenseType) attributes.push({ trait_type: \"License\", value: input.licenseType });\n if (input.commercialUse) attributes.push({ trait_type: \"Commercial Use\", value: input.commercialUse });\n if (input.derivatives) attributes.push({ trait_type: \"Derivatives\", value: input.derivatives });\n if (input.attribution) attributes.push({ trait_type: \"Attribution\", value: input.attribution });\n if (input.geographicScope) attributes.push({ trait_type: \"Territory\", value: input.geographicScope });\n if (input.aiPolicy) attributes.push({ trait_type: \"AI Policy\", value: input.aiPolicy });\n\n if (input.royalty) {\n const num = parseFloat(String(input.royalty).replace(\"%\", \"\"));\n if (!isNaN(num) && num > 0) attributes.push({ trait_type: \"Royalty\", value: `${num}%` });\n }\n\n if (input.edition) attributes.push({ trait_type: \"Edition\", value: input.edition });\n\n for (const t of input.templateTraits ?? []) {\n const traitType = t.traitType?.trim() ?? \"\";\n const traitValue = String(t.value ?? \"\").trim();\n if (!traitType || !traitValue || RESERVED_TRAITS_NORMALIZED.has(traitType.toLowerCase())) continue;\n attributes.push({ trait_type: traitType, value: traitValue });\n }\n\n if (input.licenseType) {\n attributes.push({ trait_type: \"Standard\", value: \"Berne Convention\" });\n attributes.push({\n trait_type: \"Registration\",\n value: input.registrationDate ?? new Date().toISOString().split(\"T\")[0],\n });\n }\n\n return {\n name: input.name,\n description: input.description ?? \"\",\n image: input.imageUri ?? null,\n external_url: input.externalUrl || \"https://medialane.io\",\n attributes,\n };\n}\n\nexport interface CollectionMetadata {\n name: string;\n description?: string;\n image?: string;\n external_link: string;\n}\n\nexport interface BuildCollectionMetadataInput {\n name: string;\n owner: string;\n description?: string | null;\n image?: string | null;\n externalLink?: string | null;\n}\n\nexport const accountPageUrl = (address: string): string => `https://www.medialane.io/account/${address}`;\n\nexport function buildCollectionMetadata(input: BuildCollectionMetadataInput): CollectionMetadata {\n const description = input.description?.trim();\n const image = input.image?.trim();\n return {\n name: input.name,\n ...(description ? { description } : {}),\n ...(image ? { image } : {}),\n external_link: input.externalLink?.trim() || accountPageUrl(input.owner),\n };\n}\n","\n\ntype Attribute = { trait_type?: string; value?: string | number | boolean };\n\nexport function getDerivativesTerm(\n attributes: Attribute[] | null | undefined,\n): \"Allowed\" | \"Not Allowed\" | null {\n const v = (Array.isArray(attributes) ? attributes : []).find(\n (a) => a.trait_type === \"Derivatives\",\n )?.value;\n return v === \"Allowed\" || v === \"Not Allowed\" ? v : null;\n}\n\nexport interface RemixPolicyInput {\n\n parentNoDerivatives: boolean;\n\n viewerIsParentOwner: boolean;\n\n dealAvailable: boolean;\n}\n\nexport interface RemixPolicy extends RemixPolicyInput {\n\n canRemixDirect: boolean;\n\n showDealOption: boolean;\n}\n\nexport function resolveRemixPolicy(input: RemixPolicyInput): RemixPolicy {\n const canRemixDirect = input.viewerIsParentOwner || !input.parentNoDerivatives;\n const showDealOption = input.dealAvailable && !input.viewerIsParentOwner;\n return { ...input, canRemixDirect, showDealOption };\n}\n","export const FIELD_LIMITS = {\n name: 255,\n symbol: 10,\n description: 2000,\n} as const;\n","export type UploadKind = \"image\" | \"document\" | \"media\";\n\nexport interface UploadLimit {\n mimeTypes: readonly string[];\n extensions: readonly string[];\n}\n\nconst MB = 1024 * 1024;\n\nexport const MAX_UPLOAD_BYTES = 90 * MB;\n\nconst IMAGE_EXTENSIONS = [\".jpg\", \".jpeg\", \".png\", \".gif\", \".svg\", \".webp\", \".avif\"];\n\nexport const UPLOAD_LIMITS: Record<UploadKind, UploadLimit> = {\n image: {\n mimeTypes: [\"image/jpeg\", \"image/png\", \"image/gif\", \"image/svg+xml\", \"image/webp\", \"image/avif\"],\n extensions: IMAGE_EXTENSIONS,\n },\n document: {\n mimeTypes: [\n \"application/pdf\",\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.oasis.opendocument.text\",\n \"application/rtf\",\n \"text/plain\",\n \"text/markdown\",\n \"application/octet-stream\",\n ],\n extensions: [\".pdf\", \".doc\", \".docx\", \".odt\", \".rtf\", \".txt\", \".md\"],\n },\n media: {\n mimeTypes: [\n \"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\", \"image/svg+xml\", \"image/avif\",\n \"video/mp4\", \"video/webm\", \"video/ogg\",\n \"audio/mpeg\", \"audio/ogg\", \"audio/wav\", \"audio/webm\", \"audio/flac\",\n \"application/pdf\",\n ],\n extensions: [...IMAGE_EXTENSIONS, \".mp4\", \".webm\", \".ogv\", \".ogg\", \".mp3\", \".wav\", \".flac\", \".pdf\"],\n },\n};\n\nexport function formatFileSize(bytes: number): string {\n const mb = bytes / MB;\n return `${Number.isInteger(mb) ? mb : mb.toFixed(1)} MB`;\n}\n\nexport function uploadSizeError(file: { size: number }, kind: UploadKind = \"image\"): string | null {\n if (file.size <= MAX_UPLOAD_BYTES) return null;\n const noun = kind === \"image\" ? \"image\" : \"file\";\n return `That ${noun} is ${formatFileSize(file.size)}. Please choose one under ${formatFileSize(MAX_UPLOAD_BYTES)}.`;\n}\n\nexport function acceptFor(kind: UploadKind): string {\n const { mimeTypes, extensions } = UPLOAD_LIMITS[kind];\n return [...mimeTypes, ...extensions].join(\",\");\n}\n\nfunction typeList(extensions: readonly string[]): string {\n const names = extensions.map((ext) => ext.slice(1).toUpperCase());\n return names.length > 1 ? `${names.slice(0, -1).join(\", \")} or ${names[names.length - 1]}` : names.join(\"\");\n}\n\nexport function uploadError(file: { size: number; type: string; name?: string }, kind: UploadKind = \"image\"): string | null {\n const { mimeTypes, extensions } = UPLOAD_LIMITS[kind];\n const name = (file.name ?? \"\").toLowerCase();\n const allowed = mimeTypes.includes(file.type) || (file.type === \"\" && extensions.some((ext) => name.endsWith(ext)));\n if (!allowed) return `Choose ${kind === \"image\" ? \"an image\" : \"a file\"} in ${typeList(extensions)}.`;\n return uploadSizeError(file, kind);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/api/launchpad-runs.ts","../src/types/api.ts","../src/metadata.ts","../src/remix-policy.ts","../src/uploads.ts"],"names":[],"mappings":";;;;;;;;;;AAoEO,IAAM,qBAAA,GAAwB,CAAC,GAAA,KACpC,GAAA,CAAI,OAAA,KAAY;AAEX,IAAM,cAAA,GAAiB,CAAC,GAAA,KAA2C,GAAA,CAAI,OAAA,KAAY;AAEnF,IAAM,wBAAA,GAA2B,CAAC,GAAA,KACvC,GAAA,CAAI,OAAA,KAAY;AAQX,IAAM,eAAA,GAAN,cAA8B,KAAA,CAA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,CAAM,mBAAA;AACrD,EAAA,OAAO,EAAE,GAAG,KAAA,EAAO,cAAA,EAAgB,cAAA,EAAe;AACpD;;;AC/BA,IAAM,KAAK,IAAA,GAAO,IAAA;AAEX,IAAM,mBAAmB,EAAA,GAAK;AAE9B,SAAS,eAAe,KAAA,EAAuB;AACpD,EAAA,MAAM,KAAK,KAAA,GAAQ,EAAA;AACnB,EAAA,OAAO,CAAA,EAAG,OAAO,SAAA,CAAU,EAAE,IAAI,EAAA,GAAK,EAAA,CAAG,OAAA,CAAQ,CAAC,CAAC,CAAA,GAAA,CAAA;AACrD;AAEO,SAAS,eAAA,CAAgB,IAAA,EAAwB,IAAA,GAAmB,OAAA,EAAwB;AACjG,EAAA,IAAI,IAAA,CAAK,IAAA,IAAQ,gBAAA,EAAkB,OAAO,IAAA;AAC1C,EAAA,MAAM,IAAA,GAAO,IAAA,KAAS,OAAA,GAAU,OAAA,GAAU,MAAA;AAC1C,EAAA,OAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,IAAA,EAAO,cAAA,CAAe,IAAA,CAAK,IAAI,CAAC,CAAA,0BAAA,EAA6B,cAAA,CAAe,gBAAgB,CAAC,CAAA,CAAA,CAAA;AAClH","file":"index.cjs","sourcesContent":["import type { FetchLike } from \"../utils/fetch.js\";\nexport type RunStatus = \"DRAFT\" | \"PAID\" | \"RUNNING\" | \"COMPLETED\" | \"FAILED\" | \"CANCELLED\";\n\nexport interface RunQuoteLine {\n action: string;\n units: number;\n unitCredits: number;\n credits: number;\n}\n\nexport interface RunQuote {\n lines: RunQuoteLine[];\n total: number;\n}\n\nexport type NextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"metadata\"; items: number[] }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport type TicketingNextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"ticket-metadata\" }\n | { kind: \"tier\" }\n | { kind: \"wait-tier\" }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport type CertificateEmissionNextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"certificate-metadata\" }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport interface WalletRequest {\n recipient: string;\n}\n\ninterface LaunchpadRunBase {\n id: string;\n status: RunStatus;\n spec: unknown;\n quote: RunQuote | null;\n creditsHeld: number;\n creditsSpent: number;\n progress: unknown;\n createdAt: string;\n updatedAt: string;\n}\n\nexport type DataTokenizationRun = LaunchpadRunBase & { service: \"data-tokenization-erc721\"; next?: NextStep };\nexport type TicketingRun = LaunchpadRunBase & { service: \"ip-ticketing\"; next?: TicketingNextStep };\nexport type CertificateEmissionRun = LaunchpadRunBase & { service: \"certificate-emission\"; next?: CertificateEmissionNextStep };\nexport type LaunchpadRun = DataTokenizationRun | TicketingRun | CertificateEmissionRun;\n\nexport const isDataTokenizationRun = (run: LaunchpadRun): run is DataTokenizationRun =>\n run.service === \"data-tokenization-erc721\";\n\nexport const isTicketingRun = (run: LaunchpadRun): run is TicketingRun => run.service === \"ip-ticketing\";\n\nexport const isCertificateEmissionRun = (run: LaunchpadRun): run is CertificateEmissionRun =>\n run.service === \"certificate-emission\";\n\nexport interface ConfirmResult {\n pending: boolean;\n status: string;\n completed?: boolean;\n}\n\nexport class RunRequestError extends Error {\n constructor(\n message: string,\n readonly status: number,\n readonly body: Record<string, unknown>,\n ) {\n super(message);\n }\n}\n\nexport interface LaunchpadRunsClientOptions {\n baseUrl: string;\n fetchImpl?: FetchLike;\n}\n\nexport function createLaunchpadRunsClient({ baseUrl, fetchImpl = fetch }: LaunchpadRunsClientOptions) {\n const runsUrl = `${baseUrl.replace(/\\/$/, \"\")}/v1/portal/runs`;\n const runBase = (id: string): string => `${runsUrl}/${id}`;\n const runBatchBase = (id: string, index: number): string => `${runBase(id)}/batches/${index}`;\n const runCollectionBase = (id: string): string => `${runBase(id)}/collection`;\n const runTierBase = (id: string): string => `${runBase(id)}/tier`;\n\n const runFetch: FetchLike = (input, init) => fetchImpl(input, { ...init, cache: \"no-store\" });\n\n async function call<T>(url: string, init?: RequestInit): Promise<{ status: number; data: T }> {\n const res = await runFetch(url, {\n ...init,\n headers: { \"content-type\": \"application/json\", ...(init?.headers as Record<string, string> | undefined) },\n });\n const body = (await res.json().catch(() => ({}))) as Record<string, unknown>;\n if (!res.ok) {\n throw new RunRequestError(String(body.error ?? \"Something went wrong with this run\"), res.status, body);\n }\n return { status: res.status, data: body.data as T };\n }\n\n const post = <T>(url: string, body?: unknown) =>\n call<T>(url, { method: \"POST\", body: body === undefined ? undefined : JSON.stringify(body) });\n\n const confirm = async (url: string): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string; completed?: boolean }>(url);\n return { pending: status === 202, status: data.status, completed: data.completed };\n };\n\n const ticketing = {\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n metadata: async (id: string, userAddress: string) =>\n (await post<{ tokenUri: string }>(`${runBase(id)}/metadata`, { userAddress })).data,\n\n resolveWallets: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/wallets/resolve`)).data.pending,\n\n registerWallet: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/wallets`, request)).data,\n\n confirmCollection: (id: string) => confirm(`${runCollectionBase(id)}/confirm`),\n confirmTier: (id: string) => confirm(`${runTierBase(id)}/confirm`),\n confirmBatch: (id: string, index: number) => confirm(`${runBatchBase(id, index)}/confirm`),\n };\n\n const certificateEmission = {\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n metadata: async (id: string, userAddress: string) =>\n (await post<{ tokenUri: string }>(`${runBase(id)}/certificate-metadata`, { userAddress })).data,\n\n resolveWallets: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/recipients/resolve`)).data.pending,\n\n registerWallet: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/recipients`, request)).data,\n\n confirmCollection: (id: string) => confirm(`${runCollectionBase(id)}/confirm`),\n confirmBatch: (id: string, index: number) => confirm(`${runBatchBase(id, index)}/confirm`),\n };\n\n return {\n fetch: runFetch,\n runBase,\n runBatchBase,\n runCollectionBase,\n runTierBase,\n ticketing,\n certificateEmission,\n\n list: async () => (await call<LaunchpadRun[]>(runsUrl)).data,\n\n get: async (id: string) => (await call<LaunchpadRun>(`${runBase(id)}`)).data,\n\n create: async (service: string, spec: unknown) =>\n (await post<LaunchpadRun>(runsUrl, { service, spec })).data,\n\n update: async (id: string, spec: unknown) =>\n (await call<LaunchpadRun>(`${runBase(id)}`, { method: \"PATCH\", body: JSON.stringify({ spec }) })).data,\n\n cancel: async (id: string) => (await post<LaunchpadRun>(`${runBase(id)}/cancel`)).data,\n\n checkoutWithCredits: async (id: string) =>\n (await post<LaunchpadRun>(`${runBase(id)}/checkout`, { method: \"credits\" })).data,\n\n checkoutFromWallet: async (id: string, intentId: string) =>\n (await post<LaunchpadRun>(`${runBase(id)}/checkout`, { method: \"wallet\", intentId })).data,\n\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n itemMetadata: async (id: string, index: number, userAddress: string) =>\n (await post<{ index: number; tokenUri: string }>(`${runBase(id)}/items/${index}/metadata`, { userAddress })).data,\n\n resolveGuests: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/guests/resolve`)).data.pending,\n\n registerGuest: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/guests`, request)).data,\n\n confirmBatch: async (id: string, index: number): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string; completed?: boolean }>(\n `${runBase(id)}/batches/${index}/confirm`,\n );\n return { pending: status === 202, status: data.status, completed: data.completed };\n },\n\n confirmCollection: async (id: string): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string }>(`${runBase(id)}/collection/confirm`);\n return { pending: status === 202, status: data.status };\n },\n };\n}\n\nexport type LaunchpadRunsClient = ReturnType<typeof createLaunchpadRunsClient>;\n","import type { z } from \"zod\";\nimport type * as intents from \"../contract/intents.js\";\nimport type * as issuance from \"../contract/issuance.js\";\nimport type * as orders from \"../contract/orders.js\";\nimport type * as profiles from \"../contract/profiles.js\";\nimport type * as responses from \"../contract/responses.js\";\n\nexport type IPType =\n | \"Audio\"\n | \"Art\"\n | \"Documents\"\n | \"NFT\"\n | \"Video\"\n | \"Photography\"\n | \"Patents\"\n | \"Posts\"\n | \"Publications\"\n | \"RWA\"\n | \"Software\"\n | \"Custom\";\n\nexport type CollectionSort = \"recent\" | \"supply\" | \"floor\" | \"volume\" | \"name\";\n\nexport type CollectionTokensSort = \"recent\" | \"oldest\" | \"name\" | \"price\";\n\nexport type ServiceCapability =\n | \"list\" | \"buy\" | \"make_offer\" | \"cancel\"\n | \"transfer\" | \"burn\"\n | \"mint\" | \"claim\" | \"airdrop\"\n | \"remix\" | \"license\"\n | \"subscribe\" | \"redeem\"\n | \"launch\" | \"swap\"\n | \"sponsor\";\n\nexport interface EnforcementDeclaration {\n royalty?: \"erc2981\" | \"service-split\" | \"none\";\n escrow?: boolean;\n timeLock?: boolean;\n revocable?: boolean;\n}\n\nexport interface ServiceEventDeclaration {\n\n name: string;\n\n emittedBy: \"factory\" | \"instance\";\n\n poll?: \"fast\" | \"slow\";\n}\n\nexport interface ServiceDefinition {\n\n id: string;\n displayName: string;\n description: string;\n standard: \"ERC721\" | \"ERC1155\" | \"ERC20\" | \"UNKNOWN\";\n provenance: \"MEDIALANE\" | \"EXTERNAL\";\n onchain?: Partial<Record<import(\"../chains.js\").Chain, {\n factoryAddress?: string;\n classHash?: string;\n startBlock?: number;\n }>>;\n\n uiVariant: string;\n capabilities: ServiceCapability[];\n\n events?: ServiceEventDeclaration[];\n metadataSchema?: {\n requiredTraits?: string[];\n\n licenseDefault?: string;\n enforcement?: EnforcementDeclaration;\n };\n}\n\nexport interface ApiCollectionsQuery {\n page?: number;\n limit?: number;\n isKnown?: boolean;\n sort?: CollectionSort;\n owner?: string;\n\n service?: string;\n}\n\nexport type OrderStatus = \"ACTIVE\" | \"FULFILLED\" | \"CANCELLED\" | \"EXPIRED\";\nexport type SortOrder = \"price_asc\" | \"price_desc\" | \"recent\";\nexport type ActivityType = \"mint\" | \"transfer\" | \"sale\" | \"listing\" | \"offer\" | \"cancelled\";\nexport type IntentType = \"CREATE_LISTING\" | \"MAKE_OFFER\" | \"FULFILL_ORDER\" | \"CANCEL_ORDER\" | \"MINT\" | \"CREATE_COLLECTION\" | \"COUNTER_OFFER\";\nexport type IntentStatus = \"PENDING\" | \"SIGNED\" | \"SUBMITTED\" | \"CONFIRMED\" | \"FAILED\" | \"EXPIRED\";\n\nexport interface ApiMeta {\n page: number;\n limit: number;\n total?: number;\n\n counts?: Record<string, number>;\n}\n\nexport interface ApiResponse<T> {\n data: T;\n meta?: ApiMeta;\n}\n\nexport type ChainFilter = import(\"../chains.js\").Chain | \"all\";\n\nexport type ApiOrdersQuery = z.input<typeof orders.ordersListQuery> & { chain?: ChainFilter };\n\nexport interface ApiOrderOffer {\n itemType: string;\n token: string;\n identifier: string;\n startAmount: string;\n endAmount: string;\n}\n\nexport interface ApiOrderConsideration extends ApiOrderOffer {\n recipient: string;\n}\n\nexport interface ApiOrderPrice {\n raw: string | null;\n formatted: string | null;\n currency: string | null;\n decimals: number;\n}\n\nexport interface ApiOrderTxHash {\n created: string | null;\n fulfilled: string | null;\n cancelled: string | null;\n}\n\nexport interface ApiOrderTokenMeta {\n name: string | null;\n image: string | null;\n description: string | null;\n animationUrl: string | null;\n}\n\nexport type ApiOrder = z.output<typeof responses.orderSchema>;\n\nexport type IpAttribute = z.output<typeof responses.tokenAttributeSchema>;\n\nexport interface IpNftMetadata {\n name: string;\n description?: string;\n image?: string | null;\n external_url?: string;\n attributes?: IpAttribute[];\n\n ipType?: string | null;\n licenseType?: string | null;\n commercialUse?: string | null;\n derivatives?: string | null;\n attribution?: string | null;\n territory?: string | null;\n aiPolicy?: string | null;\n royalty?: string | null;\n registration?: string | null;\n}\n\nexport type ApiTokenMetadata = ApiToken[\"metadata\"];\n\nexport interface ApiTokenBalance {\n owner: string;\n\n amount: string;\n}\n\nexport type ApiToken = z.output<typeof responses.tokenSchema>;\n\nexport type ApiCollection = z.output<typeof responses.collectionSchema>;\n\nexport interface ApiCoin {\n id: string;\n chain: string;\n contractAddress: string;\n standard: \"ERC20\";\n\n service: string;\n name: string | null;\n symbol: string | null;\n decimals: number;\n\n totalSupply: string | null;\n description: string | null;\n image: string | null;\n creator: string | null;\n\n isLaunched?: boolean | null;\n startBlock: string;\n isHidden: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ApiCoinPrice {\n\n usdc: number;\n}\n\nexport type ApiCoinPrices = Record<string, ApiCoinPrice | null>;\n\nexport type ApiCoinClaimResult =\n | { verified: true; coin: ApiCoin | null }\n | { verified: false; reason: \"owner_mismatch\" | \"owner_check_failed\" | \"not_erc20\" | \"no_total_supply\" };\n\nexport interface ApiCoinsQuery {\n chain?: ChainFilter;\n page?: number;\n limit?: number;\n service?: string;\n sort?: string;\n creator?: string;\n}\n\nexport interface ApiActivityPrice {\n raw: string | null;\n formatted: string | null;\n currency: string | null;\n}\n\nexport interface ApiActivity {\n type: ActivityType;\n chain: import(\"../chains.js\").Chain;\n\n contractAddress?: string;\n tokenId?: string;\n from?: string;\n to?: string;\n blockNumber?: string;\n\n amount?: string;\n\n orderHash?: string;\n nftContract?: string;\n nftTokenId?: string;\n offerer?: string;\n fulfiller?: string | null;\n price?: ApiActivityPrice;\n\n tokenStandard?: \"ERC721\" | \"ERC1155\";\n txHash: string | null;\n timestamp: string;\n\n token?: { name: string | null; image: string | null; animationUrl: string | null } | null;\n}\n\nexport interface ApiActivitiesQuery {\n chain?: ChainFilter;\n type?: ActivityType;\n\n contract?: string;\n page?: number;\n limit?: number;\n}\n\nexport interface ApiComment {\n id: string;\n chain: string;\n contractAddress: string;\n tokenId: string;\n author: string;\n content: string;\n txHash: string | null;\n blockNumber: string;\n postedAt: string;\n}\n\nexport interface ApiSearchTokenResult {\n contractAddress: string;\n tokenId: string;\n name: string | null;\n image: string | null;\n owner: string;\n metadataStatus: string;\n}\n\nexport interface ApiSearchCollectionResult {\n contractAddress: string;\n name: string | null;\n image: string | null;\n totalSupply: number | null;\n floorPrice: string | null;\n holderCount: number | null;\n}\n\nexport interface ApiSearchCreatorResult {\n walletAddress: string;\n username: string | null;\n name: string | null;\n bio: string | null;\n avatarImage: string | null;\n}\n\nexport interface ApiSearchResult {\n tokens: ApiSearchTokenResult[];\n collections: ApiSearchCollectionResult[];\n creators: ApiSearchCreatorResult[];\n}\n\nexport interface ApiIntent {\n id: string;\n chain: string;\n type: IntentType;\n status: IntentStatus;\n requester: string;\n typedData: unknown;\n calls: unknown;\n signature: string[];\n txHash: string | null;\n orderHash: string | null;\n\n parentOrderHash?: string | null;\n\n counterOfferMessage?: string | null;\n expiresAt: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IntentCall {\n contractAddress: string;\n entrypoint: string;\n calldata: string[];\n}\n\nexport type ApiIntentCreated =\n | { id: string; expiresAt: string; requiresSignature: true; typedData: unknown }\n | { id: string; expiresAt: string; requiresSignature: false; calls: IntentCall[] };\n\nexport interface ApiTxSyncResult {\n applied: number;\n contracts?: string[];\n pending: boolean;\n}\n\nexport type CreateListingIntentParams = z.input<typeof intents.listingSchema>;\n\nexport type MakeOfferIntentParams = z.input<typeof intents.offerSchema>;\n\nexport type FulfillOrderIntentParams = z.input<typeof intents.fulfillSchema>;\n\nexport type CancelOrderIntentParams = z.input<typeof intents.cancelSchema>;\n\nexport type FactoryFamilyServiceId = (typeof intents.FACTORY_FAMILY_SERVICE_IDS)[number];\n\nexport type TierServiceId = (typeof intents.TIER_SERVICE_IDS)[number];\n\nexport type CollectionServiceId = (typeof intents.COLLECTION_SERVICE_IDS)[number];\n\nexport type CreateMintIntentParams = z.input<typeof intents.mintSchema>;\n\n/** Drop sale terms on the wire: amounts as decimal strings in the token's smallest unit. */\nexport interface DropTermsBody {\n /** Unix seconds; 0 = open from creation. */\n startTime: number;\n /** Unix seconds; 0 = never closes. */\n endTime: number;\n /** Per token; \"0\" = free. */\n price: string;\n paymentToken: string;\n /** \"0\" = unlimited. */\n maxPerWallet: string;\n}\n\nexport type ApiDropListStatus = \"live\" | \"upcoming\" | \"ended\";\n\nexport interface ApiDrop {\n contractAddress: string;\n dropId: string;\n organizer: string;\n name: string | null;\n symbol: string | null;\n description: string | null;\n image: string | null;\n /** Token URI = baseUri + token id. */\n baseUri: string | null;\n /** \"0\" = no cap. */\n maxSupply: string;\n minted: string;\n /** Total paid to the organizer, in the payment token's smallest unit. */\n revenue: string;\n collectors: number;\n terms: DropTermsBody;\n /** \"0x0\" = open to everyone. */\n allowlistRoot: string;\n createdBlock: string;\n}\n\nexport interface ApiDropFee {\n /** Platform fee added to a mint, in basis points; 0 when none applies. */\n launchpadBps: number;\n}\n\nexport interface ApiDropMint {\n kind: \"claim\" | \"issue\";\n wallet: string;\n quantity: string;\n firstTokenId: string;\n totalPaid: string;\n txHash: string;\n blockNumber: string;\n createdAt: string;\n}\n\nexport type CreateCollectionIntentParams = z.input<typeof intents.createCollectionSchema>;\n\nexport interface CheckoutIntentItem {\n orderHash: string;\n\n quantity?: string;\n}\n\nexport type CreateCheckoutIntentParams = z.input<typeof intents.checkoutBodySchema>;\n\nexport interface ApiCheckoutIntentResult {\n id?: string;\n orderHash: string;\n requiresSignature?: false;\n calls?: unknown;\n expiresAt?: string;\n\n error?: string;\n}\n\nexport type CreateTierIntentParams = z.output<typeof intents.createTierSchema>;\n\nexport type EmissionParams = z.input<typeof issuance.emissionSchema>;\n\nexport interface ApiEmissionCall {\n contractAddress: string;\n entrypoint: string;\n calldata: string[];\n}\n\nexport interface ApiEmissionResult {\n service: string;\n recipientCount: number;\n callCount: number;\n batches: ApiEmissionCall[][];\n}\n\nexport type CreateCoinIntentParams = z.input<typeof intents.createCoinSchema>;\n\nexport type LaunchCoinIntentParams = z.output<typeof intents.launchCoinSchema>;\n\nexport type CreateSponsorshipOfferIntentParams = z.output<typeof intents.sponsorshipOfferSchema>;\n\nexport type SetSponsorshipOfferOpenIntentParams = z.input<typeof intents.sponsorshipOfferOpenSchema>;\n\nexport type PlaceSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidSchema>;\n\nexport type RetractSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidRetractSchema>;\n\nexport type AcceptSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidAcceptSchema>;\n\nexport type CreateSponsorshipProposalIntentParams = z.output<typeof intents.sponsorshipProposalSchema>;\n\nexport type WithdrawSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalWithdrawSchema>;\n\nexport type AcceptSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalAcceptSchema>;\n\nexport type RejectSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalRejectSchema>;\n\nexport type CreateCounterOfferIntentParams = z.input<typeof intents.counterOfferSchema>;\n\nexport interface ApiCounterOffersQuery {\n\n originalOrderHash?: string;\n\n sellerAddress?: string;\n page?: number;\n limit?: number;\n}\n\nexport const OPEN_LICENSES = [\"CC0\", \"CC BY\", \"CC BY-SA\", \"CC BY-NC\"] as const;\nexport type OpenLicense = (typeof OPEN_LICENSES)[number];\n\nexport type RemixOfferStatus =\n | \"PENDING\"\n | \"AUTO_PENDING\"\n | \"APPROVED\"\n | \"COMPLETED\"\n | \"REJECTED\"\n | \"EXPIRED\"\n | \"SELF_MINTED\";\n\nexport interface ApiRemixOfferPrice {\n raw: string;\n formatted: string;\n currency: string;\n decimals: number;\n}\n\nexport interface ApiRemixOffer {\n id: string;\n status: RemixOfferStatus;\n originalContract: string;\n originalTokenId: string;\n creatorAddress: string;\n requesterAddress: string | null;\n message?: string | null;\n\n price?: ApiRemixOfferPrice;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct: number | null;\n approvedCollection: string | null;\n remixContract: string | null;\n remixTokenId: string | null;\n orderHash: string | null;\n createdAt: string;\n expiresAt: string;\n updatedAt: string;\n}\n\nexport interface ApiPublicRemix {\n id: string;\n remixContract: string | null;\n remixTokenId: string | null;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n createdAt: string;\n}\n\nexport interface CreateRemixOfferParams {\n originalContract: string;\n originalTokenId: string;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct?: number;\n proposedPrice?: string;\n proposedCurrency?: string;\n message?: string;\n\n expiresInDays?: number;\n}\n\nexport interface AutoRemixOfferParams {\n originalContract: string;\n originalTokenId: string;\n licenseType: string;\n}\n\nexport interface ConfirmSelfRemixParams {\n originalContract: string;\n originalTokenId: string;\n remixContract: string;\n remixTokenId: string;\n\n txHash?: string;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct?: number;\n}\n\nexport interface ConfirmRemixOfferParams {\n approvedCollection: string;\n remixContract: string;\n remixTokenId: string;\n orderHash?: string;\n}\n\nexport interface ApiRemixOffersQuery {\n\n role: \"creator\" | \"requester\";\n status?: string;\n page?: number;\n limit?: number;\n}\n\nexport interface ApiMetadataSignedUrl {\n url: string;\n}\n\nexport interface ApiMetadataUpload {\n cid: string;\n url: string;\n}\n\nexport interface ApiPortalMe {\n id: string;\n accountId: string;\n status: string;\n creditBalance: number;\n}\n\nexport interface ApiPortalKey {\n id: string;\n prefix: string;\n label: string | null;\n lastUsedAt: string | null;\n createdAt: string;\n}\n\nexport interface ApiPortalKeyCreated {\n id: string;\n prefix: string;\n label: string | null;\n\n plaintext: string;\n}\n\nexport interface ApiCreditPayment {\n id: string;\n asset: string;\n amountAtomic: string;\n creditedAmount: number;\n mdlnMultiplier: number;\n txHash: string;\n status: string;\n createdAt: string;\n}\n\nexport interface ApiFundingMethod {\n id: string;\n [detail: string]: unknown;\n}\n\nexport type ApiFundingStatus = \"PENDING\" | \"SETTLED\" | \"FAILED\" | \"EXPIRED\";\n\nexport interface ApiFundingIntent {\n id: string;\n method: string;\n status: ApiFundingStatus;\n expiresAt: string;\n payer?: string | null;\n}\n\nexport interface ApiFundingInstructions {\n chain: string;\n payTo: string;\n asset: string;\n amountAtomic: string;\n}\n\nexport type ApiFundingSubmit =\n | { status: \"SETTLED\"; credited?: number }\n | { status: \"PENDING\"; reason: string };\n\nexport interface ApiSpendByAction {\n actionKey: string;\n credits: number;\n units: number;\n}\n\nexport interface ApiPortalSpend {\n recent: Array<{ actionKey: string; credits: number; createdAt: string }>;\n byAction: ApiSpendByAction[];\n spent: number;\n credited: number;\n drift: number;\n}\n\nexport interface ApiCollectionProfile {\n contractAddress: string;\n chain: string;\n displayName: string | null;\n description: string | null;\n image: string | null;\n bannerImage: string | null;\n websiteUrl: string | null;\n twitterUrl: string | null;\n discordUrl: string | null;\n telegramUrl: string | null;\n hasGatedContent: boolean;\n gatedContentTitle: string | null;\n slug: string | null;\n updatedBy: string | null;\n updatedAt: string;\n}\n\nexport type UpdateCollectionProfileInput = z.output<typeof profiles.collectionProfileSchema>;\n\nexport interface ApiCollectionSlugClaim {\n id: string;\n slug: string;\n contractAddress: string;\n chain: string;\n walletAddress: string;\n status: \"PENDING\" | \"APPROVED\" | \"REJECTED\";\n adminNotes: string | null;\n notifyEmail: string | null;\n reviewedAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ApiCreatorProfile {\n walletAddress: string;\n chain: string;\n username: string | null;\n name: string | null;\n bio: string | null;\n avatarImage: string | null;\n\n collectionImage?: string | null;\n websiteUrl: string | null;\n twitterUrl: string | null;\n discordUrl: string | null;\n telegramUrl: string | null;\n updatedAt: string;\n}\n\nexport interface ApiCreatorListResult {\n creators: ApiCreatorProfile[];\n total: number;\n page: number;\n limit: number;\n}\n\nexport type ApiChain = \"STARKNET\" | \"ETHEREUM\" | \"SOLANA\" | \"BASE\" | \"BITCOIN\";\n\nexport interface ApiSession {\n accountId: string;\n publicId: string;\n walletAddress: string | null;\n email: string | null;\n emailDeadline: string | null;\n}\n\nexport interface ApiUserWallet {\n walletAddress: string;\n email?: string | null;\n emailDeadline?: string | null;\n}\n\nexport interface ApiCollectionClaim {\n id: string;\n contractAddress: string;\n chain: string;\n claimantAddress: string | null;\n status: \"PENDING\" | \"AUTO_APPROVED\" | \"APPROVED\" | \"REJECTED\";\n verificationMethod: \"ONCHAIN\" | \"SIGNATURE\" | \"MANUAL\";\n createdAt: string;\n}\n\nexport interface ApiAdminCollectionClaim extends ApiCollectionClaim {\n claimantEmail: string | null;\n notes: string | null;\n adminNotes: string | null;\n reviewedBy: string | null;\n reviewedAt: string | null;\n updatedAt: string;\n}\n\nexport interface ApiBusinessProvisioning {\n chain: string;\n walletAddress: string;\n}\n\nexport interface ApiWalletActivity {\n id: string;\n chain: string;\n accountAddress: string;\n type: \"SEND\" | \"RECEIVE\" | \"SWAP\" | \"DEPLOY\" | \"GUARDIAN_SET\" | \"GUARDIAN_TRIGGER_ESCAPE\" | \"GUARDIAN_COMPLETE_ESCAPE\" | \"GUARDIAN_CANCEL_ESCAPE\";\n txHash: string;\n blockNumber: string;\n timestamp: string;\n tokenAddress: string | null;\n amount: string | null;\n counterparty: string | null;\n tokenInAddress: string | null;\n amountIn: string | null;\n tokenOutAddress: string | null;\n amountOut: string | null;\n}\n\nexport interface ApiRewardsBadge {\n key: string;\n name: string;\n description: string;\n icon: string;\n color: string;\n category: string;\n}\n\nexport interface ApiRewardsLevel {\n level: number;\n name: string;\n xpRequired: number;\n badgeColor: string;\n description: string | null;\n}\n\nexport interface ApiUserRewards {\n address: string;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n nextLevel: { level: number; name: string; xpRequired: number } | null;\n progressPct: number;\n breakdown: Record<string, number>;\n badges: ApiRewardsBadge[];\n computedAt: string | null;\n}\n\nexport interface ApiRewardsLeaderboardEntry {\n rank: number;\n address: string;\n accountId: string | null;\n publicId: string | null;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n}\n\nexport interface ApiRewardsConfig {\n levels: ApiRewardsLevel[];\n actions: { type: string; label: string; xp: number; dailyCap: number | null }[];\n badges: ApiRewardsBadge[];\n}\n\nexport interface ApiRewardsBatchEntry {\n address: string;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n}\n\nexport interface ApiPointEvent {\n id: string;\n actionType: string;\n xp: number;\n multiplier: number;\n finalXp: number;\n txHash: string | null;\n createdAt: string;\n}\n\nexport interface ApiPlatformStats {\n collections: number;\n tokens: number;\n sales: number;\n}\n\nexport interface ApiTierOnchain {\n maxSupply: string;\n minted: string;\n startTime: number | null;\n endTime: number | null;\n royaltyBps: number;\n}\n\nexport interface ApiSwapQuoteRequest {\n sellSymbol?: string;\n buySymbol?: string;\n sellTokenAddress?: string;\n buyTokenAddress?: string;\n sellAmountRaw?: string;\n buyAmountRaw?: string;\n takerAddress?: string;\n}\n\nexport interface ApiSwapQuote {\n quoteId: string;\n sellTokenAddress: string;\n sellAmount: string;\n buyTokenAddress: string;\n buyAmount: string;\n}\n\nexport interface ApiIpNftTokenData {\n owner: string;\n metadataUri: string;\n originalCreator: string;\n registeredAt: number;\n}\n\nexport interface ApiTokensQuery {\n page?: number;\n limit?: number;\n sort?: string;\n ipType?: string;\n derivatives?: \"allowed\";\n}\n\nexport interface ApiUsernameClaim {\n id: string;\n username: string;\n walletAddress: string;\n status: \"PENDING\" | \"APPROVED\" | \"REJECTED\";\n adminNotes: string | null;\n reviewedAt: string | null;\n createdAt: string;\n}\n\nexport type ApiReportTargetType = \"COLLECTION\" | \"TOKEN\" | \"CREATOR\" | \"COMMENT\";\n\nexport interface ApiSubmitReport {\n targetType: ApiReportTargetType;\n targetContract?: string;\n targetTokenId?: string;\n targetAddress?: string;\n targetId?: string;\n categories: string[];\n description?: string;\n}\n\nexport interface ApiSponsorshipOffer {\n id: string;\n chain: string;\n contractAddress: string;\n offerId: string;\n author: string;\n nftContract: string;\n tokenId: string;\n minAmount: string;\n duration: number;\n paymentToken: string;\n licenseTermsUri: string;\n transferable: boolean;\n royaltyBps: number;\n specificSponsor: string | null;\n open: boolean;\n createdAtChain: string;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipBid {\n id: string;\n chain: string;\n contractAddress: string;\n offerId: string;\n sponsor: string;\n amount: string;\n placedAtChain: string;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipProposal {\n id: string;\n chain: string;\n contractAddress: string;\n proposalId: string;\n proposer: string;\n nftContract: string;\n tokenId: string;\n amount: string;\n duration: number;\n validUntil: string | null;\n paymentToken: string;\n licenseTermsUri: string;\n transferable: boolean;\n royaltyBps: number;\n open: boolean;\n accepted: boolean | null;\n createdAtChain: string;\n closedAtChain: string | null;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipLicense {\n id: string;\n chain: string;\n contractAddress: string;\n tokenId: string;\n author: string;\n recipient: string;\n assetContract: string;\n assetTokenId: string;\n expiresAt: string;\n transferable: boolean;\n royaltyBps: number;\n licenseTermsUri: string;\n offerId: string | null;\n proposalId: string | null;\n mintedAtChain: string;\n currentHolder?: string | null;\n}\n\nexport interface ApiSponsorshipOffersQuery {\n limit?: number;\n nftContract?: string;\n author?: string;\n owner?: string;\n open?: boolean;\n}\n\nexport interface ApiSponsorshipProposalsQuery {\n limit?: number;\n nftContract?: string;\n proposer?: string;\n owner?: string;\n open?: boolean;\n}\n\nexport interface ApiSponsorshipLicensesQuery {\n limit?: number;\n holder?: string;\n author?: string;\n}\n\nexport interface ApiCollectionsListQuery {\n page?: number;\n limit?: number;\n owner?: string;\n service?: string;\n sort?: CollectionSort;\n isFeatured?: boolean;\n hideEmpty?: boolean;\n standard?: string;\n chain?: ChainFilter;\n}\n\nexport interface ApiPricingRule {\n actionKey: string;\n chain: string;\n service: string;\n credits: number;\n}\n\nexport interface ApiPricing {\n creditsPerUsdc: number;\n mdln?: { contract: string | null; tiers: { minWholeTokens: number; multiplier: number }[] };\n pricing: { default: number; rules: ApiPricingRule[] };\n}\n\nexport type CreateTransferTokenIntentParams = z.input<typeof intents.transferTokenSchema>;\n\nexport type CreateTransferNftIntentParams = z.input<typeof intents.transferNftSchema>;\n\nexport type CreateTransferCollectionOwnershipIntentParams = z.input<typeof intents.transferCollectionOwnershipSchema>;\n\nexport type CreateCommentIntentParams = z.input<typeof intents.commentSchema>;\n\nexport type CreateGenesisMintIntentParams = z.input<typeof intents.genesisMintSchema>;\n\nexport type CreatePopClaimIntentParams = z.input<typeof intents.popClaimSchema>;\n\nexport type CreatePopBurnIntentParams = z.input<typeof intents.popBurnSchema>;\n\nexport type CreateDropClaimIntentParams = z.input<typeof intents.dropClaimSchema>;\n\nexport type WalletManageAction = \"add_owner\" | \"remove_owner\" | \"cancel_escape\" | \"set_first_guardian\" | \"trigger_escape\" | \"complete_escape\";\n\nexport type CreateWalletManageIntentParams = z.input<typeof intents.walletManageSchema>;\n\nexport type CreateSwapIntentParams = z.input<typeof intents.swapIntentSchema>;\n\nexport type CreateFundingTransferIntentParams = z.input<typeof intents.fundingTransferSchema>;\n\nexport type DropManageAction = \"issue\" | \"set_allowlist_root\";\n\nexport type CreateDropManageIntentParams = z.input<typeof intents.dropManageSchema>;\n\nexport type PopManageAction = \"issue\" | \"set_allowlist_root\";\n\nexport type CreatePopManageIntentParams = z.input<typeof intents.popManageSchema>;\n\nexport interface IntentParamsByKind {\n listing: CreateListingIntentParams;\n offer: MakeOfferIntentParams;\n fulfill: FulfillOrderIntentParams;\n cancel: CancelOrderIntentParams;\n mint: CreateMintIntentParams;\n \"transfer-token\": CreateTransferTokenIntentParams;\n \"transfer-nft\": CreateTransferNftIntentParams;\n \"transfer-collection-ownership\": CreateTransferCollectionOwnershipIntentParams;\n comment: CreateCommentIntentParams;\n \"genesis-mint\": CreateGenesisMintIntentParams;\n \"pop-claim\": CreatePopClaimIntentParams;\n \"pop-burn\": CreatePopBurnIntentParams;\n \"drop-claim\": CreateDropClaimIntentParams;\n \"wallet-manage\": CreateWalletManageIntentParams;\n swap: CreateSwapIntentParams;\n \"funding-transfer\": CreateFundingTransferIntentParams;\n \"drop-manage\": CreateDropManageIntentParams;\n \"pop-manage\": CreatePopManageIntentParams;\n \"create-collection\": CreateCollectionIntentParams;\n \"create-tier\": CreateTierIntentParams;\n \"create-coin\": CreateCoinIntentParams;\n \"launch-coin\": LaunchCoinIntentParams;\n \"sponsorship-offer\": CreateSponsorshipOfferIntentParams;\n \"sponsorship-offer-open\": SetSponsorshipOfferOpenIntentParams;\n \"sponsorship-bid\": PlaceSponsorshipBidIntentParams;\n \"sponsorship-bid-retract\": RetractSponsorshipBidIntentParams;\n \"sponsorship-bid-accept\": AcceptSponsorshipBidIntentParams;\n \"sponsorship-proposal\": CreateSponsorshipProposalIntentParams;\n \"sponsorship-proposal-withdraw\": WithdrawSponsorshipProposalIntentParams;\n \"sponsorship-proposal-accept\": AcceptSponsorshipProposalIntentParams;\n \"sponsorship-proposal-reject\": RejectSponsorshipProposalIntentParams;\n \"counter-offer\": CreateCounterOfferIntentParams;\n}\n","\n\nexport type AssetAttribute = { trait_type: string; value: string };\n\nexport interface AssetMetadata {\n name: string;\n description: string;\n image: string | null;\n external_url: string;\n attributes: AssetAttribute[];\n}\n\nexport interface BuildAssetMetadataInput {\n name: string;\n description?: string | null;\n externalUrl?: string | null;\n imageUri?: string | null;\n creator?: string | null;\n ipType?: string | null;\n licenseType?: string | null;\n commercialUse?: string | null;\n derivatives?: string | null;\n attribution?: string | null;\n geographicScope?: string | null;\n aiPolicy?: string | null;\n royalty?: string | null;\n edition?: string | null;\n\n templateTraits?: { traitType: string; value: string }[];\n}\n\nexport const RESERVED_TRAITS = new Set([\n \"Creator\", \"IP Type\", \"License\", \"Commercial Use\", \"Derivatives\",\n \"Attribution\", \"Territory\", \"AI Policy\", \"Royalty\", \"Edition\",\n \"Standard\",\n]);\nconst RESERVED_TRAITS_NORMALIZED = new Set([...RESERVED_TRAITS].map((t) => t.toLowerCase()));\n\nexport function buildAssetMetadata(input: BuildAssetMetadataInput): AssetMetadata {\n const attributes: AssetAttribute[] = [];\n\n if (input.creator) attributes.push({ trait_type: \"Creator\", value: input.creator });\n if (input.ipType) attributes.push({ trait_type: \"IP Type\", value: input.ipType });\n if (input.licenseType) attributes.push({ trait_type: \"License\", value: input.licenseType });\n if (input.commercialUse) attributes.push({ trait_type: \"Commercial Use\", value: input.commercialUse });\n if (input.derivatives) attributes.push({ trait_type: \"Derivatives\", value: input.derivatives });\n if (input.attribution) attributes.push({ trait_type: \"Attribution\", value: input.attribution });\n if (input.geographicScope) attributes.push({ trait_type: \"Territory\", value: input.geographicScope });\n if (input.aiPolicy) attributes.push({ trait_type: \"AI Policy\", value: input.aiPolicy });\n\n if (input.royalty) {\n const num = parseFloat(String(input.royalty).replace(\"%\", \"\"));\n if (!isNaN(num) && num > 0) attributes.push({ trait_type: \"Royalty\", value: `${num}%` });\n }\n\n if (input.edition) attributes.push({ trait_type: \"Edition\", value: input.edition });\n\n for (const t of input.templateTraits ?? []) {\n const traitType = t.traitType?.trim() ?? \"\";\n const traitValue = String(t.value ?? \"\").trim();\n if (!traitType || !traitValue || RESERVED_TRAITS_NORMALIZED.has(traitType.toLowerCase())) continue;\n attributes.push({ trait_type: traitType, value: traitValue });\n }\n\n if (input.licenseType) attributes.push({ trait_type: \"Standard\", value: \"Berne Convention\" });\n\n return {\n name: input.name,\n description: input.description ?? \"\",\n image: input.imageUri ?? null,\n external_url: input.externalUrl || \"https://medialane.io\",\n attributes,\n };\n}\n\nexport interface CollectionMetadata {\n name: string;\n description?: string;\n image?: string;\n external_link: string;\n}\n\nexport interface BuildCollectionMetadataInput {\n name: string;\n owner: string;\n description?: string | null;\n image?: string | null;\n externalLink?: string | null;\n}\n\nexport const accountPageUrl = (address: string): string => `https://www.medialane.io/account/${address}`;\n\nexport function buildCollectionMetadata(input: BuildCollectionMetadataInput): CollectionMetadata {\n const description = input.description?.trim();\n const image = input.image?.trim();\n return {\n name: input.name,\n ...(description ? { description } : {}),\n ...(image ? { image } : {}),\n external_link: input.externalLink?.trim() || accountPageUrl(input.owner),\n };\n}\n","\n\ntype Attribute = { trait_type?: string; value?: string | number | boolean };\n\nexport function getDerivativesTerm(\n attributes: Attribute[] | null | undefined,\n): \"Allowed\" | \"Not Allowed\" | null {\n const v = (Array.isArray(attributes) ? attributes : []).find(\n (a) => a.trait_type === \"Derivatives\",\n )?.value;\n return v === \"Allowed\" || v === \"Not Allowed\" ? v : null;\n}\n\nexport interface RemixPolicyInput {\n\n parentNoDerivatives: boolean;\n\n viewerIsParentOwner: boolean;\n\n dealAvailable: boolean;\n}\n\nexport interface RemixPolicy extends RemixPolicyInput {\n\n canRemixDirect: boolean;\n\n showDealOption: boolean;\n}\n\nexport function resolveRemixPolicy(input: RemixPolicyInput): RemixPolicy {\n const canRemixDirect = input.viewerIsParentOwner || !input.parentNoDerivatives;\n const showDealOption = input.dealAvailable && !input.viewerIsParentOwner;\n return { ...input, canRemixDirect, showDealOption };\n}\n","export type UploadKind = \"image\" | \"document\" | \"media\";\n\nconst MB = 1024 * 1024;\n\nexport const MAX_UPLOAD_BYTES = 90 * MB;\n\nexport function formatFileSize(bytes: number): string {\n const mb = bytes / MB;\n return `${Number.isInteger(mb) ? mb : mb.toFixed(1)} MB`;\n}\n\nexport function uploadSizeError(file: { size: number }, kind: UploadKind = \"image\"): string | null {\n if (file.size <= MAX_UPLOAD_BYTES) return null;\n const noun = kind === \"image\" ? \"image\" : \"file\";\n return `That ${noun} is ${formatFileSize(file.size)}. Please choose one under ${formatFileSize(MAX_UPLOAD_BYTES)}.`;\n}\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -722,7 +722,6 @@ interface BuildAssetMetadataInput {
|
|
|
722
722
|
traitType: string;
|
|
723
723
|
value: string;
|
|
724
724
|
}[];
|
|
725
|
-
registrationDate?: string;
|
|
726
725
|
}
|
|
727
726
|
declare const RESERVED_TRAITS: Set<string>;
|
|
728
727
|
declare function buildAssetMetadata(input: BuildAssetMetadataInput): AssetMetadata;
|
|
@@ -758,28 +757,11 @@ interface RemixPolicy extends RemixPolicyInput {
|
|
|
758
757
|
}
|
|
759
758
|
declare function resolveRemixPolicy(input: RemixPolicyInput): RemixPolicy;
|
|
760
759
|
|
|
761
|
-
declare const FIELD_LIMITS: {
|
|
762
|
-
readonly name: 255;
|
|
763
|
-
readonly symbol: 10;
|
|
764
|
-
readonly description: 2000;
|
|
765
|
-
};
|
|
766
|
-
|
|
767
760
|
type UploadKind = "image" | "document" | "media";
|
|
768
|
-
interface UploadLimit {
|
|
769
|
-
mimeTypes: readonly string[];
|
|
770
|
-
extensions: readonly string[];
|
|
771
|
-
}
|
|
772
761
|
declare const MAX_UPLOAD_BYTES: number;
|
|
773
|
-
declare const UPLOAD_LIMITS: Record<UploadKind, UploadLimit>;
|
|
774
762
|
declare function formatFileSize(bytes: number): string;
|
|
775
763
|
declare function uploadSizeError(file: {
|
|
776
764
|
size: number;
|
|
777
765
|
}, kind?: UploadKind): string | null;
|
|
778
|
-
declare function acceptFor(kind: UploadKind): string;
|
|
779
|
-
declare function uploadError(file: {
|
|
780
|
-
size: number;
|
|
781
|
-
type: string;
|
|
782
|
-
name?: string;
|
|
783
|
-
}, kind?: UploadKind): string | null;
|
|
784
766
|
|
|
785
|
-
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, type BuildCollectionMetadataInput, type CanonicalHash, type CertificateEmissionNextStep, type CertificateEmissionRun, Chain, type CollectionMetadata, type ConfirmResult, type ConsiderationItem, DEFAULT_CURRENCY, type DataTokenizationRun,
|
|
767
|
+
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, type BuildCollectionMetadataInput, type CanonicalHash, type CertificateEmissionNextStep, type CertificateEmissionRun, Chain, type CollectionMetadata, type ConfirmResult, type ConsiderationItem, DEFAULT_CURRENCY, type DataTokenizationRun, FetchLike, type LaunchpadRun, type LaunchpadRunsClient, type LaunchpadRunsClientOptions, MAX_UPLOAD_BYTES, type NextStep, type OfferItem, type Order, type OrderDetails, type OrderParameters, RESERVED_TRAITS, type RemixPolicy, type RemixPolicyInput, type RunQuote, type RunQuoteLine, RunRequestError, type RunStatus, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_721_CONTRACT, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_DATA_TOKENIZATION_721_CONTRACT, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_DROP_FACTORY_START_BLOCK, STARKNET_GENESIS_MINT_CONTRACT, STARKNET_GENESIS_NFT_URI, STARKNET_IP_CLUB_FACTORY_CONTRACT, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_FACTORY_CONTRACT, STARKNET_POP_FACTORY_START_BLOCK, SUPPORTED_TOKENS, SUPPORTED_URL_CHAINS, ServiceCapability, ServiceDefinition, type ServiceId, type SupportedToken, type SupportedTokenSymbol, type TicketingNextStep, type TicketingRun, type TxResult, type UploadKind, type WalletRequest, accountPageUrl, assetHref, buildAssetMetadata, buildCollectionMetadata, chainFromSlug, chainSlug, coinHref, collectionHref, createLaunchpadRunsClient, dropHref, encodeU256, formatAmount, formatFileSize, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isCertificateEmissionRun, isDataTokenizationRun, isServiceId, isTicketingRun, listServices, normalizeAddress, normalizeHash, parseAmount, profileHref, resolveRemixPolicy, shortenAddress, stringifyBigInts, u256ToBigInt, uploadSizeError };
|
package/dist/index.d.ts
CHANGED
|
@@ -722,7 +722,6 @@ interface BuildAssetMetadataInput {
|
|
|
722
722
|
traitType: string;
|
|
723
723
|
value: string;
|
|
724
724
|
}[];
|
|
725
|
-
registrationDate?: string;
|
|
726
725
|
}
|
|
727
726
|
declare const RESERVED_TRAITS: Set<string>;
|
|
728
727
|
declare function buildAssetMetadata(input: BuildAssetMetadataInput): AssetMetadata;
|
|
@@ -758,28 +757,11 @@ interface RemixPolicy extends RemixPolicyInput {
|
|
|
758
757
|
}
|
|
759
758
|
declare function resolveRemixPolicy(input: RemixPolicyInput): RemixPolicy;
|
|
760
759
|
|
|
761
|
-
declare const FIELD_LIMITS: {
|
|
762
|
-
readonly name: 255;
|
|
763
|
-
readonly symbol: 10;
|
|
764
|
-
readonly description: 2000;
|
|
765
|
-
};
|
|
766
|
-
|
|
767
760
|
type UploadKind = "image" | "document" | "media";
|
|
768
|
-
interface UploadLimit {
|
|
769
|
-
mimeTypes: readonly string[];
|
|
770
|
-
extensions: readonly string[];
|
|
771
|
-
}
|
|
772
761
|
declare const MAX_UPLOAD_BYTES: number;
|
|
773
|
-
declare const UPLOAD_LIMITS: Record<UploadKind, UploadLimit>;
|
|
774
762
|
declare function formatFileSize(bytes: number): string;
|
|
775
763
|
declare function uploadSizeError(file: {
|
|
776
764
|
size: number;
|
|
777
765
|
}, kind?: UploadKind): string | null;
|
|
778
|
-
declare function acceptFor(kind: UploadKind): string;
|
|
779
|
-
declare function uploadError(file: {
|
|
780
|
-
size: number;
|
|
781
|
-
type: string;
|
|
782
|
-
name?: string;
|
|
783
|
-
}, kind?: UploadKind): string | null;
|
|
784
766
|
|
|
785
|
-
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, type BuildCollectionMetadataInput, type CanonicalHash, type CertificateEmissionNextStep, type CertificateEmissionRun, Chain, type CollectionMetadata, type ConfirmResult, type ConsiderationItem, DEFAULT_CURRENCY, type DataTokenizationRun,
|
|
767
|
+
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, type BuildCollectionMetadataInput, type CanonicalHash, type CertificateEmissionNextStep, type CertificateEmissionRun, Chain, type CollectionMetadata, type ConfirmResult, type ConsiderationItem, DEFAULT_CURRENCY, type DataTokenizationRun, FetchLike, type LaunchpadRun, type LaunchpadRunsClient, type LaunchpadRunsClientOptions, MAX_UPLOAD_BYTES, type NextStep, type OfferItem, type Order, type OrderDetails, type OrderParameters, RESERVED_TRAITS, type RemixPolicy, type RemixPolicyInput, type RunQuote, type RunQuoteLine, RunRequestError, type RunStatus, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_721_CONTRACT, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_DATA_TOKENIZATION_721_CONTRACT, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_DROP_FACTORY_START_BLOCK, STARKNET_GENESIS_MINT_CONTRACT, STARKNET_GENESIS_NFT_URI, STARKNET_IP_CLUB_FACTORY_CONTRACT, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_FACTORY_CONTRACT, STARKNET_POP_FACTORY_START_BLOCK, SUPPORTED_TOKENS, SUPPORTED_URL_CHAINS, ServiceCapability, ServiceDefinition, type ServiceId, type SupportedToken, type SupportedTokenSymbol, type TicketingNextStep, type TicketingRun, type TxResult, type UploadKind, type WalletRequest, accountPageUrl, assetHref, buildAssetMetadata, buildCollectionMetadata, chainFromSlug, chainSlug, coinHref, collectionHref, createLaunchpadRunsClient, dropHref, encodeU256, formatAmount, formatFileSize, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isCertificateEmissionRun, isDataTokenizationRun, isServiceId, isTicketingRun, listServices, normalizeAddress, normalizeHash, parseAmount, profileHref, resolveRemixPolicy, shortenAddress, stringifyBigInts, u256ToBigInt, uploadSizeError };
|
package/dist/index.js
CHANGED
|
@@ -106,8 +106,7 @@ var RESERVED_TRAITS = /* @__PURE__ */ new Set([
|
|
|
106
106
|
"AI Policy",
|
|
107
107
|
"Royalty",
|
|
108
108
|
"Edition",
|
|
109
|
-
"Standard"
|
|
110
|
-
"Registration"
|
|
109
|
+
"Standard"
|
|
111
110
|
]);
|
|
112
111
|
var RESERVED_TRAITS_NORMALIZED = new Set([...RESERVED_TRAITS].map((t) => t.toLowerCase()));
|
|
113
112
|
function buildAssetMetadata(input) {
|
|
@@ -131,13 +130,7 @@ function buildAssetMetadata(input) {
|
|
|
131
130
|
if (!traitType || !traitValue || RESERVED_TRAITS_NORMALIZED.has(traitType.toLowerCase())) continue;
|
|
132
131
|
attributes.push({ trait_type: traitType, value: traitValue });
|
|
133
132
|
}
|
|
134
|
-
if (input.licenseType) {
|
|
135
|
-
attributes.push({ trait_type: "Standard", value: "Berne Convention" });
|
|
136
|
-
attributes.push({
|
|
137
|
-
trait_type: "Registration",
|
|
138
|
-
value: input.registrationDate ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
|
|
139
|
-
});
|
|
140
|
-
}
|
|
133
|
+
if (input.licenseType) attributes.push({ trait_type: "Standard", value: "Berne Convention" });
|
|
141
134
|
return {
|
|
142
135
|
name: input.name,
|
|
143
136
|
description: input.description ?? "",
|
|
@@ -171,56 +164,9 @@ function resolveRemixPolicy(input) {
|
|
|
171
164
|
return { ...input, canRemixDirect, showDealOption };
|
|
172
165
|
}
|
|
173
166
|
|
|
174
|
-
// src/field-limits.ts
|
|
175
|
-
var FIELD_LIMITS = {
|
|
176
|
-
name: 255,
|
|
177
|
-
symbol: 10,
|
|
178
|
-
description: 2e3
|
|
179
|
-
};
|
|
180
|
-
|
|
181
167
|
// src/uploads.ts
|
|
182
168
|
var MB = 1024 * 1024;
|
|
183
169
|
var MAX_UPLOAD_BYTES = 90 * MB;
|
|
184
|
-
var IMAGE_EXTENSIONS = [".jpg", ".jpeg", ".png", ".gif", ".svg", ".webp", ".avif"];
|
|
185
|
-
var UPLOAD_LIMITS = {
|
|
186
|
-
image: {
|
|
187
|
-
mimeTypes: ["image/jpeg", "image/png", "image/gif", "image/svg+xml", "image/webp", "image/avif"],
|
|
188
|
-
extensions: IMAGE_EXTENSIONS
|
|
189
|
-
},
|
|
190
|
-
document: {
|
|
191
|
-
mimeTypes: [
|
|
192
|
-
"application/pdf",
|
|
193
|
-
"application/msword",
|
|
194
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
195
|
-
"application/vnd.oasis.opendocument.text",
|
|
196
|
-
"application/rtf",
|
|
197
|
-
"text/plain",
|
|
198
|
-
"text/markdown",
|
|
199
|
-
"application/octet-stream"
|
|
200
|
-
],
|
|
201
|
-
extensions: [".pdf", ".doc", ".docx", ".odt", ".rtf", ".txt", ".md"]
|
|
202
|
-
},
|
|
203
|
-
media: {
|
|
204
|
-
mimeTypes: [
|
|
205
|
-
"image/jpeg",
|
|
206
|
-
"image/png",
|
|
207
|
-
"image/gif",
|
|
208
|
-
"image/webp",
|
|
209
|
-
"image/svg+xml",
|
|
210
|
-
"image/avif",
|
|
211
|
-
"video/mp4",
|
|
212
|
-
"video/webm",
|
|
213
|
-
"video/ogg",
|
|
214
|
-
"audio/mpeg",
|
|
215
|
-
"audio/ogg",
|
|
216
|
-
"audio/wav",
|
|
217
|
-
"audio/webm",
|
|
218
|
-
"audio/flac",
|
|
219
|
-
"application/pdf"
|
|
220
|
-
],
|
|
221
|
-
extensions: [...IMAGE_EXTENSIONS, ".mp4", ".webm", ".ogv", ".ogg", ".mp3", ".wav", ".flac", ".pdf"]
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
170
|
function formatFileSize(bytes) {
|
|
225
171
|
const mb = bytes / MB;
|
|
226
172
|
return `${Number.isInteger(mb) ? mb : mb.toFixed(1)} MB`;
|
|
@@ -230,22 +176,7 @@ function uploadSizeError(file, kind = "image") {
|
|
|
230
176
|
const noun = kind === "image" ? "image" : "file";
|
|
231
177
|
return `That ${noun} is ${formatFileSize(file.size)}. Please choose one under ${formatFileSize(MAX_UPLOAD_BYTES)}.`;
|
|
232
178
|
}
|
|
233
|
-
function acceptFor(kind) {
|
|
234
|
-
const { mimeTypes, extensions } = UPLOAD_LIMITS[kind];
|
|
235
|
-
return [...mimeTypes, ...extensions].join(",");
|
|
236
|
-
}
|
|
237
|
-
function typeList(extensions) {
|
|
238
|
-
const names = extensions.map((ext) => ext.slice(1).toUpperCase());
|
|
239
|
-
return names.length > 1 ? `${names.slice(0, -1).join(", ")} or ${names[names.length - 1]}` : names.join("");
|
|
240
|
-
}
|
|
241
|
-
function uploadError(file, kind = "image") {
|
|
242
|
-
const { mimeTypes, extensions } = UPLOAD_LIMITS[kind];
|
|
243
|
-
const name = (file.name ?? "").toLowerCase();
|
|
244
|
-
const allowed = mimeTypes.includes(file.type) || file.type === "" && extensions.some((ext) => name.endsWith(ext));
|
|
245
|
-
if (!allowed) return `Choose ${kind === "image" ? "an image" : "a file"} in ${typeList(extensions)}.`;
|
|
246
|
-
return uploadSizeError(file, kind);
|
|
247
|
-
}
|
|
248
179
|
|
|
249
|
-
export {
|
|
180
|
+
export { MAX_UPLOAD_BYTES, OPEN_LICENSES, RESERVED_TRAITS, RunRequestError, accountPageUrl, buildAssetMetadata, buildCollectionMetadata, createLaunchpadRunsClient, formatFileSize, getDerivativesTerm, isCertificateEmissionRun, isDataTokenizationRun, isTicketingRun, resolveRemixPolicy, uploadSizeError };
|
|
250
181
|
//# sourceMappingURL=index.js.map
|
|
251
182
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/api/launchpad-runs.ts","../src/types/api.ts","../src/metadata.ts","../src/remix-policy.ts","../src/field-limits.ts","../src/uploads.ts"],"names":[],"mappings":";;;;;;;;AAoEO,IAAM,qBAAA,GAAwB,CAAC,GAAA,KACpC,GAAA,CAAI,OAAA,KAAY;AAEX,IAAM,cAAA,GAAiB,CAAC,GAAA,KAA2C,GAAA,CAAI,OAAA,KAAY;AAEnF,IAAM,wBAAA,GAA2B,CAAC,GAAA,KACvC,GAAA,CAAI,OAAA,KAAY;AAQX,IAAM,eAAA,GAAN,cAA8B,KAAA,CAAM;AAAA,EACzC,WAAA,CACE,OAAA,EACS,MAAA,EACA,IAAA,EACT;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAHJ,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAAA,EAGX;AACF;AAOO,SAAS,yBAAA,CAA0B,EAAE,OAAA,EAAS,SAAA,GAAY,OAAM,EAA+B;AACpG,EAAA,MAAM,UAAU,CAAA,EAAG,OAAA,CAAQ,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAC,CAAA,eAAA,CAAA;AAC7C,EAAA,MAAM,UAAU,CAAC,EAAA,KAAuB,CAAA,EAAG,OAAO,IAAI,EAAE,CAAA,CAAA;AACxD,EAAA,MAAM,YAAA,GAAe,CAAC,EAAA,EAAY,KAAA,KAA0B,GAAG,OAAA,CAAQ,EAAE,CAAC,CAAA,SAAA,EAAY,KAAK,CAAA,CAAA;AAC3F,EAAA,MAAM,oBAAoB,CAAC,EAAA,KAAuB,CAAA,EAAG,OAAA,CAAQ,EAAE,CAAC,CAAA,WAAA,CAAA;AAChE,EAAA,MAAM,cAAc,CAAC,EAAA,KAAuB,CAAA,EAAG,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AA,IAAI,CAAC,OAAA,EAAS,OAAO,CAAA,OAAA,EAAU,IAAA,KAAS,OAAA,GAAU,UAAA,GAAa,QAAQ,CAAA,IAAA,EAAO,QAAA,CAAS,UAAU,CAAC,CAAA,CAAA,CAAA;AAClG,EAAA,OAAO,eAAA,CAAgB,MAAM,IAAI,CAAA;AACnC","file":"index.js","sourcesContent":["import type { FetchLike } from \"../utils/fetch.js\";\nexport type RunStatus = \"DRAFT\" | \"PAID\" | \"RUNNING\" | \"COMPLETED\" | \"FAILED\" | \"CANCELLED\";\n\nexport interface RunQuoteLine {\n action: string;\n units: number;\n unitCredits: number;\n credits: number;\n}\n\nexport interface RunQuote {\n lines: RunQuoteLine[];\n total: number;\n}\n\nexport type NextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"metadata\"; items: number[] }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport type TicketingNextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"ticket-metadata\" }\n | { kind: \"tier\" }\n | { kind: \"wait-tier\" }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport type CertificateEmissionNextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"certificate-metadata\" }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport interface WalletRequest {\n recipient: string;\n}\n\ninterface LaunchpadRunBase {\n id: string;\n status: RunStatus;\n spec: unknown;\n quote: RunQuote | null;\n creditsHeld: number;\n creditsSpent: number;\n progress: unknown;\n createdAt: string;\n updatedAt: string;\n}\n\nexport type DataTokenizationRun = LaunchpadRunBase & { service: \"data-tokenization-erc721\"; next?: NextStep };\nexport type TicketingRun = LaunchpadRunBase & { service: \"ip-ticketing\"; next?: TicketingNextStep };\nexport type CertificateEmissionRun = LaunchpadRunBase & { service: \"certificate-emission\"; next?: CertificateEmissionNextStep };\nexport type LaunchpadRun = DataTokenizationRun | TicketingRun | CertificateEmissionRun;\n\nexport const isDataTokenizationRun = (run: LaunchpadRun): run is DataTokenizationRun =>\n run.service === \"data-tokenization-erc721\";\n\nexport const isTicketingRun = (run: LaunchpadRun): run is TicketingRun => run.service === \"ip-ticketing\";\n\nexport const isCertificateEmissionRun = (run: LaunchpadRun): run is CertificateEmissionRun =>\n run.service === \"certificate-emission\";\n\nexport interface ConfirmResult {\n pending: boolean;\n status: string;\n completed?: boolean;\n}\n\nexport class RunRequestError extends Error {\n constructor(\n message: string,\n readonly status: number,\n readonly body: Record<string, unknown>,\n ) {\n super(message);\n }\n}\n\nexport interface LaunchpadRunsClientOptions {\n baseUrl: string;\n fetchImpl?: FetchLike;\n}\n\nexport function createLaunchpadRunsClient({ baseUrl, fetchImpl = fetch }: LaunchpadRunsClientOptions) {\n const runsUrl = `${baseUrl.replace(/\\/$/, \"\")}/v1/portal/runs`;\n const runBase = (id: string): string => `${runsUrl}/${id}`;\n const runBatchBase = (id: string, index: number): string => `${runBase(id)}/batches/${index}`;\n const runCollectionBase = (id: string): string => `${runBase(id)}/collection`;\n const runTierBase = (id: string): string => `${runBase(id)}/tier`;\n\n const runFetch: FetchLike = (input, init) => fetchImpl(input, { ...init, cache: \"no-store\" });\n\n async function call<T>(url: string, init?: RequestInit): Promise<{ status: number; data: T }> {\n const res = await runFetch(url, {\n ...init,\n headers: { \"content-type\": \"application/json\", ...(init?.headers as Record<string, string> | undefined) },\n });\n const body = (await res.json().catch(() => ({}))) as Record<string, unknown>;\n if (!res.ok) {\n throw new RunRequestError(String(body.error ?? \"Something went wrong with this run\"), res.status, body);\n }\n return { status: res.status, data: body.data as T };\n }\n\n const post = <T>(url: string, body?: unknown) =>\n call<T>(url, { method: \"POST\", body: body === undefined ? undefined : JSON.stringify(body) });\n\n const confirm = async (url: string): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string; completed?: boolean }>(url);\n return { pending: status === 202, status: data.status, completed: data.completed };\n };\n\n const ticketing = {\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n metadata: async (id: string, userAddress: string) =>\n (await post<{ tokenUri: string }>(`${runBase(id)}/metadata`, { userAddress })).data,\n\n resolveWallets: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/wallets/resolve`)).data.pending,\n\n registerWallet: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/wallets`, request)).data,\n\n confirmCollection: (id: string) => confirm(`${runCollectionBase(id)}/confirm`),\n confirmTier: (id: string) => confirm(`${runTierBase(id)}/confirm`),\n confirmBatch: (id: string, index: number) => confirm(`${runBatchBase(id, index)}/confirm`),\n };\n\n const certificateEmission = {\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n metadata: async (id: string, userAddress: string) =>\n (await post<{ tokenUri: string }>(`${runBase(id)}/certificate-metadata`, { userAddress })).data,\n\n resolveWallets: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/recipients/resolve`)).data.pending,\n\n registerWallet: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/recipients`, request)).data,\n\n confirmCollection: (id: string) => confirm(`${runCollectionBase(id)}/confirm`),\n confirmBatch: (id: string, index: number) => confirm(`${runBatchBase(id, index)}/confirm`),\n };\n\n return {\n fetch: runFetch,\n runBase,\n runBatchBase,\n runCollectionBase,\n runTierBase,\n ticketing,\n certificateEmission,\n\n list: async () => (await call<LaunchpadRun[]>(runsUrl)).data,\n\n get: async (id: string) => (await call<LaunchpadRun>(`${runBase(id)}`)).data,\n\n create: async (service: string, spec: unknown) =>\n (await post<LaunchpadRun>(runsUrl, { service, spec })).data,\n\n update: async (id: string, spec: unknown) =>\n (await call<LaunchpadRun>(`${runBase(id)}`, { method: \"PATCH\", body: JSON.stringify({ spec }) })).data,\n\n cancel: async (id: string) => (await post<LaunchpadRun>(`${runBase(id)}/cancel`)).data,\n\n checkoutWithCredits: async (id: string) =>\n (await post<LaunchpadRun>(`${runBase(id)}/checkout`, { method: \"credits\" })).data,\n\n checkoutFromWallet: async (id: string, intentId: string) =>\n (await post<LaunchpadRun>(`${runBase(id)}/checkout`, { method: \"wallet\", intentId })).data,\n\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n itemMetadata: async (id: string, index: number, userAddress: string) =>\n (await post<{ index: number; tokenUri: string }>(`${runBase(id)}/items/${index}/metadata`, { userAddress })).data,\n\n resolveGuests: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/guests/resolve`)).data.pending,\n\n registerGuest: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/guests`, request)).data,\n\n confirmBatch: async (id: string, index: number): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string; completed?: boolean }>(\n `${runBase(id)}/batches/${index}/confirm`,\n );\n return { pending: status === 202, status: data.status, completed: data.completed };\n },\n\n confirmCollection: async (id: string): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string }>(`${runBase(id)}/collection/confirm`);\n return { pending: status === 202, status: data.status };\n },\n };\n}\n\nexport type LaunchpadRunsClient = ReturnType<typeof createLaunchpadRunsClient>;\n","import type { z } from \"zod\";\nimport type * as intents from \"../contract/intents.js\";\nimport type * as issuance from \"../contract/issuance.js\";\nimport type * as orders from \"../contract/orders.js\";\nimport type * as profiles from \"../contract/profiles.js\";\nimport type * as responses from \"../contract/responses.js\";\n\nexport type IPType =\n | \"Audio\"\n | \"Art\"\n | \"Documents\"\n | \"NFT\"\n | \"Video\"\n | \"Photography\"\n | \"Patents\"\n | \"Posts\"\n | \"Publications\"\n | \"RWA\"\n | \"Software\"\n | \"Custom\";\n\nexport type CollectionSort = \"recent\" | \"supply\" | \"floor\" | \"volume\" | \"name\";\n\nexport type CollectionTokensSort = \"recent\" | \"oldest\" | \"name\" | \"price\";\n\nexport type ServiceCapability =\n | \"list\" | \"buy\" | \"make_offer\" | \"cancel\"\n | \"transfer\" | \"burn\"\n | \"mint\" | \"claim\" | \"airdrop\"\n | \"remix\" | \"license\"\n | \"subscribe\" | \"redeem\"\n | \"launch\" | \"swap\"\n | \"sponsor\";\n\nexport interface EnforcementDeclaration {\n royalty?: \"erc2981\" | \"service-split\" | \"none\";\n escrow?: boolean;\n timeLock?: boolean;\n revocable?: boolean;\n}\n\nexport interface ServiceEventDeclaration {\n\n name: string;\n\n emittedBy: \"factory\" | \"instance\";\n\n poll?: \"fast\" | \"slow\";\n}\n\nexport interface ServiceDefinition {\n\n id: string;\n displayName: string;\n description: string;\n standard: \"ERC721\" | \"ERC1155\" | \"ERC20\" | \"UNKNOWN\";\n provenance: \"MEDIALANE\" | \"EXTERNAL\";\n onchain?: Partial<Record<import(\"../chains.js\").Chain, {\n factoryAddress?: string;\n classHash?: string;\n startBlock?: number;\n }>>;\n\n uiVariant: string;\n capabilities: ServiceCapability[];\n\n events?: ServiceEventDeclaration[];\n metadataSchema?: {\n requiredTraits?: string[];\n\n licenseDefault?: string;\n enforcement?: EnforcementDeclaration;\n };\n}\n\nexport interface ApiCollectionsQuery {\n page?: number;\n limit?: number;\n isKnown?: boolean;\n sort?: CollectionSort;\n owner?: string;\n\n service?: string;\n}\n\nexport type OrderStatus = \"ACTIVE\" | \"FULFILLED\" | \"CANCELLED\" | \"EXPIRED\";\nexport type SortOrder = \"price_asc\" | \"price_desc\" | \"recent\";\nexport type ActivityType = \"mint\" | \"transfer\" | \"sale\" | \"listing\" | \"offer\" | \"cancelled\";\nexport type IntentType = \"CREATE_LISTING\" | \"MAKE_OFFER\" | \"FULFILL_ORDER\" | \"CANCEL_ORDER\" | \"MINT\" | \"CREATE_COLLECTION\" | \"COUNTER_OFFER\";\nexport type IntentStatus = \"PENDING\" | \"SIGNED\" | \"SUBMITTED\" | \"CONFIRMED\" | \"FAILED\" | \"EXPIRED\";\n\nexport interface ApiMeta {\n page: number;\n limit: number;\n total?: number;\n\n counts?: Record<string, number>;\n}\n\nexport interface ApiResponse<T> {\n data: T;\n meta?: ApiMeta;\n}\n\nexport type ChainFilter = import(\"../chains.js\").Chain | \"all\";\n\nexport type ApiOrdersQuery = z.input<typeof orders.ordersListQuery> & { chain?: ChainFilter };\n\nexport interface ApiOrderOffer {\n itemType: string;\n token: string;\n identifier: string;\n startAmount: string;\n endAmount: string;\n}\n\nexport interface ApiOrderConsideration extends ApiOrderOffer {\n recipient: string;\n}\n\nexport interface ApiOrderPrice {\n raw: string | null;\n formatted: string | null;\n currency: string | null;\n decimals: number;\n}\n\nexport interface ApiOrderTxHash {\n created: string | null;\n fulfilled: string | null;\n cancelled: string | null;\n}\n\nexport interface ApiOrderTokenMeta {\n name: string | null;\n image: string | null;\n description: string | null;\n animationUrl: string | null;\n}\n\nexport type ApiOrder = z.output<typeof responses.orderSchema>;\n\nexport type IpAttribute = z.output<typeof responses.tokenAttributeSchema>;\n\nexport interface IpNftMetadata {\n name: string;\n description?: string;\n image?: string | null;\n external_url?: string;\n attributes?: IpAttribute[];\n\n ipType?: string | null;\n licenseType?: string | null;\n commercialUse?: string | null;\n derivatives?: string | null;\n attribution?: string | null;\n territory?: string | null;\n aiPolicy?: string | null;\n royalty?: string | null;\n registration?: string | null;\n}\n\nexport type ApiTokenMetadata = ApiToken[\"metadata\"];\n\nexport interface ApiTokenBalance {\n owner: string;\n\n amount: string;\n}\n\nexport type ApiToken = z.output<typeof responses.tokenSchema>;\n\nexport type ApiCollection = z.output<typeof responses.collectionSchema>;\n\nexport interface ApiCoin {\n id: string;\n chain: string;\n contractAddress: string;\n standard: \"ERC20\";\n\n service: string;\n name: string | null;\n symbol: string | null;\n decimals: number;\n\n totalSupply: string | null;\n description: string | null;\n image: string | null;\n creator: string | null;\n\n isLaunched?: boolean | null;\n startBlock: string;\n isHidden: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ApiCoinPrice {\n\n usdc: number;\n}\n\nexport type ApiCoinPrices = Record<string, ApiCoinPrice | null>;\n\nexport type ApiCoinClaimResult =\n | { verified: true; coin: ApiCoin | null }\n | { verified: false; reason: \"owner_mismatch\" | \"owner_check_failed\" | \"not_erc20\" | \"no_total_supply\" };\n\nexport interface ApiCoinsQuery {\n chain?: ChainFilter;\n page?: number;\n limit?: number;\n service?: string;\n sort?: string;\n creator?: string;\n}\n\nexport interface ApiActivityPrice {\n raw: string | null;\n formatted: string | null;\n currency: string | null;\n}\n\nexport interface ApiActivity {\n type: ActivityType;\n chain: import(\"../chains.js\").Chain;\n\n contractAddress?: string;\n tokenId?: string;\n from?: string;\n to?: string;\n blockNumber?: string;\n\n amount?: string;\n\n orderHash?: string;\n nftContract?: string;\n nftTokenId?: string;\n offerer?: string;\n fulfiller?: string | null;\n price?: ApiActivityPrice;\n\n tokenStandard?: \"ERC721\" | \"ERC1155\";\n txHash: string | null;\n timestamp: string;\n\n token?: { name: string | null; image: string | null; animationUrl: string | null } | null;\n}\n\nexport interface ApiActivitiesQuery {\n chain?: ChainFilter;\n type?: ActivityType;\n\n contract?: string;\n page?: number;\n limit?: number;\n}\n\nexport interface ApiComment {\n id: string;\n chain: string;\n contractAddress: string;\n tokenId: string;\n author: string;\n content: string;\n txHash: string | null;\n blockNumber: string;\n postedAt: string;\n}\n\nexport interface ApiSearchTokenResult {\n contractAddress: string;\n tokenId: string;\n name: string | null;\n image: string | null;\n owner: string;\n metadataStatus: string;\n}\n\nexport interface ApiSearchCollectionResult {\n contractAddress: string;\n name: string | null;\n image: string | null;\n totalSupply: number | null;\n floorPrice: string | null;\n holderCount: number | null;\n}\n\nexport interface ApiSearchCreatorResult {\n walletAddress: string;\n username: string | null;\n name: string | null;\n bio: string | null;\n avatarImage: string | null;\n}\n\nexport interface ApiSearchResult {\n tokens: ApiSearchTokenResult[];\n collections: ApiSearchCollectionResult[];\n creators: ApiSearchCreatorResult[];\n}\n\nexport interface ApiIntent {\n id: string;\n chain: string;\n type: IntentType;\n status: IntentStatus;\n requester: string;\n typedData: unknown;\n calls: unknown;\n signature: string[];\n txHash: string | null;\n orderHash: string | null;\n\n parentOrderHash?: string | null;\n\n counterOfferMessage?: string | null;\n expiresAt: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IntentCall {\n contractAddress: string;\n entrypoint: string;\n calldata: string[];\n}\n\nexport type ApiIntentCreated =\n | { id: string; expiresAt: string; requiresSignature: true; typedData: unknown }\n | { id: string; expiresAt: string; requiresSignature: false; calls: IntentCall[] };\n\nexport interface ApiTxSyncResult {\n applied: number;\n contracts?: string[];\n pending: boolean;\n}\n\nexport type CreateListingIntentParams = z.input<typeof intents.listingSchema>;\n\nexport type MakeOfferIntentParams = z.input<typeof intents.offerSchema>;\n\nexport type FulfillOrderIntentParams = z.input<typeof intents.fulfillSchema>;\n\nexport type CancelOrderIntentParams = z.input<typeof intents.cancelSchema>;\n\nexport type FactoryFamilyServiceId = (typeof intents.FACTORY_FAMILY_SERVICE_IDS)[number];\n\nexport type TierServiceId = (typeof intents.TIER_SERVICE_IDS)[number];\n\nexport type CollectionServiceId = (typeof intents.COLLECTION_SERVICE_IDS)[number];\n\nexport type CreateMintIntentParams = z.input<typeof intents.mintSchema>;\n\n/** Drop sale terms on the wire: amounts as decimal strings in the token's smallest unit. */\nexport interface DropTermsBody {\n /** Unix seconds; 0 = open from creation. */\n startTime: number;\n /** Unix seconds; 0 = never closes. */\n endTime: number;\n /** Per token; \"0\" = free. */\n price: string;\n paymentToken: string;\n /** \"0\" = unlimited. */\n maxPerWallet: string;\n}\n\nexport type ApiDropListStatus = \"live\" | \"upcoming\" | \"ended\";\n\nexport interface ApiDrop {\n contractAddress: string;\n dropId: string;\n organizer: string;\n name: string | null;\n symbol: string | null;\n description: string | null;\n image: string | null;\n /** Token URI = baseUri + token id. */\n baseUri: string | null;\n /** \"0\" = no cap. */\n maxSupply: string;\n minted: string;\n /** Total paid to the organizer, in the payment token's smallest unit. */\n revenue: string;\n collectors: number;\n terms: DropTermsBody;\n /** \"0x0\" = open to everyone. */\n allowlistRoot: string;\n createdBlock: string;\n}\n\nexport interface ApiDropFee {\n /** Platform fee added to a mint, in basis points; 0 when none applies. */\n launchpadBps: number;\n}\n\nexport interface ApiDropMint {\n kind: \"claim\" | \"issue\";\n wallet: string;\n quantity: string;\n firstTokenId: string;\n totalPaid: string;\n txHash: string;\n blockNumber: string;\n createdAt: string;\n}\n\nexport type CreateCollectionIntentParams = z.input<typeof intents.createCollectionSchema>;\n\nexport interface CheckoutIntentItem {\n orderHash: string;\n\n quantity?: string;\n}\n\nexport type CreateCheckoutIntentParams = z.input<typeof intents.checkoutBodySchema>;\n\nexport interface ApiCheckoutIntentResult {\n id?: string;\n orderHash: string;\n requiresSignature?: false;\n calls?: unknown;\n expiresAt?: string;\n\n error?: string;\n}\n\nexport type CreateTierIntentParams = z.output<typeof intents.createTierSchema>;\n\nexport type EmissionParams = z.input<typeof issuance.emissionSchema>;\n\nexport interface ApiEmissionCall {\n contractAddress: string;\n entrypoint: string;\n calldata: string[];\n}\n\nexport interface ApiEmissionResult {\n service: string;\n recipientCount: number;\n callCount: number;\n batches: ApiEmissionCall[][];\n}\n\nexport type CreateCoinIntentParams = z.input<typeof intents.createCoinSchema>;\n\nexport type LaunchCoinIntentParams = z.output<typeof intents.launchCoinSchema>;\n\nexport type CreateSponsorshipOfferIntentParams = z.output<typeof intents.sponsorshipOfferSchema>;\n\nexport type SetSponsorshipOfferOpenIntentParams = z.input<typeof intents.sponsorshipOfferOpenSchema>;\n\nexport type PlaceSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidSchema>;\n\nexport type RetractSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidRetractSchema>;\n\nexport type AcceptSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidAcceptSchema>;\n\nexport type CreateSponsorshipProposalIntentParams = z.output<typeof intents.sponsorshipProposalSchema>;\n\nexport type WithdrawSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalWithdrawSchema>;\n\nexport type AcceptSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalAcceptSchema>;\n\nexport type RejectSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalRejectSchema>;\n\nexport type CreateCounterOfferIntentParams = z.input<typeof intents.counterOfferSchema>;\n\nexport interface ApiCounterOffersQuery {\n\n originalOrderHash?: string;\n\n sellerAddress?: string;\n page?: number;\n limit?: number;\n}\n\nexport const OPEN_LICENSES = [\"CC0\", \"CC BY\", \"CC BY-SA\", \"CC BY-NC\"] as const;\nexport type OpenLicense = (typeof OPEN_LICENSES)[number];\n\nexport type RemixOfferStatus =\n | \"PENDING\"\n | \"AUTO_PENDING\"\n | \"APPROVED\"\n | \"COMPLETED\"\n | \"REJECTED\"\n | \"EXPIRED\"\n | \"SELF_MINTED\";\n\nexport interface ApiRemixOfferPrice {\n raw: string;\n formatted: string;\n currency: string;\n decimals: number;\n}\n\nexport interface ApiRemixOffer {\n id: string;\n status: RemixOfferStatus;\n originalContract: string;\n originalTokenId: string;\n creatorAddress: string;\n requesterAddress: string | null;\n message?: string | null;\n\n price?: ApiRemixOfferPrice;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct: number | null;\n approvedCollection: string | null;\n remixContract: string | null;\n remixTokenId: string | null;\n orderHash: string | null;\n createdAt: string;\n expiresAt: string;\n updatedAt: string;\n}\n\nexport interface ApiPublicRemix {\n id: string;\n remixContract: string | null;\n remixTokenId: string | null;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n createdAt: string;\n}\n\nexport interface CreateRemixOfferParams {\n originalContract: string;\n originalTokenId: string;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct?: number;\n proposedPrice?: string;\n proposedCurrency?: string;\n message?: string;\n\n expiresInDays?: number;\n}\n\nexport interface AutoRemixOfferParams {\n originalContract: string;\n originalTokenId: string;\n licenseType: string;\n}\n\nexport interface ConfirmSelfRemixParams {\n originalContract: string;\n originalTokenId: string;\n remixContract: string;\n remixTokenId: string;\n\n txHash?: string;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct?: number;\n}\n\nexport interface ConfirmRemixOfferParams {\n approvedCollection: string;\n remixContract: string;\n remixTokenId: string;\n orderHash?: string;\n}\n\nexport interface ApiRemixOffersQuery {\n\n role: \"creator\" | \"requester\";\n status?: string;\n page?: number;\n limit?: number;\n}\n\nexport interface ApiMetadataSignedUrl {\n url: string;\n}\n\nexport interface ApiMetadataUpload {\n cid: string;\n url: string;\n}\n\nexport interface ApiPortalMe {\n id: string;\n accountId: string;\n status: string;\n creditBalance: number;\n}\n\nexport interface ApiPortalKey {\n id: string;\n prefix: string;\n label: string | null;\n lastUsedAt: string | null;\n createdAt: string;\n}\n\nexport interface ApiPortalKeyCreated {\n id: string;\n prefix: string;\n label: string | null;\n\n plaintext: string;\n}\n\nexport interface ApiCreditPayment {\n id: string;\n asset: string;\n amountAtomic: string;\n creditedAmount: number;\n mdlnMultiplier: number;\n txHash: string;\n status: string;\n createdAt: string;\n}\n\nexport interface ApiFundingMethod {\n id: string;\n [detail: string]: unknown;\n}\n\nexport type ApiFundingStatus = \"PENDING\" | \"SETTLED\" | \"FAILED\" | \"EXPIRED\";\n\nexport interface ApiFundingIntent {\n id: string;\n method: string;\n status: ApiFundingStatus;\n expiresAt: string;\n payer?: string | null;\n}\n\nexport interface ApiFundingInstructions {\n chain: string;\n payTo: string;\n asset: string;\n amountAtomic: string;\n}\n\nexport type ApiFundingSubmit =\n | { status: \"SETTLED\"; credited?: number }\n | { status: \"PENDING\"; reason: string };\n\nexport interface ApiSpendByAction {\n actionKey: string;\n credits: number;\n units: number;\n}\n\nexport interface ApiPortalSpend {\n recent: Array<{ actionKey: string; credits: number; createdAt: string }>;\n byAction: ApiSpendByAction[];\n spent: number;\n credited: number;\n drift: number;\n}\n\nexport interface ApiCollectionProfile {\n contractAddress: string;\n chain: string;\n displayName: string | null;\n description: string | null;\n image: string | null;\n bannerImage: string | null;\n websiteUrl: string | null;\n twitterUrl: string | null;\n discordUrl: string | null;\n telegramUrl: string | null;\n hasGatedContent: boolean;\n gatedContentTitle: string | null;\n slug: string | null;\n updatedBy: string | null;\n updatedAt: string;\n}\n\nexport type UpdateCollectionProfileInput = z.output<typeof profiles.collectionProfileSchema>;\n\nexport interface ApiCollectionSlugClaim {\n id: string;\n slug: string;\n contractAddress: string;\n chain: string;\n walletAddress: string;\n status: \"PENDING\" | \"APPROVED\" | \"REJECTED\";\n adminNotes: string | null;\n notifyEmail: string | null;\n reviewedAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ApiCreatorProfile {\n walletAddress: string;\n chain: string;\n username: string | null;\n name: string | null;\n bio: string | null;\n avatarImage: string | null;\n\n collectionImage?: string | null;\n websiteUrl: string | null;\n twitterUrl: string | null;\n discordUrl: string | null;\n telegramUrl: string | null;\n updatedAt: string;\n}\n\nexport interface ApiCreatorListResult {\n creators: ApiCreatorProfile[];\n total: number;\n page: number;\n limit: number;\n}\n\nexport type ApiChain = \"STARKNET\" | \"ETHEREUM\" | \"SOLANA\" | \"BASE\" | \"BITCOIN\";\n\nexport interface ApiSession {\n accountId: string;\n publicId: string;\n walletAddress: string | null;\n email: string | null;\n emailDeadline: string | null;\n}\n\nexport interface ApiUserWallet {\n walletAddress: string;\n email?: string | null;\n emailDeadline?: string | null;\n}\n\nexport interface ApiCollectionClaim {\n id: string;\n contractAddress: string;\n chain: string;\n claimantAddress: string | null;\n status: \"PENDING\" | \"AUTO_APPROVED\" | \"APPROVED\" | \"REJECTED\";\n verificationMethod: \"ONCHAIN\" | \"SIGNATURE\" | \"MANUAL\";\n createdAt: string;\n}\n\nexport interface ApiAdminCollectionClaim extends ApiCollectionClaim {\n claimantEmail: string | null;\n notes: string | null;\n adminNotes: string | null;\n reviewedBy: string | null;\n reviewedAt: string | null;\n updatedAt: string;\n}\n\nexport interface ApiBusinessProvisioning {\n chain: string;\n walletAddress: string;\n}\n\nexport interface ApiWalletActivity {\n id: string;\n chain: string;\n accountAddress: string;\n type: \"SEND\" | \"RECEIVE\" | \"SWAP\" | \"DEPLOY\" | \"GUARDIAN_SET\" | \"GUARDIAN_TRIGGER_ESCAPE\" | \"GUARDIAN_COMPLETE_ESCAPE\" | \"GUARDIAN_CANCEL_ESCAPE\";\n txHash: string;\n blockNumber: string;\n timestamp: string;\n tokenAddress: string | null;\n amount: string | null;\n counterparty: string | null;\n tokenInAddress: string | null;\n amountIn: string | null;\n tokenOutAddress: string | null;\n amountOut: string | null;\n}\n\nexport interface ApiRewardsBadge {\n key: string;\n name: string;\n description: string;\n icon: string;\n color: string;\n category: string;\n}\n\nexport interface ApiRewardsLevel {\n level: number;\n name: string;\n xpRequired: number;\n badgeColor: string;\n description: string | null;\n}\n\nexport interface ApiUserRewards {\n address: string;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n nextLevel: { level: number; name: string; xpRequired: number } | null;\n progressPct: number;\n breakdown: Record<string, number>;\n badges: ApiRewardsBadge[];\n computedAt: string | null;\n}\n\nexport interface ApiRewardsLeaderboardEntry {\n rank: number;\n address: string;\n accountId: string | null;\n publicId: string | null;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n}\n\nexport interface ApiRewardsConfig {\n levels: ApiRewardsLevel[];\n actions: { type: string; label: string; xp: number; dailyCap: number | null }[];\n badges: ApiRewardsBadge[];\n}\n\nexport interface ApiRewardsBatchEntry {\n address: string;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n}\n\nexport interface ApiPointEvent {\n id: string;\n actionType: string;\n xp: number;\n multiplier: number;\n finalXp: number;\n txHash: string | null;\n createdAt: string;\n}\n\nexport interface ApiPlatformStats {\n collections: number;\n tokens: number;\n sales: number;\n}\n\nexport interface ApiTierOnchain {\n maxSupply: string;\n minted: string;\n startTime: number | null;\n endTime: number | null;\n royaltyBps: number;\n}\n\nexport interface ApiSwapQuoteRequest {\n sellSymbol?: string;\n buySymbol?: string;\n sellTokenAddress?: string;\n buyTokenAddress?: string;\n sellAmountRaw?: string;\n buyAmountRaw?: string;\n takerAddress?: string;\n}\n\nexport interface ApiSwapQuote {\n quoteId: string;\n sellTokenAddress: string;\n sellAmount: string;\n buyTokenAddress: string;\n buyAmount: string;\n}\n\nexport interface ApiIpNftTokenData {\n owner: string;\n metadataUri: string;\n originalCreator: string;\n registeredAt: number;\n}\n\nexport interface ApiTokensQuery {\n page?: number;\n limit?: number;\n sort?: string;\n ipType?: string;\n derivatives?: \"allowed\";\n}\n\nexport interface ApiUsernameClaim {\n id: string;\n username: string;\n walletAddress: string;\n status: \"PENDING\" | \"APPROVED\" | \"REJECTED\";\n adminNotes: string | null;\n reviewedAt: string | null;\n createdAt: string;\n}\n\nexport type ApiReportTargetType = \"COLLECTION\" | \"TOKEN\" | \"CREATOR\" | \"COMMENT\";\n\nexport interface ApiSubmitReport {\n targetType: ApiReportTargetType;\n targetContract?: string;\n targetTokenId?: string;\n targetAddress?: string;\n targetId?: string;\n categories: string[];\n description?: string;\n}\n\nexport interface ApiSponsorshipOffer {\n id: string;\n chain: string;\n contractAddress: string;\n offerId: string;\n author: string;\n nftContract: string;\n tokenId: string;\n minAmount: string;\n duration: number;\n paymentToken: string;\n licenseTermsUri: string;\n transferable: boolean;\n royaltyBps: number;\n specificSponsor: string | null;\n open: boolean;\n createdAtChain: string;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipBid {\n id: string;\n chain: string;\n contractAddress: string;\n offerId: string;\n sponsor: string;\n amount: string;\n placedAtChain: string;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipProposal {\n id: string;\n chain: string;\n contractAddress: string;\n proposalId: string;\n proposer: string;\n nftContract: string;\n tokenId: string;\n amount: string;\n duration: number;\n validUntil: string | null;\n paymentToken: string;\n licenseTermsUri: string;\n transferable: boolean;\n royaltyBps: number;\n open: boolean;\n accepted: boolean | null;\n createdAtChain: string;\n closedAtChain: string | null;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipLicense {\n id: string;\n chain: string;\n contractAddress: string;\n tokenId: string;\n author: string;\n recipient: string;\n assetContract: string;\n assetTokenId: string;\n expiresAt: string;\n transferable: boolean;\n royaltyBps: number;\n licenseTermsUri: string;\n offerId: string | null;\n proposalId: string | null;\n mintedAtChain: string;\n currentHolder?: string | null;\n}\n\nexport interface ApiSponsorshipOffersQuery {\n limit?: number;\n nftContract?: string;\n author?: string;\n owner?: string;\n open?: boolean;\n}\n\nexport interface ApiSponsorshipProposalsQuery {\n limit?: number;\n nftContract?: string;\n proposer?: string;\n owner?: string;\n open?: boolean;\n}\n\nexport interface ApiSponsorshipLicensesQuery {\n limit?: number;\n holder?: string;\n author?: string;\n}\n\nexport interface ApiCollectionsListQuery {\n page?: number;\n limit?: number;\n owner?: string;\n service?: string;\n sort?: CollectionSort;\n isFeatured?: boolean;\n hideEmpty?: boolean;\n standard?: string;\n chain?: ChainFilter;\n}\n\nexport interface ApiPricingRule {\n actionKey: string;\n chain: string;\n service: string;\n credits: number;\n}\n\nexport interface ApiPricing {\n creditsPerUsdc: number;\n mdln?: { contract: string | null; tiers: { minWholeTokens: number; multiplier: number }[] };\n pricing: { default: number; rules: ApiPricingRule[] };\n}\n\nexport type CreateTransferTokenIntentParams = z.input<typeof intents.transferTokenSchema>;\n\nexport type CreateTransferNftIntentParams = z.input<typeof intents.transferNftSchema>;\n\nexport type CreateTransferCollectionOwnershipIntentParams = z.input<typeof intents.transferCollectionOwnershipSchema>;\n\nexport type CreateCommentIntentParams = z.input<typeof intents.commentSchema>;\n\nexport type CreateGenesisMintIntentParams = z.input<typeof intents.genesisMintSchema>;\n\nexport type CreatePopClaimIntentParams = z.input<typeof intents.popClaimSchema>;\n\nexport type CreatePopBurnIntentParams = z.input<typeof intents.popBurnSchema>;\n\nexport type CreateDropClaimIntentParams = z.input<typeof intents.dropClaimSchema>;\n\nexport type WalletManageAction = \"add_owner\" | \"remove_owner\" | \"cancel_escape\" | \"set_first_guardian\" | \"trigger_escape\" | \"complete_escape\";\n\nexport type CreateWalletManageIntentParams = z.input<typeof intents.walletManageSchema>;\n\nexport type CreateSwapIntentParams = z.input<typeof intents.swapIntentSchema>;\n\nexport type CreateFundingTransferIntentParams = z.input<typeof intents.fundingTransferSchema>;\n\nexport type DropManageAction = \"issue\" | \"set_allowlist_root\";\n\nexport type CreateDropManageIntentParams = z.input<typeof intents.dropManageSchema>;\n\nexport type PopManageAction = \"issue\" | \"set_allowlist_root\";\n\nexport type CreatePopManageIntentParams = z.input<typeof intents.popManageSchema>;\n\nexport interface IntentParamsByKind {\n listing: CreateListingIntentParams;\n offer: MakeOfferIntentParams;\n fulfill: FulfillOrderIntentParams;\n cancel: CancelOrderIntentParams;\n mint: CreateMintIntentParams;\n \"transfer-token\": CreateTransferTokenIntentParams;\n \"transfer-nft\": CreateTransferNftIntentParams;\n \"transfer-collection-ownership\": CreateTransferCollectionOwnershipIntentParams;\n comment: CreateCommentIntentParams;\n \"genesis-mint\": CreateGenesisMintIntentParams;\n \"pop-claim\": CreatePopClaimIntentParams;\n \"pop-burn\": CreatePopBurnIntentParams;\n \"drop-claim\": CreateDropClaimIntentParams;\n \"wallet-manage\": CreateWalletManageIntentParams;\n swap: CreateSwapIntentParams;\n \"funding-transfer\": CreateFundingTransferIntentParams;\n \"drop-manage\": CreateDropManageIntentParams;\n \"pop-manage\": CreatePopManageIntentParams;\n \"create-collection\": CreateCollectionIntentParams;\n \"create-tier\": CreateTierIntentParams;\n \"create-coin\": CreateCoinIntentParams;\n \"launch-coin\": LaunchCoinIntentParams;\n \"sponsorship-offer\": CreateSponsorshipOfferIntentParams;\n \"sponsorship-offer-open\": SetSponsorshipOfferOpenIntentParams;\n \"sponsorship-bid\": PlaceSponsorshipBidIntentParams;\n \"sponsorship-bid-retract\": RetractSponsorshipBidIntentParams;\n \"sponsorship-bid-accept\": AcceptSponsorshipBidIntentParams;\n \"sponsorship-proposal\": CreateSponsorshipProposalIntentParams;\n \"sponsorship-proposal-withdraw\": WithdrawSponsorshipProposalIntentParams;\n \"sponsorship-proposal-accept\": AcceptSponsorshipProposalIntentParams;\n \"sponsorship-proposal-reject\": RejectSponsorshipProposalIntentParams;\n \"counter-offer\": CreateCounterOfferIntentParams;\n}\n","\n\nexport type AssetAttribute = { trait_type: string; value: string };\n\nexport interface AssetMetadata {\n name: string;\n description: string;\n image: string | null;\n external_url: string;\n attributes: AssetAttribute[];\n}\n\nexport interface BuildAssetMetadataInput {\n name: string;\n description?: string | null;\n externalUrl?: string | null;\n imageUri?: string | null;\n creator?: string | null;\n ipType?: string | null;\n licenseType?: string | null;\n commercialUse?: string | null;\n derivatives?: string | null;\n attribution?: string | null;\n geographicScope?: string | null;\n aiPolicy?: string | null;\n royalty?: string | null;\n edition?: string | null;\n\n templateTraits?: { traitType: string; value: string }[];\n\n registrationDate?: string;\n}\n\nexport const RESERVED_TRAITS = new Set([\n \"Creator\", \"IP Type\", \"License\", \"Commercial Use\", \"Derivatives\",\n \"Attribution\", \"Territory\", \"AI Policy\", \"Royalty\", \"Edition\",\n \"Standard\", \"Registration\",\n]);\nconst RESERVED_TRAITS_NORMALIZED = new Set([...RESERVED_TRAITS].map((t) => t.toLowerCase()));\n\nexport function buildAssetMetadata(input: BuildAssetMetadataInput): AssetMetadata {\n const attributes: AssetAttribute[] = [];\n\n if (input.creator) attributes.push({ trait_type: \"Creator\", value: input.creator });\n if (input.ipType) attributes.push({ trait_type: \"IP Type\", value: input.ipType });\n if (input.licenseType) attributes.push({ trait_type: \"License\", value: input.licenseType });\n if (input.commercialUse) attributes.push({ trait_type: \"Commercial Use\", value: input.commercialUse });\n if (input.derivatives) attributes.push({ trait_type: \"Derivatives\", value: input.derivatives });\n if (input.attribution) attributes.push({ trait_type: \"Attribution\", value: input.attribution });\n if (input.geographicScope) attributes.push({ trait_type: \"Territory\", value: input.geographicScope });\n if (input.aiPolicy) attributes.push({ trait_type: \"AI Policy\", value: input.aiPolicy });\n\n if (input.royalty) {\n const num = parseFloat(String(input.royalty).replace(\"%\", \"\"));\n if (!isNaN(num) && num > 0) attributes.push({ trait_type: \"Royalty\", value: `${num}%` });\n }\n\n if (input.edition) attributes.push({ trait_type: \"Edition\", value: input.edition });\n\n for (const t of input.templateTraits ?? []) {\n const traitType = t.traitType?.trim() ?? \"\";\n const traitValue = String(t.value ?? \"\").trim();\n if (!traitType || !traitValue || RESERVED_TRAITS_NORMALIZED.has(traitType.toLowerCase())) continue;\n attributes.push({ trait_type: traitType, value: traitValue });\n }\n\n if (input.licenseType) {\n attributes.push({ trait_type: \"Standard\", value: \"Berne Convention\" });\n attributes.push({\n trait_type: \"Registration\",\n value: input.registrationDate ?? new Date().toISOString().split(\"T\")[0],\n });\n }\n\n return {\n name: input.name,\n description: input.description ?? \"\",\n image: input.imageUri ?? null,\n external_url: input.externalUrl || \"https://medialane.io\",\n attributes,\n };\n}\n\nexport interface CollectionMetadata {\n name: string;\n description?: string;\n image?: string;\n external_link: string;\n}\n\nexport interface BuildCollectionMetadataInput {\n name: string;\n owner: string;\n description?: string | null;\n image?: string | null;\n externalLink?: string | null;\n}\n\nexport const accountPageUrl = (address: string): string => `https://www.medialane.io/account/${address}`;\n\nexport function buildCollectionMetadata(input: BuildCollectionMetadataInput): CollectionMetadata {\n const description = input.description?.trim();\n const image = input.image?.trim();\n return {\n name: input.name,\n ...(description ? { description } : {}),\n ...(image ? { image } : {}),\n external_link: input.externalLink?.trim() || accountPageUrl(input.owner),\n };\n}\n","\n\ntype Attribute = { trait_type?: string; value?: string | number | boolean };\n\nexport function getDerivativesTerm(\n attributes: Attribute[] | null | undefined,\n): \"Allowed\" | \"Not Allowed\" | null {\n const v = (Array.isArray(attributes) ? attributes : []).find(\n (a) => a.trait_type === \"Derivatives\",\n )?.value;\n return v === \"Allowed\" || v === \"Not Allowed\" ? v : null;\n}\n\nexport interface RemixPolicyInput {\n\n parentNoDerivatives: boolean;\n\n viewerIsParentOwner: boolean;\n\n dealAvailable: boolean;\n}\n\nexport interface RemixPolicy extends RemixPolicyInput {\n\n canRemixDirect: boolean;\n\n showDealOption: boolean;\n}\n\nexport function resolveRemixPolicy(input: RemixPolicyInput): RemixPolicy {\n const canRemixDirect = input.viewerIsParentOwner || !input.parentNoDerivatives;\n const showDealOption = input.dealAvailable && !input.viewerIsParentOwner;\n return { ...input, canRemixDirect, showDealOption };\n}\n","export const FIELD_LIMITS = {\n name: 255,\n symbol: 10,\n description: 2000,\n} as const;\n","export type UploadKind = \"image\" | \"document\" | \"media\";\n\nexport interface UploadLimit {\n mimeTypes: readonly string[];\n extensions: readonly string[];\n}\n\nconst MB = 1024 * 1024;\n\nexport const MAX_UPLOAD_BYTES = 90 * MB;\n\nconst IMAGE_EXTENSIONS = [\".jpg\", \".jpeg\", \".png\", \".gif\", \".svg\", \".webp\", \".avif\"];\n\nexport const UPLOAD_LIMITS: Record<UploadKind, UploadLimit> = {\n image: {\n mimeTypes: [\"image/jpeg\", \"image/png\", \"image/gif\", \"image/svg+xml\", \"image/webp\", \"image/avif\"],\n extensions: IMAGE_EXTENSIONS,\n },\n document: {\n mimeTypes: [\n \"application/pdf\",\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"application/vnd.oasis.opendocument.text\",\n \"application/rtf\",\n \"text/plain\",\n \"text/markdown\",\n \"application/octet-stream\",\n ],\n extensions: [\".pdf\", \".doc\", \".docx\", \".odt\", \".rtf\", \".txt\", \".md\"],\n },\n media: {\n mimeTypes: [\n \"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\", \"image/svg+xml\", \"image/avif\",\n \"video/mp4\", \"video/webm\", \"video/ogg\",\n \"audio/mpeg\", \"audio/ogg\", \"audio/wav\", \"audio/webm\", \"audio/flac\",\n \"application/pdf\",\n ],\n extensions: [...IMAGE_EXTENSIONS, \".mp4\", \".webm\", \".ogv\", \".ogg\", \".mp3\", \".wav\", \".flac\", \".pdf\"],\n },\n};\n\nexport function formatFileSize(bytes: number): string {\n const mb = bytes / MB;\n return `${Number.isInteger(mb) ? mb : mb.toFixed(1)} MB`;\n}\n\nexport function uploadSizeError(file: { size: number }, kind: UploadKind = \"image\"): string | null {\n if (file.size <= MAX_UPLOAD_BYTES) return null;\n const noun = kind === \"image\" ? \"image\" : \"file\";\n return `That ${noun} is ${formatFileSize(file.size)}. Please choose one under ${formatFileSize(MAX_UPLOAD_BYTES)}.`;\n}\n\nexport function acceptFor(kind: UploadKind): string {\n const { mimeTypes, extensions } = UPLOAD_LIMITS[kind];\n return [...mimeTypes, ...extensions].join(\",\");\n}\n\nfunction typeList(extensions: readonly string[]): string {\n const names = extensions.map((ext) => ext.slice(1).toUpperCase());\n return names.length > 1 ? `${names.slice(0, -1).join(\", \")} or ${names[names.length - 1]}` : names.join(\"\");\n}\n\nexport function uploadError(file: { size: number; type: string; name?: string }, kind: UploadKind = \"image\"): string | null {\n const { mimeTypes, extensions } = UPLOAD_LIMITS[kind];\n const name = (file.name ?? \"\").toLowerCase();\n const allowed = mimeTypes.includes(file.type) || (file.type === \"\" && extensions.some((ext) => name.endsWith(ext)));\n if (!allowed) return `Choose ${kind === \"image\" ? \"an image\" : \"a file\"} in ${typeList(extensions)}.`;\n return uploadSizeError(file, kind);\n}\n"]}
|
|
1
|
+
{"version":3,"s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,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,KAAe;AAAA,GAC1B,EAAG,KAAA;AACH,EAAA,OAAO,CAAA,KAAM,SAAA,IAAa,CAAA,KAAM,aAAA,GAAgB,CAAA,GAAI,IAAA;AACtD;AAkBO,SAAS,mBAAmB,KAAA,EAAsC;AACvE,EAAA,MAAM,cAAA,GAAiB,KAAA,CAAM,mBAAA,IAAuB,CAAC,KAAA,CAAM,mBAAA;AAC3D,EAAA,MAAM,cAAA,GAAiB,KAAA,CAAM,aAAA,IAAiB,CAAC,KAAA,CAAM,mBAAA;AACrD,EAAA,OAAO,EAAE,GAAG,KAAA,EAAO,cAAA,EAAgB,cAAA,EAAe;AACpD;;;AC/BA,IAAM,KAAK,IAAA,GAAO,IAAA;AAEX,IAAM,mBAAmB,EAAA,GAAK;AAE9B,SAAS,eAAe,KAAA,EAAuB;AACpD,EAAA,MAAM,KAAK,KAAA,GAAQ,EAAA;AACnB,EAAA,OAAO,CAAA,EAAG,OAAO,SAAA,CAAU,EAAE,IAAI,EAAA,GAAK,EAAA,CAAG,OAAA,CAAQ,CAAC,CAAC,CAAA,GAAA,CAAA;AACrD;AAEO,SAAS,eAAA,CAAgB,IAAA,EAAwB,IAAA,GAAmB,OAAA,EAAwB;AACjG,EAAA,IAAI,IAAA,CAAK,IAAA,IAAQ,gBAAA,EAAkB,OAAO,IAAA;AAC1C,EAAA,MAAM,IAAA,GAAO,IAAA,KAAS,OAAA,GAAU,OAAA,GAAU,MAAA;AAC1C,EAAA,OAAO,CAAA,KAAA,EAAQ,IAAI,CAAA,IAAA,EAAO,cAAA,CAAe,IAAA,CAAK,IAAI,CAAC,CAAA,0BAAA,EAA6B,cAAA,CAAe,gBAAgB,CAAC,CAAA,CAAA,CAAA;AAClH","file":"index.js","sourcesContent":["import type { FetchLike } from \"../utils/fetch.js\";\nexport type RunStatus = \"DRAFT\" | \"PAID\" | \"RUNNING\" | \"COMPLETED\" | \"FAILED\" | \"CANCELLED\";\n\nexport interface RunQuoteLine {\n action: string;\n units: number;\n unitCredits: number;\n credits: number;\n}\n\nexport interface RunQuote {\n lines: RunQuoteLine[];\n total: number;\n}\n\nexport type NextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"metadata\"; items: number[] }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport type TicketingNextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"ticket-metadata\" }\n | { kind: \"tier\" }\n | { kind: \"wait-tier\" }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport type CertificateEmissionNextStep =\n | { kind: \"collection\" }\n | { kind: \"wait-collection\" }\n | { kind: \"upload\"; files: string[] }\n | { kind: \"certificate-metadata\" }\n | { kind: \"wallets\" }\n | { kind: \"batch\"; index: number }\n | { kind: \"wait\"; index: number }\n | { kind: \"done\" };\n\nexport interface WalletRequest {\n recipient: string;\n}\n\ninterface LaunchpadRunBase {\n id: string;\n status: RunStatus;\n spec: unknown;\n quote: RunQuote | null;\n creditsHeld: number;\n creditsSpent: number;\n progress: unknown;\n createdAt: string;\n updatedAt: string;\n}\n\nexport type DataTokenizationRun = LaunchpadRunBase & { service: \"data-tokenization-erc721\"; next?: NextStep };\nexport type TicketingRun = LaunchpadRunBase & { service: \"ip-ticketing\"; next?: TicketingNextStep };\nexport type CertificateEmissionRun = LaunchpadRunBase & { service: \"certificate-emission\"; next?: CertificateEmissionNextStep };\nexport type LaunchpadRun = DataTokenizationRun | TicketingRun | CertificateEmissionRun;\n\nexport const isDataTokenizationRun = (run: LaunchpadRun): run is DataTokenizationRun =>\n run.service === \"data-tokenization-erc721\";\n\nexport const isTicketingRun = (run: LaunchpadRun): run is TicketingRun => run.service === \"ip-ticketing\";\n\nexport const isCertificateEmissionRun = (run: LaunchpadRun): run is CertificateEmissionRun =>\n run.service === \"certificate-emission\";\n\nexport interface ConfirmResult {\n pending: boolean;\n status: string;\n completed?: boolean;\n}\n\nexport class RunRequestError extends Error {\n constructor(\n message: string,\n readonly status: number,\n readonly body: Record<string, unknown>,\n ) {\n super(message);\n }\n}\n\nexport interface LaunchpadRunsClientOptions {\n baseUrl: string;\n fetchImpl?: FetchLike;\n}\n\nexport function createLaunchpadRunsClient({ baseUrl, fetchImpl = fetch }: LaunchpadRunsClientOptions) {\n const runsUrl = `${baseUrl.replace(/\\/$/, \"\")}/v1/portal/runs`;\n const runBase = (id: string): string => `${runsUrl}/${id}`;\n const runBatchBase = (id: string, index: number): string => `${runBase(id)}/batches/${index}`;\n const runCollectionBase = (id: string): string => `${runBase(id)}/collection`;\n const runTierBase = (id: string): string => `${runBase(id)}/tier`;\n\n const runFetch: FetchLike = (input, init) => fetchImpl(input, { ...init, cache: \"no-store\" });\n\n async function call<T>(url: string, init?: RequestInit): Promise<{ status: number; data: T }> {\n const res = await runFetch(url, {\n ...init,\n headers: { \"content-type\": \"application/json\", ...(init?.headers as Record<string, string> | undefined) },\n });\n const body = (await res.json().catch(() => ({}))) as Record<string, unknown>;\n if (!res.ok) {\n throw new RunRequestError(String(body.error ?? \"Something went wrong with this run\"), res.status, body);\n }\n return { status: res.status, data: body.data as T };\n }\n\n const post = <T>(url: string, body?: unknown) =>\n call<T>(url, { method: \"POST\", body: body === undefined ? undefined : JSON.stringify(body) });\n\n const confirm = async (url: string): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string; completed?: boolean }>(url);\n return { pending: status === 202, status: data.status, completed: data.completed };\n };\n\n const ticketing = {\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n metadata: async (id: string, userAddress: string) =>\n (await post<{ tokenUri: string }>(`${runBase(id)}/metadata`, { userAddress })).data,\n\n resolveWallets: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/wallets/resolve`)).data.pending,\n\n registerWallet: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/wallets`, request)).data,\n\n confirmCollection: (id: string) => confirm(`${runCollectionBase(id)}/confirm`),\n confirmTier: (id: string) => confirm(`${runTierBase(id)}/confirm`),\n confirmBatch: (id: string, index: number) => confirm(`${runBatchBase(id, index)}/confirm`),\n };\n\n const certificateEmission = {\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n metadata: async (id: string, userAddress: string) =>\n (await post<{ tokenUri: string }>(`${runBase(id)}/certificate-metadata`, { userAddress })).data,\n\n resolveWallets: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/recipients/resolve`)).data.pending,\n\n registerWallet: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/recipients`, request)).data,\n\n confirmCollection: (id: string) => confirm(`${runCollectionBase(id)}/confirm`),\n confirmBatch: (id: string, index: number) => confirm(`${runBatchBase(id, index)}/confirm`),\n };\n\n return {\n fetch: runFetch,\n runBase,\n runBatchBase,\n runCollectionBase,\n runTierBase,\n ticketing,\n certificateEmission,\n\n list: async () => (await call<LaunchpadRun[]>(runsUrl)).data,\n\n get: async (id: string) => (await call<LaunchpadRun>(`${runBase(id)}`)).data,\n\n create: async (service: string, spec: unknown) =>\n (await post<LaunchpadRun>(runsUrl, { service, spec })).data,\n\n update: async (id: string, spec: unknown) =>\n (await call<LaunchpadRun>(`${runBase(id)}`, { method: \"PATCH\", body: JSON.stringify({ spec }) })).data,\n\n cancel: async (id: string) => (await post<LaunchpadRun>(`${runBase(id)}/cancel`)).data,\n\n checkoutWithCredits: async (id: string) =>\n (await post<LaunchpadRun>(`${runBase(id)}/checkout`, { method: \"credits\" })).data,\n\n checkoutFromWallet: async (id: string, intentId: string) =>\n (await post<LaunchpadRun>(`${runBase(id)}/checkout`, { method: \"wallet\", intentId })).data,\n\n uploadUrl: async (id: string, name: string) =>\n (await post<{ name: string; url: string }>(`${runBase(id)}/files/upload-url`, { name })).data.url,\n\n uploaded: async (id: string, name: string, cid: string) =>\n (await post<{ name: string; uri: string }>(`${runBase(id)}/files/uploaded`, { name, cid })).data,\n\n itemMetadata: async (id: string, index: number, userAddress: string) =>\n (await post<{ index: number; tokenUri: string }>(`${runBase(id)}/items/${index}/metadata`, { userAddress })).data,\n\n resolveGuests: async (id: string) =>\n (await post<{ pending: string[] }>(`${runBase(id)}/guests/resolve`)).data.pending,\n\n registerGuest: async (id: string, request: WalletRequest) =>\n (await post<{ recipient: string; walletAddress: string }>(`${runBase(id)}/guests`, request)).data,\n\n confirmBatch: async (id: string, index: number): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string; completed?: boolean }>(\n `${runBase(id)}/batches/${index}/confirm`,\n );\n return { pending: status === 202, status: data.status, completed: data.completed };\n },\n\n confirmCollection: async (id: string): Promise<ConfirmResult> => {\n const { status, data } = await post<{ status: string }>(`${runBase(id)}/collection/confirm`);\n return { pending: status === 202, status: data.status };\n },\n };\n}\n\nexport type LaunchpadRunsClient = ReturnType<typeof createLaunchpadRunsClient>;\n","import type { z } from \"zod\";\nimport type * as intents from \"../contract/intents.js\";\nimport type * as issuance from \"../contract/issuance.js\";\nimport type * as orders from \"../contract/orders.js\";\nimport type * as profiles from \"../contract/profiles.js\";\nimport type * as responses from \"../contract/responses.js\";\n\nexport type IPType =\n | \"Audio\"\n | \"Art\"\n | \"Documents\"\n | \"NFT\"\n | \"Video\"\n | \"Photography\"\n | \"Patents\"\n | \"Posts\"\n | \"Publications\"\n | \"RWA\"\n | \"Software\"\n | \"Custom\";\n\nexport type CollectionSort = \"recent\" | \"supply\" | \"floor\" | \"volume\" | \"name\";\n\nexport type CollectionTokensSort = \"recent\" | \"oldest\" | \"name\" | \"price\";\n\nexport type ServiceCapability =\n | \"list\" | \"buy\" | \"make_offer\" | \"cancel\"\n | \"transfer\" | \"burn\"\n | \"mint\" | \"claim\" | \"airdrop\"\n | \"remix\" | \"license\"\n | \"subscribe\" | \"redeem\"\n | \"launch\" | \"swap\"\n | \"sponsor\";\n\nexport interface EnforcementDeclaration {\n royalty?: \"erc2981\" | \"service-split\" | \"none\";\n escrow?: boolean;\n timeLock?: boolean;\n revocable?: boolean;\n}\n\nexport interface ServiceEventDeclaration {\n\n name: string;\n\n emittedBy: \"factory\" | \"instance\";\n\n poll?: \"fast\" | \"slow\";\n}\n\nexport interface ServiceDefinition {\n\n id: string;\n displayName: string;\n description: string;\n standard: \"ERC721\" | \"ERC1155\" | \"ERC20\" | \"UNKNOWN\";\n provenance: \"MEDIALANE\" | \"EXTERNAL\";\n onchain?: Partial<Record<import(\"../chains.js\").Chain, {\n factoryAddress?: string;\n classHash?: string;\n startBlock?: number;\n }>>;\n\n uiVariant: string;\n capabilities: ServiceCapability[];\n\n events?: ServiceEventDeclaration[];\n metadataSchema?: {\n requiredTraits?: string[];\n\n licenseDefault?: string;\n enforcement?: EnforcementDeclaration;\n };\n}\n\nexport interface ApiCollectionsQuery {\n page?: number;\n limit?: number;\n isKnown?: boolean;\n sort?: CollectionSort;\n owner?: string;\n\n service?: string;\n}\n\nexport type OrderStatus = \"ACTIVE\" | \"FULFILLED\" | \"CANCELLED\" | \"EXPIRED\";\nexport type SortOrder = \"price_asc\" | \"price_desc\" | \"recent\";\nexport type ActivityType = \"mint\" | \"transfer\" | \"sale\" | \"listing\" | \"offer\" | \"cancelled\";\nexport type IntentType = \"CREATE_LISTING\" | \"MAKE_OFFER\" | \"FULFILL_ORDER\" | \"CANCEL_ORDER\" | \"MINT\" | \"CREATE_COLLECTION\" | \"COUNTER_OFFER\";\nexport type IntentStatus = \"PENDING\" | \"SIGNED\" | \"SUBMITTED\" | \"CONFIRMED\" | \"FAILED\" | \"EXPIRED\";\n\nexport interface ApiMeta {\n page: number;\n limit: number;\n total?: number;\n\n counts?: Record<string, number>;\n}\n\nexport interface ApiResponse<T> {\n data: T;\n meta?: ApiMeta;\n}\n\nexport type ChainFilter = import(\"../chains.js\").Chain | \"all\";\n\nexport type ApiOrdersQuery = z.input<typeof orders.ordersListQuery> & { chain?: ChainFilter };\n\nexport interface ApiOrderOffer {\n itemType: string;\n token: string;\n identifier: string;\n startAmount: string;\n endAmount: string;\n}\n\nexport interface ApiOrderConsideration extends ApiOrderOffer {\n recipient: string;\n}\n\nexport interface ApiOrderPrice {\n raw: string | null;\n formatted: string | null;\n currency: string | null;\n decimals: number;\n}\n\nexport interface ApiOrderTxHash {\n created: string | null;\n fulfilled: string | null;\n cancelled: string | null;\n}\n\nexport interface ApiOrderTokenMeta {\n name: string | null;\n image: string | null;\n description: string | null;\n animationUrl: string | null;\n}\n\nexport type ApiOrder = z.output<typeof responses.orderSchema>;\n\nexport type IpAttribute = z.output<typeof responses.tokenAttributeSchema>;\n\nexport interface IpNftMetadata {\n name: string;\n description?: string;\n image?: string | null;\n external_url?: string;\n attributes?: IpAttribute[];\n\n ipType?: string | null;\n licenseType?: string | null;\n commercialUse?: string | null;\n derivatives?: string | null;\n attribution?: string | null;\n territory?: string | null;\n aiPolicy?: string | null;\n royalty?: string | null;\n registration?: string | null;\n}\n\nexport type ApiTokenMetadata = ApiToken[\"metadata\"];\n\nexport interface ApiTokenBalance {\n owner: string;\n\n amount: string;\n}\n\nexport type ApiToken = z.output<typeof responses.tokenSchema>;\n\nexport type ApiCollection = z.output<typeof responses.collectionSchema>;\n\nexport interface ApiCoin {\n id: string;\n chain: string;\n contractAddress: string;\n standard: \"ERC20\";\n\n service: string;\n name: string | null;\n symbol: string | null;\n decimals: number;\n\n totalSupply: string | null;\n description: string | null;\n image: string | null;\n creator: string | null;\n\n isLaunched?: boolean | null;\n startBlock: string;\n isHidden: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ApiCoinPrice {\n\n usdc: number;\n}\n\nexport type ApiCoinPrices = Record<string, ApiCoinPrice | null>;\n\nexport type ApiCoinClaimResult =\n | { verified: true; coin: ApiCoin | null }\n | { verified: false; reason: \"owner_mismatch\" | \"owner_check_failed\" | \"not_erc20\" | \"no_total_supply\" };\n\nexport interface ApiCoinsQuery {\n chain?: ChainFilter;\n page?: number;\n limit?: number;\n service?: string;\n sort?: string;\n creator?: string;\n}\n\nexport interface ApiActivityPrice {\n raw: string | null;\n formatted: string | null;\n currency: string | null;\n}\n\nexport interface ApiActivity {\n type: ActivityType;\n chain: import(\"../chains.js\").Chain;\n\n contractAddress?: string;\n tokenId?: string;\n from?: string;\n to?: string;\n blockNumber?: string;\n\n amount?: string;\n\n orderHash?: string;\n nftContract?: string;\n nftTokenId?: string;\n offerer?: string;\n fulfiller?: string | null;\n price?: ApiActivityPrice;\n\n tokenStandard?: \"ERC721\" | \"ERC1155\";\n txHash: string | null;\n timestamp: string;\n\n token?: { name: string | null; image: string | null; animationUrl: string | null } | null;\n}\n\nexport interface ApiActivitiesQuery {\n chain?: ChainFilter;\n type?: ActivityType;\n\n contract?: string;\n page?: number;\n limit?: number;\n}\n\nexport interface ApiComment {\n id: string;\n chain: string;\n contractAddress: string;\n tokenId: string;\n author: string;\n content: string;\n txHash: string | null;\n blockNumber: string;\n postedAt: string;\n}\n\nexport interface ApiSearchTokenResult {\n contractAddress: string;\n tokenId: string;\n name: string | null;\n image: string | null;\n owner: string;\n metadataStatus: string;\n}\n\nexport interface ApiSearchCollectionResult {\n contractAddress: string;\n name: string | null;\n image: string | null;\n totalSupply: number | null;\n floorPrice: string | null;\n holderCount: number | null;\n}\n\nexport interface ApiSearchCreatorResult {\n walletAddress: string;\n username: string | null;\n name: string | null;\n bio: string | null;\n avatarImage: string | null;\n}\n\nexport interface ApiSearchResult {\n tokens: ApiSearchTokenResult[];\n collections: ApiSearchCollectionResult[];\n creators: ApiSearchCreatorResult[];\n}\n\nexport interface ApiIntent {\n id: string;\n chain: string;\n type: IntentType;\n status: IntentStatus;\n requester: string;\n typedData: unknown;\n calls: unknown;\n signature: string[];\n txHash: string | null;\n orderHash: string | null;\n\n parentOrderHash?: string | null;\n\n counterOfferMessage?: string | null;\n expiresAt: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IntentCall {\n contractAddress: string;\n entrypoint: string;\n calldata: string[];\n}\n\nexport type ApiIntentCreated =\n | { id: string; expiresAt: string; requiresSignature: true; typedData: unknown }\n | { id: string; expiresAt: string; requiresSignature: false; calls: IntentCall[] };\n\nexport interface ApiTxSyncResult {\n applied: number;\n contracts?: string[];\n pending: boolean;\n}\n\nexport type CreateListingIntentParams = z.input<typeof intents.listingSchema>;\n\nexport type MakeOfferIntentParams = z.input<typeof intents.offerSchema>;\n\nexport type FulfillOrderIntentParams = z.input<typeof intents.fulfillSchema>;\n\nexport type CancelOrderIntentParams = z.input<typeof intents.cancelSchema>;\n\nexport type FactoryFamilyServiceId = (typeof intents.FACTORY_FAMILY_SERVICE_IDS)[number];\n\nexport type TierServiceId = (typeof intents.TIER_SERVICE_IDS)[number];\n\nexport type CollectionServiceId = (typeof intents.COLLECTION_SERVICE_IDS)[number];\n\nexport type CreateMintIntentParams = z.input<typeof intents.mintSchema>;\n\n/** Drop sale terms on the wire: amounts as decimal strings in the token's smallest unit. */\nexport interface DropTermsBody {\n /** Unix seconds; 0 = open from creation. */\n startTime: number;\n /** Unix seconds; 0 = never closes. */\n endTime: number;\n /** Per token; \"0\" = free. */\n price: string;\n paymentToken: string;\n /** \"0\" = unlimited. */\n maxPerWallet: string;\n}\n\nexport type ApiDropListStatus = \"live\" | \"upcoming\" | \"ended\";\n\nexport interface ApiDrop {\n contractAddress: string;\n dropId: string;\n organizer: string;\n name: string | null;\n symbol: string | null;\n description: string | null;\n image: string | null;\n /** Token URI = baseUri + token id. */\n baseUri: string | null;\n /** \"0\" = no cap. */\n maxSupply: string;\n minted: string;\n /** Total paid to the organizer, in the payment token's smallest unit. */\n revenue: string;\n collectors: number;\n terms: DropTermsBody;\n /** \"0x0\" = open to everyone. */\n allowlistRoot: string;\n createdBlock: string;\n}\n\nexport interface ApiDropFee {\n /** Platform fee added to a mint, in basis points; 0 when none applies. */\n launchpadBps: number;\n}\n\nexport interface ApiDropMint {\n kind: \"claim\" | \"issue\";\n wallet: string;\n quantity: string;\n firstTokenId: string;\n totalPaid: string;\n txHash: string;\n blockNumber: string;\n createdAt: string;\n}\n\nexport type CreateCollectionIntentParams = z.input<typeof intents.createCollectionSchema>;\n\nexport interface CheckoutIntentItem {\n orderHash: string;\n\n quantity?: string;\n}\n\nexport type CreateCheckoutIntentParams = z.input<typeof intents.checkoutBodySchema>;\n\nexport interface ApiCheckoutIntentResult {\n id?: string;\n orderHash: string;\n requiresSignature?: false;\n calls?: unknown;\n expiresAt?: string;\n\n error?: string;\n}\n\nexport type CreateTierIntentParams = z.output<typeof intents.createTierSchema>;\n\nexport type EmissionParams = z.input<typeof issuance.emissionSchema>;\n\nexport interface ApiEmissionCall {\n contractAddress: string;\n entrypoint: string;\n calldata: string[];\n}\n\nexport interface ApiEmissionResult {\n service: string;\n recipientCount: number;\n callCount: number;\n batches: ApiEmissionCall[][];\n}\n\nexport type CreateCoinIntentParams = z.input<typeof intents.createCoinSchema>;\n\nexport type LaunchCoinIntentParams = z.output<typeof intents.launchCoinSchema>;\n\nexport type CreateSponsorshipOfferIntentParams = z.output<typeof intents.sponsorshipOfferSchema>;\n\nexport type SetSponsorshipOfferOpenIntentParams = z.input<typeof intents.sponsorshipOfferOpenSchema>;\n\nexport type PlaceSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidSchema>;\n\nexport type RetractSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidRetractSchema>;\n\nexport type AcceptSponsorshipBidIntentParams = z.input<typeof intents.sponsorshipBidAcceptSchema>;\n\nexport type CreateSponsorshipProposalIntentParams = z.output<typeof intents.sponsorshipProposalSchema>;\n\nexport type WithdrawSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalWithdrawSchema>;\n\nexport type AcceptSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalAcceptSchema>;\n\nexport type RejectSponsorshipProposalIntentParams = z.input<typeof intents.sponsorshipProposalRejectSchema>;\n\nexport type CreateCounterOfferIntentParams = z.input<typeof intents.counterOfferSchema>;\n\nexport interface ApiCounterOffersQuery {\n\n originalOrderHash?: string;\n\n sellerAddress?: string;\n page?: number;\n limit?: number;\n}\n\nexport const OPEN_LICENSES = [\"CC0\", \"CC BY\", \"CC BY-SA\", \"CC BY-NC\"] as const;\nexport type OpenLicense = (typeof OPEN_LICENSES)[number];\n\nexport type RemixOfferStatus =\n | \"PENDING\"\n | \"AUTO_PENDING\"\n | \"APPROVED\"\n | \"COMPLETED\"\n | \"REJECTED\"\n | \"EXPIRED\"\n | \"SELF_MINTED\";\n\nexport interface ApiRemixOfferPrice {\n raw: string;\n formatted: string;\n currency: string;\n decimals: number;\n}\n\nexport interface ApiRemixOffer {\n id: string;\n status: RemixOfferStatus;\n originalContract: string;\n originalTokenId: string;\n creatorAddress: string;\n requesterAddress: string | null;\n message?: string | null;\n\n price?: ApiRemixOfferPrice;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct: number | null;\n approvedCollection: string | null;\n remixContract: string | null;\n remixTokenId: string | null;\n orderHash: string | null;\n createdAt: string;\n expiresAt: string;\n updatedAt: string;\n}\n\nexport interface ApiPublicRemix {\n id: string;\n remixContract: string | null;\n remixTokenId: string | null;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n createdAt: string;\n}\n\nexport interface CreateRemixOfferParams {\n originalContract: string;\n originalTokenId: string;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct?: number;\n proposedPrice?: string;\n proposedCurrency?: string;\n message?: string;\n\n expiresInDays?: number;\n}\n\nexport interface AutoRemixOfferParams {\n originalContract: string;\n originalTokenId: string;\n licenseType: string;\n}\n\nexport interface ConfirmSelfRemixParams {\n originalContract: string;\n originalTokenId: string;\n remixContract: string;\n remixTokenId: string;\n\n txHash?: string;\n licenseType: string;\n commercial: boolean;\n derivatives: boolean;\n royaltyPct?: number;\n}\n\nexport interface ConfirmRemixOfferParams {\n approvedCollection: string;\n remixContract: string;\n remixTokenId: string;\n orderHash?: string;\n}\n\nexport interface ApiRemixOffersQuery {\n\n role: \"creator\" | \"requester\";\n status?: string;\n page?: number;\n limit?: number;\n}\n\nexport interface ApiMetadataSignedUrl {\n url: string;\n}\n\nexport interface ApiMetadataUpload {\n cid: string;\n url: string;\n}\n\nexport interface ApiPortalMe {\n id: string;\n accountId: string;\n status: string;\n creditBalance: number;\n}\n\nexport interface ApiPortalKey {\n id: string;\n prefix: string;\n label: string | null;\n lastUsedAt: string | null;\n createdAt: string;\n}\n\nexport interface ApiPortalKeyCreated {\n id: string;\n prefix: string;\n label: string | null;\n\n plaintext: string;\n}\n\nexport interface ApiCreditPayment {\n id: string;\n asset: string;\n amountAtomic: string;\n creditedAmount: number;\n mdlnMultiplier: number;\n txHash: string;\n status: string;\n createdAt: string;\n}\n\nexport interface ApiFundingMethod {\n id: string;\n [detail: string]: unknown;\n}\n\nexport type ApiFundingStatus = \"PENDING\" | \"SETTLED\" | \"FAILED\" | \"EXPIRED\";\n\nexport interface ApiFundingIntent {\n id: string;\n method: string;\n status: ApiFundingStatus;\n expiresAt: string;\n payer?: string | null;\n}\n\nexport interface ApiFundingInstructions {\n chain: string;\n payTo: string;\n asset: string;\n amountAtomic: string;\n}\n\nexport type ApiFundingSubmit =\n | { status: \"SETTLED\"; credited?: number }\n | { status: \"PENDING\"; reason: string };\n\nexport interface ApiSpendByAction {\n actionKey: string;\n credits: number;\n units: number;\n}\n\nexport interface ApiPortalSpend {\n recent: Array<{ actionKey: string; credits: number; createdAt: string }>;\n byAction: ApiSpendByAction[];\n spent: number;\n credited: number;\n drift: number;\n}\n\nexport interface ApiCollectionProfile {\n contractAddress: string;\n chain: string;\n displayName: string | null;\n description: string | null;\n image: string | null;\n bannerImage: string | null;\n websiteUrl: string | null;\n twitterUrl: string | null;\n discordUrl: string | null;\n telegramUrl: string | null;\n hasGatedContent: boolean;\n gatedContentTitle: string | null;\n slug: string | null;\n updatedBy: string | null;\n updatedAt: string;\n}\n\nexport type UpdateCollectionProfileInput = z.output<typeof profiles.collectionProfileSchema>;\n\nexport interface ApiCollectionSlugClaim {\n id: string;\n slug: string;\n contractAddress: string;\n chain: string;\n walletAddress: string;\n status: \"PENDING\" | \"APPROVED\" | \"REJECTED\";\n adminNotes: string | null;\n notifyEmail: string | null;\n reviewedAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ApiCreatorProfile {\n walletAddress: string;\n chain: string;\n username: string | null;\n name: string | null;\n bio: string | null;\n avatarImage: string | null;\n\n collectionImage?: string | null;\n websiteUrl: string | null;\n twitterUrl: string | null;\n discordUrl: string | null;\n telegramUrl: string | null;\n updatedAt: string;\n}\n\nexport interface ApiCreatorListResult {\n creators: ApiCreatorProfile[];\n total: number;\n page: number;\n limit: number;\n}\n\nexport type ApiChain = \"STARKNET\" | \"ETHEREUM\" | \"SOLANA\" | \"BASE\" | \"BITCOIN\";\n\nexport interface ApiSession {\n accountId: string;\n publicId: string;\n walletAddress: string | null;\n email: string | null;\n emailDeadline: string | null;\n}\n\nexport interface ApiUserWallet {\n walletAddress: string;\n email?: string | null;\n emailDeadline?: string | null;\n}\n\nexport interface ApiCollectionClaim {\n id: string;\n contractAddress: string;\n chain: string;\n claimantAddress: string | null;\n status: \"PENDING\" | \"AUTO_APPROVED\" | \"APPROVED\" | \"REJECTED\";\n verificationMethod: \"ONCHAIN\" | \"SIGNATURE\" | \"MANUAL\";\n createdAt: string;\n}\n\nexport interface ApiAdminCollectionClaim extends ApiCollectionClaim {\n claimantEmail: string | null;\n notes: string | null;\n adminNotes: string | null;\n reviewedBy: string | null;\n reviewedAt: string | null;\n updatedAt: string;\n}\n\nexport interface ApiBusinessProvisioning {\n chain: string;\n walletAddress: string;\n}\n\nexport interface ApiWalletActivity {\n id: string;\n chain: string;\n accountAddress: string;\n type: \"SEND\" | \"RECEIVE\" | \"SWAP\" | \"DEPLOY\" | \"GUARDIAN_SET\" | \"GUARDIAN_TRIGGER_ESCAPE\" | \"GUARDIAN_COMPLETE_ESCAPE\" | \"GUARDIAN_CANCEL_ESCAPE\";\n txHash: string;\n blockNumber: string;\n timestamp: string;\n tokenAddress: string | null;\n amount: string | null;\n counterparty: string | null;\n tokenInAddress: string | null;\n amountIn: string | null;\n tokenOutAddress: string | null;\n amountOut: string | null;\n}\n\nexport interface ApiRewardsBadge {\n key: string;\n name: string;\n description: string;\n icon: string;\n color: string;\n category: string;\n}\n\nexport interface ApiRewardsLevel {\n level: number;\n name: string;\n xpRequired: number;\n badgeColor: string;\n description: string | null;\n}\n\nexport interface ApiUserRewards {\n address: string;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n nextLevel: { level: number; name: string; xpRequired: number } | null;\n progressPct: number;\n breakdown: Record<string, number>;\n badges: ApiRewardsBadge[];\n computedAt: string | null;\n}\n\nexport interface ApiRewardsLeaderboardEntry {\n rank: number;\n address: string;\n accountId: string | null;\n publicId: string | null;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n}\n\nexport interface ApiRewardsConfig {\n levels: ApiRewardsLevel[];\n actions: { type: string; label: string; xp: number; dailyCap: number | null }[];\n badges: ApiRewardsBadge[];\n}\n\nexport interface ApiRewardsBatchEntry {\n address: string;\n totalXp: number;\n currentLevel: number;\n currentLevelName: string;\n badgeColor: string;\n}\n\nexport interface ApiPointEvent {\n id: string;\n actionType: string;\n xp: number;\n multiplier: number;\n finalXp: number;\n txHash: string | null;\n createdAt: string;\n}\n\nexport interface ApiPlatformStats {\n collections: number;\n tokens: number;\n sales: number;\n}\n\nexport interface ApiTierOnchain {\n maxSupply: string;\n minted: string;\n startTime: number | null;\n endTime: number | null;\n royaltyBps: number;\n}\n\nexport interface ApiSwapQuoteRequest {\n sellSymbol?: string;\n buySymbol?: string;\n sellTokenAddress?: string;\n buyTokenAddress?: string;\n sellAmountRaw?: string;\n buyAmountRaw?: string;\n takerAddress?: string;\n}\n\nexport interface ApiSwapQuote {\n quoteId: string;\n sellTokenAddress: string;\n sellAmount: string;\n buyTokenAddress: string;\n buyAmount: string;\n}\n\nexport interface ApiIpNftTokenData {\n owner: string;\n metadataUri: string;\n originalCreator: string;\n registeredAt: number;\n}\n\nexport interface ApiTokensQuery {\n page?: number;\n limit?: number;\n sort?: string;\n ipType?: string;\n derivatives?: \"allowed\";\n}\n\nexport interface ApiUsernameClaim {\n id: string;\n username: string;\n walletAddress: string;\n status: \"PENDING\" | \"APPROVED\" | \"REJECTED\";\n adminNotes: string | null;\n reviewedAt: string | null;\n createdAt: string;\n}\n\nexport type ApiReportTargetType = \"COLLECTION\" | \"TOKEN\" | \"CREATOR\" | \"COMMENT\";\n\nexport interface ApiSubmitReport {\n targetType: ApiReportTargetType;\n targetContract?: string;\n targetTokenId?: string;\n targetAddress?: string;\n targetId?: string;\n categories: string[];\n description?: string;\n}\n\nexport interface ApiSponsorshipOffer {\n id: string;\n chain: string;\n contractAddress: string;\n offerId: string;\n author: string;\n nftContract: string;\n tokenId: string;\n minAmount: string;\n duration: number;\n paymentToken: string;\n licenseTermsUri: string;\n transferable: boolean;\n royaltyBps: number;\n specificSponsor: string | null;\n open: boolean;\n createdAtChain: string;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipBid {\n id: string;\n chain: string;\n contractAddress: string;\n offerId: string;\n sponsor: string;\n amount: string;\n placedAtChain: string;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipProposal {\n id: string;\n chain: string;\n contractAddress: string;\n proposalId: string;\n proposer: string;\n nftContract: string;\n tokenId: string;\n amount: string;\n duration: number;\n validUntil: string | null;\n paymentToken: string;\n licenseTermsUri: string;\n transferable: boolean;\n royaltyBps: number;\n open: boolean;\n accepted: boolean | null;\n createdAtChain: string;\n closedAtChain: string | null;\n updatedAt: string;\n}\n\nexport interface ApiSponsorshipLicense {\n id: string;\n chain: string;\n contractAddress: string;\n tokenId: string;\n author: string;\n recipient: string;\n assetContract: string;\n assetTokenId: string;\n expiresAt: string;\n transferable: boolean;\n royaltyBps: number;\n licenseTermsUri: string;\n offerId: string | null;\n proposalId: string | null;\n mintedAtChain: string;\n currentHolder?: string | null;\n}\n\nexport interface ApiSponsorshipOffersQuery {\n limit?: number;\n nftContract?: string;\n author?: string;\n owner?: string;\n open?: boolean;\n}\n\nexport interface ApiSponsorshipProposalsQuery {\n limit?: number;\n nftContract?: string;\n proposer?: string;\n owner?: string;\n open?: boolean;\n}\n\nexport interface ApiSponsorshipLicensesQuery {\n limit?: number;\n holder?: string;\n author?: string;\n}\n\nexport interface ApiCollectionsListQuery {\n page?: number;\n limit?: number;\n owner?: string;\n service?: string;\n sort?: CollectionSort;\n isFeatured?: boolean;\n hideEmpty?: boolean;\n standard?: string;\n chain?: ChainFilter;\n}\n\nexport interface ApiPricingRule {\n actionKey: string;\n chain: string;\n service: string;\n credits: number;\n}\n\nexport interface ApiPricing {\n creditsPerUsdc: number;\n mdln?: { contract: string | null; tiers: { minWholeTokens: number; multiplier: number }[] };\n pricing: { default: number; rules: ApiPricingRule[] };\n}\n\nexport type CreateTransferTokenIntentParams = z.input<typeof intents.transferTokenSchema>;\n\nexport type CreateTransferNftIntentParams = z.input<typeof intents.transferNftSchema>;\n\nexport type CreateTransferCollectionOwnershipIntentParams = z.input<typeof intents.transferCollectionOwnershipSchema>;\n\nexport type CreateCommentIntentParams = z.input<typeof intents.commentSchema>;\n\nexport type CreateGenesisMintIntentParams = z.input<typeof intents.genesisMintSchema>;\n\nexport type CreatePopClaimIntentParams = z.input<typeof intents.popClaimSchema>;\n\nexport type CreatePopBurnIntentParams = z.input<typeof intents.popBurnSchema>;\n\nexport type CreateDropClaimIntentParams = z.input<typeof intents.dropClaimSchema>;\n\nexport type WalletManageAction = \"add_owner\" | \"remove_owner\" | \"cancel_escape\" | \"set_first_guardian\" | \"trigger_escape\" | \"complete_escape\";\n\nexport type CreateWalletManageIntentParams = z.input<typeof intents.walletManageSchema>;\n\nexport type CreateSwapIntentParams = z.input<typeof intents.swapIntentSchema>;\n\nexport type CreateFundingTransferIntentParams = z.input<typeof intents.fundingTransferSchema>;\n\nexport type DropManageAction = \"issue\" | \"set_allowlist_root\";\n\nexport type CreateDropManageIntentParams = z.input<typeof intents.dropManageSchema>;\n\nexport type PopManageAction = \"issue\" | \"set_allowlist_root\";\n\nexport type CreatePopManageIntentParams = z.input<typeof intents.popManageSchema>;\n\nexport interface IntentParamsByKind {\n listing: CreateListingIntentParams;\n offer: MakeOfferIntentParams;\n fulfill: FulfillOrderIntentParams;\n cancel: CancelOrderIntentParams;\n mint: CreateMintIntentParams;\n \"transfer-token\": CreateTransferTokenIntentParams;\n \"transfer-nft\": CreateTransferNftIntentParams;\n \"transfer-collection-ownership\": CreateTransferCollectionOwnershipIntentParams;\n comment: CreateCommentIntentParams;\n \"genesis-mint\": CreateGenesisMintIntentParams;\n \"pop-claim\": CreatePopClaimIntentParams;\n \"pop-burn\": CreatePopBurnIntentParams;\n \"drop-claim\": CreateDropClaimIntentParams;\n \"wallet-manage\": CreateWalletManageIntentParams;\n swap: CreateSwapIntentParams;\n \"funding-transfer\": CreateFundingTransferIntentParams;\n \"drop-manage\": CreateDropManageIntentParams;\n \"pop-manage\": CreatePopManageIntentParams;\n \"create-collection\": CreateCollectionIntentParams;\n \"create-tier\": CreateTierIntentParams;\n \"create-coin\": CreateCoinIntentParams;\n \"launch-coin\": LaunchCoinIntentParams;\n \"sponsorship-offer\": CreateSponsorshipOfferIntentParams;\n \"sponsorship-offer-open\": SetSponsorshipOfferOpenIntentParams;\n \"sponsorship-bid\": PlaceSponsorshipBidIntentParams;\n \"sponsorship-bid-retract\": RetractSponsorshipBidIntentParams;\n \"sponsorship-bid-accept\": AcceptSponsorshipBidIntentParams;\n \"sponsorship-proposal\": CreateSponsorshipProposalIntentParams;\n \"sponsorship-proposal-withdraw\": WithdrawSponsorshipProposalIntentParams;\n \"sponsorship-proposal-accept\": AcceptSponsorshipProposalIntentParams;\n \"sponsorship-proposal-reject\": RejectSponsorshipProposalIntentParams;\n \"counter-offer\": CreateCounterOfferIntentParams;\n}\n","\n\nexport type AssetAttribute = { trait_type: string; value: string };\n\nexport interface AssetMetadata {\n name: string;\n description: string;\n image: string | null;\n external_url: string;\n attributes: AssetAttribute[];\n}\n\nexport interface BuildAssetMetadataInput {\n name: string;\n description?: string | null;\n externalUrl?: string | null;\n imageUri?: string | null;\n creator?: string | null;\n ipType?: string | null;\n licenseType?: string | null;\n commercialUse?: string | null;\n derivatives?: string | null;\n attribution?: string | null;\n geographicScope?: string | null;\n aiPolicy?: string | null;\n royalty?: string | null;\n edition?: string | null;\n\n templateTraits?: { traitType: string; value: string }[];\n}\n\nexport const RESERVED_TRAITS = new Set([\n \"Creator\", \"IP Type\", \"License\", \"Commercial Use\", \"Derivatives\",\n \"Attribution\", \"Territory\", \"AI Policy\", \"Royalty\", \"Edition\",\n \"Standard\",\n]);\nconst RESERVED_TRAITS_NORMALIZED = new Set([...RESERVED_TRAITS].map((t) => t.toLowerCase()));\n\nexport function buildAssetMetadata(input: BuildAssetMetadataInput): AssetMetadata {\n const attributes: AssetAttribute[] = [];\n\n if (input.creator) attributes.push({ trait_type: \"Creator\", value: input.creator });\n if (input.ipType) attributes.push({ trait_type: \"IP Type\", value: input.ipType });\n if (input.licenseType) attributes.push({ trait_type: \"License\", value: input.licenseType });\n if (input.commercialUse) attributes.push({ trait_type: \"Commercial Use\", value: input.commercialUse });\n if (input.derivatives) attributes.push({ trait_type: \"Derivatives\", value: input.derivatives });\n if (input.attribution) attributes.push({ trait_type: \"Attribution\", value: input.attribution });\n if (input.geographicScope) attributes.push({ trait_type: \"Territory\", value: input.geographicScope });\n if (input.aiPolicy) attributes.push({ trait_type: \"AI Policy\", value: input.aiPolicy });\n\n if (input.royalty) {\n const num = parseFloat(String(input.royalty).replace(\"%\", \"\"));\n if (!isNaN(num) && num > 0) attributes.push({ trait_type: \"Royalty\", value: `${num}%` });\n }\n\n if (input.edition) attributes.push({ trait_type: \"Edition\", value: input.edition });\n\n for (const t of input.templateTraits ?? []) {\n const traitType = t.traitType?.trim() ?? \"\";\n const traitValue = String(t.value ?? \"\").trim();\n if (!traitType || !traitValue || RESERVED_TRAITS_NORMALIZED.has(traitType.toLowerCase())) continue;\n attributes.push({ trait_type: traitType, value: traitValue });\n }\n\n if (input.licenseType) attributes.push({ trait_type: \"Standard\", value: \"Berne Convention\" });\n\n return {\n name: input.name,\n description: input.description ?? \"\",\n image: input.imageUri ?? null,\n external_url: input.externalUrl || \"https://medialane.io\",\n attributes,\n };\n}\n\nexport interface CollectionMetadata {\n name: string;\n description?: string;\n image?: string;\n external_link: string;\n}\n\nexport interface BuildCollectionMetadataInput {\n name: string;\n owner: string;\n description?: string | null;\n image?: string | null;\n externalLink?: string | null;\n}\n\nexport const accountPageUrl = (address: string): string => `https://www.medialane.io/account/${address}`;\n\nexport function buildCollectionMetadata(input: BuildCollectionMetadataInput): CollectionMetadata {\n const description = input.description?.trim();\n const image = input.image?.trim();\n return {\n name: input.name,\n ...(description ? { description } : {}),\n ...(image ? { image } : {}),\n external_link: input.externalLink?.trim() || accountPageUrl(input.owner),\n };\n}\n","\n\ntype Attribute = { trait_type?: string; value?: string | number | boolean };\n\nexport function getDerivativesTerm(\n attributes: Attribute[] | null | undefined,\n): \"Allowed\" | \"Not Allowed\" | null {\n const v = (Array.isArray(attributes) ? attributes : []).find(\n (a) => a.trait_type === \"Derivatives\",\n )?.value;\n return v === \"Allowed\" || v === \"Not Allowed\" ? v : null;\n}\n\nexport interface RemixPolicyInput {\n\n parentNoDerivatives: boolean;\n\n viewerIsParentOwner: boolean;\n\n dealAvailable: boolean;\n}\n\nexport interface RemixPolicy extends RemixPolicyInput {\n\n canRemixDirect: boolean;\n\n showDealOption: boolean;\n}\n\nexport function resolveRemixPolicy(input: RemixPolicyInput): RemixPolicy {\n const canRemixDirect = input.viewerIsParentOwner || !input.parentNoDerivatives;\n const showDealOption = input.dealAvailable && !input.viewerIsParentOwner;\n return { ...input, canRemixDirect, showDealOption };\n}\n","export type UploadKind = \"image\" | \"document\" | \"media\";\n\nconst MB = 1024 * 1024;\n\nexport const MAX_UPLOAD_BYTES = 90 * MB;\n\nexport function formatFileSize(bytes: number): string {\n const mb = bytes / MB;\n return `${Number.isInteger(mb) ? mb : mb.toFixed(1)} MB`;\n}\n\nexport function uploadSizeError(file: { size: number }, kind: UploadKind = \"image\"): string | null {\n if (file.size <= MAX_UPLOAD_BYTES) return null;\n const noun = kind === \"image\" ? \"image\" : \"file\";\n return `That ${noun} is ${formatFileSize(file.size)}. Please choose one under ${formatFileSize(MAX_UPLOAD_BYTES)}.`;\n}\n"]}
|