@argent/x-shared 1.78.5 → 1.78.7

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 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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("lodash-es"),n=require("./HttpError.cjs"),u=require("./IHttpService.cjs");class d{constructor(c,e="json"){this.requestInit=c,this.responseType=e}async get(c,e,r){const i=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,s={...i,...e,method:"GET",headers:{...i?.headers,...e?.headers}},t=await fetch(c,s).catch(async a=>{let o;throw a instanceof Response&&(o=await a.json().catch(()=>{})),new n.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_FETCH_URL,0,o)});if(this.responseType==="json"){if(!t.ok)throw new n.HttpError(t.statusText,t.status,await t.json().catch(()=>{}));const a=await t.json();if(r)try{return r.parse(a)}catch(o){throw new n.HttpError(o.message,0)}return a}return t}async post(c,e,r){const i=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,s={...i,...e,method:"POST",headers:{...i?.headers,...e?.headers}},t=await fetch(c,s).catch(()=>{throw new n.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_POST_URL,0)});if(!t.ok){const o=await t.json().catch(()=>{});throw new n.HttpError(t.statusText,t.status,o)}if(t.status===204)return{};const a=await t.json();if(r)try{return r.parse(a)}catch(o){throw new n.HttpError(o.message,0)}return a}async put(c,e,r){const i=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,s={...i,...e,method:"PUT",headers:{...i?.headers,...e?.headers}},t=await fetch(c,s).catch(()=>{throw new n.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_PUT_URL,0)});if(!t.ok)throw new n.HttpError(t.statusText,t.status,await t.json().catch(()=>{}));if(t.status===204)return{};const a=await t.json();if(r)try{return r.parse(a)}catch(o){throw new n.HttpError(o.message,0)}return a}async delete(c,e){const r=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,i={...r,...e,method:"DELETE",headers:{...r?.headers,...e?.headers}},s=await fetch(c,i).catch(()=>{throw new n.HttpError(u.HTTP_ERROR_MESSAGE.FAILED_TO_DELETE_URL,0)});if(!s.ok){const t=await s.json().catch(()=>{});throw new n.HttpError(s.statusText,s.status,t)}}async patch(c,e){const r=h.isFunction(this.requestInit)?await this.requestInit():this.requestInit,i={...r,...e,method:"PATCH",headers:{...r?.headers,...e?.headers}},s=await fetch(c,i).catch(()=>{throw new n.HttpError("Failed to patch url",0)});if(!s.ok){const a=await s.json().catch(()=>{});throw new n.HttpError(s.statusText,s.status,a)}return await s.json()}}exports.HTTPService=d;
@@ -1,124 +1,133 @@
1
- import { isFunction as c } from "lodash-es";
2
- import { HttpError as n } from "./HttpError.js";
1
+ import { isFunction as h } from "lodash-es";
2
+ import { HttpError as o } from "./HttpError.js";
3
3
  import { HTTP_ERROR_MESSAGE as u } from "./IHttpService.js";
4
4
  class p {
5
- constructor(o, e = "json") {
6
- this.requestInit = o, this.responseType = e;
5
+ constructor(c, e = "json") {
6
+ this.requestInit = c, this.responseType = e;
7
7
  }
8
- async get(o, e, s) {
9
- const r = c(this.requestInit) ? await this.requestInit() : this.requestInit, a = {
10
- ...r,
8
+ async get(c, e, a) {
9
+ const i = h(this.requestInit) ? await this.requestInit() : this.requestInit, s = {
10
+ ...i,
11
11
  ...e,
12
12
  method: "GET",
13
13
  // merge headers
14
14
  headers: {
15
- ...r?.headers,
15
+ ...i?.headers,
16
16
  ...e?.headers
17
17
  }
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);
18
+ }, t = await fetch(c, s).catch(async (n) => {
19
+ let r;
20
+ throw n instanceof Response && (r = await n.json().catch(() => {
21
+ })), new o(u.FAILED_TO_FETCH_URL, 0, r);
22
22
  });
23
23
  if (this.responseType === "json") {
24
24
  if (!t.ok)
25
- throw new n(t.statusText, t.status, await t.json().catch(() => {
25
+ throw new o(t.statusText, t.status, await t.json().catch(() => {
26
26
  }));
27
- const i = await t.json();
28
- if (s)
27
+ const n = await t.json();
28
+ if (a)
29
29
  try {
30
- return s.parse(i);
31
- } catch (h) {
32
- throw new n(h.message, 0);
30
+ return a.parse(n);
31
+ } catch (r) {
32
+ throw new o(r.message, 0);
33
33
  }
34
- return i;
34
+ return n;
35
35
  }
36
36
  return t;
37
37
  }
38
- async post(o, e, s) {
39
- const r = c(this.requestInit) ? await this.requestInit() : this.requestInit, a = {
40
- ...r,
38
+ async post(c, e, a) {
39
+ const i = h(this.requestInit) ? await this.requestInit() : this.requestInit, s = {
40
+ ...i,
41
41
  ...e,
42
42
  method: "POST",
43
43
  // merge headers
44
44
  headers: {
45
- ...r?.headers,
45
+ ...i?.headers,
46
46
  ...e?.headers
47
47
  }
48
- }, t = await fetch(o, a).catch(() => {
49
- throw new n(u.FAILED_TO_POST_URL, 0);
48
+ }, t = await fetch(c, s).catch(() => {
49
+ throw new o(u.FAILED_TO_POST_URL, 0);
50
50
  });
51
- if (!t.ok)
52
- throw new n(t.statusText, t.status, await t.json());
51
+ if (!t.ok) {
52
+ const r = await t.json().catch(() => {
53
+ });
54
+ throw new o(t.statusText, t.status, r);
55
+ }
53
56
  if (t.status === 204)
54
57
  return {};
55
- const i = await t.json();
56
- if (s)
58
+ const n = await t.json();
59
+ if (a)
57
60
  try {
58
- return s.parse(i);
59
- } catch (h) {
60
- throw new n(h.message, 0);
61
+ return a.parse(n);
62
+ } catch (r) {
63
+ throw new o(r.message, 0);
61
64
  }
62
- return i;
65
+ return n;
63
66
  }
64
- async put(o, e, s) {
65
- const r = c(this.requestInit) ? await this.requestInit() : this.requestInit, a = {
66
- ...r,
67
+ async put(c, e, a) {
68
+ const i = h(this.requestInit) ? await this.requestInit() : this.requestInit, s = {
69
+ ...i,
67
70
  ...e,
68
71
  method: "PUT",
69
72
  // merge headers
70
73
  headers: {
71
- ...r?.headers,
74
+ ...i?.headers,
72
75
  ...e?.headers
73
76
  }
74
- }, t = await fetch(o, a).catch(() => {
75
- throw new n(u.FAILED_TO_PUT_URL, 0);
77
+ }, t = await fetch(c, s).catch(() => {
78
+ throw new o(u.FAILED_TO_PUT_URL, 0);
76
79
  });
77
80
  if (!t.ok)
78
- throw new n(t.statusText, t.status, await t.json().catch(() => {
81
+ throw new o(t.statusText, t.status, await t.json().catch(() => {
79
82
  }));
80
83
  if (t.status === 204)
81
84
  return {};
82
- const i = await t.json();
83
- if (s)
85
+ const n = await t.json();
86
+ if (a)
84
87
  try {
85
- return s.parse(i);
86
- } catch (h) {
87
- throw new n(h.message, 0);
88
+ return a.parse(n);
89
+ } catch (r) {
90
+ throw new o(r.message, 0);
88
91
  }
89
- return i;
92
+ return n;
90
93
  }
91
- async delete(o, e) {
92
- const s = c(this.requestInit) ? await this.requestInit() : this.requestInit, r = {
93
- ...s,
94
+ async delete(c, e) {
95
+ const a = h(this.requestInit) ? await this.requestInit() : this.requestInit, i = {
96
+ ...a,
94
97
  ...e,
95
98
  method: "DELETE",
96
99
  // merge headers
97
100
  headers: {
98
- ...s?.headers,
101
+ ...a?.headers,
99
102
  ...e?.headers
100
103
  }
101
- }, a = await fetch(o, r).catch(() => {
102
- throw new n(u.FAILED_TO_DELETE_URL, 0);
104
+ }, s = await fetch(c, i).catch(() => {
105
+ throw new o(u.FAILED_TO_DELETE_URL, 0);
103
106
  });
104
- if (!a.ok)
105
- throw new n(a.statusText, a.status);
107
+ if (!s.ok) {
108
+ const t = await s.json().catch(() => {
109
+ });
110
+ throw new o(s.statusText, s.status, t);
111
+ }
106
112
  }
107
- async patch(o, e) {
108
- const s = c(this.requestInit) ? await this.requestInit() : this.requestInit, r = {
109
- ...s,
113
+ async patch(c, e) {
114
+ const a = h(this.requestInit) ? await this.requestInit() : this.requestInit, i = {
115
+ ...a,
110
116
  ...e,
111
117
  method: "PATCH",
112
118
  headers: {
113
- ...s?.headers,
119
+ ...a?.headers,
114
120
  ...e?.headers
115
121
  }
116
- }, a = await fetch(o, r).catch(() => {
117
- throw new n("Failed to patch url", 0);
122
+ }, s = await fetch(c, i).catch(() => {
123
+ throw new o("Failed to patch url", 0);
118
124
  });
119
- if (!a.ok)
120
- throw new n(a.statusText, a.status);
121
- return await a.json();
125
+ if (!s.ok) {
126
+ const n = await s.json().catch(() => {
127
+ });
128
+ throw new o(s.statusText, s.status, n);
129
+ }
130
+ return await s.json();
122
131
  }
123
132
  }
124
133
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../../chains/starknet/address.cjs"),h=require("./defiPositionType.model.cjs"),b=require("../../../utils/schemas.cjs"),u=e.z.object({status:e.z.literal("initialising")}).or(e.z.object({status:e.z.literal("initialised"),balances:e.z.array(e.z.object({tokenAddress:a.addressSchemaArgentBackend,tokenBalance:e.z.string()}))})),o=e.z.object({id:e.z.number(),address:a.addressSchema,brandColor:e.z.string().optional(),name:e.z.string(),symbol:e.z.string(),decimals:e.z.number(),iconUrl:e.z.string().optional(),sendable:e.z.boolean(),popular:e.z.boolean(),refundable:e.z.boolean(),listed:e.z.boolean(),tradable:e.z.boolean(),category:e.z.union([e.z.literal("tokens"),e.z.literal("currencies"),e.z.literal("savings")]),pricingId:e.z.number().optional(),dappId:e.z.string().optional(),marketData:e.z.object({marketCap:e.z.number().default(0),marketCap24hChange:e.z.number().default(0),dailyVolume:e.z.number().default(0),rank:e.z.number().default(0)}).optional(),tags:e.z.array(e.z.string()).optional()}),k=e.z.object({tokens:e.z.array(o)}),D=o,p=e.z.object({pricingId:e.z.number(),ethValue:e.z.string(),ccyValue:e.z.string(),ethDayChange:e.z.string(),ccyDayChange:e.z.string()}),y=e.z.object({prices:e.z.array(p)}),i=e.z.object({tokenAddress:a.addressSchemaArgentBackend,principal:e.z.string(),accruedFees:e.z.string(),minPrice:e.z.string(),maxPrice:e.z.string(),currentPrice:e.z.string()}),t=e.z.object({id:e.z.string(),investmentId:e.z.string().optional(),tokenAddress:a.addressSchema.optional(),totalBalances:e.z.record(e.z.string(),e.z.string())}),n=t.extend({tokenId:e.z.string(),data:e.z.object({poolFeePercentage:e.z.string(),tickSpacingPercentage:e.z.string().optional(),token0:i,token1:i})}),P=e.z.array(n),s=t.extend({data:e.z.object({apy:e.z.string().optional(),totalApy:e.z.string().optional()}),investmentId:e.z.string().optional(),totalBalances:e.z.record(e.z.string(),e.z.string())}),f=e.z.array(s),r=t.extend({data:e.z.object({apy:e.z.string().optional(),totalApy:e.z.string().optional(),group:e.z.number().optional(),collateral:e.z.boolean(),debt:e.z.boolean(),lending:e.z.boolean()})}),j=e.z.array(r),c=t.extend({id:e.z.string(),data:e.z.object({delegatingTo:a.addressSchema}),totalBalances:e.z.record(e.z.string(),e.z.string())}),A=e.z.array(c),d=t.extend({investmentId:e.z.string().optional(),data:e.z.object({stakerInfo:e.z.object({name:e.z.string().optional(),iconUrl:e.z.string().optional(),address:a.addressSchema}),accruedRewards:e.z.string(),stakedAmount:e.z.string(),pendingWithdrawal:e.z.object({amount:e.z.string(),withdrawableAfter:e.z.number()}).optional(),apy:e.z.string().optional(),totalApy:e.z.string().optional(),stakedTokenAddress:a.addressSchema,rewardTokenAddress:a.addressSchema})}),T=e.z.array(d),l=n.or(r).or(c).or(s).or(d),z=e.z.array(l),m=b.createSchemaWithWarnings({productId:e.z.string().optional(),name:e.z.string(),manageUrl:e.z.string().optional(),type:h.defiPositionTypeSchema,groups:e.z.record(e.z.string(),e.z.object({name:e.z.string().optional(),healthRatio:e.z.string().optional()})).optional(),positions:z}),g=e.z.object({dappId:e.z.string(),products:e.z.array(m)}),I=e.z.object({dapps:e.z.array(g)}),S=e.z.object({name:e.z.string().optional(),tokenAddress:a.addressSchema,amount:e.z.string().optional(),claimUrl:e.z.string().optional(),claimStart:e.z.number(),claimEnd:e.z.number().optional()}),C=e.z.object({accountAddress:a.addressSchema,chain:e.z.string(),airdrops:e.z.array(S)});exports.apiAccountTokenBalancesSchema=u;exports.apiAirdropSchema=S;exports.apiCollateralizedDebtPositionSchema=r;exports.apiCollateralizedDebtPositionsSchema=j;exports.apiConcentratedLiquidityPositionSchema=n;exports.apiConcentratedLiquidityPositionsSchema=P;exports.apiDefiDecompositionProduct=m;exports.apiDefiDecompositionProducts=z;exports.apiDefiDecompositionSchema=g;exports.apiDefiDecompositionToken=i;exports.apiDefiPositionSchema=l;exports.apiDefiPositionsSchema=I;exports.apiDelegatedTokensArraySchema=A;exports.apiDelegatedTokensSchema=c;exports.apiPriceDataResponseSchema=y;exports.apiPriceDetailsSchema=p;exports.apiStakingPositionSchema=s;exports.apiStakingPositionsSchema=f;exports.apiStrkDelegatedStakingPositionsSchema=T;exports.apiStrkDelegatedStakingSchema=d;exports.apiTokenInfoResponseSchema=D;exports.apiTokenInfoSchema=o;exports.apiTokensInfoResponseSchema=k;exports.apiUnclaimedRewardsSchema=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),a=require("../../../chains/starknet/address.cjs"),h=require("./defiPositionType.model.cjs"),b=require("../../../utils/schemas.cjs"),u=e.z.object({status:e.z.literal("initialising")}).or(e.z.object({status:e.z.literal("initialised"),balances:e.z.array(e.z.object({tokenAddress:a.addressSchemaArgentBackend,tokenBalance:e.z.string()}))})),o=e.z.object({id:e.z.number(),address:a.addressSchema,brandColor:e.z.string().optional(),name:e.z.string(),symbol:e.z.string(),decimals:e.z.number(),iconUrl:e.z.string().optional(),sendable:e.z.boolean(),popular:e.z.boolean(),refundable:e.z.boolean(),listed:e.z.boolean(),tradable:e.z.boolean(),category:e.z.union([e.z.literal("tokens"),e.z.literal("currencies"),e.z.literal("savings")]),pricingId:e.z.number().optional(),dappId:e.z.string().optional(),marketData:e.z.object({marketCap:e.z.number().default(0),marketCap24hChange:e.z.number().default(0),dailyVolume:e.z.number().default(0),rank:e.z.number().default(0)}).optional(),tags:e.z.array(e.z.string()).optional(),useNewBalanceOfFormat:e.z.boolean().optional()}),k=e.z.object({tokens:e.z.array(o)}),D=o,p=e.z.object({pricingId:e.z.number(),ethValue:e.z.string(),ccyValue:e.z.string(),ethDayChange:e.z.string(),ccyDayChange:e.z.string()}),y=e.z.object({prices:e.z.array(p)}),i=e.z.object({tokenAddress:a.addressSchemaArgentBackend,principal:e.z.string(),accruedFees:e.z.string(),minPrice:e.z.string(),maxPrice:e.z.string(),currentPrice:e.z.string()}),t=e.z.object({id:e.z.string(),investmentId:e.z.string().optional(),tokenAddress:a.addressSchema.optional(),totalBalances:e.z.record(e.z.string(),e.z.string())}),n=t.extend({tokenId:e.z.string(),data:e.z.object({poolFeePercentage:e.z.string(),tickSpacingPercentage:e.z.string().optional(),token0:i,token1:i})}),P=e.z.array(n),s=t.extend({data:e.z.object({apy:e.z.string().optional(),totalApy:e.z.string().optional()}),investmentId:e.z.string().optional(),totalBalances:e.z.record(e.z.string(),e.z.string())}),f=e.z.array(s),r=t.extend({data:e.z.object({apy:e.z.string().optional(),totalApy:e.z.string().optional(),group:e.z.number().optional(),collateral:e.z.boolean(),debt:e.z.boolean(),lending:e.z.boolean()})}),j=e.z.array(r),c=t.extend({id:e.z.string(),data:e.z.object({delegatingTo:a.addressSchema}),totalBalances:e.z.record(e.z.string(),e.z.string())}),A=e.z.array(c),d=t.extend({investmentId:e.z.string().optional(),data:e.z.object({stakerInfo:e.z.object({name:e.z.string().optional(),iconUrl:e.z.string().optional(),address:a.addressSchema}),accruedRewards:e.z.string(),stakedAmount:e.z.string(),pendingWithdrawal:e.z.object({amount:e.z.string(),withdrawableAfter:e.z.number()}).optional(),apy:e.z.string().optional(),totalApy:e.z.string().optional(),stakedTokenAddress:a.addressSchema,rewardTokenAddress:a.addressSchema})}),T=e.z.array(d),l=n.or(r).or(c).or(s).or(d),z=e.z.array(l),m=b.createSchemaWithWarnings({productId:e.z.string().optional(),name:e.z.string(),manageUrl:e.z.string().optional(),type:h.defiPositionTypeSchema,groups:e.z.record(e.z.string(),e.z.object({name:e.z.string().optional(),healthRatio:e.z.string().optional()})).optional(),positions:z}),g=e.z.object({dappId:e.z.string(),products:e.z.array(m)}),I=e.z.object({dapps:e.z.array(g)}),S=e.z.object({name:e.z.string().optional(),tokenAddress:a.addressSchema,amount:e.z.string().optional(),claimUrl:e.z.string().optional(),claimStart:e.z.number(),claimEnd:e.z.number().optional()}),C=e.z.object({accountAddress:a.addressSchema,chain:e.z.string(),airdrops:e.z.array(S)});exports.apiAccountTokenBalancesSchema=u;exports.apiAirdropSchema=S;exports.apiCollateralizedDebtPositionSchema=r;exports.apiCollateralizedDebtPositionsSchema=j;exports.apiConcentratedLiquidityPositionSchema=n;exports.apiConcentratedLiquidityPositionsSchema=P;exports.apiDefiDecompositionProduct=m;exports.apiDefiDecompositionProducts=z;exports.apiDefiDecompositionSchema=g;exports.apiDefiDecompositionToken=i;exports.apiDefiPositionSchema=l;exports.apiDefiPositionsSchema=I;exports.apiDelegatedTokensArraySchema=A;exports.apiDelegatedTokensSchema=c;exports.apiPriceDataResponseSchema=y;exports.apiPriceDetailsSchema=p;exports.apiStakingPositionSchema=s;exports.apiStakingPositionsSchema=f;exports.apiStrkDelegatedStakingPositionsSchema=T;exports.apiStrkDelegatedStakingSchema=d;exports.apiTokenInfoResponseSchema=D;exports.apiTokenInfoSchema=o;exports.apiTokensInfoResponseSchema=k;exports.apiUnclaimedRewardsSchema=C;
@@ -32,6 +32,7 @@ export declare const apiTokenInfoSchema: z.ZodObject<{
32
32
  rank: z.ZodDefault<z.ZodNumber>;
33
33
  }, z.core.$strip>>;
34
34
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
35
36
  }, z.core.$strip>;
36
37
  export type ApiTokenInfo = z.infer<typeof apiTokenInfoSchema>;
37
38
  export declare const apiTokensInfoResponseSchema: z.ZodObject<{
@@ -58,6 +59,7 @@ export declare const apiTokensInfoResponseSchema: z.ZodObject<{
58
59
  rank: z.ZodDefault<z.ZodNumber>;
59
60
  }, z.core.$strip>>;
60
61
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
61
63
  }, z.core.$strip>>;
62
64
  }, z.core.$strip>;
63
65
  export declare const apiTokenInfoResponseSchema: z.ZodObject<{
@@ -83,6 +85,7 @@ export declare const apiTokenInfoResponseSchema: z.ZodObject<{
83
85
  rank: z.ZodDefault<z.ZodNumber>;
84
86
  }, z.core.$strip>>;
85
87
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
86
89
  }, z.core.$strip>;
87
90
  export type ApiTokensInfoResponse = z.infer<typeof apiTokensInfoResponseSchema>;
88
91
  export type ApiTokenInfoResponse = z.infer<typeof apiTokenInfoResponseSchema>;
@@ -1,5 +1,5 @@
1
1
  import { z as t } from "zod";
2
- import { addressSchemaArgentBackend as o, addressSchema as a } from "../../../chains/starknet/address.js";
2
+ import { addressSchemaArgentBackend as n, addressSchema as a } from "../../../chains/starknet/address.js";
3
3
  import { defiPositionTypeSchema as d } from "./defiPositionType.model.js";
4
4
  import { createSchemaWithWarnings as g } from "../../../utils/schemas.js";
5
5
  const P = t.object({
@@ -7,7 +7,7 @@ const P = t.object({
7
7
  }).or(t.object({
8
8
  status: t.literal("initialised"),
9
9
  balances: t.array(t.object({
10
- tokenAddress: o,
10
+ tokenAddress: n,
11
11
  tokenBalance: t.string()
12
12
  }))
13
13
  })), i = t.object({
@@ -36,7 +36,8 @@ const P = t.object({
36
36
  dailyVolume: t.number().default(0),
37
37
  rank: t.number().default(0)
38
38
  }).optional(),
39
- tags: t.array(t.string()).optional()
39
+ tags: t.array(t.string()).optional(),
40
+ useNewBalanceOfFormat: t.boolean().optional()
40
41
  }), A = t.object({
41
42
  tokens: t.array(i)
42
43
  }), I = i, m = t.object({
@@ -47,8 +48,8 @@ const P = t.object({
47
48
  ccyDayChange: t.string()
48
49
  }), T = t.object({
49
50
  prices: t.array(m)
50
- }), n = t.object({
51
- tokenAddress: o,
51
+ }), o = t.object({
52
+ tokenAddress: n,
52
53
  principal: t.string(),
53
54
  accruedFees: t.string(),
54
55
  minPrice: t.string(),
@@ -64,8 +65,8 @@ const P = t.object({
64
65
  data: t.object({
65
66
  poolFeePercentage: t.string(),
66
67
  tickSpacingPercentage: t.string().optional(),
67
- token0: n,
68
- token1: n
68
+ token0: o,
69
+ token1: o
69
70
  })
70
71
  }), C = t.array(r), s = e.extend({
71
72
  data: t.object({
@@ -74,7 +75,7 @@ const P = t.object({
74
75
  }),
75
76
  investmentId: t.string().optional(),
76
77
  totalBalances: t.record(t.string(), t.string())
77
- }), x = t.array(s), c = e.extend({
78
+ }), B = t.array(s), c = e.extend({
78
79
  data: t.object({
79
80
  apy: t.string().optional(),
80
81
  totalApy: t.string().optional(),
@@ -83,13 +84,13 @@ const P = t.object({
83
84
  debt: t.boolean(),
84
85
  lending: t.boolean()
85
86
  })
86
- }), B = t.array(c), l = e.extend({
87
+ }), w = t.array(c), l = e.extend({
87
88
  id: t.string(),
88
89
  data: t.object({
89
90
  delegatingTo: a
90
91
  }),
91
92
  totalBalances: t.record(t.string(), t.string())
92
- }), w = t.array(l), p = e.extend({
93
+ }), x = t.array(l), p = e.extend({
93
94
  investmentId: t.string().optional(),
94
95
  data: t.object({
95
96
  stakerInfo: t.object({
@@ -139,21 +140,21 @@ export {
139
140
  P as apiAccountTokenBalancesSchema,
140
141
  S as apiAirdropSchema,
141
142
  c as apiCollateralizedDebtPositionSchema,
142
- B as apiCollateralizedDebtPositionsSchema,
143
+ w as apiCollateralizedDebtPositionsSchema,
143
144
  r as apiConcentratedLiquidityPositionSchema,
144
145
  C as apiConcentratedLiquidityPositionsSchema,
145
146
  h as apiDefiDecompositionProduct,
146
147
  u as apiDefiDecompositionProducts,
147
148
  k as apiDefiDecompositionSchema,
148
- n as apiDefiDecompositionToken,
149
+ o as apiDefiDecompositionToken,
149
150
  b as apiDefiPositionSchema,
150
151
  U as apiDefiPositionsSchema,
151
- w as apiDelegatedTokensArraySchema,
152
+ x as apiDelegatedTokensArraySchema,
152
153
  l as apiDelegatedTokensSchema,
153
154
  T as apiPriceDataResponseSchema,
154
155
  m as apiPriceDetailsSchema,
155
156
  s as apiStakingPositionSchema,
156
- x as apiStakingPositionsSchema,
157
+ B as apiStakingPositionsSchema,
157
158
  R as apiStrkDelegatedStakingPositionsSchema,
158
159
  p as apiStrkDelegatedStakingSchema,
159
160
  I as apiTokenInfoResponseSchema,
@@ -186,6 +186,7 @@ export declare const collateralizedDebtPositionSchema: z.ZodObject<{
186
186
  rank: z.ZodDefault<z.ZodNumber>;
187
187
  }, z.core.$strip>>;
188
188
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
189
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
189
190
  }, z.core.$strip>, z.ZodUndefined]>;
190
191
  token: z.ZodOptional<z.ZodObject<{
191
192
  currencyValue: z.ZodString;
@@ -245,6 +246,7 @@ export declare const collateralizedDebtPositionsSchema: z.ZodArray<z.ZodObject<{
245
246
  rank: z.ZodDefault<z.ZodNumber>;
246
247
  }, z.core.$strip>>;
247
248
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
249
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
248
250
  }, z.core.$strip>, z.ZodUndefined]>;
249
251
  token: z.ZodOptional<z.ZodObject<{
250
252
  currencyValue: z.ZodString;
@@ -584,6 +586,7 @@ export declare const defiPositionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.Z
584
586
  rank: z.ZodDefault<z.ZodNumber>;
585
587
  }, z.core.$strip>>;
586
588
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
589
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
587
590
  }, z.core.$strip>, z.ZodUndefined]>;
588
591
  token: z.ZodOptional<z.ZodObject<{
589
592
  currencyValue: z.ZodString;
@@ -819,6 +822,7 @@ export declare const defiProductSchema: z.ZodObject<{
819
822
  rank: z.ZodDefault<z.ZodNumber>;
820
823
  }, z.core.$strip>>;
821
824
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
825
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
822
826
  }, z.core.$strip>, z.ZodUndefined]>;
823
827
  token: z.ZodOptional<z.ZodObject<{
824
828
  currencyValue: z.ZodString;
@@ -1058,6 +1062,7 @@ export declare const defiProductsSchema: z.ZodArray<z.ZodObject<{
1058
1062
  rank: z.ZodDefault<z.ZodNumber>;
1059
1063
  }, z.core.$strip>>;
1060
1064
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1065
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
1061
1066
  }, z.core.$strip>, z.ZodUndefined]>;
1062
1067
  token: z.ZodOptional<z.ZodObject<{
1063
1068
  currencyValue: z.ZodString;
@@ -1299,6 +1304,7 @@ export declare const defiDappsProductsSchema: z.ZodObject<{
1299
1304
  rank: z.ZodDefault<z.ZodNumber>;
1300
1305
  }, z.core.$strip>>;
1301
1306
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1307
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
1302
1308
  }, z.core.$strip>, z.ZodUndefined]>;
1303
1309
  token: z.ZodOptional<z.ZodObject<{
1304
1310
  currencyValue: z.ZodString;
@@ -25,6 +25,7 @@ export declare const airdropSchema: z.ZodObject<{
25
25
  rank: z.ZodDefault<z.ZodNumber>;
26
26
  }, z.core.$strip>>;
27
27
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
28
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
28
29
  }, z.core.$strip>>;
29
30
  amount: z.ZodOptional<z.ZodString>;
30
31
  claimUrl: z.ZodOptional<z.ZodString>;
@@ -57,6 +58,7 @@ export declare const unclaimedRewardsSchema: z.ZodArray<z.ZodObject<{
57
58
  rank: z.ZodDefault<z.ZodNumber>;
58
59
  }, z.core.$strip>>;
59
60
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
60
62
  }, z.core.$strip>>;
61
63
  amount: z.ZodOptional<z.ZodString>;
62
64
  claimUrl: z.ZodOptional<z.ZodString>;
@@ -142,5 +142,6 @@ export declare const webTokenInfoDetailsSchema: z.ZodObject<{
142
142
  rank: z.ZodDefault<z.ZodNumber>;
143
143
  }, z.core.$strip>>;
144
144
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ useNewBalanceOfFormat: z.ZodOptional<z.ZodBoolean>;
145
146
  }, z.core.$strip>;
146
147
  export type WebTokenInfoDetails = z.infer<typeof webTokenInfoDetailsSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.78.5",
3
+ "version": "1.78.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/argentlabs/x-shared.git"