@medialane/ui 0.169.0 → 0.171.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 (73) hide show
  1. package/dist/components/badge.d.cts +1 -1
  2. package/dist/components/badge.d.ts +1 -1
  3. package/dist/components/button.d.cts +2 -2
  4. package/dist/components/button.d.ts +2 -2
  5. package/dist/components/fast-mint/fast-mint.d.cts +2 -2
  6. package/dist/components/fast-mint/fast-mint.d.ts +2 -2
  7. package/dist/components/sheet.d.cts +1 -1
  8. package/dist/components/sheet.d.ts +1 -1
  9. package/dist/components/wallet/export-key-section.cjs +9 -14
  10. package/dist/components/wallet/export-key-section.cjs.map +1 -1
  11. package/dist/components/wallet/export-key-section.d.cts +1 -2
  12. package/dist/components/wallet/export-key-section.d.ts +1 -2
  13. package/dist/components/wallet/export-key-section.js +9 -14
  14. package/dist/components/wallet/export-key-section.js.map +1 -1
  15. package/dist/index.cjs +68 -0
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +8 -0
  18. package/dist/index.d.ts +8 -0
  19. package/dist/index.js +63 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/utils/sitemap-data.cjs +55 -0
  22. package/dist/utils/sitemap-data.cjs.map +1 -0
  23. package/dist/utils/sitemap-data.d.cts +23 -0
  24. package/dist/utils/sitemap-data.d.ts +23 -0
  25. package/dist/utils/sitemap-data.js +31 -0
  26. package/dist/utils/sitemap-data.js.map +1 -0
  27. package/dist/utils/use-coin-price.cjs +88 -0
  28. package/dist/utils/use-coin-price.cjs.map +1 -0
  29. package/dist/utils/use-coin-price.d.cts +17 -0
  30. package/dist/utils/use-coin-price.d.ts +17 -0
  31. package/dist/utils/use-coin-price.js +53 -0
  32. package/dist/utils/use-coin-price.js.map +1 -0
  33. package/dist/utils/use-collections.cjs +2 -2
  34. package/dist/utils/use-collections.cjs.map +1 -1
  35. package/dist/utils/use-collections.js +2 -2
  36. package/dist/utils/use-collections.js.map +1 -1
  37. package/dist/utils/use-drops.cjs +94 -0
  38. package/dist/utils/use-drops.cjs.map +1 -0
  39. package/dist/utils/use-drops.d.cts +39 -0
  40. package/dist/utils/use-drops.d.ts +39 -0
  41. package/dist/utils/use-drops.js +56 -0
  42. package/dist/utils/use-drops.js.map +1 -0
  43. package/dist/utils/use-platform-stats.cjs +50 -0
  44. package/dist/utils/use-platform-stats.cjs.map +1 -0
  45. package/dist/utils/use-platform-stats.d.cts +9 -0
  46. package/dist/utils/use-platform-stats.d.ts +9 -0
  47. package/dist/utils/use-platform-stats.js +16 -0
  48. package/dist/utils/use-platform-stats.js.map +1 -0
  49. package/dist/utils/use-pop.cjs +72 -0
  50. package/dist/utils/use-pop.cjs.map +1 -0
  51. package/dist/utils/use-pop.d.cts +28 -0
  52. package/dist/utils/use-pop.d.ts +28 -0
  53. package/dist/utils/use-pop.js +36 -0
  54. package/dist/utils/use-pop.js.map +1 -0
  55. package/dist/utils/use-sponsorship.cjs +131 -0
  56. package/dist/utils/use-sponsorship.cjs.map +1 -0
  57. package/dist/utils/use-sponsorship.d.cts +70 -0
  58. package/dist/utils/use-sponsorship.d.ts +70 -0
  59. package/dist/utils/use-sponsorship.js +90 -0
  60. package/dist/utils/use-sponsorship.js.map +1 -0
  61. package/dist/utils/use-tiers.cjs +137 -0
  62. package/dist/utils/use-tiers.cjs.map +1 -0
  63. package/dist/utils/use-tiers.d.cts +60 -0
  64. package/dist/utils/use-tiers.d.ts +60 -0
  65. package/dist/utils/use-tiers.js +95 -0
  66. package/dist/utils/use-tiers.js.map +1 -0
  67. package/dist/utils/use-tokens-by-ip-type.cjs +50 -0
  68. package/dist/utils/use-tokens-by-ip-type.cjs.map +1 -0
  69. package/dist/utils/use-tokens-by-ip-type.d.cts +14 -0
  70. package/dist/utils/use-tokens-by-ip-type.d.ts +14 -0
  71. package/dist/utils/use-tokens-by-ip-type.js +16 -0
  72. package/dist/utils/use-tokens-by-ip-type.js.map +1 -0
  73. package/package.json +3 -3
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var use_platform_stats_exports = {};
31
+ __export(use_platform_stats_exports, {
32
+ usePlatformStats: () => usePlatformStats
33
+ });
34
+ module.exports = __toCommonJS(use_platform_stats_exports);
35
+ var import_swr = __toESM(require("swr"), 1);
36
+ var import_use_medialane_client = require("./use-medialane-client.js");
37
+ function usePlatformStats(getClient) {
38
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
39
+ const { data, isLoading } = (0, import_swr.default)(
40
+ "platform-stats",
41
+ () => client.api.getPlatformStats(),
42
+ { revalidateOnFocus: false, dedupingInterval: 6e4 }
43
+ );
44
+ return { stats: data ?? null, isLoading };
45
+ }
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ usePlatformStats
49
+ });
50
+ //# sourceMappingURL=use-platform-stats.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/use-platform-stats.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiPlatformStats } from \"@medialane/sdk\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport function usePlatformStats(getClient: () => MedialaneClient) {\n const client = useMedialaneClient(getClient);\n const { data, isLoading } = useSWR<ApiPlatformStats>(\n \"platform-stats\",\n () => client.api.getPlatformStats(),\n { revalidateOnFocus: false, dedupingInterval: 60_000 }\n );\n return { stats: data ?? null, isLoading };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAmB;AAGnB,kCAAmC;AAE5B,SAAS,iBAAiB,WAAkC;AACjE,QAAM,aAAS,gDAAmB,SAAS;AAC3C,QAAM,EAAE,MAAM,UAAU,QAAI,WAAAA;AAAA,IAC1B;AAAA,IACA,MAAM,OAAO,IAAI,iBAAiB;AAAA,IAClC,EAAE,mBAAmB,OAAO,kBAAkB,IAAO;AAAA,EACvD;AACA,SAAO,EAAE,OAAO,QAAQ,MAAM,UAAU;AAC1C;","names":["useSWR"]}
@@ -0,0 +1,9 @@
1
+ import { ApiPlatformStats } from '@medialane/sdk';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ declare function usePlatformStats(getClient: () => MedialaneClient): {
5
+ stats: ApiPlatformStats | null;
6
+ isLoading: boolean;
7
+ };
8
+
9
+ export { usePlatformStats };
@@ -0,0 +1,9 @@
1
+ import { ApiPlatformStats } from '@medialane/sdk';
2
+ import { MedialaneClient } from '@medialane/sdk/starknet';
3
+
4
+ declare function usePlatformStats(getClient: () => MedialaneClient): {
5
+ stats: ApiPlatformStats | null;
6
+ isLoading: boolean;
7
+ };
8
+
9
+ export { usePlatformStats };
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import useSWR from "swr";
3
+ import { useMedialaneClient } from "./use-medialane-client.js";
4
+ function usePlatformStats(getClient) {
5
+ const client = useMedialaneClient(getClient);
6
+ const { data, isLoading } = useSWR(
7
+ "platform-stats",
8
+ () => client.api.getPlatformStats(),
9
+ { revalidateOnFocus: false, dedupingInterval: 6e4 }
10
+ );
11
+ return { stats: data ?? null, isLoading };
12
+ }
13
+ export {
14
+ usePlatformStats
15
+ };
16
+ //# sourceMappingURL=use-platform-stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/use-platform-stats.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiPlatformStats } from \"@medialane/sdk\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport function usePlatformStats(getClient: () => MedialaneClient) {\n const client = useMedialaneClient(getClient);\n const { data, isLoading } = useSWR<ApiPlatformStats>(\n \"platform-stats\",\n () => client.api.getPlatformStats(),\n { revalidateOnFocus: false, dedupingInterval: 60_000 }\n );\n return { stats: data ?? null, isLoading };\n}\n"],"mappings":";AAEA,OAAO,YAAY;AAGnB,SAAS,0BAA0B;AAE5B,SAAS,iBAAiB,WAAkC;AACjE,QAAM,SAAS,mBAAmB,SAAS;AAC3C,QAAM,EAAE,MAAM,UAAU,IAAI;AAAA,IAC1B;AAAA,IACA,MAAM,OAAO,IAAI,iBAAiB;AAAA,IAClC,EAAE,mBAAmB,OAAO,kBAAkB,IAAO;AAAA,EACvD;AACA,SAAO,EAAE,OAAO,QAAQ,MAAM,UAAU;AAC1C;","names":[]}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var use_pop_exports = {};
31
+ __export(use_pop_exports, {
32
+ useMyPopEvents: () => useMyPopEvents,
33
+ usePopClaimStatus: () => usePopClaimStatus,
34
+ usePopCollections: () => usePopCollections
35
+ });
36
+ module.exports = __toCommonJS(use_pop_exports);
37
+ var import_swr = __toESM(require("swr"), 1);
38
+ var import_use_medialane_client = require("./use-medialane-client.js");
39
+ function usePopCollections(getClient) {
40
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
41
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
42
+ "pop-collections",
43
+ () => client.api.listCollections({ service: "pop-protocol", hideEmpty: false, limit: 50 }),
44
+ { revalidateOnFocus: false }
45
+ );
46
+ return { collections: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };
47
+ }
48
+ function useMyPopEvents(getClient, owner) {
49
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
50
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
51
+ owner ? `my-pop-events-${owner}` : null,
52
+ async () => (await client.api.listCollections({ service: "pop-protocol", owner, limit: 50 })).data ?? [],
53
+ { revalidateOnFocus: false }
54
+ );
55
+ return { events: data ?? [], isLoading, error, mutate };
56
+ }
57
+ function usePopClaimStatus(getClient, collection, wallet) {
58
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
59
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
60
+ collection && wallet ? `pop-eligibility-${collection}-${wallet}` : null,
61
+ () => client.api.getPopEligibility(collection, wallet),
62
+ { revalidateOnFocus: false, shouldRetryOnError: false }
63
+ );
64
+ return { claimStatus: data ?? null, isLoading, error, mutate };
65
+ }
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ useMyPopEvents,
69
+ usePopClaimStatus,
70
+ usePopCollections
71
+ });
72
+ //# sourceMappingURL=use-pop.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/use-pop.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiCollection, ApiMeta, PopClaimStatus } from \"@medialane/sdk\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport function usePopCollections(getClient: () => MedialaneClient) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<{ data: ApiCollection[]; meta?: ApiMeta }>(\n \"pop-collections\",\n () => client.api.listCollections({ service: \"pop-protocol\", hideEmpty: false, limit: 50 }),\n { revalidateOnFocus: false }\n );\n return { collections: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };\n}\n\nexport function useMyPopEvents(getClient: () => MedialaneClient, owner: string | null) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<ApiCollection[]>(\n owner ? `my-pop-events-${owner}` : null,\n async () => (await client.api.listCollections({ service: \"pop-protocol\", owner: owner!, limit: 50 })).data ?? [],\n { revalidateOnFocus: false }\n );\n return { events: data ?? [], isLoading, error, mutate };\n}\n\nexport function usePopClaimStatus(getClient: () => MedialaneClient, collection: string | null, wallet: string | null) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<PopClaimStatus>(\n collection && wallet ? `pop-eligibility-${collection}-${wallet}` : null,\n () => client.api.getPopEligibility(collection!, wallet!),\n { revalidateOnFocus: false, shouldRetryOnError: false }\n );\n return { claimStatus: data ?? null, isLoading, error, mutate };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAmB;AAGnB,kCAAmC;AAE5B,SAAS,kBAAkB,WAAkC;AAClE,QAAM,aAAS,gDAAmB,SAAS;AAC3C,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,QAAI,WAAAA;AAAA,IACzC;AAAA,IACA,MAAM,OAAO,IAAI,gBAAgB,EAAE,SAAS,gBAAgB,WAAW,OAAO,OAAO,GAAG,CAAC;AAAA,IACzF,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AACA,SAAO,EAAE,aAAa,MAAM,QAAQ,CAAC,GAAG,MAAM,MAAM,MAAM,WAAW,OAAO,OAAO;AACrF;AAEO,SAAS,eAAe,WAAkC,OAAsB;AACrF,QAAM,aAAS,gDAAmB,SAAS;AAC3C,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,QAAI,WAAAA;AAAA,IACzC,QAAQ,iBAAiB,KAAK,KAAK;AAAA,IACnC,aAAa,MAAM,OAAO,IAAI,gBAAgB,EAAE,SAAS,gBAAgB,OAAe,OAAO,GAAG,CAAC,GAAG,QAAQ,CAAC;AAAA,IAC/G,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AACA,SAAO,EAAE,QAAQ,QAAQ,CAAC,GAAG,WAAW,OAAO,OAAO;AACxD;AAEO,SAAS,kBAAkB,WAAkC,YAA2B,QAAuB;AACpH,QAAM,aAAS,gDAAmB,SAAS;AAC3C,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,QAAI,WAAAA;AAAA,IACzC,cAAc,SAAS,mBAAmB,UAAU,IAAI,MAAM,KAAK;AAAA,IACnE,MAAM,OAAO,IAAI,kBAAkB,YAAa,MAAO;AAAA,IACvD,EAAE,mBAAmB,OAAO,oBAAoB,MAAM;AAAA,EACxD;AACA,SAAO,EAAE,aAAa,QAAQ,MAAM,WAAW,OAAO,OAAO;AAC/D;","names":["useSWR"]}
@@ -0,0 +1,28 @@
1
+ import * as swr from 'swr';
2
+ import { ApiCollection, PopClaimStatus, ApiMeta } from '@medialane/sdk';
3
+ import { MedialaneClient } from '@medialane/sdk/starknet';
4
+
5
+ declare function usePopCollections(getClient: () => MedialaneClient): {
6
+ collections: ApiCollection[];
7
+ meta: ApiMeta | undefined;
8
+ isLoading: boolean;
9
+ error: any;
10
+ mutate: swr.KeyedMutator<{
11
+ data: ApiCollection[];
12
+ meta?: ApiMeta;
13
+ }>;
14
+ };
15
+ declare function useMyPopEvents(getClient: () => MedialaneClient, owner: string | null): {
16
+ events: ApiCollection[];
17
+ isLoading: boolean;
18
+ error: any;
19
+ mutate: swr.KeyedMutator<ApiCollection[]>;
20
+ };
21
+ declare function usePopClaimStatus(getClient: () => MedialaneClient, collection: string | null, wallet: string | null): {
22
+ claimStatus: PopClaimStatus | null;
23
+ isLoading: boolean;
24
+ error: any;
25
+ mutate: swr.KeyedMutator<PopClaimStatus>;
26
+ };
27
+
28
+ export { useMyPopEvents, usePopClaimStatus, usePopCollections };
@@ -0,0 +1,28 @@
1
+ import * as swr from 'swr';
2
+ import { ApiCollection, PopClaimStatus, ApiMeta } from '@medialane/sdk';
3
+ import { MedialaneClient } from '@medialane/sdk/starknet';
4
+
5
+ declare function usePopCollections(getClient: () => MedialaneClient): {
6
+ collections: ApiCollection[];
7
+ meta: ApiMeta | undefined;
8
+ isLoading: boolean;
9
+ error: any;
10
+ mutate: swr.KeyedMutator<{
11
+ data: ApiCollection[];
12
+ meta?: ApiMeta;
13
+ }>;
14
+ };
15
+ declare function useMyPopEvents(getClient: () => MedialaneClient, owner: string | null): {
16
+ events: ApiCollection[];
17
+ isLoading: boolean;
18
+ error: any;
19
+ mutate: swr.KeyedMutator<ApiCollection[]>;
20
+ };
21
+ declare function usePopClaimStatus(getClient: () => MedialaneClient, collection: string | null, wallet: string | null): {
22
+ claimStatus: PopClaimStatus | null;
23
+ isLoading: boolean;
24
+ error: any;
25
+ mutate: swr.KeyedMutator<PopClaimStatus>;
26
+ };
27
+
28
+ export { useMyPopEvents, usePopClaimStatus, usePopCollections };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import useSWR from "swr";
3
+ import { useMedialaneClient } from "./use-medialane-client.js";
4
+ function usePopCollections(getClient) {
5
+ const client = useMedialaneClient(getClient);
6
+ const { data, error, isLoading, mutate } = useSWR(
7
+ "pop-collections",
8
+ () => client.api.listCollections({ service: "pop-protocol", hideEmpty: false, limit: 50 }),
9
+ { revalidateOnFocus: false }
10
+ );
11
+ return { collections: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };
12
+ }
13
+ function useMyPopEvents(getClient, owner) {
14
+ const client = useMedialaneClient(getClient);
15
+ const { data, error, isLoading, mutate } = useSWR(
16
+ owner ? `my-pop-events-${owner}` : null,
17
+ async () => (await client.api.listCollections({ service: "pop-protocol", owner, limit: 50 })).data ?? [],
18
+ { revalidateOnFocus: false }
19
+ );
20
+ return { events: data ?? [], isLoading, error, mutate };
21
+ }
22
+ function usePopClaimStatus(getClient, collection, wallet) {
23
+ const client = useMedialaneClient(getClient);
24
+ const { data, error, isLoading, mutate } = useSWR(
25
+ collection && wallet ? `pop-eligibility-${collection}-${wallet}` : null,
26
+ () => client.api.getPopEligibility(collection, wallet),
27
+ { revalidateOnFocus: false, shouldRetryOnError: false }
28
+ );
29
+ return { claimStatus: data ?? null, isLoading, error, mutate };
30
+ }
31
+ export {
32
+ useMyPopEvents,
33
+ usePopClaimStatus,
34
+ usePopCollections
35
+ };
36
+ //# sourceMappingURL=use-pop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/use-pop.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiCollection, ApiMeta, PopClaimStatus } from \"@medialane/sdk\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport function usePopCollections(getClient: () => MedialaneClient) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<{ data: ApiCollection[]; meta?: ApiMeta }>(\n \"pop-collections\",\n () => client.api.listCollections({ service: \"pop-protocol\", hideEmpty: false, limit: 50 }),\n { revalidateOnFocus: false }\n );\n return { collections: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };\n}\n\nexport function useMyPopEvents(getClient: () => MedialaneClient, owner: string | null) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<ApiCollection[]>(\n owner ? `my-pop-events-${owner}` : null,\n async () => (await client.api.listCollections({ service: \"pop-protocol\", owner: owner!, limit: 50 })).data ?? [],\n { revalidateOnFocus: false }\n );\n return { events: data ?? [], isLoading, error, mutate };\n}\n\nexport function usePopClaimStatus(getClient: () => MedialaneClient, collection: string | null, wallet: string | null) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<PopClaimStatus>(\n collection && wallet ? `pop-eligibility-${collection}-${wallet}` : null,\n () => client.api.getPopEligibility(collection!, wallet!),\n { revalidateOnFocus: false, shouldRetryOnError: false }\n );\n return { claimStatus: data ?? null, isLoading, error, mutate };\n}\n"],"mappings":";AAEA,OAAO,YAAY;AAGnB,SAAS,0BAA0B;AAE5B,SAAS,kBAAkB,WAAkC;AAClE,QAAM,SAAS,mBAAmB,SAAS;AAC3C,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC;AAAA,IACA,MAAM,OAAO,IAAI,gBAAgB,EAAE,SAAS,gBAAgB,WAAW,OAAO,OAAO,GAAG,CAAC;AAAA,IACzF,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AACA,SAAO,EAAE,aAAa,MAAM,QAAQ,CAAC,GAAG,MAAM,MAAM,MAAM,WAAW,OAAO,OAAO;AACrF;AAEO,SAAS,eAAe,WAAkC,OAAsB;AACrF,QAAM,SAAS,mBAAmB,SAAS;AAC3C,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,QAAQ,iBAAiB,KAAK,KAAK;AAAA,IACnC,aAAa,MAAM,OAAO,IAAI,gBAAgB,EAAE,SAAS,gBAAgB,OAAe,OAAO,GAAG,CAAC,GAAG,QAAQ,CAAC;AAAA,IAC/G,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AACA,SAAO,EAAE,QAAQ,QAAQ,CAAC,GAAG,WAAW,OAAO,OAAO;AACxD;AAEO,SAAS,kBAAkB,WAAkC,YAA2B,QAAuB;AACpH,QAAM,SAAS,mBAAmB,SAAS;AAC3C,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,cAAc,SAAS,mBAAmB,UAAU,IAAI,MAAM,KAAK;AAAA,IACnE,MAAM,OAAO,IAAI,kBAAkB,YAAa,MAAO;AAAA,IACvD,EAAE,mBAAmB,OAAO,oBAAoB,MAAM;AAAA,EACxD;AACA,SAAO,EAAE,aAAa,QAAQ,MAAM,WAAW,OAAO,OAAO;AAC/D;","names":[]}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var use_sponsorship_exports = {};
31
+ __export(use_sponsorship_exports, {
32
+ useMySponsorshipDealCounts: () => useMySponsorshipDealCounts,
33
+ usePendingProposalsForAsset: () => usePendingProposalsForAsset,
34
+ useSponsorshipBids: () => useSponsorshipBids,
35
+ useSponsorshipLicenses: () => useSponsorshipLicenses,
36
+ useSponsorshipOffer: () => useSponsorshipOffer,
37
+ useSponsorshipOffers: () => useSponsorshipOffers,
38
+ useSponsorshipProposal: () => useSponsorshipProposal,
39
+ useSponsorshipProposals: () => useSponsorshipProposals
40
+ });
41
+ module.exports = __toCommonJS(use_sponsorship_exports);
42
+ var import_swr = __toESM(require("swr"), 1);
43
+ var import_use_medialane_client = require("./use-medialane-client.js");
44
+ function useSponsorshipOffers(getClient, params) {
45
+ const key = `sponsorship-offers-${JSON.stringify(params ?? {})}`;
46
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
47
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
48
+ key,
49
+ () => client.api.getSponsorshipOffers({ ...params, limit: 50 }),
50
+ { revalidateOnFocus: false }
51
+ );
52
+ return { offers: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };
53
+ }
54
+ function useSponsorshipOffer(getClient, offerId) {
55
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
56
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
57
+ offerId ? `sponsorship-offer-${offerId}` : null,
58
+ () => client.api.getSponsorshipOffer(offerId),
59
+ { revalidateOnFocus: false }
60
+ );
61
+ return { offer: data ?? null, isLoading, error, mutate };
62
+ }
63
+ function useSponsorshipBids(getClient, offerId) {
64
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
65
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
66
+ offerId ? `sponsorship-bids-${offerId}` : null,
67
+ () => client.api.getSponsorshipBids(offerId),
68
+ { revalidateOnFocus: false }
69
+ );
70
+ return { bids: data ?? [], isLoading, error, mutate };
71
+ }
72
+ function useSponsorshipProposals(getClient, params) {
73
+ const key = `sponsorship-proposals-${JSON.stringify(params ?? {})}`;
74
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
75
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
76
+ key,
77
+ () => client.api.getSponsorshipProposals({ ...params, limit: 50 }),
78
+ { revalidateOnFocus: false }
79
+ );
80
+ return { proposals: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };
81
+ }
82
+ function useSponsorshipProposal(getClient, proposalId) {
83
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
84
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
85
+ proposalId ? `sponsorship-proposal-${proposalId}` : null,
86
+ () => client.api.getSponsorshipProposal(proposalId),
87
+ { revalidateOnFocus: false }
88
+ );
89
+ return { proposal: data ?? null, isLoading, error, mutate };
90
+ }
91
+ function usePendingProposalsForAsset(getClient, nftContract) {
92
+ const { proposals, isLoading, error, mutate } = useSponsorshipProposals(
93
+ getClient,
94
+ nftContract ? { nftContract, open: true } : void 0
95
+ );
96
+ return { proposals: nftContract ? proposals : [], isLoading, error, mutate };
97
+ }
98
+ function useSponsorshipLicenses(getClient, params) {
99
+ const key = `sponsorship-licenses-${JSON.stringify(params ?? {})}`;
100
+ const client = (0, import_use_medialane_client.useMedialaneClient)(getClient);
101
+ const { data, error, isLoading, mutate } = (0, import_swr.default)(
102
+ key,
103
+ () => client.api.getSponsorshipLicenses({ ...params, limit: 50 }),
104
+ { revalidateOnFocus: false }
105
+ );
106
+ return { licenses: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };
107
+ }
108
+ function useMySponsorshipDealCounts(getClient, walletAddress) {
109
+ const { proposals, isLoading: proposalsLoading } = useSponsorshipProposals(
110
+ getClient,
111
+ walletAddress ? { owner: walletAddress, open: true } : void 0
112
+ );
113
+ const { offers, isLoading: offersLoading } = useSponsorshipOffers(
114
+ getClient,
115
+ walletAddress ? { author: walletAddress, open: true } : void 0
116
+ );
117
+ void offers;
118
+ return { pendingCount: proposals.length, isLoading: proposalsLoading || offersLoading };
119
+ }
120
+ // Annotate the CommonJS export names for ESM import in node:
121
+ 0 && (module.exports = {
122
+ useMySponsorshipDealCounts,
123
+ usePendingProposalsForAsset,
124
+ useSponsorshipBids,
125
+ useSponsorshipLicenses,
126
+ useSponsorshipOffer,
127
+ useSponsorshipOffers,
128
+ useSponsorshipProposal,
129
+ useSponsorshipProposals
130
+ });
131
+ //# sourceMappingURL=use-sponsorship.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/use-sponsorship.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiSponsorshipOffer, ApiSponsorshipBid, ApiSponsorshipProposal, ApiSponsorshipLicense, ApiResponse } from \"@medialane/sdk\";\nimport type { MedialaneClient } from \"@medialane/sdk/starknet\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport type {\n ApiSponsorshipOffer as SponsorshipOffer,\n ApiSponsorshipBid as SponsorshipBid,\n ApiSponsorshipProposal as SponsorshipProposal,\n ApiSponsorshipLicense as SponsorshipLicense,\n} from \"@medialane/sdk\";\n\nexport function useSponsorshipOffers(getClient: () => MedialaneClient, params?: { nftContract?: string; author?: string; owner?: string; open?: boolean }) {\n const key = `sponsorship-offers-${JSON.stringify(params ?? {})}`;\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<ApiResponse<ApiSponsorshipOffer[]>>(\n key,\n () => client.api.getSponsorshipOffers({ ...params, limit: 50 }),\n { revalidateOnFocus: false }\n );\n\n return { offers: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };\n}\n\nexport function useSponsorshipOffer(getClient: () => MedialaneClient, offerId: string | null) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<ApiSponsorshipOffer | null>(\n offerId ? `sponsorship-offer-${offerId}` : null,\n () => client.api.getSponsorshipOffer(offerId!),\n { revalidateOnFocus: false }\n );\n\n return { offer: data ?? null, isLoading, error, mutate };\n}\n\nexport function useSponsorshipBids(getClient: () => MedialaneClient, offerId: string | null) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<ApiSponsorshipBid[]>(\n offerId ? `sponsorship-bids-${offerId}` : null,\n () => client.api.getSponsorshipBids(offerId!),\n { revalidateOnFocus: false }\n );\n\n return { bids: data ?? [], isLoading, error, mutate };\n}\n\nexport function useSponsorshipProposals(getClient: () => MedialaneClient, params?: { nftContract?: string; proposer?: string; owner?: string; open?: boolean }) {\n const key = `sponsorship-proposals-${JSON.stringify(params ?? {})}`;\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<ApiResponse<ApiSponsorshipProposal[]>>(\n key,\n () => client.api.getSponsorshipProposals({ ...params, limit: 50 }),\n { revalidateOnFocus: false }\n );\n\n return { proposals: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };\n}\n\nexport function useSponsorshipProposal(getClient: () => MedialaneClient, proposalId: string | null) {\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<ApiSponsorshipProposal | null>(\n proposalId ? `sponsorship-proposal-${proposalId}` : null,\n () => client.api.getSponsorshipProposal(proposalId!),\n { revalidateOnFocus: false }\n );\n\n return { proposal: data ?? null, isLoading, error, mutate };\n}\n\nexport function usePendingProposalsForAsset(getClient: () => MedialaneClient, nftContract: string | null) {\n const { proposals, isLoading, error, mutate } = useSponsorshipProposals(\n getClient,\n nftContract ? { nftContract, open: true } : undefined\n );\n return { proposals: nftContract ? proposals : [], isLoading, error, mutate };\n}\n\nexport function useSponsorshipLicenses(getClient: () => MedialaneClient, params?: { holder?: string; author?: string }) {\n const key = `sponsorship-licenses-${JSON.stringify(params ?? {})}`;\n const client = useMedialaneClient(getClient);\n const { data, error, isLoading, mutate } = useSWR<ApiResponse<ApiSponsorshipLicense[]>>(\n key,\n () => client.api.getSponsorshipLicenses({ ...params, limit: 50 }),\n { revalidateOnFocus: false }\n );\n\n return { licenses: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };\n}\n\nexport function useMySponsorshipDealCounts(getClient: () => MedialaneClient, walletAddress: string | null) {\n const { proposals, isLoading: proposalsLoading } = useSponsorshipProposals(\n getClient,\n walletAddress ? { owner: walletAddress, open: true } : undefined\n );\n const { offers, isLoading: offersLoading } = useSponsorshipOffers(\n getClient,\n walletAddress ? { author: walletAddress, open: true } : undefined\n );\n\n void offers;\n return { pendingCount: proposals.length, isLoading: proposalsLoading || offersLoading };\n}\n"],"mappings":"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","names":["useSWR"]}
@@ -0,0 +1,70 @@
1
+ import * as swr from 'swr';
2
+ import * as _medialane_sdk from '@medialane/sdk';
3
+ import { ApiSponsorshipProposal, ApiResponse, ApiSponsorshipBid, ApiSponsorshipLicense, ApiSponsorshipOffer } from '@medialane/sdk';
4
+ export { ApiSponsorshipBid as SponsorshipBid, ApiSponsorshipLicense as SponsorshipLicense, ApiSponsorshipOffer as SponsorshipOffer, ApiSponsorshipProposal as SponsorshipProposal } from '@medialane/sdk';
5
+ import { MedialaneClient } from '@medialane/sdk/starknet';
6
+
7
+ declare function useSponsorshipOffers(getClient: () => MedialaneClient, params?: {
8
+ nftContract?: string;
9
+ author?: string;
10
+ owner?: string;
11
+ open?: boolean;
12
+ }): {
13
+ offers: ApiSponsorshipOffer[];
14
+ meta: _medialane_sdk.ApiMeta | undefined;
15
+ isLoading: boolean;
16
+ error: any;
17
+ mutate: swr.KeyedMutator<ApiResponse<ApiSponsorshipOffer[]>>;
18
+ };
19
+ declare function useSponsorshipOffer(getClient: () => MedialaneClient, offerId: string | null): {
20
+ offer: ApiSponsorshipOffer | null;
21
+ isLoading: boolean;
22
+ error: any;
23
+ mutate: swr.KeyedMutator<ApiSponsorshipOffer | null>;
24
+ };
25
+ declare function useSponsorshipBids(getClient: () => MedialaneClient, offerId: string | null): {
26
+ bids: ApiSponsorshipBid[];
27
+ isLoading: boolean;
28
+ error: any;
29
+ mutate: swr.KeyedMutator<ApiSponsorshipBid[]>;
30
+ };
31
+ declare function useSponsorshipProposals(getClient: () => MedialaneClient, params?: {
32
+ nftContract?: string;
33
+ proposer?: string;
34
+ owner?: string;
35
+ open?: boolean;
36
+ }): {
37
+ proposals: ApiSponsorshipProposal[];
38
+ meta: _medialane_sdk.ApiMeta | undefined;
39
+ isLoading: boolean;
40
+ error: any;
41
+ mutate: swr.KeyedMutator<ApiResponse<ApiSponsorshipProposal[]>>;
42
+ };
43
+ declare function useSponsorshipProposal(getClient: () => MedialaneClient, proposalId: string | null): {
44
+ proposal: ApiSponsorshipProposal | null;
45
+ isLoading: boolean;
46
+ error: any;
47
+ mutate: swr.KeyedMutator<ApiSponsorshipProposal | null>;
48
+ };
49
+ declare function usePendingProposalsForAsset(getClient: () => MedialaneClient, nftContract: string | null): {
50
+ proposals: ApiSponsorshipProposal[];
51
+ isLoading: boolean;
52
+ error: any;
53
+ mutate: swr.KeyedMutator<ApiResponse<ApiSponsorshipProposal[]>>;
54
+ };
55
+ declare function useSponsorshipLicenses(getClient: () => MedialaneClient, params?: {
56
+ holder?: string;
57
+ author?: string;
58
+ }): {
59
+ licenses: ApiSponsorshipLicense[];
60
+ meta: _medialane_sdk.ApiMeta | undefined;
61
+ isLoading: boolean;
62
+ error: any;
63
+ mutate: swr.KeyedMutator<ApiResponse<ApiSponsorshipLicense[]>>;
64
+ };
65
+ declare function useMySponsorshipDealCounts(getClient: () => MedialaneClient, walletAddress: string | null): {
66
+ pendingCount: number;
67
+ isLoading: boolean;
68
+ };
69
+
70
+ export { useMySponsorshipDealCounts, usePendingProposalsForAsset, useSponsorshipBids, useSponsorshipLicenses, useSponsorshipOffer, useSponsorshipOffers, useSponsorshipProposal, useSponsorshipProposals };
@@ -0,0 +1,70 @@
1
+ import * as swr from 'swr';
2
+ import * as _medialane_sdk from '@medialane/sdk';
3
+ import { ApiSponsorshipProposal, ApiResponse, ApiSponsorshipBid, ApiSponsorshipLicense, ApiSponsorshipOffer } from '@medialane/sdk';
4
+ export { ApiSponsorshipBid as SponsorshipBid, ApiSponsorshipLicense as SponsorshipLicense, ApiSponsorshipOffer as SponsorshipOffer, ApiSponsorshipProposal as SponsorshipProposal } from '@medialane/sdk';
5
+ import { MedialaneClient } from '@medialane/sdk/starknet';
6
+
7
+ declare function useSponsorshipOffers(getClient: () => MedialaneClient, params?: {
8
+ nftContract?: string;
9
+ author?: string;
10
+ owner?: string;
11
+ open?: boolean;
12
+ }): {
13
+ offers: ApiSponsorshipOffer[];
14
+ meta: _medialane_sdk.ApiMeta | undefined;
15
+ isLoading: boolean;
16
+ error: any;
17
+ mutate: swr.KeyedMutator<ApiResponse<ApiSponsorshipOffer[]>>;
18
+ };
19
+ declare function useSponsorshipOffer(getClient: () => MedialaneClient, offerId: string | null): {
20
+ offer: ApiSponsorshipOffer | null;
21
+ isLoading: boolean;
22
+ error: any;
23
+ mutate: swr.KeyedMutator<ApiSponsorshipOffer | null>;
24
+ };
25
+ declare function useSponsorshipBids(getClient: () => MedialaneClient, offerId: string | null): {
26
+ bids: ApiSponsorshipBid[];
27
+ isLoading: boolean;
28
+ error: any;
29
+ mutate: swr.KeyedMutator<ApiSponsorshipBid[]>;
30
+ };
31
+ declare function useSponsorshipProposals(getClient: () => MedialaneClient, params?: {
32
+ nftContract?: string;
33
+ proposer?: string;
34
+ owner?: string;
35
+ open?: boolean;
36
+ }): {
37
+ proposals: ApiSponsorshipProposal[];
38
+ meta: _medialane_sdk.ApiMeta | undefined;
39
+ isLoading: boolean;
40
+ error: any;
41
+ mutate: swr.KeyedMutator<ApiResponse<ApiSponsorshipProposal[]>>;
42
+ };
43
+ declare function useSponsorshipProposal(getClient: () => MedialaneClient, proposalId: string | null): {
44
+ proposal: ApiSponsorshipProposal | null;
45
+ isLoading: boolean;
46
+ error: any;
47
+ mutate: swr.KeyedMutator<ApiSponsorshipProposal | null>;
48
+ };
49
+ declare function usePendingProposalsForAsset(getClient: () => MedialaneClient, nftContract: string | null): {
50
+ proposals: ApiSponsorshipProposal[];
51
+ isLoading: boolean;
52
+ error: any;
53
+ mutate: swr.KeyedMutator<ApiResponse<ApiSponsorshipProposal[]>>;
54
+ };
55
+ declare function useSponsorshipLicenses(getClient: () => MedialaneClient, params?: {
56
+ holder?: string;
57
+ author?: string;
58
+ }): {
59
+ licenses: ApiSponsorshipLicense[];
60
+ meta: _medialane_sdk.ApiMeta | undefined;
61
+ isLoading: boolean;
62
+ error: any;
63
+ mutate: swr.KeyedMutator<ApiResponse<ApiSponsorshipLicense[]>>;
64
+ };
65
+ declare function useMySponsorshipDealCounts(getClient: () => MedialaneClient, walletAddress: string | null): {
66
+ pendingCount: number;
67
+ isLoading: boolean;
68
+ };
69
+
70
+ export { useMySponsorshipDealCounts, usePendingProposalsForAsset, useSponsorshipBids, useSponsorshipLicenses, useSponsorshipOffer, useSponsorshipOffers, useSponsorshipProposal, useSponsorshipProposals };