@argent/x-shared 1.42.1 → 1.43.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/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/simulation/activity/utils/createNativeActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/createNativeActivity.js +23 -23
- package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.js +10 -9
- package/dist/src/features/simulation/transactionReview/schema.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/schema.d.ts +12 -12
- package/dist/src/features/simulation/transactionReview/schema.js +2 -2
- 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 +16 -10
- 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 +640 -400
- package/dist/src/tokens/service/types/backend.model.js +116 -114
- package/dist/src/transactions/estimate/error.d.ts +1 -1
- package/dist/src/transactions/estimate/utils.cjs +1 -1
- package/dist/src/transactions/estimate/utils.js +30 -27
- package/dist/src/transactions/index.d.ts +5 -5
- package/dist/src/transactions/service/implementation.cjs +1 -1
- package/dist/src/transactions/service/implementation.js +66 -65
- 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
|
};
|
|
@@ -159,8 +159,8 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
159
159
|
id: string;
|
|
160
160
|
totalBalances: Record<string, string>;
|
|
161
161
|
tokenId: string;
|
|
162
|
-
tokenAddress?: `0x${string}` | undefined;
|
|
163
162
|
investmentId?: string | undefined;
|
|
163
|
+
tokenAddress?: `0x${string}` | undefined;
|
|
164
164
|
}, {
|
|
165
165
|
data: {
|
|
166
166
|
poolFeePercentage: string;
|
|
@@ -185,8 +185,8 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
185
185
|
id: string;
|
|
186
186
|
totalBalances: Record<string, string>;
|
|
187
187
|
tokenId: string;
|
|
188
|
-
tokenAddress?: string | undefined;
|
|
189
188
|
investmentId?: string | undefined;
|
|
189
|
+
tokenAddress?: string | undefined;
|
|
190
190
|
}>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
191
191
|
id: import('zod').ZodString;
|
|
192
192
|
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
@@ -222,8 +222,8 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
222
222
|
};
|
|
223
223
|
id: string;
|
|
224
224
|
totalBalances: Record<string, string>;
|
|
225
|
-
tokenAddress?: `0x${string}` | undefined;
|
|
226
225
|
investmentId?: string | undefined;
|
|
226
|
+
tokenAddress?: `0x${string}` | undefined;
|
|
227
227
|
}, {
|
|
228
228
|
data: {
|
|
229
229
|
lending: boolean;
|
|
@@ -234,8 +234,8 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
234
234
|
};
|
|
235
235
|
id: string;
|
|
236
236
|
totalBalances: Record<string, string>;
|
|
237
|
-
tokenAddress?: string | undefined;
|
|
238
237
|
investmentId?: string | undefined;
|
|
238
|
+
tokenAddress?: string | undefined;
|
|
239
239
|
}>]>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
240
240
|
id: import('zod').ZodString;
|
|
241
241
|
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
@@ -257,16 +257,16 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
257
257
|
};
|
|
258
258
|
id: string;
|
|
259
259
|
totalBalances: Record<string, string>;
|
|
260
|
-
tokenAddress?: `0x${string}` | undefined;
|
|
261
260
|
investmentId?: string | undefined;
|
|
261
|
+
tokenAddress?: `0x${string}` | undefined;
|
|
262
262
|
}, {
|
|
263
263
|
data: {
|
|
264
264
|
delegatingTo: string;
|
|
265
265
|
};
|
|
266
266
|
id: string;
|
|
267
267
|
totalBalances: Record<string, string>;
|
|
268
|
-
tokenAddress?: string | undefined;
|
|
269
268
|
investmentId?: string | undefined;
|
|
269
|
+
tokenAddress?: string | undefined;
|
|
270
270
|
}>]>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
271
271
|
id: import('zod').ZodString;
|
|
272
272
|
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
@@ -288,22 +288,23 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
288
288
|
};
|
|
289
289
|
id: string;
|
|
290
290
|
totalBalances: Record<string, string>;
|
|
291
|
-
tokenAddress?: `0x${string}` | undefined;
|
|
292
291
|
investmentId?: string | undefined;
|
|
292
|
+
tokenAddress?: `0x${string}` | undefined;
|
|
293
293
|
}, {
|
|
294
294
|
data: {
|
|
295
295
|
apy: string;
|
|
296
296
|
};
|
|
297
297
|
id: string;
|
|
298
298
|
totalBalances: Record<string, string>;
|
|
299
|
-
tokenAddress?: string | undefined;
|
|
300
299
|
investmentId?: string | undefined;
|
|
300
|
+
tokenAddress?: string | undefined;
|
|
301
301
|
}>]>, import('zod').ZodObject<import("zod").objectUtil.extendShape<{
|
|
302
302
|
id: import('zod').ZodString;
|
|
303
303
|
investmentId: import('zod').ZodOptional<import('zod').ZodString>;
|
|
304
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>>;
|
|
305
305
|
totalBalances: import('zod').ZodRecord<import('zod').ZodString, import('zod').ZodString>;
|
|
306
306
|
}, {
|
|
307
|
+
investmentId: import('zod').ZodString;
|
|
307
308
|
data: import('zod').ZodObject<{
|
|
308
309
|
stakerInfo: import('zod').ZodObject<{
|
|
309
310
|
name: import('zod').ZodOptional<import('zod').ZodString>;
|
|
@@ -319,6 +320,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
319
320
|
iconUrl?: string | undefined;
|
|
320
321
|
}>;
|
|
321
322
|
accruedRewards: import('zod').ZodString;
|
|
323
|
+
stakedAmount: import('zod').ZodString;
|
|
322
324
|
pendingWithdrawal: import('zod').ZodOptional<import('zod').ZodObject<{
|
|
323
325
|
amount: import('zod').ZodString;
|
|
324
326
|
withdrawableAfter: import('zod').ZodNumber;
|
|
@@ -337,6 +339,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
337
339
|
iconUrl?: string | undefined;
|
|
338
340
|
};
|
|
339
341
|
accruedRewards: string;
|
|
342
|
+
stakedAmount: string;
|
|
340
343
|
apy?: string | undefined;
|
|
341
344
|
pendingWithdrawal?: {
|
|
342
345
|
amount: string;
|
|
@@ -349,6 +352,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
349
352
|
iconUrl?: string | undefined;
|
|
350
353
|
};
|
|
351
354
|
accruedRewards: string;
|
|
355
|
+
stakedAmount: string;
|
|
352
356
|
apy?: string | undefined;
|
|
353
357
|
pendingWithdrawal?: {
|
|
354
358
|
amount: string;
|
|
@@ -363,6 +367,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
363
367
|
iconUrl?: string | undefined;
|
|
364
368
|
};
|
|
365
369
|
accruedRewards: string;
|
|
370
|
+
stakedAmount: string;
|
|
366
371
|
apy?: string | undefined;
|
|
367
372
|
pendingWithdrawal?: {
|
|
368
373
|
amount: string;
|
|
@@ -370,9 +375,9 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
370
375
|
} | undefined;
|
|
371
376
|
};
|
|
372
377
|
id: string;
|
|
378
|
+
investmentId: string;
|
|
373
379
|
totalBalances: Record<string, string>;
|
|
374
380
|
tokenAddress?: `0x${string}` | undefined;
|
|
375
|
-
investmentId?: string | undefined;
|
|
376
381
|
}, {
|
|
377
382
|
data: {
|
|
378
383
|
stakerInfo: {
|
|
@@ -381,6 +386,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
381
386
|
iconUrl?: string | undefined;
|
|
382
387
|
};
|
|
383
388
|
accruedRewards: string;
|
|
389
|
+
stakedAmount: string;
|
|
384
390
|
apy?: string | undefined;
|
|
385
391
|
pendingWithdrawal?: {
|
|
386
392
|
amount: string;
|
|
@@ -388,9 +394,9 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
388
394
|
} | undefined;
|
|
389
395
|
};
|
|
390
396
|
id: string;
|
|
397
|
+
investmentId: string;
|
|
391
398
|
totalBalances: Record<string, string>;
|
|
392
399
|
tokenAddress?: string | undefined;
|
|
393
|
-
investmentId?: string | undefined;
|
|
394
400
|
}>]>, "many">;
|
|
395
401
|
}, import('zod').ZodTypeAny, "passthrough">[];
|
|
396
402
|
}[]>;
|
|
@@ -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;
|