@argent/x-shared 1.78.11 → 1.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./src/features/paymaster/PaymasterService.cjs"),e=require("./src/features/paymaster/types.cjs");exports.PaymasterService=a.PaymasterService;exports.paymasterDeployAccountParams=e.paymasterDeployAccountParams;exports.paymasterExecuteParams=e.paymasterExecuteParams;exports.paymasterExecuteResponse=e.paymasterExecuteResponse;exports.paymasterExecutionDataParams=e.paymasterExecutionDataParams;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./src/features/paymaster/PaymasterService.cjs"),e=require("./src/features/paymaster/types.cjs");exports.PaymasterService=a.PaymasterService;exports.canSubsidiseResponse=e.canSubsidiseResponse;exports.canUserSubsidiseParams=e.canUserSubsidiseParams;exports.paymasterDeployAccountParams=e.paymasterDeployAccountParams;exports.paymasterExecuteParams=e.paymasterExecuteParams;exports.paymasterExecuteResponse=e.paymasterExecuteResponse;exports.paymasterExecutionDataParams=e.paymasterExecutionDataParams;exports.subsidyCallSchema=e.subsidyCallSchema;
package/dist/paymaster.js CHANGED
@@ -1,9 +1,12 @@
1
- import { PaymasterService as r } from "./src/features/paymaster/PaymasterService.js";
2
- import { paymasterDeployAccountParams as m, paymasterExecuteParams as s, paymasterExecuteResponse as o, paymasterExecutionDataParams as p } from "./src/features/paymaster/types.js";
1
+ import { PaymasterService as s } from "./src/features/paymaster/PaymasterService.js";
2
+ import { canSubsidiseResponse as m, canUserSubsidiseParams as t, paymasterDeployAccountParams as c, paymasterExecuteParams as o, paymasterExecuteResponse as p, paymasterExecutionDataParams as i, subsidyCallSchema as u } from "./src/features/paymaster/types.js";
3
3
  export {
4
- r as PaymasterService,
5
- m as paymasterDeployAccountParams,
6
- s as paymasterExecuteParams,
7
- o as paymasterExecuteResponse,
8
- p as paymasterExecutionDataParams
4
+ s as PaymasterService,
5
+ m as canSubsidiseResponse,
6
+ t as canUserSubsidiseParams,
7
+ c as paymasterDeployAccountParams,
8
+ o as paymasterExecuteParams,
9
+ p as paymasterExecuteResponse,
10
+ i as paymasterExecutionDataParams,
11
+ u as subsidyCallSchema
9
12
  };
@@ -1,7 +1,8 @@
1
1
  import { TypedData } from 'starknet';
2
- import { PaymasterExecutionDataParams, PaymasterExecuteParams, PaymasterOptions, PaymasterDeployAccountParams } from './types';
2
+ import { CanUserSubsidiseParams, PaymasterExecutionDataParams, PaymasterExecuteParams, PaymasterOptions, PaymasterDeployAccountParams } from './types';
3
3
  export interface IPaymasterService {
4
4
  getExecutionData(params: PaymasterExecutionDataParams, options?: PaymasterOptions): Promise<TypedData>;
5
5
  execute(params: PaymasterExecuteParams, options?: PaymasterOptions): Promise<string>;
6
6
  deployAccount(params: PaymasterDeployAccountParams, options?: PaymasterOptions): Promise<string>;
7
+ canUserSubsidise(params: CanUserSubsidiseParams, options?: PaymasterOptions): Promise<boolean>;
7
8
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("starknet"),p=require("url-join"),v=require("./types.cjs"),h=require("../../chains/starknet/network.cjs"),A=require("../../utils/starknet/starknet.cjs"),d=require("../../utils/url/urlWithQuery.cjs");class f{constructor(e="",t){this.argentRelayerUrl=e,this.httpService=t}async getExecutionData(e,t={}){const{useAvnu:o,isSubsidised:i}=t,{networkId:s}=e,u=s?{network:h.getArgentNetwork(s)}:void 0,r=o?p(this.getAvnuUrl(s),"/build-typed-data"):d.urlWithQuery([this.argentRelayerUrl,"/build-typed-data"],u),c={calls:o?e.calls.map(y=>({contractAddress:n.num.toHex(y.contractAddress),calldata:n.CallData.toCalldata(y.calldata).map(w=>n.num.toHex(w)),entrypoint:y.entrypoint})):e.calls,userAddress:e.accountAddress,gasTokenAddress:i?null:n.num.toHex(e.feeTokenAddress),maxGasTokenAmount:i?null:n.num.toHex(e.maxFee),accountClassHash:e.accountClassHash},a=await this.httpService.post(r,{body:n.json.stringify(c),headers:{"Content-Type":"application/json"}}),g=A.typedDataSchema.safeParse(a);if(!g.success)throw new Error("Invalid response from paymaster");return g.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:o,isSubsidised:i}=t,{networkId:s}=e,u=s?{network:h.getArgentNetwork(s)}:void 0;let r=o?p(this.getAvnuUrl(s),"/execute"):d.urlWithQuery([this.argentRelayerUrl,"/execute"],u);i&&(r=d.urlWithQuery(r,{isSubsidised:"true"}));const l={signature:e.signature,userAddress:e.accountAddress,typedData:o?n.json.stringify(e.typedData):e.typedData,deploymentData:e.deploymentData},c=await this.httpService.post(r,{body:n.json.stringify(l),headers:{"Content-Type":"application/json"}}),a=v.paymasterExecuteResponse.safeParse(c);if(!a.success)throw new Error("Invalid response from paymaster");return a.data.transactionHash}async deployAccount(e,t={}){const{useAvnu:o,isSubsidised:i}=t,{networkId:s}=e,u=s?{network:h.getArgentNetwork(s)}:void 0;let r=o?p(this.getAvnuUrl(s),"/execute"):d.urlWithQuery([this.argentRelayerUrl,"/execute"],u);i&&(r=d.urlWithQuery(r,{isSubsidised:"true"}));const l={userAddress:e.accountAddress,deploymentData:e.deploymentData},c=await this.httpService.post(r,{body:n.json.stringify(l),headers:{"Content-Type":"application/json"}}),a=v.paymasterExecuteResponse.safeParse(c);if(!a.success)throw new Error("Invalid response from paymaster");return a.data.transactionHash}}exports.PaymasterService=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("starknet"),g=require("url-join"),w=require("./types.cjs"),v=require("../../chains/starknet/network.cjs"),m=require("../../utils/starknet/starknet.cjs"),c=require("../../utils/url/urlWithQuery.cjs");class k{constructor(e="",t){this.argentRelayerUrl=e,this.httpService=t}async buildRequestInit(e,t,n,a={}){const s=a.getAdditionalHeaders?await a.getAdditionalHeaders(e,t,n):{};return{body:n,headers:{"Content-Type":"application/json",...s}}}async getExecutionData(e,t={}){const{useAvnu:n,isSubsidised:a}=t,{networkId:s}=e,o=s?{network:v.getArgentNetwork(s)}:void 0,r=n?g(this.getAvnuUrl(s),"/build-typed-data"):c.urlWithQuery([this.argentRelayerUrl,"/build-typed-data"],o),d=n?e.calls.map(p=>({contractAddress:i.num.toHex(p.contractAddress),calldata:i.CallData.toCalldata(p.calldata).map(b=>i.num.toHex(b)),entrypoint:p.entrypoint})):e.calls,l=a?null:e.feeTokenAddress!==void 0?i.num.toHex(e.feeTokenAddress):void 0,y=a?null:e.maxFee!==void 0?i.num.toHex(e.maxFee):void 0,h={calls:d,userAddress:e.accountAddress,gasTokenAddress:l,maxGasTokenAmount:y,accountClassHash:e.accountClassHash},u=i.json.stringify(h),A=await this.buildRequestInit(r,"POST",u,t),S=await this.httpService.post(r,A),f=m.typedDataSchema.safeParse(S);if(!f.success)throw new Error("Invalid response from paymaster");return f.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:a}=t,{networkId:s}=e,o=s?{network:v.getArgentNetwork(s)}:void 0;let r=n?g(this.getAvnuUrl(s),"/execute"):c.urlWithQuery([this.argentRelayerUrl,"/execute"],o);a&&(r=c.urlWithQuery(r,{isSubsidised:"true"}));const d={signature:e.signature,userAddress:e.accountAddress,typedData:n?i.json.stringify(e.typedData):e.typedData,deploymentData:e.deploymentData},l=i.json.stringify(d),y=await this.buildRequestInit(r,"POST",l,t),h=await this.httpService.post(r,y),u=w.paymasterExecuteResponse.safeParse(h);if(!u.success)throw new Error("Invalid response from paymaster");return u.data.transactionHash}async deployAccount(e,t={}){const{useAvnu:n,isSubsidised:a}=t,{networkId:s}=e,o=s?{network:v.getArgentNetwork(s)}:void 0;let r=n?g(this.getAvnuUrl(s),"/execute"):c.urlWithQuery([this.argentRelayerUrl,"/execute"],o);a&&(r=c.urlWithQuery(r,{isSubsidised:"true"}));const d={userAddress:e.accountAddress,deploymentData:e.deploymentData},l=i.json.stringify(d),y=await this.buildRequestInit(r,"POST",l,t),h=await this.httpService.post(r,y),u=w.paymasterExecuteResponse.safeParse(h);if(!u.success)throw new Error("Invalid response from paymaster");return u.data.transactionHash}async canUserSubsidise(e,t={}){const n=c.urlWithQuery([this.argentRelayerUrl,"/can-user-subsidise"]),a=i.json.stringify(e),s=await this.buildRequestInit(n,"POST",a,t),o=await this.httpService.post(n,s),r=w.canSubsidiseResponse.safeParse(o);if(!r.success)throw new Error("Invalid response from paymaster");return r.data.canSubsidise}}exports.PaymasterService=k;
@@ -1,13 +1,15 @@
1
1
  import { TypedData } from '@starknet-io/types-js';
2
2
  import { IHttpService } from '../../http';
3
3
  import { IPaymasterService } from './IPaymasterService';
4
- import { PaymasterDeployAccountParams, PaymasterOptions, PaymasterExecuteParams, PaymasterExecutionDataParams } from './types';
4
+ import { CanUserSubsidiseParams, PaymasterDeployAccountParams, PaymasterOptions, PaymasterExecuteParams, PaymasterExecutionDataParams } from './types';
5
5
  export declare class PaymasterService implements IPaymasterService {
6
6
  private readonly argentRelayerUrl;
7
7
  private readonly httpService;
8
8
  constructor(argentRelayerUrl: string | undefined, httpService: IHttpService);
9
+ private buildRequestInit;
9
10
  getExecutionData(params: PaymasterExecutionDataParams, options?: PaymasterOptions): Promise<TypedData>;
10
11
  getAvnuUrl(networkId?: string): string;
11
12
  execute(params: PaymasterExecuteParams, options?: PaymasterOptions): Promise<string>;
12
13
  deployAccount(params: PaymasterDeployAccountParams, options?: PaymasterOptions): Promise<string>;
14
+ canUserSubsidise(params: CanUserSubsidiseParams, options?: PaymasterOptions): Promise<boolean>;
13
15
  }
@@ -1,33 +1,38 @@
1
- import { CallData as A, num as u, json as p } from "starknet";
2
- import h from "url-join";
3
- import { paymasterExecuteResponse as v } from "./types.js";
4
- import { getArgentNetwork as f } from "../../chains/starknet/network.js";
5
- import { typedDataSchema as g } from "../../utils/starknet/starknet.js";
6
- import { urlWithQuery as c } from "../../utils/url/urlWithQuery.js";
7
- class U {
1
+ import { CallData as x, num as h, json as y } from "starknet";
2
+ import w from "url-join";
3
+ import { paymasterExecuteResponse as m, canSubsidiseResponse as R } from "./types.js";
4
+ import { getArgentNetwork as v } from "../../chains/starknet/network.js";
5
+ import { typedDataSchema as k } from "../../utils/starknet/starknet.js";
6
+ import { urlWithQuery as d } from "../../utils/url/urlWithQuery.js";
7
+ class E {
8
8
  constructor(e = "", t) {
9
9
  this.argentRelayerUrl = e, this.httpService = t;
10
10
  }
11
+ async buildRequestInit(e, t, n, a = {}) {
12
+ const s = a.getAdditionalHeaders ? await a.getAdditionalHeaders(e, t, n) : {};
13
+ return {
14
+ body: n,
15
+ headers: {
16
+ "Content-Type": "application/json",
17
+ ...s
18
+ }
19
+ };
20
+ }
11
21
  async getExecutionData(e, t = {}) {
12
- const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: f(s) } : void 0, r = n ? h(this.getAvnuUrl(s), "/build-typed-data") : c([this.argentRelayerUrl, "/build-typed-data"], i), d = {
13
- calls: n ? e.calls.map((y) => ({
14
- contractAddress: u.toHex(y.contractAddress),
15
- calldata: A.toCalldata(y.calldata).map((w) => u.toHex(w)),
16
- entrypoint: y.entrypoint
17
- })) : e.calls,
22
+ const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: v(s) } : void 0, r = n ? w(this.getAvnuUrl(s), "/build-typed-data") : d([this.argentRelayerUrl, "/build-typed-data"], i), c = n ? e.calls.map((f) => ({
23
+ contractAddress: h.toHex(f.contractAddress),
24
+ calldata: x.toCalldata(f.calldata).map((b) => h.toHex(b)),
25
+ entrypoint: f.entrypoint
26
+ })) : e.calls, u = a ? null : e.feeTokenAddress !== void 0 ? h.toHex(e.feeTokenAddress) : void 0, l = a ? null : e.maxFee !== void 0 ? h.toHex(e.maxFee) : void 0, p = {
27
+ calls: c,
18
28
  userAddress: e.accountAddress,
19
- gasTokenAddress: a ? null : u.toHex(e.feeTokenAddress),
20
- maxGasTokenAmount: a ? null : u.toHex(e.maxFee),
29
+ gasTokenAddress: u,
30
+ maxGasTokenAmount: l,
21
31
  accountClassHash: e.accountClassHash
22
- }, o = await this.httpService.post(r, {
23
- body: p.stringify(d),
24
- headers: {
25
- "Content-Type": "application/json"
26
- }
27
- }), m = g.safeParse(o);
28
- if (!m.success)
32
+ }, o = y.stringify(p), A = await this.buildRequestInit(r, "POST", o, t), S = await this.httpService.post(r, A), g = k.safeParse(S);
33
+ if (!g.success)
29
34
  throw new Error("Invalid response from paymaster");
30
- return m.data;
35
+ return g.data;
31
36
  }
32
37
  getAvnuUrl(e) {
33
38
  if (!e)
@@ -42,46 +47,42 @@ class U {
42
47
  return `https://${t}.api.avnu.fi/paymaster/v1`;
43
48
  }
44
49
  async execute(e, t = {}) {
45
- const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: f(s) } : void 0;
46
- let r = n ? h(this.getAvnuUrl(s), "/execute") : c([this.argentRelayerUrl, "/execute"], i);
47
- a && (r = c(r, {
50
+ const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: v(s) } : void 0;
51
+ let r = n ? w(this.getAvnuUrl(s), "/execute") : d([this.argentRelayerUrl, "/execute"], i);
52
+ a && (r = d(r, {
48
53
  isSubsidised: "true"
49
54
  }));
50
- const l = {
55
+ const c = {
51
56
  signature: e.signature,
52
57
  userAddress: e.accountAddress,
53
- typedData: n ? p.stringify(e.typedData) : e.typedData,
58
+ typedData: n ? y.stringify(e.typedData) : e.typedData,
54
59
  deploymentData: e.deploymentData
55
- }, d = await this.httpService.post(r, {
56
- body: p.stringify(l),
57
- headers: {
58
- "Content-Type": "application/json"
59
- }
60
- }), o = v.safeParse(d);
60
+ }, u = y.stringify(c), l = await this.buildRequestInit(r, "POST", u, t), p = await this.httpService.post(r, l), o = m.safeParse(p);
61
61
  if (!o.success)
62
62
  throw new Error("Invalid response from paymaster");
63
63
  return o.data.transactionHash;
64
64
  }
65
65
  async deployAccount(e, t = {}) {
66
- const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: f(s) } : void 0;
67
- let r = n ? h(this.getAvnuUrl(s), "/execute") : c([this.argentRelayerUrl, "/execute"], i);
68
- a && (r = c(r, {
66
+ const { useAvnu: n, isSubsidised: a } = t, { networkId: s } = e, i = s ? { network: v(s) } : void 0;
67
+ let r = n ? w(this.getAvnuUrl(s), "/execute") : d([this.argentRelayerUrl, "/execute"], i);
68
+ a && (r = d(r, {
69
69
  isSubsidised: "true"
70
70
  }));
71
- const l = {
71
+ const c = {
72
72
  userAddress: e.accountAddress,
73
73
  deploymentData: e.deploymentData
74
- }, d = await this.httpService.post(r, {
75
- body: p.stringify(l),
76
- headers: {
77
- "Content-Type": "application/json"
78
- }
79
- }), o = v.safeParse(d);
74
+ }, u = y.stringify(c), l = await this.buildRequestInit(r, "POST", u, t), p = await this.httpService.post(r, l), o = m.safeParse(p);
80
75
  if (!o.success)
81
76
  throw new Error("Invalid response from paymaster");
82
77
  return o.data.transactionHash;
83
78
  }
79
+ async canUserSubsidise(e, t = {}) {
80
+ const n = d([this.argentRelayerUrl, "/can-user-subsidise"]), a = y.stringify(e), s = await this.buildRequestInit(n, "POST", a, t), i = await this.httpService.post(n, s), r = R.safeParse(i);
81
+ if (!r.success)
82
+ throw new Error("Invalid response from paymaster");
83
+ return r.data.canSubsidise;
84
+ }
84
85
  }
85
86
  export {
86
- U as PaymasterService
87
+ E as PaymasterService
87
88
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),t=require("../../chains/starknet/address.cjs"),r=require("../../utils/starknet/starknet.cjs"),e=require("../../backend/schema.cjs"),s=a.z.object({calls:a.z.array(r.callSchema),accountAddress:t.addressSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),feeTokenAddress:t.addressSchema,maxFee:r.bigNumberishSchema,accountClassHash:a.z.string().optional()}),o=a.z.object({signature:a.z.string().array(),accountAddress:t.addressSchema,typedData:r.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()}),c=a.z.object({accountAddress:t.addressSchema,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()});exports.paymasterDeployAccountParams=c;exports.paymasterExecuteParams=o;exports.paymasterExecuteResponse=n;exports.paymasterExecutionDataParams=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),t=require("../../chains/starknet/address.cjs"),s=require("../../utils/starknet/starknet.cjs"),e=require("../../backend/schema.cjs"),o=a.z.object({calls:a.z.array(s.callSchema),accountAddress:t.addressSchema,networkId:e.argentNetworkIdSchema.or(e.argentBackendNetworkIdSchema).optional(),feeTokenAddress:t.addressSchema.optional(),maxFee:s.bigNumberishSchema.optional(),accountClassHash:a.z.string().optional()}),n=a.z.object({signature:a.z.string().array(),accountAddress:t.addressSchema,typedData:s.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()}),c=a.z.object({transactionHash:a.z.string()}),r=a.z.object({contractAddress:a.z.string(),entrypoint:a.z.string(),calldata:a.z.array(a.z.string()).optional()}),i=a.z.object({accountAddress:t.addressSchema,calls:a.z.array(r)}),d=a.z.object({canSubsidise:a.z.boolean()}),l=a.z.object({accountAddress:t.addressSchema,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()});exports.canSubsidiseResponse=d;exports.canUserSubsidiseParams=i;exports.paymasterDeployAccountParams=l;exports.paymasterExecuteParams=n;exports.paymasterExecuteResponse=c;exports.paymasterExecutionDataParams=o;exports.subsidyCallSchema=r;
@@ -9,8 +9,8 @@ export declare const paymasterExecutionDataParams: z.ZodObject<{
9
9
  mainnet: "mainnet";
10
10
  sepolia: "sepolia";
11
11
  }>]>>;
12
- feeTokenAddress: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodString>, z.ZodTransform<`0x${string}`, string>>;
13
- maxFee: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBigInt]>;
12
+ feeTokenAddress: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodString>, z.ZodTransform<`0x${string}`, string>>>;
13
+ maxFee: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBigInt]>>;
14
14
  accountClassHash: z.ZodOptional<z.ZodString>;
15
15
  }, z.core.$strip>;
16
16
  export type PaymasterExecutionDataParams = z.infer<typeof paymasterExecutionDataParams>;
@@ -56,7 +56,25 @@ export type PaymasterExecuteResponse = z.infer<typeof paymasterExecuteResponse>;
56
56
  export type PaymasterOptions = {
57
57
  useAvnu?: boolean;
58
58
  isSubsidised?: boolean;
59
+ getAdditionalHeaders?: (url: string, method: string, body?: string) => Promise<Record<string, string>>;
59
60
  };
61
+ export declare const subsidyCallSchema: z.ZodObject<{
62
+ contractAddress: z.ZodString;
63
+ entrypoint: z.ZodString;
64
+ calldata: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
+ }, z.core.$strip>;
66
+ export declare const canUserSubsidiseParams: z.ZodObject<{
67
+ accountAddress: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodString>, z.ZodTransform<`0x${string}`, string>>;
68
+ calls: z.ZodArray<z.ZodObject<{
69
+ contractAddress: z.ZodString;
70
+ entrypoint: z.ZodString;
71
+ calldata: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$strip>;
74
+ export type CanUserSubsidiseParams = z.infer<typeof canUserSubsidiseParams>;
75
+ export declare const canSubsidiseResponse: z.ZodObject<{
76
+ canSubsidise: z.ZodBoolean;
77
+ }, z.core.$strip>;
60
78
  export declare const paymasterDeployAccountParams: z.ZodObject<{
61
79
  accountAddress: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodString>, z.ZodTransform<`0x${string}`, string>>;
62
80
  networkId: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
@@ -1,30 +1,39 @@
1
1
  import { z as a } from "zod";
2
2
  import { addressSchema as t } from "../../chains/starknet/address.js";
3
- import { bigNumberishSchema as e, callSchema as n, typedDataSchema as s } from "../../utils/starknet/starknet.js";
4
- import { argentNetworkIdSchema as o, argentBackendNetworkIdSchema as r } from "../../backend/schema.js";
5
- const p = a.object({
6
- calls: a.array(n),
3
+ import { bigNumberishSchema as r, callSchema as e, typedDataSchema as n } from "../../utils/starknet/starknet.js";
4
+ import { argentNetworkIdSchema as o, argentBackendNetworkIdSchema as s } from "../../backend/schema.js";
5
+ const m = a.object({
6
+ calls: a.array(e),
7
7
  accountAddress: t,
8
- networkId: o.or(r).optional(),
9
- feeTokenAddress: t,
10
- maxFee: e,
8
+ networkId: o.or(s).optional(),
9
+ feeTokenAddress: t.optional(),
10
+ maxFee: r.optional(),
11
11
  accountClassHash: a.string().optional()
12
- }), d = a.object({
12
+ }), u = a.object({
13
13
  signature: a.string().array(),
14
14
  accountAddress: t,
15
- typedData: s,
16
- networkId: o.or(r).optional(),
15
+ typedData: n,
16
+ networkId: o.or(s).optional(),
17
17
  deploymentData: a.object({
18
18
  class_hash: a.string().optional(),
19
19
  salt: a.string().or(a.number()).or(a.bigint()).optional(),
20
20
  unique: a.string(),
21
21
  calldata: a.array(a.string())
22
22
  }).optional()
23
- }), g = a.object({
23
+ }), b = a.object({
24
24
  transactionHash: a.string()
25
- }), u = a.object({
25
+ }), c = a.object({
26
+ contractAddress: a.string(),
27
+ entrypoint: a.string(),
28
+ calldata: a.array(a.string()).optional()
29
+ }), g = a.object({
30
+ accountAddress: t,
31
+ calls: a.array(c)
32
+ }), y = a.object({
33
+ canSubsidise: a.boolean()
34
+ }), h = a.object({
26
35
  accountAddress: t,
27
- networkId: o.or(r).optional(),
36
+ networkId: o.or(s).optional(),
28
37
  deploymentData: a.object({
29
38
  class_hash: a.string().optional(),
30
39
  salt: a.string().or(a.number()).or(a.bigint()).optional(),
@@ -33,8 +42,11 @@ const p = a.object({
33
42
  }).optional()
34
43
  });
35
44
  export {
36
- u as paymasterDeployAccountParams,
37
- d as paymasterExecuteParams,
38
- g as paymasterExecuteResponse,
39
- p as paymasterExecutionDataParams
45
+ y as canSubsidiseResponse,
46
+ g as canUserSubsidiseParams,
47
+ h as paymasterDeployAccountParams,
48
+ u as paymasterExecuteParams,
49
+ b as paymasterExecuteResponse,
50
+ m as paymasterExecutionDataParams,
51
+ c as subsidyCallSchema
40
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.78.11",
3
+ "version": "1.79.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/argentlabs/x-shared.git"