@argent/x-shared 1.64.0 → 1.65.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.
@@ -1,12 +1,12 @@
1
1
  import { z as t } from "zod";
2
- import { estimatedFeesSchema as h, estimatedFeesV2Schema as y } from "../fees/schema.js";
3
- import { severitySchema as f, reasonsSchema as j } from "../warning/schema.js";
4
- import { addressSchemaArgentBackend as n, addressSchema as k } from "../../../chains/starknet/address.js";
5
- const v = t.object({
2
+ import { estimatedFeesSchema as y, estimatedFeesV2Schema as f } from "../fees/schema.js";
3
+ import { severitySchema as j, reasonsSchema as k } from "../warning/schema.js";
4
+ import { addressSchemaArgentBackend as n, addressSchema as v } from "../../../chains/starknet/address.js";
5
+ const w = t.object({
6
6
  name: t.string(),
7
7
  url: t.string(),
8
8
  position: t.number()
9
- }), o = t.object({
9
+ }), e = t.object({
10
10
  address: t.string(),
11
11
  name: t.string(),
12
12
  symbol: t.string().optional(),
@@ -14,11 +14,11 @@ const v = t.object({
14
14
  unknown: t.boolean(),
15
15
  iconUrl: t.string().optional(),
16
16
  type: t.string()
17
- }), l = t.discriminatedUnion("type", [
17
+ }), c = t.discriminatedUnion("type", [
18
18
  t.object({
19
19
  type: t.literal("amount"),
20
20
  label: t.string(),
21
- token: o,
21
+ token: e,
22
22
  amount: t.string(),
23
23
  usd: t.string(),
24
24
  editable: t.boolean()
@@ -39,7 +39,7 @@ const v = t.object({
39
39
  t.object({
40
40
  type: t.literal("token_address"),
41
41
  label: t.string(),
42
- token: o
42
+ token: e
43
43
  }),
44
44
  t.object({
45
45
  type: t.literal("calldata"),
@@ -60,42 +60,42 @@ const v = t.object({
60
60
  t.object({
61
61
  type: t.literal("nft"),
62
62
  label: t.string(),
63
- token: o
63
+ token: e
64
64
  })
65
- ]), w = t.object({
65
+ ]), E = t.object({
66
66
  name: t.string(),
67
- properties: t.array(l),
68
- defaultProperties: t.array(l).optional()
69
- }), E = t.union([
67
+ properties: t.array(c),
68
+ defaultProperties: t.array(c).optional()
69
+ }), F = t.union([
70
70
  t.literal("verified"),
71
71
  t.literal("neutral"),
72
72
  t.literal("partial"),
73
73
  t.literal("warn")
74
- ]), F = t.object({
74
+ ]), U = t.object({
75
75
  unknown_token: t.unknown().optional(),
76
76
  date_of_addition: t.string().optional(),
77
- contract_address: k.optional(),
77
+ contract_address: v.optional(),
78
78
  reason: t.string().optional(),
79
79
  value: t.string().or(t.number()).optional()
80
- }), c = t.object({
81
- reason: j,
82
- details: F.optional(),
83
- severity: f
84
- }), U = t.object({
85
- assessment: E,
86
- warnings: t.array(c).optional(),
80
+ }), p = t.object({
81
+ reason: k,
82
+ details: U.optional(),
83
+ severity: j
84
+ }), x = t.object({
85
+ assessment: F,
86
+ warnings: t.array(p).optional(),
87
87
  assessmentReasons: t.array(t.string()).optional(),
88
88
  assessmentDetails: t.object({
89
89
  contract_address: t.string()
90
90
  }).optional(),
91
- action: w
92
- }), x = t.object({
91
+ action: E
92
+ }), D = t.object({
93
93
  name: t.string(),
94
94
  description: t.string(),
95
95
  logoUrl: t.string().optional(),
96
96
  iconUrl: t.string().optional(),
97
97
  argentVerified: t.boolean(),
98
- links: t.array(v)
98
+ links: t.array(w)
99
99
  }), m = t.object({
100
100
  assessment: t.union([
101
101
  t.literal("verified"),
@@ -103,18 +103,18 @@ const v = t.object({
103
103
  t.literal("partial"),
104
104
  t.literal("warn")
105
105
  ]),
106
- warnings: t.array(c).optional(),
106
+ warnings: t.array(p).optional(),
107
107
  assessmentDetails: t.object({
108
108
  contract_address: t.string()
109
109
  }).optional(),
110
- targetedDapp: x.optional(),
111
- reviews: t.array(U)
112
- }).optional(), p = t.object({
110
+ targetedDapp: D.optional(),
111
+ reviews: t.array(x)
112
+ }).optional(), d = t.object({
113
113
  banner: t.string().nullable().optional(),
114
114
  preview: t.string().nullable().optional(),
115
115
  full: t.string().nullable().optional(),
116
116
  original: t.string().nullable().optional()
117
- }), D = t.object({
117
+ }), A = t.object({
118
118
  twitter: t.string().optional(),
119
119
  external: t.string().optional(),
120
120
  discord: t.string().optional()
@@ -128,47 +128,47 @@ const v = t.object({
128
128
  usdValue: t.string().optional(),
129
129
  iconUrl: t.string().optional(),
130
130
  unknown: t.boolean().optional(),
131
- imageUrls: p.optional(),
132
- links: D.optional()
133
- }), A = t.object({
131
+ imageUrls: d.optional(),
132
+ links: A.optional()
133
+ }), T = t.object({
134
134
  tokenAddress: n,
135
135
  owner: n,
136
136
  spender: n,
137
137
  value: t.string().optional(),
138
138
  approvalForAll: t.boolean(),
139
139
  details: i.optional()
140
- }), T = t.object({
140
+ }), P = t.object({
141
141
  tokenAddress: n,
142
142
  from: n,
143
143
  to: n,
144
144
  tokenId: t.string().optional(),
145
145
  value: t.string().optional(),
146
146
  details: i.optional()
147
- }), a = t.union([t.string(), t.number(), t.bigint()]).transform((e) => parseInt(e.toString(), 10)), d = {
148
- overallFee: a,
149
- gasPrice: a,
150
- gasUsage: a,
151
- dataGasPrice: a.optional(),
152
- dataGasConsumed: a.optional()
153
- }, P = t.object({
154
- ...d,
155
- unit: t.string().transform((e) => e.toUpperCase()).pipe(t.literal("WEI")),
156
- maxFee: a
157
- }), g = t.object({
147
+ }), o = t.union([t.string(), t.number(), t.bigint()]).transform((a) => parseInt(a.toString(), 10)), g = {
148
+ overallFee: o,
149
+ gasPrice: o,
150
+ gasUsage: o,
151
+ dataGasPrice: o.optional(),
152
+ dataGasConsumed: o.optional()
153
+ }, _ = t.object({
154
+ ...g,
155
+ unit: t.string().transform((a) => a.toUpperCase()).pipe(t.literal("WEI")),
156
+ maxFee: o
157
+ }), b = t.object({
158
158
  address: n,
159
159
  unknown: t.boolean(),
160
160
  type: t.literal("ERC20")
161
- }), _ = t.object({
162
- ...d,
163
- unit: t.string().transform((e) => e.toUpperCase()).pipe(t.literal("FRI")),
164
- maxAmount: a,
165
- maxPricePerUnit: a,
166
- token: g
167
161
  }), V = t.object({
168
- token: g,
169
- overallFee: a,
170
- maxFee: a
171
- }), b = P.or(_), I = b.or(V), N = t.object({
162
+ ...g,
163
+ unit: t.string().transform((a) => a.toUpperCase()).pipe(t.literal("FRI")),
164
+ maxAmount: o,
165
+ maxPricePerUnit: o,
166
+ token: b
167
+ }), I = t.object({
168
+ token: b,
169
+ overallFee: o,
170
+ maxFee: o
171
+ }), u = _.or(V), N = u.or(I), R = t.object({
172
172
  type: t.string(),
173
173
  label: t.string(),
174
174
  tokenId: t.string().optional(),
@@ -179,69 +179,77 @@ const v = t.object({
179
179
  tokenIdDetails: t.object({
180
180
  name: t.string().optional(),
181
181
  description: t.string().optional(),
182
- imageUrls: p.optional()
182
+ imageUrls: d.optional()
183
183
  }).optional()
184
- }), R = t.object({
185
- approvals: t.array(A).optional(),
186
- transfers: t.array(T).optional(),
187
- calculatedNonce: t.string().optional(),
188
- feeEstimation: b,
189
- feeEstimations: t.array(I),
190
- summary: t.array(N).optional()
191
184
  }), C = t.object({
185
+ approvals: t.array(T).optional(),
186
+ transfers: t.array(P).optional(),
187
+ calculatedNonce: t.string().optional(),
188
+ feeEstimation: u,
189
+ feeEstimations: t.array(N),
190
+ summary: t.array(R).optional()
191
+ }), O = t.object({
192
192
  label: t.string().optional(),
193
193
  code: t.number().optional(),
194
194
  message: t.string().optional(),
195
195
  error: t.string().optional()
196
- }), u = t.object({
196
+ }), S = t.object({
197
197
  reviewOfTransaction: m,
198
- simulation: R,
198
+ simulation: C,
199
199
  simulationError: t.undefined()
200
- }), S = t.object({
200
+ }), h = t.object({
201
201
  reviewOfTransaction: m,
202
202
  simulation: t.undefined(),
203
- simulationError: C
204
- }), s = u.or(S), r = t.object({
203
+ simulationError: O
204
+ }), s = S.or(h), r = t.object({
205
205
  subsidiseDeployment: t.boolean(),
206
206
  subsidiseTransaction: t.boolean()
207
- }), H = t.object({
207
+ }), B = t.object({
208
+ name: t.string().optional(),
209
+ shouldShow: t.boolean().optional()
210
+ }), l = t.array(B), q = t.object({
208
211
  transactions: t.array(s).optional(),
209
- subsidyStatus: r.optional()
210
- }), W = t.object({
212
+ subsidyStatus: r.optional(),
213
+ promotions: l.optional()
214
+ }), J = t.object({
211
215
  transactions: t.array(s).optional(),
212
216
  subsidyStatus: r.optional(),
213
- enrichedFeeEstimation: h.optional(),
214
- isBackendDown: t.boolean().default(!1).optional()
215
- }), q = t.object({
217
+ enrichedFeeEstimation: y.optional(),
218
+ isBackendDown: t.boolean().default(!1).optional(),
219
+ promotions: l.optional()
220
+ }), K = t.object({
216
221
  transactions: t.array(s).optional(),
217
222
  subsidyStatus: r.optional(),
218
- enrichedFeeEstimation: t.array(y).optional(),
219
- isBackendDown: t.boolean().default(!1).optional()
223
+ enrichedFeeEstimation: t.array(f).optional(),
224
+ isBackendDown: t.boolean().default(!1).optional(),
225
+ promotions: l.optional()
220
226
  });
221
- function J(e) {
222
- return u.safeParse(e).success;
227
+ function L(a) {
228
+ return S.safeParse(a).success;
223
229
  }
224
- function K(e) {
225
- return S.safeParse(e).success;
230
+ function M(a) {
231
+ return h.safeParse(a).success;
226
232
  }
227
233
  export {
228
- w as actionSchema,
229
- E as assessmentSchema,
230
- W as enrichedSimulateAndReviewSchema,
231
- q as enrichedSimulateAndReviewV2Schema,
232
- I as feeEstimationNativeOrPaymasterSchema,
233
- b as feeEstimationSchema,
234
- P as feeEstimationTxV1Schema,
235
- _ as feeEstimationTxV3Schema,
236
- J as isNotTransactionSimulationError,
237
- K as isTransactionSimulationError,
238
- V as paymasterFeeEstimationSchema,
239
- g as paymasterFeeTokenSchema,
240
- l as propertySchema,
241
- U as reviewSchema,
242
- H as simulateAndReviewSchema,
234
+ E as actionSchema,
235
+ F as assessmentSchema,
236
+ J as enrichedSimulateAndReviewSchema,
237
+ K as enrichedSimulateAndReviewV2Schema,
238
+ N as feeEstimationNativeOrPaymasterSchema,
239
+ u as feeEstimationSchema,
240
+ _ as feeEstimationTxV1Schema,
241
+ V as feeEstimationTxV3Schema,
242
+ L as isNotTransactionSimulationError,
243
+ M as isTransactionSimulationError,
244
+ I as paymasterFeeEstimationSchema,
245
+ b as paymasterFeeTokenSchema,
246
+ B as promotionSchema,
247
+ l as promotionsSchema,
248
+ c as propertySchema,
249
+ x as reviewSchema,
250
+ q as simulateAndReviewSchema,
243
251
  r as subsidyStatusSchema,
244
- x as targetedDappSchema,
245
- F as warningDetailsSchema,
246
- c as warningSchema
252
+ D as targetedDappSchema,
253
+ U as warningDetailsSchema,
254
+ p as warningSchema
247
255
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.64.0",
3
+ "version": "1.65.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/argentlabs/x-shared.git"