@argent/x-shared 1.41.7 → 1.42.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/src/bigdecimal/parseUnits.cjs +1 -1
- package/dist/src/bigdecimal/parseUnits.d.ts +5 -5
- package/dist/src/bigdecimal/parseUnits.js +7 -8
- package/dist/src/tokens/service/implementation.d.ts +13 -0
- package/dist/src/tokens/service/types/backend.model.cjs +1 -1
- package/dist/src/tokens/service/types/backend.model.d.ts +520 -0
- package/dist/src/tokens/service/types/backend.model.js +3 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(n,t)=>{const[o,e=""]=n.split("."),s=o.startsWith("-"),i=s?o.slice(1):o,r=t??e.length,a=e.slice(0,r),c=t!==void 0&&e.length>t?l(a,e[t]):a.padEnd(r,"0");return{value:BigInt(`${s?"-":""}${i}${c}`),decimals:r}},l=(n,t)=>Number(t)>=5?(BigInt(n)+1n).toString().padStart(n.length,"0"):n;exports.parseUnits=u;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BigDecimal } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Parses a string value representing a number to a BigInt, with a specified number of decimals.
|
|
4
|
-
* If the fraction part of the string value is longer than the allowed decimal places, it rounds the value.
|
|
3
|
+
* Parses a string value representing a number to a BigInt, with a specified or determined number of decimals.
|
|
4
|
+
* If decimals are specified and the fraction part of the string value is longer than the allowed decimal places, it rounds the value.
|
|
5
5
|
*
|
|
6
6
|
* @param {string} value - The string value to be parsed.
|
|
7
|
-
* @param {number} decimals - The number of decimals to consider during parsing.
|
|
8
|
-
* @returns {
|
|
7
|
+
* @param {number} [decimals] - The number of decimals to consider during parsing. If not provided, it uses as many as needed.
|
|
8
|
+
* @returns {BigDecimal} The parsed BigDecimal value.
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare const parseUnits: (value: string, decimals?: number) => BigDecimal;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
decimals: n
|
|
1
|
+
const d = (n, t) => {
|
|
2
|
+
const [e, o = ""] = n.split("."), s = e.startsWith("-"), c = s ? e.slice(1) : e, r = t ?? o.length, a = o.slice(0, r), i = t !== void 0 && o.length > t ? u(a, o[t]) : a.padEnd(r, "0");
|
|
3
|
+
return {
|
|
4
|
+
value: BigInt(`${s ? "-" : ""}${c}${i}`),
|
|
5
|
+
decimals: r
|
|
7
6
|
};
|
|
8
|
-
}
|
|
7
|
+
}, u = (n, t) => Number(t) >= 5 ? (BigInt(n) + 1n).toString().padStart(n.length, "0") : n;
|
|
9
8
|
export {
|
|
10
|
-
|
|
9
|
+
d as parseUnits
|
|
11
10
|
};
|
|
@@ -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
|
}, {
|
|
@@ -159,6 +160,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
159
160
|
totalBalances: Record<string, string>;
|
|
160
161
|
tokenId: string;
|
|
161
162
|
tokenAddress?: `0x${string}` | undefined;
|
|
163
|
+
investmentId?: string | undefined;
|
|
162
164
|
}, {
|
|
163
165
|
data: {
|
|
164
166
|
poolFeePercentage: string;
|
|
@@ -184,8 +186,10 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
184
186
|
totalBalances: Record<string, string>;
|
|
185
187
|
tokenId: string;
|
|
186
188
|
tokenAddress?: string | undefined;
|
|
189
|
+
investmentId?: 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
|
}, {
|
|
@@ -219,6 +223,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
219
223
|
id: string;
|
|
220
224
|
totalBalances: Record<string, string>;
|
|
221
225
|
tokenAddress?: `0x${string}` | undefined;
|
|
226
|
+
investmentId?: string | undefined;
|
|
222
227
|
}, {
|
|
223
228
|
data: {
|
|
224
229
|
lending: boolean;
|
|
@@ -230,8 +235,10 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
230
235
|
id: string;
|
|
231
236
|
totalBalances: Record<string, string>;
|
|
232
237
|
tokenAddress?: string | undefined;
|
|
238
|
+
investmentId?: 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
|
}, {
|
|
@@ -251,6 +258,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
251
258
|
id: string;
|
|
252
259
|
totalBalances: Record<string, string>;
|
|
253
260
|
tokenAddress?: `0x${string}` | undefined;
|
|
261
|
+
investmentId?: string | undefined;
|
|
254
262
|
}, {
|
|
255
263
|
data: {
|
|
256
264
|
delegatingTo: string;
|
|
@@ -258,8 +266,10 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
258
266
|
id: string;
|
|
259
267
|
totalBalances: Record<string, string>;
|
|
260
268
|
tokenAddress?: string | undefined;
|
|
269
|
+
investmentId?: 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
|
}, {
|
|
@@ -290,6 +300,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
290
300
|
investmentId?: 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
|
}, {
|
|
@@ -361,6 +372,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
361
372
|
id: string;
|
|
362
373
|
totalBalances: Record<string, string>;
|
|
363
374
|
tokenAddress?: `0x${string}` | undefined;
|
|
375
|
+
investmentId?: string | undefined;
|
|
364
376
|
}, {
|
|
365
377
|
data: {
|
|
366
378
|
stakerInfo: {
|
|
@@ -378,6 +390,7 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
378
390
|
id: string;
|
|
379
391
|
totalBalances: Record<string, string>;
|
|
380
392
|
tokenAddress?: string | undefined;
|
|
393
|
+
investmentId?: string | undefined;
|
|
381
394
|
}>]>, "many">;
|
|
382
395
|
}, import('zod').ZodTypeAny, "passthrough">[];
|
|
383
396
|
}[]>;
|
|
@@ -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,d=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(d)}),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(),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),p=i.extend({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(),pendingWithdrawal:e.z.object({amount:e.z.string(),withdrawableAfter:e.z.number()}).optional(),apy:e.z.string().optional()})}),
|
|
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,d=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(d)}),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),p=i.extend({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(),pendingWithdrawal:e.z.object({amount:e.z.string(),withdrawableAfter:e.z.number()}).optional(),apy:e.z.string().optional()})}),I=e.z.array(p),z=n.or(r).or(c).or(s).or(p),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=d;exports.apiStakingPositionSchema=s;exports.apiStakingPositionsSchema=f;exports.apiStrkDelegatedStakingPositionsSchema=I;exports.apiStrkDelegatedStakingSchema=p;exports.apiTokenInfoResponseSchema=D;exports.apiTokenInfoSchema=o;exports.apiTokensInfoResponseSchema=k;exports.apiUnclaimedRewardsSchema=C;
|