@argent/x-shared 1.77.0 → 1.77.2
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/index.cjs +1 -1
- package/dist/index.js +120 -122
- package/dist/simulation.cjs +1 -1
- package/dist/simulation.js +18 -20
- package/dist/src/features/simulation/activity/schema.cjs +1 -1
- package/dist/src/features/simulation/activity/schema.d.ts +0 -27
- package/dist/src/features/simulation/activity/schema.js +40 -43
- package/dist/src/features/simulation/transactionReview/schema.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/schema.d.ts +0 -18
- package/dist/src/features/simulation/transactionReview/schema.js +70 -77
- package/dist/src/http/IHttpService.d.ts +1 -0
- package/dist/src/transactions/transactionExecuteTypes.cjs +1 -1
- package/dist/src/transactions/transactionExecuteTypes.d.ts +0 -43
- package/dist/src/transactions/transactionExecuteTypes.js +3 -18
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import { severitySchema as
|
|
3
|
-
import { estimatedFeesSchema as
|
|
4
|
-
import { addressSchema as
|
|
5
|
-
const
|
|
2
|
+
import { severitySchema as y, reasonsSchema as h } from "../warning/schema.js";
|
|
3
|
+
import { estimatedFeesSchema as j } from "../fees/schema.js";
|
|
4
|
+
import { addressSchema as f, addressSchemaArgentBackend as a } from "../../../chains/starknet/address.js";
|
|
5
|
+
const k = t.object({
|
|
6
6
|
name: t.string(),
|
|
7
7
|
url: t.string(),
|
|
8
8
|
position: t.number()
|
|
@@ -62,40 +62,40 @@ const v = t.object({
|
|
|
62
62
|
label: t.string(),
|
|
63
63
|
token: e
|
|
64
64
|
})
|
|
65
|
-
]),
|
|
65
|
+
]), v = t.object({
|
|
66
66
|
name: t.string(),
|
|
67
67
|
properties: t.array(r),
|
|
68
68
|
defaultProperties: t.array(r).optional()
|
|
69
|
-
}),
|
|
69
|
+
}), w = t.union([
|
|
70
70
|
t.literal("verified"),
|
|
71
71
|
t.literal("neutral"),
|
|
72
72
|
t.literal("partial"),
|
|
73
73
|
t.literal("warn")
|
|
74
|
-
]),
|
|
74
|
+
]), E = t.object({
|
|
75
75
|
unknown_token: t.unknown().optional(),
|
|
76
76
|
date_of_addition: t.string().optional(),
|
|
77
|
-
contract_address:
|
|
77
|
+
contract_address: f.optional(),
|
|
78
78
|
reason: t.string().optional(),
|
|
79
79
|
value: t.any().optional()
|
|
80
80
|
}), l = t.object({
|
|
81
|
-
reason:
|
|
82
|
-
details:
|
|
83
|
-
severity:
|
|
84
|
-
}),
|
|
85
|
-
assessment:
|
|
81
|
+
reason: h,
|
|
82
|
+
details: E.optional(),
|
|
83
|
+
severity: y
|
|
84
|
+
}), D = t.object({
|
|
85
|
+
assessment: w,
|
|
86
86
|
warnings: t.array(l).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: v
|
|
92
|
+
}), U = 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(k)
|
|
99
99
|
}), c = t.object({
|
|
100
100
|
assessment: t.union([
|
|
101
101
|
t.literal("verified"),
|
|
@@ -107,19 +107,19 @@ const v = t.object({
|
|
|
107
107
|
assessmentDetails: t.object({
|
|
108
108
|
contract_address: t.string()
|
|
109
109
|
}).optional(),
|
|
110
|
-
targetedDapp:
|
|
111
|
-
reviews: t.array(
|
|
110
|
+
targetedDapp: U.optional(),
|
|
111
|
+
reviews: t.array(D)
|
|
112
112
|
}).optional(), p = 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
|
+
}), F = t.object({
|
|
118
118
|
twitter: t.string().optional(),
|
|
119
119
|
external: t.string().optional(),
|
|
120
120
|
discord: t.string().optional()
|
|
121
121
|
}), s = t.object({
|
|
122
|
-
address:
|
|
122
|
+
address: a,
|
|
123
123
|
decimals: t.number().optional(),
|
|
124
124
|
symbol: t.string().optional(),
|
|
125
125
|
name: t.string(),
|
|
@@ -129,44 +129,44 @@ const v = t.object({
|
|
|
129
129
|
iconUrl: t.string().optional(),
|
|
130
130
|
unknown: t.boolean().optional(),
|
|
131
131
|
imageUrls: p.optional(),
|
|
132
|
-
links:
|
|
133
|
-
}),
|
|
134
|
-
tokenAddress:
|
|
135
|
-
owner:
|
|
136
|
-
spender:
|
|
132
|
+
links: F.optional()
|
|
133
|
+
}), T = t.object({
|
|
134
|
+
tokenAddress: a,
|
|
135
|
+
owner: a,
|
|
136
|
+
spender: a,
|
|
137
137
|
value: t.string().optional(),
|
|
138
138
|
approvalForAll: t.boolean(),
|
|
139
139
|
details: s.optional()
|
|
140
|
-
}),
|
|
141
|
-
tokenAddress:
|
|
142
|
-
from:
|
|
143
|
-
to:
|
|
140
|
+
}), A = t.object({
|
|
141
|
+
tokenAddress: a,
|
|
142
|
+
from: a,
|
|
143
|
+
to: a,
|
|
144
144
|
tokenId: t.string().optional(),
|
|
145
145
|
value: t.string().optional(),
|
|
146
146
|
details: s.optional()
|
|
147
|
-
}), n = t.union([t.string(), t.number(), t.bigint()]).transform((
|
|
148
|
-
address:
|
|
147
|
+
}), n = t.union([t.string(), t.number(), t.bigint()]).transform((o) => parseInt(o.toString(), 10)), m = t.object({
|
|
148
|
+
address: a,
|
|
149
149
|
unknown: t.boolean(),
|
|
150
150
|
type: t.literal("ERC20")
|
|
151
151
|
}), i = t.object({
|
|
152
152
|
maxAmount: n,
|
|
153
153
|
maxPricePerUnit: n
|
|
154
|
-
}),
|
|
154
|
+
}), _ = t.object({
|
|
155
155
|
l1Gas: i,
|
|
156
156
|
l1DataGas: i,
|
|
157
157
|
l2Gas: i
|
|
158
|
-
}),
|
|
158
|
+
}), x = t.object({
|
|
159
159
|
token: m,
|
|
160
160
|
overallFee: n,
|
|
161
161
|
maxFee: n,
|
|
162
162
|
defaultTip: n.optional()
|
|
163
|
-
}),
|
|
163
|
+
}), d = t.object({
|
|
164
164
|
overallFee: n,
|
|
165
|
-
resourceBounds:
|
|
166
|
-
unit: t.string().transform((
|
|
165
|
+
resourceBounds: _,
|
|
166
|
+
unit: t.string().transform((o) => o.toUpperCase()).pipe(t.literal("FRI")),
|
|
167
167
|
token: m,
|
|
168
168
|
defaultTip: n.optional()
|
|
169
|
-
}),
|
|
169
|
+
}), N = d.or(x), P = t.object({
|
|
170
170
|
type: t.string(),
|
|
171
171
|
label: t.string(),
|
|
172
172
|
tokenId: t.string().optional(),
|
|
@@ -182,70 +182,63 @@ const v = t.object({
|
|
|
182
182
|
description: t.string().optional(),
|
|
183
183
|
imageUrls: p.optional()
|
|
184
184
|
}).optional()
|
|
185
|
-
}),
|
|
186
|
-
approvals: t.array(
|
|
187
|
-
transfers: t.array(
|
|
185
|
+
}), R = t.object({
|
|
186
|
+
approvals: t.array(T).optional(),
|
|
187
|
+
transfers: t.array(A).optional(),
|
|
188
188
|
calculatedNonce: t.string().optional(),
|
|
189
|
-
feeEstimation:
|
|
190
|
-
feeEstimations: t.array(
|
|
191
|
-
summary: t.array(
|
|
192
|
-
}),
|
|
189
|
+
feeEstimation: d,
|
|
190
|
+
feeEstimations: t.array(N),
|
|
191
|
+
summary: t.array(P).optional()
|
|
192
|
+
}), I = t.object({
|
|
193
193
|
label: t.string().optional(),
|
|
194
194
|
code: t.number().optional(),
|
|
195
195
|
message: t.string().optional(),
|
|
196
196
|
error: t.string().optional()
|
|
197
|
-
}),
|
|
197
|
+
}), b = t.object({
|
|
198
198
|
reviewOfTransaction: c,
|
|
199
|
-
simulation:
|
|
199
|
+
simulation: R,
|
|
200
200
|
simulationError: t.undefined().optional()
|
|
201
201
|
}), g = t.object({
|
|
202
202
|
reviewOfTransaction: c,
|
|
203
203
|
simulation: t.undefined().optional(),
|
|
204
|
-
simulationError:
|
|
205
|
-
}), u =
|
|
204
|
+
simulationError: I
|
|
205
|
+
}), u = b.or(g), S = t.object({
|
|
206
206
|
subsidiseDeployment: t.boolean(),
|
|
207
207
|
subsidiseTransaction: t.boolean()
|
|
208
|
-
}),
|
|
209
|
-
name: t.string().optional(),
|
|
210
|
-
shouldShow: t.boolean().optional()
|
|
211
|
-
}), y = t.array(B), H = t.object({
|
|
208
|
+
}), C = t.object({
|
|
212
209
|
transactions: t.array(u).optional(),
|
|
213
210
|
canSubsidise: t.boolean().optional(),
|
|
214
|
-
subsidyStatus: S.optional()
|
|
215
|
-
|
|
216
|
-
}), q = t.object({
|
|
211
|
+
subsidyStatus: S.optional()
|
|
212
|
+
}), z = t.object({
|
|
217
213
|
transactions: t.array(u).optional(),
|
|
218
214
|
canSubsidise: t.boolean().optional(),
|
|
219
215
|
subsidyStatus: S.optional(),
|
|
220
|
-
enrichedFeeEstimation: t.array(
|
|
221
|
-
isBackendDown: t.boolean().default(!1).optional()
|
|
222
|
-
promotions: y.optional()
|
|
216
|
+
enrichedFeeEstimation: t.array(j).optional(),
|
|
217
|
+
isBackendDown: t.boolean().default(!1).optional()
|
|
223
218
|
});
|
|
224
|
-
function
|
|
225
|
-
return
|
|
219
|
+
function H(o) {
|
|
220
|
+
return b.safeParse(o).success;
|
|
226
221
|
}
|
|
227
|
-
function
|
|
228
|
-
return g.safeParse(
|
|
222
|
+
function q(o) {
|
|
223
|
+
return g.safeParse(o).success;
|
|
229
224
|
}
|
|
230
225
|
export {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
226
|
+
v as actionSchema,
|
|
227
|
+
w as assessmentSchema,
|
|
228
|
+
z as enrichedSimulateAndReviewSchema,
|
|
234
229
|
i as feeEstimationGasSchema,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
230
|
+
N as feeEstimationNativeOrPaymasterSchema,
|
|
231
|
+
_ as feeEstimationResourceBoundSchema,
|
|
232
|
+
d as feeEstimationSchema,
|
|
233
|
+
H as isNotTransactionSimulationError,
|
|
234
|
+
q as isTransactionSimulationError,
|
|
235
|
+
x as paymasterFeeEstimationSchema,
|
|
241
236
|
m as paymasterFeeTokenSchema,
|
|
242
|
-
B as promotionSchema,
|
|
243
|
-
y as promotionsSchema,
|
|
244
237
|
r as propertySchema,
|
|
245
|
-
|
|
246
|
-
|
|
238
|
+
D as reviewSchema,
|
|
239
|
+
C as simulateAndReviewSchema,
|
|
247
240
|
S as subsidyStatusSchema,
|
|
248
|
-
|
|
249
|
-
|
|
241
|
+
U as targetedDappSchema,
|
|
242
|
+
E as warningDetailsSchema,
|
|
250
243
|
l as warningSchema
|
|
251
244
|
};
|
|
@@ -3,6 +3,7 @@ export interface IHttpService {
|
|
|
3
3
|
get<T>(url: string, options?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
|
|
4
4
|
post<T>(url: string, options?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
|
|
5
5
|
delete(url: string, options?: RequestInit): Promise<void>;
|
|
6
|
+
patch<T>(url: string, options?: RequestInit): Promise<T>;
|
|
6
7
|
put<T>(url: string, options?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
|
|
7
8
|
}
|
|
8
9
|
export declare enum HTTP_ERROR_MESSAGE {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("zod"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("zod"),e=t.z.object({transactionState:t.z.enum(["submitted","rejected"]).optional(),transactionHash:t.z.string(),rejectReason:t.z.string().nullable().optional()});exports.transactionExecutionResponseSchema=e;
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const transactionPromotionPrizeSchema: z.ZodObject<{
|
|
3
|
-
tokenType: z.ZodString;
|
|
4
|
-
tokenAddress: z.ZodString;
|
|
5
|
-
tokenAmount: z.ZodString;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
export declare const transactionPromotionSchema: z.ZodObject<{
|
|
8
|
-
type: z.ZodEnum<{
|
|
9
|
-
lootbox: "lootbox";
|
|
10
|
-
}>;
|
|
11
|
-
status: z.ZodEnum<{
|
|
12
|
-
notEligible: "notEligible";
|
|
13
|
-
win: "win";
|
|
14
|
-
loss: "loss";
|
|
15
|
-
disabled: "disabled";
|
|
16
|
-
}>;
|
|
17
|
-
prizes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
18
|
-
tokenType: z.ZodString;
|
|
19
|
-
tokenAddress: z.ZodString;
|
|
20
|
-
tokenAmount: z.ZodString;
|
|
21
|
-
}, z.core.$strip>>>>;
|
|
22
|
-
prizeTierLevel: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
23
|
-
prizeUsdAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
2
|
export declare const transactionExecutionResponseSchema: z.ZodObject<{
|
|
26
3
|
transactionState: z.ZodOptional<z.ZodEnum<{
|
|
27
4
|
rejected: "rejected";
|
|
@@ -29,25 +6,5 @@ export declare const transactionExecutionResponseSchema: z.ZodObject<{
|
|
|
29
6
|
}>>;
|
|
30
7
|
transactionHash: z.ZodString;
|
|
31
8
|
rejectReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
-
promotions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
33
|
-
type: z.ZodEnum<{
|
|
34
|
-
lootbox: "lootbox";
|
|
35
|
-
}>;
|
|
36
|
-
status: z.ZodEnum<{
|
|
37
|
-
notEligible: "notEligible";
|
|
38
|
-
win: "win";
|
|
39
|
-
loss: "loss";
|
|
40
|
-
disabled: "disabled";
|
|
41
|
-
}>;
|
|
42
|
-
prizes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
43
|
-
tokenType: z.ZodString;
|
|
44
|
-
tokenAddress: z.ZodString;
|
|
45
|
-
tokenAmount: z.ZodString;
|
|
46
|
-
}, z.core.$strip>>>>;
|
|
47
|
-
prizeTierLevel: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
48
|
-
prizeUsdAmount: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
-
}, z.core.$strip>>>>;
|
|
50
9
|
}, z.core.$strip>;
|
|
51
10
|
export type TransactionExecutionResponse = z.infer<typeof transactionExecutionResponseSchema>;
|
|
52
|
-
export type TransactionPromotion = z.infer<typeof transactionPromotionSchema>;
|
|
53
|
-
export type TransactionPromotionPrize = z.infer<typeof transactionPromotionPrizeSchema>;
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
const
|
|
3
|
-
tokenType: t.string(),
|
|
4
|
-
tokenAddress: t.string(),
|
|
5
|
-
tokenAmount: t.string()
|
|
6
|
-
}), n = t.object({
|
|
7
|
-
type: t.enum(["lootbox"]),
|
|
8
|
-
status: t.enum(["notEligible", "win", "loss", "disabled"]),
|
|
9
|
-
prizes: t.array(o).nullable().optional(),
|
|
10
|
-
// need to support null values too
|
|
11
|
-
prizeTierLevel: t.number().nullable().optional(),
|
|
12
|
-
prizeUsdAmount: t.string().nullable().optional()
|
|
13
|
-
}), a = t.object({
|
|
2
|
+
const n = t.object({
|
|
14
3
|
transactionState: t.enum(["submitted", "rejected"]).optional(),
|
|
15
4
|
transactionHash: t.string(),
|
|
16
|
-
rejectReason: t.string().nullable().optional()
|
|
17
|
-
// need to support null values too
|
|
18
|
-
promotions: t.array(n).nullable().optional()
|
|
5
|
+
rejectReason: t.string().nullable().optional()
|
|
19
6
|
// need to support null values too
|
|
20
7
|
});
|
|
21
8
|
export {
|
|
22
|
-
|
|
23
|
-
o as transactionPromotionPrizeSchema,
|
|
24
|
-
n as transactionPromotionSchema
|
|
9
|
+
n as transactionExecutionResponseSchema
|
|
25
10
|
};
|