@argent/x-shared 1.30.0 → 1.31.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/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.d.ts +6 -0
- package/dist/features/simulation/transactionReview/getMessageFromSimulationError.d.ts +3 -0
- package/dist/features/simulation/transactionReview/index.d.ts +2 -0
- package/dist/features/simulation/transactionReview/schema.d.ts +0 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1855 -2278
- package/dist/onchainRecovery/IOnchainRecoveryService.d.ts +3 -5
- package/dist/onchainRecovery/OnchainRecoveryService.d.ts +3 -5
- package/dist/onchainRecovery/schema.d.ts +8 -10
- package/dist/simulation.js +1 -1
- package/dist/simulation.mjs +139 -120
- package/dist/transactionVersion-CnOPxZEg.js +1 -0
- package/dist/transactionVersion-DpP30aO1.mjs +2644 -0
- package/package.json +1 -1
- package/dist/schema-3qaq9ugL.mjs +0 -2171
- package/dist/schema-C-_pmcO7.js +0 -1
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { Address } from '../chains/starknet/address';
|
|
2
|
-
import {
|
|
2
|
+
import { OnchainRecovery } from './schema';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* IOnchainRecoveryService interface
|
|
6
6
|
*/
|
|
7
7
|
export interface IOnchainRecoveryService {
|
|
8
|
-
startRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<
|
|
9
|
-
|
|
10
|
-
}>;
|
|
11
|
-
getRecovery(address: Address, recoveryId: number): Promise<RecoveryStatus>;
|
|
8
|
+
startRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<OnchainRecovery>;
|
|
9
|
+
getRecovery(address: Address, recoveryId?: number): Promise<OnchainRecovery>;
|
|
12
10
|
cancelRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<void>;
|
|
13
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address } from '../chains/starknet/address';
|
|
2
2
|
import { IHttpService } from '../http';
|
|
3
3
|
import { IOnchainRecoveryService } from './IOnchainRecoveryService';
|
|
4
|
-
import {
|
|
4
|
+
import { OnchainRecovery } from './schema';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* RecoveryService class implements IRecoveryService interface.
|
|
@@ -10,9 +10,7 @@ export declare class OnchainRecoveryService implements IOnchainRecoveryService {
|
|
|
10
10
|
protected readonly apiBase: string;
|
|
11
11
|
private readonly httpService;
|
|
12
12
|
constructor(apiBase: string, httpService: IHttpService);
|
|
13
|
-
startRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<
|
|
14
|
-
|
|
15
|
-
}>;
|
|
16
|
-
getRecovery(address: Address, recoveryId: number): Promise<RecoveryStatus>;
|
|
13
|
+
startRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<OnchainRecovery>;
|
|
14
|
+
getRecovery(address: Address, recoveryId?: number): Promise<OnchainRecovery>;
|
|
17
15
|
cancelRecovery(address: Address, feeToken: Address, publicKey: string, privateKey: string): Promise<void>;
|
|
18
16
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
export declare const startRecoverySchema: z.ZodObject<{
|
|
4
|
-
recoveryId: z.ZodNumber;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
recoveryId: number;
|
|
7
|
-
}, {
|
|
8
|
-
recoveryId: number;
|
|
9
|
-
}>;
|
|
10
3
|
export declare const recoveryBodySchema: z.ZodObject<{
|
|
11
4
|
feeToken: z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEffects<z.ZodString, string, string>>, `0x${string}`, string>;
|
|
12
5
|
signerSignature: z.ZodObject<{
|
|
@@ -61,13 +54,18 @@ export declare const recoveryBodySchema: z.ZodObject<{
|
|
|
61
54
|
};
|
|
62
55
|
}>;
|
|
63
56
|
export declare const recoveryStatusSchema: z.ZodEnum<["ONGOING", "COMPLETED", "ERROR", "CANCELLED", "AWAITING_FUNDS"]>;
|
|
64
|
-
export declare const
|
|
57
|
+
export declare const onchainRecoverySchema: z.ZodObject<{
|
|
65
58
|
status: z.ZodEnum<["ONGOING", "COMPLETED", "ERROR", "CANCELLED", "AWAITING_FUNDS"]>;
|
|
59
|
+
recoveryId: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
completionTime: z.ZodArray<z.ZodNumber, "many">;
|
|
66
61
|
}, "strip", z.ZodTypeAny, {
|
|
67
62
|
status: "ONGOING" | "COMPLETED" | "ERROR" | "CANCELLED" | "AWAITING_FUNDS";
|
|
63
|
+
completionTime: number[];
|
|
64
|
+
recoveryId?: number | undefined;
|
|
68
65
|
}, {
|
|
69
66
|
status: "ONGOING" | "COMPLETED" | "ERROR" | "CANCELLED" | "AWAITING_FUNDS";
|
|
67
|
+
completionTime: number[];
|
|
68
|
+
recoveryId?: number | undefined;
|
|
70
69
|
}>;
|
|
71
|
-
export type StartRecoveryResponse = z.infer<typeof startRecoverySchema>;
|
|
72
70
|
export type RecoveryStatus = z.infer<typeof recoveryStatusSchema>;
|
|
73
|
-
export type
|
|
71
|
+
export type OnchainRecovery = z.infer<typeof onchainRecoverySchema>;
|
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-CnOPxZEg.js"),h=require("lodash-es");require("starknet");require("zod");require("@scure/base");require("react");require("object-hash");require("swr");function d(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(o=>i.isTransactionSimulationError(o)?o.simulationError:!1),t=n==null?void 0:n[n.length-1];if(!t)return;const s=d(t),a=t.message||t.error,r=i.getPrettyRpcError(a),u=r||t.label;return{message:r?a:s,label:u}}const l=e=>e.map(f),f=e=>{var s,a,r,u;if(i.isActivitySummary(e))return i.activitySummarySchema.parse(e);const n=!!e.sent;if(e.token.type!=="ERC20"){const c={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:(a=e.tokenIdDetails)==null?void 0:a.name,nftPreviewImage:(u=(r=e.tokenIdDetails)==null?void 0:r.imageUrls)==null?void 0:u.preview},sent:n};return i.activitySummarySchema.parse(c)}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 m(e){var s,a;const n=(a=(s=e.transactions)==null?void 0:s[0].reviewOfTransaction)==null?void 0:a.reviews;return n?n.map(r=>r.action):void 0}function g({simulateAndReview:e,...n}){var s,a;const t={type:i.NativeActivityTypeNative,...n};if(e&&!h.isEmpty(e.transactions)){const r=e.transactions[e.transactions.length-1],u=(s=r.simulation)==null?void 0:s.summary;if(u){const S=l(u);t.transferSummary=S}const c=(a=r.reviewOfTransaction)==null?void 0:a.targetedDapp;c&&(t.dapp=c);const o=m(e);o&&(t.actions=o)}return i.nativeActivitySchema.parse(t)}function A(e){const n=k(e),t=T(e);return n||t}const k=e=>{var u;if(!((u=e.actions)!=null&&u.length))return!1;const n=e.actions[0];if(n.name!=="ERC20_transfer")return!1;let t,s,a,r;return n.defaultProperties&&n.defaultProperties.forEach(c=>{c.type==="token_address"&&c.token.address===i.ETH_TOKEN_ADDRESS&&(s=!0),c.type==="calldata"&&(t=c.calldata[0])}),n.properties.length>1&&n.properties.forEach(c=>{c.type==="amount"&&c.label==="ERC20_transfer_amount"&&c.amount==="0"&&(a=!0),c.type==="address"&&c.label==="ERC20_transfer_recipient"&&i.isEqualAddress(c.address,t)&&(r=!0)}),s&&a&&r},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(A(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 O=e=>{var t,s;return!!((s=(t=e.details)==null?void 0:t.calls)==null?void 0:s.some(a=>{var r,u,c;return(u=(r=a==null?void 0:a.details)==null?void 0:r.function)!=null&&u.name?((c=a==null?void 0:a.details)==null?void 0:c.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 D(e){const n=M(e),t=R(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})},R=e=>{var n,t;return!!("meta"in e&&(t=(n=e.meta)==null?void 0:n.title)!=null&&t.includes("Upgrade account"))};function w({activities:e,accountAddressesOnNetwork:n}){const t={};return e.forEach(s=>{const a=s.wallet,r=s.type==="deploy"?s.type:s.details.type==="security"?s.details.action:void 0;s.group==="security"&&i.includesAddress(a,n)&&r&&(t[r]=t[r]||[],i.includesAddress(a,t[r])||(t[r]=i.ensureArray(t[r]).concat(a))),y(s)&&(t.deploy=i.ensureArray(t.deploy).concat(a))}),t}function _({activities:e,accountAddressesOnNetwork:n,tokenAddressesOnNetwork:t,nftAddressesOnNetwork:s}){const a={tokenActivity:{accountAddresses:[],tokenAddresses:[]},nftActivity:{accountAddresses:[],tokenAddresses:[]}};return e.forEach(r=>{if(r.group==="finance"&&r.relatedAddresses){const u=r.transfers.some(c=>c.asset.type==="token");r.relatedAddresses.forEach(({type:c,address:o})=>{c==="token"?(i.includesAddress(o,t)&&(i.includesAddress(o,a.tokenActivity.tokenAddresses)||a.tokenActivity.tokenAddresses.push(o)),i.includesAddress(o,s)&&(i.includesAddress(o,a.nftActivity.tokenAddresses)||a.nftActivity.tokenAddresses.push(o))):c==="wallet"&&i.includesAddress(o,n)&&(u?i.includesAddress(o,a.tokenActivity.accountAddresses)||a.tokenActivity.accountAddresses.push(o):i.includesAddress(o,a.nftActivity.accountAddresses)||a.nftActivity.accountAddresses.push(o))})}}),a}const j=e=>{if(e.length===0)return null;const n=["critical","high","caution","info"];return e.reduce((t,s)=>{const a=n.indexOf(s.severity),r=n.indexOf(t.severity);return a<r?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=d;exports.getOverallLastModified=N;exports.hasDelegationActivity=O;exports.isMulticallWithDeploymentActivity=y;exports.isRejectOnChainActivity=A;exports.isUpgradeActivity=D;exports.normalizeActions=m;exports.normalizeActivitySummary=f;exports.normalizeActivitySummaryCollection=l;exports.parseAccountActivities=w;exports.parseFinanceActivities=_;
|
package/dist/simulation.mjs
CHANGED
|
@@ -1,14 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { isEmpty as
|
|
1
|
+
import { Q as m, aZ as h, bR as v, bS as u, bT as l, bU as S, I as g, h as p, a0 as f, v as d } from "./transactionVersion-DpP30aO1.mjs";
|
|
2
|
+
import { c0 as G, c1 as J, b$ as I, ca as ee, c2 as te, bX as se, bW as ne, c3 as ie, bZ as ae, bV as re, cb as oe, cg as ce, c7 as fe, c8 as ue, K as de, bY as le, c4 as pe, c6 as Ae, ch as me, c5 as he, b_ as ve, c9 as Se, cj as ge, ce as ye, ci as ke, P as Ee, cf as Oe, cc as Te, cd as be } from "./transactionVersion-DpP30aO1.mjs";
|
|
3
|
+
import { isEmpty as y } from "lodash-es";
|
|
4
4
|
import "starknet";
|
|
5
5
|
import "zod";
|
|
6
6
|
import "@scure/base";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import "react";
|
|
8
|
+
import "object-hash";
|
|
9
|
+
import "swr";
|
|
10
|
+
function k(e) {
|
|
11
|
+
return e.error ? e.error : e.message && e.code ? `${e.code}: ${e.message}` : "Unknown error";
|
|
12
|
+
}
|
|
13
|
+
function P(e) {
|
|
14
|
+
if (!e)
|
|
15
|
+
return;
|
|
16
|
+
const s = e.transactions.flatMap((o) => m(o) ? o.simulationError : !1), t = s == null ? void 0 : s[s.length - 1];
|
|
17
|
+
if (!t)
|
|
18
|
+
return;
|
|
19
|
+
const n = k(t), i = t.message || t.error, a = h(i), c = a || t.label;
|
|
20
|
+
return {
|
|
21
|
+
message: a ? i : n,
|
|
22
|
+
label: c
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const E = (e) => e.map(O), O = (e) => {
|
|
26
|
+
var n, i, a, c;
|
|
27
|
+
if (v(e))
|
|
10
28
|
return u.parse(e);
|
|
11
|
-
const
|
|
29
|
+
const s = !!e.sent;
|
|
12
30
|
if (e.token.type !== "ERC20") {
|
|
13
31
|
const r = {
|
|
14
32
|
asset: {
|
|
@@ -17,11 +35,11 @@ const y = (e) => e.map(b), b = (e) => {
|
|
|
17
35
|
tokenId: e.tokenId ? parseInt(e.tokenId) : 0,
|
|
18
36
|
amount: e.value,
|
|
19
37
|
collectionName: e.token.name,
|
|
20
|
-
collectionPreviewImage: (
|
|
38
|
+
collectionPreviewImage: (n = e.token.imageUrls) == null ? void 0 : n.preview,
|
|
21
39
|
nftName: (i = e.tokenIdDetails) == null ? void 0 : i.name,
|
|
22
40
|
nftPreviewImage: (c = (a = e.tokenIdDetails) == null ? void 0 : a.imageUrls) == null ? void 0 : c.preview
|
|
23
41
|
},
|
|
24
|
-
sent:
|
|
42
|
+
sent: s
|
|
25
43
|
};
|
|
26
44
|
return u.parse(r);
|
|
27
45
|
}
|
|
@@ -35,116 +53,116 @@ const y = (e) => e.map(b), b = (e) => {
|
|
|
35
53
|
currencyAmount: e.usdValue || "0"
|
|
36
54
|
}
|
|
37
55
|
},
|
|
38
|
-
sent:
|
|
56
|
+
sent: s
|
|
39
57
|
};
|
|
40
58
|
return u.parse(t);
|
|
41
59
|
};
|
|
42
|
-
function
|
|
43
|
-
var
|
|
44
|
-
const
|
|
45
|
-
return
|
|
60
|
+
function T(e) {
|
|
61
|
+
var n, i;
|
|
62
|
+
const s = (i = (n = e.transactions) == null ? void 0 : n[0].reviewOfTransaction) == null ? void 0 : i.reviews;
|
|
63
|
+
return s ? s.map((a) => a.action) : void 0;
|
|
46
64
|
}
|
|
47
|
-
function
|
|
48
|
-
var
|
|
65
|
+
function W({ simulateAndReview: e, ...s }) {
|
|
66
|
+
var n, i;
|
|
49
67
|
const t = {
|
|
50
68
|
type: l,
|
|
51
|
-
...
|
|
69
|
+
...s
|
|
52
70
|
};
|
|
53
|
-
if (e && !
|
|
54
|
-
const a = e.transactions[e.transactions.length - 1], c = (
|
|
71
|
+
if (e && !y(e.transactions)) {
|
|
72
|
+
const a = e.transactions[e.transactions.length - 1], c = (n = a.simulation) == null ? void 0 : n.summary;
|
|
55
73
|
if (c) {
|
|
56
|
-
const A =
|
|
74
|
+
const A = E(c);
|
|
57
75
|
t.transferSummary = A;
|
|
58
76
|
}
|
|
59
77
|
const r = (i = a.reviewOfTransaction) == null ? void 0 : i.targetedDapp;
|
|
60
78
|
r && (t.dapp = r);
|
|
61
|
-
const o =
|
|
79
|
+
const o = T(e);
|
|
62
80
|
o && (t.actions = o);
|
|
63
81
|
}
|
|
64
|
-
return
|
|
82
|
+
return S.parse(t);
|
|
65
83
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
return
|
|
84
|
+
function b(e) {
|
|
85
|
+
const s = D(e), t = M(e);
|
|
86
|
+
return s || t;
|
|
69
87
|
}
|
|
70
|
-
const
|
|
88
|
+
const D = (e) => {
|
|
71
89
|
var c;
|
|
72
90
|
if (!((c = e.actions) != null && c.length))
|
|
73
91
|
return !1;
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
92
|
+
const s = e.actions[0];
|
|
93
|
+
if (s.name !== "ERC20_transfer")
|
|
76
94
|
return !1;
|
|
77
|
-
let t,
|
|
78
|
-
return
|
|
79
|
-
r.type === "token_address" && r.token.address ===
|
|
80
|
-
}),
|
|
95
|
+
let t, n, i, a;
|
|
96
|
+
return s.defaultProperties && s.defaultProperties.forEach((r) => {
|
|
97
|
+
r.type === "token_address" && r.token.address === g && (n = !0), r.type === "calldata" && (t = r.calldata[0]);
|
|
98
|
+
}), s.properties.length > 1 && s.properties.forEach((r) => {
|
|
81
99
|
r.type === "amount" && r.label === "ERC20_transfer_amount" && r.amount === "0" && (i = !0), r.type === "address" && r.label === "ERC20_transfer_recipient" && p(r.address, t) && (a = !0);
|
|
82
|
-
}),
|
|
83
|
-
},
|
|
84
|
-
var
|
|
85
|
-
return !!("meta" in e && (t = (
|
|
100
|
+
}), n && i && a;
|
|
101
|
+
}, M = (e) => {
|
|
102
|
+
var s, t;
|
|
103
|
+
return !!("meta" in e && (t = (s = e.meta) == null ? void 0 : s.title) != null && t.includes("On-chain rejection"));
|
|
86
104
|
};
|
|
87
|
-
function
|
|
88
|
-
var t,
|
|
105
|
+
function R(e, s = !1) {
|
|
106
|
+
var t, n;
|
|
89
107
|
if (e.type === l) {
|
|
90
|
-
if (
|
|
108
|
+
if (s && ((t = e.meta) != null && t.shortTitle))
|
|
91
109
|
return e.meta.shortTitle;
|
|
92
|
-
if ((
|
|
110
|
+
if ((n = e.meta) != null && n.title)
|
|
93
111
|
return e.meta.title;
|
|
94
112
|
} else {
|
|
95
|
-
if (
|
|
113
|
+
if (b(e))
|
|
96
114
|
return "On-chain rejection";
|
|
97
115
|
if (e.title)
|
|
98
116
|
return e.title;
|
|
99
117
|
}
|
|
100
118
|
return "Contract interaction";
|
|
101
119
|
}
|
|
102
|
-
function
|
|
103
|
-
return
|
|
120
|
+
function Z(e) {
|
|
121
|
+
return R(e, !0);
|
|
104
122
|
}
|
|
105
|
-
function
|
|
106
|
-
return e.map((
|
|
123
|
+
function $(e) {
|
|
124
|
+
return e.map((n) => n.lastModified).sort().pop();
|
|
107
125
|
}
|
|
108
|
-
const
|
|
109
|
-
var t,
|
|
110
|
-
return !!((
|
|
126
|
+
const H = (e) => {
|
|
127
|
+
var t, n;
|
|
128
|
+
return !!((n = (t = e.details) == null ? void 0 : t.calls) == null ? void 0 : n.some((i) => {
|
|
111
129
|
var a, c, r;
|
|
112
130
|
return (c = (a = i == null ? void 0 : i.details) == null ? void 0 : a.function) != null && c.name ? ((r = i == null ? void 0 : i.details) == null ? void 0 : r.function.name) === "lock_and_delegate_by_sig" : !1;
|
|
113
131
|
}));
|
|
114
|
-
},
|
|
115
|
-
var
|
|
116
|
-
return e.type === "multicall" && "calls" in e.details && ((
|
|
117
|
-
var
|
|
118
|
-
return ((
|
|
132
|
+
}, _ = (e) => {
|
|
133
|
+
var s;
|
|
134
|
+
return e.type === "multicall" && "calls" in e.details && ((s = e.details.calls) == null ? void 0 : s.some((t) => {
|
|
135
|
+
var n;
|
|
136
|
+
return ((n = t == null ? void 0 : t.details) == null ? void 0 : n.type) === "deploy" && p((t == null ? void 0 : t.details.contractAddress) || "", e.wallet);
|
|
119
137
|
}));
|
|
120
138
|
};
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
return
|
|
139
|
+
function K(e) {
|
|
140
|
+
const s = w(e), t = B(e);
|
|
141
|
+
return s || t;
|
|
124
142
|
}
|
|
125
|
-
const
|
|
143
|
+
const w = (e) => {
|
|
126
144
|
var t;
|
|
127
145
|
if (!((t = e.actions) != null && t.length))
|
|
128
146
|
return !1;
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
147
|
+
const s = e.actions[0];
|
|
148
|
+
if (s.name !== "account_upgrade")
|
|
131
149
|
return !1;
|
|
132
|
-
|
|
133
|
-
if (
|
|
150
|
+
s.defaultProperties && s.defaultProperties.forEach((n) => {
|
|
151
|
+
if (n.type === "calldata" && n.entrypoint === "upgrade")
|
|
134
152
|
return !0;
|
|
135
153
|
});
|
|
136
|
-
},
|
|
137
|
-
var
|
|
138
|
-
return !!("meta" in e && (t = (
|
|
154
|
+
}, B = (e) => {
|
|
155
|
+
var s, t;
|
|
156
|
+
return !!("meta" in e && (t = (s = e.meta) == null ? void 0 : s.title) != null && t.includes("Upgrade account"));
|
|
139
157
|
};
|
|
140
|
-
function
|
|
158
|
+
function Q({ activities: e, accountAddressesOnNetwork: s }) {
|
|
141
159
|
const t = {};
|
|
142
|
-
return e.forEach((
|
|
143
|
-
const i =
|
|
144
|
-
|
|
160
|
+
return e.forEach((n) => {
|
|
161
|
+
const i = n.wallet, a = n.type === "deploy" ? n.type : n.details.type === "security" ? n.details.action : void 0;
|
|
162
|
+
n.group === "security" && f(i, s) && a && (t[a] = t[a] || [], f(i, t[a]) || (t[a] = d(t[a]).concat(i))), _(n) && (t.deploy = d(t.deploy).concat(i));
|
|
145
163
|
}), t;
|
|
146
164
|
}
|
|
147
|
-
function
|
|
165
|
+
function V({ activities: e, accountAddressesOnNetwork: s, tokenAddressesOnNetwork: t, nftAddressesOnNetwork: n }) {
|
|
148
166
|
const i = {
|
|
149
167
|
tokenActivity: {
|
|
150
168
|
accountAddresses: [],
|
|
@@ -159,68 +177,69 @@ function q({ activities: e, accountAddressesOnNetwork: n, tokenAddressesOnNetwor
|
|
|
159
177
|
if (a.group === "finance" && a.relatedAddresses) {
|
|
160
178
|
const c = a.transfers.some((r) => r.asset.type === "token");
|
|
161
179
|
a.relatedAddresses.forEach(({ type: r, address: o }) => {
|
|
162
|
-
r === "token" ? (f(o, t) && (f(o, i.tokenActivity.tokenAddresses) || i.tokenActivity.tokenAddresses.push(o)), f(o,
|
|
180
|
+
r === "token" ? (f(o, t) && (f(o, i.tokenActivity.tokenAddresses) || i.tokenActivity.tokenAddresses.push(o)), f(o, n) && (f(o, i.nftActivity.tokenAddresses) || i.nftActivity.tokenAddresses.push(o))) : r === "wallet" && f(o, s) && (c ? f(o, i.tokenActivity.accountAddresses) || i.tokenActivity.accountAddresses.push(o) : f(o, i.nftActivity.accountAddresses) || i.nftActivity.accountAddresses.push(o));
|
|
163
181
|
});
|
|
164
182
|
}
|
|
165
183
|
}), i;
|
|
166
184
|
}
|
|
167
|
-
const
|
|
185
|
+
const q = (e) => {
|
|
168
186
|
if (e.length === 0)
|
|
169
187
|
return null;
|
|
170
|
-
const
|
|
171
|
-
return e.reduce((t,
|
|
172
|
-
const i =
|
|
173
|
-
return i < a ?
|
|
188
|
+
const s = ["critical", "high", "caution", "info"];
|
|
189
|
+
return e.reduce((t, n) => {
|
|
190
|
+
const i = s.indexOf(n.severity), a = s.indexOf(t.severity);
|
|
191
|
+
return i < a ? n : t;
|
|
174
192
|
}, e[0]);
|
|
175
193
|
};
|
|
176
194
|
export {
|
|
177
195
|
G as NativeActivityStatusCancelled,
|
|
178
|
-
|
|
179
|
-
|
|
196
|
+
J as NativeActivityStatusQueued,
|
|
197
|
+
I as NativeActivityStatusRejected,
|
|
180
198
|
l as NativeActivityTypeNative,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
199
|
+
ee as actionSchema,
|
|
200
|
+
te as activitiesSchema,
|
|
201
|
+
se as activityDappSchema,
|
|
202
|
+
ne as activityDetailsSchema,
|
|
203
|
+
ie as activityResponseSchema,
|
|
204
|
+
ae as activitySchema,
|
|
187
205
|
u as activitySummarySchema,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
206
|
+
re as activityTransferSchema,
|
|
207
|
+
oe as assessmentSchema,
|
|
208
|
+
W as createNativeActivity,
|
|
209
|
+
ce as enrichedSimulateAndReviewSchema,
|
|
210
|
+
fe as estimatedFeeSchema,
|
|
211
|
+
ue as estimatedFeesSchema,
|
|
212
|
+
de as feeEstimationSchema,
|
|
213
|
+
le as feeSchema,
|
|
214
|
+
Z as getAnyActivityShortTitle,
|
|
215
|
+
R as getAnyActivityTitle,
|
|
216
|
+
P as getErrorMessageAndLabelFromSimulation,
|
|
217
|
+
q as getHighestSeverity,
|
|
218
|
+
k as getMessageFromSimulationError,
|
|
219
|
+
$ as getOverallLastModified,
|
|
220
|
+
H as hasDelegationActivity,
|
|
221
|
+
pe as isActivityDetailsAction,
|
|
222
|
+
v as isActivitySummary,
|
|
223
|
+
_ as isMulticallWithDeploymentActivity,
|
|
224
|
+
Ae as isNftActivitySummary,
|
|
225
|
+
me as isNotTransactionSimulationError,
|
|
226
|
+
b as isRejectOnChainActivity,
|
|
227
|
+
he as isTokenActivitySummary,
|
|
228
|
+
m as isTransactionSimulationError,
|
|
229
|
+
K as isUpgradeActivity,
|
|
230
|
+
ve as nativeActivityMetaSchema,
|
|
231
|
+
S as nativeActivitySchema,
|
|
232
|
+
T as normalizeActions,
|
|
233
|
+
O as normalizeActivitySummary,
|
|
234
|
+
E as normalizeActivitySummaryCollection,
|
|
235
|
+
Q as parseAccountActivities,
|
|
236
|
+
V as parseFinanceActivities,
|
|
237
|
+
Se as propertySchema,
|
|
238
|
+
ge as reasonsSchema,
|
|
239
|
+
ye as reviewSchema,
|
|
240
|
+
ke as severitySchema,
|
|
241
|
+
Ee as simulateAndReviewSchema,
|
|
242
|
+
Oe as targetedDappSchema,
|
|
243
|
+
Te as warningDetailsSchema,
|
|
225
244
|
be as warningSchema
|
|
226
245
|
};
|