@medialane/sdk 0.198.0 → 0.200.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.
Files changed (92) hide show
  1. package/README.md +86 -41
  2. package/dist/chains-CmwjZVU7.d.cts +85 -0
  3. package/dist/chains-CmwjZVU7.d.ts +85 -0
  4. package/dist/chunk-3HPMEDYH.cjs +967 -0
  5. package/dist/chunk-3HPMEDYH.cjs.map +1 -0
  6. package/dist/{chunk-3ME5YKTW.js → chunk-5KY6P434.js} +2 -2
  7. package/dist/chunk-5KY6P434.js.map +1 -0
  8. package/dist/chunk-F7W6IWTL.js +660 -0
  9. package/dist/chunk-F7W6IWTL.js.map +1 -0
  10. package/dist/chunk-GIBIHGSV.js +916 -0
  11. package/dist/chunk-GIBIHGSV.js.map +1 -0
  12. package/dist/chunk-GV4A2WNO.js +444 -0
  13. package/dist/chunk-GV4A2WNO.js.map +1 -0
  14. package/dist/{chunk-7EYJC5CB.cjs → chunk-H2NJB3AK.cjs} +2 -2
  15. package/dist/chunk-H2NJB3AK.cjs.map +1 -0
  16. package/dist/chunk-KGAGWULG.js +932 -0
  17. package/dist/chunk-KGAGWULG.js.map +1 -0
  18. package/dist/chunk-MEJ47LC3.cjs +463 -0
  19. package/dist/chunk-MEJ47LC3.cjs.map +1 -0
  20. package/dist/chunk-W76AZ5WC.cjs +376 -0
  21. package/dist/chunk-W76AZ5WC.cjs.map +1 -0
  22. package/dist/chunk-WRBXQPRL.js +323 -0
  23. package/dist/chunk-WRBXQPRL.js.map +1 -0
  24. package/dist/chunk-ZLMIHQWM.cjs +975 -0
  25. package/dist/chunk-ZLMIHQWM.cjs.map +1 -0
  26. package/dist/chunk-ZVANOWIB.cjs +688 -0
  27. package/dist/chunk-ZVANOWIB.cjs.map +1 -0
  28. package/dist/contract/index.cjs +88 -261
  29. package/dist/contract/index.cjs.map +1 -1
  30. package/dist/contract/index.d.cts +139 -4
  31. package/dist/contract/index.d.ts +139 -4
  32. package/dist/contract/index.js +4 -220
  33. package/dist/contract/index.js.map +1 -1
  34. package/dist/evm/index.cjs +3 -3
  35. package/dist/evm/index.d.cts +2 -1
  36. package/dist/evm/index.d.ts +2 -1
  37. package/dist/evm/index.js +1 -1
  38. package/dist/fetch-Cx9Pr7-B.d.cts +3 -0
  39. package/dist/fetch-Cx9Pr7-B.d.ts +3 -0
  40. package/dist/index.cjs +177 -833
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +54 -132
  43. package/dist/index.d.ts +54 -132
  44. package/dist/index.js +6 -659
  45. package/dist/index.js.map +1 -1
  46. package/dist/passkey-errors-B0HGcjPc.d.ts +981 -0
  47. package/dist/passkey-errors-yndCFeHv.d.cts +981 -0
  48. package/dist/provisioning-CwRkCN8D.d.cts +14 -0
  49. package/dist/provisioning-CwRkCN8D.d.ts +14 -0
  50. package/dist/{provisioning-BUYiU8Tr.d.ts → responses-D3nBY71f.d.cts} +40 -48
  51. package/dist/{provisioning-BUYiU8Tr.d.cts → responses-D3nBY71f.d.ts} +40 -48
  52. package/dist/server/index.cjs +117 -0
  53. package/dist/server/index.cjs.map +1 -0
  54. package/dist/server/index.d.cts +98 -0
  55. package/dist/server/index.d.ts +98 -0
  56. package/dist/server/index.js +4 -0
  57. package/dist/server/index.js.map +1 -0
  58. package/dist/services-B15RJBSW.d.cts +728 -0
  59. package/dist/services-BAnTJhwt.d.ts +728 -0
  60. package/dist/solana/index.cjs +2 -2
  61. package/dist/solana/index.d.cts +2 -1
  62. package/dist/solana/index.d.ts +2 -1
  63. package/dist/solana/index.js +1 -1
  64. package/dist/starknet/index.cjs +898 -1729
  65. package/dist/starknet/index.cjs.map +1 -1
  66. package/dist/starknet/index.d.cts +98 -467
  67. package/dist/starknet/index.d.ts +98 -467
  68. package/dist/starknet/index.js +704 -1680
  69. package/dist/starknet/index.js.map +1 -1
  70. package/dist/stellar/index.cjs +2 -2
  71. package/dist/stellar/index.d.cts +2 -1
  72. package/dist/stellar/index.d.ts +2 -1
  73. package/dist/stellar/index.js +1 -1
  74. package/dist/types-BW6ktwcT.d.ts +71 -0
  75. package/dist/types-BftPOVEJ.d.cts +71 -0
  76. package/dist/wallet/index.cjs +240 -0
  77. package/dist/wallet/index.cjs.map +1 -0
  78. package/dist/wallet/index.d.cts +319 -0
  79. package/dist/wallet/index.d.ts +319 -0
  80. package/dist/wallet/index.js +7 -0
  81. package/dist/wallet/index.js.map +1 -0
  82. package/package.json +13 -2
  83. package/dist/chunk-2R7XBA34.cjs +0 -1938
  84. package/dist/chunk-2R7XBA34.cjs.map +0 -1
  85. package/dist/chunk-3ME5YKTW.js.map +0 -1
  86. package/dist/chunk-6WVUUBFI.js +0 -1853
  87. package/dist/chunk-6WVUUBFI.js.map +0 -1
  88. package/dist/chunk-7EYJC5CB.cjs.map +0 -1
  89. package/dist/errors-CZm-NZK0.d.cts +0 -1754
  90. package/dist/errors-h6H6cj3Q.d.ts +0 -1754
  91. package/dist/types-DC4jNPAF.d.cts +0 -153
  92. package/dist/types-DC4jNPAF.d.ts +0 -153
@@ -0,0 +1,728 @@
1
+ import { z } from 'zod';
2
+ import { C as Chain } from './chains-CmwjZVU7.js';
3
+ import { F as FetchLike } from './fetch-Cx9Pr7-B.js';
4
+ import { _ as ApiOrdersQuery, ac as ApiResponse, U as ApiOrder, x as ApiCounterOffersQuery, aC as ApiTokensQuery, az as ApiToken, aA as ApiTokenBalance, f as ApiActivity, w as ApiComment, a7 as ApiPublicRemix, u as ApiCollectionsListQuery, q as ApiCollection, aO as CollectionTokensSort, s as ApiCollectionProfile, bI as UpdateCollectionProfileInput, r as ApiCollectionClaim, t as ApiCollectionSlugClaim, e as ApiActivitiesQuery, aH as ApiWalletActivity, aK as ChainFilter, ak as ApiSearchResult, bl as IntentParamsByKind, O as ApiIntentCreated, aR as CreateCheckoutIntentParams, k as ApiCheckoutIntentResult, N as ApiIntent, aD as ApiTxSyncResult, R as ApiMetadataSignedUrl, T as ApiMetadataUpload, y as ApiCreatorListResult, z as ApiCreatorProfile, aG as ApiUsernameClaim, a3 as ApiPortalMe, a1 as ApiPortalKey, a2 as ApiPortalKeyCreated, B as ApiCreditPayment, a4 as ApiPortalSpend, a5 as ApiPricing, K as ApiFundingMethod, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, bf as EmissionParams, H as ApiEmissionResult, i as ApiBusinessProvisioning, b3 as CreateRemixOfferParams, a8 as ApiRemixOffer, aI as AutoRemixOfferParams, aQ as ConfirmSelfRemixParams, aa as ApiRemixOffersQuery, aP as ConfirmRemixOfferParams, p as ApiCoinsQuery, l as ApiCoin, o as ApiCoinPrices, m as ApiCoinClaimResult, D as ApiDropFee, E as ApiDropListStatus, C as ApiDrop, F as ApiDropMint, as as ApiSponsorshipOffersQuery, ar as ApiSponsorshipOffer, ao as ApiSponsorshipBid, au as ApiSponsorshipProposalsQuery, at as ApiSponsorshipProposal, aq as ApiSponsorshipLicensesQuery, ap as ApiSponsorshipLicense, aE as ApiUserRewards, ag as ApiRewardsLeaderboardEntry, a0 as ApiPointEvent, af as ApiRewardsConfig, ae as ApiRewardsBatchEntry, $ as ApiPlatformStats, ax as ApiSwapQuoteRequest, aw as ApiSwapQuote, av as ApiSubmitReport, ay as ApiTierOnchain, P as ApiIpNftTokenData, c as AccountApi } from './passkey-errors-B0HGcjPc.js';
5
+ import { R as IntentKind } from './responses-D3nBY71f.js';
6
+ import { TypedData, Call, ProviderInterface } from 'starknet';
7
+ import { p as provisioningRegisterSchema } from './provisioning-CwRkCN8D.js';
8
+
9
+ interface RetryOptions {
10
+ maxAttempts?: number;
11
+ baseDelayMs?: number;
12
+ maxDelayMs?: number;
13
+ }
14
+
15
+ declare const FeeConfigSchema: z.ZodObject<{
16
+ enabled: z.ZodDefault<z.ZodBoolean>;
17
+ fundAddress: z.ZodOptional<z.ZodString>;
18
+ marketplaceBps: z.ZodDefault<z.ZodNumber>;
19
+ launchpadBps: z.ZodDefault<z.ZodNumber>;
20
+ sponsorshipBps: z.ZodDefault<z.ZodNumber>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ enabled: boolean;
23
+ marketplaceBps: number;
24
+ launchpadBps: number;
25
+ sponsorshipBps: number;
26
+ fundAddress?: string | undefined;
27
+ }, {
28
+ enabled?: boolean | undefined;
29
+ fundAddress?: string | undefined;
30
+ marketplaceBps?: number | undefined;
31
+ launchpadBps?: number | undefined;
32
+ sponsorshipBps?: number | undefined;
33
+ }>;
34
+ type FeeConfig = z.input<typeof FeeConfigSchema>;
35
+ interface ResolvedFeeConfig {
36
+ enabled: boolean;
37
+ fundAddress: string | undefined;
38
+ marketplaceBps: number;
39
+ launchpadBps: number;
40
+ sponsorshipBps: number;
41
+ }
42
+ declare function resolveFeeConfig(raw: FeeConfig | undefined): ResolvedFeeConfig;
43
+
44
+ declare const MedialaneConfigSchema: z.ZodObject<{
45
+ chain: z.ZodDefault<z.ZodEnum<["STARKNET", "ETHEREUM", "SOLANA", "BASE", "STELLAR", "BITCOIN"]>>;
46
+ backendUrl: z.ZodOptional<z.ZodString>;
47
+ apiKey: z.ZodOptional<z.ZodString>;
48
+ marketplace721Contract: z.ZodOptional<z.ZodString>;
49
+ marketplace1155Contract: z.ZodOptional<z.ZodString>;
50
+ collection721Contract: z.ZodOptional<z.ZodString>;
51
+ collection1155Contract: z.ZodOptional<z.ZodString>;
52
+ retryOptions: z.ZodOptional<z.ZodObject<{
53
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
54
+ baseDelayMs: z.ZodOptional<z.ZodNumber>;
55
+ maxDelayMs: z.ZodOptional<z.ZodNumber>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ maxAttempts?: number | undefined;
58
+ baseDelayMs?: number | undefined;
59
+ maxDelayMs?: number | undefined;
60
+ }, {
61
+ maxAttempts?: number | undefined;
62
+ baseDelayMs?: number | undefined;
63
+ maxDelayMs?: number | undefined;
64
+ }>>;
65
+ feeConfig: z.ZodOptional<z.ZodObject<{
66
+ enabled: z.ZodDefault<z.ZodBoolean>;
67
+ fundAddress: z.ZodOptional<z.ZodString>;
68
+ marketplaceBps: z.ZodDefault<z.ZodNumber>;
69
+ launchpadBps: z.ZodDefault<z.ZodNumber>;
70
+ sponsorshipBps: z.ZodDefault<z.ZodNumber>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ enabled: boolean;
73
+ marketplaceBps: number;
74
+ launchpadBps: number;
75
+ sponsorshipBps: number;
76
+ fundAddress?: string | undefined;
77
+ }, {
78
+ enabled?: boolean | undefined;
79
+ fundAddress?: string | undefined;
80
+ marketplaceBps?: number | undefined;
81
+ launchpadBps?: number | undefined;
82
+ sponsorshipBps?: number | undefined;
83
+ }>>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ chain: "STARKNET" | "ETHEREUM" | "SOLANA" | "BASE" | "STELLAR" | "BITCOIN";
86
+ backendUrl?: string | undefined;
87
+ apiKey?: string | undefined;
88
+ marketplace721Contract?: string | undefined;
89
+ marketplace1155Contract?: string | undefined;
90
+ collection721Contract?: string | undefined;
91
+ collection1155Contract?: string | undefined;
92
+ retryOptions?: {
93
+ maxAttempts?: number | undefined;
94
+ baseDelayMs?: number | undefined;
95
+ maxDelayMs?: number | undefined;
96
+ } | undefined;
97
+ feeConfig?: {
98
+ enabled: boolean;
99
+ marketplaceBps: number;
100
+ launchpadBps: number;
101
+ sponsorshipBps: number;
102
+ fundAddress?: string | undefined;
103
+ } | undefined;
104
+ }, {
105
+ chain?: "STARKNET" | "ETHEREUM" | "SOLANA" | "BASE" | "STELLAR" | "BITCOIN" | undefined;
106
+ backendUrl?: string | undefined;
107
+ apiKey?: string | undefined;
108
+ marketplace721Contract?: string | undefined;
109
+ marketplace1155Contract?: string | undefined;
110
+ collection721Contract?: string | undefined;
111
+ collection1155Contract?: string | undefined;
112
+ retryOptions?: {
113
+ maxAttempts?: number | undefined;
114
+ baseDelayMs?: number | undefined;
115
+ maxDelayMs?: number | undefined;
116
+ } | undefined;
117
+ feeConfig?: {
118
+ enabled?: boolean | undefined;
119
+ fundAddress?: string | undefined;
120
+ marketplaceBps?: number | undefined;
121
+ launchpadBps?: number | undefined;
122
+ sponsorshipBps?: number | undefined;
123
+ } | undefined;
124
+ }>;
125
+ type MedialaneConfig = z.input<typeof MedialaneConfigSchema>;
126
+ interface ResolvedConfig {
127
+ chain: Chain;
128
+ backendUrl: string | undefined;
129
+ apiKey: string | undefined;
130
+ marketplace721Contract: string;
131
+ marketplace1155Contract: string;
132
+ collection721Contract: string;
133
+ collection1155Contract: string;
134
+ retryOptions?: RetryOptions;
135
+ feeConfig: ResolvedFeeConfig;
136
+ }
137
+ declare function resolveConfig(raw: MedialaneConfig): ResolvedConfig;
138
+
139
+ type MedialaneErrorCode = "NOT_FOUND" | "TOKEN_NOT_FOUND" | "COLLECTION_NOT_FOUND" | "ORDER_NOT_FOUND" | "INTENT_NOT_FOUND" | "INTENT_EXPIRED" | "RATE_LIMITED" | "INVALID_PARAMS" | "UNAUTHORIZED" | "UNKNOWN";
140
+
141
+ declare class UserFacingError extends Error {
142
+ constructor(message: string);
143
+ }
144
+ declare class MedialaneError extends Error {
145
+ readonly code: MedialaneErrorCode;
146
+ readonly cause?: unknown | undefined;
147
+ constructor(message: string, code?: MedialaneErrorCode, cause?: unknown | undefined);
148
+ }
149
+ declare class MedialaneApiError extends MedialaneError {
150
+ readonly status: number;
151
+ readonly retryAfterMs?: number | undefined;
152
+ readonly details?: unknown | undefined;
153
+ readonly serverCode?: string | undefined;
154
+ constructor(status: number, message: string, retryAfterMs?: number | undefined, details?: unknown | undefined, path?: string, serverCode?: string | undefined);
155
+ }
156
+
157
+ type BearerSource = string | (() => string | undefined);
158
+ interface TransportOptions {
159
+ baseUrl: string;
160
+ apiKey?: string;
161
+ bearer?: BearerSource;
162
+ retry?: RetryOptions;
163
+ chain?: Chain;
164
+ fetch?: FetchLike;
165
+ }
166
+
167
+ interface OrdersApi {
168
+ list(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
169
+ get(orderHash: string): Promise<ApiOrder>;
170
+ forToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
171
+ receivedBy(address: string, opts?: {
172
+ page?: number;
173
+ limit?: number;
174
+ }): Promise<ApiResponse<ApiOrder[]>>;
175
+ byUser(address: string, opts?: {
176
+ page?: number;
177
+ limit?: number;
178
+ }): Promise<ApiResponse<ApiOrder[]>>;
179
+ counterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
180
+ }
181
+
182
+ interface Paging {
183
+ page?: number;
184
+ limit?: number;
185
+ }
186
+ interface TokensApi {
187
+ list(query?: ApiTokensQuery): Promise<ApiResponse<ApiToken[]>>;
188
+ get(contract: string, tokenId: string, opts?: {
189
+ wait?: boolean;
190
+ }): Promise<ApiToken>;
191
+ balance(contract: string, tokenId: string, owner: string): Promise<ApiTokenBalance>;
192
+ ownedBy(address: string, opts?: Paging): Promise<ApiResponse<ApiToken[]>>;
193
+ history(contract: string, tokenId: string, opts?: Paging): Promise<ApiResponse<ApiActivity[]>>;
194
+ comments(contract: string, tokenId: string, opts?: Paging): Promise<ApiResponse<ApiComment[]>>;
195
+ remixes(contract: string, tokenId: string, opts?: Paging): Promise<ApiResponse<ApiPublicRemix[]>>;
196
+ }
197
+
198
+ interface GatedContent {
199
+ title: string;
200
+ url: string;
201
+ type: string;
202
+ }
203
+ interface CollectionsApi {
204
+ list(query?: ApiCollectionsListQuery): Promise<ApiResponse<ApiCollection[]>>;
205
+ get(contract: string): Promise<ApiCollection>;
206
+ findBySlug(slug: string): Promise<ApiCollection | null>;
207
+ tokens(contract: string, opts?: {
208
+ page?: number;
209
+ limit?: number;
210
+ sort?: CollectionTokensSort;
211
+ }): Promise<ApiResponse<ApiToken[]>>;
212
+ register(contractAddress: string): Promise<ApiCollection>;
213
+ findProfile(contractAddress: string): Promise<ApiCollectionProfile | null>;
214
+ updateProfile(contractAddress: string, data: UpdateCollectionProfileInput): Promise<ApiCollectionProfile>;
215
+ findGatedContent(contractAddress: string): Promise<GatedContent | null>;
216
+ claim(contractAddress: string, walletAddress: string): Promise<{
217
+ verified: boolean;
218
+ collection?: ApiCollection;
219
+ reason?: string;
220
+ }>;
221
+ requestClaim(params: {
222
+ contractAddress: string;
223
+ walletAddress?: string;
224
+ email: string;
225
+ notes?: string;
226
+ }): Promise<{
227
+ claim: ApiCollectionClaim;
228
+ }>;
229
+ slugAvailability(slug: string): Promise<{
230
+ available: boolean;
231
+ reason?: string;
232
+ }>;
233
+ submitSlugClaim(contractAddress: string, slug: string, notifyEmail?: string): Promise<{
234
+ claim: ApiCollectionSlugClaim;
235
+ }>;
236
+ mySlugClaims(): Promise<{
237
+ claims: ApiCollectionSlugClaim[];
238
+ }>;
239
+ }
240
+
241
+ interface ActivityApi {
242
+ list(query?: ApiActivitiesQuery): Promise<ApiResponse<ApiActivity[]>>;
243
+ byAddress(address: string, opts?: {
244
+ page?: number;
245
+ limit?: number;
246
+ }): Promise<ApiResponse<ApiActivity[]>>;
247
+ wallet(address: string, chain?: "STARKNET"): Promise<ApiResponse<ApiWalletActivity[]>>;
248
+ }
249
+ interface SearchApi {
250
+ (q: string, limit?: number, chain?: ChainFilter): Promise<ApiResponse<ApiSearchResult> & {
251
+ query: string;
252
+ }>;
253
+ }
254
+
255
+ interface IntentsApi {
256
+ create<K extends IntentKind>(kind: K, params: IntentParamsByKind[K], opts?: {
257
+ bearer?: string;
258
+ }): Promise<ApiIntentCreated>;
259
+ checkout(params: CreateCheckoutIntentParams): Promise<ApiCheckoutIntentResult[]>;
260
+ get(id: string): Promise<ApiIntent>;
261
+ submitSignature(id: string, signature: string[]): Promise<ApiIntent>;
262
+ confirm(id: string, txHash: string): Promise<ApiIntent>;
263
+ syncTransaction(txHash: string): Promise<ApiTxSyncResult>;
264
+ }
265
+
266
+ interface MetadataApi {
267
+ signedUrl(kind?: "image" | "document" | "media"): Promise<ApiResponse<ApiMetadataSignedUrl>>;
268
+ upload(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
269
+ uploadDirectory(files: {
270
+ name: string;
271
+ content: unknown;
272
+ }[]): Promise<{
273
+ cid: string;
274
+ baseUri: string;
275
+ }>;
276
+ resolve(uri: string): Promise<ApiResponse<unknown>>;
277
+ uploadFile(file: File): Promise<ApiResponse<ApiMetadataUpload>>;
278
+ }
279
+
280
+ interface CreatorsApi {
281
+ list(opts?: {
282
+ search?: string;
283
+ page?: number;
284
+ limit?: number;
285
+ }): Promise<ApiCreatorListResult>;
286
+ findProfile(walletAddress: string): Promise<ApiCreatorProfile | null>;
287
+ findByUsername(username: string): Promise<ApiCreatorProfile | null>;
288
+ updateProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>): Promise<ApiCreatorProfile>;
289
+ isHidden(wallet: string): Promise<boolean>;
290
+ myUsernameClaim(): Promise<{
291
+ username: string | null;
292
+ claim: ApiUsernameClaim | null;
293
+ }>;
294
+ usernameAvailability(username: string): Promise<{
295
+ available: boolean;
296
+ reason?: string;
297
+ }>;
298
+ submitUsernameClaim(username: string, notifyEmail?: string): Promise<ApiUsernameClaim>;
299
+ }
300
+
301
+ type ApiKeyAction = "replace_api_key" | "delete_api_key";
302
+ interface ApiKeyConfirmationInput {
303
+ action: ApiKeyAction;
304
+ /** For `delete_api_key`, the key's id; for `replace_api_key`, the current key's id, or `none`. */
305
+ key: string;
306
+ /** The account's public id. */
307
+ account: string;
308
+ /** Unix seconds. */
309
+ expiresAt: number;
310
+ }
311
+ /** What the account's wallet signs to approve one API key change. */
312
+ interface ApiKeyConfirmation {
313
+ expiresAt: number;
314
+ signature: string[];
315
+ }
316
+ declare function apiKeyConfirmationTypedData(input: ApiKeyConfirmationInput): TypedData;
317
+
318
+ interface FundingApi {
319
+ methods(): Promise<ApiFundingMethod[]>;
320
+ create(input: {
321
+ method: string;
322
+ params: Record<string, unknown>;
323
+ }): Promise<ApiFundingIntent>;
324
+ get(id: string): Promise<ApiFundingIntent>;
325
+ challenge(id: string, payer: string): Promise<{
326
+ typedData: unknown;
327
+ }>;
328
+ authorize(id: string, input: {
329
+ payer: string;
330
+ signature: string[];
331
+ }): Promise<{
332
+ instructions: ApiFundingInstructions;
333
+ }>;
334
+ submit(id: string, txHash: string): Promise<ApiFundingSubmit>;
335
+ cancel(id: string): Promise<{
336
+ status: string;
337
+ }>;
338
+ }
339
+ interface PortalApi {
340
+ me(): Promise<ApiPortalMe>;
341
+ apiKeys(): Promise<ApiPortalKey[]>;
342
+ createApiKey(input: {
343
+ label?: string;
344
+ } | undefined, confirmation: ApiKeyConfirmation): Promise<ApiPortalKeyCreated>;
345
+ deleteApiKey(id: string, confirmation: ApiKeyConfirmation): Promise<{
346
+ id: string;
347
+ }>;
348
+ creditHistory(): Promise<ApiCreditPayment[]>;
349
+ spend(): Promise<ApiPortalSpend>;
350
+ checkDeposit(txHash: string): Promise<{
351
+ deposits: number;
352
+ }>;
353
+ pricing(): Promise<ApiPricing>;
354
+ funding: FundingApi;
355
+ }
356
+
357
+ type ProvisioningResult = ApiResponse<ApiBusinessProvisioning> & {
358
+ reusedExistingWallet?: boolean;
359
+ };
360
+ interface BusinessApi {
361
+ emit(params: EmissionParams): Promise<ApiEmissionResult>;
362
+ registerProvisioning(params: z.input<typeof provisioningRegisterSchema>): Promise<ProvisioningResult>;
363
+ }
364
+
365
+ interface RemixApi {
366
+ submit(params: CreateRemixOfferParams): Promise<ApiRemixOffer>;
367
+ submitAuto(params: AutoRemixOfferParams): Promise<ApiRemixOffer>;
368
+ confirmSelf(params: ConfirmSelfRemixParams): Promise<ApiRemixOffer>;
369
+ list(query: ApiRemixOffersQuery): Promise<ApiResponse<ApiRemixOffer[]>>;
370
+ get(id: string): Promise<ApiRemixOffer>;
371
+ confirm(id: string, params: ConfirmRemixOfferParams): Promise<ApiRemixOffer>;
372
+ reject(id: string): Promise<ApiRemixOffer>;
373
+ extend(id: string, days: number): Promise<ApiRemixOffer>;
374
+ }
375
+
376
+ interface CoinsApi {
377
+ list(opts?: ApiCoinsQuery): Promise<ApiResponse<ApiCoin[]>>;
378
+ get(contract: string): Promise<ApiCoin>;
379
+ prices(): Promise<ApiCoinPrices>;
380
+ claim(coinAddress: string): Promise<ApiCoinClaimResult>;
381
+ claims(status?: string): Promise<ApiResponse<ApiCollectionClaim[]>>;
382
+ updateProfile(contract: string, data: {
383
+ image?: string | null;
384
+ description?: string | null;
385
+ }): Promise<ApiCoin>;
386
+ sync(coinAddress: string, owner?: string): Promise<ApiCoin>;
387
+ }
388
+
389
+ interface DropsApi {
390
+ fee(): Promise<ApiDropFee>;
391
+ list(query?: {
392
+ status?: ApiDropListStatus;
393
+ organizer?: string;
394
+ page?: number;
395
+ limit?: number;
396
+ }): Promise<ApiResponse<ApiDrop[]>>;
397
+ find(contract: string): Promise<ApiDrop | null>;
398
+ mints(contract: string, opts?: {
399
+ page?: number;
400
+ limit?: number;
401
+ }): Promise<ApiResponse<ApiDropMint[]>>;
402
+ }
403
+
404
+ interface SponsorshipApi {
405
+ offers(query?: ApiSponsorshipOffersQuery): Promise<ApiResponse<ApiSponsorshipOffer[]>>;
406
+ findOffer(offerId: string): Promise<ApiSponsorshipOffer | null>;
407
+ bids(offerId: string): Promise<ApiSponsorshipBid[]>;
408
+ proposals(query?: ApiSponsorshipProposalsQuery): Promise<ApiResponse<ApiSponsorshipProposal[]>>;
409
+ findProposal(proposalId: string): Promise<ApiSponsorshipProposal | null>;
410
+ licenses(query?: ApiSponsorshipLicensesQuery): Promise<ApiResponse<ApiSponsorshipLicense[]>>;
411
+ }
412
+
413
+ interface RewardsApi {
414
+ get(address: string): Promise<ApiUserRewards>;
415
+ leaderboard(opts?: {
416
+ page?: number;
417
+ limit?: number;
418
+ }): Promise<ApiResponse<ApiRewardsLeaderboardEntry[]>>;
419
+ events(address: string, opts?: {
420
+ page?: number;
421
+ limit?: number;
422
+ }): Promise<ApiResponse<ApiPointEvent[]>>;
423
+ config(): Promise<ApiRewardsConfig>;
424
+ batch(addresses: string[]): Promise<ApiRewardsBatchEntry[]>;
425
+ }
426
+
427
+ interface PlatformApi {
428
+ stats(): Promise<ApiPlatformStats>;
429
+ swapQuote(body: ApiSwapQuoteRequest): Promise<ApiSwapQuote>;
430
+ submitReport(report: ApiSubmitReport): Promise<void>;
431
+ }
432
+
433
+ interface CreateCreatorCoinParams {
434
+ owner: string;
435
+ name: string;
436
+ symbol: string;
437
+ initialSupply: bigint | string;
438
+ salt?: bigint | string;
439
+ }
440
+ interface EkuboPoolParams {
441
+ fee: bigint | string;
442
+ tickSpacing: bigint | string;
443
+ startingPrice: {
444
+ mag: bigint | string;
445
+ sign: boolean;
446
+ };
447
+ bound: bigint | string;
448
+ }
449
+ interface EkuboLaunchParams {
450
+ creatorCoin: string;
451
+ quoteToken: string;
452
+ initialHolders: string[];
453
+ initialHoldersAmounts: (bigint | string)[];
454
+ transferRestrictionDelay?: number;
455
+ maxPercentageBuyLaunch?: number;
456
+ ekubo: EkuboPoolParams;
457
+ quoteFundAmount?: bigint | string;
458
+ }
459
+ declare const VALIDATED_EKUBO_PARAMS: EkuboPoolParams;
460
+ declare function priceToEkuboParams(quoteDecimals: number, price?: number): EkuboPoolParams;
461
+ declare function validatePrice(quoteDecimals: number, price: number): string | null;
462
+ declare const MAX_TEAM_ALLOCATION_PERCENT = 10;
463
+ declare const MAX_HOLDERS_AT_LAUNCH = 10;
464
+ interface CreatorCoinGuarantees {
465
+ isLaunched: boolean;
466
+ launchedAtBlock: number | null;
467
+ totalSupplyRaw: string;
468
+ teamAllocationRaw: string;
469
+ teamAllocationPercent: number | null;
470
+ liquidityPositionId: string | null;
471
+ }
472
+ declare function getCreatorCoinGuarantees(coinAddress: string, provider: ProviderInterface): Promise<CreatorCoinGuarantees | null>;
473
+ declare function buildCreateCreatorCoinCall(params: CreateCreatorCoinParams): Call;
474
+ declare function buildLaunchOnEkuboCalls(params: EkuboLaunchParams): Call[];
475
+ interface CreatorCoinReceiptLike {
476
+ events?: Array<{
477
+ from_address?: string;
478
+ keys?: string[];
479
+ data?: string[];
480
+ }>;
481
+ }
482
+ declare function parseCreatorCoinCreated(receipt: CreatorCoinReceiptLike): string;
483
+ declare function isCreatorCoin(provider: Pick<ProviderInterface, "callContract">, address: string): Promise<boolean>;
484
+
485
+ interface PopAllowlist {
486
+ /** Merkle root to publish with `set_allowlist_root`. */
487
+ root: string;
488
+ /** Proof per address, keyed by normalized Starknet address. */
489
+ proofs: Record<string, string[]>;
490
+ }
491
+ declare function buildPopAllowlist(addresses: string[]): PopAllowlist;
492
+ /** True when `proof` places `address` under `root` — checked before sending a claim. */
493
+ declare function verifyPopProof(root: string, address: string, proof: string[]): boolean;
494
+ declare function encodePopClaimFragment(proof: string[]): string;
495
+ /** The proof in a claim link's fragment; `null` when absent or malformed. */
496
+ declare function decodePopClaimFragment(fragment: string): string[] | null;
497
+
498
+ interface PopClaimLink {
499
+ address: string;
500
+ url: string;
501
+ }
502
+ /** One claim link per allowlisted address: the collection page with the proof in its fragment. */
503
+ declare function popClaimLinks(origin: string, collection: string, list: PopAllowlist): PopClaimLink[];
504
+ declare function popClaimLinksCsv(links: PopClaimLink[]): string;
505
+ interface PopClaimInfo {
506
+ /** Allowlist Merkle root; 0 when claims are closed. */
507
+ root: string;
508
+ /** Unix seconds; 0 = no deadline. */
509
+ claimEndTime: number;
510
+ }
511
+ /** Reads a collection's allowlist root and claim deadline from chain. */
512
+ declare function popClaimInfo(provider: Pick<ProviderInterface, "callContract">, collection: string): Promise<PopClaimInfo>;
513
+ type PopClaimState = "loading" | "claimed" | "closed" | "ended" | "no-link" | "wrong-wallet" | "ready";
514
+ /** What a claim page should show, decided before any transaction is sent. */
515
+ declare function popClaimState(input: {
516
+ hasClaimed: boolean | null;
517
+ proof: string[] | null;
518
+ wallet: string | null;
519
+ /** The collection's claim settings, with `now` in Unix seconds. */
520
+ info: (PopClaimInfo & {
521
+ now: number;
522
+ }) | null;
523
+ }): PopClaimState;
524
+ /** Calls on a POP collection, ready for `account.execute` or a sponsored transaction. */
525
+ declare const popCalls: {
526
+ claim(collection: string, proof: string[]): Call;
527
+ /** An empty `tokenUri` uses the collection's URI. */
528
+ issue(collection: string, recipient: string, tokenUri?: string): Call;
529
+ /** Only the token's holder can burn it. */
530
+ burn(collection: string, tokenId: string | bigint): Call;
531
+ setAllowlistRoot(collection: string, root: string): Call;
532
+ };
533
+ /** Whether `address` already holds this collection's credential (read from chain). */
534
+ declare function popHasClaimed(provider: Pick<ProviderInterface, "callContract">, collection: string, address: string): Promise<boolean>;
535
+
536
+ interface DropOnchain {
537
+ organizer: string;
538
+ /** Unix seconds; 0 = open from creation. */
539
+ startTime: number;
540
+ /** Unix seconds; 0 = never closes. */
541
+ endTime: number;
542
+ price: bigint;
543
+ paymentToken: string;
544
+ /** 0 = unlimited. */
545
+ maxPerWallet: bigint;
546
+ /** 0x0 = open to everyone. */
547
+ allowlistRoot: string;
548
+ /** 0 = no cap. */
549
+ maxSupply: bigint;
550
+ totalMinted: bigint;
551
+ }
552
+ /** A drop's organizer, terms, allowlist root and supply, read from chain. */
553
+ declare function readDrop(provider: Pick<ProviderInterface, "callContract">, collection: string): Promise<DropOnchain>;
554
+ /** Approve, claim and the platform fee for `quantity` tokens, priced from the drop's terms on chain. */
555
+ declare function buildDropClaimCalls(provider: Pick<ProviderInterface, "callContract">, collection: string, input: {
556
+ quantity: bigint | string | number;
557
+ proof?: string[];
558
+ }, feeConfig: ResolvedFeeConfig): Promise<Call[]>;
559
+ /** How many tokens `wallet` has claimed from this drop (gifts not included). */
560
+ declare function dropClaimedBy(provider: Pick<ProviderInterface, "callContract">, collection: string, wallet: string): Promise<bigint>;
561
+ type DropMintStateKind = "loading" | "upcoming" | "ended" | "sold-out" | "no-wallet" | "no-link" | "not-on-list" | "limit-reached" | "insufficient-balance" | "ready";
562
+ interface DropMintState {
563
+ state: DropMintStateKind;
564
+ /** Largest quantity this wallet can claim now; 0 unless `ready`. */
565
+ maxQuantity: bigint;
566
+ }
567
+ /** What the mint button should show, decided before any transaction is sent. */
568
+ declare function dropMintState(input: {
569
+ drop: DropOnchain | null;
570
+ wallet: string | null;
571
+ /** `claimed_by(wallet)`; null while loading. */
572
+ claimed: bigint | null;
573
+ /** From the claim link; null when the page was opened without one. */
574
+ proof: string[] | null;
575
+ /** Wallet balance of the payment token; null while loading (ignored for free drops). */
576
+ balance: bigint | null;
577
+ /** Platform fee added to a mint, in basis points. */
578
+ feeBps: number;
579
+ /** Unix seconds. */
580
+ now: number;
581
+ }): DropMintState;
582
+ /** One claim link per allowlisted address: the drop page with the proof in its fragment. */
583
+ declare function dropClaimLinks(origin: string, collection: string, list: PopAllowlist): PopClaimLink[];
584
+
585
+ interface ChainReadsApi {
586
+ ticket(contract: string, tokenId: string): Promise<ApiTierOnchain>;
587
+ ticketCount(contract: string): Promise<number>;
588
+ clubMembershipCount(contract: string): Promise<number>;
589
+ clubMembership(contract: string, tokenId: string): Promise<ApiTierOnchain>;
590
+ isClubMember(contract: string, tokenId: string, wallet: string): Promise<boolean>;
591
+ ipNftTokenData(contract: string, tokenId: string): Promise<ApiIpNftTokenData | null>;
592
+ coinGuarantees(contract: string): Promise<CreatorCoinGuarantees | null>;
593
+ popClaimInfo(collection: string): Promise<PopClaimInfo | null>;
594
+ dropState(contract: string): Promise<DropOnchain | null>;
595
+ }
596
+
597
+ type ApiClientOptions = TransportOptions;
598
+ declare class ApiClient {
599
+ private readonly transport;
600
+ readonly orders: OrdersApi;
601
+ readonly tokens: TokensApi;
602
+ readonly collections: CollectionsApi;
603
+ readonly activity: ActivityApi;
604
+ readonly search: SearchApi;
605
+ readonly intents: IntentsApi;
606
+ readonly metadata: MetadataApi;
607
+ readonly creators: CreatorsApi;
608
+ readonly account: AccountApi;
609
+ readonly portal: PortalApi;
610
+ readonly business: BusinessApi;
611
+ readonly remix: RemixApi;
612
+ readonly coins: CoinsApi;
613
+ readonly drops: DropsApi;
614
+ readonly sponsorship: SponsorshipApi;
615
+ readonly rewards: RewardsApi;
616
+ readonly platform: PlatformApi;
617
+ readonly chainReads: ChainReadsApi;
618
+ constructor(options: ApiClientOptions);
619
+ withBearer(bearer: BearerSource | undefined): ApiClient;
620
+ }
621
+
622
+ interface CreatePopCollectionParams {
623
+ name: string;
624
+ symbol: string;
625
+ baseUri: string;
626
+ /** Unix seconds; 0 = no deadline. */
627
+ claimEndTime: number;
628
+ }
629
+ interface DropTerms {
630
+ /** Unix seconds; 0 = open from creation. */
631
+ startTime: number;
632
+ /** Unix seconds; 0 = never closes. */
633
+ endTime: number;
634
+ /** Per token, in the payment token's smallest unit; 0 = free. */
635
+ price: bigint | string;
636
+ /** Sent as zero when the drop is free. */
637
+ paymentToken: string;
638
+ /** Claims per wallet; 0 = unlimited. */
639
+ maxPerWallet: bigint | string;
640
+ }
641
+ interface CreateDropParams {
642
+ name: string;
643
+ symbol: string;
644
+ /** Token URI = baseUri + token id. */
645
+ baseUri: string;
646
+ /** 0 = no cap. */
647
+ maxSupply: bigint | string;
648
+ terms: DropTerms;
649
+ /** Merkle root of the allowlist; absent or 0 = open to everyone. */
650
+ allowlistRoot?: string;
651
+ }
652
+ interface CreateTicketParams {
653
+ collection: string;
654
+ maxSupply: bigint | string;
655
+ startTime?: number;
656
+ endTime?: number;
657
+ royaltyBps: number;
658
+ metadataUri: string;
659
+ }
660
+ interface MintTicketsParams {
661
+ collection: string;
662
+ tokenId: bigint | string;
663
+ to: string;
664
+ amount: bigint | string;
665
+ }
666
+ interface CreateMembershipParams {
667
+ collection: string;
668
+ maxSupply: bigint | string;
669
+ startTime?: number;
670
+ endTime?: number;
671
+ royaltyBps: number;
672
+ metadataUri: string;
673
+ }
674
+ interface MintMembershipsParams {
675
+ collection: string;
676
+ tokenId: bigint | string;
677
+ to: string;
678
+ amount: bigint | string;
679
+ }
680
+ interface CreateSponsorshipOfferParams {
681
+ nftContract: string;
682
+ tokenId: bigint | string;
683
+ minAmount: bigint | string;
684
+ duration: number;
685
+ paymentToken: string;
686
+ licenseTermsUri: string;
687
+ transferable: boolean;
688
+ royaltyBps: bigint | string;
689
+ specificSponsor?: string;
690
+ }
691
+ interface ProposeSponsorshipParams {
692
+ nftContract: string;
693
+ tokenId: bigint | string;
694
+ amount: bigint | string;
695
+ duration: number;
696
+ validUntil?: number;
697
+ paymentToken: string;
698
+ licenseTermsUri: string;
699
+ transferable: boolean;
700
+ royaltyBps: bigint | string;
701
+ }
702
+ interface DeployCollectionParams {
703
+ name: string;
704
+ symbol: string;
705
+ baseUri: string;
706
+ }
707
+ interface MintEditionParams {
708
+ collection: string;
709
+ to: string;
710
+ value: bigint | string;
711
+ tokenUri: string;
712
+ }
713
+ interface BatchMintEditionParams {
714
+ collection: string;
715
+ to: string;
716
+ items: Array<{
717
+ value: bigint | string;
718
+ tokenUri: string;
719
+ }>;
720
+ }
721
+ interface AddSupplyParams {
722
+ collection: string;
723
+ to: string;
724
+ tokenId: bigint | string;
725
+ value: bigint | string;
726
+ }
727
+
728
+ export { type DropMintState as $, type ActivityApi as A, type BatchMintEditionParams as B, type ChainReadsApi as C, type DeployCollectionParams as D, type ResolvedConfig as E, type FeeConfig as F, type GatedContent as G, type ResolvedFeeConfig as H, type IntentsApi as I, type RetryOptions as J, type RewardsApi as K, type SponsorshipApi as L, MedialaneApiError as M, resolveConfig as N, type OrdersApi as O, type PlatformApi as P, resolveFeeConfig as Q, type RemixApi as R, type SearchApi as S, type TokensApi as T, UserFacingError as U, type ApiKeyAction as V, type ApiKeyConfirmation as W, type ApiKeyConfirmationInput as X, type CreateCreatorCoinParams as Y, type CreatorCoinGuarantees as Z, type CreatorCoinReceiptLike as _, type AddSupplyParams as a, type DropMintStateKind as a0, type DropOnchain as a1, type EkuboLaunchParams as a2, type EkuboPoolParams as a3, MAX_HOLDERS_AT_LAUNCH as a4, MAX_TEAM_ALLOCATION_PERCENT as a5, type PopAllowlist as a6, type PopClaimInfo as a7, type PopClaimLink as a8, type PopClaimState as a9, VALIDATED_EKUBO_PARAMS as aa, apiKeyConfirmationTypedData as ab, buildCreateCreatorCoinCall as ac, buildDropClaimCalls as ad, buildLaunchOnEkuboCalls as ae, buildPopAllowlist as af, decodePopClaimFragment as ag, dropClaimLinks as ah, dropClaimedBy as ai, dropMintState as aj, encodePopClaimFragment as ak, getCreatorCoinGuarantees as al, isCreatorCoin as am, parseCreatorCoinCreated as an, popCalls as ao, popClaimInfo as ap, popClaimLinks as aq, popClaimLinksCsv as ar, popClaimState as as, popHasClaimed as at, priceToEkuboParams as au, readDrop as av, validatePrice as aw, verifyPopProof as ax, ApiClient as b, type ApiClientOptions as c, type BearerSource as d, type BusinessApi as e, type CoinsApi as f, type CollectionsApi as g, type CreateDropParams as h, type CreateMembershipParams as i, type CreatePopCollectionParams as j, type CreateSponsorshipOfferParams as k, type CreateTicketParams as l, type CreatorsApi as m, type DropTerms as n, type DropsApi as o, type FundingApi as p, type MedialaneConfig as q, MedialaneError as r, type MedialaneErrorCode as s, type MetadataApi as t, type MintEditionParams as u, type MintMembershipsParams as v, type MintTicketsParams as w, type PortalApi as x, type ProposeSponsorshipParams as y, type ProvisioningResult as z };