@microcosmmoney/auth-react 1.0.4 → 1.1.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 (101) hide show
  1. package/dist/hooks/use-auction-bids.d.ts +4 -0
  2. package/dist/hooks/use-auction-bids.js +12 -0
  3. package/dist/hooks/use-auction-config.d.ts +3 -0
  4. package/dist/hooks/use-auction-config.js +11 -0
  5. package/dist/hooks/use-auction-detail.d.ts +2 -1
  6. package/dist/hooks/use-auction-end.d.ts +5 -0
  7. package/dist/hooks/use-auction-end.js +32 -0
  8. package/dist/hooks/use-auction-refund.d.ts +5 -0
  9. package/dist/hooks/use-auction-refund.js +32 -0
  10. package/dist/hooks/use-auctions.d.ts +10 -2
  11. package/dist/hooks/use-auctions.js +14 -1
  12. package/dist/hooks/use-buyback-flow.d.ts +22 -0
  13. package/dist/hooks/use-buyback-flow.js +46 -0
  14. package/dist/hooks/use-create-auction.d.ts +6 -0
  15. package/dist/hooks/use-create-auction.js +32 -0
  16. package/dist/hooks/use-dashboard-mining-history.d.ts +3 -0
  17. package/dist/hooks/use-dashboard-mining-history.js +11 -0
  18. package/dist/hooks/use-dashboard-summary.d.ts +4 -14
  19. package/dist/hooks/use-dashboard-territory-stats.d.ts +3 -0
  20. package/dist/hooks/use-dashboard-territory-stats.js +11 -0
  21. package/dist/hooks/use-dashboard-user-stats.d.ts +4 -0
  22. package/dist/hooks/use-dashboard-user-stats.js +11 -0
  23. package/dist/hooks/use-fragment-config.d.ts +3 -0
  24. package/dist/hooks/use-fragment-config.js +11 -0
  25. package/dist/hooks/use-fragment-vault-detail.d.ts +3 -0
  26. package/dist/hooks/use-fragment-vault-detail.js +12 -0
  27. package/dist/hooks/use-fragment-vaults.d.ts +3 -0
  28. package/dist/hooks/use-fragment-vaults.js +11 -0
  29. package/dist/hooks/use-lending-pool.d.ts +3 -0
  30. package/dist/hooks/use-lending-pool.js +11 -0
  31. package/dist/hooks/use-lending-position.d.ts +3 -0
  32. package/dist/hooks/use-lending-position.js +13 -0
  33. package/dist/hooks/use-lending-stats.d.ts +3 -0
  34. package/dist/hooks/use-lending-stats.js +11 -0
  35. package/dist/hooks/use-manager-income.d.ts +9 -0
  36. package/dist/hooks/use-manager-income.js +11 -0
  37. package/dist/hooks/use-market-data.d.ts +4 -0
  38. package/dist/hooks/use-market-data.js +11 -0
  39. package/dist/hooks/use-mcc-history.d.ts +2 -9
  40. package/dist/hooks/use-mcc-holders.d.ts +3 -0
  41. package/dist/hooks/use-mcc-holders.js +11 -0
  42. package/dist/hooks/use-mcc-mining-history.d.ts +3 -0
  43. package/dist/hooks/use-mcc-mining-history.js +11 -0
  44. package/dist/hooks/use-mcc-stats.d.ts +2 -1
  45. package/dist/hooks/use-mcd.js +1 -1
  46. package/dist/hooks/use-mining-distribution.d.ts +2 -2
  47. package/dist/hooks/use-mining-flow.d.ts +22 -0
  48. package/dist/hooks/use-mining-flow.js +46 -0
  49. package/dist/hooks/use-mining-history.d.ts +2 -1
  50. package/dist/hooks/use-mining-records.d.ts +2 -1
  51. package/dist/hooks/use-mining-stats.d.ts +2 -1
  52. package/dist/hooks/use-multi-wallet-balance.d.ts +15 -0
  53. package/dist/hooks/use-multi-wallet-balance.js +53 -0
  54. package/dist/hooks/use-notification-action.d.ts +10 -0
  55. package/dist/hooks/use-notification-action.js +49 -0
  56. package/dist/hooks/use-notifications.d.ts +13 -0
  57. package/dist/hooks/use-notifications.js +15 -0
  58. package/dist/hooks/use-organization-summary.d.ts +12 -0
  59. package/dist/hooks/use-organization-summary.js +12 -0
  60. package/dist/hooks/use-organization-tree.d.ts +4 -0
  61. package/dist/hooks/use-organization-tree.js +13 -0
  62. package/dist/hooks/use-organizations.d.ts +2 -1
  63. package/dist/hooks/use-platform-stats.d.ts +3 -0
  64. package/dist/hooks/use-platform-stats.js +11 -0
  65. package/dist/hooks/use-price-history.d.ts +2 -1
  66. package/dist/hooks/use-proposal-settle.d.ts +5 -0
  67. package/dist/hooks/use-proposal-settle.js +32 -0
  68. package/dist/hooks/use-solana-wallet.d.ts +16 -0
  69. package/dist/hooks/use-solana-wallet.js +56 -0
  70. package/dist/hooks/use-station-join.d.ts +5 -0
  71. package/dist/hooks/use-station-join.js +32 -0
  72. package/dist/hooks/use-station-leave.d.ts +5 -0
  73. package/dist/hooks/use-station-leave.js +32 -0
  74. package/dist/hooks/use-station-queue.d.ts +3 -0
  75. package/dist/hooks/use-station-queue.js +12 -0
  76. package/dist/hooks/use-team-custody.d.ts +18 -0
  77. package/dist/hooks/use-team-custody.js +11 -0
  78. package/dist/hooks/use-tech-tree-action.d.ts +6 -0
  79. package/dist/hooks/use-tech-tree-action.js +51 -0
  80. package/dist/hooks/use-tech-tree-bonus.d.ts +4 -0
  81. package/dist/hooks/use-tech-tree-bonus.js +12 -0
  82. package/dist/hooks/use-tech-tree-config.d.ts +4 -0
  83. package/dist/hooks/use-tech-tree-config.js +11 -0
  84. package/dist/hooks/use-tech-tree.d.ts +2 -1
  85. package/dist/hooks/use-territory-detailed-stats.d.ts +9 -0
  86. package/dist/hooks/use-territory-detailed-stats.js +12 -0
  87. package/dist/hooks/use-territory-distribution-plan.d.ts +16 -0
  88. package/dist/hooks/use-territory-distribution-plan.js +41 -0
  89. package/dist/hooks/use-territory-name-status.d.ts +10 -0
  90. package/dist/hooks/use-territory-name-status.js +13 -0
  91. package/dist/hooks/use-territory-nft-action.d.ts +15 -0
  92. package/dist/hooks/use-territory-nft-action.js +51 -0
  93. package/dist/hooks/use-territory-nft-collection.d.ts +3 -0
  94. package/dist/hooks/use-territory-nft-collection.js +11 -0
  95. package/dist/hooks/use-territory-nft-mint.d.ts +12 -0
  96. package/dist/hooks/use-territory-nft-mint.js +32 -0
  97. package/dist/hooks/use-user-level.d.ts +2 -8
  98. package/dist/hooks/use-user-stats.d.ts +2 -1
  99. package/dist/index.d.ts +43 -1
  100. package/dist/index.js +83 -1
  101. package/package.json +2 -2
@@ -0,0 +1,4 @@
1
+ import type { AuctionBid } from '@microcosmmoney/auth-core';
2
+ export declare function useAuctionBids(auctionId?: number, options?: {
3
+ refetchInterval?: number;
4
+ }): import("./use-api-query").UseApiQueryResult<AuctionBid[]>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAuctionBids = useAuctionBids;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useAuctionBids(auctionId, options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: `/auction-solana/auction/${auctionId}/bids`,
9
+ skip: auctionId === undefined || auctionId === null,
10
+ refetchInterval: options?.refetchInterval ?? 30000,
11
+ });
12
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useAuctionConfig(options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAuctionConfig = useAuctionConfig;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useAuctionConfig(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/auction-solana/config',
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -1,3 +1,4 @@
1
+ import type { AuctionDetail } from '@microcosmmoney/auth-core';
1
2
  export declare function useAuctionDetail(id?: number, options?: {
2
3
  refetchInterval?: number;
3
- }): import("./use-api-query").UseApiQueryResult<any>;
4
+ }): import("./use-api-query").UseApiQueryResult<AuctionDetail>;
@@ -0,0 +1,5 @@
1
+ export declare function useAuctionEnd(): {
2
+ endAuction: (auctionId: number) => Promise<any>;
3
+ loading: boolean;
4
+ error: Error | null;
5
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAuctionEnd = useAuctionEnd;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const react_1 = require("react");
6
+ const provider_1 = require("../provider");
7
+ function useAuctionEnd() {
8
+ const { client } = (0, provider_1.useAuth)();
9
+ const [loading, setLoading] = (0, react_1.useState)(false);
10
+ const [error, setError] = (0, react_1.useState)(null);
11
+ const mountedRef = (0, react_1.useRef)(true);
12
+ const endAuction = (0, react_1.useCallback)(async (auctionId) => {
13
+ const api = client.getApiClient();
14
+ try {
15
+ setLoading(true);
16
+ setError(null);
17
+ const res = await api.post(`/auction-solana/auction/${auctionId}/end`, {});
18
+ return res.data;
19
+ }
20
+ catch (err) {
21
+ const e = err instanceof Error ? err : new Error(String(err));
22
+ if (mountedRef.current)
23
+ setError(e);
24
+ throw e;
25
+ }
26
+ finally {
27
+ if (mountedRef.current)
28
+ setLoading(false);
29
+ }
30
+ }, [client]);
31
+ return { endAuction, loading, error };
32
+ }
@@ -0,0 +1,5 @@
1
+ export declare function useAuctionRefund(): {
2
+ prepareRefund: (auctionId: number) => Promise<any>;
3
+ loading: boolean;
4
+ error: Error | null;
5
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAuctionRefund = useAuctionRefund;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const react_1 = require("react");
6
+ const provider_1 = require("../provider");
7
+ function useAuctionRefund() {
8
+ const { client } = (0, provider_1.useAuth)();
9
+ const [loading, setLoading] = (0, react_1.useState)(false);
10
+ const [error, setError] = (0, react_1.useState)(null);
11
+ const mountedRef = (0, react_1.useRef)(true);
12
+ const prepareRefund = (0, react_1.useCallback)(async (auctionId) => {
13
+ const api = client.getApiClient();
14
+ try {
15
+ setLoading(true);
16
+ setError(null);
17
+ const res = await api.post('/auction-solana/bid/cancel/prepare', { auction_id: auctionId });
18
+ return res.data;
19
+ }
20
+ catch (err) {
21
+ const e = err instanceof Error ? err : new Error(String(err));
22
+ if (mountedRef.current)
23
+ setError(e);
24
+ throw e;
25
+ }
26
+ finally {
27
+ if (mountedRef.current)
28
+ setLoading(false);
29
+ }
30
+ }, [client]);
31
+ return { prepareRefund, loading, error };
32
+ }
@@ -1,3 +1,11 @@
1
- export declare function useAuctions(options?: {
1
+ import type { Auction } from '@microcosmmoney/auth-core';
2
+ interface AuctionFilters {
3
+ status?: string;
4
+ unit_type?: string;
5
+ sort_by?: string;
6
+ page?: number;
7
+ limit?: number;
2
8
  refetchInterval?: number;
3
- }): import("./use-api-query").UseApiQueryResult<any>;
9
+ }
10
+ export declare function useAuctions(options?: AuctionFilters): import("./use-api-query").UseApiQueryResult<Auction[]>;
11
+ export {};
@@ -4,8 +4,21 @@ exports.useAuctions = useAuctions;
4
4
  // AI-generated · AI-managed · AI-maintained
5
5
  const use_api_query_1 = require("./use-api-query");
6
6
  function useAuctions(options) {
7
+ const params = new URLSearchParams();
8
+ if (options?.status)
9
+ params.set('status', options.status);
10
+ if (options?.unit_type)
11
+ params.set('unit_type', options.unit_type);
12
+ if (options?.sort_by)
13
+ params.set('sort_by', options.sort_by);
14
+ if (options?.page)
15
+ params.set('page', String(options.page));
16
+ if (options?.limit)
17
+ params.set('limit', String(options.limit));
18
+ const qs = params.toString();
19
+ const path = qs ? `/auction-solana/active?${qs}` : '/auction-solana/active';
7
20
  return (0, use_api_query_1.useApiQuery)({
8
- path: '/auction-solana/active',
21
+ path,
9
22
  refetchInterval: options?.refetchInterval ?? 60000,
10
23
  });
11
24
  }
@@ -0,0 +1,22 @@
1
+ export type BuybackFlowStep = 'idle' | 'quoting' | 'executing' | 'signing' | 'completed' | 'error';
2
+ export interface BuybackFlowState {
3
+ step: BuybackFlowStep;
4
+ quote: any | null;
5
+ result: any | null;
6
+ txSignature: string | null;
7
+ error: string | null;
8
+ }
9
+ export declare function useBuybackFlow(): {
10
+ getQuote: (params: {
11
+ amount: number;
12
+ wallet_address: string;
13
+ stablecoin?: "USDT" | "USDC";
14
+ }) => Promise<any>;
15
+ executeBuyback: (quoteId: string, txSignature: string) => Promise<any>;
16
+ reset: () => void;
17
+ step: BuybackFlowStep;
18
+ quote: any | null;
19
+ result: any | null;
20
+ txSignature: string | null;
21
+ error: string | null;
22
+ };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useBuybackFlow = useBuybackFlow;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const react_1 = require("react");
6
+ const provider_1 = require("../provider");
7
+ function useBuybackFlow() {
8
+ const { client } = (0, provider_1.useAuth)();
9
+ const [state, setState] = (0, react_1.useState)({
10
+ step: 'idle',
11
+ quote: null,
12
+ result: null,
13
+ txSignature: null,
14
+ error: null,
15
+ });
16
+ const reset = (0, react_1.useCallback)(() => {
17
+ setState({ step: 'idle', quote: null, result: null, txSignature: null, error: null });
18
+ }, []);
19
+ const getQuote = (0, react_1.useCallback)(async (params) => {
20
+ const api = client.getApiClient();
21
+ setState(s => ({ ...s, step: 'quoting', error: null }));
22
+ try {
23
+ const q = await api.post('/mcc/buyback/quote', params);
24
+ setState(s => ({ ...s, step: 'executing', quote: q.data }));
25
+ return q.data;
26
+ }
27
+ catch (e) {
28
+ setState(s => ({ ...s, step: 'error', error: e.message }));
29
+ throw e;
30
+ }
31
+ }, [client]);
32
+ const executeBuyback = (0, react_1.useCallback)(async (quoteId, txSignature) => {
33
+ const api = client.getApiClient();
34
+ setState(s => ({ ...s, step: 'signing' }));
35
+ try {
36
+ const res = await api.post('/mcc/buyback/execute', { quote_id: quoteId, tx_signature: txSignature });
37
+ setState(s => ({ ...s, step: 'completed', result: res.data, txSignature }));
38
+ return res.data;
39
+ }
40
+ catch (e) {
41
+ setState(s => ({ ...s, step: 'error', error: e.message }));
42
+ throw e;
43
+ }
44
+ }, [client]);
45
+ return { ...state, getQuote, executeBuyback, reset };
46
+ }
@@ -0,0 +1,6 @@
1
+ import type { AuctionCreateInput } from '@microcosmmoney/auth-core';
2
+ export declare function useCreateAuction(): {
3
+ createAuction: (input: AuctionCreateInput) => Promise<any>;
4
+ loading: boolean;
5
+ error: Error | null;
6
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useCreateAuction = useCreateAuction;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const react_1 = require("react");
6
+ const provider_1 = require("../provider");
7
+ function useCreateAuction() {
8
+ const { client } = (0, provider_1.useAuth)();
9
+ const [loading, setLoading] = (0, react_1.useState)(false);
10
+ const [error, setError] = (0, react_1.useState)(null);
11
+ const mountedRef = (0, react_1.useRef)(true);
12
+ const createAuction = (0, react_1.useCallback)(async (input) => {
13
+ const api = client.getApiClient();
14
+ try {
15
+ setLoading(true);
16
+ setError(null);
17
+ const res = await api.post('/auction-solana/create', input);
18
+ return res.data;
19
+ }
20
+ catch (err) {
21
+ const e = err instanceof Error ? err : new Error(String(err));
22
+ if (mountedRef.current)
23
+ setError(e);
24
+ throw e;
25
+ }
26
+ finally {
27
+ if (mountedRef.current)
28
+ setLoading(false);
29
+ }
30
+ }, [client]);
31
+ return { createAuction, loading, error };
32
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useDashboardMiningHistory(days?: number, options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any[]>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDashboardMiningHistory = useDashboardMiningHistory;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useDashboardMiningHistory(days = 30, options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: `/dashboard/stats/mining-history?days=${days}`,
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -1,16 +1,7 @@
1
- interface DashboardSummary {
2
- market: {
3
- price_usd: number;
4
- price_change_24h: number;
5
- volume_24h: number;
6
- liquidity_usd: number;
7
- fdv: number;
8
- market_cap: number;
9
- } | null;
10
- user: {
11
- level: any;
12
- mcc_balance: any;
13
- } | null;
1
+ import type { DashboardMarketSummary, DashboardUserSummary } from '@microcosmmoney/auth-core';
2
+ export interface DashboardSummary {
3
+ market: DashboardMarketSummary | null;
4
+ user: DashboardUserSummary | null;
14
5
  }
15
6
  export declare function useDashboardSummary(wallet?: string, options?: {
16
7
  refetchInterval?: number;
@@ -20,4 +11,3 @@ export declare function useDashboardSummary(wallet?: string, options?: {
20
11
  error: Error | null;
21
12
  refresh: () => Promise<void>;
22
13
  };
23
- export {};
@@ -0,0 +1,3 @@
1
+ export declare function useDashboardTerritoryStats(options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDashboardTerritoryStats = useDashboardTerritoryStats;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useDashboardTerritoryStats(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/dashboard/stats/territories',
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -0,0 +1,4 @@
1
+ import type { UserStats } from '@microcosmmoney/auth-core';
2
+ export declare function useDashboardUserStats(options?: {
3
+ refetchInterval?: number;
4
+ }): import("./use-api-query").UseApiQueryResult<UserStats>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDashboardUserStats = useDashboardUserStats;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useDashboardUserStats(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/dashboard/stats/users',
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useFragmentConfig(options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useFragmentConfig = useFragmentConfig;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useFragmentConfig(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/fragment/config',
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useFragmentVaultDetail(vaultId?: string, options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useFragmentVaultDetail = useFragmentVaultDetail;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useFragmentVaultDetail(vaultId, options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: `/fragment/vault/${vaultId}`,
9
+ skip: !vaultId,
10
+ refetchInterval: options?.refetchInterval ?? 60000,
11
+ });
12
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useFragmentVaults(options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any[]>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useFragmentVaults = useFragmentVaults;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useFragmentVaults(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/fragment/vaults',
9
+ refetchInterval: options?.refetchInterval ?? 120000,
10
+ });
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useLendingPool(options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLendingPool = useLendingPool;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useLendingPool(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/lending/pool',
9
+ refetchInterval: options?.refetchInterval ?? 120000,
10
+ });
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useLendingPosition(wallet?: string, options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLendingPosition = useLendingPosition;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useLendingPosition(wallet, options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: `/lending/position/${wallet}`,
9
+ skip: !wallet,
10
+ requireAuth: true,
11
+ refetchInterval: options?.refetchInterval ?? 60000,
12
+ });
13
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useLendingStats(options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLendingStats = useLendingStats;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useLendingStats(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/lending/stats',
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -0,0 +1,9 @@
1
+ import type { TerritoryIncome } from '@microcosmmoney/auth-core';
2
+ export interface ManagerIncomeData {
3
+ total_income: number;
4
+ pending_income: number;
5
+ records: TerritoryIncome[];
6
+ }
7
+ export declare function useManagerIncome(options?: {
8
+ refetchInterval?: number;
9
+ }): import("./use-api-query").UseApiQueryResult<ManagerIncomeData>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useManagerIncome = useManagerIncome;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useManagerIncome(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/territories/manager/income',
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -0,0 +1,4 @@
1
+ import type { DashboardMarketSummary } from '@microcosmmoney/auth-core';
2
+ export declare function useMarketData(options?: {
3
+ refetchInterval?: number;
4
+ }): import("./use-api-query").UseApiQueryResult<DashboardMarketSummary>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMarketData = useMarketData;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useMarketData(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/dashboard/market',
9
+ refetchInterval: options?.refetchInterval ?? 120000,
10
+ });
11
+ }
@@ -1,18 +1,11 @@
1
- import type { MCCHistoryRecord } from '@microcosmmoney/auth-core';
2
- interface PaginatedResult {
3
- records: MCCHistoryRecord[];
4
- total: number;
5
- page: number;
6
- page_size: number;
7
- }
1
+ import type { MCCHistoryRecord, PaginatedResult } from '@microcosmmoney/auth-core';
8
2
  export declare function useMCCHistory(params?: {
9
3
  tx_type?: string;
10
4
  page?: number;
11
5
  page_size?: number;
12
6
  }): {
13
- data: PaginatedResult | null;
7
+ data: PaginatedResult<MCCHistoryRecord> | null;
14
8
  loading: boolean;
15
9
  error: Error | null;
16
10
  refresh: () => Promise<void>;
17
11
  };
18
- export {};
@@ -0,0 +1,3 @@
1
+ export declare function useMCCHolders(options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMCCHolders = useMCCHolders;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useMCCHolders(options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: '/reincarnation/holders',
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -0,0 +1,3 @@
1
+ export declare function useMCCMiningHistory(days?: number, options?: {
2
+ refetchInterval?: number;
3
+ }): import("./use-api-query").UseApiQueryResult<any[]>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useMCCMiningHistory = useMCCMiningHistory;
4
+ // AI-generated · AI-managed · AI-maintained
5
+ const use_api_query_1 = require("./use-api-query");
6
+ function useMCCMiningHistory(days = 30, options) {
7
+ return (0, use_api_query_1.useApiQuery)({
8
+ path: `/reincarnation/mining-history?days=${days}`,
9
+ refetchInterval: options?.refetchInterval ?? 300000,
10
+ });
11
+ }
@@ -1,3 +1,4 @@
1
+ import type { MCCStats } from '@microcosmmoney/auth-core';
1
2
  export declare function useMCCStats(options?: {
2
3
  refetchInterval?: number;
3
- }): import("./use-api-query").UseApiQueryResult<any>;
4
+ }): import("./use-api-query").UseApiQueryResult<MCCStats>;
@@ -19,7 +19,7 @@ function useMCD(refreshInterval) {
19
19
  setLoading(true);
20
20
  const api = client.getApiClient();
21
21
  const data = await api.get('/mcd/balance');
22
- setBalance(data.data?.attributes || null);
22
+ setBalance(data.data || null);
23
23
  setError(null);
24
24
  }
25
25
  catch (err) {
@@ -1,6 +1,6 @@
1
- import type { MiningDistribution } from '@microcosmmoney/auth-core';
1
+ import type { MiningDistribution, PaginatedResult } from '@microcosmmoney/auth-core';
2
2
  export declare function useMiningDistribution(options?: {
3
3
  page?: number;
4
4
  pageSize?: number;
5
5
  refetchInterval?: number;
6
- }): import("./use-api-query").UseApiQueryResult<MiningDistribution[]>;
6
+ }): import("./use-api-query").UseApiQueryResult<PaginatedResult<MiningDistribution>>;
@@ -0,0 +1,22 @@
1
+ export type MiningFlowStep = 'idle' | 'requesting' | 'confirming' | 'signing' | 'completed' | 'error';
2
+ export interface MiningFlowState {
3
+ step: MiningFlowStep;
4
+ requestData: any | null;
5
+ confirmData: any | null;
6
+ txSignature: string | null;
7
+ error: string | null;
8
+ }
9
+ export declare function useMiningFlow(): {
10
+ startMining: (params: {
11
+ amount: number;
12
+ wallet_address: string;
13
+ stablecoin?: "USDT" | "USDC";
14
+ }) => Promise<any>;
15
+ confirmMining: (requestId: string, txSignature: string) => Promise<any>;
16
+ reset: () => void;
17
+ step: MiningFlowStep;
18
+ requestData: any | null;
19
+ confirmData: any | null;
20
+ txSignature: string | null;
21
+ error: string | null;
22
+ };