@argent/x-shared 1.40.0 → 1.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +342 -337
- package/dist/src/tokens/service/implementation.d.ts +101 -2
- package/dist/src/tokens/service/types/backend.model.cjs +1 -1
- package/dist/src/tokens/service/types/backend.model.d.ts +4290 -97
- package/dist/src/tokens/service/types/backend.model.js +59 -41
- package/dist/src/tokens/service/types/defiPosition.model.cjs +1 -1
- package/dist/src/tokens/service/types/defiPosition.model.d.ts +153 -93
- package/dist/src/tokens/service/types/defiPosition.model.js +31 -27
- package/dist/src/tokens/service/types/defiPositionType.model.cjs +1 -1
- package/dist/src/tokens/service/types/defiPositionType.model.d.ts +1 -1
- package/dist/src/tokens/service/types/defiPositionType.model.js +8 -7
- package/dist/src/tokens/utils.d.ts +6 -0
- package/package.json +1 -1
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { z as o } from "zod";
|
|
2
2
|
import { addressSchema as t } from "../../../chains/starknet/address.js";
|
|
3
|
-
import { apiTokenInfoSchema as
|
|
4
|
-
import { defiPositionTypeSchema as
|
|
5
|
-
import { webTokenWithBalanceAndPriceSchema as
|
|
6
|
-
const i =
|
|
3
|
+
import { apiTokenInfoSchema as l } from "./backend.model.js";
|
|
4
|
+
import { defiPositionTypeSchema as d } from "./defiPositionType.model.js";
|
|
5
|
+
import { webTokenWithBalanceAndPriceSchema as e } from "./webToken.model.js";
|
|
6
|
+
const i = e.extend({
|
|
7
7
|
accruedFees: o.string(),
|
|
8
8
|
currentPrice: o.string(),
|
|
9
9
|
maxPrice: o.string(),
|
|
10
10
|
minPrice: o.string(),
|
|
11
11
|
principal: o.string()
|
|
12
|
-
}),
|
|
13
|
-
id: o.string(),
|
|
12
|
+
}), n = o.object({
|
|
14
13
|
address: t.optional(),
|
|
15
14
|
currencyValue: o.string().default("0")
|
|
16
|
-
}), a =
|
|
15
|
+
}), a = n.extend({
|
|
17
16
|
poolFeePercentage: o.string(),
|
|
18
17
|
tickSpacingPercentage: o.string().optional(),
|
|
19
18
|
tokenId: o.string().optional(),
|
|
@@ -25,7 +24,7 @@ const i = n.extend({
|
|
|
25
24
|
name: o.string().optional(),
|
|
26
25
|
healthRatio: o.string().optional(),
|
|
27
26
|
accountAddress: t.optional()
|
|
28
|
-
}), r =
|
|
27
|
+
}), r = n.extend({
|
|
29
28
|
totalBalances: o.record(o.string()),
|
|
30
29
|
collateral: o.boolean(),
|
|
31
30
|
debt: o.boolean(),
|
|
@@ -33,44 +32,49 @@ const i = n.extend({
|
|
|
33
32
|
apy: o.string().optional(),
|
|
34
33
|
group: o.string().optional(),
|
|
35
34
|
unitCurrencyValue: o.string().optional(),
|
|
36
|
-
positionToken:
|
|
37
|
-
token:
|
|
35
|
+
positionToken: l.or(o.undefined()),
|
|
36
|
+
token: e.optional(),
|
|
38
37
|
accountAddress: t.optional(),
|
|
39
38
|
accountAddressGroup: o.string().optional()
|
|
40
|
-
}),
|
|
39
|
+
}), T = o.array(r), s = n.extend({
|
|
41
40
|
delegatingTo: t,
|
|
42
|
-
token:
|
|
41
|
+
token: e.optional(),
|
|
43
42
|
balance: o.string(),
|
|
44
43
|
unitCurrencyValue: o.string().optional().default("0")
|
|
45
|
-
}),
|
|
44
|
+
}), x = o.array(s), c = n.extend({
|
|
45
|
+
apy: o.string().optional(),
|
|
46
|
+
unitCurrencyValue: o.string().optional()
|
|
47
|
+
}), A = o.array(c), p = a.or(r).or(s).or(c), g = o.record(o.object({
|
|
46
48
|
name: o.string().optional(),
|
|
47
49
|
healthRatio: o.string().optional(),
|
|
48
50
|
accountAddress: t.optional()
|
|
49
|
-
})),
|
|
50
|
-
type:
|
|
51
|
+
})), u = o.object({
|
|
52
|
+
type: d,
|
|
51
53
|
manageUrl: o.string().url().optional(),
|
|
52
54
|
name: o.string(),
|
|
53
|
-
positions: o.array(
|
|
55
|
+
positions: o.array(p),
|
|
54
56
|
// other types will be added when available from be
|
|
55
57
|
positionsTotalValue: o.string(),
|
|
56
58
|
brandColor: o.string().optional(),
|
|
57
|
-
groups:
|
|
59
|
+
groups: g.optional(),
|
|
58
60
|
accountAddress: t
|
|
59
|
-
}),
|
|
61
|
+
}), m = o.array(u), V = o.object({
|
|
60
62
|
dappId: o.string(),
|
|
61
|
-
products:
|
|
63
|
+
products: m
|
|
62
64
|
});
|
|
63
65
|
export {
|
|
64
66
|
f as collateralizedDebtGroupSchema,
|
|
65
67
|
r as collateralizedDebtPositionSchema,
|
|
66
|
-
|
|
68
|
+
T as collateralizedDebtPositionsSchema,
|
|
67
69
|
a as concentratedLiquidityPositionSchema,
|
|
68
70
|
b as concentratedLiquidityPositionsSchema,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
V as defiDappsProductsSchema,
|
|
72
|
+
p as defiPositionSchema,
|
|
73
|
+
u as defiProductSchema,
|
|
74
|
+
m as defiProductsSchema,
|
|
75
|
+
x as delegatedTokensArraySchema,
|
|
76
|
+
s as delegatedTokensSchema,
|
|
77
|
+
g as productGroupsSchema,
|
|
78
|
+
c as stakingPositionSchema,
|
|
79
|
+
A as stakingPositionsSchema
|
|
76
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),t=e.z.union([e.z.literal("concentratedLiquidityPosition"),e.z.literal("collateralizedDebtPosition"),e.z.literal("delegatedTokens"),e.z.literal("strkDelegatedStaking"),e.z.literal("staking")]);exports.defiPositionTypeSchema=t;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const defiPositionTypeSchema: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">, z.ZodLiteral<"delegatedTokens">, z.ZodLiteral<"staking">]>;
|
|
2
|
+
export declare const defiPositionTypeSchema: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">, z.ZodLiteral<"delegatedTokens">, z.ZodLiteral<"strkDelegatedStaking">, z.ZodLiteral<"staking">]>;
|
|
3
3
|
export type DefiPositionType = z.infer<typeof defiPositionTypeSchema>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
const i = e.union([
|
|
3
|
+
e.literal("concentratedLiquidityPosition"),
|
|
4
|
+
e.literal("collateralizedDebtPosition"),
|
|
5
|
+
e.literal("delegatedTokens"),
|
|
6
|
+
e.literal("strkDelegatedStaking"),
|
|
7
|
+
e.literal("staking")
|
|
7
8
|
]);
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
i as defiPositionTypeSchema
|
|
10
11
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApiStaking, ApiStrkDelegatedStaking, ApiCollateralizedDebtPosition, ApiConcentratedLiquidityPosition, ApiDelegatedTokens } from './service';
|
|
2
|
+
export declare const isConcentratedLiquidityPosition: (position: unknown) => position is ApiConcentratedLiquidityPosition;
|
|
3
|
+
export declare const isCollateralizedDebtPosition: (position: unknown) => position is ApiCollateralizedDebtPosition;
|
|
4
|
+
export declare const isDelegatedTokens: (position: unknown) => position is ApiDelegatedTokens;
|
|
5
|
+
export declare const isStaking: (position: unknown) => position is ApiStaking;
|
|
6
|
+
export declare const isStrkDelegatedStaking: (position: unknown) => position is ApiStrkDelegatedStaking;
|