@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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/.eslintrc.d.cts +2 -0
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.js +297 -295
  5. package/dist/src/backend/index.d.ts +1 -1
  6. package/dist/src/bigdecimal/index.d.ts +1 -1
  7. package/dist/src/cache/index.d.ts +1 -1
  8. package/dist/src/chains/starknet/services/address/index.d.ts +1 -1
  9. package/dist/src/errors/account.d.ts +1 -1
  10. package/dist/src/errors/address.d.ts +1 -1
  11. package/dist/src/errors/call.d.ts +1 -1
  12. package/dist/src/errors/network.d.ts +1 -1
  13. package/dist/src/errors/review.d.ts +1 -1
  14. package/dist/src/errors/swap.d.ts +1 -1
  15. package/dist/src/features/simulation/activity/schema.cjs +1 -1
  16. package/dist/src/features/simulation/activity/schema.d.ts +346 -334
  17. package/dist/src/features/simulation/activity/schema.js +17 -26
  18. package/dist/src/features/swap/services/index.d.ts +1 -1
  19. package/dist/src/http/index.d.ts +2 -2
  20. package/dist/src/knownDapps/index.d.ts +1 -1
  21. package/dist/src/nameResolution/index.d.ts +1 -1
  22. package/dist/src/nfts/index.d.ts +1 -1
  23. package/dist/src/onchainRecovery/index.d.ts +1 -1
  24. package/dist/src/staking/schema.cjs +1 -1
  25. package/dist/src/staking/schema.d.ts +88 -505
  26. package/dist/src/staking/schema.js +27 -19
  27. package/dist/src/tokens/index.d.ts +1 -1
  28. package/dist/src/tokens/service/implementation.d.ts +21 -2
  29. package/dist/src/tokens/service/index.d.ts +1 -1
  30. package/dist/src/tokens/service/tokenError.d.ts +1 -1
  31. package/dist/src/tokens/service/types/backend.model.cjs +1 -1
  32. package/dist/src/tokens/service/types/backend.model.d.ts +840 -80
  33. package/dist/src/tokens/service/types/backend.model.js +117 -114
  34. package/dist/src/transactions/estimate/error.d.ts +1 -1
  35. package/dist/src/transactions/index.d.ts +5 -5
  36. package/dist/src/transactions/service/index.d.ts +1 -1
  37. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { z as t } from "zod";
2
- import { actionSchema as m, targetedDappSchema as d } from "../transactionReview/schema.js";
3
- import { investmentMetaSchema as g } from "../../../staking/schema.js";
2
+ import { stakingActionSchema as m, stakerInfoSchema as d, investmentMetaSchema as g } from "../../../staking/schema.js";
3
+ import { actionSchema as y, targetedDappSchema as b } from "../transactionReview/schema.js";
4
4
  import { addressSchemaArgentBackend as e } from "../../../chains/starknet/address.js";
5
5
  const r = t.object({
6
6
  network: t.string(),
@@ -16,20 +16,20 @@ const r = t.object({
16
16
  currency: t.string(),
17
17
  currencyAmount: t.number()
18
18
  }).optional().nullable()
19
- }), i = t.enum(["ethereum", "starknet", "zksync", "zksync2"]), y = t.object({
19
+ }), i = t.enum(["ethereum", "starknet", "zksync", "zksync2"]), S = t.object({
20
20
  type: t.enum(["payment", "gasFee"]),
21
21
  leg: t.enum(["credit", "debit"]),
22
22
  asset: a,
23
23
  counterParty: e.optional(),
24
24
  counterPartyNetwork: i.optional()
25
- }), b = t.object({
25
+ }), h = t.object({
26
26
  address: e,
27
27
  network: i,
28
28
  type: t.enum(["wallet", "token"])
29
- }), S = t.object({
29
+ }), v = t.object({
30
30
  chainId: t.enum(["TESTNET", "MAINNET", "SEPOLIA"]),
31
31
  ethereumNetwork: t.enum(["mainnet", "sepolia"])
32
- }), h = t.enum([
32
+ }), k = t.enum([
33
33
  "approval",
34
34
  "changePubKey",
35
35
  "dappInteraction",
@@ -51,7 +51,7 @@ const r = t.object({
51
51
  "cancelEscape",
52
52
  "accountUpgraded",
53
53
  "multisigConfigurationUpdated"
54
- ]), v = t.object({
54
+ ]), A = t.object({
55
55
  name: t.string(),
56
56
  parameters: t.array(t.unknown()).optional()
57
57
  }), f = t.object({
@@ -68,15 +68,6 @@ const r = t.object({
68
68
  newVersion: t.string().optional(),
69
69
  signerGuid: t.string().optional(),
70
70
  signers: t.array(f).optional()
71
- }), k = t.enum([
72
- "deposit",
73
- "withdraw",
74
- "finalizeWithdraw",
75
- "claim"
76
- ]), A = t.object({
77
- name: t.string(),
78
- iconUrl: t.string(),
79
- address: e
80
71
  }), o = t.discriminatedUnion("type", [
81
72
  t.object({
82
73
  type: t.literal("deploy"),
@@ -109,15 +100,15 @@ const r = t.object({
109
100
  t.object({
110
101
  type: t.literal("dappInteraction"),
111
102
  dappAddress: e,
112
- function: v.optional().nullable()
103
+ function: A.optional().nullable()
113
104
  // This object is often null. It happens when we were unable to get the ABI or failed decoding the function call
114
105
  }),
115
106
  t.object({
116
107
  type: t.literal("staking"),
117
- stakingAction: k,
108
+ stakingAction: m,
118
109
  counterparty: e,
119
110
  asset: a,
120
- stakerInfo: A
111
+ stakerInfo: d
121
112
  })
122
113
  ]), w = t.union([
123
114
  o,
@@ -173,21 +164,21 @@ const r = t.object({
173
164
  wallet: e,
174
165
  txSender: e,
175
166
  source: t.string(),
176
- type: h,
167
+ type: k,
177
168
  group: t.enum(["finance", "security"]),
178
169
  submitted: t.number(),
179
170
  lastModified: t.number(),
180
171
  transaction: r,
181
- transfers: t.array(y),
172
+ transfers: t.array(S),
182
173
  // to be clarified
183
174
  fees: t.array(I).optional(),
184
- relatedAddresses: t.array(b).nullable(),
175
+ relatedAddresses: t.array(h).nullable(),
185
176
  network: t.string(),
186
- networkDetails: S.optional(),
177
+ networkDetails: v.optional(),
187
178
  details: w,
188
179
  transferSummary: t.array(c).optional(),
189
180
  dapp: N.optional(),
190
- actions: t.array(m).optional(),
181
+ actions: t.array(y).optional(),
191
182
  title: t.string().optional(),
192
183
  multisigDetails: t.object({
193
184
  signers: t.array(e)
@@ -220,7 +211,7 @@ const r = t.object({
220
211
  transaction: r.pick({
221
212
  hash: !0
222
213
  }),
223
- dapp: d.optional(),
214
+ dapp: b.optional(),
224
215
  meta: T.optional()
225
216
  }), M = t.array(p), F = t.object({
226
217
  activities: M,
@@ -244,7 +235,7 @@ export {
244
235
  F as activityResponseSchema,
245
236
  p as activitySchema,
246
237
  c as activitySummarySchema,
247
- y as activityTransferSchema,
238
+ S as activityTransferSchema,
248
239
  I as feeSchema,
249
240
  K as isActivityDetailsAction,
250
241
  u as isActivitySummary,
@@ -1,2 +1,2 @@
1
1
  export * from './implementation';
2
- export * from './interface';
2
+ export type * from './interface';
@@ -1,9 +1,9 @@
1
1
  export * from './DateService';
2
2
  export * from './HttpError';
3
3
  export * from './HttpService';
4
- export * from './IDateService';
4
+ export type * from './IDateService';
5
5
  export * from './IHttpService';
6
6
  export * from './SWRService';
7
- export * from './apiData';
7
+ export type * from './apiData';
8
8
  export * from './fetcher';
9
9
  export * from './time';
@@ -1,4 +1,4 @@
1
- export * from './IKnownDappsBackendService';
1
+ export type * from './IKnownDappsBackendService';
2
2
  export * from './KnownDappsBackendService';
3
3
  export * from './schema';
4
4
  export * from './utils';
@@ -1,3 +1,3 @@
1
1
  export * from './ResolveNameService';
2
- export * from './IResolveNameService';
2
+ export type * from './IResolveNameService';
3
3
  export * from './schema';
@@ -1,3 +1,3 @@
1
1
  export * from './BackendNftService';
2
- export * from './INFTService';
2
+ export type * from './INFTService';
3
3
  export * from './utils';
@@ -1,3 +1,3 @@
1
1
  export * from './OnchainRecoveryService';
2
- export * from './IOnchainRecoveryService';
2
+ export type * from './IOnchainRecoveryService';
3
3
  export * from './schema';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),i=require("../utils/starknet/starknet.cjs"),t=require("../chains/starknet/address.cjs"),n=e.z.object({id:e.z.string(),dappId:e.z.string(),productId:e.z.string(),productName:e.z.string(),chain:e.z.string(),name:e.z.string(),description:e.z.string(),iconUrl:e.z.string().url(),learnMoreUrl:e.z.string().url().optional(),riskFactor:e.z.enum(["low"]),metrics:e.z.object({baseApy:e.z.string(),totalApy:e.z.string(),tvl:e.z.string().optional()}),incentives:e.z.array(e.z.object({name:e.z.string(),description:e.z.string(),iconUrl:e.z.string().url(),learnMoreUrl:e.z.string().url(),metric:e.z.object({apy:e.z.string()})})),buyEnabled:e.z.boolean(),sellEnabled:e.z.boolean()}),s=n.extend({category:e.z.literal("staking"),investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),fees:e.z.object({depositFees:e.z.object({protocolFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),withdrawalFees:e.z.object({protocolFee:e.z.string().nullable().optional(),totalFee:e.z.string()})})}),o=n.extend({category:e.z.literal("lending"),investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),fees:e.z.object({depositFees:e.z.object({totalFee:e.z.string()}),withdrawalFees:e.z.object({totalFee:e.z.string()})})}),r=e.z.object({name:e.z.string(),iconUrl:e.z.string().url(),address:e.z.string()}),a=n.extend({category:e.z.literal("strkDelegatedStaking"),stakerInfo:r,investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"]),useDecomposedBalances:e.z.boolean().optional()}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"]),useDecomposedBalances:e.z.boolean().optional(),amountsRequirement:e.z.enum(["fullBalance"]).optional(),timelockDuration:e.z.number().optional()}),fees:e.z.object({depositFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),withdrawalFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),performanceFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}).optional()}),claimEnabled:e.z.boolean().optional()}),l=e.z.discriminatedUnion("category",[s,o,a]),c=e.z.object({investments:e.z.array(l)}),d=e.z.object({calls:e.z.array(i.callSchema)}),z=e.z.object({investment:a,accountAddress:t.addressSchemaArgentBackend,tokenAddress:t.addressSchemaArgentBackend,amount:e.z.string(),useFullBalance:e.z.boolean()}),m=e.z.object({stakerInfo:r,tokenAddress:t.addressSchema,amount:e.z.string()});exports.buildBuyCalldataResponseSchema=d;exports.buildBuyCalldataSchema=z;exports.investmentMetaSchema=m;exports.investmentSchema=l;exports.investmentsResponseSchema=c;exports.lendingInvestmentSchema=o;exports.stakingInvestmentSchema=s;exports.strkDelegatedStakingInvestmentSchema=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),c=require("../utils/starknet/starknet.cjs"),t=require("../chains/starknet/address.cjs"),a=e.z.object({id:e.z.string(),dappId:e.z.string(),productId:e.z.string(),productName:e.z.string(),chain:e.z.string(),name:e.z.string(),description:e.z.string(),iconUrl:e.z.string().url(),learnMoreUrl:e.z.string().url().optional(),riskFactor:e.z.enum(["low"]),metrics:e.z.object({baseApy:e.z.string(),totalApy:e.z.string(),tvl:e.z.string().optional()}),incentives:e.z.array(e.z.object({name:e.z.string(),description:e.z.string(),iconUrl:e.z.string().url(),learnMoreUrl:e.z.string().url(),metric:e.z.object({apy:e.z.string()})})),buyEnabled:e.z.boolean(),sellEnabled:e.z.boolean()}),s=a.extend({category:e.z.literal("staking"),investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),fees:e.z.object({depositFees:e.z.object({protocolFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),withdrawalFees:e.z.object({protocolFee:e.z.string().nullable().optional(),totalFee:e.z.string()})})}),o=a.extend({category:e.z.literal("lending"),investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),fees:e.z.object({depositFees:e.z.object({totalFee:e.z.string()}),withdrawalFees:e.z.object({totalFee:e.z.string()})})}),n=e.z.object({name:e.z.string().optional(),iconUrl:e.z.string().url().optional(),address:e.z.string()}),r=a.extend({category:e.z.literal("strkDelegatedStaking"),stakerInfo:n,investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"]),useDecomposedBalances:e.z.boolean().optional()}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"]),useDecomposedBalances:e.z.boolean().optional(),amountsRequirement:e.z.enum(["fullBalance"]).optional(),timelockDuration:e.z.number().optional()}),fees:e.z.object({depositFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),withdrawalFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),performanceFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}).optional()}),claimEnabled:e.z.boolean().optional()}),i=e.z.discriminatedUnion("category",[s,o,r]),z=e.z.object({investments:e.z.array(i)}),d=e.z.object({calls:e.z.array(c.callSchema)}),m=e.z.object({investmentId:e.z.string(),stakerInfo:n,accountAddress:t.addressSchemaArgentBackend,tokenAddress:t.addressSchemaArgentBackend,amount:e.z.string()}),l=e.z.enum(["stake","initiateWithdraw","withdraw","claim"]),g=e.z.object({stakingAction:l,stakerInfo:n,tokenAddress:t.addressSchema,amount:e.z.string()});exports.investmentMetaSchema=g;exports.investmentSchema=i;exports.investmentsResponseSchema=z;exports.lendingInvestmentSchema=o;exports.stakerInfoSchema=n;exports.stakingActionSchema=l;exports.stakingInvestmentSchema=s;exports.strkDelegatedStakingInvestmentSchema=r;exports.strkStakingCalldataResponseSchema=d;exports.strkStakingCalldataSchema=m;