@argent/x-shared 1.42.0 → 1.43.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/README.md +1 -1
- package/dist/.eslintrc.d.cts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +297 -295
- package/dist/src/backend/index.d.ts +1 -1
- package/dist/src/bigdecimal/index.d.ts +1 -1
- package/dist/src/cache/index.d.ts +1 -1
- package/dist/src/chains/starknet/services/address/index.d.ts +1 -1
- package/dist/src/errors/account.d.ts +1 -1
- package/dist/src/errors/address.d.ts +1 -1
- package/dist/src/errors/call.d.ts +1 -1
- package/dist/src/errors/network.d.ts +1 -1
- package/dist/src/errors/review.d.ts +1 -1
- package/dist/src/errors/swap.d.ts +1 -1
- package/dist/src/features/simulation/activity/schema.cjs +1 -1
- package/dist/src/features/simulation/activity/schema.d.ts +346 -334
- package/dist/src/features/simulation/activity/schema.js +17 -26
- package/dist/src/features/swap/services/index.d.ts +1 -1
- package/dist/src/http/index.d.ts +2 -2
- package/dist/src/knownDapps/index.d.ts +1 -1
- package/dist/src/nameResolution/index.d.ts +1 -1
- package/dist/src/nfts/index.d.ts +1 -1
- package/dist/src/onchainRecovery/index.d.ts +1 -1
- package/dist/src/staking/schema.cjs +1 -1
- package/dist/src/staking/schema.d.ts +88 -505
- package/dist/src/staking/schema.js +27 -19
- package/dist/src/tokens/index.d.ts +1 -1
- package/dist/src/tokens/service/implementation.d.ts +21 -2
- package/dist/src/tokens/service/index.d.ts +1 -1
- package/dist/src/tokens/service/tokenError.d.ts +1 -1
- package/dist/src/tokens/service/types/backend.model.cjs +1 -1
- package/dist/src/tokens/service/types/backend.model.d.ts +840 -80
- package/dist/src/tokens/service/types/backend.model.js +117 -114
- package/dist/src/transactions/estimate/error.d.ts +1 -1
- package/dist/src/transactions/index.d.ts +5 -5
- package/dist/src/transactions/service/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
2
|
import { callSchema as a } from "../utils/starknet/starknet.js";
|
|
3
|
-
import { addressSchemaArgentBackend as t, addressSchema as
|
|
3
|
+
import { addressSchemaArgentBackend as t, addressSchema as s } from "../chains/starknet/address.js";
|
|
4
4
|
const n = e.object({
|
|
5
5
|
id: e.string(),
|
|
6
6
|
dappId: e.string(),
|
|
@@ -28,7 +28,7 @@ const n = e.object({
|
|
|
28
28
|
})),
|
|
29
29
|
buyEnabled: e.boolean(),
|
|
30
30
|
sellEnabled: e.boolean()
|
|
31
|
-
}),
|
|
31
|
+
}), r = n.extend({
|
|
32
32
|
category: e.literal("staking"),
|
|
33
33
|
investableAssets: e.object({
|
|
34
34
|
tokenAddresses: e.array(t),
|
|
@@ -67,10 +67,10 @@ const n = e.object({
|
|
|
67
67
|
})
|
|
68
68
|
})
|
|
69
69
|
}), o = e.object({
|
|
70
|
-
name: e.string(),
|
|
71
|
-
iconUrl: e.string().url(),
|
|
70
|
+
name: e.string().optional(),
|
|
71
|
+
iconUrl: e.string().url().optional(),
|
|
72
72
|
address: e.string()
|
|
73
|
-
}),
|
|
73
|
+
}), l = n.extend({
|
|
74
74
|
category: e.literal("strkDelegatedStaking"),
|
|
75
75
|
stakerInfo: o,
|
|
76
76
|
investableAssets: e.object({
|
|
@@ -107,31 +107,39 @@ const n = e.object({
|
|
|
107
107
|
}),
|
|
108
108
|
claimEnabled: e.boolean().optional()
|
|
109
109
|
}), c = e.discriminatedUnion("category", [
|
|
110
|
-
|
|
110
|
+
r,
|
|
111
111
|
i,
|
|
112
|
-
|
|
113
|
-
]),
|
|
112
|
+
l
|
|
113
|
+
]), p = e.object({
|
|
114
114
|
investments: e.array(c)
|
|
115
115
|
}), u = e.object({
|
|
116
116
|
calls: e.array(a)
|
|
117
|
-
}),
|
|
118
|
-
|
|
117
|
+
}), k = e.object({
|
|
118
|
+
investmentId: e.string(),
|
|
119
|
+
stakerInfo: o,
|
|
119
120
|
accountAddress: t,
|
|
120
121
|
tokenAddress: t,
|
|
121
|
-
amount: e.string()
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
amount: e.string()
|
|
123
|
+
}), d = e.enum([
|
|
124
|
+
"stake",
|
|
125
|
+
"initiateWithdraw",
|
|
126
|
+
"withdraw",
|
|
127
|
+
"claim"
|
|
128
|
+
]), F = e.object({
|
|
129
|
+
stakingAction: d,
|
|
124
130
|
stakerInfo: o,
|
|
125
|
-
tokenAddress:
|
|
131
|
+
tokenAddress: s,
|
|
126
132
|
amount: e.string()
|
|
127
133
|
});
|
|
128
134
|
export {
|
|
129
|
-
u as buildBuyCalldataResponseSchema,
|
|
130
|
-
p as buildBuyCalldataSchema,
|
|
131
135
|
F as investmentMetaSchema,
|
|
132
136
|
c as investmentSchema,
|
|
133
|
-
|
|
137
|
+
p as investmentsResponseSchema,
|
|
134
138
|
i as lendingInvestmentSchema,
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
o as stakerInfoSchema,
|
|
140
|
+
d as stakingActionSchema,
|
|
141
|
+
r as stakingInvestmentSchema,
|
|
142
|
+
l as strkDelegatedStakingInvestmentSchema,
|
|
143
|
+
u as strkStakingCalldataResponseSchema,
|
|
144
|
+
k as strkStakingCalldataSchema
|
|
137
145
|
};
|
|
@@ -44,6 +44,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
44
44
|
}>>>;
|
|
45
45
|
positions: import('zod').ZodArray<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
46
46
|
id: import('zod').ZodString;
|
|
47
|
+
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
47
48
|
tokenAddress: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodPipeline<import('zod').ZodString, import('zod').ZodEffects<import('zod').ZodString, string, string>>, `0x${string}`, string>>;
|
|
48
49
|
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
49
50
|
}, {
|
|
@@ -158,6 +159,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
158
159
|
id: string;
|
|
159
160
|
totalBalances: Record<string, string>;
|
|
160
161
|
tokenId: string;
|
|
162
|
+
investmentId?: string | undefined;
|
|
161
163
|
tokenAddress?: `0x${string}` | undefined;
|
|
162
164
|
}, {
|
|
163
165
|
data: {
|
|
@@ -183,9 +185,11 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
183
185
|
id: string;
|
|
184
186
|
totalBalances: Record<string, string>;
|
|
185
187
|
tokenId: string;
|
|
188
|
+
investmentId?: string | undefined;
|
|
186
189
|
tokenAddress?: string | undefined;
|
|
187
190
|
}>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
188
191
|
id: import('zod').ZodString;
|
|
192
|
+
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
189
193
|
tokenAddress: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodPipeline<import('zod').ZodString, import('zod').ZodEffects<import('zod').ZodString, string, string>>, `0x${string}`, string>>;
|
|
190
194
|
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
191
195
|
}, {
|
|
@@ -218,6 +222,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
218
222
|
};
|
|
219
223
|
id: string;
|
|
220
224
|
totalBalances: Record<string, string>;
|
|
225
|
+
investmentId?: string | undefined;
|
|
221
226
|
tokenAddress?: `0x${string}` | undefined;
|
|
222
227
|
}, {
|
|
223
228
|
data: {
|
|
@@ -229,9 +234,11 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
229
234
|
};
|
|
230
235
|
id: string;
|
|
231
236
|
totalBalances: Record<string, string>;
|
|
237
|
+
investmentId?: string | undefined;
|
|
232
238
|
tokenAddress?: string | undefined;
|
|
233
239
|
}>]>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
234
240
|
id: import('zod').ZodString;
|
|
241
|
+
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
235
242
|
tokenAddress: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodPipeline<import('zod').ZodString, import('zod').ZodEffects<import('zod').ZodString, string, string>>, `0x${string}`, string>>;
|
|
236
243
|
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
237
244
|
}, {
|
|
@@ -250,6 +257,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
250
257
|
};
|
|
251
258
|
id: string;
|
|
252
259
|
totalBalances: Record<string, string>;
|
|
260
|
+
investmentId?: string | undefined;
|
|
253
261
|
tokenAddress?: `0x${string}` | undefined;
|
|
254
262
|
}, {
|
|
255
263
|
data: {
|
|
@@ -257,9 +265,11 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
257
265
|
};
|
|
258
266
|
id: string;
|
|
259
267
|
totalBalances: Record<string, string>;
|
|
268
|
+
investmentId?: string | undefined;
|
|
260
269
|
tokenAddress?: string | undefined;
|
|
261
270
|
}>]>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
262
271
|
id: import('zod').ZodString;
|
|
272
|
+
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
263
273
|
tokenAddress: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodPipeline<import('zod').ZodString, import('zod').ZodEffects<import('zod').ZodString, string, string>>, `0x${string}`, string>>;
|
|
264
274
|
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
265
275
|
}, {
|
|
@@ -278,21 +288,23 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
278
288
|
};
|
|
279
289
|
id: string;
|
|
280
290
|
totalBalances: Record<string, string>;
|
|
281
|
-
tokenAddress?: `0x${string}` | undefined;
|
|
282
291
|
investmentId?: string | undefined;
|
|
292
|
+
tokenAddress?: `0x${string}` | undefined;
|
|
283
293
|
}, {
|
|
284
294
|
data: {
|
|
285
295
|
apy: string;
|
|
286
296
|
};
|
|
287
297
|
id: string;
|
|
288
298
|
totalBalances: Record<string, string>;
|
|
289
|
-
tokenAddress?: string | undefined;
|
|
290
299
|
investmentId?: string | undefined;
|
|
300
|
+
tokenAddress?: string | undefined;
|
|
291
301
|
}>]>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
292
302
|
id: import('zod').ZodString;
|
|
303
|
+
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
293
304
|
tokenAddress: import('zod').ZodOptional<import('zod').ZodEffects<import('zod').ZodPipeline<import('zod').ZodString, import('zod').ZodEffects<import('zod').ZodString, string, string>>, `0x${string}`, string>>;
|
|
294
305
|
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
295
306
|
}, {
|
|
307
|
+
investmentId: import('zod').ZodString;
|
|
296
308
|
data: import('zod').ZodObject<{
|
|
297
309
|
stakerInfo: import('zod').ZodObject<{
|
|
298
310
|
name: import('zod').ZodOptional<import('zod').ZodString>;
|
|
@@ -308,6 +320,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
308
320
|
iconUrl?: string | undefined;
|
|
309
321
|
}>;
|
|
310
322
|
accruedRewards: import('zod').ZodString;
|
|
323
|
+
stakedAmount: import('zod').ZodString;
|
|
311
324
|
pendingWithdrawal: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
312
325
|
amount: import('zod').ZodString;
|
|
313
326
|
withdrawableAfter: import('zod').ZodNumber;
|
|
@@ -326,6 +339,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
326
339
|
iconUrl?: string | undefined;
|
|
327
340
|
};
|
|
328
341
|
accruedRewards: string;
|
|
342
|
+
stakedAmount: string;
|
|
329
343
|
apy?: string | undefined;
|
|
330
344
|
pendingWithdrawal?: {
|
|
331
345
|
amount: string;
|
|
@@ -338,6 +352,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
338
352
|
iconUrl?: string | undefined;
|
|
339
353
|
};
|
|
340
354
|
accruedRewards: string;
|
|
355
|
+
stakedAmount: string;
|
|
341
356
|
apy?: string | undefined;
|
|
342
357
|
pendingWithdrawal?: {
|
|
343
358
|
amount: string;
|
|
@@ -352,6 +367,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
352
367
|
iconUrl?: string | undefined;
|
|
353
368
|
};
|
|
354
369
|
accruedRewards: string;
|
|
370
|
+
stakedAmount: string;
|
|
355
371
|
apy?: string | undefined;
|
|
356
372
|
pendingWithdrawal?: {
|
|
357
373
|
amount: string;
|
|
@@ -359,6 +375,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
359
375
|
} | undefined;
|
|
360
376
|
};
|
|
361
377
|
id: string;
|
|
378
|
+
investmentId: string;
|
|
362
379
|
totalBalances: Record<string, string>;
|
|
363
380
|
tokenAddress?: `0x${string}` | undefined;
|
|
364
381
|
}, {
|
|
@@ -369,6 +386,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
369
386
|
iconUrl?: string | undefined;
|
|
370
387
|
};
|
|
371
388
|
accruedRewards: string;
|
|
389
|
+
stakedAmount: string;
|
|
372
390
|
apy?: string | undefined;
|
|
373
391
|
pendingWithdrawal?: {
|
|
374
392
|
amount: string;
|
|
@@ -376,6 +394,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
376
394
|
} | undefined;
|
|
377
395
|
};
|
|
378
396
|
id: string;
|
|
397
|
+
investmentId: string;
|
|
379
398
|
totalBalances: Record<string, string>;
|
|
380
399
|
tokenAddress?: string | undefined;
|
|
381
400
|
}>]>, "many">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseErrorPayload, BaseError } from '../../errors/baseErrors';
|
|
2
2
|
export declare enum TOKEN_ERROR_MESSAGES {
|
|
3
3
|
NO_TOKEN_API_URL = "NO_TOKEN_API_URL is not defined",
|
|
4
4
|
NO_TOKEN_PRICE_API_URL = "NO_TOKEN_PRICE_API_URL is not defined",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../../chains/starknet/address.cjs"),h=require("./defiPositionType.model.cjs"),b=require("../../../utils/schemas.cjs"),u=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()}))})),o=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()}),k=e.z.object({tokens:e.z.array(o)}),D=o,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../../chains/starknet/address.cjs"),h=require("./defiPositionType.model.cjs"),b=require("../../../utils/schemas.cjs"),u=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()}))})),o=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()}),k=e.z.object({tokens:e.z.array(o)}),D=o,p=e.z.object({pricingId:e.z.number(),ethValue:e.z.string(),ccyValue:e.z.string(),ethDayChange:e.z.string(),ccyDayChange:e.z.string()}),y=e.z.object({prices:e.z.array(p)}),t=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()}),i=e.z.object({id:e.z.string(),investmentId:e.z.string().optional(),tokenAddress:a.addressSchema.optional(),totalBalances:e.z.record(e.z.string())}),n=i.extend({tokenId:e.z.string(),data:e.z.object({poolFeePercentage:e.z.string(),tickSpacingPercentage:e.z.string().optional(),token0:t,token1:t})}),P=e.z.array(n),s=i.extend({data:e.z.object({apy:e.z.string()}),investmentId:e.z.string().optional(),totalBalances:e.z.record(e.z.string())}),f=e.z.array(s),r=i.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()})}),j=e.z.array(r),c=i.extend({id:e.z.string(),data:e.z.object({delegatingTo:a.addressSchema}),totalBalances:e.z.record(e.z.string())}),T=e.z.array(c),d=i.extend({investmentId:e.z.string(),data:e.z.object({stakerInfo:e.z.object({name:e.z.string().optional(),iconUrl:e.z.string().optional(),address:a.addressSchema}),accruedRewards:e.z.string(),stakedAmount:e.z.string(),pendingWithdrawal:e.z.object({amount:e.z.string(),withdrawableAfter:e.z.number()}).optional(),apy:e.z.string().optional()})}),I=e.z.array(d),z=n.or(r).or(c).or(s).or(d),l=e.z.array(z),m=b.createSchemaWithWarnings({productId:e.z.string().optional(),name:e.z.string(),manageUrl:e.z.string(),type:h.defiPositionTypeSchema,groups:e.z.record(e.z.object({name:e.z.string().optional(),healthRatio:e.z.string().optional()})).optional(),positions:l}),g=e.z.object({dappId:e.z.string(),products:e.z.array(m)}),A=e.z.object({dapps:e.z.array(g)}),S=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()}),C=e.z.object({accountAddress:a.addressSchema,chain:e.z.string(),airdrops:e.z.array(S)});exports.apiAccountTokenBalancesSchema=u;exports.apiAirdropSchema=S;exports.apiCollateralizedDebtPositionSchema=r;exports.apiCollateralizedDebtPositionsSchema=j;exports.apiConcentratedLiquidityPositionSchema=n;exports.apiConcentratedLiquidityPositionsSchema=P;exports.apiDefiDecompositionProduct=m;exports.apiDefiDecompositionProducts=l;exports.apiDefiDecompositionSchema=g;exports.apiDefiDecompositionToken=t;exports.apiDefiPositionSchema=z;exports.apiDefiPositionsSchema=A;exports.apiDelegatedTokensArraySchema=T;exports.apiDelegatedTokensSchema=c;exports.apiPriceDataResponseSchema=y;exports.apiPriceDetailsSchema=p;exports.apiStakingPositionSchema=s;exports.apiStakingPositionsSchema=f;exports.apiStrkDelegatedStakingPositionsSchema=I;exports.apiStrkDelegatedStakingSchema=d;exports.apiTokenInfoResponseSchema=D;exports.apiTokenInfoSchema=o;exports.apiTokensInfoResponseSchema=k;exports.apiUnclaimedRewardsSchema=C;
|