@argent/x-shared 1.38.0 → 1.39.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/index.cjs +1 -1
- package/dist/index.js +295 -282
- package/dist/src/features/simulation/activity/schema.cjs +1 -1
- package/dist/src/features/simulation/activity/schema.d.ts +1660 -52
- package/dist/src/features/simulation/activity/schema.js +68 -49
- package/dist/src/features/swap/models/quote.model.d.ts +4 -4
- package/dist/src/features/swap/models/trade.model.d.ts +2 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/staking/index.d.ts +1 -0
- package/dist/src/staking/schema.cjs +1 -0
- package/dist/src/staking/schema.d.ts +3027 -0
- package/dist/src/staking/schema.js +137 -0
- package/dist/src/tokens/service/implementation.d.ts +25 -6
- package/dist/src/tokens/service/types/backend.model.cjs +1 -1
- package/dist/src/tokens/service/types/backend.model.d.ts +983 -238
- package/dist/src/tokens/service/types/backend.model.js +29 -22
- package/dist/src/tokens/service/types/defiPosition.model.cjs +1 -1
- package/dist/src/tokens/service/types/defiPosition.model.d.ts +1390 -430
- package/dist/src/tokens/service/types/defiPosition.model.js +29 -22
- 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 +3 -2
- package/dist/src/tokens/service/types/unclaimedRewards.model.d.ts +8 -8
- package/dist/src/tokens/service/types/webToken.model.d.ts +8 -8
- package/dist/src/transactions/estimate/model.cjs +1 -1
- package/dist/src/transactions/estimate/model.js +5 -5
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { callSchema as a } from "../utils/starknet/starknet.js";
|
|
3
|
+
import { addressSchemaArgentBackend as t, addressSchema as r } from "../chains/starknet/address.js";
|
|
4
|
+
const n = e.object({
|
|
5
|
+
id: e.string(),
|
|
6
|
+
dappId: e.string(),
|
|
7
|
+
productId: e.string(),
|
|
8
|
+
productName: e.string(),
|
|
9
|
+
chain: e.string(),
|
|
10
|
+
name: e.string(),
|
|
11
|
+
description: e.string(),
|
|
12
|
+
iconUrl: e.string().url(),
|
|
13
|
+
learnMoreUrl: e.string().url().optional(),
|
|
14
|
+
riskFactor: e.enum(["low"]),
|
|
15
|
+
metrics: e.object({
|
|
16
|
+
baseApy: e.string(),
|
|
17
|
+
totalApy: e.string(),
|
|
18
|
+
tvl: e.string().optional()
|
|
19
|
+
}),
|
|
20
|
+
incentives: e.array(e.object({
|
|
21
|
+
name: e.string(),
|
|
22
|
+
description: e.string(),
|
|
23
|
+
iconUrl: e.string().url(),
|
|
24
|
+
learnMoreUrl: e.string().url(),
|
|
25
|
+
metric: e.object({
|
|
26
|
+
apy: e.string()
|
|
27
|
+
})
|
|
28
|
+
})),
|
|
29
|
+
buyEnabled: e.boolean(),
|
|
30
|
+
sellEnabled: e.boolean()
|
|
31
|
+
}), l = n.extend({
|
|
32
|
+
category: e.literal("staking"),
|
|
33
|
+
investableAssets: e.object({
|
|
34
|
+
tokenAddresses: e.array(t),
|
|
35
|
+
tokensRequirement: e.enum(["any"])
|
|
36
|
+
}),
|
|
37
|
+
withdrawableAssets: e.object({
|
|
38
|
+
tokenAddresses: e.array(t),
|
|
39
|
+
tokensRequirement: e.enum(["any"])
|
|
40
|
+
}),
|
|
41
|
+
fees: e.object({
|
|
42
|
+
depositFees: e.object({
|
|
43
|
+
protocolFee: e.string().nullable().optional(),
|
|
44
|
+
totalFee: e.string()
|
|
45
|
+
}),
|
|
46
|
+
withdrawalFees: e.object({
|
|
47
|
+
protocolFee: e.string().nullable().optional(),
|
|
48
|
+
totalFee: e.string()
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
}), i = n.extend({
|
|
52
|
+
category: e.literal("lending"),
|
|
53
|
+
investableAssets: e.object({
|
|
54
|
+
tokenAddresses: e.array(t),
|
|
55
|
+
tokensRequirement: e.enum(["any"])
|
|
56
|
+
}),
|
|
57
|
+
withdrawableAssets: e.object({
|
|
58
|
+
tokenAddresses: e.array(t),
|
|
59
|
+
tokensRequirement: e.enum(["any"])
|
|
60
|
+
}),
|
|
61
|
+
fees: e.object({
|
|
62
|
+
depositFees: e.object({
|
|
63
|
+
totalFee: e.string()
|
|
64
|
+
}),
|
|
65
|
+
withdrawalFees: e.object({
|
|
66
|
+
totalFee: e.string()
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
}), o = e.object({
|
|
70
|
+
name: e.string(),
|
|
71
|
+
iconUrl: e.string().url(),
|
|
72
|
+
address: e.string()
|
|
73
|
+
}), s = n.extend({
|
|
74
|
+
category: e.literal("strkDelegatedStaking"),
|
|
75
|
+
stakerInfo: o,
|
|
76
|
+
investableAssets: e.object({
|
|
77
|
+
tokenAddresses: e.array(t),
|
|
78
|
+
tokensRequirement: e.enum(["any"]),
|
|
79
|
+
useDecomposedBalances: e.boolean().optional()
|
|
80
|
+
}),
|
|
81
|
+
withdrawableAssets: e.object({
|
|
82
|
+
tokenAddresses: e.array(t),
|
|
83
|
+
tokensRequirement: e.enum(["any"]),
|
|
84
|
+
useDecomposedBalances: e.boolean().optional(),
|
|
85
|
+
amountsRequirement: e.enum(["fullBalance"]).optional(),
|
|
86
|
+
timelockDuration: e.number().optional()
|
|
87
|
+
}),
|
|
88
|
+
fees: e.object({
|
|
89
|
+
depositFees: e.object({
|
|
90
|
+
argentFee: e.string().nullable().optional(),
|
|
91
|
+
protocolFee: e.string().nullable().optional(),
|
|
92
|
+
providerFee: e.string().nullable().optional(),
|
|
93
|
+
totalFee: e.string()
|
|
94
|
+
}),
|
|
95
|
+
withdrawalFees: e.object({
|
|
96
|
+
argentFee: e.string().nullable().optional(),
|
|
97
|
+
protocolFee: e.string().nullable().optional(),
|
|
98
|
+
providerFee: e.string().nullable().optional(),
|
|
99
|
+
totalFee: e.string()
|
|
100
|
+
}),
|
|
101
|
+
performanceFees: e.object({
|
|
102
|
+
argentFee: e.string().nullable().optional(),
|
|
103
|
+
protocolFee: e.string().nullable().optional(),
|
|
104
|
+
providerFee: e.string().nullable().optional(),
|
|
105
|
+
totalFee: e.string()
|
|
106
|
+
}).optional()
|
|
107
|
+
}),
|
|
108
|
+
claimEnabled: e.boolean().optional()
|
|
109
|
+
}), c = e.discriminatedUnion("category", [
|
|
110
|
+
l,
|
|
111
|
+
i,
|
|
112
|
+
s
|
|
113
|
+
]), g = e.object({
|
|
114
|
+
investments: e.array(c)
|
|
115
|
+
}), u = e.object({
|
|
116
|
+
calls: e.array(a)
|
|
117
|
+
}), p = e.object({
|
|
118
|
+
investment: s,
|
|
119
|
+
accountAddress: t,
|
|
120
|
+
tokenAddress: t,
|
|
121
|
+
amount: e.string(),
|
|
122
|
+
useFullBalance: e.boolean()
|
|
123
|
+
}), F = e.object({
|
|
124
|
+
stakerInfo: o,
|
|
125
|
+
tokenAddress: r,
|
|
126
|
+
amount: e.string()
|
|
127
|
+
});
|
|
128
|
+
export {
|
|
129
|
+
u as buildBuyCalldataResponseSchema,
|
|
130
|
+
p as buildBuyCalldataSchema,
|
|
131
|
+
F as investmentMetaSchema,
|
|
132
|
+
c as investmentSchema,
|
|
133
|
+
g as investmentsResponseSchema,
|
|
134
|
+
i as lendingInvestmentSchema,
|
|
135
|
+
l as stakingInvestmentSchema,
|
|
136
|
+
s as strkDelegatedStakingInvestmentSchema
|
|
137
|
+
};
|
|
@@ -31,7 +31,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
31
31
|
products: import('zod').objectOutputType<{
|
|
32
32
|
name: import('zod').ZodString;
|
|
33
33
|
manageUrl: import('zod').ZodString;
|
|
34
|
-
type: import('zod').ZodUnion<[import('zod').ZodLiteral<"concentratedLiquidityPosition">, import('zod').ZodLiteral<"collateralizedDebtPosition">, import('zod').ZodLiteral<"staking">]>;
|
|
34
|
+
type: import('zod').ZodUnion<[import('zod').ZodLiteral<"concentratedLiquidityPosition">, import('zod').ZodLiteral<"collateralizedDebtPosition">, import('zod').ZodLiteral<"delegatedTokens">, import('zod').ZodLiteral<"staking">]>;
|
|
35
35
|
groups: import('zod').ZodOptional<import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodObject<{
|
|
36
36
|
name: import('zod').ZodOptional<import('zod').ZodString>;
|
|
37
37
|
healthRatio: import('zod').ZodOptional<import('zod').ZodString>;
|
|
@@ -42,7 +42,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
42
42
|
name?: string | undefined;
|
|
43
43
|
healthRatio?: string | undefined;
|
|
44
44
|
}>>>;
|
|
45
|
-
positions: import('zod').ZodArray<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
45
|
+
positions: import('zod').ZodArray<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
46
46
|
tokenAddress: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodPipeline<import('zod').ZodString, import('zod').ZodEffects<import('zod').ZodString, string, string>>, `0x${string}`, string>>;
|
|
47
47
|
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
48
48
|
}, {
|
|
@@ -192,23 +192,23 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
192
192
|
debt: import('zod').ZodBoolean;
|
|
193
193
|
lending: import('zod').ZodBoolean;
|
|
194
194
|
}, "strip", import('zod').ZodTypeAny, {
|
|
195
|
+
lending: boolean;
|
|
195
196
|
collateral: boolean;
|
|
196
197
|
debt: boolean;
|
|
197
|
-
lending: boolean;
|
|
198
198
|
apy?: string | undefined;
|
|
199
199
|
group?: number | undefined;
|
|
200
200
|
}, {
|
|
201
|
+
lending: boolean;
|
|
201
202
|
collateral: boolean;
|
|
202
203
|
debt: boolean;
|
|
203
|
-
lending: boolean;
|
|
204
204
|
apy?: string | undefined;
|
|
205
205
|
group?: number | undefined;
|
|
206
206
|
}>;
|
|
207
207
|
}>, "strip", import('zod').ZodTypeAny, {
|
|
208
208
|
data: {
|
|
209
|
+
lending: boolean;
|
|
209
210
|
collateral: boolean;
|
|
210
211
|
debt: boolean;
|
|
211
|
-
lending: boolean;
|
|
212
212
|
apy?: string | undefined;
|
|
213
213
|
group?: number | undefined;
|
|
214
214
|
};
|
|
@@ -216,14 +216,33 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
216
216
|
tokenAddress?: `0x${string}` | undefined;
|
|
217
217
|
}, {
|
|
218
218
|
data: {
|
|
219
|
+
lending: boolean;
|
|
219
220
|
collateral: boolean;
|
|
220
221
|
debt: boolean;
|
|
221
|
-
lending: boolean;
|
|
222
222
|
apy?: string | undefined;
|
|
223
223
|
group?: number | undefined;
|
|
224
224
|
};
|
|
225
225
|
totalBalances: Record<string, string>;
|
|
226
226
|
tokenAddress?: string | undefined;
|
|
227
|
+
}>]>, import('zod').ZodObject<{
|
|
228
|
+
data: import('zod').ZodObject<{
|
|
229
|
+
delegatingTo: import('zod').ZodEffects<import('zod').ZodPipeline<import('zod').ZodString, import('zod').ZodEffects<import('zod').ZodString, string, string>>, `0x${string}`, string>;
|
|
230
|
+
}, "strip", import('zod').ZodTypeAny, {
|
|
231
|
+
delegatingTo: `0x${string}`;
|
|
232
|
+
}, {
|
|
233
|
+
delegatingTo: string;
|
|
234
|
+
}>;
|
|
235
|
+
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
236
|
+
}, "strip", import('zod').ZodTypeAny, {
|
|
237
|
+
data: {
|
|
238
|
+
delegatingTo: `0x${string}`;
|
|
239
|
+
};
|
|
240
|
+
totalBalances: Record<string, string>;
|
|
241
|
+
}, {
|
|
242
|
+
data: {
|
|
243
|
+
delegatingTo: string;
|
|
244
|
+
};
|
|
245
|
+
totalBalances: Record<string, string>;
|
|
227
246
|
}>]>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
228
247
|
tokenAddress: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodPipeline<import('zod').ZodString, import('zod').ZodEffects<import('zod').ZodString, string, string>>, `0x${string}`, string>>;
|
|
229
248
|
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../../chains/starknet/address.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../../chains/starknet/address.cjs"),g=require("./defiPositionType.model.cjs"),h=require("../../../utils/schemas.cjs"),S=e.z.object({status:e.z.literal("initialising")}).or(e.z.object({status:e.z.literal("initialised"),balances:e.z.array(e.z.object({tokenAddress:a.addressSchemaArgentBackend,tokenBalance:e.z.string()}))})),i=e.z.object({id:e.z.number(),address:a.addressSchema,brandColor:e.z.string().optional(),name:e.z.string(),symbol:e.z.string(),decimals:e.z.number(),iconUrl:e.z.string().optional(),sendable:e.z.boolean(),popular:e.z.boolean(),refundable:e.z.boolean(),listed:e.z.boolean(),tradable:e.z.boolean(),category:e.z.union([e.z.literal("tokens"),e.z.literal("currencies"),e.z.literal("savings")]),pricingId:e.z.number().optional(),dappId:e.z.string().optional(),marketData:e.z.object({marketCap:e.z.number(),marketCap24hChange:e.z.number(),dailyVolume:e.z.number(),rank:e.z.number()}).optional(),tags:e.z.array(e.z.string()).optional()}),b=e.z.object({tokens:e.z.array(i)}),u=i,p=e.z.object({pricingId:e.z.number(),ethValue:e.z.string(),ccyValue:e.z.string(),ethDayChange:e.z.string(),ccyDayChange:e.z.string()}),k=e.z.object({prices:e.z.array(p)}),o=e.z.object({tokenAddress:a.addressSchemaArgentBackend,principal:e.z.string(),accruedFees:e.z.string(),minPrice:e.z.string(),maxPrice:e.z.string(),currentPrice:e.z.string()}),t=e.z.object({tokenAddress:a.addressSchema.optional(),totalBalances:e.z.record(e.z.string())}),n=t.extend({tokenId:e.z.string(),data:e.z.object({poolFeePercentage:e.z.string(),tickSpacingPercentage:e.z.string().optional(),token0:o,token1:o})}),D=e.z.array(n),s=t.extend({data:e.z.object({apy:e.z.string()}),investmentId:e.z.string().optional()}),y=e.z.array(s),r=t.extend({data:e.z.object({apy:e.z.string().optional(),group:e.z.number().optional(),collateral:e.z.boolean(),debt:e.z.boolean(),lending:e.z.boolean()})}),P=e.z.array(r),c=e.z.object({data:e.z.object({delegatingTo:a.addressSchema}),totalBalances:e.z.record(e.z.string())}),j=e.z.array(c),z=e.z.array(n.or(r).or(c).or(s)),d=h.createSchemaWithWarnings({name:e.z.string(),manageUrl:e.z.string(),type:g.defiPositionTypeSchema,groups:e.z.record(e.z.object({name:e.z.string().optional(),healthRatio:e.z.string().optional()})).optional(),positions:z}),l=e.z.object({dappId:e.z.string(),products:e.z.array(d)}),f=e.z.object({dapps:e.z.array(l)}),m=e.z.object({name:e.z.string().optional(),tokenAddress:a.addressSchema,amount:e.z.string().optional(),claimUrl:e.z.string().optional(),claimStart:e.z.number(),claimEnd:e.z.number().optional()}),T=e.z.object({accountAddress:a.addressSchema,chain:e.z.string(),airdrops:e.z.array(m)});exports.apiAccountTokenBalancesSchema=S;exports.apiAirdropSchema=m;exports.apiCollateralizedDebtPositionSchema=r;exports.apiCollateralizedDebtPositionsSchema=P;exports.apiConcentratedLiquidityPositionSchema=n;exports.apiConcentratedLiquidityPositionsSchema=D;exports.apiDefiDecompositionProduct=d;exports.apiDefiDecompositionProducts=z;exports.apiDefiDecompositionSchema=l;exports.apiDefiDecompositionToken=o;exports.apiDefiPositionsSchema=f;exports.apiDelegatedTokensArraySchema=j;exports.apiDelegatedTokensSchema=c;exports.apiPriceDataResponseSchema=k;exports.apiPriceDetailsSchema=p;exports.apiStakingPositionSchema=s;exports.apiStakingPositionsSchema=y;exports.apiTokenInfoResponseSchema=u;exports.apiTokenInfoSchema=i;exports.apiTokensInfoResponseSchema=b;exports.apiUnclaimedRewardsSchema=T;
|