@argent/x-shared 1.75.9 → 1.77.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 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"
@@ -1 +1 @@
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
+ "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()});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";
2
3
  import { bigNumberishSchema as o, callSchema as s, typedDataSchema as n } from "../../utils/starknet/starknet.js";
3
4
  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 c=require("lodash-es"),o=require("./HttpError.cjs"),u=require("./IHttpService.cjs");class d{constructor(n,e="json"){this.requestInit=n,this.responseType=e}async get(n,e){const s=c.isFunction(this.requestInit)?await this.requestInit():this.requestInit,a={...s,...e,method:"GET",headers:{...s?.headers,...e?.headers}},t=await fetch(n,a).catch(async r=>{let i;throw r instanceof Response&&(i=await r.json().catch(()=>{})),new o.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_FETCH_URL,0,i)});if(this.responseType==="json"){if(!t.ok)throw new o.HttpError(t.statusText,t.status,await t.json().catch(()=>{}));return await t.json()}return t}async post(n,e,s){const a=c.isFunction(this.requestInit)?await this.requestInit():this.requestInit,t={...a,...e,method:"POST",headers:{...a?.headers,...e?.headers}},r=await fetch(n,t).catch(()=>{throw new o.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_POST_URL,0)});if(!r.ok)throw new o.HttpError(r.statusText,r.status,await r.json());if(r.status===204)return{};const i=await r.json();if(s)try{return s.parse(i)}catch(h){throw new o.HttpError(h.message,0)}return i}async put(n,e){const s=c.isFunction(this.requestInit)?await this.requestInit():this.requestInit,a={...s,...e,method:"PUT",headers:{...s?.headers,...e?.headers}},t=await fetch(n,a).catch(()=>{throw new o.HttpError("Failed to put url",0)});if(!t.ok)throw new o.HttpError(t.statusText,t.status);return await t.json()}async delete(n,e){const s=c.isFunction(this.requestInit)?await this.requestInit():this.requestInit,a={...s,...e,method:"DELETE",headers:{...s?.headers,...e?.headers}},t=await fetch(n,a).catch(()=>{throw new o.HttpError("Failed to delete url",0)});if(!t.ok)throw new o.HttpError(t.statusText,t.status)}}exports.HTTPService=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("lodash-es"),a=require("./HttpError.cjs"),u=require("./IHttpService.cjs");class w{constructor(o,e="json"){this.requestInit=o,this.responseType=e}async get(o,e,s){const n=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,r={...n,...e,method:"GET",headers:{...n?.headers,...e?.headers}},t=await fetch(o,r).catch(async i=>{let c;throw i instanceof Response&&(c=await i.json().catch(()=>{})),new a.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_FETCH_URL,0,c)});if(this.responseType==="json"){if(!t.ok)throw new a.HttpError(t.statusText,t.status,await t.json().catch(()=>{}));const i=await t.json();if(s)try{return s.parse(i)}catch(c){throw new a.HttpError(c.message,0)}return i}return t}async post(o,e,s){const n=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,r={...n,...e,method:"POST",headers:{...n?.headers,...e?.headers}},t=await fetch(o,r).catch(()=>{throw new a.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_POST_URL,0)});if(!t.ok)throw new a.HttpError(t.statusText,t.status,await t.json());if(t.status===204)return{};const i=await t.json();if(s)try{return s.parse(i)}catch(c){throw new a.HttpError(c.message,0)}return i}async put(o,e,s){const n=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,r={...n,...e,method:"PUT",headers:{...n?.headers,...e?.headers}},t=await fetch(o,r).catch(()=>{throw new a.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_PUT_URL,0)});if(!t.ok)throw new a.HttpError(t.statusText,t.status,await t.json().catch(()=>{}));if(t.status===204)return{};const i=await t.json();if(s)try{return s.parse(i)}catch(c){throw new a.HttpError(c.message,0)}return i}async delete(o,e){const s=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,n={...s,...e,method:"DELETE",headers:{...s?.headers,...e?.headers}},r=await fetch(o,n).catch(()=>{throw new a.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_DELETE_URL,0)});if(!r.ok)throw new a.HttpError(r.statusText,r.status)}async patch(o,e){const s=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,n={...s,...e,method:"PATCH",headers:{...s?.headers,...e?.headers}},r=await fetch(o,n).catch(()=>{throw new a.HttpError("Failed to patch url",0)});if(!r.ok)throw new a.HttpError(r.statusText,r.status);return await r.json()}}exports.HTTPService=w;
@@ -7,9 +7,10 @@ export declare class HTTPService implements IHttpService {
7
7
  private requestInit;
8
8
  private responseType;
9
9
  constructor(requestInit?: CanBeFn<RequestInit>, responseType?: ResponseType);
10
- get<T>(url: string, requestInit?: RequestInit): Promise<T>;
10
+ get<T>(url: string, requestInit?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
11
11
  post<T>(url: string, requestInit?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
12
- put<T>(url: string, requestInit?: RequestInit): Promise<T>;
12
+ put<T>(url: string, requestInit?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
13
13
  delete(url: string, requestInit?: RequestInit): Promise<void>;
14
+ patch<T>(url: string, requestInit?: RequestInit): Promise<T>;
14
15
  }
15
16
  export {};
@@ -1,35 +1,42 @@
1
- import { isFunction as h } from "lodash-es";
2
- import { HttpError as o } from "./HttpError.js";
1
+ import { isFunction as c } from "lodash-es";
2
+ import { HttpError as n } from "./HttpError.js";
3
3
  import { HTTP_ERROR_MESSAGE as u } from "./IHttpService.js";
4
- class T {
5
- constructor(n, e = "json") {
6
- this.requestInit = n, this.responseType = e;
4
+ class p {
5
+ constructor(o, e = "json") {
6
+ this.requestInit = o, this.responseType = e;
7
7
  }
8
- async get(n, e) {
9
- const s = h(this.requestInit) ? await this.requestInit() : this.requestInit, r = {
10
- ...s,
8
+ async get(o, e, s) {
9
+ const r = c(this.requestInit) ? await this.requestInit() : this.requestInit, a = {
10
+ ...r,
11
11
  ...e,
12
12
  method: "GET",
13
13
  // merge headers
14
14
  headers: {
15
- ...s?.headers,
15
+ ...r?.headers,
16
16
  ...e?.headers
17
17
  }
18
- }, t = await fetch(n, r).catch(async (a) => {
19
- let i;
20
- throw a instanceof Response && (i = await a.json().catch(() => {
21
- })), new o(u.FAILED_TO_FETCH_URL, 0, i);
18
+ }, t = await fetch(o, a).catch(async (i) => {
19
+ let h;
20
+ throw i instanceof Response && (h = await i.json().catch(() => {
21
+ })), new n(u.FAILED_TO_FETCH_URL, 0, h);
22
22
  });
23
23
  if (this.responseType === "json") {
24
24
  if (!t.ok)
25
- throw new o(t.statusText, t.status, await t.json().catch(() => {
25
+ throw new n(t.statusText, t.status, await t.json().catch(() => {
26
26
  }));
27
- return await t.json();
27
+ const i = await t.json();
28
+ if (s)
29
+ try {
30
+ return s.parse(i);
31
+ } catch (h) {
32
+ throw new n(h.message, 0);
33
+ }
34
+ return i;
28
35
  }
29
36
  return t;
30
37
  }
31
- async post(n, e, s) {
32
- const r = h(this.requestInit) ? await this.requestInit() : this.requestInit, t = {
38
+ async post(o, e, s) {
39
+ const r = c(this.requestInit) ? await this.requestInit() : this.requestInit, a = {
33
40
  ...r,
34
41
  ...e,
35
42
  method: "POST",
@@ -38,41 +45,51 @@ class T {
38
45
  ...r?.headers,
39
46
  ...e?.headers
40
47
  }
41
- }, a = await fetch(n, t).catch(() => {
42
- throw new o(u.FAILED_TO_POST_URL, 0);
48
+ }, t = await fetch(o, a).catch(() => {
49
+ throw new n(u.FAILED_TO_POST_URL, 0);
43
50
  });
44
- if (!a.ok)
45
- throw new o(a.statusText, a.status, await a.json());
46
- if (a.status === 204)
51
+ if (!t.ok)
52
+ throw new n(t.statusText, t.status, await t.json());
53
+ if (t.status === 204)
47
54
  return {};
48
- const i = await a.json();
55
+ const i = await t.json();
49
56
  if (s)
50
57
  try {
51
58
  return s.parse(i);
52
- } catch (c) {
53
- throw new o(c.message, 0);
59
+ } catch (h) {
60
+ throw new n(h.message, 0);
54
61
  }
55
62
  return i;
56
63
  }
57
- async put(n, e) {
58
- const s = h(this.requestInit) ? await this.requestInit() : this.requestInit, r = {
59
- ...s,
64
+ async put(o, e, s) {
65
+ const r = c(this.requestInit) ? await this.requestInit() : this.requestInit, a = {
66
+ ...r,
60
67
  ...e,
61
68
  method: "PUT",
62
69
  // merge headers
63
70
  headers: {
64
- ...s?.headers,
71
+ ...r?.headers,
65
72
  ...e?.headers
66
73
  }
67
- }, t = await fetch(n, r).catch(() => {
68
- throw new o("Failed to put url", 0);
74
+ }, t = await fetch(o, a).catch(() => {
75
+ throw new n(u.FAILED_TO_PUT_URL, 0);
69
76
  });
70
77
  if (!t.ok)
71
- throw new o(t.statusText, t.status);
72
- return await t.json();
78
+ throw new n(t.statusText, t.status, await t.json().catch(() => {
79
+ }));
80
+ if (t.status === 204)
81
+ return {};
82
+ const i = await t.json();
83
+ if (s)
84
+ try {
85
+ return s.parse(i);
86
+ } catch (h) {
87
+ throw new n(h.message, 0);
88
+ }
89
+ return i;
73
90
  }
74
- async delete(n, e) {
75
- const s = h(this.requestInit) ? await this.requestInit() : this.requestInit, r = {
91
+ async delete(o, e) {
92
+ const s = c(this.requestInit) ? await this.requestInit() : this.requestInit, r = {
76
93
  ...s,
77
94
  ...e,
78
95
  method: "DELETE",
@@ -81,13 +98,29 @@ class T {
81
98
  ...s?.headers,
82
99
  ...e?.headers
83
100
  }
84
- }, t = await fetch(n, r).catch(() => {
85
- throw new o("Failed to delete url", 0);
101
+ }, a = await fetch(o, r).catch(() => {
102
+ throw new n(u.FAILED_TO_DELETE_URL, 0);
86
103
  });
87
- if (!t.ok)
88
- throw new o(t.statusText, t.status);
104
+ if (!a.ok)
105
+ throw new n(a.statusText, a.status);
106
+ }
107
+ async patch(o, e) {
108
+ const s = c(this.requestInit) ? await this.requestInit() : this.requestInit, r = {
109
+ ...s,
110
+ ...e,
111
+ method: "PATCH",
112
+ headers: {
113
+ ...s?.headers,
114
+ ...e?.headers
115
+ }
116
+ }, a = await fetch(o, r).catch(() => {
117
+ throw new n("Failed to patch url", 0);
118
+ });
119
+ if (!a.ok)
120
+ throw new n(a.statusText, a.status);
121
+ return await a.json();
89
122
  }
90
123
  }
91
124
  export {
92
- T as HTTPService
125
+ p as HTTPService
93
126
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.HTTP_ERROR_MESSAGE=void 0;(function(t){t.FAILED_TO_FETCH_URL="Failed to fetch url",t.FAILED_TO_POST_URL="Failed to post url"})(exports.HTTP_ERROR_MESSAGE||(exports.HTTP_ERROR_MESSAGE={}));
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.HTTP_ERROR_MESSAGE=void 0;(function(e){e.FAILED_TO_FETCH_URL="Failed to fetch url",e.FAILED_TO_POST_URL="Failed to post url",e.FAILED_TO_PUT_URL="Failed to put url",e.FAILED_TO_DELETE_URL="Failed to delete url"})(exports.HTTP_ERROR_MESSAGE||(exports.HTTP_ERROR_MESSAGE={}));
@@ -1,11 +1,13 @@
1
1
  import { ZodType } from 'zod';
2
2
  export interface IHttpService {
3
- get<T>(url: string, options?: RequestInit): Promise<T>;
3
+ get<T>(url: string, options?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
4
4
  post<T>(url: string, options?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
5
5
  delete(url: string, options?: RequestInit): Promise<void>;
6
- put<T>(url: string, options?: RequestInit): Promise<T>;
6
+ put<T>(url: string, options?: RequestInit, validationSchema?: ZodType<T>): Promise<T>;
7
7
  }
8
8
  export declare enum HTTP_ERROR_MESSAGE {
9
9
  FAILED_TO_FETCH_URL = "Failed to fetch url",
10
- FAILED_TO_POST_URL = "Failed to post url"
10
+ FAILED_TO_POST_URL = "Failed to post url",
11
+ FAILED_TO_PUT_URL = "Failed to put url",
12
+ FAILED_TO_DELETE_URL = "Failed to delete url"
11
13
  }
@@ -1,7 +1,7 @@
1
- var _;
1
+ var e;
2
2
  (function(t) {
3
- t.FAILED_TO_FETCH_URL = "Failed to fetch url", t.FAILED_TO_POST_URL = "Failed to post url";
4
- })(_ || (_ = {}));
3
+ t.FAILED_TO_FETCH_URL = "Failed to fetch url", t.FAILED_TO_POST_URL = "Failed to post url", t.FAILED_TO_PUT_URL = "Failed to put url", t.FAILED_TO_DELETE_URL = "Failed to delete url";
4
+ })(e || (e = {}));
5
5
  export {
6
- _ as HTTP_ERROR_MESSAGE
6
+ e as HTTP_ERROR_MESSAGE
7
7
  };
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.75.9",
3
+ "version": "1.77.0",
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.42.0",
68
- "@typescript-eslint/parser": "8.42.0",
67
+ "@typescript-eslint/eslint-plugin": "8.43.0",
68
+ "@typescript-eslint/parser": "8.43.0",
69
69
  "esbuild": "0.25.9",
70
70
  "esbuild-register": "3.6.0",
71
71
  "eslint": "8.57.1",