@argent/x-shared 1.67.0 → 1.67.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +389 -388
- package/dist/simulation.cjs +1 -1
- package/dist/simulation.js +52 -50
- package/dist/src/chains/starknet/getAddressFromArgentName.cjs +1 -1
- package/dist/src/chains/starknet/getAddressFromArgentName.js +7 -7
- package/dist/src/chains/starknet/services/address/StarknetAddressService.cjs +1 -1
- package/dist/src/chains/starknet/services/address/StarknetAddressService.js +9 -9
- package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.cjs +1 -1
- package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.d.ts +1 -0
- package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.js +41 -31
- package/dist/src/features/paymaster/types.cjs +1 -1
- package/dist/src/features/paymaster/types.js +1 -1
- package/dist/src/features/simulation/activity/utils/index.d.ts +1 -0
- package/dist/src/features/simulation/activity/utils/isSwapActivity.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/isSwapActivity.js +28 -0
- package/dist/src/transactions/getTransactionVersion.cjs +1 -1
- package/dist/src/transactions/getTransactionVersion.js +5 -5
- package/dist/src/transactions/txv3.cjs +1 -1
- package/dist/src/transactions/txv3.js +4 -4
- package/package.json +1 -1
package/dist/simulation.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./src/features/simulation/activity/normalize.cjs"),t=require("./src/features/simulation/activity/schema.cjs"),c=require("./src/features/simulation/activity/utils/createNativeActivity.cjs"),m=require("./src/features/simulation/activity/utils/getAnyActivityTitle.cjs"),r=require("./src/features/simulation/activity/utils/getOverallLastModified.cjs"),n=require("./src/features/simulation/activity/utils/hasDelegationActivity.cjs"),S=require("./src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.cjs"),o=require("./src/features/simulation/activity/utils/isRejectOnChainActivity.cjs"),v=require("./src/features/simulation/activity/utils/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./src/features/simulation/activity/normalize.cjs"),t=require("./src/features/simulation/activity/schema.cjs"),c=require("./src/features/simulation/activity/utils/createNativeActivity.cjs"),m=require("./src/features/simulation/activity/utils/getAnyActivityTitle.cjs"),r=require("./src/features/simulation/activity/utils/getOverallLastModified.cjs"),n=require("./src/features/simulation/activity/utils/hasDelegationActivity.cjs"),S=require("./src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.cjs"),o=require("./src/features/simulation/activity/utils/isRejectOnChainActivity.cjs"),v=require("./src/features/simulation/activity/utils/isSwapActivity.cjs"),h=require("./src/features/simulation/activity/utils/isUpgradeActivity.cjs"),y=require("./src/features/simulation/activity/utils/parseAccountActivities.cjs"),A=require("./src/features/simulation/activity/utils/parseFinanceActivities.cjs"),i=require("./src/features/simulation/fees/schema.cjs"),l=require("./src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.cjs"),u=require("./src/features/simulation/transactionReview/getMessageFromSimulationError.cjs"),e=require("./src/features/simulation/transactionReview/schema.cjs"),s=require("./src/features/simulation/warning/schema.cjs"),d=require("./src/features/simulation/warning/helper.cjs");exports.normalizeActivitySummary=a.normalizeActivitySummary;exports.normalizeActivitySummaryCollection=a.normalizeActivitySummaryCollection;exports.NativeActivityStatusCancelled=t.NativeActivityStatusCancelled;exports.NativeActivityStatusQueued=t.NativeActivityStatusQueued;exports.NativeActivityStatusRejected=t.NativeActivityStatusRejected;exports.NativeActivityTypeNative=t.NativeActivityTypeNative;exports.activitiesSchema=t.activitiesSchema;exports.activityDappSchema=t.activityDappSchema;exports.activityDetailsSchema=t.activityDetailsSchema;exports.activityResponseSchema=t.activityResponseSchema;exports.activitySchema=t.activitySchema;exports.activitySummarySchema=t.activitySummarySchema;exports.activityTransferSchema=t.activityTransferSchema;exports.feeSchema=t.feeSchema;exports.isActivityDetailsAction=t.isActivityDetailsAction;exports.isActivitySummary=t.isActivitySummary;exports.isNftActivitySummary=t.isNftActivitySummary;exports.isTokenActivitySummary=t.isTokenActivitySummary;exports.nativeActivityMetaSchema=t.nativeActivityMetaSchema;exports.nativeActivitySchema=t.nativeActivitySchema;exports.createNativeActivity=c.createNativeActivity;exports.normalizeActions=c.normalizeActions;exports.getAnyActivityShortTitle=m.getAnyActivityShortTitle;exports.getAnyActivityTitle=m.getAnyActivityTitle;exports.getOverallLastModified=r.getOverallLastModified;exports.hasDelegationActivity=n.hasDelegationActivity;exports.isMulticallWithDeploymentActivity=S.isMulticallWithDeploymentActivity;exports.isRejectOnChainActivity=o.isRejectOnChainActivity;exports.isSwapActivity=v.isSwapActivity;exports.isUpgradeActivity=h.isUpgradeActivity;exports.parseAccountActivities=y.parseAccountActivities;exports.parseFinanceActivities=A.parseFinanceActivities;exports.estimatedFeeSchema=i.estimatedFeeSchema;exports.estimatedFeeV2Schema=i.estimatedFeeV2Schema;exports.estimatedFeesSchema=i.estimatedFeesSchema;exports.estimatedFeesV2Schema=i.estimatedFeesV2Schema;exports.feeEstimationResultV2Schema=i.feeEstimationResultV2Schema;exports.nativeEstimatedFeeSchema=i.nativeEstimatedFeeSchema;exports.nativeEstimatedFeesSchema=i.nativeEstimatedFeesSchema;exports.paymasterEstimatedFeeSchema=i.paymasterEstimatedFeeSchema;exports.paymasterEstimatedFeesSchema=i.paymasterEstimatedFeesSchema;exports.getErrorMessageAndLabelFromSimulation=l.getErrorMessageAndLabelFromSimulation;exports.getMessageFromSimulationError=u.getMessageFromSimulationError;exports.actionSchema=e.actionSchema;exports.assessmentSchema=e.assessmentSchema;exports.enrichedSimulateAndReviewSchema=e.enrichedSimulateAndReviewSchema;exports.enrichedSimulateAndReviewV2Schema=e.enrichedSimulateAndReviewV2Schema;exports.feeEstimationNativeOrPaymasterSchema=e.feeEstimationNativeOrPaymasterSchema;exports.feeEstimationSchema=e.feeEstimationSchema;exports.feeEstimationTxV1Schema=e.feeEstimationTxV1Schema;exports.feeEstimationTxV3Schema=e.feeEstimationTxV3Schema;exports.isNotTransactionSimulationError=e.isNotTransactionSimulationError;exports.isTransactionSimulationError=e.isTransactionSimulationError;exports.paymasterFeeEstimationSchema=e.paymasterFeeEstimationSchema;exports.paymasterFeeTokenSchema=e.paymasterFeeTokenSchema;exports.promotionSchema=e.promotionSchema;exports.promotionsSchema=e.promotionsSchema;exports.propertySchema=e.propertySchema;exports.reviewSchema=e.reviewSchema;exports.simulateAndReviewSchema=e.simulateAndReviewSchema;exports.subsidyStatusSchema=e.subsidyStatusSchema;exports.targetedDappSchema=e.targetedDappSchema;exports.warningDetailsSchema=e.warningDetailsSchema;exports.warningSchema=e.warningSchema;exports.reasonsSchema=s.reasonsSchema;exports.severitySchema=s.severitySchema;exports.getHighestSeverity=d.getHighestSeverity;
|
package/dist/simulation.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { normalizeActivitySummary as i, normalizeActivitySummaryCollection as a } from "./src/features/simulation/activity/normalize.js";
|
|
2
2
|
import { NativeActivityStatusCancelled as r, NativeActivityStatusQueued as c, NativeActivityStatusRejected as o, NativeActivityTypeNative as s, activitiesSchema as S, activityDappSchema as n, activityDetailsSchema as h, activityResponseSchema as v, activitySchema as y, activitySummarySchema as p, activityTransferSchema as A, feeSchema as l, isActivityDetailsAction as f, isActivitySummary as u, isNftActivitySummary as d, isTokenActivitySummary as x, nativeActivityMetaSchema as g, nativeActivitySchema as E } from "./src/features/simulation/activity/schema.js";
|
|
3
3
|
import { createNativeActivity as T, normalizeActions as N } from "./src/features/simulation/activity/utils/createNativeActivity.js";
|
|
4
|
-
import { getAnyActivityShortTitle as
|
|
4
|
+
import { getAnyActivityShortTitle as D, getAnyActivityTitle as R } from "./src/features/simulation/activity/utils/getAnyActivityTitle.js";
|
|
5
5
|
import { getOverallLastModified as M } from "./src/features/simulation/activity/utils/getOverallLastModified.js";
|
|
6
6
|
import { hasDelegationActivity as C } from "./src/features/simulation/activity/utils/hasDelegationActivity.js";
|
|
7
7
|
import { isMulticallWithDeploymentActivity as b } from "./src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.js";
|
|
8
8
|
import { isRejectOnChainActivity as k } from "./src/features/simulation/activity/utils/isRejectOnChainActivity.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
9
|
+
import { isSwapActivity as H } from "./src/features/simulation/activity/utils/isSwapActivity.js";
|
|
10
|
+
import { isUpgradeActivity as Q } from "./src/features/simulation/activity/utils/isUpgradeActivity.js";
|
|
11
|
+
import { parseAccountActivities as W } from "./src/features/simulation/activity/utils/parseAccountActivities.js";
|
|
12
|
+
import { parseFinanceActivities as B } from "./src/features/simulation/activity/utils/parseFinanceActivities.js";
|
|
13
|
+
import { estimatedFeeSchema as I, estimatedFeeV2Schema as J, estimatedFeesSchema as K, estimatedFeesV2Schema as X, feeEstimationResultV2Schema as Y, nativeEstimatedFeeSchema as Z, nativeEstimatedFeesSchema as _, paymasterEstimatedFeeSchema as $, paymasterEstimatedFeesSchema as ee } from "./src/features/simulation/fees/schema.js";
|
|
14
|
+
import { getErrorMessageAndLabelFromSimulation as ie } from "./src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.js";
|
|
15
|
+
import { getMessageFromSimulationError as me } from "./src/features/simulation/transactionReview/getMessageFromSimulationError.js";
|
|
16
|
+
import { actionSchema as ce, assessmentSchema as oe, enrichedSimulateAndReviewSchema as se, enrichedSimulateAndReviewV2Schema as Se, feeEstimationNativeOrPaymasterSchema as ne, feeEstimationSchema as he, feeEstimationTxV1Schema as ve, feeEstimationTxV3Schema as ye, isNotTransactionSimulationError as pe, isTransactionSimulationError as Ae, paymasterFeeEstimationSchema as le, paymasterFeeTokenSchema as fe, promotionSchema as ue, promotionsSchema as de, propertySchema as xe, reviewSchema as ge, simulateAndReviewSchema as Ee, subsidyStatusSchema as Fe, targetedDappSchema as Te, warningDetailsSchema as Ne, warningSchema as we } from "./src/features/simulation/transactionReview/schema.js";
|
|
17
|
+
import { reasonsSchema as Re, severitySchema as Ve } from "./src/features/simulation/warning/schema.js";
|
|
18
|
+
import { getHighestSeverity as ze } from "./src/features/simulation/warning/helper.js";
|
|
18
19
|
export {
|
|
19
20
|
r as NativeActivityStatusCancelled,
|
|
20
21
|
c as NativeActivityStatusQueued,
|
|
21
22
|
o as NativeActivityStatusRejected,
|
|
22
23
|
s as NativeActivityTypeNative,
|
|
23
|
-
|
|
24
|
+
ce as actionSchema,
|
|
24
25
|
S as activitiesSchema,
|
|
25
26
|
n as activityDappSchema,
|
|
26
27
|
h as activityDetailsSchema,
|
|
@@ -28,58 +29,59 @@ export {
|
|
|
28
29
|
y as activitySchema,
|
|
29
30
|
p as activitySummarySchema,
|
|
30
31
|
A as activityTransferSchema,
|
|
31
|
-
|
|
32
|
+
oe as assessmentSchema,
|
|
32
33
|
T as createNativeActivity,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
se as enrichedSimulateAndReviewSchema,
|
|
35
|
+
Se as enrichedSimulateAndReviewV2Schema,
|
|
36
|
+
I as estimatedFeeSchema,
|
|
37
|
+
J as estimatedFeeV2Schema,
|
|
38
|
+
K as estimatedFeesSchema,
|
|
39
|
+
X as estimatedFeesV2Schema,
|
|
40
|
+
ne as feeEstimationNativeOrPaymasterSchema,
|
|
41
|
+
Y as feeEstimationResultV2Schema,
|
|
42
|
+
he as feeEstimationSchema,
|
|
43
|
+
ve as feeEstimationTxV1Schema,
|
|
44
|
+
ye as feeEstimationTxV3Schema,
|
|
44
45
|
l as feeSchema,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
D as getAnyActivityShortTitle,
|
|
47
|
+
R as getAnyActivityTitle,
|
|
48
|
+
ie as getErrorMessageAndLabelFromSimulation,
|
|
49
|
+
ze as getHighestSeverity,
|
|
50
|
+
me as getMessageFromSimulationError,
|
|
50
51
|
M as getOverallLastModified,
|
|
51
52
|
C as hasDelegationActivity,
|
|
52
53
|
f as isActivityDetailsAction,
|
|
53
54
|
u as isActivitySummary,
|
|
54
55
|
b as isMulticallWithDeploymentActivity,
|
|
55
56
|
d as isNftActivitySummary,
|
|
56
|
-
|
|
57
|
+
pe as isNotTransactionSimulationError,
|
|
57
58
|
k as isRejectOnChainActivity,
|
|
59
|
+
H as isSwapActivity,
|
|
58
60
|
x as isTokenActivitySummary,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
Ae as isTransactionSimulationError,
|
|
62
|
+
Q as isUpgradeActivity,
|
|
61
63
|
g as nativeActivityMetaSchema,
|
|
62
64
|
E as nativeActivitySchema,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
Z as nativeEstimatedFeeSchema,
|
|
66
|
+
_ as nativeEstimatedFeesSchema,
|
|
65
67
|
N as normalizeActions,
|
|
66
68
|
i as normalizeActivitySummary,
|
|
67
69
|
a as normalizeActivitySummaryCollection,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
W as parseAccountActivities,
|
|
71
|
+
B as parseFinanceActivities,
|
|
72
|
+
$ as paymasterEstimatedFeeSchema,
|
|
73
|
+
ee as paymasterEstimatedFeesSchema,
|
|
74
|
+
le as paymasterFeeEstimationSchema,
|
|
75
|
+
fe as paymasterFeeTokenSchema,
|
|
76
|
+
ue as promotionSchema,
|
|
77
|
+
de as promotionsSchema,
|
|
78
|
+
xe as propertySchema,
|
|
79
|
+
Re as reasonsSchema,
|
|
80
|
+
ge as reviewSchema,
|
|
81
|
+
Ve as severitySchema,
|
|
82
|
+
Ee as simulateAndReviewSchema,
|
|
83
|
+
Fe as subsidyStatusSchema,
|
|
84
|
+
Te as targetedDappSchema,
|
|
85
|
+
Ne as warningDetailsSchema,
|
|
86
|
+
we as warningSchema
|
|
85
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("url-join"),s=require("zod"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("url-join"),s=require("zod"),o=require("../../errors/address.cjs"),m=require("./argentName.cjs"),d=require("./address.cjs"),w=require("../../http/HttpError.cjs"),E=s.z.object({walletAddress:d.addressSchemaArgentBackend,ens:m.argentNameSchema,chain:s.z.enum(["ethereum","starknet"]),deleted:s.z.boolean(),walletDeployed:s.z.boolean()}).or(s.z.object({status:s.z.string()}));async function N(t,n,a,c="starknet"){const i={ens:t,chain:c},l=new URLSearchParams(i),A=u(a,"wallet",`?${l}`);try{const e=await n.get(A),r=e&&"walletAddress"in e?e.walletAddress:void 0;if(!r)throw new o.AddressError({code:"NO_ADDRESS_FROM_ARGENT_NAME"});if(d.isZeroAddress(r))throw new o.AddressError({code:"ARGENT_NAME_NOT_FOUND",message:`${t} not found`});if(!d.isValidAddress(r))throw new o.AddressError({code:"ARGENT_NAME_INVALID_ADDRESS",message:`${t} resolved to an invalid address (${r})`});return d.normalizeAddress(r)}catch(e){throw e instanceof w.HttpError&&e.status===404?new o.AddressError({code:"ARGENT_NAME_NOT_FOUND",message:`${t} not found`}):e}}exports.apiWalletResponseSchema=E;exports.getAddressFromArgentName=N;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import m from "url-join";
|
|
2
2
|
import { z as s } from "zod";
|
|
3
|
-
import { addressSchemaArgentBackend as A, isZeroAddress as w, isValidAddress as f, normalizeAddress as N } from "./address.js";
|
|
4
|
-
import { argentNameSchema as h } from "./argentName.js";
|
|
5
3
|
import { AddressError as t } from "../../errors/address.js";
|
|
4
|
+
import { argentNameSchema as A } from "./argentName.js";
|
|
5
|
+
import { addressSchemaArgentBackend as w, isZeroAddress as f, isValidAddress as N, normalizeAddress as h } from "./address.js";
|
|
6
6
|
import { HttpError as _ } from "../../http/HttpError.js";
|
|
7
7
|
const O = s.object({
|
|
8
|
-
walletAddress:
|
|
9
|
-
ens:
|
|
8
|
+
walletAddress: w,
|
|
9
|
+
ens: A,
|
|
10
10
|
chain: s.enum(["ethereum", "starknet"]),
|
|
11
11
|
deleted: s.boolean(),
|
|
12
12
|
walletDeployed: s.boolean()
|
|
@@ -24,17 +24,17 @@ async function T(o, n, a, d = "starknet") {
|
|
|
24
24
|
throw new t({
|
|
25
25
|
code: "NO_ADDRESS_FROM_ARGENT_NAME"
|
|
26
26
|
});
|
|
27
|
-
if (
|
|
27
|
+
if (f(r))
|
|
28
28
|
throw new t({
|
|
29
29
|
code: "ARGENT_NAME_NOT_FOUND",
|
|
30
30
|
message: `${o} not found`
|
|
31
31
|
});
|
|
32
|
-
if (!
|
|
32
|
+
if (!N(r))
|
|
33
33
|
throw new t({
|
|
34
34
|
code: "ARGENT_NAME_INVALID_ADDRESS",
|
|
35
35
|
message: `${o} resolved to an invalid address (${r})`
|
|
36
36
|
});
|
|
37
|
-
return
|
|
37
|
+
return h(r);
|
|
38
38
|
} catch (e) {
|
|
39
39
|
throw e instanceof _ && e.status === 404 ? new t({
|
|
40
40
|
code: "ARGENT_NAME_NOT_FOUND",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../errors/address.cjs"),d=require("../../address.cjs"),a=require("../../starknetId.cjs"),o=require("../../getAddressFromStarkName.cjs"),n=require("../../argentName.cjs"),i=require("../../getAddressFromArgentName.cjs");class A{constructor(e,r,t){this.httpService=e,this.baseUrl=r,this.allowedArgentNameNetworkId=t}async parseAddressOrDomain(e,r,t){if(d.isAddress(e))return d.normalizeAddress(e);try{return await this.getAddressFromDomainName(e,r,t)}catch{throw new s.AddressError({code:"NOT_VALID"})}}async getAddressFromDomainName(e,r,t){if(a.isStarknetId(e))return o.getAddressFromStarkName(e,r,t);if(n.isArgentName(e)){if(r!==this.allowedArgentNameNetworkId)throw new s.AddressError({code:"ARGENT_NAME_INVALID_NETWORK",message:`Argent name is only enabled on "${this.allowedArgentNameNetworkId}"`});return i.getAddressFromArgentName(e,this.httpService,this.baseUrl)}throw new s.AddressError({code:"NO_ADDRESS_FROM_DOMAIN"})}}exports.StarknetAddressService=A;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { isAddress as o, normalizeAddress as i } from "../../address.js";
|
|
2
|
-
import { isArgentName as m } from "../../argentName.js";
|
|
3
|
-
import { getAddressFromArgentName as a } from "../../getAddressFromArgentName.js";
|
|
4
|
-
import { getAddressFromStarkName as d } from "../../getAddressFromStarkName.js";
|
|
5
|
-
import { isStarknetId as n } from "../../starknetId.js";
|
|
6
1
|
import { AddressError as s } from "../../../../errors/address.js";
|
|
2
|
+
import { isAddress as o, normalizeAddress as i } from "../../address.js";
|
|
3
|
+
import { isStarknetId as m } from "../../starknetId.js";
|
|
4
|
+
import { getAddressFromStarkName as a } from "../../getAddressFromStarkName.js";
|
|
5
|
+
import { isArgentName as d } from "../../argentName.js";
|
|
6
|
+
import { getAddressFromArgentName as n } from "../../getAddressFromArgentName.js";
|
|
7
7
|
class p {
|
|
8
8
|
constructor(e, r, t) {
|
|
9
9
|
this.httpService = e, this.baseUrl = r, this.allowedArgentNameNetworkId = t;
|
|
@@ -18,15 +18,15 @@ class p {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
async getAddressFromDomainName(e, r, t) {
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
23
|
-
if (
|
|
21
|
+
if (m(e))
|
|
22
|
+
return a(e, r, t);
|
|
23
|
+
if (d(e)) {
|
|
24
24
|
if (r !== this.allowedArgentNameNetworkId)
|
|
25
25
|
throw new s({
|
|
26
26
|
code: "ARGENT_NAME_INVALID_NETWORK",
|
|
27
27
|
message: `Argent name is only enabled on "${this.allowedArgentNameNetworkId}"`
|
|
28
28
|
});
|
|
29
|
-
return
|
|
29
|
+
return n(e, this.httpService, this.baseUrl);
|
|
30
30
|
}
|
|
31
31
|
throw new s({
|
|
32
32
|
code: "NO_ADDRESS_FROM_DOMAIN"
|
|
@@ -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("../../../../../_virtual/semver.cjs"),a=require("../../address.cjs"),e=require("./constants.cjs");function c(t){for(const[A,s]of Object.entries(e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES))if(a.isEqualAddress(s,t))return A;for(const[A,s]of Object.entries(e.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES))if(a.isEqualAddress(s,t))return A}function C(t){const A=Object.entries(e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES),s=Object.entries(e.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES);switch(t){case"cairo0":return A.filter(([n])=>r.default.lt(n,"0.3.0")).map(([,n])=>n);case"cairo1":return A.filter(([n])=>r.default.gte(n,"0.3.0")).map(([,n])=>n);case"multisig":return s.map(([,n])=>n);default:return A.map(([,n])=>n)}}function o(){const t=r.default.maxSatisfying(Object.keys(e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES),"*");if(!t)throw new Error(`No argent account contract found: v${t} `);return e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES[t]}function S(){const t=r.default.maxSatisfying(Object.keys(e.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES),"*");if(!t)throw new Error(`No argent multisig contract found: v${t} `);return e.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES[t]}function u(){return Object.entries(e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES).filter(([t])=>r.default.gte(t,"0.4.0")).map(([,t])=>t)}function i(){const t=r.default.maxSatisfying(Object.keys(e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES),"<0.3.0");if(!t)throw new Error(`No argent account contract found: v${t} `);return e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES[t]}function T(){const t=Object.entries(e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES).filter(([s])=>r.default.gte(s,"0.3.1")).map(([,s])=>s),A=Object.entries(e.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES).filter(([s])=>r.default.gte(s,"0.1.1")).map(([,s])=>s);return[...t,...A]}function _(){return Object.entries(e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES).filter(([t])=>r.default.gte(t,"0.4.0")).map(([,t])=>t)}function g(){const t=r.default.maxSatisfying(Object.keys(e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES),">=0.4.0");if(!t)throw new Error(`No ledger account contract found: v${t}`);return e.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES[t]}exports.getAccountVersionByClasshash=c;exports.getArgentAccountClassHashes=C;exports.getArgentAccountClassHashesWithTxV3Support=T;exports.getArgentAccountWithMultiSignerClassHashes=u;exports.getLastCairo0ArgentAccountClassHash=i;exports.getLatestArgentAccountClassHash=o;exports.getLatestArgentMultisigClassHash=S;exports.getLatestLedgerAccountClassHash=g;exports.getLedgerAccountClassHashes=_;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function getAccountVersionByClasshash(classHash: string): string | undefined;
|
|
1
2
|
export declare function getArgentAccountClassHashes(type: "cairo0" | "cairo1" | "multisig" | "all"): ("0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003" | "0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f" | "0x033434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2" | "0x1a7820094feaf82d53f53f214b81292d717e7bb9a92bb2488092cd306f3993f" | "0x3e327de1c40540b98d05cbcb13552008e36f0ec8d61d46956d2f9752c294328" | "0x7e28fb0161d10d1cf7fe1f13e7ca57bce062731a3bd04494dfd2d0412699727" | "0x29927c8af6bccf3f6fda035981e765a7bdbf18a2dc0d630494f8758aa908e2b")[] | ("0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48" | "0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72")[];
|
|
2
3
|
export declare function getLatestArgentAccountClassHash(): "0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003" | "0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f" | "0x033434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2" | "0x1a7820094feaf82d53f53f214b81292d717e7bb9a92bb2488092cd306f3993f" | "0x3e327de1c40540b98d05cbcb13552008e36f0ec8d61d46956d2f9752c294328" | "0x7e28fb0161d10d1cf7fe1f13e7ca57bce062731a3bd04494dfd2d0412699727" | "0x29927c8af6bccf3f6fda035981e765a7bdbf18a2dc0d630494f8758aa908e2b";
|
|
3
4
|
export declare function getLatestArgentMultisigClassHash(): "0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48" | "0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72";
|
|
@@ -1,59 +1,69 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import s from "../../../../../_virtual/semver.js";
|
|
2
|
+
import { isEqualAddress as i } from "../../address.js";
|
|
3
|
+
import { ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES as r, ARGENT_MULTISIG_CONTRACT_CLASS_HASHES as o } from "./constants.js";
|
|
4
|
+
function g(t) {
|
|
5
|
+
for (const [c, e] of Object.entries(r))
|
|
6
|
+
if (i(e, t))
|
|
7
|
+
return c;
|
|
8
|
+
for (const [c, e] of Object.entries(o))
|
|
9
|
+
if (i(e, t))
|
|
10
|
+
return c;
|
|
11
|
+
}
|
|
12
|
+
function l(t) {
|
|
13
|
+
const c = Object.entries(r), e = Object.entries(o);
|
|
5
14
|
switch (t) {
|
|
6
15
|
case "cairo0":
|
|
7
|
-
return c.filter(([
|
|
16
|
+
return c.filter(([n]) => s.lt(n, "0.3.0")).map(([, n]) => n);
|
|
8
17
|
case "cairo1":
|
|
9
|
-
return c.filter(([
|
|
18
|
+
return c.filter(([n]) => s.gte(n, "0.3.0")).map(([, n]) => n);
|
|
10
19
|
case "multisig":
|
|
11
|
-
return
|
|
20
|
+
return e.map(([, n]) => n);
|
|
12
21
|
default:
|
|
13
|
-
return c.map(([,
|
|
22
|
+
return c.map(([, n]) => n);
|
|
14
23
|
}
|
|
15
24
|
}
|
|
16
|
-
function
|
|
17
|
-
const t =
|
|
25
|
+
function A() {
|
|
26
|
+
const t = s.maxSatisfying(Object.keys(r), "*");
|
|
18
27
|
if (!t)
|
|
19
28
|
throw new Error(`No argent account contract found: v${t} `);
|
|
20
29
|
return r[t];
|
|
21
30
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
31
|
+
function m() {
|
|
32
|
+
const t = s.maxSatisfying(Object.keys(o), "*");
|
|
24
33
|
if (!t)
|
|
25
34
|
throw new Error(`No argent multisig contract found: v${t} `);
|
|
26
|
-
return
|
|
35
|
+
return o[t];
|
|
27
36
|
}
|
|
28
|
-
function
|
|
29
|
-
return Object.entries(r).filter(([t]) =>
|
|
37
|
+
function h() {
|
|
38
|
+
return Object.entries(r).filter(([t]) => s.gte(t, "0.4.0")).map(([, t]) => t);
|
|
30
39
|
}
|
|
31
|
-
function
|
|
32
|
-
const t =
|
|
40
|
+
function C() {
|
|
41
|
+
const t = s.maxSatisfying(Object.keys(r), "<0.3.0");
|
|
33
42
|
if (!t)
|
|
34
43
|
throw new Error(`No argent account contract found: v${t} `);
|
|
35
44
|
return r[t];
|
|
36
45
|
}
|
|
37
|
-
function
|
|
38
|
-
const t = Object.entries(r).filter(([
|
|
46
|
+
function O() {
|
|
47
|
+
const t = Object.entries(r).filter(([e]) => s.gte(e, "0.3.1")).map(([, e]) => e), c = Object.entries(o).filter(([e]) => s.gte(e, "0.1.1")).map(([, e]) => e);
|
|
39
48
|
return [...t, ...c];
|
|
40
49
|
}
|
|
41
|
-
function
|
|
42
|
-
return Object.entries(r).filter(([t]) =>
|
|
50
|
+
function S() {
|
|
51
|
+
return Object.entries(r).filter(([t]) => s.gte(t, "0.4.0")).map(([, t]) => t);
|
|
43
52
|
}
|
|
44
|
-
function
|
|
45
|
-
const t =
|
|
53
|
+
function p() {
|
|
54
|
+
const t = s.maxSatisfying(Object.keys(r), ">=0.4.0");
|
|
46
55
|
if (!t)
|
|
47
56
|
throw new Error(`No ledger account contract found: v${t}`);
|
|
48
57
|
return r[t];
|
|
49
58
|
}
|
|
50
59
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
g as getAccountVersionByClasshash,
|
|
61
|
+
l as getArgentAccountClassHashes,
|
|
62
|
+
O as getArgentAccountClassHashesWithTxV3Support,
|
|
63
|
+
h as getArgentAccountWithMultiSignerClassHashes,
|
|
64
|
+
C as getLastCairo0ArgentAccountClassHash,
|
|
65
|
+
A as getLatestArgentAccountClassHash,
|
|
66
|
+
m as getLatestArgentMultisigClassHash,
|
|
67
|
+
p as getLatestLedgerAccountClassHash,
|
|
68
|
+
S as getLedgerAccountClassHashes
|
|
59
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),t=require("../../
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),t=require("../../utils/starknet/starknet.cjs"),e=require("../../backend/schema.cjs"),r=require("../../chains/starknet/address.cjs"),s=a.z.object({calls:a.z.array(t.callSchema),accountAddress:r.addressSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),feeTokenAddress:r.addressSchema,maxFee:t.bigNumberishSchema,accountClassHash:a.z.string().optional()}),o=a.z.object({signature:a.z.string().array(),accountAddress:r.addressSchema,typedData:t.typedDataSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),deploymentData:a.z.object({class_hash:a.z.string().optional(),salt:a.z.string().or(a.z.number()).or(a.z.bigint()).optional(),unique:a.z.string(),calldata:a.z.array(a.z.string())}).optional()}),n=a.z.object({transactionHash:a.z.string()});exports.paymasterExecuteParams=o;exports.paymasterExecuteResponse=n;exports.paymasterExecutionDataParams=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as a } from "zod";
|
|
2
|
-
import { addressSchema as t } from "../../chains/starknet/address.js";
|
|
3
2
|
import { bigNumberishSchema as o, callSchema as s, typedDataSchema as n } from "../../utils/starknet/starknet.js";
|
|
4
3
|
import { argentNetworkIdSchema as e, argentBackendNetworkIdSchema as r } from "../../backend/schema.js";
|
|
4
|
+
import { addressSchema as t } from "../../chains/starknet/address.js";
|
|
5
5
|
const d = a.object({
|
|
6
6
|
calls: a.array(s),
|
|
7
7
|
accountAddress: t,
|
|
@@ -4,6 +4,7 @@ export * from './getOverallLastModified';
|
|
|
4
4
|
export * from './hasDelegationActivity';
|
|
5
5
|
export * from './isMulticallWithDeploymentActivity';
|
|
6
6
|
export * from './isRejectOnChainActivity';
|
|
7
|
+
export * from './isSwapActivity';
|
|
7
8
|
export * from './isUpgradeActivity';
|
|
8
9
|
export * from './parseAccountActivities';
|
|
9
10
|
export * from './parseFinanceActivities';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function u(e){const t=l(e),s=o(e);return t||s}const l=e=>{var s;if(!((s=e.actions)!=null&&s.length))return!1;const t=["multi_route_swap","Jediswap_swap","Avnu_swap","multi_multihop_swap"];return e.actions.some(a=>{var n;return t.includes(a.name)?((n=a.defaultProperties)==null?void 0:n.some(i=>{var r;return i.type==="calldata"&&((r=i.entrypoint)==null?void 0:r.toLowerCase().includes("swap"))}))??!1:!1})},o=e=>{var t,s;return!!("meta"in e&&(s=(t=e.meta)==null?void 0:t.title)!=null&&s.includes("Swap"))};exports.isSwapActivity=u;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function o(e) {
|
|
2
|
+
const t = u(e), s = p(e);
|
|
3
|
+
return t || s;
|
|
4
|
+
}
|
|
5
|
+
const u = (e) => {
|
|
6
|
+
var s;
|
|
7
|
+
if (!((s = e.actions) != null && s.length))
|
|
8
|
+
return !1;
|
|
9
|
+
const t = [
|
|
10
|
+
"multi_route_swap",
|
|
11
|
+
"Jediswap_swap",
|
|
12
|
+
"Avnu_swap",
|
|
13
|
+
"multi_multihop_swap"
|
|
14
|
+
];
|
|
15
|
+
return e.actions.some((a) => {
|
|
16
|
+
var n;
|
|
17
|
+
return t.includes(a.name) ? ((n = a.defaultProperties) == null ? void 0 : n.some((i) => {
|
|
18
|
+
var r;
|
|
19
|
+
return i.type === "calldata" && ((r = i.entrypoint) == null ? void 0 : r.toLowerCase().includes("swap"));
|
|
20
|
+
})) ?? !1 : !1;
|
|
21
|
+
});
|
|
22
|
+
}, p = (e) => {
|
|
23
|
+
var t, s;
|
|
24
|
+
return !!("meta" in e && (s = (t = e.meta) == null ? void 0 : t.title) != null && s.includes("Swap"));
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
o as isSwapActivity
|
|
28
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("starknet"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("starknet"),s=require("./txv3.cjs"),r=require("../chains/starknet/constants.cjs"),o=require("../chains/starknet/address.cjs");function T(e){return o.isEqualAddress(e,r.ETH_TOKEN_ADDRESS)?t.constants.TRANSACTION_VERSION.V1:t.constants.TRANSACTION_VERSION.V3}function c(e){return o.isEqualAddress(e,r.ETH_TOKEN_ADDRESS)?t.constants.TRANSACTION_VERSION.F1:t.constants.TRANSACTION_VERSION.F3}function N(e,n){return t.isSierra(n.contract)?o.isEqualAddress(e,r.ETH_TOKEN_ADDRESS)?t.constants.TRANSACTION_VERSION.V2:t.constants.TRANSACTION_VERSION.V3:t.constants.TRANSACTION_VERSION.V1}const S=({classHash:e})=>e&&!s.classHashSupportsTxV3(e)?t.constants.TRANSACTION_VERSION.V1:t.constants.TRANSACTION_VERSION.V3,a=({classHash:e},n)=>t.isSierra(n.contract)?e&&!s.classHashSupportsTxV3(e)?t.constants.TRANSACTION_VERSION.V2:t.constants.TRANSACTION_VERSION.V3:t.constants.TRANSACTION_VERSION.V1;exports.getAccountTxVersion=S;exports.getSimulationTxVersionFromFeeToken=c;exports.getTxVersionForDeclareContract=a;exports.getTxVersionFromFeeToken=T;exports.getTxVersionFromFeeTokenForDeclareContract=N;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { constants as r, isSierra as e } from "starknet";
|
|
2
|
-
import { isEqualAddress as o } from "../chains/starknet/address.js";
|
|
3
|
-
import { ETH_TOKEN_ADDRESS as T } from "../chains/starknet/constants.js";
|
|
4
2
|
import { classHashSupportsTxV3 as n } from "./txv3.js";
|
|
3
|
+
import { ETH_TOKEN_ADDRESS as o } from "../chains/starknet/constants.js";
|
|
4
|
+
import { isEqualAddress as T } from "../chains/starknet/address.js";
|
|
5
5
|
function R(N) {
|
|
6
|
-
return
|
|
6
|
+
return T(N, o) ? r.TRANSACTION_VERSION.V1 : r.TRANSACTION_VERSION.V3;
|
|
7
7
|
}
|
|
8
8
|
function I(N) {
|
|
9
|
-
return
|
|
9
|
+
return T(N, o) ? r.TRANSACTION_VERSION.F1 : r.TRANSACTION_VERSION.F3;
|
|
10
10
|
}
|
|
11
11
|
function i(N, t) {
|
|
12
|
-
return e(t.contract) ?
|
|
12
|
+
return e(t.contract) ? T(N, o) ? r.TRANSACTION_VERSION.V2 : r.TRANSACTION_VERSION.V3 : r.TRANSACTION_VERSION.V1;
|
|
13
13
|
}
|
|
14
14
|
const E = ({ classHash: N }) => N && !n(N) ? r.TRANSACTION_VERSION.V1 : r.TRANSACTION_VERSION.V3, c = ({ classHash: N }, t) => e(t.contract) ? N && !n(N) ? r.TRANSACTION_VERSION.V2 : r.TRANSACTION_VERSION.V3 : r.TRANSACTION_VERSION.V1;
|
|
15
15
|
export {
|
|
@@ -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("../chains/starknet/services/deploymentData/getAccountClassHash.cjs"),o=require("../chains/starknet/constants.cjs"),t=require("../chains/starknet/address.cjs"),u=[o.STRK_TOKEN_ADDRESS];function n({address:e}){return u.some(s=>t.isEqualAddress(e,s))}function a(e){return e?r.getArgentAccountClassHashesWithTxV3Support().some(s=>t.isEqualAddress(s,e)):!1}exports.classHashSupportsTxV3=a;exports.feeTokenNeedsTxV3Support=n;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { getArgentAccountClassHashesWithTxV3Support as t } from "../chains/starknet/services/deploymentData/getAccountClassHash.js";
|
|
2
|
+
import { STRK_TOKEN_ADDRESS as s } from "../chains/starknet/constants.js";
|
|
1
3
|
import { isEqualAddress as o } from "../chains/starknet/address.js";
|
|
2
|
-
|
|
3
|
-
import { getArgentAccountClassHashesWithTxV3Support as s } from "../chains/starknet/services/deploymentData/getAccountClassHash.js";
|
|
4
|
-
const n = [t];
|
|
4
|
+
const n = [s];
|
|
5
5
|
function f({ address: r }) {
|
|
6
6
|
return n.some((e) => o(r, e));
|
|
7
7
|
}
|
|
8
8
|
function m(r) {
|
|
9
|
-
return r ?
|
|
9
|
+
return r ? t().some((e) => o(e, r)) : !1;
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
12
|
m as classHashSupportsTxV3,
|