@argent/x-shared 1.62.12 → 1.63.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/defiDecomposition.cjs +1 -0
- package/dist/defiDecomposition.d.ts +2 -0
- package/dist/defiDecomposition.js +65 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +476 -475
- package/dist/src/account/account.model.cjs +1 -1
- package/dist/src/account/account.model.d.ts +11 -0
- package/dist/src/account/account.model.js +8 -4
- package/dist/src/features/defiDecomposition/helpers/computeCollateralizedDebtPositionsUsdValue.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/computeCollateralizedDebtPositionsUsdValue.d.ts +6 -0
- package/dist/src/features/defiDecomposition/helpers/computeCollateralizedDebtPositionsUsdValue.js +62 -0
- package/dist/src/features/defiDecomposition/helpers/computeConcentratedLiquidityPositionsUsdValue.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/computeConcentratedLiquidityPositionsUsdValue.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/computeConcentratedLiquidityPositionsUsdValue.js +31 -0
- package/dist/src/features/defiDecomposition/helpers/computeDefiDecompositionUsdValue.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/computeDefiDecompositionUsdValue.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/computeDefiDecompositionUsdValue.js +55 -0
- package/dist/src/features/defiDecomposition/helpers/computeDelegatedTokensPositionsUsdValue.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/computeDelegatedTokensPositionsUsdValue.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/computeDelegatedTokensPositionsUsdValue.js +30 -0
- package/dist/src/features/defiDecomposition/helpers/computeStakingPositionsUsdValue.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/computeStakingPositionsUsdValue.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/computeStakingPositionsUsdValue.js +30 -0
- package/dist/src/features/defiDecomposition/helpers/computeStrkDelegatedStakingPositionsUsdValue.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/computeStrkDelegatedStakingPositionsUsdValue.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/computeStrkDelegatedStakingPositionsUsdValue.js +30 -0
- package/dist/src/features/defiDecomposition/helpers/computeUsdValueForPosition.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/computeUsdValueForPosition.d.ts +3 -0
- package/dist/src/features/defiDecomposition/helpers/computeUsdValueForPosition.js +17 -0
- package/dist/src/features/defiDecomposition/helpers/getDefiProductName.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/getDefiProductName.d.ts +1 -0
- package/dist/src/features/defiDecomposition/helpers/getDefiProductName.js +11 -0
- package/dist/src/features/defiDecomposition/helpers/index.d.ts +13 -0
- package/dist/src/features/defiDecomposition/helpers/parseCollateralizedDebtPositions.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/parseCollateralizedDebtPositions.d.ts +7 -0
- package/dist/src/features/defiDecomposition/helpers/parseCollateralizedDebtPositions.js +57 -0
- package/dist/src/features/defiDecomposition/helpers/parseConcentratedLiquidityPositions.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/parseConcentratedLiquidityPositions.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/parseConcentratedLiquidityPositions.js +42 -0
- package/dist/src/features/defiDecomposition/helpers/parseDefiDecomposition.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/parseDefiDecomposition.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/parseDefiDecomposition.js +63 -0
- package/dist/src/features/defiDecomposition/helpers/parseDelegatedTokensPositions.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/parseDelegatedTokensPositions.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/parseDelegatedTokensPositions.js +27 -0
- package/dist/src/features/defiDecomposition/helpers/parseStakingPositions.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/parseStakingPositions.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/parseStakingPositions.js +29 -0
- package/dist/src/features/defiDecomposition/helpers/parseStrkDelegatedStakingPositions.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/parseStrkDelegatedStakingPositions.d.ts +4 -0
- package/dist/src/features/defiDecomposition/helpers/parseStrkDelegatedStakingPositions.js +27 -0
- package/dist/src/features/defiDecomposition/helpers/sortDescendingByUsdValue.cjs +1 -0
- package/dist/src/features/defiDecomposition/helpers/sortDescendingByUsdValue.d.ts +9 -0
- package/dist/src/features/defiDecomposition/helpers/sortDescendingByUsdValue.js +9 -0
- package/dist/src/features/defiDecomposition/index.d.ts +2 -0
- package/dist/src/features/defiDecomposition/schema.cjs +1 -0
- package/dist/src/features/defiDecomposition/schema.d.ts +16935 -0
- package/dist/src/features/defiDecomposition/schema.js +153 -0
- package/dist/src/features/paymaster/types.d.ts +20 -20
- package/dist/src/features/simulation/activity/schema.d.ts +356 -356
- package/dist/src/features/simulation/activity/utils/createNativeActivity.d.ts +8 -8
- package/dist/src/features/simulation/transactionReview/schema.d.ts +1484 -1484
- package/dist/src/features/swap/models/trade.model.d.ts +20 -0
- package/dist/src/staking/schema.d.ts +24 -24
- package/dist/src/tokens/service/types/backend.model.d.ts +8 -8
- package/dist/src/tokens/service/types/defiPosition.model.d.ts +576 -40
- package/dist/src/tokens/service/types/unclaimedRewards.model.d.ts +8 -8
- package/dist/src/tokens/service/types/webToken.model.cjs +1 -1
- package/dist/src/tokens/service/types/webToken.model.d.ts +36 -2
- package/dist/src/tokens/service/types/webToken.model.js +9 -7
- package/dist/src/transactions/equalTokens.cjs +1 -0
- package/dist/src/transactions/equalTokens.d.ts +2 -0
- package/dist/src/transactions/equalTokens.js +5 -0
- package/dist/src/transactions/errors.d.ts +4 -4
- package/dist/src/utils/starknet/starknet.d.ts +12 -12
- package/dist/src/utils/starknet/starknetSchemas.d.ts +212 -212
- package/package.json +6 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { z as t } from "zod";
|
|
2
|
+
import { webBaseTokenSchema as o } from "../../tokens/service/types/webToken.model.js";
|
|
3
|
+
import { productGroupsSchema as D } from "../../tokens/service/types/defiPosition.model.js";
|
|
4
|
+
import { stakerInfoSchema as U } from "../../staking/schema.js";
|
|
5
|
+
const i = o.extend({
|
|
6
|
+
balance: t.string()
|
|
7
|
+
}), a = i.extend({
|
|
8
|
+
usdValue: t.string()
|
|
9
|
+
}), n = i.extend({
|
|
10
|
+
principal: t.string(),
|
|
11
|
+
accruedFees: t.string(),
|
|
12
|
+
minPrice: t.string(),
|
|
13
|
+
maxPrice: t.string(),
|
|
14
|
+
currentPrice: t.string()
|
|
15
|
+
}), u = n.extend({
|
|
16
|
+
usdValue: t.string()
|
|
17
|
+
}), d = t.object({
|
|
18
|
+
id: t.string(),
|
|
19
|
+
poolFeePercentage: t.string(),
|
|
20
|
+
tickSpacingPercentage: t.string().optional(),
|
|
21
|
+
token0: n,
|
|
22
|
+
token1: n,
|
|
23
|
+
liquidityToken: o.optional()
|
|
24
|
+
}), m = d.extend({
|
|
25
|
+
totalUsdValue: t.string(),
|
|
26
|
+
token0: u,
|
|
27
|
+
token1: u,
|
|
28
|
+
liquidityToken: o.optional()
|
|
29
|
+
}), I = t.object({
|
|
30
|
+
totalUsdValue: t.string(),
|
|
31
|
+
positions: t.array(m)
|
|
32
|
+
}), s = t.object({
|
|
33
|
+
id: t.string(),
|
|
34
|
+
collateral: t.boolean(),
|
|
35
|
+
debt: t.boolean(),
|
|
36
|
+
lending: t.boolean(),
|
|
37
|
+
apy: t.string().optional(),
|
|
38
|
+
totalApy: t.string().optional(),
|
|
39
|
+
group: t.string().optional(),
|
|
40
|
+
token: i,
|
|
41
|
+
liquidityToken: o.optional()
|
|
42
|
+
}), r = s.extend({
|
|
43
|
+
token: a
|
|
44
|
+
}), l = t.object({
|
|
45
|
+
id: t.string(),
|
|
46
|
+
group: t.string(),
|
|
47
|
+
healthRatio: t.string().optional(),
|
|
48
|
+
collateralizedPositions: t.array(s),
|
|
49
|
+
debtPositions: t.array(s)
|
|
50
|
+
}), f = l.extend({
|
|
51
|
+
totalUsdValue: t.string(),
|
|
52
|
+
collateralizedPositions: t.array(r),
|
|
53
|
+
debtPositions: t.array(r),
|
|
54
|
+
collateralizedPositionsTotalUsdValue: t.string(),
|
|
55
|
+
debtPositionsTotalUsdValue: t.string()
|
|
56
|
+
}), h = s.or(l), P = r.or(f), B = t.object({
|
|
57
|
+
totalUsdValue: t.string(),
|
|
58
|
+
positions: t.array(P)
|
|
59
|
+
}), c = t.object({
|
|
60
|
+
id: t.string(),
|
|
61
|
+
investmentId: t.string().optional(),
|
|
62
|
+
apy: t.string(),
|
|
63
|
+
totalApy: t.string().optional(),
|
|
64
|
+
token: i,
|
|
65
|
+
liquidityToken: o.optional()
|
|
66
|
+
}), S = c.extend({
|
|
67
|
+
token: a
|
|
68
|
+
}), A = t.object({
|
|
69
|
+
totalUsdValue: t.string(),
|
|
70
|
+
positions: t.array(S)
|
|
71
|
+
}), p = t.object({
|
|
72
|
+
id: t.string(),
|
|
73
|
+
investmentId: t.string().optional(),
|
|
74
|
+
stakerInfo: U,
|
|
75
|
+
pendingWithdrawal: t.object({
|
|
76
|
+
amount: t.string(),
|
|
77
|
+
withdrawableAfter: t.number()
|
|
78
|
+
}).optional(),
|
|
79
|
+
accruedRewards: t.string(),
|
|
80
|
+
stakedAmount: t.string(),
|
|
81
|
+
apy: t.string().optional(),
|
|
82
|
+
totalApy: t.string().optional(),
|
|
83
|
+
token: i
|
|
84
|
+
}), k = p.extend({
|
|
85
|
+
token: a
|
|
86
|
+
}), v = t.object({
|
|
87
|
+
totalUsdValue: t.string(),
|
|
88
|
+
positions: t.array(k)
|
|
89
|
+
}), g = t.object({
|
|
90
|
+
id: t.string(),
|
|
91
|
+
delegatingTo: t.string(),
|
|
92
|
+
token: i,
|
|
93
|
+
liquidityToken: o.optional()
|
|
94
|
+
}), b = g.extend({
|
|
95
|
+
token: a
|
|
96
|
+
}), F = t.object({
|
|
97
|
+
totalUsdValue: t.string(),
|
|
98
|
+
positions: t.array(b)
|
|
99
|
+
}), T = d.or(h).or(g).or(p).or(c), W = m.or(P).or(b).or(k).or(S), z = t.union([
|
|
100
|
+
t.literal("concentratedLiquidityPosition"),
|
|
101
|
+
t.literal("collateralizedDebtLendingPosition"),
|
|
102
|
+
t.literal("collateralizedDebtBorrowingPosition"),
|
|
103
|
+
t.literal("delegatedTokens"),
|
|
104
|
+
t.literal("strkDelegatedStaking"),
|
|
105
|
+
t.literal("staking")
|
|
106
|
+
]), y = t.object({
|
|
107
|
+
type: z,
|
|
108
|
+
productId: t.string().optional(),
|
|
109
|
+
manageUrl: t.string().url().optional(),
|
|
110
|
+
name: t.string(),
|
|
111
|
+
positions: t.array(T),
|
|
112
|
+
groups: D.optional()
|
|
113
|
+
}), C = y.extend({
|
|
114
|
+
positions: t.array(W),
|
|
115
|
+
totalUsdValue: t.string()
|
|
116
|
+
}), V = t.object({
|
|
117
|
+
dappId: t.string(),
|
|
118
|
+
products: t.array(y)
|
|
119
|
+
}), R = t.array(V), j = V.extend({
|
|
120
|
+
dappId: t.string(),
|
|
121
|
+
products: t.array(C),
|
|
122
|
+
totalUsdValue: t.string()
|
|
123
|
+
}), G = t.array(j), E = (e) => s.safeParse(e).success, H = (e) => l.safeParse(e).success, J = (e) => h.safeParse(e).success, K = (e) => g.safeParse(e).success, M = (e) => c.safeParse(e).success, N = (e) => p.safeParse(e).success, O = (e) => d.safeParse(e).success;
|
|
124
|
+
export {
|
|
125
|
+
z as argentDefiPositionTypeSchema,
|
|
126
|
+
H as isCollateralizedDebtBorrowingPosition,
|
|
127
|
+
E as isCollateralizedDebtLendingPosition,
|
|
128
|
+
J as isCollateralizedDebtPosition,
|
|
129
|
+
O as isConcentratedLiquidityPosition,
|
|
130
|
+
K as isDelegatedTokensPosition,
|
|
131
|
+
M as isStakingPosition,
|
|
132
|
+
N as isStrkDelegatedStakingPosition,
|
|
133
|
+
f as parsedCollateralizedDebtBorrowingPositionWithUsdValueSchema,
|
|
134
|
+
s as parsedCollateralizedDebtLendingPositionSchema,
|
|
135
|
+
h as parsedCollateralizedDebtPositionSchema,
|
|
136
|
+
P as parsedCollateralizedDebtPositionWithUsdValueSchema,
|
|
137
|
+
B as parsedCollateralizedDebtPositionsWithUsdValueSchema,
|
|
138
|
+
d as parsedConcentratedLiquidityPositionSchema,
|
|
139
|
+
m as parsedConcentratedLiquidityPositionWithUsdValueSchema,
|
|
140
|
+
I as parsedConcentratedLiquidityPositionsWithUsdValueSchema,
|
|
141
|
+
V as parsedDefiDecompositionItemSchema,
|
|
142
|
+
j as parsedDefiDecompositionItemWithUsdValueSchema,
|
|
143
|
+
R as parsedDefiDecompositionSchema,
|
|
144
|
+
G as parsedDefiDecompositionWithUsdValueSchema,
|
|
145
|
+
b as parsedDelegatedTokensPositionWithUsdValueSchema,
|
|
146
|
+
F as parsedDelegatedTokensPositionsWithUsdValueSchema,
|
|
147
|
+
T as parsedPositionSchema,
|
|
148
|
+
W as parsedPositionWithUsdValueSchema,
|
|
149
|
+
y as parsedProductSchema,
|
|
150
|
+
C as parsedProductWithUsdValueSchema,
|
|
151
|
+
A as parsedStakingPositionsWithUsdValueSchema,
|
|
152
|
+
v as parsedStrkDelegatedStakingPositionsWithUsdValueSchema
|
|
153
|
+
};
|
|
@@ -11,15 +11,15 @@ export declare const paymasterExecutionDataParams: z.ZodObject<{
|
|
|
11
11
|
calls: import('starknet').Call[];
|
|
12
12
|
maxFee: string | number | bigint;
|
|
13
13
|
feeTokenAddress: `0x${string}`;
|
|
14
|
-
accountClassHash?: string | undefined;
|
|
15
14
|
networkId?: "mainnet-alpha" | "sepolia-alpha" | "mainnet" | "sepolia" | undefined;
|
|
15
|
+
accountClassHash?: string | undefined;
|
|
16
16
|
}, {
|
|
17
17
|
accountAddress: string;
|
|
18
18
|
calls: import('starknet').Call[];
|
|
19
19
|
maxFee: string | number | bigint;
|
|
20
20
|
feeTokenAddress: string;
|
|
21
|
-
accountClassHash?: string | undefined;
|
|
22
21
|
networkId?: "mainnet-alpha" | "sepolia-alpha" | "mainnet" | "sepolia" | undefined;
|
|
22
|
+
accountClassHash?: string | undefined;
|
|
23
23
|
}>;
|
|
24
24
|
export type PaymasterExecutionDataParams = z.infer<typeof paymasterExecutionDataParams>;
|
|
25
25
|
export declare const paymasterExecuteParams: z.ZodObject<{
|
|
@@ -31,34 +31,34 @@ export declare const paymasterExecuteParams: z.ZodObject<{
|
|
|
31
31
|
type: z.ZodLiteral<"merkletree">;
|
|
32
32
|
contains: z.ZodString;
|
|
33
33
|
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
name: string;
|
|
35
34
|
type: "merkletree";
|
|
35
|
+
name: string;
|
|
36
36
|
contains: string;
|
|
37
37
|
}, {
|
|
38
|
-
name: string;
|
|
39
38
|
type: "merkletree";
|
|
39
|
+
name: string;
|
|
40
40
|
contains: string;
|
|
41
41
|
}>, z.ZodObject<{
|
|
42
42
|
name: z.ZodString;
|
|
43
43
|
type: z.ZodLiteral<"enum">;
|
|
44
44
|
contains: z.ZodString;
|
|
45
45
|
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
name: string;
|
|
47
46
|
type: "enum";
|
|
47
|
+
name: string;
|
|
48
48
|
contains: string;
|
|
49
49
|
}, {
|
|
50
|
-
name: string;
|
|
51
50
|
type: "enum";
|
|
51
|
+
name: string;
|
|
52
52
|
contains: string;
|
|
53
53
|
}>, z.ZodObject<{
|
|
54
54
|
name: z.ZodString;
|
|
55
55
|
type: z.ZodString;
|
|
56
56
|
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
name: string;
|
|
58
57
|
type: string;
|
|
59
|
-
}, {
|
|
60
58
|
name: string;
|
|
59
|
+
}, {
|
|
61
60
|
type: string;
|
|
61
|
+
name: string;
|
|
62
62
|
}>]>, "many">>;
|
|
63
63
|
primaryType: z.ZodString;
|
|
64
64
|
domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -66,32 +66,32 @@ export declare const paymasterExecuteParams: z.ZodObject<{
|
|
|
66
66
|
}, "strip", z.ZodTypeAny, {
|
|
67
67
|
message: Record<string, any> | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
|
|
68
68
|
types: Record<string, ({
|
|
69
|
-
name: string;
|
|
70
69
|
type: "merkletree";
|
|
70
|
+
name: string;
|
|
71
71
|
contains: string;
|
|
72
72
|
} | {
|
|
73
|
-
name: string;
|
|
74
73
|
type: "enum";
|
|
74
|
+
name: string;
|
|
75
75
|
contains: string;
|
|
76
76
|
} | {
|
|
77
|
-
name: string;
|
|
78
77
|
type: string;
|
|
78
|
+
name: string;
|
|
79
79
|
})[]>;
|
|
80
80
|
primaryType: string;
|
|
81
81
|
domain: Record<string, unknown>;
|
|
82
82
|
}, {
|
|
83
83
|
message: Record<string, any> | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
|
|
84
84
|
types: Record<string, ({
|
|
85
|
-
name: string;
|
|
86
85
|
type: "merkletree";
|
|
86
|
+
name: string;
|
|
87
87
|
contains: string;
|
|
88
88
|
} | {
|
|
89
|
-
name: string;
|
|
90
89
|
type: "enum";
|
|
90
|
+
name: string;
|
|
91
91
|
contains: string;
|
|
92
92
|
} | {
|
|
93
|
-
name: string;
|
|
94
93
|
type: string;
|
|
94
|
+
name: string;
|
|
95
95
|
})[]>;
|
|
96
96
|
primaryType: string;
|
|
97
97
|
domain: Record<string, unknown>;
|
|
@@ -119,16 +119,16 @@ export declare const paymasterExecuteParams: z.ZodObject<{
|
|
|
119
119
|
typedData: {
|
|
120
120
|
message: Record<string, any> | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
|
|
121
121
|
types: Record<string, ({
|
|
122
|
-
name: string;
|
|
123
122
|
type: "merkletree";
|
|
123
|
+
name: string;
|
|
124
124
|
contains: string;
|
|
125
125
|
} | {
|
|
126
|
-
name: string;
|
|
127
126
|
type: "enum";
|
|
127
|
+
name: string;
|
|
128
128
|
contains: string;
|
|
129
129
|
} | {
|
|
130
|
-
name: string;
|
|
131
130
|
type: string;
|
|
131
|
+
name: string;
|
|
132
132
|
})[]>;
|
|
133
133
|
primaryType: string;
|
|
134
134
|
domain: Record<string, unknown>;
|
|
@@ -146,16 +146,16 @@ export declare const paymasterExecuteParams: z.ZodObject<{
|
|
|
146
146
|
typedData: {
|
|
147
147
|
message: Record<string, any> | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
|
|
148
148
|
types: Record<string, ({
|
|
149
|
-
name: string;
|
|
150
149
|
type: "merkletree";
|
|
150
|
+
name: string;
|
|
151
151
|
contains: string;
|
|
152
152
|
} | {
|
|
153
|
-
name: string;
|
|
154
153
|
type: "enum";
|
|
154
|
+
name: string;
|
|
155
155
|
contains: string;
|
|
156
156
|
} | {
|
|
157
|
-
name: string;
|
|
158
157
|
type: string;
|
|
158
|
+
name: string;
|
|
159
159
|
})[]>;
|
|
160
160
|
primaryType: string;
|
|
161
161
|
domain: Record<string, unknown>;
|