@argent/x-shared 1.34.1 → 1.34.3
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.
|
@@ -57,6 +57,31 @@ export declare const knownDappSchema: z.ZodObject<{
|
|
|
57
57
|
supportedApps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
58
58
|
brandColor: z.ZodOptional<z.ZodString>;
|
|
59
59
|
executeFromOutsideAllowed: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
60
|
+
sessionConfig: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
maxExpiryDays: z.ZodNumber;
|
|
62
|
+
allowList: z.ZodArray<z.ZodObject<{
|
|
63
|
+
contractAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
64
|
+
methods: z.ZodArray<z.ZodString, "many">;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
contractAddress: `0x${string}`;
|
|
67
|
+
methods: string[];
|
|
68
|
+
}, {
|
|
69
|
+
contractAddress: string;
|
|
70
|
+
methods: string[];
|
|
71
|
+
}>, "many">;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
maxExpiryDays: number;
|
|
74
|
+
allowList: {
|
|
75
|
+
contractAddress: `0x${string}`;
|
|
76
|
+
methods: string[];
|
|
77
|
+
}[];
|
|
78
|
+
}, {
|
|
79
|
+
maxExpiryDays: number;
|
|
80
|
+
allowList: {
|
|
81
|
+
contractAddress: string;
|
|
82
|
+
methods: string[];
|
|
83
|
+
}[];
|
|
84
|
+
}>>;
|
|
60
85
|
}, "strip", z.ZodTypeAny, {
|
|
61
86
|
name: string;
|
|
62
87
|
dappId: string;
|
|
@@ -78,6 +103,13 @@ export declare const knownDappSchema: z.ZodObject<{
|
|
|
78
103
|
supportedApps?: string[] | undefined;
|
|
79
104
|
brandColor?: string | undefined;
|
|
80
105
|
executeFromOutsideAllowed?: boolean | undefined;
|
|
106
|
+
sessionConfig?: {
|
|
107
|
+
maxExpiryDays: number;
|
|
108
|
+
allowList: {
|
|
109
|
+
contractAddress: `0x${string}`;
|
|
110
|
+
methods: string[];
|
|
111
|
+
}[];
|
|
112
|
+
} | undefined;
|
|
81
113
|
}, {
|
|
82
114
|
name: string;
|
|
83
115
|
dappId: string;
|
|
@@ -99,6 +131,13 @@ export declare const knownDappSchema: z.ZodObject<{
|
|
|
99
131
|
supportedApps?: string[] | undefined;
|
|
100
132
|
brandColor?: string | undefined;
|
|
101
133
|
executeFromOutsideAllowed?: boolean | undefined;
|
|
134
|
+
sessionConfig?: {
|
|
135
|
+
maxExpiryDays: number;
|
|
136
|
+
allowList: {
|
|
137
|
+
contractAddress: string;
|
|
138
|
+
methods: string[];
|
|
139
|
+
}[];
|
|
140
|
+
} | undefined;
|
|
102
141
|
}>;
|
|
103
142
|
export declare const knownDappsSchema: z.ZodArray<z.ZodObject<{
|
|
104
143
|
dappId: z.ZodString;
|
|
@@ -135,6 +174,31 @@ export declare const knownDappsSchema: z.ZodArray<z.ZodObject<{
|
|
|
135
174
|
supportedApps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
136
175
|
brandColor: z.ZodOptional<z.ZodString>;
|
|
137
176
|
executeFromOutsideAllowed: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
177
|
+
sessionConfig: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
maxExpiryDays: z.ZodNumber;
|
|
179
|
+
allowList: z.ZodArray<z.ZodObject<{
|
|
180
|
+
contractAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>;
|
|
181
|
+
methods: z.ZodArray<z.ZodString, "many">;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
contractAddress: `0x${string}`;
|
|
184
|
+
methods: string[];
|
|
185
|
+
}, {
|
|
186
|
+
contractAddress: string;
|
|
187
|
+
methods: string[];
|
|
188
|
+
}>, "many">;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
maxExpiryDays: number;
|
|
191
|
+
allowList: {
|
|
192
|
+
contractAddress: `0x${string}`;
|
|
193
|
+
methods: string[];
|
|
194
|
+
}[];
|
|
195
|
+
}, {
|
|
196
|
+
maxExpiryDays: number;
|
|
197
|
+
allowList: {
|
|
198
|
+
contractAddress: string;
|
|
199
|
+
methods: string[];
|
|
200
|
+
}[];
|
|
201
|
+
}>>;
|
|
138
202
|
}, "strip", z.ZodTypeAny, {
|
|
139
203
|
name: string;
|
|
140
204
|
dappId: string;
|
|
@@ -156,6 +220,13 @@ export declare const knownDappsSchema: z.ZodArray<z.ZodObject<{
|
|
|
156
220
|
supportedApps?: string[] | undefined;
|
|
157
221
|
brandColor?: string | undefined;
|
|
158
222
|
executeFromOutsideAllowed?: boolean | undefined;
|
|
223
|
+
sessionConfig?: {
|
|
224
|
+
maxExpiryDays: number;
|
|
225
|
+
allowList: {
|
|
226
|
+
contractAddress: `0x${string}`;
|
|
227
|
+
methods: string[];
|
|
228
|
+
}[];
|
|
229
|
+
} | undefined;
|
|
159
230
|
}, {
|
|
160
231
|
name: string;
|
|
161
232
|
dappId: string;
|
|
@@ -177,6 +248,13 @@ export declare const knownDappsSchema: z.ZodArray<z.ZodObject<{
|
|
|
177
248
|
supportedApps?: string[] | undefined;
|
|
178
249
|
brandColor?: string | undefined;
|
|
179
250
|
executeFromOutsideAllowed?: boolean | undefined;
|
|
251
|
+
sessionConfig?: {
|
|
252
|
+
maxExpiryDays: number;
|
|
253
|
+
allowList: {
|
|
254
|
+
contractAddress: string;
|
|
255
|
+
methods: string[];
|
|
256
|
+
}[];
|
|
257
|
+
} | undefined;
|
|
180
258
|
}>, "many">;
|
|
181
259
|
export type KnownDapp = z.infer<typeof knownDappSchema>;
|
|
182
260
|
export type KnownDapps = z.infer<typeof knownDappsSchema>;
|
package/dist/simulation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./transactionVersion-FKKSXkzh.js"),h=require("lodash-es");require("starknet");require("zod");require("@scure/base");require("react");require("object-hash");require("swr");function u(e){return e.error?e.error:e.message&&e.code?`${e.code}: ${e.message}`:"Unknown error"}function p(e){if(!e)return;const n=e.transactions.flatMap(d=>i.isTransactionSimulationError(d)?d.simulationError:!1),t=n==null?void 0:n[n.length-1];if(!t)return;const s=u(t),r=t.message||t.error,c=i.getPrettyRpcError(r),o=c||t.label;return{message:c?r:s,label:o}}const l=e=>e.map(f),f=e=>{var s,r,c,o;if(i.isActivitySummary(e))return i.activitySummarySchema.parse(e);const n=!!e.sent;if(e.token.type!=="ERC20"){const a={asset:{type:"nft",tokenAddress:e.token.address,tokenId:e.tokenId?parseInt(e.tokenId):0,amount:e.value,collectionName:e.token.name,collectionPreviewImage:(s=e.token.imageUrls)==null?void 0:s.preview,nftName:(r=e.tokenIdDetails)==null?void 0:r.name,nftPreviewImage:(o=(c=e.tokenIdDetails)==null?void 0:c.imageUrls)==null?void 0:o.preview},sent:n};return i.activitySummarySchema.parse(a)}const t={asset:{type:"token",tokenAddress:e.token.address,amount:e.value,fiatAmount:{currency:"USD",currencyAmount:e.usdValue||"0"}},sent:n};return i.activitySummarySchema.parse(t)};function A(e){var s,r;const n=(r=(s=e.transactions)==null?void 0:s[0].reviewOfTransaction)==null?void 0:r.reviews;return n?n.map(c=>c.action):void 0}function g({simulateAndReview:e,...n}){var s,r;const t={type:i.NativeActivityTypeNative,...n};if(e&&!h.isEmpty(e.transactions)){const c=e.transactions[e.transactions.length-1],o=(s=c.simulation)==null?void 0:s.summary;if(o){const S=l(o);t.transferSummary=S}const a=(r=c.reviewOfTransaction)==null?void 0:r.targetedDapp;a&&(t.dapp=a);const d=A(e);d&&(t.actions=d)}return i.nativeActivitySchema.parse(t)}function m(e){const n=k(e),t=T(e);return n||t}const k=e=>{var o;if(!((o=e.actions)!=null&&o.length))return!1;const n=e.actions[0];if(n.name!=="ERC20_transfer")return!1;let t,s,r,c;return n.defaultProperties&&n.defaultProperties.forEach(a=>{a.type==="token_address"&&a.token.address===i.ETH_TOKEN_ADDRESS&&(s=!0),a.type==="calldata"&&(t=a.calldata[0])}),n.properties.length>1&&n.properties.forEach(a=>{a.type==="amount"&&a.label==="ERC20_transfer_amount"&&a.amount==="0"&&(r=!0),a.type==="address"&&a.label==="ERC20_transfer_recipient"&&i.isEqualAddress(a.address,t)&&(c=!0)}),s&&r&&c},T=e=>{var n,t;return!!("meta"in e&&(t=(n=e.meta)==null?void 0:n.title)!=null&&t.includes("On-chain rejection"))};function v(e,n=!1){var t,s;if(e.type===i.NativeActivityTypeNative){if(n&&((t=e.meta)!=null&&t.shortTitle))return e.meta.shortTitle;if((s=e.meta)!=null&&s.title)return e.meta.title}else{if(m(e))return"On-chain rejection";if(e.title)return e.title}return"Contract interaction"}function E(e){return v(e,!0)}function N(e){return e.map(s=>s.lastModified).sort().pop()}const D=e=>{var t,s;return!!((s=(t=e.details)==null?void 0:t.calls)==null?void 0:s.some(r=>{var c,o,a;return(o=(c=r==null?void 0:r.details)==null?void 0:c.function)!=null&&o.name?((a=r==null?void 0:r.details)==null?void 0:a.function.name)==="lock_and_delegate_by_sig":!1}))},y=e=>{var n;return e.type==="multicall"&&"calls"in e.details&&((n=e.details.calls)==null?void 0:n.some(t=>{var s;return((s=t==null?void 0:t.details)==null?void 0:s.type)==="deploy"&&i.isEqualAddress((t==null?void 0:t.details.contractAddress)||"",e.wallet)}))};function O(e){const n=M(e),t=w(e);return n||t}const M=e=>{var t;if(!((t=e.actions)!=null&&t.length))return!1;const n=e.actions[0];if(n.name!=="account_upgrade")return!1;n.defaultProperties&&n.defaultProperties.forEach(s=>{if(s.type==="calldata"&&s.entrypoint==="upgrade")return!0})},w=e=>{var n,t;return!!("meta"in e&&(t=(n=e.meta)==null?void 0:n.title)!=null&&t.includes("Upgrade account"))};function R({activities:e,accountAddressesOnNetwork:n}){const t={};return e.forEach(s=>{const r=s.wallet,c=s.type==="deploy"?s.type:s.details.type==="security"?s.details.action:void 0;s.group==="security"&&i.includesAddress(r,n)&&c&&(t[c]=t[c]||[],i.includesAddress(r,t[c])||(t[c]=i.ensureArray(t[c]).concat(r))),y(s)&&(t.deploy=i.ensureArray(t.deploy).concat(r))}),t}function _({activities:e,accountAddressesOnNetwork:n,tokenAddressesOnNetwork:t}){const s={tokenActivity:{accountAddresses:[],tokenAddresses:[],newTokenAddresses:[]},nftActivity:{accountAddresses:[],tokenAddresses:[]}};return e.forEach(r=>{if(r.group==="finance"&&r.relatedAddresses){const c=r.transfers.some(o=>o.asset.type==="token");r.relatedAddresses.forEach(({type:o,address:a})=>{o==="token"?i.includesAddress(a,t)&&(i.includesAddress(a,s.tokenActivity.tokenAddresses)||s.tokenActivity.tokenAddresses.push(a)):o==="wallet"&&i.includesAddress(a,n)&&(c?i.includesAddress(a,s.tokenActivity.accountAddresses)||s.tokenActivity.accountAddresses.push(a):i.includesAddress(a,s.nftActivity.accountAddresses)||s.nftActivity.accountAddresses.push(a))}),r.transfers.forEach(o=>{if(o.asset.type==="token"){const a=o.asset.tokenAddress;!i.includesAddress(a,t)&&!i.includesAddress(a,s.tokenActivity.newTokenAddresses)&&s.tokenActivity.newTokenAddresses.push(a)}else if(o.asset.type==="nft"){const a=o.asset.tokenAddress;i.includesAddress(a,s.nftActivity.tokenAddresses)||s.nftActivity.tokenAddresses.push(a)}})}}),s}const j=e=>{if(e.length===0)return null;const n=["critical","high","caution","info"];return e.reduce((t,s)=>{const r=n.indexOf(s.severity),c=n.indexOf(t.severity);return r<c?s:t},e[0])};exports.NativeActivityStatusCancelled=i.NativeActivityStatusCancelled;exports.NativeActivityStatusQueued=i.NativeActivityStatusQueued;exports.NativeActivityStatusRejected=i.NativeActivityStatusRejected;exports.NativeActivityTypeNative=i.NativeActivityTypeNative;exports.actionSchema=i.actionSchema;exports.activitiesSchema=i.activitiesSchema;exports.activityDappSchema=i.activityDappSchema;exports.activityDetailsSchema=i.activityDetailsSchema;exports.activityResponseSchema=i.activityResponseSchema;exports.activitySchema=i.activitySchema;exports.activitySummarySchema=i.activitySummarySchema;exports.activityTransferSchema=i.activityTransferSchema;exports.assessmentSchema=i.assessmentSchema;exports.enrichedSimulateAndReviewSchema=i.enrichedSimulateAndReviewSchema;exports.estimatedFeeSchema=i.estimatedFeeSchema;exports.estimatedFeesSchema=i.estimatedFeesSchema;exports.feeEstimationSchema=i.feeEstimationSchema;exports.feeSchema=i.feeSchema;exports.isActivityDetailsAction=i.isActivityDetailsAction;exports.isActivitySummary=i.isActivitySummary;exports.isNftActivitySummary=i.isNftActivitySummary;exports.isNotTransactionSimulationError=i.isNotTransactionSimulationError;exports.isTokenActivitySummary=i.isTokenActivitySummary;exports.isTransactionSimulationError=i.isTransactionSimulationError;exports.nativeActivityMetaSchema=i.nativeActivityMetaSchema;exports.nativeActivitySchema=i.nativeActivitySchema;exports.propertySchema=i.propertySchema;exports.reasonsSchema=i.reasonsSchema;exports.reviewSchema=i.reviewSchema;exports.severitySchema=i.severitySchema;exports.simulateAndReviewSchema=i.simulateAndReviewSchema;exports.targetedDappSchema=i.targetedDappSchema;exports.warningDetailsSchema=i.warningDetailsSchema;exports.warningSchema=i.warningSchema;exports.createNativeActivity=g;exports.getAnyActivityShortTitle=E;exports.getAnyActivityTitle=v;exports.getErrorMessageAndLabelFromSimulation=p;exports.getHighestSeverity=j;exports.getMessageFromSimulationError=u;exports.getOverallLastModified=N;exports.hasDelegationActivity=D;exports.isMulticallWithDeploymentActivity=y;exports.isRejectOnChainActivity=m;exports.isUpgradeActivity=O;exports.normalizeActions=A;exports.normalizeActivitySummary=f;exports.normalizeActivitySummaryCollection=l;exports.parseAccountActivities=R;exports.parseFinanceActivities=_;
|
package/dist/simulation.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as m, aZ as h, bS as v, bT as
|
|
2
|
-
import { c1 as G, c2 as J, c0 as I, cb as ee, c3 as te, bY as se, bX as ne, c4 as ie, b_ as ae, bW as re, cc as oe, ch as ce, c8 as
|
|
1
|
+
import { Q as m, aZ as h, bS as v, bT as f, bU as l, bV as S, I as g, h as p, a0 as c, v as u } from "./transactionVersion-tQTwHiJA.mjs";
|
|
2
|
+
import { c1 as G, c2 as J, c0 as I, cb as ee, c3 as te, bY as se, bX as ne, c4 as ie, b_ as ae, bW as re, cc as oe, ch as ce, c8 as de, c9 as fe, K as ue, bZ as le, c5 as pe, c7 as Ae, ci as me, c6 as he, b$ as ve, ca as Se, ck as ge, cf as ye, cj as ke, P as Te, cg as Ee, cd as Oe, ce as be } from "./transactionVersion-tQTwHiJA.mjs";
|
|
3
3
|
import { isEmpty as y } from "lodash-es";
|
|
4
4
|
import "starknet";
|
|
5
5
|
import "zod";
|
|
@@ -13,35 +13,35 @@ function k(e) {
|
|
|
13
13
|
function P(e) {
|
|
14
14
|
if (!e)
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
16
|
+
const n = e.transactions.flatMap((d) => m(d) ? d.simulationError : !1), t = n == null ? void 0 : n[n.length - 1];
|
|
17
17
|
if (!t)
|
|
18
18
|
return;
|
|
19
|
-
const
|
|
19
|
+
const s = k(t), a = t.message || t.error, r = h(a), o = r || t.label;
|
|
20
20
|
return {
|
|
21
|
-
message:
|
|
22
|
-
label:
|
|
21
|
+
message: r ? a : s,
|
|
22
|
+
label: o
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
const T = (e) => e.map(E), E = (e) => {
|
|
26
|
-
var
|
|
26
|
+
var s, a, r, o;
|
|
27
27
|
if (v(e))
|
|
28
|
-
return
|
|
29
|
-
const
|
|
28
|
+
return f.parse(e);
|
|
29
|
+
const n = !!e.sent;
|
|
30
30
|
if (e.token.type !== "ERC20") {
|
|
31
|
-
const
|
|
31
|
+
const i = {
|
|
32
32
|
asset: {
|
|
33
33
|
type: "nft",
|
|
34
34
|
tokenAddress: e.token.address,
|
|
35
35
|
tokenId: e.tokenId ? parseInt(e.tokenId) : 0,
|
|
36
36
|
amount: e.value,
|
|
37
37
|
collectionName: e.token.name,
|
|
38
|
-
collectionPreviewImage: (
|
|
39
|
-
nftName: (
|
|
40
|
-
nftPreviewImage: (
|
|
38
|
+
collectionPreviewImage: (s = e.token.imageUrls) == null ? void 0 : s.preview,
|
|
39
|
+
nftName: (a = e.tokenIdDetails) == null ? void 0 : a.name,
|
|
40
|
+
nftPreviewImage: (o = (r = e.tokenIdDetails) == null ? void 0 : r.imageUrls) == null ? void 0 : o.preview
|
|
41
41
|
},
|
|
42
|
-
sent:
|
|
42
|
+
sent: n
|
|
43
43
|
};
|
|
44
|
-
return
|
|
44
|
+
return f.parse(i);
|
|
45
45
|
}
|
|
46
46
|
const t = {
|
|
47
47
|
asset: {
|
|
@@ -53,61 +53,61 @@ const T = (e) => e.map(E), E = (e) => {
|
|
|
53
53
|
currencyAmount: e.usdValue || "0"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
sent:
|
|
56
|
+
sent: n
|
|
57
57
|
};
|
|
58
|
-
return
|
|
58
|
+
return f.parse(t);
|
|
59
59
|
};
|
|
60
60
|
function O(e) {
|
|
61
|
-
var
|
|
62
|
-
const
|
|
63
|
-
return
|
|
61
|
+
var s, a;
|
|
62
|
+
const n = (a = (s = e.transactions) == null ? void 0 : s[0].reviewOfTransaction) == null ? void 0 : a.reviews;
|
|
63
|
+
return n ? n.map((r) => r.action) : void 0;
|
|
64
64
|
}
|
|
65
|
-
function W({ simulateAndReview: e, ...
|
|
66
|
-
var
|
|
65
|
+
function W({ simulateAndReview: e, ...n }) {
|
|
66
|
+
var s, a;
|
|
67
67
|
const t = {
|
|
68
|
-
type:
|
|
69
|
-
...
|
|
68
|
+
type: l,
|
|
69
|
+
...n
|
|
70
70
|
};
|
|
71
71
|
if (e && !y(e.transactions)) {
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
t.transferSummary =
|
|
72
|
+
const r = e.transactions[e.transactions.length - 1], o = (s = r.simulation) == null ? void 0 : s.summary;
|
|
73
|
+
if (o) {
|
|
74
|
+
const A = T(o);
|
|
75
|
+
t.transferSummary = A;
|
|
76
76
|
}
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
77
|
+
const i = (a = r.reviewOfTransaction) == null ? void 0 : a.targetedDapp;
|
|
78
|
+
i && (t.dapp = i);
|
|
79
|
+
const d = O(e);
|
|
80
|
+
d && (t.actions = d);
|
|
81
81
|
}
|
|
82
82
|
return S.parse(t);
|
|
83
83
|
}
|
|
84
84
|
function b(e) {
|
|
85
|
-
const
|
|
86
|
-
return
|
|
85
|
+
const n = w(e), t = D(e);
|
|
86
|
+
return n || t;
|
|
87
87
|
}
|
|
88
88
|
const w = (e) => {
|
|
89
|
-
var
|
|
90
|
-
if (!((
|
|
89
|
+
var o;
|
|
90
|
+
if (!((o = e.actions) != null && o.length))
|
|
91
91
|
return !1;
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
92
|
+
const n = e.actions[0];
|
|
93
|
+
if (n.name !== "ERC20_transfer")
|
|
94
94
|
return !1;
|
|
95
|
-
let t,
|
|
96
|
-
return
|
|
97
|
-
|
|
98
|
-
}),
|
|
99
|
-
|
|
100
|
-
}),
|
|
95
|
+
let t, s, a, r;
|
|
96
|
+
return n.defaultProperties && n.defaultProperties.forEach((i) => {
|
|
97
|
+
i.type === "token_address" && i.token.address === g && (s = !0), i.type === "calldata" && (t = i.calldata[0]);
|
|
98
|
+
}), n.properties.length > 1 && n.properties.forEach((i) => {
|
|
99
|
+
i.type === "amount" && i.label === "ERC20_transfer_amount" && i.amount === "0" && (a = !0), i.type === "address" && i.label === "ERC20_transfer_recipient" && p(i.address, t) && (r = !0);
|
|
100
|
+
}), s && a && r;
|
|
101
101
|
}, D = (e) => {
|
|
102
|
-
var
|
|
103
|
-
return !!("meta" in e && (t = (
|
|
102
|
+
var n, t;
|
|
103
|
+
return !!("meta" in e && (t = (n = e.meta) == null ? void 0 : n.title) != null && t.includes("On-chain rejection"));
|
|
104
104
|
};
|
|
105
|
-
function M(e,
|
|
106
|
-
var t,
|
|
107
|
-
if (e.type ===
|
|
108
|
-
if (
|
|
105
|
+
function M(e, n = !1) {
|
|
106
|
+
var t, s;
|
|
107
|
+
if (e.type === l) {
|
|
108
|
+
if (n && ((t = e.meta) != null && t.shortTitle))
|
|
109
109
|
return e.meta.shortTitle;
|
|
110
|
-
if ((
|
|
110
|
+
if ((s = e.meta) != null && s.title)
|
|
111
111
|
return e.meta.title;
|
|
112
112
|
} else {
|
|
113
113
|
if (b(e))
|
|
@@ -121,49 +121,49 @@ function Z(e) {
|
|
|
121
121
|
return M(e, !0);
|
|
122
122
|
}
|
|
123
123
|
function $(e) {
|
|
124
|
-
return e.map((
|
|
124
|
+
return e.map((s) => s.lastModified).sort().pop();
|
|
125
125
|
}
|
|
126
126
|
const H = (e) => {
|
|
127
|
-
var t,
|
|
128
|
-
return !!((
|
|
129
|
-
var
|
|
130
|
-
return (
|
|
127
|
+
var t, s;
|
|
128
|
+
return !!((s = (t = e.details) == null ? void 0 : t.calls) == null ? void 0 : s.some((a) => {
|
|
129
|
+
var r, o, i;
|
|
130
|
+
return (o = (r = a == null ? void 0 : a.details) == null ? void 0 : r.function) != null && o.name ? ((i = a == null ? void 0 : a.details) == null ? void 0 : i.function.name) === "lock_and_delegate_by_sig" : !1;
|
|
131
131
|
}));
|
|
132
132
|
}, R = (e) => {
|
|
133
|
-
var
|
|
134
|
-
return e.type === "multicall" && "calls" in e.details && ((
|
|
135
|
-
var
|
|
136
|
-
return ((
|
|
133
|
+
var n;
|
|
134
|
+
return e.type === "multicall" && "calls" in e.details && ((n = e.details.calls) == null ? void 0 : n.some((t) => {
|
|
135
|
+
var s;
|
|
136
|
+
return ((s = t == null ? void 0 : t.details) == null ? void 0 : s.type) === "deploy" && p((t == null ? void 0 : t.details.contractAddress) || "", e.wallet);
|
|
137
137
|
}));
|
|
138
138
|
};
|
|
139
139
|
function K(e) {
|
|
140
|
-
const
|
|
141
|
-
return
|
|
140
|
+
const n = _(e), t = N(e);
|
|
141
|
+
return n || t;
|
|
142
142
|
}
|
|
143
143
|
const _ = (e) => {
|
|
144
144
|
var t;
|
|
145
145
|
if (!((t = e.actions) != null && t.length))
|
|
146
146
|
return !1;
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
147
|
+
const n = e.actions[0];
|
|
148
|
+
if (n.name !== "account_upgrade")
|
|
149
149
|
return !1;
|
|
150
|
-
|
|
151
|
-
if (
|
|
150
|
+
n.defaultProperties && n.defaultProperties.forEach((s) => {
|
|
151
|
+
if (s.type === "calldata" && s.entrypoint === "upgrade")
|
|
152
152
|
return !0;
|
|
153
153
|
});
|
|
154
154
|
}, N = (e) => {
|
|
155
|
-
var
|
|
156
|
-
return !!("meta" in e && (t = (
|
|
155
|
+
var n, t;
|
|
156
|
+
return !!("meta" in e && (t = (n = e.meta) == null ? void 0 : n.title) != null && t.includes("Upgrade account"));
|
|
157
157
|
};
|
|
158
|
-
function Q({ activities: e, accountAddressesOnNetwork:
|
|
158
|
+
function Q({ activities: e, accountAddressesOnNetwork: n }) {
|
|
159
159
|
const t = {};
|
|
160
|
-
return e.forEach((
|
|
161
|
-
const
|
|
162
|
-
|
|
160
|
+
return e.forEach((s) => {
|
|
161
|
+
const a = s.wallet, r = s.type === "deploy" ? s.type : s.details.type === "security" ? s.details.action : void 0;
|
|
162
|
+
s.group === "security" && c(a, n) && r && (t[r] = t[r] || [], c(a, t[r]) || (t[r] = u(t[r]).concat(a))), R(s) && (t.deploy = u(t.deploy).concat(a));
|
|
163
163
|
}), t;
|
|
164
164
|
}
|
|
165
|
-
function V({ activities: e, accountAddressesOnNetwork:
|
|
166
|
-
const
|
|
165
|
+
function V({ activities: e, accountAddressesOnNetwork: n, tokenAddressesOnNetwork: t }) {
|
|
166
|
+
const s = {
|
|
167
167
|
tokenActivity: {
|
|
168
168
|
accountAddresses: [],
|
|
169
169
|
tokenAddresses: [],
|
|
@@ -176,45 +176,48 @@ function V({ activities: e, accountAddressesOnNetwork: s, tokenAddressesOnNetwor
|
|
|
176
176
|
};
|
|
177
177
|
return e.forEach((a) => {
|
|
178
178
|
if (a.group === "finance" && a.relatedAddresses) {
|
|
179
|
-
const
|
|
180
|
-
a.relatedAddresses.forEach(({ type:
|
|
181
|
-
|
|
182
|
-
}), a.transfers.forEach((
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
179
|
+
const r = a.transfers.some((o) => o.asset.type === "token");
|
|
180
|
+
a.relatedAddresses.forEach(({ type: o, address: i }) => {
|
|
181
|
+
o === "token" ? c(i, t) && (c(i, s.tokenActivity.tokenAddresses) || s.tokenActivity.tokenAddresses.push(i)) : o === "wallet" && c(i, n) && (r ? c(i, s.tokenActivity.accountAddresses) || s.tokenActivity.accountAddresses.push(i) : c(i, s.nftActivity.accountAddresses) || s.nftActivity.accountAddresses.push(i));
|
|
182
|
+
}), a.transfers.forEach((o) => {
|
|
183
|
+
if (o.asset.type === "token") {
|
|
184
|
+
const i = o.asset.tokenAddress;
|
|
185
|
+
!c(i, t) && !c(i, s.tokenActivity.newTokenAddresses) && s.tokenActivity.newTokenAddresses.push(i);
|
|
186
|
+
} else if (o.asset.type === "nft") {
|
|
187
|
+
const i = o.asset.tokenAddress;
|
|
188
|
+
c(i, s.nftActivity.tokenAddresses) || s.nftActivity.tokenAddresses.push(i);
|
|
189
|
+
}
|
|
187
190
|
});
|
|
188
191
|
}
|
|
189
|
-
}),
|
|
192
|
+
}), s;
|
|
190
193
|
}
|
|
191
194
|
const q = (e) => {
|
|
192
195
|
if (e.length === 0)
|
|
193
196
|
return null;
|
|
194
|
-
const
|
|
195
|
-
return e.reduce((t,
|
|
196
|
-
const
|
|
197
|
-
return
|
|
197
|
+
const n = ["critical", "high", "caution", "info"];
|
|
198
|
+
return e.reduce((t, s) => {
|
|
199
|
+
const a = n.indexOf(s.severity), r = n.indexOf(t.severity);
|
|
200
|
+
return a < r ? s : t;
|
|
198
201
|
}, e[0]);
|
|
199
202
|
};
|
|
200
203
|
export {
|
|
201
204
|
G as NativeActivityStatusCancelled,
|
|
202
205
|
J as NativeActivityStatusQueued,
|
|
203
206
|
I as NativeActivityStatusRejected,
|
|
204
|
-
|
|
207
|
+
l as NativeActivityTypeNative,
|
|
205
208
|
ee as actionSchema,
|
|
206
209
|
te as activitiesSchema,
|
|
207
210
|
se as activityDappSchema,
|
|
208
211
|
ne as activityDetailsSchema,
|
|
209
212
|
ie as activityResponseSchema,
|
|
210
213
|
ae as activitySchema,
|
|
211
|
-
|
|
214
|
+
f as activitySummarySchema,
|
|
212
215
|
re as activityTransferSchema,
|
|
213
216
|
oe as assessmentSchema,
|
|
214
217
|
W as createNativeActivity,
|
|
215
218
|
ce as enrichedSimulateAndReviewSchema,
|
|
216
|
-
|
|
217
|
-
|
|
219
|
+
de as estimatedFeeSchema,
|
|
220
|
+
fe as estimatedFeesSchema,
|
|
218
221
|
ue as feeEstimationSchema,
|
|
219
222
|
le as feeSchema,
|
|
220
223
|
Z as getAnyActivityShortTitle,
|