@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.
@@ -1,8 +1,8 @@
1
1
  import { z as t } from "zod";
2
- import { severitySchema as h, reasonsSchema as j } from "../warning/schema.js";
3
- import { estimatedFeesSchema as f } from "../fees/schema.js";
4
- import { addressSchema as k, addressSchemaArgentBackend as o } from "../../../chains/starknet/address.js";
5
- const v = t.object({
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
- ]), w = t.object({
65
+ ]), v = t.object({
66
66
  name: t.string(),
67
67
  properties: t.array(r),
68
68
  defaultProperties: t.array(r).optional()
69
- }), E = t.union([
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
- ]), D = t.object({
74
+ ]), E = 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: f.optional(),
78
78
  reason: t.string().optional(),
79
79
  value: t.any().optional()
80
80
  }), l = t.object({
81
- reason: j,
82
- details: D.optional(),
83
- severity: h
84
- }), U = t.object({
85
- assessment: E,
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: w
92
- }), F = t.object({
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(v)
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: F.optional(),
111
- reviews: t.array(U)
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
- }), T = t.object({
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: o,
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: T.optional()
133
- }), A = t.object({
134
- tokenAddress: o,
135
- owner: o,
136
- spender: o,
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
- }), _ = t.object({
141
- tokenAddress: o,
142
- from: o,
143
- to: o,
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((a) => parseInt(a.toString(), 10)), m = t.object({
148
- address: o,
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
- }), x = t.object({
154
+ }), _ = t.object({
155
155
  l1Gas: i,
156
156
  l1DataGas: i,
157
157
  l2Gas: i
158
- }), N = t.object({
158
+ }), x = t.object({
159
159
  token: m,
160
160
  overallFee: n,
161
161
  maxFee: n,
162
162
  defaultTip: n.optional()
163
- }), b = t.object({
163
+ }), d = t.object({
164
164
  overallFee: n,
165
- resourceBounds: x,
166
- unit: t.string().transform((a) => a.toUpperCase()).pipe(t.literal("FRI")),
165
+ resourceBounds: _,
166
+ unit: t.string().transform((o) => o.toUpperCase()).pipe(t.literal("FRI")),
167
167
  token: m,
168
168
  defaultTip: n.optional()
169
- }), P = b.or(N), R = t.object({
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
- }), I = t.object({
186
- approvals: t.array(A).optional(),
187
- transfers: t.array(_).optional(),
185
+ }), R = t.object({
186
+ approvals: t.array(T).optional(),
187
+ transfers: t.array(A).optional(),
188
188
  calculatedNonce: t.string().optional(),
189
- feeEstimation: b,
190
- feeEstimations: t.array(P),
191
- summary: t.array(R).optional()
192
- }), O = t.object({
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
- }), d = t.object({
197
+ }), b = t.object({
198
198
  reviewOfTransaction: c,
199
- simulation: I,
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: O
205
- }), u = d.or(g), S = t.object({
204
+ simulationError: I
205
+ }), u = b.or(g), S = t.object({
206
206
  subsidiseDeployment: t.boolean(),
207
207
  subsidiseTransaction: t.boolean()
208
- }), B = t.object({
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
- promotions: y.optional()
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(f).optional(),
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 J(a) {
225
- return d.safeParse(a).success;
219
+ function H(o) {
220
+ return b.safeParse(o).success;
226
221
  }
227
- function K(a) {
228
- return g.safeParse(a).success;
222
+ function q(o) {
223
+ return g.safeParse(o).success;
229
224
  }
230
225
  export {
231
- w as actionSchema,
232
- E as assessmentSchema,
233
- q as enrichedSimulateAndReviewSchema,
226
+ v as actionSchema,
227
+ w as assessmentSchema,
228
+ z as enrichedSimulateAndReviewSchema,
234
229
  i as feeEstimationGasSchema,
235
- P as feeEstimationNativeOrPaymasterSchema,
236
- x as feeEstimationResourceBoundSchema,
237
- b as feeEstimationSchema,
238
- J as isNotTransactionSimulationError,
239
- K as isTransactionSimulationError,
240
- N as paymasterFeeEstimationSchema,
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
- U as reviewSchema,
246
- H as simulateAndReviewSchema,
238
+ D as reviewSchema,
239
+ C as simulateAndReviewSchema,
247
240
  S as subsidyStatusSchema,
248
- F as targetedDappSchema,
249
- D as warningDetailsSchema,
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"),o=t.z.object({tokenType:t.z.string(),tokenAddress:t.z.string(),tokenAmount:t.z.string()}),n=t.z.object({type:t.z.enum(["lootbox"]),status:t.z.enum(["notEligible","win","loss","disabled"]),prizes:t.z.array(o).nullable().optional(),prizeTierLevel:t.z.number().nullable().optional(),prizeUsdAmount:t.z.string().nullable().optional()}),e=t.z.object({transactionState:t.z.enum(["submitted","rejected"]).optional(),transactionHash:t.z.string(),rejectReason:t.z.string().nullable().optional(),promotions:t.z.array(n).nullable().optional()});exports.transactionExecutionResponseSchema=e;exports.transactionPromotionPrizeSchema=o;exports.transactionPromotionSchema=n;
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 o = t.object({
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
- a as transactionExecutionResponseSchema,
23
- o as transactionPromotionPrizeSchema,
24
- n as transactionPromotionSchema
9
+ n as transactionExecutionResponseSchema
25
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.77.0",
3
+ "version": "1.77.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/argentlabs/x-shared.git"