@medialane/sdk 0.5.7 → 0.6.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/dist/index.d.cts CHANGED
@@ -33,6 +33,8 @@ type SupportedTokenSymbol = (typeof SUPPORTED_TOKENS)[number]["symbol"];
33
33
  declare const SUPPORTED_NETWORKS: readonly ["mainnet", "sepolia"];
34
34
  type Network = (typeof SUPPORTED_NETWORKS)[number];
35
35
  declare const DEFAULT_RPC_URLS: Record<Network, string>;
36
+ declare const POP_FACTORY_CONTRACT_MAINNET = "0x00b32c34b427d8f346b5843ada6a37bd3368d879fc752cd52b68a87287f60111";
37
+ declare const POP_COLLECTION_CLASS_HASH_MAINNET = "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
36
38
 
37
39
  interface RetryOptions {
38
40
  maxAttempts?: number;
@@ -205,12 +207,14 @@ declare class MarketplaceModule {
205
207
 
206
208
  type IPType = "Audio" | "Art" | "Documents" | "NFT" | "Video" | "Photography" | "Patents" | "Posts" | "Publications" | "RWA" | "Software" | "Custom";
207
209
  type CollectionSort = "recent" | "supply" | "floor" | "volume" | "name";
210
+ type CollectionSource = "MEDIALANE_REGISTRY" | "EXTERNAL" | "PARTNERSHIP" | "IP_TICKET" | "IP_CLUB" | "GAME" | "POP_PROTOCOL";
208
211
  interface ApiCollectionsQuery {
209
212
  page?: number;
210
213
  limit?: number;
211
214
  isKnown?: boolean;
212
215
  sort?: CollectionSort;
213
216
  owner?: string;
217
+ source?: CollectionSource;
214
218
  }
215
219
  type OrderStatus = "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED" | "COUNTER_OFFERED";
216
220
  type SortOrder = "price_asc" | "price_desc" | "recent";
@@ -371,7 +375,7 @@ interface ApiCollection {
371
375
  startBlock: string;
372
376
  metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
373
377
  isKnown: boolean;
374
- source: "MEDIALANE_REGISTRY" | "EXTERNAL" | "PARTNERSHIP" | "IP_TICKET" | "IP_CLUB" | "GAME";
378
+ source: "MEDIALANE_REGISTRY" | "EXTERNAL" | "PARTNERSHIP" | "IP_TICKET" | "IP_CLUB" | "GAME" | "POP_PROTOCOL";
375
379
  claimedBy: string | null;
376
380
  profile?: ApiCollectionProfile | null;
377
381
  floorPrice: string | null;
@@ -727,6 +731,15 @@ interface ApiAdminCollectionClaim extends ApiCollectionClaim {
727
731
  reviewedAt: string | null;
728
732
  updatedAt: string;
729
733
  }
734
+ interface PopClaimStatus {
735
+ isEligible: boolean;
736
+ hasClaimed: boolean;
737
+ tokenId: string | null;
738
+ }
739
+ interface PopBatchEligibilityItem extends PopClaimStatus {
740
+ wallet: string;
741
+ }
742
+ type PopEventType = "Conference" | "Bootcamp" | "Workshop" | "Hackathon" | "Meetup" | "Course" | "Other";
730
743
 
731
744
  declare class MedialaneApiError extends Error {
732
745
  readonly status: number;
@@ -750,7 +763,7 @@ declare class ApiClient {
750
763
  getToken(contract: string, tokenId: string, wait?: boolean): Promise<ApiResponse<ApiToken>>;
751
764
  getTokensByOwner(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiToken[]>>;
752
765
  getTokenHistory(contract: string, tokenId: string, page?: number, limit?: number): Promise<ApiResponse<ApiActivity[]>>;
753
- getCollections(page?: number, limit?: number, isKnown?: boolean, sort?: CollectionSort): Promise<ApiResponse<ApiCollection[]>>;
766
+ getCollections(page?: number, limit?: number, isKnown?: boolean, sort?: CollectionSort, source?: CollectionSource): Promise<ApiResponse<ApiCollection[]>>;
754
767
  getCollectionsByOwner(owner: string, page?: number, limit?: number): Promise<ApiResponse<ApiCollection[]>>;
755
768
  getCollection(contract: string): Promise<ApiResponse<ApiCollection>>;
756
769
  getCollectionTokens(contract: string, page?: number, limit?: number): Promise<ApiResponse<ApiToken[]>>;
@@ -826,6 +839,11 @@ declare class ApiClient {
826
839
  * Update collection profile. Requires Clerk JWT for ownership check.
827
840
  */
828
841
  updateCollectionProfile(contractAddress: string, data: Partial<Omit<ApiCollectionProfile, "contractAddress" | "chain" | "updatedBy" | "updatedAt">>, clerkToken: string): Promise<ApiCollectionProfile>;
842
+ getGatedContent(contractAddress: string, clerkToken: string): Promise<{
843
+ title: string;
844
+ url: string;
845
+ type: string;
846
+ } | null>;
829
847
  /** List all creators with an approved username. */
830
848
  getCreators(opts?: {
831
849
  search?: string;
@@ -893,6 +911,53 @@ declare class ApiClient {
893
911
  * Requires Clerk JWT.
894
912
  */
895
913
  extendRemixOffer(id: string, days: number, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
914
+ getPopCollections(opts?: {
915
+ page?: number;
916
+ limit?: number;
917
+ sort?: CollectionSort;
918
+ }): Promise<ApiResponse<ApiCollection[]>>;
919
+ getPopEligibility(collection: string, wallet: string): Promise<PopClaimStatus>;
920
+ getPopEligibilityBatch(collection: string, wallets: string[]): Promise<PopBatchEligibilityItem[]>;
921
+ }
922
+
923
+ interface CreatePopCollectionParams {
924
+ name: string;
925
+ symbol: string;
926
+ baseUri: string;
927
+ claimEndTime: number;
928
+ eventType: PopEventType;
929
+ }
930
+ declare class PopService {
931
+ private readonly factoryAddress;
932
+ constructor(_config: ResolvedConfig);
933
+ claim(account: AccountInterface, collectionAddress: string): Promise<TxResult>;
934
+ adminMint(account: AccountInterface, params: {
935
+ collection: string;
936
+ recipient: string;
937
+ customUri?: string;
938
+ }): Promise<TxResult>;
939
+ addToAllowlist(account: AccountInterface, params: {
940
+ collection: string;
941
+ address: string;
942
+ }): Promise<TxResult>;
943
+ batchAddToAllowlist(account: AccountInterface, params: {
944
+ collection: string;
945
+ addresses: string[];
946
+ }): Promise<TxResult>;
947
+ removeFromAllowlist(account: AccountInterface, params: {
948
+ collection: string;
949
+ address: string;
950
+ }): Promise<TxResult>;
951
+ setTokenUri(account: AccountInterface, params: {
952
+ collection: string;
953
+ tokenId: string | bigint;
954
+ uri: string;
955
+ }): Promise<TxResult>;
956
+ setPaused(account: AccountInterface, params: {
957
+ collection: string;
958
+ paused: boolean;
959
+ }): Promise<TxResult>;
960
+ createCollection(account: AccountInterface, params: CreatePopCollectionParams): Promise<TxResult>;
896
961
  }
897
962
 
898
963
  declare class MedialaneClient {
@@ -903,6 +968,9 @@ declare class MedialaneClient {
903
968
  * Requires `backendUrl` in config; pass `apiKey` for authenticated routes.
904
969
  */
905
970
  readonly api: ApiClient;
971
+ readonly services: {
972
+ readonly pop: PopService;
973
+ };
906
974
  private readonly config;
907
975
  constructor(rawConfig?: MedialaneConfig);
908
976
  get network(): "mainnet" | "sepolia";
@@ -1279,6 +1347,202 @@ declare const IPMarketplaceABI: readonly [{
1279
1347
  readonly kind: "nested";
1280
1348
  }];
1281
1349
  }];
1350
+ declare const POPCollectionABI: readonly [{
1351
+ readonly type: "struct";
1352
+ readonly name: "core::byte_array::ByteArray";
1353
+ readonly members: readonly [{
1354
+ readonly name: "data";
1355
+ readonly type: "core::array::Array::<core::felt252>";
1356
+ }, {
1357
+ readonly name: "pending_word";
1358
+ readonly type: "core::felt252";
1359
+ }, {
1360
+ readonly name: "pending_word_len";
1361
+ readonly type: "core::integer::u32";
1362
+ }];
1363
+ }, {
1364
+ readonly type: "function";
1365
+ readonly name: "claim";
1366
+ readonly inputs: readonly [];
1367
+ readonly outputs: readonly [];
1368
+ readonly state_mutability: "external";
1369
+ }, {
1370
+ readonly type: "function";
1371
+ readonly name: "admin_mint";
1372
+ readonly inputs: readonly [{
1373
+ readonly name: "recipient";
1374
+ readonly type: "core::starknet::contract_address::ContractAddress";
1375
+ }, {
1376
+ readonly name: "custom_uri";
1377
+ readonly type: "core::byte_array::ByteArray";
1378
+ }];
1379
+ readonly outputs: readonly [];
1380
+ readonly state_mutability: "external";
1381
+ }, {
1382
+ readonly type: "function";
1383
+ readonly name: "add_to_allowlist";
1384
+ readonly inputs: readonly [{
1385
+ readonly name: "address";
1386
+ readonly type: "core::starknet::contract_address::ContractAddress";
1387
+ }];
1388
+ readonly outputs: readonly [];
1389
+ readonly state_mutability: "external";
1390
+ }, {
1391
+ readonly type: "function";
1392
+ readonly name: "batch_add_to_allowlist";
1393
+ readonly inputs: readonly [{
1394
+ readonly name: "addresses";
1395
+ readonly type: "core::array::Array::<core::starknet::contract_address::ContractAddress>";
1396
+ }];
1397
+ readonly outputs: readonly [];
1398
+ readonly state_mutability: "external";
1399
+ }, {
1400
+ readonly type: "function";
1401
+ readonly name: "remove_from_allowlist";
1402
+ readonly inputs: readonly [{
1403
+ readonly name: "address";
1404
+ readonly type: "core::starknet::contract_address::ContractAddress";
1405
+ }];
1406
+ readonly outputs: readonly [];
1407
+ readonly state_mutability: "external";
1408
+ }, {
1409
+ readonly type: "function";
1410
+ readonly name: "set_token_uri";
1411
+ readonly inputs: readonly [{
1412
+ readonly name: "token_id";
1413
+ readonly type: "core::integer::u256";
1414
+ }, {
1415
+ readonly name: "uri";
1416
+ readonly type: "core::byte_array::ByteArray";
1417
+ }];
1418
+ readonly outputs: readonly [];
1419
+ readonly state_mutability: "external";
1420
+ }, {
1421
+ readonly type: "function";
1422
+ readonly name: "set_paused";
1423
+ readonly inputs: readonly [{
1424
+ readonly name: "paused";
1425
+ readonly type: "core::bool";
1426
+ }];
1427
+ readonly outputs: readonly [];
1428
+ readonly state_mutability: "external";
1429
+ }, {
1430
+ readonly type: "function";
1431
+ readonly name: "is_eligible";
1432
+ readonly inputs: readonly [{
1433
+ readonly name: "address";
1434
+ readonly type: "core::starknet::contract_address::ContractAddress";
1435
+ }];
1436
+ readonly outputs: readonly [{
1437
+ readonly type: "core::bool";
1438
+ }];
1439
+ readonly state_mutability: "view";
1440
+ }, {
1441
+ readonly type: "function";
1442
+ readonly name: "has_claimed";
1443
+ readonly inputs: readonly [{
1444
+ readonly name: "address";
1445
+ readonly type: "core::starknet::contract_address::ContractAddress";
1446
+ }];
1447
+ readonly outputs: readonly [{
1448
+ readonly type: "core::bool";
1449
+ }];
1450
+ readonly state_mutability: "view";
1451
+ }, {
1452
+ readonly type: "function";
1453
+ readonly name: "total_minted";
1454
+ readonly inputs: readonly [];
1455
+ readonly outputs: readonly [{
1456
+ readonly type: "core::integer::u256";
1457
+ }];
1458
+ readonly state_mutability: "view";
1459
+ }];
1460
+ declare const POPFactoryABI: readonly [{
1461
+ readonly type: "struct";
1462
+ readonly name: "core::byte_array::ByteArray";
1463
+ readonly members: readonly [{
1464
+ readonly name: "data";
1465
+ readonly type: "core::array::Array::<core::felt252>";
1466
+ }, {
1467
+ readonly name: "pending_word";
1468
+ readonly type: "core::felt252";
1469
+ }, {
1470
+ readonly name: "pending_word_len";
1471
+ readonly type: "core::integer::u32";
1472
+ }];
1473
+ }, {
1474
+ readonly type: "enum";
1475
+ readonly name: "pop_protocol::types::EventType";
1476
+ readonly variants: readonly [{
1477
+ readonly name: "Conference";
1478
+ readonly type: "()";
1479
+ }, {
1480
+ readonly name: "Bootcamp";
1481
+ readonly type: "()";
1482
+ }, {
1483
+ readonly name: "Workshop";
1484
+ readonly type: "()";
1485
+ }, {
1486
+ readonly name: "Hackathon";
1487
+ readonly type: "()";
1488
+ }, {
1489
+ readonly name: "Meetup";
1490
+ readonly type: "()";
1491
+ }, {
1492
+ readonly name: "Course";
1493
+ readonly type: "()";
1494
+ }, {
1495
+ readonly name: "Other";
1496
+ readonly type: "()";
1497
+ }];
1498
+ }, {
1499
+ readonly type: "function";
1500
+ readonly name: "create_collection";
1501
+ readonly inputs: readonly [{
1502
+ readonly name: "name";
1503
+ readonly type: "core::byte_array::ByteArray";
1504
+ }, {
1505
+ readonly name: "symbol";
1506
+ readonly type: "core::byte_array::ByteArray";
1507
+ }, {
1508
+ readonly name: "base_uri";
1509
+ readonly type: "core::byte_array::ByteArray";
1510
+ }, {
1511
+ readonly name: "claim_end_time";
1512
+ readonly type: "core::integer::u64";
1513
+ }, {
1514
+ readonly name: "event_type";
1515
+ readonly type: "pop_protocol::types::EventType";
1516
+ }];
1517
+ readonly outputs: readonly [{
1518
+ readonly type: "core::starknet::contract_address::ContractAddress";
1519
+ }];
1520
+ readonly state_mutability: "external";
1521
+ }, {
1522
+ readonly type: "function";
1523
+ readonly name: "register_provider";
1524
+ readonly inputs: readonly [{
1525
+ readonly name: "provider";
1526
+ readonly type: "core::starknet::contract_address::ContractAddress";
1527
+ }, {
1528
+ readonly name: "name";
1529
+ readonly type: "core::byte_array::ByteArray";
1530
+ }, {
1531
+ readonly name: "website_url";
1532
+ readonly type: "core::byte_array::ByteArray";
1533
+ }];
1534
+ readonly outputs: readonly [];
1535
+ readonly state_mutability: "external";
1536
+ }, {
1537
+ readonly type: "function";
1538
+ readonly name: "set_pop_collection_class_hash";
1539
+ readonly inputs: readonly [{
1540
+ readonly name: "new_class_hash";
1541
+ readonly type: "core::starknet::class_hash::ClassHash";
1542
+ }];
1543
+ readonly outputs: readonly [];
1544
+ readonly state_mutability: "external";
1545
+ }];
1282
1546
 
1283
1547
  /**
1284
1548
  * Normalize a Starknet address to a 0x-prefixed 64-character hex string.
@@ -1340,4 +1604,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
1340
1604
  */
1341
1605
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
1342
1606
 
1343
- export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderParameters, type OrderStatus, type RemixOfferStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
1607
+ export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type CollectionSource, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IPType, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };