@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.
- package/dist/hooks/use-auction-bids.d.ts +4 -0
- package/dist/hooks/use-auction-bids.js +12 -0
- package/dist/hooks/use-auction-config.d.ts +3 -0
- package/dist/hooks/use-auction-config.js +11 -0
- package/dist/hooks/use-auction-detail.d.ts +2 -1
- package/dist/hooks/use-auction-end.d.ts +5 -0
- package/dist/hooks/use-auction-end.js +32 -0
- package/dist/hooks/use-auction-refund.d.ts +5 -0
- package/dist/hooks/use-auction-refund.js +32 -0
- package/dist/hooks/use-auctions.d.ts +10 -2
- package/dist/hooks/use-auctions.js +14 -1
- package/dist/hooks/use-buyback-flow.d.ts +22 -0
- package/dist/hooks/use-buyback-flow.js +46 -0
- package/dist/hooks/use-create-auction.d.ts +6 -0
- package/dist/hooks/use-create-auction.js +32 -0
- package/dist/hooks/use-dashboard-mining-history.d.ts +3 -0
- package/dist/hooks/use-dashboard-mining-history.js +11 -0
- package/dist/hooks/use-dashboard-summary.d.ts +4 -14
- package/dist/hooks/use-dashboard-territory-stats.d.ts +3 -0
- package/dist/hooks/use-dashboard-territory-stats.js +11 -0
- package/dist/hooks/use-dashboard-user-stats.d.ts +4 -0
- package/dist/hooks/use-dashboard-user-stats.js +11 -0
- package/dist/hooks/use-fragment-config.d.ts +3 -0
- package/dist/hooks/use-fragment-config.js +11 -0
- package/dist/hooks/use-fragment-vault-detail.d.ts +3 -0
- package/dist/hooks/use-fragment-vault-detail.js +12 -0
- package/dist/hooks/use-fragment-vaults.d.ts +3 -0
- package/dist/hooks/use-fragment-vaults.js +11 -0
- package/dist/hooks/use-lending-pool.d.ts +3 -0
- package/dist/hooks/use-lending-pool.js +11 -0
- package/dist/hooks/use-lending-position.d.ts +3 -0
- package/dist/hooks/use-lending-position.js +13 -0
- package/dist/hooks/use-lending-stats.d.ts +3 -0
- package/dist/hooks/use-lending-stats.js +11 -0
- package/dist/hooks/use-manager-income.d.ts +9 -0
- package/dist/hooks/use-manager-income.js +11 -0
- package/dist/hooks/use-market-data.d.ts +4 -0
- package/dist/hooks/use-market-data.js +11 -0
- package/dist/hooks/use-mcc-history.d.ts +2 -9
- package/dist/hooks/use-mcc-holders.d.ts +3 -0
- package/dist/hooks/use-mcc-holders.js +11 -0
- package/dist/hooks/use-mcc-mining-history.d.ts +3 -0
- package/dist/hooks/use-mcc-mining-history.js +11 -0
- package/dist/hooks/use-mcc-stats.d.ts +2 -1
- package/dist/hooks/use-mcd.js +1 -1
- package/dist/hooks/use-mining-distribution.d.ts +2 -2
- package/dist/hooks/use-mining-flow.d.ts +22 -0
- package/dist/hooks/use-mining-flow.js +46 -0
- package/dist/hooks/use-mining-history.d.ts +2 -1
- package/dist/hooks/use-mining-records.d.ts +2 -1
- package/dist/hooks/use-mining-stats.d.ts +2 -1
- package/dist/hooks/use-multi-wallet-balance.d.ts +15 -0
- package/dist/hooks/use-multi-wallet-balance.js +53 -0
- package/dist/hooks/use-notification-action.d.ts +10 -0
- package/dist/hooks/use-notification-action.js +49 -0
- package/dist/hooks/use-notifications.d.ts +13 -0
- package/dist/hooks/use-notifications.js +15 -0
- package/dist/hooks/use-organization-summary.d.ts +12 -0
- package/dist/hooks/use-organization-summary.js +12 -0
- package/dist/hooks/use-organization-tree.d.ts +4 -0
- package/dist/hooks/use-organization-tree.js +13 -0
- package/dist/hooks/use-organizations.d.ts +2 -1
- package/dist/hooks/use-platform-stats.d.ts +3 -0
- package/dist/hooks/use-platform-stats.js +11 -0
- package/dist/hooks/use-price-history.d.ts +2 -1
- package/dist/hooks/use-proposal-settle.d.ts +5 -0
- package/dist/hooks/use-proposal-settle.js +32 -0
- package/dist/hooks/use-solana-wallet.d.ts +16 -0
- package/dist/hooks/use-solana-wallet.js +56 -0
- package/dist/hooks/use-station-join.d.ts +5 -0
- package/dist/hooks/use-station-join.js +32 -0
- package/dist/hooks/use-station-leave.d.ts +5 -0
- package/dist/hooks/use-station-leave.js +32 -0
- package/dist/hooks/use-station-queue.d.ts +3 -0
- package/dist/hooks/use-station-queue.js +12 -0
- package/dist/hooks/use-team-custody.d.ts +18 -0
- package/dist/hooks/use-team-custody.js +11 -0
- package/dist/hooks/use-tech-tree-action.d.ts +6 -0
- package/dist/hooks/use-tech-tree-action.js +51 -0
- package/dist/hooks/use-tech-tree-bonus.d.ts +4 -0
- package/dist/hooks/use-tech-tree-bonus.js +12 -0
- package/dist/hooks/use-tech-tree-config.d.ts +4 -0
- package/dist/hooks/use-tech-tree-config.js +11 -0
- package/dist/hooks/use-tech-tree.d.ts +2 -1
- package/dist/hooks/use-territory-detailed-stats.d.ts +9 -0
- package/dist/hooks/use-territory-detailed-stats.js +12 -0
- package/dist/hooks/use-territory-distribution-plan.d.ts +16 -0
- package/dist/hooks/use-territory-distribution-plan.js +41 -0
- package/dist/hooks/use-territory-name-status.d.ts +10 -0
- package/dist/hooks/use-territory-name-status.js +13 -0
- package/dist/hooks/use-territory-nft-action.d.ts +15 -0
- package/dist/hooks/use-territory-nft-action.js +51 -0
- package/dist/hooks/use-territory-nft-collection.d.ts +3 -0
- package/dist/hooks/use-territory-nft-collection.js +11 -0
- package/dist/hooks/use-territory-nft-mint.d.ts +12 -0
- package/dist/hooks/use-territory-nft-mint.js +32 -0
- package/dist/hooks/use-user-level.d.ts +2 -8
- package/dist/hooks/use-user-stats.d.ts +2 -1
- package/dist/index.d.ts +43 -1
- package/dist/index.js +83 -1
- package/package.json +2 -2
|
@@ -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,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<
|
|
4
|
+
}): import("./use-api-query").UseApiQueryResult<AuctionDetail>;
|
|
@@ -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,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
|
-
|
|
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
|
-
}
|
|
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
|
|
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,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,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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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,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,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,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,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,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,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,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,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,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,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,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
|
+
}
|
package/dist/hooks/use-mcd.js
CHANGED
|
@@ -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
|
|
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
|
+
};
|