@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.
- package/dist/simulation.cjs +1 -1
- package/dist/simulation.js +20 -18
- package/dist/src/features/simulation/activity/schema.cjs +1 -1
- package/dist/src/features/simulation/activity/schema.d.ts +238 -12
- package/dist/src/features/simulation/activity/schema.js +48 -46
- package/dist/src/features/simulation/transactionReview/schema.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/schema.d.ts +76 -0
- package/dist/src/features/simulation/transactionReview/schema.js +106 -98
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import { estimatedFeesSchema as
|
|
3
|
-
import { severitySchema as
|
|
4
|
-
import { addressSchemaArgentBackend as n, addressSchema as
|
|
5
|
-
const
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
17
|
+
}), c = t.discriminatedUnion("type", [
|
|
18
18
|
t.object({
|
|
19
19
|
type: t.literal("amount"),
|
|
20
20
|
label: t.string(),
|
|
21
|
-
token:
|
|
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:
|
|
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:
|
|
63
|
+
token: e
|
|
64
64
|
})
|
|
65
|
-
]),
|
|
65
|
+
]), E = t.object({
|
|
66
66
|
name: t.string(),
|
|
67
|
-
properties: t.array(
|
|
68
|
-
defaultProperties: t.array(
|
|
69
|
-
}),
|
|
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
|
-
]),
|
|
74
|
+
]), U = t.object({
|
|
75
75
|
unknown_token: t.unknown().optional(),
|
|
76
76
|
date_of_addition: t.string().optional(),
|
|
77
|
-
contract_address:
|
|
77
|
+
contract_address: v.optional(),
|
|
78
78
|
reason: t.string().optional(),
|
|
79
79
|
value: t.string().or(t.number()).optional()
|
|
80
|
-
}),
|
|
81
|
-
reason:
|
|
82
|
-
details:
|
|
83
|
-
severity:
|
|
84
|
-
}),
|
|
85
|
-
assessment:
|
|
86
|
-
warnings: t.array(
|
|
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:
|
|
92
|
-
}),
|
|
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(
|
|
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(
|
|
106
|
+
warnings: t.array(p).optional(),
|
|
107
107
|
assessmentDetails: t.object({
|
|
108
108
|
contract_address: t.string()
|
|
109
109
|
}).optional(),
|
|
110
|
-
targetedDapp:
|
|
111
|
-
reviews: t.array(
|
|
112
|
-
}).optional(),
|
|
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
|
-
}),
|
|
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:
|
|
132
|
-
links:
|
|
133
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
148
|
-
overallFee:
|
|
149
|
-
gasPrice:
|
|
150
|
-
gasUsage:
|
|
151
|
-
dataGasPrice:
|
|
152
|
-
dataGasConsumed:
|
|
153
|
-
},
|
|
154
|
-
...
|
|
155
|
-
unit: t.string().transform((
|
|
156
|
-
maxFee:
|
|
157
|
-
}),
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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:
|
|
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
|
-
}),
|
|
196
|
+
}), S = t.object({
|
|
197
197
|
reviewOfTransaction: m,
|
|
198
|
-
simulation:
|
|
198
|
+
simulation: C,
|
|
199
199
|
simulationError: t.undefined()
|
|
200
|
-
}),
|
|
200
|
+
}), h = t.object({
|
|
201
201
|
reviewOfTransaction: m,
|
|
202
202
|
simulation: t.undefined(),
|
|
203
|
-
simulationError:
|
|
204
|
-
}), s =
|
|
203
|
+
simulationError: O
|
|
204
|
+
}), s = S.or(h), r = t.object({
|
|
205
205
|
subsidiseDeployment: t.boolean(),
|
|
206
206
|
subsidiseTransaction: t.boolean()
|
|
207
|
-
}),
|
|
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
|
-
|
|
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:
|
|
214
|
-
isBackendDown: t.boolean().default(!1).optional()
|
|
215
|
-
|
|
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(
|
|
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
|
|
222
|
-
return
|
|
227
|
+
function L(a) {
|
|
228
|
+
return S.safeParse(a).success;
|
|
223
229
|
}
|
|
224
|
-
function
|
|
225
|
-
return
|
|
230
|
+
function M(a) {
|
|
231
|
+
return h.safeParse(a).success;
|
|
226
232
|
}
|
|
227
233
|
export {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
|
|
245
|
-
|
|
246
|
-
|
|
252
|
+
D as targetedDappSchema,
|
|
253
|
+
U as warningDetailsSchema,
|
|
254
|
+
p as warningSchema
|
|
247
255
|
};
|