@medialane/sdk 0.4.5 → 0.4.7

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
@@ -203,6 +203,7 @@ declare class MarketplaceModule {
203
203
  buildCancellationTypedData(params: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
204
204
  }
205
205
 
206
+ type IPType = "Audio" | "Art" | "Documents" | "NFT" | "Video" | "Photography" | "Patents" | "Posts" | "Publications" | "RWA" | "Software" | "Custom";
206
207
  type CollectionSort = "recent" | "supply" | "floor" | "volume" | "name";
207
208
  interface ApiCollectionsQuery {
208
209
  page?: number;
@@ -582,6 +583,9 @@ interface ApiCreatorListResult {
582
583
  page: number;
583
584
  limit: number;
584
585
  }
586
+ interface ApiUserWallet {
587
+ walletAddress: string;
588
+ }
585
589
  interface ApiCollectionClaim {
586
590
  id: string;
587
591
  contractAddress: string;
@@ -695,6 +699,18 @@ declare class ApiClient {
695
699
  * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
696
700
  */
697
701
  updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
702
+ /**
703
+ * Upsert the authenticated user's wallet address in the backend DB.
704
+ * Call after onboarding when ChipiPay confirms the wallet address.
705
+ * Requires Clerk JWT; no tenant API key needed.
706
+ */
707
+ upsertMyWallet(clerkToken: string): Promise<ApiUserWallet>;
708
+ /**
709
+ * Get the authenticated user's stored wallet address from the backend DB.
710
+ * Returns null if the user has not completed onboarding yet.
711
+ * Requires Clerk JWT; no tenant API key needed.
712
+ */
713
+ getMyWallet(clerkToken: string): Promise<ApiUserWallet | null>;
698
714
  }
699
715
 
700
716
  declare class MedialaneClient {
@@ -1142,4 +1158,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
1142
1158
  */
1143
1159
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
1144
1160
 
1145
- 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 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 };
1161
+ 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 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, 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
@@ -203,6 +203,7 @@ declare class MarketplaceModule {
203
203
  buildCancellationTypedData(params: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
204
204
  }
205
205
 
206
+ type IPType = "Audio" | "Art" | "Documents" | "NFT" | "Video" | "Photography" | "Patents" | "Posts" | "Publications" | "RWA" | "Software" | "Custom";
206
207
  type CollectionSort = "recent" | "supply" | "floor" | "volume" | "name";
207
208
  interface ApiCollectionsQuery {
208
209
  page?: number;
@@ -582,6 +583,9 @@ interface ApiCreatorListResult {
582
583
  page: number;
583
584
  limit: number;
584
585
  }
586
+ interface ApiUserWallet {
587
+ walletAddress: string;
588
+ }
585
589
  interface ApiCollectionClaim {
586
590
  id: string;
587
591
  contractAddress: string;
@@ -695,6 +699,18 @@ declare class ApiClient {
695
699
  * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
696
700
  */
697
701
  updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
702
+ /**
703
+ * Upsert the authenticated user's wallet address in the backend DB.
704
+ * Call after onboarding when ChipiPay confirms the wallet address.
705
+ * Requires Clerk JWT; no tenant API key needed.
706
+ */
707
+ upsertMyWallet(clerkToken: string): Promise<ApiUserWallet>;
708
+ /**
709
+ * Get the authenticated user's stored wallet address from the backend DB.
710
+ * Returns null if the user has not completed onboarding yet.
711
+ * Requires Clerk JWT; no tenant API key needed.
712
+ */
713
+ getMyWallet(clerkToken: string): Promise<ApiUserWallet | null>;
698
714
  }
699
715
 
700
716
  declare class MedialaneClient {
@@ -1142,4 +1158,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
1142
1158
  */
1143
1159
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
1144
1160
 
1145
- 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 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 };
1161
+ 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 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, 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