@argent/x-shared 1.74.2 → 1.75.1
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 +212 -209
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.js +12 -13
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.cjs +1 -1
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +60 -60
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js +1 -1
- package/dist/src/chains/starknet/address.cjs +1 -1
- package/dist/src/chains/starknet/address.js +16 -16
- package/dist/src/features/simulation/activity/normalize.cjs +1 -1
- package/dist/src/features/simulation/activity/normalize.js +12 -13
- package/dist/src/features/simulation/activity/utils/createNativeActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/createNativeActivity.js +22 -24
- package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.js +11 -12
- package/dist/src/features/simulation/activity/utils/hasDelegationActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/hasDelegationActivity.js +2 -8
- package/dist/src/features/simulation/activity/utils/isAddMultisigSignersActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isAddMultisigSignersActivity.js +4 -8
- package/dist/src/features/simulation/activity/utils/isChangeMultisigThresholdActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isChangeMultisigThresholdActivity.js +4 -8
- package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.js +3 -9
- package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.js +15 -19
- package/dist/src/features/simulation/activity/utils/isRemoveMultisigSignersActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isRemoveMultisigSignersActivity.js +4 -8
- package/dist/src/features/simulation/activity/utils/isSwapActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isSwapActivity.js +9 -16
- package/dist/src/features/simulation/activity/utils/isUpgradeActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isUpgradeActivity.js +4 -8
- package/dist/src/features/simulation/fees/schema.cjs +1 -1
- package/dist/src/features/simulation/fees/schema.d.ts +16 -0
- package/dist/src/features/simulation/fees/schema.js +8 -6
- package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.js +10 -11
- package/dist/src/features/simulation/transactionReview/schema.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/schema.d.ts +23 -0
- package/dist/src/features/simulation/transactionReview/schema.js +20 -18
- package/dist/src/features/swap/services/SwapTransactionService.cjs +1 -1
- package/dist/src/features/swap/services/SwapTransactionService.js +46 -49
- package/dist/src/http/HttpService.cjs +1 -1
- package/dist/src/http/HttpService.js +55 -55
- package/dist/src/knownDapps/utils/getDapplandUrl.cjs +1 -1
- package/dist/src/knownDapps/utils/getDapplandUrl.js +6 -8
- package/dist/src/nfts/BackendNftService.cjs +1 -1
- package/dist/src/nfts/BackendNftService.js +15 -16
- package/dist/src/tokens/service/implementation.cjs +1 -1
- package/dist/src/tokens/service/implementation.d.ts +2 -0
- package/dist/src/tokens/service/implementation.js +12 -12
- package/dist/src/tokens/service/types/backend.model.cjs +1 -1
- package/dist/src/tokens/service/types/backend.model.d.ts +26 -0
- package/dist/src/tokens/service/types/backend.model.js +25 -23
- package/dist/src/transactions/estimate/utils.cjs +1 -1
- package/dist/src/transactions/estimate/utils.d.ts +33 -0
- package/dist/src/transactions/estimate/utils.js +80 -76
- package/dist/src/transactions/service/implementation.cjs +1 -1
- package/dist/src/transactions/service/implementation.d.ts +4 -0
- package/dist/src/transactions/service/implementation.js +89 -96
- package/dist/src/transactions/service/utils.cjs +1 -1
- package/dist/src/transactions/service/utils.d.ts +2 -3
- package/dist/src/transactions/service/utils.js +12 -11
- package/dist/src/transactions/transactionVersion.cjs +1 -1
- package/dist/src/transactions/transactionVersion.d.ts +2 -0
- package/dist/src/transactions/transactionVersion.js +12 -10
- package/dist/src/utils/readFileAsString.cjs +1 -1
- package/dist/src/utils/readFileAsString.js +3 -6
- package/package.json +5 -5
- package/dist/defiDecomposition.cjs +0 -1
- package/dist/defiDecomposition.d.ts +0 -2
- package/dist/defiDecomposition.js +0 -65
- package/dist/node_modules/.pnpm/@starknet-io_types-js@0.7.7/node_modules/@starknet-io/types-js/dist/esm/api/nonspec.cjs +0 -1
- package/dist/node_modules/.pnpm/@starknet-io_types-js@0.7.7/node_modules/@starknet-io/types-js/dist/esm/api/nonspec.js +0 -6
- package/dist/src/features/defiDecomposition/helpers/computeCollateralizedDebtPositionsUsdValue.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/computeCollateralizedDebtPositionsUsdValue.d.ts +0 -6
- package/dist/src/features/defiDecomposition/helpers/computeCollateralizedDebtPositionsUsdValue.js +0 -62
- package/dist/src/features/defiDecomposition/helpers/computeConcentratedLiquidityPositionsUsdValue.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/computeConcentratedLiquidityPositionsUsdValue.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/computeConcentratedLiquidityPositionsUsdValue.js +0 -31
- package/dist/src/features/defiDecomposition/helpers/computeDefiDecompositionUsdValue.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/computeDefiDecompositionUsdValue.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/computeDefiDecompositionUsdValue.js +0 -55
- package/dist/src/features/defiDecomposition/helpers/computeDelegatedTokensPositionsUsdValue.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/computeDelegatedTokensPositionsUsdValue.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/computeDelegatedTokensPositionsUsdValue.js +0 -30
- package/dist/src/features/defiDecomposition/helpers/computeStakingPositionsUsdValue.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/computeStakingPositionsUsdValue.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/computeStakingPositionsUsdValue.js +0 -30
- package/dist/src/features/defiDecomposition/helpers/computeStrkDelegatedStakingPositionsUsdValue.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/computeStrkDelegatedStakingPositionsUsdValue.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/computeStrkDelegatedStakingPositionsUsdValue.js +0 -30
- package/dist/src/features/defiDecomposition/helpers/computeUsdValueForPosition.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/computeUsdValueForPosition.d.ts +0 -3
- package/dist/src/features/defiDecomposition/helpers/computeUsdValueForPosition.js +0 -17
- package/dist/src/features/defiDecomposition/helpers/getDefiProductName.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/getDefiProductName.d.ts +0 -1
- package/dist/src/features/defiDecomposition/helpers/getDefiProductName.js +0 -11
- package/dist/src/features/defiDecomposition/helpers/index.d.ts +0 -13
- package/dist/src/features/defiDecomposition/helpers/parseCollateralizedDebtPositions.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/parseCollateralizedDebtPositions.d.ts +0 -7
- package/dist/src/features/defiDecomposition/helpers/parseCollateralizedDebtPositions.js +0 -57
- package/dist/src/features/defiDecomposition/helpers/parseConcentratedLiquidityPositions.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/parseConcentratedLiquidityPositions.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/parseConcentratedLiquidityPositions.js +0 -42
- package/dist/src/features/defiDecomposition/helpers/parseDefiDecomposition.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/parseDefiDecomposition.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/parseDefiDecomposition.js +0 -63
- package/dist/src/features/defiDecomposition/helpers/parseDelegatedTokensPositions.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/parseDelegatedTokensPositions.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/parseDelegatedTokensPositions.js +0 -27
- package/dist/src/features/defiDecomposition/helpers/parseStakingPositions.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/parseStakingPositions.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/parseStakingPositions.js +0 -29
- package/dist/src/features/defiDecomposition/helpers/parseStrkDelegatedStakingPositions.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/parseStrkDelegatedStakingPositions.d.ts +0 -4
- package/dist/src/features/defiDecomposition/helpers/parseStrkDelegatedStakingPositions.js +0 -27
- package/dist/src/features/defiDecomposition/helpers/sortDescendingByUsdValue.cjs +0 -1
- package/dist/src/features/defiDecomposition/helpers/sortDescendingByUsdValue.d.ts +0 -9
- package/dist/src/features/defiDecomposition/helpers/sortDescendingByUsdValue.js +0 -9
- package/dist/src/features/defiDecomposition/index.d.ts +0 -2
- package/dist/src/features/defiDecomposition/schema.cjs +0 -1
- package/dist/src/features/defiDecomposition/schema.d.ts +0 -1842
- package/dist/src/features/defiDecomposition/schema.js +0 -153
- package/dist/src/transactions/equalTokens.cjs +0 -1
- package/dist/src/transactions/equalTokens.js +0 -5
|
@@ -16,7 +16,7 @@ const C = a.string().refine((e) => {
|
|
|
16
16
|
} catch {
|
|
17
17
|
}
|
|
18
18
|
return !1;
|
|
19
|
-
}, { message: "Invalid address (validation error)" }), n = a.string().regex(/^0x[0-9a-fA-F]+$/, "Invalid address"),
|
|
19
|
+
}, { message: "Invalid address (validation error)" }), n = a.string().regex(/^0x[0-9a-fA-F]+$/, "Invalid address"), k = n.min(50, "Address must at least be 50 characters long").max(66, "Address must at most be 66 characters long"), T = n.length(66, "Address must be 66 characters long"), u = k.pipe(C).transform((e) => `0x${(e.startsWith("0x") ? e.slice(2) : e).padStart(64, "0")}`), U = u.or(a.literal("")).transform((e) => e === "" ? void 0 : e).optional(), W = n.transform((e) => `0x${e.replace(/^0x/, "").toLowerCase().padStart(64, "0")}`), f = (e) => a.string().refine((s) => {
|
|
20
20
|
if (s.toLowerCase() === s)
|
|
21
21
|
return !0;
|
|
22
22
|
try {
|
|
@@ -24,25 +24,25 @@ const C = a.string().refine((e) => {
|
|
|
24
24
|
} catch {
|
|
25
25
|
}
|
|
26
26
|
return !1;
|
|
27
|
-
}, { message: e("validation.address.invalidChecksum") }),
|
|
27
|
+
}, { message: e("validation.address.invalidChecksum") }), y = (e) => a.string().refine((s) => {
|
|
28
28
|
try {
|
|
29
29
|
return l(s);
|
|
30
30
|
} catch {
|
|
31
31
|
}
|
|
32
32
|
return !1;
|
|
33
|
-
}, { message: e("validation.address.validationError") }), o = (e) => a.string().regex(/^0x[0-9a-fA-F]+$/, e("validation.address.invalidFormat")), g = (e) => o(e).min(50, e("validation.address.tooShort")).max(66, e("validation.address.tooLong")),
|
|
33
|
+
}, { message: e("validation.address.validationError") }), o = (e) => a.string().regex(/^0x[0-9a-fA-F]+$/, e("validation.address.invalidFormat")), g = (e) => o(e).min(50, e("validation.address.tooShort")).max(66, e("validation.address.tooLong")), B = (e) => o(e).length(66, e("validation.address.exactLength")), S = (e) => {
|
|
34
34
|
const s = g(e), r = f(e);
|
|
35
35
|
return s.pipe(r).transform((t) => `0x${(t.startsWith("0x") ? t.slice(2) : t).padStart(64, "0")}`);
|
|
36
|
-
},
|
|
36
|
+
}, P = (e) => S(e).or(a.literal("")).transform((r) => r === "" ? void 0 : r).optional(), v = (e) => o(e).transform((r) => `0x${r.replace(/^0x/, "").toLowerCase().padStart(64, "0")}`), j = (e) => ({
|
|
37
37
|
validChecksumAddressSchema: f(e),
|
|
38
|
-
validateAddressRangeSchema:
|
|
38
|
+
validateAddressRangeSchema: y(e),
|
|
39
39
|
addressSchemaBase: o(e),
|
|
40
40
|
addressSchemaLooseLength: g(e),
|
|
41
|
-
addressSchemaStrictLength:
|
|
41
|
+
addressSchemaStrictLength: B(e),
|
|
42
42
|
addressSchema: S(e),
|
|
43
|
-
addressOrEmptyUndefinedSchema:
|
|
44
|
-
addressSchemaArgentBackend:
|
|
45
|
-
}),
|
|
43
|
+
addressOrEmptyUndefinedSchema: P(e),
|
|
44
|
+
addressSchemaArgentBackend: v(e)
|
|
45
|
+
}), b = (e) => u.safeParse(e).success, E = b, A = (e) => x(e), q = (e) => {
|
|
46
46
|
if (!e)
|
|
47
47
|
return !1;
|
|
48
48
|
try {
|
|
@@ -75,7 +75,7 @@ const C = a.string().refine((e) => {
|
|
|
75
75
|
} catch {
|
|
76
76
|
}
|
|
77
77
|
return !1;
|
|
78
|
-
}, G = (e, s) => !!
|
|
78
|
+
}, G = (e, s) => !!s?.some((r) => z(r, e)), J = m((e) => {
|
|
79
79
|
const s = e.slice(0, 6), r = e.slice(-4);
|
|
80
80
|
return `${s}…${r}`;
|
|
81
81
|
}), K = m((e, s) => {
|
|
@@ -89,23 +89,23 @@ export {
|
|
|
89
89
|
u as addressSchema,
|
|
90
90
|
W as addressSchemaArgentBackend,
|
|
91
91
|
n as addressSchemaBase,
|
|
92
|
-
|
|
92
|
+
k as addressSchemaLooseLength,
|
|
93
93
|
T as addressSchemaStrictLength,
|
|
94
94
|
M as formatFullAddress,
|
|
95
95
|
H as formatTruncatedAddress,
|
|
96
96
|
J as formatTruncatedSignerKey,
|
|
97
97
|
K as formatTruncatedString,
|
|
98
|
-
|
|
98
|
+
P as getAddressOrEmptyUndefinedSchema,
|
|
99
99
|
S as getAddressSchema,
|
|
100
|
-
|
|
100
|
+
v as getAddressSchemaArgentBackend,
|
|
101
101
|
o as getAddressSchemaBase,
|
|
102
102
|
g as getAddressSchemaLooseLength,
|
|
103
|
-
|
|
103
|
+
B as getAddressSchemaStrictLength,
|
|
104
104
|
j as getAddressValidationSchemas,
|
|
105
105
|
f as getValidChecksumAddressSchema,
|
|
106
|
-
|
|
106
|
+
y as getValidateAddressRangeSchema,
|
|
107
107
|
G as includesAddress,
|
|
108
|
-
|
|
108
|
+
b as isAddress,
|
|
109
109
|
q as isBase58Address,
|
|
110
110
|
z as isEqualAddress,
|
|
111
111
|
E as isValidAddress,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./schema.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./schema.cjs"),r=e=>e.map(o),o=e=>{if(t.isActivitySummary(e))return t.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:e.token.imageUrls?.preview,nftName:e.tokenIdDetails?.name,nftPreviewImage:e.tokenIdDetails?.imageUrls?.preview},sent:n};return t.activitySummarySchema.parse(a)}const i={asset:{type:"token",tokenAddress:e.token.address,amount:e.value,fiatAmount:{currency:"USD",currencyAmount:e.usdValue||"0"}},sent:n};return t.activitySummarySchema.parse(i)};exports.normalizeActivitySummary=o;exports.normalizeActivitySummaryCollection=r;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { isActivitySummary as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
if (d(e))
|
|
1
|
+
import { isActivitySummary as r, activitySummarySchema as n } from "./schema.js";
|
|
2
|
+
const l = (e) => e.map(a), a = (e) => {
|
|
3
|
+
if (r(e))
|
|
5
4
|
return n.parse(e);
|
|
6
5
|
const t = !!e.sent;
|
|
7
6
|
if (e.token.type !== "ERC20") {
|
|
8
|
-
const
|
|
7
|
+
const i = {
|
|
9
8
|
asset: {
|
|
10
9
|
type: "nft",
|
|
11
10
|
tokenAddress: e.token.address,
|
|
12
11
|
tokenId: e.tokenId ? parseInt(e.tokenId) : 0,
|
|
13
12
|
amount: e.value,
|
|
14
13
|
collectionName: e.token.name,
|
|
15
|
-
collectionPreviewImage:
|
|
16
|
-
nftName:
|
|
17
|
-
nftPreviewImage:
|
|
14
|
+
collectionPreviewImage: e.token.imageUrls?.preview,
|
|
15
|
+
nftName: e.tokenIdDetails?.name,
|
|
16
|
+
nftPreviewImage: e.tokenIdDetails?.imageUrls?.preview
|
|
18
17
|
},
|
|
19
18
|
sent: t
|
|
20
19
|
};
|
|
21
|
-
return n.parse(
|
|
20
|
+
return n.parse(i);
|
|
22
21
|
}
|
|
23
|
-
const
|
|
22
|
+
const o = {
|
|
24
23
|
asset: {
|
|
25
24
|
type: "token",
|
|
26
25
|
tokenAddress: e.token.address,
|
|
@@ -32,9 +31,9 @@ const p = (e) => e.map(s), s = (e) => {
|
|
|
32
31
|
},
|
|
33
32
|
sent: t
|
|
34
33
|
};
|
|
35
|
-
return n.parse(
|
|
34
|
+
return n.parse(o);
|
|
36
35
|
};
|
|
37
36
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
a as normalizeActivitySummary,
|
|
38
|
+
l as normalizeActivitySummaryCollection
|
|
40
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),u=require("../normalize.cjs"),s=require("../schema.cjs");function e(t){const n=t.transactions?.[0].reviewOfTransaction?.reviews;return n?n.map(a=>a.action):void 0}function v({simulateAndReview:t,...n}){const i={type:s.NativeActivityTypeNative,...n};if(t&&!y.isEmpty(t.transactions)){const a=t.transactions?.[t.transactions.length-1],r=a?.simulation?.summary;if(r){const m=u.normalizeActivitySummaryCollection(r);i.transferSummary=m}const c=a?.reviewOfTransaction?.targetedDapp;c&&(i.dapp=c);const o=e(t);o&&(i.actions=o)}return s.nativeActivitySchema.parse(i)}exports.createNativeActivity=v;exports.normalizeActions=e;
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { isEmpty as
|
|
2
|
-
import { normalizeActivitySummaryCollection as
|
|
3
|
-
import { nativeActivitySchema as
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return a ? a.map((c) => c.action) : void 0;
|
|
1
|
+
import { isEmpty as e } from "lodash-es";
|
|
2
|
+
import { normalizeActivitySummaryCollection as m } from "../normalize.js";
|
|
3
|
+
import { nativeActivitySchema as p, NativeActivityTypeNative as f } from "../schema.js";
|
|
4
|
+
function y(t) {
|
|
5
|
+
const i = t.transactions?.[0].reviewOfTransaction?.reviews;
|
|
6
|
+
return i ? i.map((r) => r.action) : void 0;
|
|
8
7
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
...a
|
|
8
|
+
function T({ simulateAndReview: t, ...i }) {
|
|
9
|
+
const n = {
|
|
10
|
+
type: f,
|
|
11
|
+
...i
|
|
14
12
|
};
|
|
15
|
-
if (t && !
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
|
|
13
|
+
if (t && !e(t.transactions)) {
|
|
14
|
+
const r = t.transactions?.[t.transactions.length - 1], a = r?.simulation?.summary;
|
|
15
|
+
if (a) {
|
|
16
|
+
const s = m(a);
|
|
17
|
+
n.transferSummary = s;
|
|
20
18
|
}
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
19
|
+
const o = r?.reviewOfTransaction?.targetedDapp;
|
|
20
|
+
o && (n.dapp = o);
|
|
21
|
+
const c = y(t);
|
|
22
|
+
c && (n.actions = c);
|
|
25
23
|
}
|
|
26
|
-
return
|
|
24
|
+
return p.parse(n);
|
|
27
25
|
}
|
|
28
26
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
T as createNativeActivity,
|
|
28
|
+
y as normalizeActions
|
|
31
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../schema.cjs"),l=require("./isRejectOnChainActivity.cjs");function i(e,t,n=!1){if(e.type===r.NativeActivityTypeNative){if(n&&e.meta?.shortTitle)return t(e.meta.shortTitle);if(e.meta?.title)return t(e.meta.title)}else{if(l.isRejectOnChainActivity(e))return t("multisig.onChainRejection");if(e.title)return e.title}return t("activities.contractInteraction")}function o(e,t){return i(e,t,!0)}exports.getAnyActivityShortTitle=o;exports.getAnyActivityTitle=i;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { NativeActivityTypeNative as
|
|
2
|
-
import { isRejectOnChainActivity as
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (n && ((i = e.meta) != null && i.shortTitle))
|
|
1
|
+
import { NativeActivityTypeNative as r } from "../schema.js";
|
|
2
|
+
import { isRejectOnChainActivity as n } from "./isRejectOnChainActivity.js";
|
|
3
|
+
function o(e, t, i = !1) {
|
|
4
|
+
if (e.type === r) {
|
|
5
|
+
if (i && e.meta?.shortTitle)
|
|
7
6
|
return t(e.meta.shortTitle);
|
|
8
|
-
if (
|
|
7
|
+
if (e.meta?.title)
|
|
9
8
|
return t(e.meta.title);
|
|
10
9
|
} else {
|
|
11
|
-
if (
|
|
10
|
+
if (n(e))
|
|
12
11
|
return t("multisig.onChainRejection");
|
|
13
12
|
if (e.title)
|
|
14
13
|
return e.title;
|
|
15
14
|
}
|
|
16
15
|
return t("activities.contractInteraction");
|
|
17
16
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
17
|
+
function u(e, t) {
|
|
18
|
+
return o(e, t, !0);
|
|
20
19
|
}
|
|
21
20
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
u as getAnyActivityShortTitle,
|
|
22
|
+
o as getAnyActivityTitle
|
|
24
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=t=>!!t.details?.calls?.some(e=>e?.details?.function?.name?e?.details?.function.name==="lock_and_delegate_by_sig":!1);exports.hasDelegationActivity=a;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
var t, n;
|
|
3
|
-
return !!((n = (t = a.details) == null ? void 0 : t.calls) == null ? void 0 : n.some((e) => {
|
|
4
|
-
var i, o, s;
|
|
5
|
-
return (o = (i = e == null ? void 0 : e.details) == null ? void 0 : i.function) != null && o.name ? ((s = e == null ? void 0 : e.details) == null ? void 0 : s.function.name) === "lock_and_delegate_by_sig" : !1;
|
|
6
|
-
}));
|
|
7
|
-
};
|
|
1
|
+
const a = (t) => !!t.details?.calls?.some((e) => e?.details?.function?.name ? e?.details?.function.name === "lock_and_delegate_by_sig" : !1);
|
|
8
2
|
export {
|
|
9
|
-
|
|
3
|
+
a as hasDelegationActivity
|
|
10
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(t,i){const e=r(t),s=d(t,i);return e||s}const r=t=>{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(t,i){const e=r(t),s=d(t,i);return e||s}const r=t=>{if(!t.actions?.length)return!1;const i=t.actions[0];if(i.name!=="account_multisig_add_signers")return!1;if(i.defaultProperties){for(const e of i.defaultProperties)if(e.type==="calldata"&&e.entrypoint==="add_signers")return!0}return!1},d=(t,i)=>!!("meta"in t&&t.meta?.title?.includes(i("transactionTitle.addMultisigOwner")));exports.isAddMultisigSignersActivity=n;
|
|
@@ -3,22 +3,18 @@ function a(t, e) {
|
|
|
3
3
|
return i || s;
|
|
4
4
|
}
|
|
5
5
|
const n = (t) => {
|
|
6
|
-
|
|
7
|
-
if (!((i = t.actions) != null && i.length))
|
|
6
|
+
if (!t.actions?.length)
|
|
8
7
|
return !1;
|
|
9
8
|
const e = t.actions[0];
|
|
10
9
|
if (e.name !== "account_multisig_add_signers")
|
|
11
10
|
return !1;
|
|
12
11
|
if (e.defaultProperties) {
|
|
13
|
-
for (const
|
|
14
|
-
if (
|
|
12
|
+
for (const i of e.defaultProperties)
|
|
13
|
+
if (i.type === "calldata" && i.entrypoint === "add_signers")
|
|
15
14
|
return !0;
|
|
16
15
|
}
|
|
17
16
|
return !1;
|
|
18
|
-
}, r = (t, e) =>
|
|
19
|
-
var i, s;
|
|
20
|
-
return !!("meta" in t && (s = (i = t.meta) == null ? void 0 : i.title) != null && s.includes(e("transactionTitle.addMultisigOwner")));
|
|
21
|
-
};
|
|
17
|
+
}, r = (t, e) => !!("meta" in t && t.meta?.title?.includes(e("transactionTitle.addMultisigOwner")));
|
|
22
18
|
export {
|
|
23
19
|
a as isAddMultisigSignersActivity
|
|
24
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e,t){const i=r(e),s=a(e,t);return i||s}const r=e=>{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e,t){const i=r(e),s=a(e,t);return i||s}const r=e=>{if(!e.actions?.length)return!1;const t=e.actions[0];if(t.name!=="account_multisig_change_threshold")return!1;if(t.defaultProperties){for(const i of t.defaultProperties)if(i.type==="calldata"&&i.entrypoint==="change_threshold")return!0}return!1},a=(e,t)=>!!("meta"in e&&e.meta?.title?.includes(t("transactionTitle.setConfirmations")));exports.isChangeMultisigThresholdActivity=n;
|
|
@@ -3,22 +3,18 @@ function a(e, t) {
|
|
|
3
3
|
return s || i;
|
|
4
4
|
}
|
|
5
5
|
const n = (e) => {
|
|
6
|
-
|
|
7
|
-
if (!((s = e.actions) != null && s.length))
|
|
6
|
+
if (!e.actions?.length)
|
|
8
7
|
return !1;
|
|
9
8
|
const t = e.actions[0];
|
|
10
9
|
if (t.name !== "account_multisig_change_threshold")
|
|
11
10
|
return !1;
|
|
12
11
|
if (t.defaultProperties) {
|
|
13
|
-
for (const
|
|
14
|
-
if (
|
|
12
|
+
for (const s of t.defaultProperties)
|
|
13
|
+
if (s.type === "calldata" && s.entrypoint === "change_threshold")
|
|
15
14
|
return !0;
|
|
16
15
|
}
|
|
17
16
|
return !1;
|
|
18
|
-
}, r = (e, t) =>
|
|
19
|
-
var s, i;
|
|
20
|
-
return !!("meta" in e && (i = (s = e.meta) == null ? void 0 : s.title) != null && i.includes(t("transactionTitle.setConfirmations")));
|
|
21
|
-
};
|
|
17
|
+
}, r = (e, t) => !!("meta" in e && e.meta?.title?.includes(t("transactionTitle.setConfirmations")));
|
|
22
18
|
export {
|
|
23
19
|
a as isChangeMultisigThresholdActivity
|
|
24
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../chains/starknet/address.cjs"),s=e=>e.type==="multicall"&&"calls"in e.details&&e.details.calls?.some(l=>l?.details?.type==="deploy"&&t.isEqualAddress(l?.details.contractAddress||"",e.wallet));exports.isMulticallWithDeploymentActivity=s;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import { isEqualAddress as
|
|
2
|
-
const
|
|
3
|
-
var t;
|
|
4
|
-
return s.type === "multicall" && "calls" in s.details && ((t = s.details.calls) == null ? void 0 : t.some((e) => {
|
|
5
|
-
var d;
|
|
6
|
-
return ((d = e == null ? void 0 : e.details) == null ? void 0 : d.type) === "deploy" && o((e == null ? void 0 : e.details.contractAddress) || "", s.wallet);
|
|
7
|
-
}));
|
|
8
|
-
};
|
|
1
|
+
import { isEqualAddress as s } from "../../../../chains/starknet/address.js";
|
|
2
|
+
const d = (l) => l.type === "multicall" && "calls" in l.details && l.details.calls?.some((e) => e?.details?.type === "deploy" && s(e?.details.contractAddress || "", l.wallet));
|
|
9
3
|
export {
|
|
10
|
-
|
|
4
|
+
d as isMulticallWithDeploymentActivity
|
|
11
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../chains/starknet/address.cjs"),l=require("../../../../chains/starknet/constants.cjs");function f(t){const s=u(t),n=o(t);return s||n}const u=t=>{if(!t.actions?.length)return!1;const s=t.actions[0];if(s.name!=="ERC20_transfer")return!1;let n,i,a,r;return s.defaultProperties&&s.defaultProperties.forEach(e=>{e.type==="token_address"&&e.token.address===l.ETH_TOKEN_ADDRESS&&(i=!0),e.type==="calldata"&&(n=e.calldata[0])}),s.properties.length>1&&s.properties.forEach(e=>{e.type==="amount"&&e.label==="ERC20_transfer_amount"&&e.amount==="0"&&(a=!0),e.type==="address"&&e.label==="ERC20_transfer_recipient"&&c.isEqualAddress(e.address,n)&&(r=!0)}),i&&a&&r},o=t=>!!("meta"in t&&t.meta?.title?.includes("On-chain rejection"));exports.isRejectOnChainActivity=f;
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import { isEqualAddress as
|
|
2
|
-
import { ETH_TOKEN_ADDRESS as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
return
|
|
1
|
+
import { isEqualAddress as f } from "../../../../chains/starknet/address.js";
|
|
2
|
+
import { ETH_TOKEN_ADDRESS as c } from "../../../../chains/starknet/constants.js";
|
|
3
|
+
function R(t) {
|
|
4
|
+
const s = l(t), n = o(t);
|
|
5
|
+
return s || n;
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
if (!((f = s.actions) != null && f.length))
|
|
7
|
+
const l = (t) => {
|
|
8
|
+
if (!t.actions?.length)
|
|
10
9
|
return !1;
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
10
|
+
const s = t.actions[0];
|
|
11
|
+
if (s.name !== "ERC20_transfer")
|
|
13
12
|
return !1;
|
|
14
13
|
let n, i, a, r;
|
|
15
|
-
return
|
|
16
|
-
e.type === "token_address" && e.token.address ===
|
|
17
|
-
}),
|
|
18
|
-
e.type === "amount" && e.label === "ERC20_transfer_amount" && e.amount === "0" && (a = !0), e.type === "address" && e.label === "ERC20_transfer_recipient" &&
|
|
14
|
+
return s.defaultProperties && s.defaultProperties.forEach((e) => {
|
|
15
|
+
e.type === "token_address" && e.token.address === c && (i = !0), e.type === "calldata" && (n = e.calldata[0]);
|
|
16
|
+
}), s.properties.length > 1 && s.properties.forEach((e) => {
|
|
17
|
+
e.type === "amount" && e.label === "ERC20_transfer_amount" && e.amount === "0" && (a = !0), e.type === "address" && e.label === "ERC20_transfer_recipient" && f(e.address, n) && (r = !0);
|
|
19
18
|
}), i && a && r;
|
|
20
|
-
},
|
|
21
|
-
var t, n;
|
|
22
|
-
return !!("meta" in s && (n = (t = s.meta) == null ? void 0 : t.title) != null && n.includes("On-chain rejection"));
|
|
23
|
-
};
|
|
19
|
+
}, o = (t) => !!("meta" in t && t.meta?.title?.includes("On-chain rejection"));
|
|
24
20
|
export {
|
|
25
|
-
|
|
21
|
+
R as isRejectOnChainActivity
|
|
26
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e,t){const i=r(e),s=o(e,t);return i||s}const r=e=>{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e,t){const i=r(e),s=o(e,t);return i||s}const r=e=>{if(!e.actions?.length)return!1;const t=e.actions[0];if(t.name!=="account_multisig_remove_signers")return!1;if(t.defaultProperties){for(const i of t.defaultProperties)if(i.type==="calldata"&&i.entrypoint==="remove_signers")return!0}return!1},o=(e,t)=>!!("meta"in e&&e.meta?.title?.includes(t("transactionTitle.removeOwner")));exports.isRemoveMultisigSignersActivity=n;
|
|
@@ -3,22 +3,18 @@ function o(e, t) {
|
|
|
3
3
|
return i || s;
|
|
4
4
|
}
|
|
5
5
|
const n = (e) => {
|
|
6
|
-
|
|
7
|
-
if (!((i = e.actions) != null && i.length))
|
|
6
|
+
if (!e.actions?.length)
|
|
8
7
|
return !1;
|
|
9
8
|
const t = e.actions[0];
|
|
10
9
|
if (t.name !== "account_multisig_remove_signers")
|
|
11
10
|
return !1;
|
|
12
11
|
if (t.defaultProperties) {
|
|
13
|
-
for (const
|
|
14
|
-
if (
|
|
12
|
+
for (const i of t.defaultProperties)
|
|
13
|
+
if (i.type === "calldata" && i.entrypoint === "remove_signers")
|
|
15
14
|
return !0;
|
|
16
15
|
}
|
|
17
16
|
return !1;
|
|
18
|
-
}, r = (e, t) =>
|
|
19
|
-
var i, s;
|
|
20
|
-
return !!("meta" in e && (s = (i = e.meta) == null ? void 0 : i.title) != null && s.includes(t("transactionTitle.removeOwner")));
|
|
21
|
-
};
|
|
17
|
+
}, r = (e, t) => !!("meta" in e && e.meta?.title?.includes(t("transactionTitle.removeOwner")));
|
|
22
18
|
export {
|
|
23
19
|
o as isRemoveMultisigSignersActivity
|
|
24
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e,s){const t=r(e),a=u(e,s);return t||a}const r=e=>{if(!e.actions?.length)return!1;const s=["multi_route_swap","Jediswap_swap","Avnu_swap","multi_multihop_swap","swap"];return e.actions.some(t=>!s.includes(t.name)||!t.defaultProperties?!1:t.defaultProperties.some(i=>i.type==="calldata"&&i.entrypoint?.toLowerCase().includes("swap")))},u=(e,s)=>!!("meta"in e&&e.meta?.title?.includes(s("transactionTitle.swap")));exports.isSwapActivity=n;
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
function
|
|
2
|
-
const t =
|
|
3
|
-
return t ||
|
|
1
|
+
function u(e, s) {
|
|
2
|
+
const t = i(e), a = r(e, s);
|
|
3
|
+
return t || a;
|
|
4
4
|
}
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
if (!((t = e.actions) != null && t.length))
|
|
5
|
+
const i = (e) => {
|
|
6
|
+
if (!e.actions?.length)
|
|
8
7
|
return !1;
|
|
9
|
-
const
|
|
8
|
+
const s = [
|
|
10
9
|
"multi_route_swap",
|
|
11
10
|
"Jediswap_swap",
|
|
12
11
|
"Avnu_swap",
|
|
13
12
|
"multi_multihop_swap",
|
|
14
13
|
"swap"
|
|
15
14
|
];
|
|
16
|
-
return e.actions.some((
|
|
17
|
-
|
|
18
|
-
return n.type === "calldata" && ((i = n.entrypoint) == null ? void 0 : i.toLowerCase().includes("swap"));
|
|
19
|
-
}));
|
|
20
|
-
}, u = (e, a) => {
|
|
21
|
-
var t, s;
|
|
22
|
-
return !!("meta" in e && (s = (t = e.meta) == null ? void 0 : t.title) != null && s.includes(a("transactionTitle.swap")));
|
|
23
|
-
};
|
|
15
|
+
return e.actions.some((t) => !s.includes(t.name) || !t.defaultProperties ? !1 : t.defaultProperties.some((n) => n.type === "calldata" && n.entrypoint?.toLowerCase().includes("swap")));
|
|
16
|
+
}, r = (e, s) => !!("meta" in e && e.meta?.title?.includes(s("transactionTitle.swap")));
|
|
24
17
|
export {
|
|
25
|
-
|
|
18
|
+
u as isSwapActivity
|
|
26
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e,t){const r=n(e),a=s(e,t);return r||a}const n=e=>{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(e,t){const r=n(e),a=s(e,t);return r||a}const n=e=>{if(!e.actions?.length)return!1;const t=e.actions[0];if(t.name!=="account_upgrade")return!1;if(t.defaultProperties){for(const r of t.defaultProperties)if(r.type==="calldata"&&r.entrypoint==="upgrade")return!0}return!1},s=(e,t)=>!!("meta"in e&&e.meta?.title?.includes(t("accountUpgrade.upgradeAccount")));exports.isUpgradeActivity=i;
|
|
@@ -3,22 +3,18 @@ function i(e, t) {
|
|
|
3
3
|
return r || n;
|
|
4
4
|
}
|
|
5
5
|
const a = (e) => {
|
|
6
|
-
|
|
7
|
-
if (!((r = e.actions) != null && r.length))
|
|
6
|
+
if (!e.actions?.length)
|
|
8
7
|
return !1;
|
|
9
8
|
const t = e.actions[0];
|
|
10
9
|
if (t.name !== "account_upgrade")
|
|
11
10
|
return !1;
|
|
12
11
|
if (t.defaultProperties) {
|
|
13
|
-
for (const
|
|
14
|
-
if (
|
|
12
|
+
for (const r of t.defaultProperties)
|
|
13
|
+
if (r.type === "calldata" && r.entrypoint === "upgrade")
|
|
15
14
|
return !0;
|
|
16
15
|
}
|
|
17
16
|
return !1;
|
|
18
|
-
}, s = (e, t) =>
|
|
19
|
-
var r, n;
|
|
20
|
-
return !!("meta" in e && (n = (r = e.meta) == null ? void 0 : r.title) != null && n.includes(t("accountUpgrade.upgradeAccount")));
|
|
21
|
-
};
|
|
17
|
+
}, s = (e, t) => !!("meta" in e && e.meta?.title?.includes(t("accountUpgrade.upgradeAccount")));
|
|
22
18
|
export {
|
|
23
19
|
i as isUpgradeActivity
|
|
24
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),m=require("../../../chains/starknet/address.cjs"),t=e.z.object({gasConsumed:e.z.bigint(),gasPrice:e.z.bigint()}),a=e.z.object({type:e.z.literal("native"),feeTokenAddress:m.addressSchema,l1Gas:t,l2Gas:t,l1DataGas:t,overallFee:e.z.bigint().optional(),tip:e.z.bigint().optional()}),i=e.z.object({type:e.z.literal("paymaster"),feeTokenAddress:m.addressSchema,maxFee:e.z.bigint(),overallFee:e.z.bigint(),tip:e.z.bigint().optional()}),n=e.z.discriminatedUnion("type",[a,i]),s=e.z.object({type:e.z.literal("native"),transactions:a.omit({type:!0}),deployment:a.omit({type:!0}).optional()}),o=e.z.object({type:e.z.literal("paymaster"),transactions:i.omit({type:!0}),deployment:i.omit({type:!0}).optional()}),c=e.z.discriminatedUnion("type",[s,o]),r=e.z.object({native:s.omit({type:!0}),paymaster:o.omit({type:!0}).optional()});exports.estimatedFeeSchema=n;exports.estimatedFeesSchema=c;exports.feeEstimationResultSchema=r;exports.nativeEstimatedFeeSchema=a;exports.nativeEstimatedFeesSchema=s;exports.paymasterEstimatedFeeSchema=i;exports.paymasterEstimatedFeesSchema=o;exports.resourceBoundsSchema=t;
|