@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.
Files changed (27) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +295 -282
  3. package/dist/src/features/simulation/activity/schema.cjs +1 -1
  4. package/dist/src/features/simulation/activity/schema.d.ts +1660 -52
  5. package/dist/src/features/simulation/activity/schema.js +68 -49
  6. package/dist/src/features/swap/models/quote.model.d.ts +4 -4
  7. package/dist/src/features/swap/models/trade.model.d.ts +2 -2
  8. package/dist/src/index.d.ts +1 -0
  9. package/dist/src/staking/index.d.ts +1 -0
  10. package/dist/src/staking/schema.cjs +1 -0
  11. package/dist/src/staking/schema.d.ts +3027 -0
  12. package/dist/src/staking/schema.js +137 -0
  13. package/dist/src/tokens/service/implementation.d.ts +25 -6
  14. package/dist/src/tokens/service/types/backend.model.cjs +1 -1
  15. package/dist/src/tokens/service/types/backend.model.d.ts +983 -238
  16. package/dist/src/tokens/service/types/backend.model.js +29 -22
  17. package/dist/src/tokens/service/types/defiPosition.model.cjs +1 -1
  18. package/dist/src/tokens/service/types/defiPosition.model.d.ts +1390 -430
  19. package/dist/src/tokens/service/types/defiPosition.model.js +29 -22
  20. package/dist/src/tokens/service/types/defiPositionType.model.cjs +1 -1
  21. package/dist/src/tokens/service/types/defiPositionType.model.d.ts +1 -1
  22. package/dist/src/tokens/service/types/defiPositionType.model.js +3 -2
  23. package/dist/src/tokens/service/types/unclaimedRewards.model.d.ts +8 -8
  24. package/dist/src/tokens/service/types/webToken.model.d.ts +8 -8
  25. package/dist/src/transactions/estimate/model.cjs +1 -1
  26. package/dist/src/transactions/estimate/model.js +5 -5
  27. package/package.json +1 -1
@@ -1,30 +1,30 @@
1
1
  import { z as o } from "zod";
2
2
  import { addressSchema as t } from "../../../chains/starknet/address.js";
3
- import { apiTokenInfoSchema as c } from "./backend.model.js";
4
- import { defiPositionTypeSchema as s } from "./defiPositionType.model.js";
5
- import { webTokenWithBalanceAndPriceSchema as e } from "./webToken.model.js";
6
- const n = e.extend({
3
+ import { apiTokenInfoSchema as s } from "./backend.model.js";
4
+ import { defiPositionTypeSchema as l } from "./defiPositionType.model.js";
5
+ import { webTokenWithBalanceAndPriceSchema as n } from "./webToken.model.js";
6
+ const a = n.extend({
7
7
  accruedFees: o.string(),
8
8
  currentPrice: o.string(),
9
9
  maxPrice: o.string(),
10
10
  minPrice: o.string(),
11
11
  principal: o.string()
12
- }), i = o.object({
12
+ }), e = o.object({
13
13
  address: t.optional(),
14
14
  currencyValue: o.string().default("0")
15
- }), a = i.extend({
15
+ }), i = e.extend({
16
16
  poolFeePercentage: o.string(),
17
17
  tickSpacingPercentage: o.string().optional(),
18
18
  tokenId: o.string().optional(),
19
19
  unitCurrencyValueToken0: o.string().optional(),
20
20
  unitCurrencyValueToken1: o.string().optional(),
21
- token0: n,
22
- token1: n
23
- }), b = o.array(a), f = o.object({
21
+ token0: a,
22
+ token1: a
23
+ }), b = o.array(i), f = o.object({
24
24
  name: o.string().optional(),
25
25
  healthRatio: o.string().optional(),
26
26
  accountAddress: t.optional()
27
- }), r = i.extend({
27
+ }), r = e.extend({
28
28
  totalBalances: o.record(o.string()),
29
29
  collateral: o.boolean(),
30
30
  debt: o.boolean(),
@@ -32,37 +32,44 @@ const n = e.extend({
32
32
  apy: o.string().optional(),
33
33
  group: o.string().optional(),
34
34
  unitCurrencyValue: o.string().optional(),
35
- positionToken: c.or(o.undefined()),
36
- token: e.optional(),
35
+ positionToken: s.or(o.undefined()),
36
+ token: n.optional(),
37
37
  accountAddress: t.optional(),
38
38
  accountAddressGroup: o.string().optional()
39
- }), y = o.array(r), l = a.or(r), p = o.record(o.object({
39
+ }), k = o.array(r), c = e.extend({
40
+ delegatingTo: t,
41
+ token: n.optional(),
42
+ balance: o.string(),
43
+ unitCurrencyValue: o.string().optional().default("0")
44
+ }), T = o.array(c), d = i.or(r).or(c), p = o.record(o.object({
40
45
  name: o.string().optional(),
41
46
  healthRatio: o.string().optional(),
42
47
  accountAddress: t.optional()
43
- })), d = o.object({
44
- type: s,
48
+ })), g = o.object({
49
+ type: l,
45
50
  manageUrl: o.string().url().optional(),
46
51
  name: o.string(),
47
- positions: o.array(l),
52
+ positions: o.array(d),
48
53
  // other types will be added when available from be
49
54
  positionsTotalValue: o.string(),
50
55
  brandColor: o.string().optional(),
51
56
  groups: p.optional(),
52
57
  accountAddress: t
53
- }), u = o.array(d), k = o.object({
58
+ }), u = o.array(g), A = o.object({
54
59
  dappId: o.string(),
55
60
  products: u
56
61
  });
57
62
  export {
58
63
  f as collateralizedDebtGroupSchema,
59
64
  r as collateralizedDebtPositionSchema,
60
- y as collateralizedDebtPositionsSchema,
61
- a as concentratedLiquidityPositionSchema,
65
+ k as collateralizedDebtPositionsSchema,
66
+ i as concentratedLiquidityPositionSchema,
62
67
  b as concentratedLiquidityPositionsSchema,
63
- k as defiDappsProductsSchema,
64
- l as defiPositionSchema,
65
- d as defiProductSchema,
68
+ A as defiDappsProductsSchema,
69
+ d as defiPositionSchema,
70
+ g as defiProductSchema,
66
71
  u as defiProductsSchema,
72
+ T as delegatedTokensArraySchema,
73
+ c as delegatedTokensSchema,
67
74
  p as productGroupsSchema
68
75
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),i=e.z.union([e.z.literal("concentratedLiquidityPosition"),e.z.literal("collateralizedDebtPosition"),e.z.literal("staking")]);exports.defiPositionTypeSchema=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),i=e.z.union([e.z.literal("concentratedLiquidityPosition"),e.z.literal("collateralizedDebtPosition"),e.z.literal("delegatedTokens"),e.z.literal("staking")]);exports.defiPositionTypeSchema=i;
@@ -1,3 +1,3 @@
1
1
  import { z } from 'zod';
2
- export declare const defiPositionTypeSchema: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">, z.ZodLiteral<"staking">]>;
2
+ export declare const defiPositionTypeSchema: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">, z.ZodLiteral<"delegatedTokens">, z.ZodLiteral<"staking">]>;
3
3
  export type DefiPositionType = z.infer<typeof defiPositionTypeSchema>;
@@ -1,9 +1,10 @@
1
1
  import { z as i } from "zod";
2
- const o = i.union([
2
+ const t = i.union([
3
3
  i.literal("concentratedLiquidityPosition"),
4
4
  i.literal("collateralizedDebtPosition"),
5
+ i.literal("delegatedTokens"),
5
6
  i.literal("staking")
6
7
  ]);
7
8
  export {
8
- o as defiPositionTypeSchema
9
+ t as defiPositionTypeSchema
9
10
  };
@@ -41,12 +41,12 @@ export declare const airdropSchema: z.ZodObject<{
41
41
  address: `0x${string}`;
42
42
  decimals: number;
43
43
  id: number;
44
+ category: "tokens" | "currencies" | "savings";
44
45
  sendable: boolean;
45
46
  popular: boolean;
46
47
  refundable: boolean;
47
48
  listed: boolean;
48
49
  tradable: boolean;
49
- category: "tokens" | "currencies" | "savings";
50
50
  dappId?: string | undefined;
51
51
  brandColor?: string | undefined;
52
52
  iconUrl?: string | undefined;
@@ -64,12 +64,12 @@ export declare const airdropSchema: z.ZodObject<{
64
64
  address: string;
65
65
  decimals: number;
66
66
  id: number;
67
+ category: "tokens" | "currencies" | "savings";
67
68
  sendable: boolean;
68
69
  popular: boolean;
69
70
  refundable: boolean;
70
71
  listed: boolean;
71
72
  tradable: boolean;
72
- category: "tokens" | "currencies" | "savings";
73
73
  dappId?: string | undefined;
74
74
  brandColor?: string | undefined;
75
75
  iconUrl?: string | undefined;
@@ -99,12 +99,12 @@ export declare const airdropSchema: z.ZodObject<{
99
99
  address: `0x${string}`;
100
100
  decimals: number;
101
101
  id: number;
102
+ category: "tokens" | "currencies" | "savings";
102
103
  sendable: boolean;
103
104
  popular: boolean;
104
105
  refundable: boolean;
105
106
  listed: boolean;
106
107
  tradable: boolean;
107
- category: "tokens" | "currencies" | "savings";
108
108
  dappId?: string | undefined;
109
109
  brandColor?: string | undefined;
110
110
  iconUrl?: string | undefined;
@@ -130,12 +130,12 @@ export declare const airdropSchema: z.ZodObject<{
130
130
  address: string;
131
131
  decimals: number;
132
132
  id: number;
133
+ category: "tokens" | "currencies" | "savings";
133
134
  sendable: boolean;
134
135
  popular: boolean;
135
136
  refundable: boolean;
136
137
  listed: boolean;
137
138
  tradable: boolean;
138
- category: "tokens" | "currencies" | "savings";
139
139
  dappId?: string | undefined;
140
140
  brandColor?: string | undefined;
141
141
  iconUrl?: string | undefined;
@@ -191,12 +191,12 @@ export declare const unclaimedRewardsSchema: z.ZodArray<z.ZodObject<{
191
191
  address: `0x${string}`;
192
192
  decimals: number;
193
193
  id: number;
194
+ category: "tokens" | "currencies" | "savings";
194
195
  sendable: boolean;
195
196
  popular: boolean;
196
197
  refundable: boolean;
197
198
  listed: boolean;
198
199
  tradable: boolean;
199
- category: "tokens" | "currencies" | "savings";
200
200
  dappId?: string | undefined;
201
201
  brandColor?: string | undefined;
202
202
  iconUrl?: string | undefined;
@@ -214,12 +214,12 @@ export declare const unclaimedRewardsSchema: z.ZodArray<z.ZodObject<{
214
214
  address: string;
215
215
  decimals: number;
216
216
  id: number;
217
+ category: "tokens" | "currencies" | "savings";
217
218
  sendable: boolean;
218
219
  popular: boolean;
219
220
  refundable: boolean;
220
221
  listed: boolean;
221
222
  tradable: boolean;
222
- category: "tokens" | "currencies" | "savings";
223
223
  dappId?: string | undefined;
224
224
  brandColor?: string | undefined;
225
225
  iconUrl?: string | undefined;
@@ -249,12 +249,12 @@ export declare const unclaimedRewardsSchema: z.ZodArray<z.ZodObject<{
249
249
  address: `0x${string}`;
250
250
  decimals: number;
251
251
  id: number;
252
+ category: "tokens" | "currencies" | "savings";
252
253
  sendable: boolean;
253
254
  popular: boolean;
254
255
  refundable: boolean;
255
256
  listed: boolean;
256
257
  tradable: boolean;
257
- category: "tokens" | "currencies" | "savings";
258
258
  dappId?: string | undefined;
259
259
  brandColor?: string | undefined;
260
260
  iconUrl?: string | undefined;
@@ -280,12 +280,12 @@ export declare const unclaimedRewardsSchema: z.ZodArray<z.ZodObject<{
280
280
  address: string;
281
281
  decimals: number;
282
282
  id: number;
283
+ category: "tokens" | "currencies" | "savings";
283
284
  sendable: boolean;
284
285
  popular: boolean;
285
286
  refundable: boolean;
286
287
  listed: boolean;
287
288
  tradable: boolean;
288
- category: "tokens" | "currencies" | "savings";
289
289
  dappId?: string | undefined;
290
290
  brandColor?: string | undefined;
291
291
  iconUrl?: string | undefined;
@@ -135,10 +135,10 @@ export declare const webTokenWithPriceSchema: z.ZodObject<z.objectUtil.extendSha
135
135
  decimals?: number | undefined;
136
136
  dappId?: string | undefined;
137
137
  brandColor?: string | undefined;
138
- unitCurrencyValue?: string | undefined;
139
138
  id?: number | undefined;
140
139
  iconUrl?: string | undefined;
141
140
  category?: string | undefined;
141
+ unitCurrencyValue?: string | undefined;
142
142
  pricingId?: number | undefined;
143
143
  ethDayChange?: string | undefined;
144
144
  ccyDayChange?: string | undefined;
@@ -152,10 +152,10 @@ export declare const webTokenWithPriceSchema: z.ZodObject<z.objectUtil.extendSha
152
152
  decimals?: number | undefined;
153
153
  dappId?: string | undefined;
154
154
  brandColor?: string | undefined;
155
- unitCurrencyValue?: string | undefined;
156
155
  id?: number | undefined;
157
156
  iconUrl?: string | undefined;
158
157
  category?: string | undefined;
158
+ unitCurrencyValue?: string | undefined;
159
159
  pricingId?: number | undefined;
160
160
  ethDayChange?: string | undefined;
161
161
  ccyDayChange?: string | undefined;
@@ -204,10 +204,10 @@ export declare const webTokenWithBalanceAndPriceSchema: z.ZodObject<z.objectUtil
204
204
  decimals?: number | undefined;
205
205
  dappId?: string | undefined;
206
206
  brandColor?: string | undefined;
207
- unitCurrencyValue?: string | undefined;
208
207
  id?: number | undefined;
209
208
  iconUrl?: string | undefined;
210
209
  category?: string | undefined;
210
+ unitCurrencyValue?: string | undefined;
211
211
  pricingId?: number | undefined;
212
212
  ethDayChange?: string | undefined;
213
213
  ccyDayChange?: string | undefined;
@@ -222,10 +222,10 @@ export declare const webTokenWithBalanceAndPriceSchema: z.ZodObject<z.objectUtil
222
222
  decimals?: number | undefined;
223
223
  dappId?: string | undefined;
224
224
  brandColor?: string | undefined;
225
- unitCurrencyValue?: string | undefined;
226
225
  id?: number | undefined;
227
226
  iconUrl?: string | undefined;
228
227
  category?: string | undefined;
228
+ unitCurrencyValue?: string | undefined;
229
229
  pricingId?: number | undefined;
230
230
  ethDayChange?: string | undefined;
231
231
  ccyDayChange?: string | undefined;
@@ -274,10 +274,10 @@ export declare const webTokensWithBalanceAndPriceSchema: z.ZodArray<z.ZodObject<
274
274
  decimals?: number | undefined;
275
275
  dappId?: string | undefined;
276
276
  brandColor?: string | undefined;
277
- unitCurrencyValue?: string | undefined;
278
277
  id?: number | undefined;
279
278
  iconUrl?: string | undefined;
280
279
  category?: string | undefined;
280
+ unitCurrencyValue?: string | undefined;
281
281
  pricingId?: number | undefined;
282
282
  ethDayChange?: string | undefined;
283
283
  ccyDayChange?: string | undefined;
@@ -292,10 +292,10 @@ export declare const webTokensWithBalanceAndPriceSchema: z.ZodArray<z.ZodObject<
292
292
  decimals?: number | undefined;
293
293
  dappId?: string | undefined;
294
294
  brandColor?: string | undefined;
295
- unitCurrencyValue?: string | undefined;
296
295
  id?: number | undefined;
297
296
  iconUrl?: string | undefined;
298
297
  category?: string | undefined;
298
+ unitCurrencyValue?: string | undefined;
299
299
  pricingId?: number | undefined;
300
300
  ethDayChange?: string | undefined;
301
301
  ccyDayChange?: string | undefined;
@@ -372,12 +372,12 @@ export declare const webTokenInfoDetailsSchema: z.ZodObject<z.objectUtil.extendS
372
372
  decimals: number;
373
373
  networkId: string;
374
374
  id: number;
375
+ category: "tokens" | "currencies" | "savings";
375
376
  sendable: boolean;
376
377
  popular: boolean;
377
378
  refundable: boolean;
378
379
  listed: boolean;
379
380
  tradable: boolean;
380
- category: "tokens" | "currencies" | "savings";
381
381
  dappId?: string | undefined;
382
382
  brandColor?: string | undefined;
383
383
  iconUrl?: string | undefined;
@@ -396,12 +396,12 @@ export declare const webTokenInfoDetailsSchema: z.ZodObject<z.objectUtil.extendS
396
396
  decimals: number;
397
397
  networkId: string;
398
398
  id: number;
399
+ category: "tokens" | "currencies" | "savings";
399
400
  sendable: boolean;
400
401
  popular: boolean;
401
402
  refundable: boolean;
402
403
  listed: boolean;
403
404
  tradable: boolean;
404
- category: "tokens" | "currencies" | "savings";
405
405
  dappId?: string | undefined;
406
406
  brandColor?: string | undefined;
407
407
  iconUrl?: string | undefined;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),e=require("../../utils/starknet/starknet.cjs"),t=require("../../utils/hex.cjs"),r=a.z.object({type:a.z.enum(["DECLARE","DEPLOY","DEPLOY_ACCOUNT","INVOKE"]).default("INVOKE"),calls:a.z.array(e.callSchema).or(e.callSchema).optional(),calldata:a.z.array(a.z.string()).optional(),classHash:t.hexSchema.optional(),salt:t.hexSchema.optional(),signature:a.z.array(a.z.string()).optional()});exports.transactionReviewTransactionsSchema=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),e=require("../../utils/hex.cjs"),t=require("../../utils/starknet/starknet.cjs"),r=a.z.object({type:a.z.enum(["DECLARE","DEPLOY","DEPLOY_ACCOUNT","INVOKE"]).default("INVOKE"),calls:a.z.array(t.callSchema).or(t.callSchema).optional(),calldata:a.z.array(a.z.string()).optional(),classHash:e.hexSchema.optional(),salt:e.hexSchema.optional(),signature:a.z.array(a.z.string()).optional()});exports.transactionReviewTransactionsSchema=r;
@@ -1,12 +1,12 @@
1
1
  import { z as a } from "zod";
2
- import { callSchema as o } from "../../utils/starknet/starknet.js";
3
- import { hexSchema as t } from "../../utils/hex.js";
2
+ import { hexSchema as o } from "../../utils/hex.js";
3
+ import { callSchema as t } from "../../utils/starknet/starknet.js";
4
4
  const n = a.object({
5
5
  type: a.enum(["DECLARE", "DEPLOY", "DEPLOY_ACCOUNT", "INVOKE"]).default("INVOKE"),
6
- calls: a.array(o).or(o).optional(),
6
+ calls: a.array(t).or(t).optional(),
7
7
  calldata: a.array(a.string()).optional(),
8
- classHash: t.optional(),
9
- salt: t.optional(),
8
+ classHash: o.optional(),
9
+ salt: o.optional(),
10
10
  signature: a.array(a.string()).optional()
11
11
  });
12
12
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.38.0",
3
+ "version": "1.39.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/argentlabs/x-shared.git"