@argent/x-shared 1.75.2 → 1.75.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/features/paymaster/types.cjs +1 -1
- package/dist/src/features/paymaster/types.js +1 -1
- package/dist/src/features/simulation/activity/normalize.cjs +1 -1
- package/dist/src/features/simulation/activity/normalize.js +4 -4
- package/dist/src/features/simulation/transactionReview/schema.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/schema.d.ts +12 -6
- package/dist/src/features/simulation/transactionReview/schema.js +17 -14
- package/dist/src/transactions/txv3.cjs +1 -1
- package/dist/src/transactions/txv3.js +4 -4
- package/package.json +3 -3
|
@@ -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 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,
|
|
@@ -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"),c=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:e.currency||"USD",currencyAmount:e.ccyValue||"0"}},sent:n};return t.activitySummarySchema.parse(i)};exports.normalizeActivitySummary=o;exports.normalizeActivitySummaryCollection=c;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isActivitySummary as r, activitySummarySchema as n } from "./schema.js";
|
|
2
|
-
const l = (e) => e.map(
|
|
2
|
+
const l = (e) => e.map(c), c = (e) => {
|
|
3
3
|
if (r(e))
|
|
4
4
|
return n.parse(e);
|
|
5
5
|
const t = !!e.sent;
|
|
@@ -25,8 +25,8 @@ const l = (e) => e.map(a), a = (e) => {
|
|
|
25
25
|
tokenAddress: e.token.address,
|
|
26
26
|
amount: e.value,
|
|
27
27
|
fiatAmount: {
|
|
28
|
-
currency: "USD",
|
|
29
|
-
currencyAmount: e.
|
|
28
|
+
currency: e.currency || "USD",
|
|
29
|
+
currencyAmount: e.ccyValue || "0"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
sent: t
|
|
@@ -34,6 +34,6 @@ const l = (e) => e.map(a), a = (e) => {
|
|
|
34
34
|
return n.parse(o);
|
|
35
35
|
};
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
c as normalizeActivitySummary,
|
|
38
38
|
l as normalizeActivitySummaryCollection
|
|
39
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),d=require("../warning/schema.cjs"),B=require("../fees/schema.cjs"),t=require("../../../chains/starknet/address.cjs"),D=e.z.object({name:e.z.string(),url:e.z.string(),position:e.z.number()}),i=e.z.object({address:e.z.string(),name:e.z.string(),symbol:e.z.string().optional(),decimals:e.z.number().optional(),unknown:e.z.boolean(),iconUrl:e.z.string().optional(),type:e.z.string()}),s=e.z.discriminatedUnion("type",[e.z.object({type:e.z.literal("amount"),label:e.z.string(),token:i,amount:e.z.string(),usd:e.z.string(),editable:e.z.boolean()}),e.z.object({type:e.z.literal("address"),label:e.z.string(),address:e.z.string(),addressName:e.z.string().optional(),verified:e.z.boolean().optional()}),e.z.object({type:e.z.literal("timestamp"),label:e.z.string(),value:e.z.string()}),e.z.object({type:e.z.literal("token_address"),label:e.z.string(),token:i}),e.z.object({type:e.z.literal("calldata"),label:e.z.string(),entrypoint:e.z.string(),calldata:e.z.array(e.z.string())}),e.z.object({type:e.z.literal("class_hash"),label:e.z.string(),classHash:e.z.string()}),e.z.object({type:e.z.literal("text"),label:e.z.string(),text:e.z.string()}),e.z.object({type:e.z.literal("nft"),label:e.z.string(),token:i})]),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),d=require("../warning/schema.cjs"),B=require("../fees/schema.cjs"),t=require("../../../chains/starknet/address.cjs"),D=e.z.object({name:e.z.string(),url:e.z.string(),position:e.z.number()}),i=e.z.object({address:e.z.string(),name:e.z.string(),symbol:e.z.string().optional(),decimals:e.z.number().optional(),unknown:e.z.boolean(),iconUrl:e.z.string().optional(),type:e.z.string()}),s=e.z.discriminatedUnion("type",[e.z.object({type:e.z.literal("amount"),label:e.z.string(),token:i,amount:e.z.string(),usd:e.z.string(),editable:e.z.boolean()}),e.z.object({type:e.z.literal("address"),label:e.z.string(),address:e.z.string(),addressName:e.z.string().optional(),verified:e.z.boolean().optional()}),e.z.object({type:e.z.literal("timestamp"),label:e.z.string(),value:e.z.string()}),e.z.object({type:e.z.literal("token_address"),label:e.z.string(),token:i}),e.z.object({type:e.z.literal("calldata"),label:e.z.string(),entrypoint:e.z.string(),calldata:e.z.array(e.z.string())}),e.z.object({type:e.z.literal("class_hash"),label:e.z.string(),classHash:e.z.string()}),e.z.object({type:e.z.literal("text"),label:e.z.string(),text:e.z.string()}),e.z.object({type:e.z.literal("nft"),label:e.z.string(),token:i})]),g=e.z.object({name:e.z.string(),properties:e.z.array(s),defaultProperties:e.z.array(s).optional()}),u=e.z.union([e.z.literal("verified"),e.z.literal("neutral"),e.z.literal("partial"),e.z.literal("warn")]),b=e.z.object({unknown_token:e.z.unknown().optional(),date_of_addition:e.z.string().optional(),contract_address:t.addressSchema.optional(),reason:e.z.string().optional(),value:e.z.any().optional()}),r=e.z.object({reason:d.reasonsSchema,details:b.optional(),severity:d.severitySchema}),S=e.z.object({assessment:u,warnings:e.z.array(r).optional(),assessmentReasons:e.z.array(e.z.string()).optional(),assessmentDetails:e.z.object({contract_address:e.z.string()}).optional(),action:g}),h=e.z.object({name:e.z.string(),description:e.z.string(),logoUrl:e.z.string().optional(),iconUrl:e.z.string().optional(),argentVerified:e.z.boolean(),links:e.z.array(D)}),y=e.z.object({assessment:e.z.union([e.z.literal("verified"),e.z.literal("neutral"),e.z.literal("partial"),e.z.literal("warn")]),warnings:e.z.array(r).optional(),assessmentDetails:e.z.object({contract_address:e.z.string()}).optional(),targetedDapp:h.optional(),reviews:e.z.array(S)}).optional(),j=e.z.object({banner:e.z.string().nullable().optional(),preview:e.z.string().nullable().optional(),full:e.z.string().nullable().optional(),original:e.z.string().nullable().optional()}),F=e.z.object({twitter:e.z.string().optional(),external:e.z.string().optional(),discord:e.z.string().optional()}),l=e.z.object({address:t.addressSchemaArgentBackend,decimals:e.z.number().optional(),symbol:e.z.string().optional(),name:e.z.string(),description:e.z.string().optional(),type:e.z.string().optional(),usdValue:e.z.string().optional(),iconUrl:e.z.string().optional(),unknown:e.z.boolean().optional(),imageUrls:j.optional(),links:F.optional()}),U=e.z.object({tokenAddress:t.addressSchemaArgentBackend,owner:t.addressSchemaArgentBackend,spender:t.addressSchemaArgentBackend,value:e.z.string().optional(),approvalForAll:e.z.boolean(),details:l.optional()}),R=e.z.object({tokenAddress:t.addressSchemaArgentBackend,from:t.addressSchemaArgentBackend,to:t.addressSchemaArgentBackend,tokenId:e.z.string().optional(),value:e.z.string().optional(),details:l.optional()}),n=e.z.union([e.z.string(),e.z.number(),e.z.bigint()]).transform(a=>parseInt(a.toString(),10)),c=e.z.object({address:t.addressSchemaArgentBackend,unknown:e.z.boolean(),type:e.z.literal("ERC20")}),o=e.z.object({maxAmount:n,maxPricePerUnit:n}),f=e.z.object({l1Gas:o,l1DataGas:o,l2Gas:o}),k=e.z.object({token:c,overallFee:n,maxFee:n,defaultTip:n.optional()}),z=e.z.object({overallFee:n,resourceBounds:f,unit:e.z.string().transform(a=>a.toUpperCase()).pipe(e.z.literal("FRI")),token:c,defaultTip:n.optional()}),v=z.or(k),N=e.z.object({type:e.z.string(),label:e.z.string(),tokenId:e.z.string().optional(),value:e.z.string().optional(),token:l,sent:e.z.boolean().optional(),ccyValue:e.z.string().optional(),currency:e.z.string().optional(),tokenIdDetails:e.z.object({name:e.z.string().optional(),description:e.z.string().optional(),imageUrls:j.optional()}).optional()}),P=e.z.object({approvals:e.z.array(U).optional(),transfers:e.z.array(R).optional(),calculatedNonce:e.z.string().optional(),feeEstimation:z,feeEstimations:e.z.array(v),summary:e.z.array(N).optional()}),_=e.z.object({label:e.z.string().optional(),code:e.z.number().optional(),message:e.z.string().optional(),error:e.z.string().optional()}),w=e.z.object({reviewOfTransaction:y,simulation:P,simulationError:e.z.undefined().optional()}),E=e.z.object({reviewOfTransaction:y,simulation:e.z.undefined().optional(),simulationError:_}),A=w.or(E),m=e.z.object({subsidiseDeployment:e.z.boolean(),subsidiseTransaction:e.z.boolean()}),T=e.z.object({name:e.z.string().optional(),shouldShow:e.z.boolean().optional()}),p=e.z.array(T),O=e.z.object({transactions:e.z.array(A).optional(),canSubsidise:e.z.boolean().optional(),subsidyStatus:m.optional(),promotions:p.optional()}),x=e.z.object({transactions:e.z.array(A).optional(),canSubsidise:e.z.boolean().optional(),subsidyStatus:m.optional(),enrichedFeeEstimation:e.z.array(B.estimatedFeesSchema).optional(),isBackendDown:e.z.boolean().default(!1).optional(),promotions:p.optional()});function G(a){return w.safeParse(a).success}function I(a){return E.safeParse(a).success}exports.actionSchema=g;exports.assessmentSchema=u;exports.enrichedSimulateAndReviewSchema=x;exports.feeEstimationGasSchema=o;exports.feeEstimationNativeOrPaymasterSchema=v;exports.feeEstimationResourceBoundSchema=f;exports.feeEstimationSchema=z;exports.isNotTransactionSimulationError=G;exports.isTransactionSimulationError=I;exports.paymasterFeeEstimationSchema=k;exports.paymasterFeeTokenSchema=c;exports.promotionSchema=T;exports.promotionsSchema=p;exports.propertySchema=s;exports.reviewSchema=S;exports.simulateAndReviewSchema=O;exports.subsidyStatusSchema=m;exports.targetedDappSchema=h;exports.warningDetailsSchema=b;exports.warningSchema=r;
|
|
@@ -640,7 +640,6 @@ declare const summarySchema: z.ZodObject<{
|
|
|
640
640
|
label: z.ZodString;
|
|
641
641
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
642
642
|
value: z.ZodOptional<z.ZodString>;
|
|
643
|
-
usdValue: z.ZodOptional<z.ZodString>;
|
|
644
643
|
token: z.ZodObject<{
|
|
645
644
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
646
645
|
decimals: z.ZodOptional<z.ZodNumber>;
|
|
@@ -664,6 +663,8 @@ declare const summarySchema: z.ZodObject<{
|
|
|
664
663
|
}, z.core.$strip>>;
|
|
665
664
|
}, z.core.$strip>;
|
|
666
665
|
sent: z.ZodOptional<z.ZodBoolean>;
|
|
666
|
+
ccyValue: z.ZodOptional<z.ZodString>;
|
|
667
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
667
668
|
tokenIdDetails: z.ZodOptional<z.ZodObject<{
|
|
668
669
|
name: z.ZodOptional<z.ZodString>;
|
|
669
670
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -797,7 +798,6 @@ declare const simulationSchema: z.ZodObject<{
|
|
|
797
798
|
label: z.ZodString;
|
|
798
799
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
799
800
|
value: z.ZodOptional<z.ZodString>;
|
|
800
|
-
usdValue: z.ZodOptional<z.ZodString>;
|
|
801
801
|
token: z.ZodObject<{
|
|
802
802
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
803
803
|
decimals: z.ZodOptional<z.ZodNumber>;
|
|
@@ -821,6 +821,8 @@ declare const simulationSchema: z.ZodObject<{
|
|
|
821
821
|
}, z.core.$strip>>;
|
|
822
822
|
}, z.core.$strip>;
|
|
823
823
|
sent: z.ZodOptional<z.ZodBoolean>;
|
|
824
|
+
ccyValue: z.ZodOptional<z.ZodString>;
|
|
825
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
824
826
|
tokenIdDetails: z.ZodOptional<z.ZodObject<{
|
|
825
827
|
name: z.ZodOptional<z.ZodString>;
|
|
826
828
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1138,7 +1140,6 @@ declare const transactionSimulationSchema: z.ZodObject<{
|
|
|
1138
1140
|
label: z.ZodString;
|
|
1139
1141
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
1140
1142
|
value: z.ZodOptional<z.ZodString>;
|
|
1141
|
-
usdValue: z.ZodOptional<z.ZodString>;
|
|
1142
1143
|
token: z.ZodObject<{
|
|
1143
1144
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
1144
1145
|
decimals: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1162,6 +1163,8 @@ declare const transactionSimulationSchema: z.ZodObject<{
|
|
|
1162
1163
|
}, z.core.$strip>>;
|
|
1163
1164
|
}, z.core.$strip>;
|
|
1164
1165
|
sent: z.ZodOptional<z.ZodBoolean>;
|
|
1166
|
+
ccyValue: z.ZodOptional<z.ZodString>;
|
|
1167
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
1165
1168
|
tokenIdDetails: z.ZodOptional<z.ZodObject<{
|
|
1166
1169
|
name: z.ZodOptional<z.ZodString>;
|
|
1167
1170
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1660,7 +1663,6 @@ declare const transactionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1660
1663
|
label: z.ZodString;
|
|
1661
1664
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
1662
1665
|
value: z.ZodOptional<z.ZodString>;
|
|
1663
|
-
usdValue: z.ZodOptional<z.ZodString>;
|
|
1664
1666
|
token: z.ZodObject<{
|
|
1665
1667
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
1666
1668
|
decimals: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1684,6 +1686,8 @@ declare const transactionSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1684
1686
|
}, z.core.$strip>>;
|
|
1685
1687
|
}, z.core.$strip>;
|
|
1686
1688
|
sent: z.ZodOptional<z.ZodBoolean>;
|
|
1689
|
+
ccyValue: z.ZodOptional<z.ZodString>;
|
|
1690
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
1687
1691
|
tokenIdDetails: z.ZodOptional<z.ZodObject<{
|
|
1688
1692
|
name: z.ZodOptional<z.ZodString>;
|
|
1689
1693
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -2197,7 +2201,6 @@ export declare const simulateAndReviewSchema: z.ZodObject<{
|
|
|
2197
2201
|
label: z.ZodString;
|
|
2198
2202
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
2199
2203
|
value: z.ZodOptional<z.ZodString>;
|
|
2200
|
-
usdValue: z.ZodOptional<z.ZodString>;
|
|
2201
2204
|
token: z.ZodObject<{
|
|
2202
2205
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
2203
2206
|
decimals: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2221,6 +2224,8 @@ export declare const simulateAndReviewSchema: z.ZodObject<{
|
|
|
2221
2224
|
}, z.core.$strip>>;
|
|
2222
2225
|
}, z.core.$strip>;
|
|
2223
2226
|
sent: z.ZodOptional<z.ZodBoolean>;
|
|
2227
|
+
ccyValue: z.ZodOptional<z.ZodString>;
|
|
2228
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
2224
2229
|
tokenIdDetails: z.ZodOptional<z.ZodObject<{
|
|
2225
2230
|
name: z.ZodOptional<z.ZodString>;
|
|
2226
2231
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -2729,7 +2734,6 @@ export declare const enrichedSimulateAndReviewSchema: z.ZodObject<{
|
|
|
2729
2734
|
label: z.ZodString;
|
|
2730
2735
|
tokenId: z.ZodOptional<z.ZodString>;
|
|
2731
2736
|
value: z.ZodOptional<z.ZodString>;
|
|
2732
|
-
usdValue: z.ZodOptional<z.ZodString>;
|
|
2733
2737
|
token: z.ZodObject<{
|
|
2734
2738
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
2735
2739
|
decimals: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2753,6 +2757,8 @@ export declare const enrichedSimulateAndReviewSchema: z.ZodObject<{
|
|
|
2753
2757
|
}, z.core.$strip>>;
|
|
2754
2758
|
}, z.core.$strip>;
|
|
2755
2759
|
sent: z.ZodOptional<z.ZodBoolean>;
|
|
2760
|
+
ccyValue: z.ZodOptional<z.ZodString>;
|
|
2761
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
2756
2762
|
tokenIdDetails: z.ZodOptional<z.ZodObject<{
|
|
2757
2763
|
name: z.ZodOptional<z.ZodString>;
|
|
2758
2764
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import { severitySchema as
|
|
2
|
+
import { severitySchema as h, reasonsSchema as j } from "../warning/schema.js";
|
|
3
3
|
import { estimatedFeesSchema as f } from "../fees/schema.js";
|
|
4
4
|
import { addressSchema as k, addressSchemaArgentBackend as o } from "../../../chains/starknet/address.js";
|
|
5
5
|
const v = t.object({
|
|
@@ -80,7 +80,7 @@ const v = t.object({
|
|
|
80
80
|
}), l = t.object({
|
|
81
81
|
reason: j,
|
|
82
82
|
details: D.optional(),
|
|
83
|
-
severity:
|
|
83
|
+
severity: h
|
|
84
84
|
}), U = t.object({
|
|
85
85
|
assessment: E,
|
|
86
86
|
warnings: t.array(l).optional(),
|
|
@@ -160,20 +160,23 @@ const v = t.object({
|
|
|
160
160
|
overallFee: n,
|
|
161
161
|
maxFee: n,
|
|
162
162
|
defaultTip: n.optional()
|
|
163
|
-
}),
|
|
163
|
+
}), b = t.object({
|
|
164
164
|
overallFee: n,
|
|
165
165
|
resourceBounds: x,
|
|
166
166
|
unit: t.string().transform((a) => a.toUpperCase()).pipe(t.literal("FRI")),
|
|
167
167
|
token: m,
|
|
168
168
|
defaultTip: n.optional()
|
|
169
|
-
}), P =
|
|
169
|
+
}), P = b.or(N), R = t.object({
|
|
170
170
|
type: t.string(),
|
|
171
171
|
label: t.string(),
|
|
172
172
|
tokenId: t.string().optional(),
|
|
173
173
|
value: t.string().optional(),
|
|
174
|
-
usdValue: t.string().optional(),
|
|
175
174
|
token: s,
|
|
176
175
|
sent: t.boolean().optional(),
|
|
176
|
+
ccyValue: t.string().optional(),
|
|
177
|
+
// currency value
|
|
178
|
+
currency: t.string().optional(),
|
|
179
|
+
// currency code
|
|
177
180
|
tokenIdDetails: t.object({
|
|
178
181
|
name: t.string().optional(),
|
|
179
182
|
description: t.string().optional(),
|
|
@@ -183,7 +186,7 @@ const v = t.object({
|
|
|
183
186
|
approvals: t.array(A).optional(),
|
|
184
187
|
transfers: t.array(_).optional(),
|
|
185
188
|
calculatedNonce: t.string().optional(),
|
|
186
|
-
feeEstimation:
|
|
189
|
+
feeEstimation: b,
|
|
187
190
|
feeEstimations: t.array(P),
|
|
188
191
|
summary: t.array(R).optional()
|
|
189
192
|
}), O = t.object({
|
|
@@ -191,7 +194,7 @@ const v = t.object({
|
|
|
191
194
|
code: t.number().optional(),
|
|
192
195
|
message: t.string().optional(),
|
|
193
196
|
error: t.string().optional()
|
|
194
|
-
}),
|
|
197
|
+
}), d = t.object({
|
|
195
198
|
reviewOfTransaction: c,
|
|
196
199
|
simulation: I,
|
|
197
200
|
simulationError: t.undefined().optional()
|
|
@@ -199,27 +202,27 @@ const v = t.object({
|
|
|
199
202
|
reviewOfTransaction: c,
|
|
200
203
|
simulation: t.undefined().optional(),
|
|
201
204
|
simulationError: O
|
|
202
|
-
}), u =
|
|
205
|
+
}), u = d.or(g), S = t.object({
|
|
203
206
|
subsidiseDeployment: t.boolean(),
|
|
204
207
|
subsidiseTransaction: t.boolean()
|
|
205
208
|
}), B = t.object({
|
|
206
209
|
name: t.string().optional(),
|
|
207
210
|
shouldShow: t.boolean().optional()
|
|
208
|
-
}),
|
|
211
|
+
}), y = t.array(B), H = t.object({
|
|
209
212
|
transactions: t.array(u).optional(),
|
|
210
213
|
canSubsidise: t.boolean().optional(),
|
|
211
214
|
subsidyStatus: S.optional(),
|
|
212
|
-
promotions:
|
|
215
|
+
promotions: y.optional()
|
|
213
216
|
}), q = t.object({
|
|
214
217
|
transactions: t.array(u).optional(),
|
|
215
218
|
canSubsidise: t.boolean().optional(),
|
|
216
219
|
subsidyStatus: S.optional(),
|
|
217
220
|
enrichedFeeEstimation: t.array(f).optional(),
|
|
218
221
|
isBackendDown: t.boolean().default(!1).optional(),
|
|
219
|
-
promotions:
|
|
222
|
+
promotions: y.optional()
|
|
220
223
|
});
|
|
221
224
|
function J(a) {
|
|
222
|
-
return
|
|
225
|
+
return d.safeParse(a).success;
|
|
223
226
|
}
|
|
224
227
|
function K(a) {
|
|
225
228
|
return g.safeParse(a).success;
|
|
@@ -231,13 +234,13 @@ export {
|
|
|
231
234
|
i as feeEstimationGasSchema,
|
|
232
235
|
P as feeEstimationNativeOrPaymasterSchema,
|
|
233
236
|
x as feeEstimationResourceBoundSchema,
|
|
234
|
-
|
|
237
|
+
b as feeEstimationSchema,
|
|
235
238
|
J as isNotTransactionSimulationError,
|
|
236
239
|
K as isTransactionSimulationError,
|
|
237
240
|
N as paymasterFeeEstimationSchema,
|
|
238
241
|
m as paymasterFeeTokenSchema,
|
|
239
242
|
B as promotionSchema,
|
|
240
|
-
|
|
243
|
+
y as promotionsSchema,
|
|
241
244
|
r as propertySchema,
|
|
242
245
|
U as reviewSchema,
|
|
243
246
|
H as simulateAndReviewSchema,
|
|
@@ -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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argent/x-shared",
|
|
3
|
-
"version": "1.75.
|
|
3
|
+
"version": "1.75.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/argentlabs/x-shared.git"
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"@types/lodash-es": "4.17.12",
|
|
65
65
|
"@types/numeral": "2.0.5",
|
|
66
66
|
"@types/ua-parser-js": "0.7.39",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "8.39.
|
|
68
|
-
"@typescript-eslint/parser": "8.39.
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "8.39.1",
|
|
68
|
+
"@typescript-eslint/parser": "8.39.1",
|
|
69
69
|
"esbuild": "0.25.8",
|
|
70
70
|
"esbuild-register": "3.6.0",
|
|
71
71
|
"eslint": "8.57.1",
|