@argent/x-shared 1.62.0 → 1.62.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.
@@ -1 +1 @@
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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("url-join"),s=require("zod"),d=require("./address.cjs"),m=require("./argentName.cjs"),o=require("../../errors/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";
3
5
  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: w,
9
- ens: A,
8
+ walletAddress: A,
9
+ ens: h,
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 (f(r))
27
+ if (w(r))
28
28
  throw new t({
29
29
  code: "ARGENT_NAME_NOT_FOUND",
30
30
  message: `${o} not found`
31
31
  });
32
- if (!N(r))
32
+ if (!f(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 h(r);
37
+ return N(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 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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../address.cjs"),a=require("../../argentName.cjs"),o=require("../../getAddressFromArgentName.cjs"),n=require("../../getAddressFromStarkName.cjs"),i=require("../../starknetId.cjs"),s=require("../../../../errors/address.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(i.isStarknetId(e))return n.getAddressFromStarkName(e,r,t);if(a.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 o.getAddressFromArgentName(e,this.httpService,this.baseUrl)}throw new s.AddressError({code:"NO_ADDRESS_FROM_DOMAIN"})}}exports.StarknetAddressService=A;
@@ -1,9 +1,9 @@
1
- import { AddressError as s } from "../../../../errors/address.js";
2
1
  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";
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
+ import { AddressError as s } from "../../../../errors/address.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 (m(e))
22
- return a(e, r, t);
23
- if (d(e)) {
21
+ if (n(e))
22
+ return d(e, r, t);
23
+ if (m(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 n(e, this.httpService, this.baseUrl);
29
+ return a(e, this.httpService, this.baseUrl);
30
30
  }
31
31
  throw new s({
32
32
  code: "NO_ADDRESS_FROM_DOMAIN"
@@ -2,5 +2,8 @@ import { TypedData } from 'starknet';
2
2
  import { PaymasterExecutionDataParams, PaymasterExecuteParams } from './types';
3
3
  export interface IPaymasterService {
4
4
  getExecutionData(params: PaymasterExecutionDataParams, useAvnu?: boolean): Promise<TypedData>;
5
- execute(params: PaymasterExecuteParams, useAvnu?: boolean): Promise<string>;
5
+ execute(params: PaymasterExecuteParams, options?: {
6
+ useAvnu?: boolean;
7
+ isSubsidised?: boolean;
8
+ }): Promise<string>;
6
9
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("starknet"),l=require("url-join"),u=require("./types.cjs"),p=require("../../utils/starknet/starknet.cjs");class y{constructor(e="",t){this.argentRelayerUrl=e,this.httpService=t}async getExecutionData(e,t=!1){const r=l(t?this.getAvnuUrl(e.networkId):this.argentRelayerUrl,"/build-typed-data"),n={calls:t?e.calls.map(o=>({contractAddress:s.num.toHex(o.contractAddress),calldata:s.CallData.toCalldata(o.calldata).map(d=>s.num.toHex(d)),entrypoint:o.entrypoint})):e.calls,userAddress:e.accountAddress,gasTokenAddress:s.num.toHex(e.feeTokenAddress),maxGasTokenAmount:s.num.toHex(e.maxFee),accountClassHash:e.accountClassHash},a=await this.httpService.post(r,{body:s.json.stringify(n),headers:{"Content-Type":"application/json"}}),c=p.typedDataSchema.safeParse(a);if(!c.success)throw new Error("Invalid response from paymaster");return c.data}getAvnuUrl(e){if(!e)throw new Error("Network id is required for Avnu paymaster");let t="";if(e==="mainnet"||e==="mainnet-alpha")t="starknet";else if(e==="sepolia"||e==="sepolia-alpha")t="sepolia";else throw new Error("Invalid network id");return`https://${t}.api.avnu.fi/paymaster/v1`}async execute(e,t=!1){const r=l(t?this.getAvnuUrl(e.networkId):this.argentRelayerUrl,"/execute"),i={signature:e.signature,userAddress:e.accountAddress,typedData:t?s.json.stringify(e.typedData):e.typedData},n=await this.httpService.post(r,{body:s.json.stringify(i),headers:{"Content-Type":"application/json"}}),a=u.paymasterExecuteResponse.safeParse(n);if(!a.success)throw new Error("Invalid response from paymaster");return a.data.transactionHash}}exports.PaymasterService=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("starknet"),c=require("url-join"),u=require("./types.cjs"),p=require("../../utils/starknet/starknet.cjs");class y{constructor(e="",t){this.argentRelayerUrl=e,this.httpService=t}async getExecutionData(e,t=!1){const n=c(t?this.getAvnuUrl(e.networkId):this.argentRelayerUrl,"/build-typed-data"),r={calls:t?e.calls.map(a=>({contractAddress:s.num.toHex(a.contractAddress),calldata:s.CallData.toCalldata(a.calldata).map(l=>s.num.toHex(l)),entrypoint:a.entrypoint})):e.calls,userAddress:e.accountAddress,gasTokenAddress:s.num.toHex(e.feeTokenAddress),maxGasTokenAmount:s.num.toHex(e.maxFee),accountClassHash:e.accountClassHash},i=await this.httpService.post(n,{body:s.json.stringify(r),headers:{"Content-Type":"application/json"}}),o=p.typedDataSchema.safeParse(i);if(!o.success)throw new Error("Invalid response from paymaster");return o.data}getAvnuUrl(e){if(!e)throw new Error("Network id is required for Avnu paymaster");let t="";if(e==="mainnet"||e==="mainnet-alpha")t="starknet";else if(e==="sepolia"||e==="sepolia-alpha")t="sepolia";else throw new Error("Invalid network id");return`https://${t}.api.avnu.fi/paymaster/v1`}async execute(e,t){const{useAvnu:n,isSubsidised:d}=t??{};let r=c(n?this.getAvnuUrl(e.networkId):this.argentRelayerUrl,"/execute");d&&(r=c(r,"?isSubsidised=true"));const i={signature:e.signature,userAddress:e.accountAddress,typedData:n?s.json.stringify(e.typedData):e.typedData,deploymentData:e.deploymentData},o=await this.httpService.post(r,{body:s.json.stringify(i),headers:{"Content-Type":"application/json"}}),a=u.paymasterExecuteResponse.safeParse(o);if(!a.success)throw new Error("Invalid response from paymaster");return a.data.transactionHash}}exports.PaymasterService=y;
@@ -8,5 +8,8 @@ export declare class PaymasterService implements IPaymasterService {
8
8
  constructor(argentRelayerUrl: string | undefined, httpService: IHttpService);
9
9
  getExecutionData(params: PaymasterExecutionDataParams, useAvnu?: boolean): Promise<TypedData>;
10
10
  getAvnuUrl(networkId?: string): string;
11
- execute(params: PaymasterExecuteParams, useAvnu?: boolean): Promise<string>;
11
+ execute(params: PaymasterExecuteParams, options?: {
12
+ useAvnu?: boolean;
13
+ isSubsidised?: boolean;
14
+ }): Promise<string>;
12
15
  }
@@ -1,31 +1,31 @@
1
- import { CallData as y, num as a, json as i } from "starknet";
1
+ import { CallData as u, num as o, json as c } from "starknet";
2
2
  import d from "url-join";
3
- import { paymasterExecuteResponse as u } from "./types.js";
3
+ import { paymasterExecuteResponse as y } from "./types.js";
4
4
  import { typedDataSchema as h } from "../../utils/starknet/starknet.js";
5
- class A {
5
+ class x {
6
6
  constructor(e = "", t) {
7
7
  this.argentRelayerUrl = e, this.httpService = t;
8
8
  }
9
9
  async getExecutionData(e, t = !1) {
10
- const r = d(t ? this.getAvnuUrl(e.networkId) : this.argentRelayerUrl, "/build-typed-data"), o = {
11
- calls: t ? e.calls.map((n) => ({
12
- contractAddress: a.toHex(n.contractAddress),
13
- calldata: y.toCalldata(n.calldata).map((p) => a.toHex(p)),
14
- entrypoint: n.entrypoint
10
+ const r = d(t ? this.getAvnuUrl(e.networkId) : this.argentRelayerUrl, "/build-typed-data"), a = {
11
+ calls: t ? e.calls.map((s) => ({
12
+ contractAddress: o.toHex(s.contractAddress),
13
+ calldata: u.toCalldata(s.calldata).map((p) => o.toHex(p)),
14
+ entrypoint: s.entrypoint
15
15
  })) : e.calls,
16
16
  userAddress: e.accountAddress,
17
- gasTokenAddress: a.toHex(e.feeTokenAddress),
18
- maxGasTokenAmount: a.toHex(e.maxFee),
17
+ gasTokenAddress: o.toHex(e.feeTokenAddress),
18
+ maxGasTokenAmount: o.toHex(e.maxFee),
19
19
  accountClassHash: e.accountClassHash
20
- }, s = await this.httpService.post(r, {
21
- body: i.stringify(o),
20
+ }, i = await this.httpService.post(r, {
21
+ body: c.stringify(a),
22
22
  headers: {
23
23
  "Content-Type": "application/json"
24
24
  }
25
- }), l = h.safeParse(s);
26
- if (!l.success)
25
+ }), n = h.safeParse(i);
26
+ if (!n.success)
27
27
  throw new Error("Invalid response from paymaster");
28
- return l.data;
28
+ return n.data;
29
29
  }
30
30
  getAvnuUrl(e) {
31
31
  if (!e)
@@ -39,22 +39,26 @@ class A {
39
39
  throw new Error("Invalid network id");
40
40
  return `https://${t}.api.avnu.fi/paymaster/v1`;
41
41
  }
42
- async execute(e, t = !1) {
43
- const r = d(t ? this.getAvnuUrl(e.networkId) : this.argentRelayerUrl, "/execute"), c = {
42
+ async execute(e, t) {
43
+ const { useAvnu: r, isSubsidised: l } = t ?? {};
44
+ let a = d(r ? this.getAvnuUrl(e.networkId) : this.argentRelayerUrl, "/execute");
45
+ l && (a = d(a, "?isSubsidised=true"));
46
+ const i = {
44
47
  signature: e.signature,
45
48
  userAddress: e.accountAddress,
46
- typedData: t ? i.stringify(e.typedData) : e.typedData
47
- }, o = await this.httpService.post(r, {
48
- body: i.stringify(c),
49
+ typedData: r ? c.stringify(e.typedData) : e.typedData,
50
+ deploymentData: e.deploymentData
51
+ }, n = await this.httpService.post(a, {
52
+ body: c.stringify(i),
49
53
  headers: {
50
54
  "Content-Type": "application/json"
51
55
  }
52
- }), s = u.safeParse(o);
56
+ }), s = y.safeParse(n);
53
57
  if (!s.success)
54
58
  throw new Error("Invalid response from paymaster");
55
59
  return s.data.transactionHash;
56
60
  }
57
61
  }
58
62
  export {
59
- A as PaymasterService
63
+ x as PaymasterService
60
64
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../utils/starknet/starknet.cjs"),t=require("../../backend/schema.cjs"),s=require("../../chains/starknet/address.cjs"),r=e.z.object({calls:e.z.array(a.callSchema),accountAddress:s.addressSchema,networkId:t.argentNetworkIdSchema.or(t.argentBackendNetworkIdSchema).optional(),feeTokenAddress:s.addressSchema,maxFee:a.bigNumberishSchema,accountClassHash:e.z.string().optional()}),c=e.z.object({signature:e.z.string().array(),accountAddress:s.addressSchema,typedData:a.typedDataSchema,networkId:t.argentNetworkIdSchema.optional()}),o=e.z.object({transactionHash:e.z.string()});exports.paymasterExecuteParams=c;exports.paymasterExecuteResponse=o;exports.paymasterExecutionDataParams=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),e=require("../../chains/starknet/address.cjs"),t=require("../../utils/starknet/starknet.cjs"),r=require("../../backend/schema.cjs"),s=a.z.object({calls:a.z.array(t.callSchema),accountAddress:e.addressSchema,networkId:r.argentNetworkIdSchema.or(r.argentBackendNetworkIdSchema).optional(),feeTokenAddress:e.addressSchema,maxFee:t.bigNumberishSchema,accountClassHash:a.z.string().optional()}),o=a.z.object({signature:a.z.string().array(),accountAddress:e.addressSchema,typedData:t.typedDataSchema,networkId:r.argentNetworkIdSchema.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;
@@ -62,9 +62,9 @@ export declare const paymasterExecuteParams: z.ZodObject<{
62
62
  }>]>, "many">>;
63
63
  primaryType: z.ZodString;
64
64
  domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
65
- message: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
65
+ message: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>]>;
66
66
  }, "strip", z.ZodTypeAny, {
67
- message: {};
67
+ message: Record<string, any> | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
68
68
  types: Record<string, ({
69
69
  name: string;
70
70
  type: "merkletree";
@@ -80,7 +80,7 @@ export declare const paymasterExecuteParams: z.ZodObject<{
80
80
  primaryType: string;
81
81
  domain: Record<string, unknown>;
82
82
  }, {
83
- message: {};
83
+ message: Record<string, any> | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
84
84
  types: Record<string, ({
85
85
  name: string;
86
86
  type: "merkletree";
@@ -97,11 +97,27 @@ export declare const paymasterExecuteParams: z.ZodObject<{
97
97
  domain: Record<string, unknown>;
98
98
  }>;
99
99
  networkId: z.ZodOptional<z.ZodEnum<["mainnet-alpha", "sepolia-alpha"]>>;
100
+ deploymentData: z.ZodOptional<z.ZodObject<{
101
+ class_hash: z.ZodOptional<z.ZodString>;
102
+ salt: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodBigInt]>>;
103
+ unique: z.ZodString;
104
+ calldata: z.ZodArray<z.ZodString, "many">;
105
+ }, "strip", z.ZodTypeAny, {
106
+ calldata: string[];
107
+ unique: string;
108
+ salt?: string | number | bigint | undefined;
109
+ class_hash?: string | undefined;
110
+ }, {
111
+ calldata: string[];
112
+ unique: string;
113
+ salt?: string | number | bigint | undefined;
114
+ class_hash?: string | undefined;
115
+ }>>;
100
116
  }, "strip", z.ZodTypeAny, {
101
117
  signature: string[];
102
118
  accountAddress: `0x${string}`;
103
119
  typedData: {
104
- message: {};
120
+ message: Record<string, any> | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
105
121
  types: Record<string, ({
106
122
  name: string;
107
123
  type: "merkletree";
@@ -118,11 +134,17 @@ export declare const paymasterExecuteParams: z.ZodObject<{
118
134
  domain: Record<string, unknown>;
119
135
  };
120
136
  networkId?: "mainnet-alpha" | "sepolia-alpha" | undefined;
137
+ deploymentData?: {
138
+ calldata: string[];
139
+ unique: string;
140
+ salt?: string | number | bigint | undefined;
141
+ class_hash?: string | undefined;
142
+ } | undefined;
121
143
  }, {
122
144
  signature: string[];
123
145
  accountAddress: string;
124
146
  typedData: {
125
- message: {};
147
+ message: Record<string, any> | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
126
148
  types: Record<string, ({
127
149
  name: string;
128
150
  type: "merkletree";
@@ -139,6 +161,12 @@ export declare const paymasterExecuteParams: z.ZodObject<{
139
161
  domain: Record<string, unknown>;
140
162
  };
141
163
  networkId?: "mainnet-alpha" | "sepolia-alpha" | undefined;
164
+ deploymentData?: {
165
+ calldata: string[];
166
+ unique: string;
167
+ salt?: string | number | bigint | undefined;
168
+ class_hash?: string | undefined;
169
+ } | undefined;
142
170
  }>;
143
171
  export type PaymasterExecuteParams = z.infer<typeof paymasterExecuteParams>;
144
172
  export declare const paymasterExecuteResponse: z.ZodObject<{
@@ -1,25 +1,30 @@
1
1
  import { z as a } from "zod";
2
+ import { addressSchema as t } from "../../chains/starknet/address.js";
2
3
  import { bigNumberishSchema as r, callSchema as o, typedDataSchema as s } from "../../utils/starknet/starknet.js";
3
- import { argentNetworkIdSchema as t, argentBackendNetworkIdSchema as c } from "../../backend/schema.js";
4
- import { addressSchema as e } from "../../chains/starknet/address.js";
5
- const p = a.object({
4
+ import { argentNetworkIdSchema as e, argentBackendNetworkIdSchema as n } from "../../backend/schema.js";
5
+ const d = a.object({
6
6
  calls: a.array(o),
7
- accountAddress: e,
8
- networkId: t.or(c).optional(),
9
- feeTokenAddress: e,
7
+ accountAddress: t,
8
+ networkId: e.or(n).optional(),
9
+ feeTokenAddress: t,
10
10
  maxFee: r,
11
11
  accountClassHash: a.string().optional()
12
- }), h = a.object({
12
+ }), l = a.object({
13
13
  signature: a.string().array(),
14
- accountAddress: e,
14
+ accountAddress: t,
15
15
  typedData: s,
16
- networkId: t.optional()
17
- // deploymentData: z.object() // TODO: Implement account deployment
18
- }), l = a.object({
16
+ networkId: e.optional(),
17
+ deploymentData: a.object({
18
+ class_hash: a.string().optional(),
19
+ salt: a.string().or(a.number()).or(a.bigint()).optional(),
20
+ unique: a.string(),
21
+ calldata: a.array(a.string())
22
+ }).optional()
23
+ }), g = a.object({
19
24
  transactionHash: a.string()
20
25
  });
21
26
  export {
22
- h as paymasterExecuteParams,
23
- l as paymasterExecuteResponse,
24
- p as paymasterExecutionDataParams
27
+ l as paymasterExecuteParams,
28
+ g as paymasterExecuteResponse,
29
+ d as paymasterExecutionDataParams
25
30
  };
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { UnionEvaluate } from '../../../utils/type.utils';
3
+ import { SubsidyStatus } from '../transactionReview/schema';
3
4
  export declare const estimatedFeeSchema: z.ZodObject<{
4
5
  feeTokenAddress: z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEffects<z.ZodString, string, string>>, `0x${string}`, string>;
5
6
  amount: z.ZodBigInt;
@@ -756,6 +757,7 @@ export type EstimatedFeesV2 = z.infer<typeof estimatedFeesV2Schema>;
756
757
  export type EstimatedFeesV2Enriched = UnionEvaluate<EstimatedFeesV2 & {
757
758
  id: string;
758
759
  timestamp: number;
760
+ subsidyStatus?: SubsidyStatus;
759
761
  }>;
760
762
  export type NativeEstimatedFee = z.infer<typeof nativeEstimatedFeeSchema>;
761
763
  export type PaymasterEstimatedFee = z.infer<typeof paymasterEstimatedFeeSchema>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),p=require("../fees/schema.cjs"),m=require("../warning/schema.cjs"),n=require("../../../chains/starknet/address.cjs"),F=e.z.object({name:e.z.string(),url:e.z.string(),position:e.z.number()}),o=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()}),i=e.z.discriminatedUnion("type",[e.z.object({type:e.z.literal("amount"),label:e.z.string(),token:o,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:o}),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:o})]),d=e.z.object({name:e.z.string(),properties:e.z.array(i),defaultProperties:e.z.array(i).optional()}),g=e.z.union([e.z.literal("verified"),e.z.literal("neutral"),e.z.literal("partial"),e.z.literal("warn")]),u=e.z.object({unknown_token:e.z.unknown().optional(),date_of_addition:e.z.string().optional(),contract_address:n.addressSchema.optional(),reason:e.z.string().optional(),value:e.z.string().or(e.z.number()).optional()}),r=e.z.object({reason:m.reasonsSchema,details:u.optional(),severity:m.severitySchema}),b=e.z.object({assessment:g,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:d}),S=e.z.object({name:e.z.string(),description:e.z.string(),logoUrl:e.z.string(),iconUrl:e.z.string(),argentVerified:e.z.boolean(),links:e.z.array(F)}),h=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:S.optional(),reviews:e.z.array(b)}).optional(),y=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()}),T=e.z.object({twitter:e.z.string().optional(),external:e.z.string().optional(),discord:e.z.string().optional()}),s=e.z.object({address:n.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:y.optional(),links:T.optional()}),U=e.z.object({tokenAddress:n.addressSchemaArgentBackend,owner:n.addressSchemaArgentBackend,spender:n.addressSchemaArgentBackend,value:e.z.string().optional(),approvalForAll:e.z.boolean(),details:s.optional()}),x=e.z.object({tokenAddress:n.addressSchemaArgentBackend,from:n.addressSchemaArgentBackend,to:n.addressSchemaArgentBackend,tokenId:e.z.string().optional(),value:e.z.string().optional(),details:s.optional()}),t=e.z.union([e.z.string(),e.z.number(),e.z.bigint()]).transform(a=>parseInt(a.toString(),10)),f={overallFee:t,gasPrice:t,gasUsage:t,dataGasPrice:t.optional(),dataGasConsumed:t.optional()},j=e.z.object({...f,unit:e.z.string().transform(a=>a.toUpperCase()).pipe(e.z.literal("WEI")),maxFee:t}),l=e.z.object({address:n.addressSchemaArgentBackend,unknown:e.z.boolean(),type:e.z.literal("ERC20")}),k=e.z.object({...f,unit:e.z.string().transform(a=>a.toUpperCase()).pipe(e.z.literal("FRI")),maxAmount:t,maxPricePerUnit:t,token:l}),v=e.z.object({token:l,overallFee:t,maxFee:t}),c=j.or(k),w=c.or(v),D=e.z.object({type:e.z.string(),label:e.z.string(),tokenId:e.z.string().optional(),value:e.z.string().optional(),usdValue:e.z.string().optional(),token:s,sent:e.z.boolean().optional(),tokenIdDetails:e.z.object({name:e.z.string().optional(),description:e.z.string().optional(),imageUrls:y.optional()}).optional()}),B=e.z.object({approvals:e.z.array(U).optional(),transfers:e.z.array(x).optional(),calculatedNonce:e.z.string().optional(),feeEstimation:c,feeEstimations:e.z.array(w),summary:e.z.array(D).optional()}),P=e.z.object({label:e.z.string().optional(),code:e.z.number().optional(),message:e.z.string().optional(),error:e.z.string().optional()}),E=e.z.object({reviewOfTransaction:h,simulation:B,simulationError:e.z.undefined()}),A=e.z.object({reviewOfTransaction:h,simulation:e.z.undefined(),simulationError:P}),z=E.or(A),V=e.z.object({transactions:e.z.array(z).optional()}),R=e.z.object({transactions:e.z.array(z).optional(),enrichedFeeEstimation:p.estimatedFeesSchema.optional(),isBackendDown:e.z.boolean().default(!1).optional()}),N=e.z.object({transactions:e.z.array(z).optional(),enrichedFeeEstimation:e.z.array(p.estimatedFeesV2Schema).optional(),isBackendDown:e.z.boolean().default(!1).optional()});function _(a){return E.safeParse(a).success}function O(a){return A.safeParse(a).success}exports.actionSchema=d;exports.assessmentSchema=g;exports.enrichedSimulateAndReviewSchema=R;exports.enrichedSimulateAndReviewV2Schema=N;exports.feeEstimationNativeOrPaymasterSchema=w;exports.feeEstimationSchema=c;exports.feeEstimationTxV1Schema=j;exports.feeEstimationTxV3Schema=k;exports.isNotTransactionSimulationError=_;exports.isTransactionSimulationError=O;exports.paymasterFeeEstimationSchema=v;exports.paymasterFeeTokenSchema=l;exports.propertySchema=i;exports.reviewSchema=b;exports.simulateAndReviewSchema=V;exports.targetedDappSchema=S;exports.warningDetailsSchema=u;exports.warningSchema=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),d=require("../fees/schema.cjs"),p=require("../warning/schema.cjs"),n=require("../../../chains/starknet/address.cjs"),T=e.z.object({name:e.z.string(),url:e.z.string(),position:e.z.number()}),o=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()}),i=e.z.discriminatedUnion("type",[e.z.object({type:e.z.literal("amount"),label:e.z.string(),token:o,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:o}),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:o})]),g=e.z.object({name:e.z.string(),properties:e.z.array(i),defaultProperties:e.z.array(i).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:n.addressSchema.optional(),reason:e.z.string().optional(),value:e.z.string().or(e.z.number()).optional()}),s=e.z.object({reason:p.reasonsSchema,details:b.optional(),severity:p.severitySchema}),S=e.z.object({assessment:u,warnings:e.z.array(s).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(),iconUrl:e.z.string(),argentVerified:e.z.boolean(),links:e.z.array(T)}),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(s).optional(),assessmentDetails:e.z.object({contract_address:e.z.string()}).optional(),targetedDapp:h.optional(),reviews:e.z.array(S)}).optional(),f=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()}),D=e.z.object({twitter:e.z.string().optional(),external:e.z.string().optional(),discord:e.z.string().optional()}),r=e.z.object({address:n.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:f.optional(),links:D.optional()}),U=e.z.object({tokenAddress:n.addressSchemaArgentBackend,owner:n.addressSchemaArgentBackend,spender:n.addressSchemaArgentBackend,value:e.z.string().optional(),approvalForAll:e.z.boolean(),details:r.optional()}),x=e.z.object({tokenAddress:n.addressSchemaArgentBackend,from:n.addressSchemaArgentBackend,to:n.addressSchemaArgentBackend,tokenId:e.z.string().optional(),value:e.z.string().optional(),details:r.optional()}),t=e.z.union([e.z.string(),e.z.number(),e.z.bigint()]).transform(a=>parseInt(a.toString(),10)),j={overallFee:t,gasPrice:t,gasUsage:t,dataGasPrice:t.optional(),dataGasConsumed:t.optional()},k=e.z.object({...j,unit:e.z.string().transform(a=>a.toUpperCase()).pipe(e.z.literal("WEI")),maxFee:t}),l=e.z.object({address:n.addressSchemaArgentBackend,unknown:e.z.boolean(),type:e.z.literal("ERC20")}),v=e.z.object({...j,unit:e.z.string().transform(a=>a.toUpperCase()).pipe(e.z.literal("FRI")),maxAmount:t,maxPricePerUnit:t,token:l}),w=e.z.object({token:l,overallFee:t,maxFee:t}),c=k.or(v),E=c.or(w),B=e.z.object({type:e.z.string(),label:e.z.string(),tokenId:e.z.string().optional(),value:e.z.string().optional(),usdValue:e.z.string().optional(),token:r,sent:e.z.boolean().optional(),tokenIdDetails:e.z.object({name:e.z.string().optional(),description:e.z.string().optional(),imageUrls:f.optional()}).optional()}),P=e.z.object({approvals:e.z.array(U).optional(),transfers:e.z.array(x).optional(),calculatedNonce:e.z.string().optional(),feeEstimation:c,feeEstimations:e.z.array(E),summary:e.z.array(B).optional()}),V=e.z.object({label:e.z.string().optional(),code:e.z.number().optional(),message:e.z.string().optional(),error:e.z.string().optional()}),A=e.z.object({reviewOfTransaction:y,simulation:P,simulationError:e.z.undefined()}),F=e.z.object({reviewOfTransaction:y,simulation:e.z.undefined(),simulationError:V}),z=A.or(F),m=e.z.object({subsidiseDeployment:e.z.boolean(),subsidiseTransaction:e.z.boolean()}),R=e.z.object({transactions:e.z.array(z).optional(),subsidyStatus:m.optional()}),N=e.z.object({transactions:e.z.array(z).optional(),subsidyStatus:m.optional(),enrichedFeeEstimation:d.estimatedFeesSchema.optional(),isBackendDown:e.z.boolean().default(!1).optional()}),_=e.z.object({transactions:e.z.array(z).optional(),subsidyStatus:m.optional(),enrichedFeeEstimation:e.z.array(d.estimatedFeesV2Schema).optional(),isBackendDown:e.z.boolean().default(!1).optional()});function O(a){return A.safeParse(a).success}function I(a){return F.safeParse(a).success}exports.actionSchema=g;exports.assessmentSchema=u;exports.enrichedSimulateAndReviewSchema=N;exports.enrichedSimulateAndReviewV2Schema=_;exports.feeEstimationNativeOrPaymasterSchema=E;exports.feeEstimationSchema=c;exports.feeEstimationTxV1Schema=k;exports.feeEstimationTxV3Schema=v;exports.isNotTransactionSimulationError=O;exports.isTransactionSimulationError=I;exports.paymasterFeeEstimationSchema=w;exports.paymasterFeeTokenSchema=l;exports.propertySchema=i;exports.reviewSchema=S;exports.simulateAndReviewSchema=R;exports.targetedDappSchema=h;exports.warningDetailsSchema=b;exports.warningSchema=s;
@@ -15347,6 +15347,17 @@ declare const transactionSchema: z.ZodUnion<[z.ZodObject<{
15347
15347
  } | undefined;
15348
15348
  simulation?: undefined;
15349
15349
  }>]>;
15350
+ declare const subsidyStatusSchema: z.ZodObject<{
15351
+ subsidiseDeployment: z.ZodBoolean;
15352
+ subsidiseTransaction: z.ZodBoolean;
15353
+ }, "strip", z.ZodTypeAny, {
15354
+ subsidiseDeployment: boolean;
15355
+ subsidiseTransaction: boolean;
15356
+ }, {
15357
+ subsidiseDeployment: boolean;
15358
+ subsidiseTransaction: boolean;
15359
+ }>;
15360
+ export type SubsidyStatus = z.infer<typeof subsidyStatusSchema>;
15350
15361
  export declare const simulateAndReviewSchema: z.ZodObject<{
15351
15362
  transactions: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
15352
15363
  reviewOfTransaction: z.ZodOptional<z.ZodObject<{
@@ -20432,6 +20443,16 @@ export declare const simulateAndReviewSchema: z.ZodObject<{
20432
20443
  } | undefined;
20433
20444
  simulation?: undefined;
20434
20445
  }>]>, "many">>;
20446
+ subsidyStatus: z.ZodOptional<z.ZodObject<{
20447
+ subsidiseDeployment: z.ZodBoolean;
20448
+ subsidiseTransaction: z.ZodBoolean;
20449
+ }, "strip", z.ZodTypeAny, {
20450
+ subsidiseDeployment: boolean;
20451
+ subsidiseTransaction: boolean;
20452
+ }, {
20453
+ subsidiseDeployment: boolean;
20454
+ subsidiseTransaction: boolean;
20455
+ }>>;
20435
20456
  }, "strip", z.ZodTypeAny, {
20436
20457
  transactions?: ({
20437
20458
  simulation: {
@@ -20951,6 +20972,10 @@ export declare const simulateAndReviewSchema: z.ZodObject<{
20951
20972
  } | undefined;
20952
20973
  simulation?: undefined;
20953
20974
  })[] | undefined;
20975
+ subsidyStatus?: {
20976
+ subsidiseDeployment: boolean;
20977
+ subsidiseTransaction: boolean;
20978
+ } | undefined;
20954
20979
  }, {
20955
20980
  transactions?: ({
20956
20981
  simulation: {
@@ -21470,6 +21495,10 @@ export declare const simulateAndReviewSchema: z.ZodObject<{
21470
21495
  } | undefined;
21471
21496
  simulation?: undefined;
21472
21497
  })[] | undefined;
21498
+ subsidyStatus?: {
21499
+ subsidiseDeployment: boolean;
21500
+ subsidiseTransaction: boolean;
21501
+ } | undefined;
21473
21502
  }>;
21474
21503
  export declare const enrichedSimulateAndReviewSchema: z.ZodObject<{
21475
21504
  transactions: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{
@@ -26556,6 +26585,16 @@ export declare const enrichedSimulateAndReviewSchema: z.ZodObject<{
26556
26585
  } | undefined;
26557
26586
  simulation?: undefined;
26558
26587
  }>]>, "many">>;
26588
+ subsidyStatus: z.ZodOptional<z.ZodObject<{
26589
+ subsidiseDeployment: z.ZodBoolean;
26590
+ subsidiseTransaction: z.ZodBoolean;
26591
+ }, "strip", z.ZodTypeAny, {
26592
+ subsidiseDeployment: boolean;
26593
+ subsidiseTransaction: boolean;
26594
+ }, {
26595
+ subsidiseDeployment: boolean;
26596
+ subsidiseTransaction: boolean;
26597
+ }>>;
26559
26598
  enrichedFeeEstimation: z.ZodOptional<z.ZodObject<{
26560
26599
  deployment: z.ZodOptional<z.ZodObject<{
26561
26600
  feeTokenAddress: z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEffects<z.ZodString, string, string>>, `0x${string}`, string>;
@@ -27226,6 +27265,10 @@ export declare const enrichedSimulateAndReviewSchema: z.ZodObject<{
27226
27265
  } | undefined;
27227
27266
  simulation?: undefined;
27228
27267
  })[] | undefined;
27268
+ subsidyStatus?: {
27269
+ subsidiseDeployment: boolean;
27270
+ subsidiseTransaction: boolean;
27271
+ } | undefined;
27229
27272
  enrichedFeeEstimation?: {
27230
27273
  transactions: {
27231
27274
  amount: bigint;
@@ -27774,6 +27817,10 @@ export declare const enrichedSimulateAndReviewSchema: z.ZodObject<{
27774
27817
  } | undefined;
27775
27818
  simulation?: undefined;
27776
27819
  })[] | undefined;
27820
+ subsidyStatus?: {
27821
+ subsidiseDeployment: boolean;
27822
+ subsidiseTransaction: boolean;
27823
+ } | undefined;
27777
27824
  enrichedFeeEstimation?: {
27778
27825
  transactions: {
27779
27826
  amount: bigint;
@@ -32889,6 +32936,16 @@ export declare const enrichedSimulateAndReviewV2Schema: z.ZodObject<{
32889
32936
  } | undefined;
32890
32937
  simulation?: undefined;
32891
32938
  }>]>, "many">>;
32939
+ subsidyStatus: z.ZodOptional<z.ZodObject<{
32940
+ subsidiseDeployment: z.ZodBoolean;
32941
+ subsidiseTransaction: z.ZodBoolean;
32942
+ }, "strip", z.ZodTypeAny, {
32943
+ subsidiseDeployment: boolean;
32944
+ subsidiseTransaction: boolean;
32945
+ }, {
32946
+ subsidiseDeployment: boolean;
32947
+ subsidiseTransaction: boolean;
32948
+ }>>;
32892
32949
  enrichedFeeEstimation: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
32893
32950
  type: z.ZodLiteral<"native">;
32894
32951
  transactions: z.ZodObject<{
@@ -33616,6 +33673,10 @@ export declare const enrichedSimulateAndReviewV2Schema: z.ZodObject<{
33616
33673
  } | undefined;
33617
33674
  simulation?: undefined;
33618
33675
  })[] | undefined;
33676
+ subsidyStatus?: {
33677
+ subsidiseDeployment: boolean;
33678
+ subsidiseTransaction: boolean;
33679
+ } | undefined;
33619
33680
  enrichedFeeEstimation?: ({
33620
33681
  type: "native";
33621
33682
  transactions: {
@@ -34177,6 +34238,10 @@ export declare const enrichedSimulateAndReviewV2Schema: z.ZodObject<{
34177
34238
  } | undefined;
34178
34239
  simulation?: undefined;
34179
34240
  })[] | undefined;
34241
+ subsidyStatus?: {
34242
+ subsidiseDeployment: boolean;
34243
+ subsidiseTransaction: boolean;
34244
+ } | undefined;
34180
34245
  enrichedFeeEstimation?: ({
34181
34246
  type: "native";
34182
34247
  transactions: {
@@ -1,8 +1,8 @@
1
1
  import { z as t } from "zod";
2
- import { estimatedFeesSchema as h, estimatedFeesV2Schema as S } from "../fees/schema.js";
3
- import { severitySchema as y, reasonsSchema as f } from "../warning/schema.js";
4
- import { addressSchemaArgentBackend as n, addressSchema as j } from "../../../chains/starknet/address.js";
5
- const k = t.object({
2
+ import { estimatedFeesSchema as h, estimatedFeesV2Schema as y } from "../fees/schema.js";
3
+ import { severitySchema as f, reasonsSchema as j } from "../warning/schema.js";
4
+ import { addressSchemaArgentBackend as n, addressSchema as k } from "../../../chains/starknet/address.js";
5
+ const v = t.object({
6
6
  name: t.string(),
7
7
  url: t.string(),
8
8
  position: t.number()
@@ -14,7 +14,7 @@ const k = t.object({
14
14
  unknown: t.boolean(),
15
15
  iconUrl: t.string().optional(),
16
16
  type: t.string()
17
- }), s = t.discriminatedUnion("type", [
17
+ }), l = t.discriminatedUnion("type", [
18
18
  t.object({
19
19
  type: t.literal("amount"),
20
20
  label: t.string(),
@@ -62,59 +62,59 @@ const k = t.object({
62
62
  label: t.string(),
63
63
  token: o
64
64
  })
65
- ]), v = t.object({
65
+ ]), w = t.object({
66
66
  name: t.string(),
67
- properties: t.array(s),
68
- defaultProperties: t.array(s).optional()
69
- }), w = t.union([
67
+ properties: t.array(l),
68
+ defaultProperties: t.array(l).optional()
69
+ }), E = t.union([
70
70
  t.literal("verified"),
71
71
  t.literal("neutral"),
72
72
  t.literal("partial"),
73
73
  t.literal("warn")
74
- ]), E = t.object({
74
+ ]), F = t.object({
75
75
  unknown_token: t.unknown().optional(),
76
76
  date_of_addition: t.string().optional(),
77
- contract_address: j.optional(),
77
+ contract_address: k.optional(),
78
78
  reason: t.string().optional(),
79
79
  value: t.string().or(t.number()).optional()
80
- }), l = t.object({
81
- reason: f,
82
- details: E.optional(),
83
- severity: y
84
- }), F = t.object({
85
- assessment: w,
86
- warnings: t.array(l).optional(),
80
+ }), c = t.object({
81
+ reason: j,
82
+ details: F.optional(),
83
+ severity: f
84
+ }), U = t.object({
85
+ assessment: E,
86
+ warnings: t.array(c).optional(),
87
87
  assessmentReasons: t.array(t.string()).optional(),
88
88
  assessmentDetails: t.object({
89
89
  contract_address: t.string()
90
90
  }).optional(),
91
- action: v
92
- }), U = t.object({
91
+ action: w
92
+ }), x = t.object({
93
93
  name: t.string(),
94
94
  description: t.string(),
95
95
  logoUrl: t.string(),
96
96
  iconUrl: t.string(),
97
97
  argentVerified: t.boolean(),
98
- links: t.array(k)
99
- }), c = t.object({
98
+ links: t.array(v)
99
+ }), m = t.object({
100
100
  assessment: t.union([
101
101
  t.literal("verified"),
102
102
  t.literal("neutral"),
103
103
  t.literal("partial"),
104
104
  t.literal("warn")
105
105
  ]),
106
- warnings: t.array(l).optional(),
106
+ warnings: t.array(c).optional(),
107
107
  assessmentDetails: t.object({
108
108
  contract_address: t.string()
109
109
  }).optional(),
110
- targetedDapp: U.optional(),
111
- reviews: t.array(F)
112
- }).optional(), m = t.object({
110
+ targetedDapp: x.optional(),
111
+ reviews: t.array(U)
112
+ }).optional(), p = t.object({
113
113
  banner: t.string().nullable().optional(),
114
114
  preview: t.string().nullable().optional(),
115
115
  full: t.string().nullable().optional(),
116
116
  original: t.string().nullable().optional()
117
- }), x = t.object({
117
+ }), D = t.object({
118
118
  twitter: t.string().optional(),
119
119
  external: t.string().optional(),
120
120
  discord: t.string().optional()
@@ -128,8 +128,8 @@ const k = t.object({
128
128
  usdValue: t.string().optional(),
129
129
  iconUrl: t.string().optional(),
130
130
  unknown: t.boolean().optional(),
131
- imageUrls: m.optional(),
132
- links: x.optional()
131
+ imageUrls: p.optional(),
132
+ links: D.optional()
133
133
  }), A = t.object({
134
134
  tokenAddress: n,
135
135
  owner: n,
@@ -137,38 +137,38 @@ const k = t.object({
137
137
  value: t.string().optional(),
138
138
  approvalForAll: t.boolean(),
139
139
  details: i.optional()
140
- }), D = t.object({
140
+ }), T = t.object({
141
141
  tokenAddress: n,
142
142
  from: n,
143
143
  to: n,
144
144
  tokenId: t.string().optional(),
145
145
  value: t.string().optional(),
146
146
  details: i.optional()
147
- }), e = t.union([t.string(), t.number(), t.bigint()]).transform((a) => parseInt(a.toString(), 10)), p = {
148
- overallFee: e,
149
- gasPrice: e,
150
- gasUsage: e,
151
- dataGasPrice: e.optional(),
152
- dataGasConsumed: e.optional()
147
+ }), a = t.union([t.string(), t.number(), t.bigint()]).transform((e) => parseInt(e.toString(), 10)), d = {
148
+ overallFee: a,
149
+ gasPrice: a,
150
+ gasUsage: a,
151
+ dataGasPrice: a.optional(),
152
+ dataGasConsumed: a.optional()
153
153
  }, P = t.object({
154
- ...p,
155
- unit: t.string().transform((a) => a.toUpperCase()).pipe(t.literal("WEI")),
156
- maxFee: e
154
+ ...d,
155
+ unit: t.string().transform((e) => e.toUpperCase()).pipe(t.literal("WEI")),
156
+ maxFee: a
157
157
  }), g = t.object({
158
158
  address: n,
159
159
  unknown: t.boolean(),
160
160
  type: t.literal("ERC20")
161
- }), T = t.object({
162
- ...p,
163
- unit: t.string().transform((a) => a.toUpperCase()).pipe(t.literal("FRI")),
164
- maxAmount: e,
165
- maxPricePerUnit: e,
166
- token: g
167
161
  }), _ = t.object({
162
+ ...d,
163
+ unit: t.string().transform((e) => e.toUpperCase()).pipe(t.literal("FRI")),
164
+ maxAmount: a,
165
+ maxPricePerUnit: a,
166
+ token: g
167
+ }), V = t.object({
168
168
  token: g,
169
- overallFee: e,
170
- maxFee: e
171
- }), d = P.or(T), V = d.or(_), I = t.object({
169
+ overallFee: a,
170
+ maxFee: a
171
+ }), b = P.or(_), I = b.or(V), N = t.object({
172
172
  type: t.string(),
173
173
  label: t.string(),
174
174
  tokenId: t.string().optional(),
@@ -179,62 +179,68 @@ const k = t.object({
179
179
  tokenIdDetails: t.object({
180
180
  name: t.string().optional(),
181
181
  description: t.string().optional(),
182
- imageUrls: m.optional()
182
+ imageUrls: p.optional()
183
183
  }).optional()
184
- }), N = t.object({
184
+ }), R = t.object({
185
185
  approvals: t.array(A).optional(),
186
- transfers: t.array(D).optional(),
186
+ transfers: t.array(T).optional(),
187
187
  calculatedNonce: t.string().optional(),
188
- feeEstimation: d,
189
- feeEstimations: t.array(V),
190
- summary: t.array(I).optional()
191
- }), R = t.object({
188
+ feeEstimation: b,
189
+ feeEstimations: t.array(I),
190
+ summary: t.array(N).optional()
191
+ }), C = t.object({
192
192
  label: t.string().optional(),
193
193
  code: t.number().optional(),
194
194
  message: t.string().optional(),
195
195
  error: t.string().optional()
196
- }), b = t.object({
197
- reviewOfTransaction: c,
198
- simulation: N,
199
- simulationError: t.undefined()
200
196
  }), u = t.object({
201
- reviewOfTransaction: c,
197
+ reviewOfTransaction: m,
198
+ simulation: R,
199
+ simulationError: t.undefined()
200
+ }), S = t.object({
201
+ reviewOfTransaction: m,
202
202
  simulation: t.undefined(),
203
- simulationError: R
204
- }), r = b.or(u), z = t.object({
205
- transactions: t.array(r).optional()
203
+ simulationError: C
204
+ }), s = u.or(S), r = t.object({
205
+ subsidiseDeployment: t.boolean(),
206
+ subsidiseTransaction: t.boolean()
206
207
  }), H = t.object({
207
- transactions: t.array(r).optional(),
208
+ transactions: t.array(s).optional(),
209
+ subsidyStatus: r.optional()
210
+ }), W = t.object({
211
+ transactions: t.array(s).optional(),
212
+ subsidyStatus: r.optional(),
208
213
  enrichedFeeEstimation: h.optional(),
209
214
  isBackendDown: t.boolean().default(!1).optional()
210
- }), W = t.object({
211
- transactions: t.array(r).optional(),
212
- enrichedFeeEstimation: t.array(S).optional(),
215
+ }), q = t.object({
216
+ transactions: t.array(s).optional(),
217
+ subsidyStatus: r.optional(),
218
+ enrichedFeeEstimation: t.array(y).optional(),
213
219
  isBackendDown: t.boolean().default(!1).optional()
214
220
  });
215
- function q(a) {
216
- return b.safeParse(a).success;
221
+ function J(e) {
222
+ return u.safeParse(e).success;
217
223
  }
218
- function J(a) {
219
- return u.safeParse(a).success;
224
+ function K(e) {
225
+ return S.safeParse(e).success;
220
226
  }
221
227
  export {
222
- v as actionSchema,
223
- w as assessmentSchema,
224
- H as enrichedSimulateAndReviewSchema,
225
- W as enrichedSimulateAndReviewV2Schema,
226
- V as feeEstimationNativeOrPaymasterSchema,
227
- d as feeEstimationSchema,
228
+ w as actionSchema,
229
+ E as assessmentSchema,
230
+ W as enrichedSimulateAndReviewSchema,
231
+ q as enrichedSimulateAndReviewV2Schema,
232
+ I as feeEstimationNativeOrPaymasterSchema,
233
+ b as feeEstimationSchema,
228
234
  P as feeEstimationTxV1Schema,
229
- T as feeEstimationTxV3Schema,
230
- q as isNotTransactionSimulationError,
231
- J as isTransactionSimulationError,
232
- _ as paymasterFeeEstimationSchema,
235
+ _ as feeEstimationTxV3Schema,
236
+ J as isNotTransactionSimulationError,
237
+ K as isTransactionSimulationError,
238
+ V as paymasterFeeEstimationSchema,
233
239
  g as paymasterFeeTokenSchema,
234
- s as propertySchema,
235
- F as reviewSchema,
236
- z as simulateAndReviewSchema,
237
- U as targetedDappSchema,
238
- E as warningDetailsSchema,
239
- l as warningSchema
240
+ l as propertySchema,
241
+ U as reviewSchema,
242
+ H as simulateAndReviewSchema,
243
+ x as targetedDappSchema,
244
+ F as warningDetailsSchema,
245
+ c as warningSchema
240
246
  };
@@ -1 +1 @@
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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chains/starknet/address.cjs"),r=require("../chains/starknet/constants.cjs"),o=require("../chains/starknet/services/deploymentData/getAccountClassHash.cjs"),u=[r.STRK_TOKEN_ADDRESS];function n({address:e}){return u.some(s=>t.isEqualAddress(e,s))}function a(e){return e?o.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";
3
1
  import { isEqualAddress as o } from "../chains/starknet/address.js";
4
- const n = [s];
2
+ import { STRK_TOKEN_ADDRESS as t } from "../chains/starknet/constants.js";
3
+ import { getArgentAccountClassHashesWithTxV3Support as s } from "../chains/starknet/services/deploymentData/getAccountClassHash.js";
4
+ const n = [t];
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 ? t().some((e) => o(e, r)) : !1;
9
+ return r ? s().some((e) => o(e, r)) : !1;
10
10
  }
11
11
  export {
12
12
  m as classHashSupportsTxV3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),h=require("../../chains/starknet/address.cjs"),t=a.z.union([a.z.string(),a.z.number(),a.z.bigint()]),l=a.z.object({low:t,high:t}),o=a.z.array(a.z.string()).and(a.z.object({__compiled__:a.z.boolean().optional()}).optional()),s=a.z.lazy(()=>a.z.array(a.z.union([r,a.z.array(r),c]))),r=a.z.union([t,l,a.z.any(),a.z.boolean()]),i=a.z.lazy(()=>a.z.record(a.z.union([r,a.z.array(r),c]))),c=a.z.lazy(()=>a.z.union([i,s])),z=a.z.union([c,o]).optional(),m=a.z.lazy(()=>a.z.object({contractAddress:a.z.string(),calldata:z,entrypoint:a.z.string().optional()})),d=a.z.lazy(()=>m.and(a.z.object({entrypoint:a.z.string()}))),e=a.z.string().refine(n=>typeof parseInt(n)=="number"),S=a.z.tuple([e]),g=a.z.tuple([e]),u=a.z.object({new_threshold:a.z.string().refine(n=>typeof parseInt(n)=="number"),signers_to_add:a.z.array(e)}),p=a.z.object({new_threshold:a.z.string().refine(n=>typeof parseInt(n)=="number"),signers_to_remove:a.z.array(e)}),y=a.z.object({signer_to_remove:e,signer_to_add:e}),b=a.z.tuple([e]),C=a.z.tuple([e]),j=a.z.tuple([e]),w=a.z.tuple([e]).rest(e),_=a.z.object({recipient:h.addressSchema,amount:a.z.object({low:t,high:t})}),f=a.z.object({types:a.z.record(a.z.array(a.z.union([a.z.object({name:a.z.string(),type:a.z.literal("merkletree"),contains:a.z.string()}),a.z.object({name:a.z.string(),type:a.z.literal("enum"),contains:a.z.string()}),a.z.object({name:a.z.string(),type:a.z.string()})]))),primaryType:a.z.string(),domain:a.z.record(a.z.unknown()),message:a.z.object({})});exports.addOwnersCalldataSchema=u;exports.addPluginCalldataSchema=C;exports.bigNumberishSchema=t;exports.callDetailsSchema=m;exports.callSchema=d;exports.calldataSchema=o;exports.changeGuardianCalldataSchema=S;exports.changeThresholdCalldataSchema=b;exports.escapeGuardianCalldataSchema=g;exports.executeOnPluginCalldataSchema=w;exports.feltSchema=e;exports.looseCalldataSchema=z;exports.multiTypeSchema=r;exports.rawArgsArraySchema=s;exports.rawArgsObjectSchema=i;exports.rawArgsSchema=c;exports.removeOwnersCalldataSchema=p;exports.removePluginCalldataSchema=j;exports.replaceSignerCalldataSchema=y;exports.transferCalldataSchema=_;exports.typedDataSchema=f;exports.uint256Schema=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),h=require("../../chains/starknet/address.cjs"),t=a.z.union([a.z.string(),a.z.number(),a.z.bigint()]),l=a.z.object({low:t,high:t}),o=a.z.array(a.z.string()).and(a.z.object({__compiled__:a.z.boolean().optional()}).optional()),s=a.z.lazy(()=>a.z.array(a.z.union([r,a.z.array(r),c]))),r=a.z.union([t,l,a.z.any(),a.z.boolean()]),i=a.z.lazy(()=>a.z.record(a.z.union([r,a.z.array(r),c]))),c=a.z.lazy(()=>a.z.union([i,s])),z=a.z.union([c,o]).optional(),m=a.z.lazy(()=>a.z.object({contractAddress:a.z.string(),calldata:z,entrypoint:a.z.string().optional()})),d=a.z.lazy(()=>m.and(a.z.object({entrypoint:a.z.string()}))),e=a.z.string().refine(n=>typeof parseInt(n)=="number"),S=a.z.tuple([e]),g=a.z.tuple([e]),u=a.z.object({new_threshold:a.z.string().refine(n=>typeof parseInt(n)=="number"),signers_to_add:a.z.array(e)}),p=a.z.object({new_threshold:a.z.string().refine(n=>typeof parseInt(n)=="number"),signers_to_remove:a.z.array(e)}),y=a.z.object({signer_to_remove:e,signer_to_add:e}),b=a.z.tuple([e]),C=a.z.tuple([e]),j=a.z.tuple([e]),w=a.z.tuple([e]).rest(e),_=a.z.object({recipient:h.addressSchema,amount:a.z.object({low:t,high:t})}),f=a.z.object({types:a.z.record(a.z.array(a.z.union([a.z.object({name:a.z.string(),type:a.z.literal("merkletree"),contains:a.z.string()}),a.z.object({name:a.z.string(),type:a.z.literal("enum"),contains:a.z.string()}),a.z.object({name:a.z.string(),type:a.z.string()})]))),primaryType:a.z.string(),domain:a.z.record(a.z.unknown()),message:a.z.record(a.z.string(),a.z.any()).or(a.z.object({}).passthrough())});exports.addOwnersCalldataSchema=u;exports.addPluginCalldataSchema=C;exports.bigNumberishSchema=t;exports.callDetailsSchema=m;exports.callSchema=d;exports.calldataSchema=o;exports.changeGuardianCalldataSchema=S;exports.changeThresholdCalldataSchema=b;exports.escapeGuardianCalldataSchema=g;exports.executeOnPluginCalldataSchema=w;exports.feltSchema=e;exports.looseCalldataSchema=z;exports.multiTypeSchema=r;exports.rawArgsArraySchema=s;exports.rawArgsObjectSchema=i;exports.rawArgsSchema=c;exports.removeOwnersCalldataSchema=p;exports.removePluginCalldataSchema=j;exports.replaceSignerCalldataSchema=y;exports.transferCalldataSchema=_;exports.typedDataSchema=f;exports.uint256Schema=l;
@@ -139,9 +139,9 @@ export declare const typedDataSchema: z.ZodObject<{
139
139
  }>]>, "many">>;
140
140
  primaryType: z.ZodString;
141
141
  domain: z.ZodRecord<z.ZodString, z.ZodUnknown>;
142
- message: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
142
+ message: z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>]>;
143
143
  }, "strip", z.ZodTypeAny, {
144
- message: {};
144
+ message: Record<string, any> | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
145
145
  types: Record<string, ({
146
146
  name: string;
147
147
  type: "merkletree";
@@ -157,7 +157,7 @@ export declare const typedDataSchema: z.ZodObject<{
157
157
  primaryType: string;
158
158
  domain: Record<string, unknown>;
159
159
  }, {
160
- message: {};
160
+ message: Record<string, any> | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
161
161
  types: Record<string, ({
162
162
  name: string;
163
163
  type: "merkletree";
@@ -50,7 +50,7 @@ const n = a.union([a.string(), a.number(), a.bigint()]), s = a.object({
50
50
  ]))),
51
51
  primaryType: a.string(),
52
52
  domain: a.record(a.unknown()),
53
- message: a.object({})
53
+ message: a.record(a.string(), a.any()).or(a.object({}).passthrough())
54
54
  });
55
55
  export {
56
56
  S as addOwnersCalldataSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.62.0",
3
+ "version": "1.62.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/argentlabs/x-shared.git"