@mobula_labs/types 0.1.4 → 0.1.5
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/cjs/index.cjs +8 -31
- package/dist/cjs/index.cjs.map +6 -6
- package/dist/esm/index.js +8 -31
- package/dist/esm/index.js.map +6 -6
- package/dist/v1/wallet/HistorySchema.d.ts +3 -21
- package/dist/v1/wallet/WalletPortfolioSchema.d.ts +26 -12
- package/dist/v1/wallet/WalletTransactionSchema.d.ts +4 -4
- package/dist/v2/explorer/BlockDataQuerySchema.d.ts +33 -0
- package/dist/v2/explorer/ContractVerifyQuerySchema.ts +27 -0
- package/dist/v2/market/MarketDetailsSchema.d.ts +6 -60
- package/dist/v2/wallet/WalletDefiPositionsSchema.d.ts +156 -0
- package/package.json +2 -2
|
@@ -2,16 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const WalletHistoryParamsSchema: z.ZodObject<{
|
|
3
3
|
wallet: z.ZodOptional<z.ZodString>;
|
|
4
4
|
wallets: z.ZodOptional<z.ZodString>;
|
|
5
|
-
portfolio: z.ZodOptional<z.ZodString>;
|
|
6
5
|
blockchains: z.ZodOptional<z.ZodString>;
|
|
7
|
-
asset: z.ZodOptional<z.ZodString>;
|
|
8
|
-
pnl: z.ZodOptional<z.ZodString>;
|
|
9
|
-
cache: z.ZodOptional<z.ZodString>;
|
|
10
|
-
stale: z.ZodOptional<z.ZodString>;
|
|
11
|
-
recheck_contract: z.ZodOptional<z.ZodString>;
|
|
12
6
|
from: z.ZodOptional<z.ZodString>;
|
|
13
7
|
to: z.ZodOptional<z.ZodString>;
|
|
14
|
-
portfolio_settings: z.ZodOptional<z.ZodString>;
|
|
15
8
|
unlistedAssets: z.ZodOptional<z.ZodString>;
|
|
16
9
|
period: z.ZodOptional<z.ZodString>;
|
|
17
10
|
accuracy: z.ZodOptional<z.ZodString>;
|
|
@@ -20,22 +13,17 @@ export declare const WalletHistoryParamsSchema: z.ZodObject<{
|
|
|
20
13
|
filterSpam: z.ZodOptional<z.ZodString>;
|
|
21
14
|
fetchUntrackedHistory: z.ZodOptional<z.ZodString>;
|
|
22
15
|
fetchAllChains: z.ZodOptional<z.ZodString>;
|
|
16
|
+
shouldFetchPriceChange: z.ZodOptional<z.ZodString>;
|
|
23
17
|
backfillTransfers: z.ZodOptional<z.ZodString>;
|
|
24
18
|
}, "strip", z.ZodTypeAny, {
|
|
25
19
|
blockchains?: string | undefined;
|
|
26
20
|
testnet?: string | undefined;
|
|
27
|
-
|
|
21
|
+
shouldFetchPriceChange?: string | undefined;
|
|
28
22
|
from?: string | undefined;
|
|
29
23
|
to?: string | undefined;
|
|
30
24
|
period?: string | undefined;
|
|
31
25
|
wallet?: string | undefined;
|
|
32
26
|
wallets?: string | undefined;
|
|
33
|
-
portfolio?: string | undefined;
|
|
34
|
-
pnl?: string | undefined;
|
|
35
|
-
cache?: string | undefined;
|
|
36
|
-
stale?: string | undefined;
|
|
37
|
-
recheck_contract?: string | undefined;
|
|
38
|
-
portfolio_settings?: string | undefined;
|
|
39
27
|
unlistedAssets?: string | undefined;
|
|
40
28
|
accuracy?: string | undefined;
|
|
41
29
|
minliq?: string | undefined;
|
|
@@ -46,18 +34,12 @@ export declare const WalletHistoryParamsSchema: z.ZodObject<{
|
|
|
46
34
|
}, {
|
|
47
35
|
blockchains?: string | undefined;
|
|
48
36
|
testnet?: string | undefined;
|
|
49
|
-
|
|
37
|
+
shouldFetchPriceChange?: string | undefined;
|
|
50
38
|
from?: string | undefined;
|
|
51
39
|
to?: string | undefined;
|
|
52
40
|
period?: string | undefined;
|
|
53
41
|
wallet?: string | undefined;
|
|
54
42
|
wallets?: string | undefined;
|
|
55
|
-
portfolio?: string | undefined;
|
|
56
|
-
pnl?: string | undefined;
|
|
57
|
-
cache?: string | undefined;
|
|
58
|
-
stale?: string | undefined;
|
|
59
|
-
recheck_contract?: string | undefined;
|
|
60
|
-
portfolio_settings?: string | undefined;
|
|
61
43
|
unlistedAssets?: string | undefined;
|
|
62
44
|
accuracy?: string | undefined;
|
|
63
45
|
minliq?: string | undefined;
|
|
@@ -236,6 +236,7 @@ export declare const PortfolioResponseSchema: z.ZodObject<{
|
|
|
236
236
|
price_change_24h: z.ZodNumber;
|
|
237
237
|
estimated_balance: z.ZodNumber;
|
|
238
238
|
price: z.ZodNumber;
|
|
239
|
+
liquidity: z.ZodNumber;
|
|
239
240
|
token_balance: z.ZodNumber;
|
|
240
241
|
allocation: z.ZodNumber;
|
|
241
242
|
asset: z.ZodObject<{
|
|
@@ -272,6 +273,7 @@ export declare const PortfolioResponseSchema: z.ZodObject<{
|
|
|
272
273
|
max_buy_price: z.ZodOptional<z.ZodNumber>;
|
|
273
274
|
}, "strip", z.ZodTypeAny, {
|
|
274
275
|
price: number;
|
|
276
|
+
liquidity: number;
|
|
275
277
|
price_change_24h: number;
|
|
276
278
|
asset: {
|
|
277
279
|
symbol: string;
|
|
@@ -330,6 +332,7 @@ export declare const PortfolioResponseSchema: z.ZodObject<{
|
|
|
330
332
|
max_buy_price?: number | undefined;
|
|
331
333
|
}, {
|
|
332
334
|
price: number;
|
|
335
|
+
liquidity: number;
|
|
333
336
|
price_change_24h: number;
|
|
334
337
|
asset: {
|
|
335
338
|
symbol: string;
|
|
@@ -571,6 +574,7 @@ export declare const PortfolioResponseSchema: z.ZodObject<{
|
|
|
571
574
|
}, "strip", z.ZodTypeAny, {
|
|
572
575
|
assets: {
|
|
573
576
|
price: number;
|
|
577
|
+
liquidity: number;
|
|
574
578
|
price_change_24h: number;
|
|
575
579
|
asset: {
|
|
576
580
|
symbol: string;
|
|
@@ -682,6 +686,7 @@ export declare const PortfolioResponseSchema: z.ZodObject<{
|
|
|
682
686
|
}, {
|
|
683
687
|
assets: {
|
|
684
688
|
price: number;
|
|
689
|
+
liquidity: number;
|
|
685
690
|
price_change_24h: number;
|
|
686
691
|
asset: {
|
|
687
692
|
symbol: string;
|
|
@@ -796,6 +801,7 @@ export declare const PortfolioResponseSchema: z.ZodObject<{
|
|
|
796
801
|
data: {
|
|
797
802
|
assets: {
|
|
798
803
|
price: number;
|
|
804
|
+
liquidity: number;
|
|
799
805
|
price_change_24h: number;
|
|
800
806
|
asset: {
|
|
801
807
|
symbol: string;
|
|
@@ -910,6 +916,7 @@ export declare const PortfolioResponseSchema: z.ZodObject<{
|
|
|
910
916
|
data: {
|
|
911
917
|
assets: {
|
|
912
918
|
price: number;
|
|
919
|
+
liquidity: number;
|
|
913
920
|
price_change_24h: number;
|
|
914
921
|
asset: {
|
|
915
922
|
symbol: string;
|
|
@@ -1174,6 +1181,7 @@ export declare const MultiPortfolioResponseSchema: z.ZodObject<{
|
|
|
1174
1181
|
price_change_24h: z.ZodNumber;
|
|
1175
1182
|
estimated_balance: z.ZodNumber;
|
|
1176
1183
|
price: z.ZodNumber;
|
|
1184
|
+
liquidity: z.ZodNumber;
|
|
1177
1185
|
token_balance: z.ZodNumber;
|
|
1178
1186
|
allocation: z.ZodNumber;
|
|
1179
1187
|
asset: z.ZodObject<{
|
|
@@ -1210,6 +1218,7 @@ export declare const MultiPortfolioResponseSchema: z.ZodObject<{
|
|
|
1210
1218
|
max_buy_price: z.ZodOptional<z.ZodNumber>;
|
|
1211
1219
|
}, "strip", z.ZodTypeAny, {
|
|
1212
1220
|
price: number;
|
|
1221
|
+
liquidity: number;
|
|
1213
1222
|
price_change_24h: number;
|
|
1214
1223
|
asset: {
|
|
1215
1224
|
symbol: string;
|
|
@@ -1268,6 +1277,7 @@ export declare const MultiPortfolioResponseSchema: z.ZodObject<{
|
|
|
1268
1277
|
max_buy_price?: number | undefined;
|
|
1269
1278
|
}, {
|
|
1270
1279
|
price: number;
|
|
1280
|
+
liquidity: number;
|
|
1271
1281
|
price_change_24h: number;
|
|
1272
1282
|
asset: {
|
|
1273
1283
|
symbol: string;
|
|
@@ -1509,6 +1519,7 @@ export declare const MultiPortfolioResponseSchema: z.ZodObject<{
|
|
|
1509
1519
|
}, "strip", z.ZodTypeAny, {
|
|
1510
1520
|
assets: {
|
|
1511
1521
|
price: number;
|
|
1522
|
+
liquidity: number;
|
|
1512
1523
|
price_change_24h: number;
|
|
1513
1524
|
asset: {
|
|
1514
1525
|
symbol: string;
|
|
@@ -1620,6 +1631,7 @@ export declare const MultiPortfolioResponseSchema: z.ZodObject<{
|
|
|
1620
1631
|
}, {
|
|
1621
1632
|
assets: {
|
|
1622
1633
|
price: number;
|
|
1634
|
+
liquidity: number;
|
|
1623
1635
|
price_change_24h: number;
|
|
1624
1636
|
asset: {
|
|
1625
1637
|
symbol: string;
|
|
@@ -1734,6 +1746,7 @@ export declare const MultiPortfolioResponseSchema: z.ZodObject<{
|
|
|
1734
1746
|
data: {
|
|
1735
1747
|
assets: {
|
|
1736
1748
|
price: number;
|
|
1749
|
+
liquidity: number;
|
|
1737
1750
|
price_change_24h: number;
|
|
1738
1751
|
asset: {
|
|
1739
1752
|
symbol: string;
|
|
@@ -1848,6 +1861,7 @@ export declare const MultiPortfolioResponseSchema: z.ZodObject<{
|
|
|
1848
1861
|
data: {
|
|
1849
1862
|
assets: {
|
|
1850
1863
|
price: number;
|
|
1864
|
+
liquidity: number;
|
|
1851
1865
|
price_change_24h: number;
|
|
1852
1866
|
asset: {
|
|
1853
1867
|
symbol: string;
|
|
@@ -2580,12 +2594,6 @@ export declare const PortfolioParamsSchema: z.ZodObject<{
|
|
|
2580
2594
|
period?: string | undefined;
|
|
2581
2595
|
wallet?: string | undefined;
|
|
2582
2596
|
wallets?: string | undefined;
|
|
2583
|
-
portfolio?: string | undefined;
|
|
2584
|
-
pnl?: string | undefined;
|
|
2585
|
-
cache?: string | undefined;
|
|
2586
|
-
stale?: string | undefined;
|
|
2587
|
-
recheck_contract?: string | undefined;
|
|
2588
|
-
portfolio_settings?: string | undefined;
|
|
2589
2597
|
unlistedAssets?: string | undefined;
|
|
2590
2598
|
accuracy?: string | undefined;
|
|
2591
2599
|
minliq?: string | undefined;
|
|
@@ -2593,7 +2601,13 @@ export declare const PortfolioParamsSchema: z.ZodObject<{
|
|
|
2593
2601
|
fetchUntrackedHistory?: string | undefined;
|
|
2594
2602
|
fetchAllChains?: string | undefined;
|
|
2595
2603
|
backfillTransfers?: string | undefined;
|
|
2604
|
+
portfolio?: string | undefined;
|
|
2605
|
+
cache?: string | undefined;
|
|
2606
|
+
stale?: string | undefined;
|
|
2607
|
+
recheck_contract?: string | undefined;
|
|
2608
|
+
portfolio_settings?: string | undefined;
|
|
2596
2609
|
fetchEmptyBalances?: string | undefined;
|
|
2610
|
+
pnl?: string | undefined;
|
|
2597
2611
|
}, {
|
|
2598
2612
|
blockchains?: string | undefined;
|
|
2599
2613
|
testnet?: string | undefined;
|
|
@@ -2604,12 +2618,6 @@ export declare const PortfolioParamsSchema: z.ZodObject<{
|
|
|
2604
2618
|
period?: string | undefined;
|
|
2605
2619
|
wallet?: string | undefined;
|
|
2606
2620
|
wallets?: string | undefined;
|
|
2607
|
-
portfolio?: string | undefined;
|
|
2608
|
-
pnl?: string | undefined;
|
|
2609
|
-
cache?: string | undefined;
|
|
2610
|
-
stale?: string | undefined;
|
|
2611
|
-
recheck_contract?: string | undefined;
|
|
2612
|
-
portfolio_settings?: string | undefined;
|
|
2613
2621
|
unlistedAssets?: string | undefined;
|
|
2614
2622
|
accuracy?: string | undefined;
|
|
2615
2623
|
minliq?: string | undefined;
|
|
@@ -2617,7 +2625,13 @@ export declare const PortfolioParamsSchema: z.ZodObject<{
|
|
|
2617
2625
|
fetchUntrackedHistory?: string | undefined;
|
|
2618
2626
|
fetchAllChains?: string | undefined;
|
|
2619
2627
|
backfillTransfers?: string | undefined;
|
|
2628
|
+
portfolio?: string | undefined;
|
|
2629
|
+
cache?: string | undefined;
|
|
2630
|
+
stale?: string | undefined;
|
|
2631
|
+
recheck_contract?: string | undefined;
|
|
2632
|
+
portfolio_settings?: string | undefined;
|
|
2620
2633
|
fetchEmptyBalances?: string | undefined;
|
|
2634
|
+
pnl?: string | undefined;
|
|
2621
2635
|
}>;
|
|
2622
2636
|
export type PortfolioParams = z.input<typeof PortfolioParamsSchema>;
|
|
2623
2637
|
export declare const PortfolioDefiParamsSchema: z.ZodObject<{
|
|
@@ -30,10 +30,10 @@ export declare const WalletTransactionsParamsSchema: z.ZodObject<{
|
|
|
30
30
|
pagination?: string | undefined;
|
|
31
31
|
page?: string | undefined;
|
|
32
32
|
wallets?: string | undefined;
|
|
33
|
-
cache?: string | undefined;
|
|
34
|
-
stale?: string | undefined;
|
|
35
33
|
unlistedAssets?: string | undefined;
|
|
36
34
|
filterSpam?: string | undefined;
|
|
35
|
+
cache?: string | undefined;
|
|
36
|
+
stale?: string | undefined;
|
|
37
37
|
order?: string | undefined;
|
|
38
38
|
recheckContract?: string | undefined;
|
|
39
39
|
trades?: string | undefined;
|
|
@@ -50,10 +50,10 @@ export declare const WalletTransactionsParamsSchema: z.ZodObject<{
|
|
|
50
50
|
pagination?: string | undefined;
|
|
51
51
|
page?: string | undefined;
|
|
52
52
|
wallets?: string | undefined;
|
|
53
|
-
cache?: string | undefined;
|
|
54
|
-
stale?: string | undefined;
|
|
55
53
|
unlistedAssets?: string | undefined;
|
|
56
54
|
filterSpam?: string | undefined;
|
|
55
|
+
cache?: string | undefined;
|
|
56
|
+
stale?: string | undefined;
|
|
57
57
|
order?: string | undefined;
|
|
58
58
|
recheckContract?: string | undefined;
|
|
59
59
|
trades?: string | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BlockDataQuerySchema: z.ZodObject<{
|
|
3
|
+
limit: z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>;
|
|
4
|
+
blockchain: z.ZodOptional<z.ZodString>;
|
|
5
|
+
order: z.ZodDefault<z.ZodOptional<z.ZodEnum<["ASC", "DESC"]>>>;
|
|
6
|
+
page: z.ZodEffects<z.ZodOptional<z.ZodString>, number, string | undefined>;
|
|
7
|
+
pagination: z.ZodEffects<z.ZodOptional<z.ZodString>, boolean, string | undefined>;
|
|
8
|
+
blockId: z.ZodEffects<z.ZodOptional<z.ZodString>, string | number | undefined, string | undefined>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
limit: number;
|
|
11
|
+
pagination: boolean;
|
|
12
|
+
page: number;
|
|
13
|
+
order: "ASC" | "DESC";
|
|
14
|
+
blockchain?: string | undefined;
|
|
15
|
+
blockId?: string | number | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
blockchain?: string | undefined;
|
|
18
|
+
limit?: string | undefined;
|
|
19
|
+
pagination?: string | undefined;
|
|
20
|
+
page?: string | undefined;
|
|
21
|
+
order?: "ASC" | "DESC" | undefined;
|
|
22
|
+
blockId?: string | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const RawBlockSpecificQueryParamsSchema: z.ZodObject<{
|
|
25
|
+
blockId: z.ZodEffects<z.ZodString, string | number | undefined, string>;
|
|
26
|
+
blockchain: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
blockchain?: string | undefined;
|
|
29
|
+
blockId?: string | number | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
blockId: string;
|
|
32
|
+
blockchain?: string | undefined;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// Define the Zod schema for contract verification query
|
|
4
|
+
export const ContractVerifyQuerySchema = z.object({
|
|
5
|
+
blockchain: z
|
|
6
|
+
.string(),
|
|
7
|
+
sourceCode: z.string().optional(),
|
|
8
|
+
contractAddress: z.string().min(1, 'Contract address is required and cannot be empty'),
|
|
9
|
+
compilerVersion: z.string().min(1, 'Pragma version is required and cannot be empty'),
|
|
10
|
+
constructorArguments: z.string().optional(),
|
|
11
|
+
optimizationUsed: z.string().optional(),
|
|
12
|
+
runs: z.string().optional(),
|
|
13
|
+
evmVersion: z.string().optional(),
|
|
14
|
+
contractName: z.string(),
|
|
15
|
+
|
|
16
|
+
codeFormat: z.string(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type ContractVerifyQuery = z.infer<typeof ContractVerifyQuerySchema>;
|
|
20
|
+
|
|
21
|
+
export const ContractInterfaceQuery = z.object({
|
|
22
|
+
blockchain: z
|
|
23
|
+
.string(),
|
|
24
|
+
contractAddress: z.string().min(1, 'Contract address is required and cannot be empty'),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type ContractInterfaceQuery = z.infer<typeof ContractInterfaceQuery>;
|
|
@@ -3,152 +3,98 @@ declare const MarketDetailsParamsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
3
3
|
blockchain: z.ZodOptional<z.ZodString>;
|
|
4
4
|
address: z.ZodOptional<z.ZodString>;
|
|
5
5
|
baseToken: z.ZodOptional<z.ZodString>;
|
|
6
|
-
currencies: z.
|
|
7
|
-
stats: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>, boolean, string | boolean | undefined>;
|
|
8
|
-
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
-
instanceTracking: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
|
|
6
|
+
currencies: z.ZodOptional<z.ZodString>;
|
|
10
7
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
stats: boolean;
|
|
12
|
-
force: boolean;
|
|
13
|
-
currencies: ("USD" | "EUR" | "GBP" | "JPY" | "CHF" | "CAD" | "AUD" | "CNY" | "KRW" | "INR" | "BRL")[];
|
|
14
8
|
address?: string | undefined;
|
|
15
9
|
blockchain?: string | undefined;
|
|
16
10
|
baseToken?: string | undefined;
|
|
17
|
-
|
|
11
|
+
currencies?: string | undefined;
|
|
18
12
|
}, {
|
|
19
13
|
address?: string | undefined;
|
|
20
14
|
blockchain?: string | undefined;
|
|
21
15
|
baseToken?: string | undefined;
|
|
22
|
-
stats?: string | boolean | undefined;
|
|
23
|
-
force?: boolean | undefined;
|
|
24
|
-
instanceTracking?: unknown;
|
|
25
16
|
currencies?: string | undefined;
|
|
26
17
|
}>, {
|
|
27
18
|
blockchain: string | undefined;
|
|
28
19
|
address: string | undefined;
|
|
29
20
|
baseToken: string | undefined;
|
|
30
21
|
currencies: ("USD" | "EUR" | "GBP" | "JPY" | "CHF" | "CAD" | "AUD" | "CNY" | "KRW" | "INR" | "BRL")[];
|
|
31
|
-
stats: boolean;
|
|
32
|
-
force: boolean;
|
|
33
|
-
instanceTracking: boolean | undefined;
|
|
34
22
|
asset: string | undefined;
|
|
35
23
|
}, {
|
|
36
24
|
address?: string | undefined;
|
|
37
25
|
blockchain?: string | undefined;
|
|
38
26
|
baseToken?: string | undefined;
|
|
39
|
-
stats?: string | boolean | undefined;
|
|
40
|
-
force?: boolean | undefined;
|
|
41
|
-
instanceTracking?: unknown;
|
|
42
27
|
currencies?: string | undefined;
|
|
43
28
|
}>;
|
|
44
29
|
declare const MarketDetailsBatchParamsSchema: z.ZodUnion<[z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
45
30
|
blockchain: z.ZodOptional<z.ZodString>;
|
|
46
31
|
address: z.ZodOptional<z.ZodString>;
|
|
47
32
|
baseToken: z.ZodOptional<z.ZodString>;
|
|
48
|
-
currencies: z.
|
|
49
|
-
stats: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>, boolean, string | boolean | undefined>;
|
|
50
|
-
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
51
|
-
instanceTracking: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
|
|
33
|
+
currencies: z.ZodOptional<z.ZodString>;
|
|
52
34
|
}, "strip", z.ZodTypeAny, {
|
|
53
|
-
stats: boolean;
|
|
54
|
-
force: boolean;
|
|
55
|
-
currencies: ("USD" | "EUR" | "GBP" | "JPY" | "CHF" | "CAD" | "AUD" | "CNY" | "KRW" | "INR" | "BRL")[];
|
|
56
35
|
address?: string | undefined;
|
|
57
36
|
blockchain?: string | undefined;
|
|
58
37
|
baseToken?: string | undefined;
|
|
59
|
-
|
|
38
|
+
currencies?: string | undefined;
|
|
60
39
|
}, {
|
|
61
40
|
address?: string | undefined;
|
|
62
41
|
blockchain?: string | undefined;
|
|
63
42
|
baseToken?: string | undefined;
|
|
64
|
-
stats?: string | boolean | undefined;
|
|
65
|
-
force?: boolean | undefined;
|
|
66
|
-
instanceTracking?: unknown;
|
|
67
43
|
currencies?: string | undefined;
|
|
68
44
|
}>, {
|
|
69
45
|
blockchain: string | undefined;
|
|
70
46
|
address: string | undefined;
|
|
71
47
|
baseToken: string | undefined;
|
|
72
48
|
currencies: ("USD" | "EUR" | "GBP" | "JPY" | "CHF" | "CAD" | "AUD" | "CNY" | "KRW" | "INR" | "BRL")[];
|
|
73
|
-
stats: boolean;
|
|
74
|
-
force: boolean;
|
|
75
|
-
instanceTracking: boolean | undefined;
|
|
76
49
|
asset: string | undefined;
|
|
77
50
|
}, {
|
|
78
51
|
address?: string | undefined;
|
|
79
52
|
blockchain?: string | undefined;
|
|
80
53
|
baseToken?: string | undefined;
|
|
81
|
-
stats?: string | boolean | undefined;
|
|
82
|
-
force?: boolean | undefined;
|
|
83
|
-
instanceTracking?: unknown;
|
|
84
54
|
currencies?: string | undefined;
|
|
85
55
|
}>, "many">, z.ZodObject<{
|
|
86
56
|
items: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
87
57
|
blockchain: z.ZodOptional<z.ZodString>;
|
|
88
58
|
address: z.ZodOptional<z.ZodString>;
|
|
89
59
|
baseToken: z.ZodOptional<z.ZodString>;
|
|
90
|
-
currencies: z.
|
|
91
|
-
stats: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>, boolean, string | boolean | undefined>;
|
|
92
|
-
force: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
93
|
-
instanceTracking: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
|
|
60
|
+
currencies: z.ZodOptional<z.ZodString>;
|
|
94
61
|
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
stats: boolean;
|
|
96
|
-
force: boolean;
|
|
97
|
-
currencies: ("USD" | "EUR" | "GBP" | "JPY" | "CHF" | "CAD" | "AUD" | "CNY" | "KRW" | "INR" | "BRL")[];
|
|
98
62
|
address?: string | undefined;
|
|
99
63
|
blockchain?: string | undefined;
|
|
100
64
|
baseToken?: string | undefined;
|
|
101
|
-
|
|
65
|
+
currencies?: string | undefined;
|
|
102
66
|
}, {
|
|
103
67
|
address?: string | undefined;
|
|
104
68
|
blockchain?: string | undefined;
|
|
105
69
|
baseToken?: string | undefined;
|
|
106
|
-
stats?: string | boolean | undefined;
|
|
107
|
-
force?: boolean | undefined;
|
|
108
|
-
instanceTracking?: unknown;
|
|
109
70
|
currencies?: string | undefined;
|
|
110
71
|
}>, {
|
|
111
72
|
blockchain: string | undefined;
|
|
112
73
|
address: string | undefined;
|
|
113
74
|
baseToken: string | undefined;
|
|
114
75
|
currencies: ("USD" | "EUR" | "GBP" | "JPY" | "CHF" | "CAD" | "AUD" | "CNY" | "KRW" | "INR" | "BRL")[];
|
|
115
|
-
stats: boolean;
|
|
116
|
-
force: boolean;
|
|
117
|
-
instanceTracking: boolean | undefined;
|
|
118
76
|
asset: string | undefined;
|
|
119
77
|
}, {
|
|
120
78
|
address?: string | undefined;
|
|
121
79
|
blockchain?: string | undefined;
|
|
122
80
|
baseToken?: string | undefined;
|
|
123
|
-
stats?: string | boolean | undefined;
|
|
124
|
-
force?: boolean | undefined;
|
|
125
|
-
instanceTracking?: unknown;
|
|
126
81
|
currencies?: string | undefined;
|
|
127
82
|
}>, "many">;
|
|
128
|
-
instanceTracking: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
|
|
129
83
|
}, "strip", z.ZodTypeAny, {
|
|
130
84
|
items: {
|
|
131
85
|
blockchain: string | undefined;
|
|
132
86
|
address: string | undefined;
|
|
133
87
|
baseToken: string | undefined;
|
|
134
88
|
currencies: ("USD" | "EUR" | "GBP" | "JPY" | "CHF" | "CAD" | "AUD" | "CNY" | "KRW" | "INR" | "BRL")[];
|
|
135
|
-
stats: boolean;
|
|
136
|
-
force: boolean;
|
|
137
|
-
instanceTracking: boolean | undefined;
|
|
138
89
|
asset: string | undefined;
|
|
139
90
|
}[];
|
|
140
|
-
instanceTracking?: boolean | undefined;
|
|
141
91
|
}, {
|
|
142
92
|
items: {
|
|
143
93
|
address?: string | undefined;
|
|
144
94
|
blockchain?: string | undefined;
|
|
145
95
|
baseToken?: string | undefined;
|
|
146
|
-
stats?: string | boolean | undefined;
|
|
147
|
-
force?: boolean | undefined;
|
|
148
|
-
instanceTracking?: unknown;
|
|
149
96
|
currencies?: string | undefined;
|
|
150
97
|
}[];
|
|
151
|
-
instanceTracking?: unknown;
|
|
152
98
|
}>]>;
|
|
153
99
|
export type MarketDetailsParams = z.input<typeof MarketDetailsParamsSchema>;
|
|
154
100
|
export type MarketDetailsInferType = z.infer<typeof MarketDetailsParamsSchema>;
|
|
@@ -10,3 +10,159 @@ export declare const WalletDefiPositionsParamsSchema: z.ZodObject<{
|
|
|
10
10
|
wallet: string;
|
|
11
11
|
}>;
|
|
12
12
|
export type WalletDefiPositionsParams = z.infer<typeof WalletDefiPositionsParamsSchema>;
|
|
13
|
+
export type ProtocolCategory = 'lending' | 'lp' | 'liquid-staking' | 'native-staking' | 'restaking' | 'perps' | 'yield' | 'cdp' | 'streaming';
|
|
14
|
+
export type PositionType = 'deposit' | 'borrow' | 'liquidity' | 'stake' | 'leverage' | 'collateral' | 'debt' | 'vesting' | 'streaming' | 'order';
|
|
15
|
+
export interface TokenAmount {
|
|
16
|
+
address: string;
|
|
17
|
+
symbol: string;
|
|
18
|
+
name: string;
|
|
19
|
+
decimals: number;
|
|
20
|
+
amountRaw: string;
|
|
21
|
+
amountFormatted: number;
|
|
22
|
+
priceUSD: number;
|
|
23
|
+
valueUSD: number;
|
|
24
|
+
logoUri?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface LendingMetadata {
|
|
27
|
+
type: 'lending';
|
|
28
|
+
market?: string;
|
|
29
|
+
healthFactor?: string;
|
|
30
|
+
liquidationThreshold?: string;
|
|
31
|
+
ltv?: string;
|
|
32
|
+
supplyAPY?: string;
|
|
33
|
+
baseSupplyAPY?: string;
|
|
34
|
+
tokenAPY?: string;
|
|
35
|
+
borrowAPY?: string;
|
|
36
|
+
baseBorrowAPY?: string;
|
|
37
|
+
utilizationRate?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface LiquidityMetadata {
|
|
40
|
+
type: 'liquidity';
|
|
41
|
+
poolAddress: string;
|
|
42
|
+
poolName: string;
|
|
43
|
+
poolType: 'amm' | 'clmm' | 'dlmm';
|
|
44
|
+
shareOfPool?: string;
|
|
45
|
+
fee24h?: string;
|
|
46
|
+
apy?: string;
|
|
47
|
+
tickLower?: number;
|
|
48
|
+
tickUpper?: number;
|
|
49
|
+
inRange?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface LiquidStakingMetadata {
|
|
52
|
+
type: 'liquid-staking';
|
|
53
|
+
lstMint: string;
|
|
54
|
+
lstSymbol: string;
|
|
55
|
+
exchangeRate: string;
|
|
56
|
+
apy?: string;
|
|
57
|
+
unstakePending?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface PerpMetadata {
|
|
60
|
+
type: 'perp';
|
|
61
|
+
id: string;
|
|
62
|
+
marketId: string;
|
|
63
|
+
exchange: 'drift' | 'gains' | 'hyperliquid' | 'gte' | 'lighter';
|
|
64
|
+
side: 'BUY' | 'SELL';
|
|
65
|
+
entryPriceQuote: number;
|
|
66
|
+
currentPriceQuote: number;
|
|
67
|
+
currentLeverage: number;
|
|
68
|
+
liquidationPriceQuote: number;
|
|
69
|
+
amountUSD: number;
|
|
70
|
+
amountRaw: string;
|
|
71
|
+
realizedPnlUSD: number;
|
|
72
|
+
unrealizedPnlUSD: number;
|
|
73
|
+
realizedPnlPercent: number;
|
|
74
|
+
unrealizedPnlPercent: number;
|
|
75
|
+
feesOpeningUSD: number;
|
|
76
|
+
feesClosingUSD: number;
|
|
77
|
+
feesFundingUSD: number;
|
|
78
|
+
tp: Array<{
|
|
79
|
+
size: string;
|
|
80
|
+
price: number;
|
|
81
|
+
id: number;
|
|
82
|
+
}>;
|
|
83
|
+
sl: Array<{
|
|
84
|
+
size: string;
|
|
85
|
+
price: number;
|
|
86
|
+
id: number;
|
|
87
|
+
}>;
|
|
88
|
+
openDate?: string;
|
|
89
|
+
lastUpdate?: string;
|
|
90
|
+
address: string;
|
|
91
|
+
chainId: string;
|
|
92
|
+
collateralAsset: string;
|
|
93
|
+
}
|
|
94
|
+
export interface StreamingMetadata {
|
|
95
|
+
type: 'streaming';
|
|
96
|
+
streamType: 'vesting' | 'payment';
|
|
97
|
+
sender?: string;
|
|
98
|
+
recipient?: string;
|
|
99
|
+
startTime: string;
|
|
100
|
+
endTime: string;
|
|
101
|
+
amountPerSecond: string;
|
|
102
|
+
amountClaimed: string;
|
|
103
|
+
amountRemaining: string;
|
|
104
|
+
cliffDate?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface NativeStakingMetadata {
|
|
107
|
+
type: 'native-staking';
|
|
108
|
+
stakeAccountAddress: string;
|
|
109
|
+
validatorVoteAccount: string;
|
|
110
|
+
validatorName?: string;
|
|
111
|
+
validatorCommission?: number;
|
|
112
|
+
activationState: 'activating' | 'active' | 'deactivating' | 'inactive';
|
|
113
|
+
activationEpoch?: number;
|
|
114
|
+
deactivationEpoch?: number;
|
|
115
|
+
currentEpoch: number;
|
|
116
|
+
apy?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface RestakingMetadata {
|
|
119
|
+
type: 'restaking';
|
|
120
|
+
strategyAddress: string;
|
|
121
|
+
strategyName: string;
|
|
122
|
+
underlyingToken: string;
|
|
123
|
+
underlyingSymbol: string;
|
|
124
|
+
operatorAddress?: string;
|
|
125
|
+
isDelegated: boolean;
|
|
126
|
+
sharesRaw: string;
|
|
127
|
+
}
|
|
128
|
+
export type PositionMetadata = LendingMetadata | LiquidityMetadata | LiquidStakingMetadata | NativeStakingMetadata | RestakingMetadata | PerpMetadata | StreamingMetadata;
|
|
129
|
+
export interface Position {
|
|
130
|
+
id: string;
|
|
131
|
+
type: PositionType;
|
|
132
|
+
name: string;
|
|
133
|
+
valueUSD: number;
|
|
134
|
+
tokens: TokenAmount[];
|
|
135
|
+
rewards?: TokenAmount[];
|
|
136
|
+
metadata?: PositionMetadata;
|
|
137
|
+
createdAt?: string;
|
|
138
|
+
updatedAt?: string;
|
|
139
|
+
}
|
|
140
|
+
export interface Protocol {
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
url: string;
|
|
144
|
+
category: ProtocolCategory;
|
|
145
|
+
}
|
|
146
|
+
export interface ProtocolPosition {
|
|
147
|
+
protocol: Protocol;
|
|
148
|
+
totalValueUSD: string;
|
|
149
|
+
positions: Position[];
|
|
150
|
+
}
|
|
151
|
+
export interface WalletDefiPositionsData {
|
|
152
|
+
wallet: string;
|
|
153
|
+
fetchedAt: string;
|
|
154
|
+
totalValueUSD: string;
|
|
155
|
+
totalDepositedUSD: string;
|
|
156
|
+
totalBorrowedUSD: string;
|
|
157
|
+
totalRewardsUSD: string;
|
|
158
|
+
protocols: ProtocolPosition[];
|
|
159
|
+
}
|
|
160
|
+
export interface WalletDefiPositionsResponse {
|
|
161
|
+
data: WalletDefiPositionsData;
|
|
162
|
+
}
|
|
163
|
+
export interface WalletDefiPositionsErrorResponse {
|
|
164
|
+
error: {
|
|
165
|
+
code: string;
|
|
166
|
+
message: string;
|
|
167
|
+
};
|
|
168
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mobula_labs/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Centralized TypeScript types and schemas for Mobula SDK and applications.",
|
|
5
5
|
"author": "Mobula",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/bun": "*",
|
|
55
|
-
"@mobula/tsconfig": "
|
|
55
|
+
"@mobula/tsconfig": "0.0.0",
|
|
56
56
|
"@total-typescript/ts-reset": "*",
|
|
57
57
|
"typescript": "*",
|
|
58
58
|
"vitest": "*"
|