@medialane/sdk 0.4.4 → 0.4.6

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
@@ -418,9 +418,17 @@ interface ApiSearchCollectionResult {
418
418
  floorPrice: string | null;
419
419
  holderCount: number | null;
420
420
  }
421
+ interface ApiSearchCreatorResult {
422
+ walletAddress: string;
423
+ username: string | null;
424
+ displayName: string | null;
425
+ bio: string | null;
426
+ avatarImage: string | null;
427
+ }
421
428
  interface ApiSearchResult {
422
429
  tokens: ApiSearchTokenResult[];
423
430
  collections: ApiSearchCollectionResult[];
431
+ creators: ApiSearchCreatorResult[];
424
432
  }
425
433
  interface ApiIntent {
426
434
  id: string;
@@ -574,6 +582,9 @@ interface ApiCreatorListResult {
574
582
  page: number;
575
583
  limit: number;
576
584
  }
585
+ interface ApiUserWallet {
586
+ walletAddress: string;
587
+ }
577
588
  interface ApiCollectionClaim {
578
589
  id: string;
579
590
  contractAddress: string;
@@ -687,6 +698,18 @@ declare class ApiClient {
687
698
  * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
688
699
  */
689
700
  updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
701
+ /**
702
+ * Upsert the authenticated user's wallet address in the backend DB.
703
+ * Call after onboarding when ChipiPay confirms the wallet address.
704
+ * Requires Clerk JWT; no tenant API key needed.
705
+ */
706
+ upsertMyWallet(clerkToken: string): Promise<ApiUserWallet>;
707
+ /**
708
+ * Get the authenticated user's stored wallet address from the backend DB.
709
+ * Returns null if the user has not completed onboarding yet.
710
+ * Requires Clerk JWT; no tenant API key needed.
711
+ */
712
+ getMyWallet(clerkToken: string): Promise<ApiUserWallet | null>;
690
713
  }
691
714
 
692
715
  declare class MedialaneClient {
@@ -1134,4 +1157,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
1134
1157
  */
1135
1158
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
1136
1159
 
1137
- export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, 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 ApiResponse, type ApiSearchCollectionResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, 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, type OfferItem, type Order, type OrderParameters, type OrderStatus, 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 };
1160
+ export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, 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 ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, 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, type OfferItem, type Order, type OrderParameters, type OrderStatus, 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 };
package/dist/index.d.ts CHANGED
@@ -418,9 +418,17 @@ interface ApiSearchCollectionResult {
418
418
  floorPrice: string | null;
419
419
  holderCount: number | null;
420
420
  }
421
+ interface ApiSearchCreatorResult {
422
+ walletAddress: string;
423
+ username: string | null;
424
+ displayName: string | null;
425
+ bio: string | null;
426
+ avatarImage: string | null;
427
+ }
421
428
  interface ApiSearchResult {
422
429
  tokens: ApiSearchTokenResult[];
423
430
  collections: ApiSearchCollectionResult[];
431
+ creators: ApiSearchCreatorResult[];
424
432
  }
425
433
  interface ApiIntent {
426
434
  id: string;
@@ -574,6 +582,9 @@ interface ApiCreatorListResult {
574
582
  page: number;
575
583
  limit: number;
576
584
  }
585
+ interface ApiUserWallet {
586
+ walletAddress: string;
587
+ }
577
588
  interface ApiCollectionClaim {
578
589
  id: string;
579
590
  contractAddress: string;
@@ -687,6 +698,18 @@ declare class ApiClient {
687
698
  * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
688
699
  */
689
700
  updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
701
+ /**
702
+ * Upsert the authenticated user's wallet address in the backend DB.
703
+ * Call after onboarding when ChipiPay confirms the wallet address.
704
+ * Requires Clerk JWT; no tenant API key needed.
705
+ */
706
+ upsertMyWallet(clerkToken: string): Promise<ApiUserWallet>;
707
+ /**
708
+ * Get the authenticated user's stored wallet address from the backend DB.
709
+ * Returns null if the user has not completed onboarding yet.
710
+ * Requires Clerk JWT; no tenant API key needed.
711
+ */
712
+ getMyWallet(clerkToken: string): Promise<ApiUserWallet | null>;
690
713
  }
691
714
 
692
715
  declare class MedialaneClient {
@@ -1134,4 +1157,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
1134
1157
  */
1135
1158
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
1136
1159
 
1137
- export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, 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 ApiResponse, type ApiSearchCollectionResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, 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, type OfferItem, type Order, type OrderParameters, type OrderStatus, 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 };
1160
+ export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, 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 ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, 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, type OfferItem, type Order, type OrderParameters, type OrderStatus, 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 };
package/dist/index.js CHANGED
@@ -1271,6 +1271,36 @@ var ApiClient = class {
1271
1271
  });
1272
1272
  return res.json();
1273
1273
  }
1274
+ // ─── User Wallet ─────────────────────────────────────────────────────────────
1275
+ /**
1276
+ * Upsert the authenticated user's wallet address in the backend DB.
1277
+ * Call after onboarding when ChipiPay confirms the wallet address.
1278
+ * Requires Clerk JWT; no tenant API key needed.
1279
+ */
1280
+ async upsertMyWallet(clerkToken) {
1281
+ const url = `${this.baseUrl.replace(/\/$/, "")}/v1/users/me`;
1282
+ const res = await fetch(url, {
1283
+ method: "POST",
1284
+ headers: {
1285
+ "Content-Type": "application/json",
1286
+ "Authorization": `Bearer ${clerkToken}`
1287
+ }
1288
+ });
1289
+ return res.json();
1290
+ }
1291
+ /**
1292
+ * Get the authenticated user's stored wallet address from the backend DB.
1293
+ * Returns null if the user has not completed onboarding yet.
1294
+ * Requires Clerk JWT; no tenant API key needed.
1295
+ */
1296
+ async getMyWallet(clerkToken) {
1297
+ const url = `${this.baseUrl.replace(/\/$/, "")}/v1/users/me`;
1298
+ const res = await fetch(url, {
1299
+ headers: { "Authorization": `Bearer ${clerkToken}` }
1300
+ });
1301
+ if (res.status === 404) return null;
1302
+ return res.json();
1303
+ }
1274
1304
  };
1275
1305
 
1276
1306
  // src/client.ts