@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.
- package/dist/.ts-temp/tsconfig.tsbuildinfo +1 -1
- package/dist/src/http/HttpService.cjs +1 -1
- package/dist/src/http/HttpService.js +72 -63
- package/dist/src/tokens/service/types/backend.model.cjs +1 -1
- package/dist/src/tokens/service/types/backend.model.d.ts +3 -0
- package/dist/src/tokens/service/types/backend.model.js +15 -14
- package/dist/src/tokens/service/types/defiPosition.model.d.ts +6 -0
- package/dist/src/tokens/service/types/unclaimedRewards.model.d.ts +2 -0
- package/dist/src/tokens/service/types/webToken.model.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("lodash-es"),
|
|
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
|
|
2
|
-
import { HttpError as
|
|
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(
|
|
6
|
-
this.requestInit =
|
|
5
|
+
constructor(c, e = "json") {
|
|
6
|
+
this.requestInit = c, this.responseType = e;
|
|
7
7
|
}
|
|
8
|
-
async get(
|
|
9
|
-
const
|
|
10
|
-
...
|
|
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
|
-
...
|
|
15
|
+
...i?.headers,
|
|
16
16
|
...e?.headers
|
|
17
17
|
}
|
|
18
|
-
}, t = await fetch(
|
|
19
|
-
let
|
|
20
|
-
throw
|
|
21
|
-
})), new
|
|
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
|
|
25
|
+
throw new o(t.statusText, t.status, await t.json().catch(() => {
|
|
26
26
|
}));
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
27
|
+
const n = await t.json();
|
|
28
|
+
if (a)
|
|
29
29
|
try {
|
|
30
|
-
return
|
|
31
|
-
} catch (
|
|
32
|
-
throw new
|
|
30
|
+
return a.parse(n);
|
|
31
|
+
} catch (r) {
|
|
32
|
+
throw new o(r.message, 0);
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return n;
|
|
35
35
|
}
|
|
36
36
|
return t;
|
|
37
37
|
}
|
|
38
|
-
async post(
|
|
39
|
-
const
|
|
40
|
-
...
|
|
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
|
-
...
|
|
45
|
+
...i?.headers,
|
|
46
46
|
...e?.headers
|
|
47
47
|
}
|
|
48
|
-
}, t = await fetch(
|
|
49
|
-
throw new
|
|
48
|
+
}, t = await fetch(c, s).catch(() => {
|
|
49
|
+
throw new o(u.FAILED_TO_POST_URL, 0);
|
|
50
50
|
});
|
|
51
|
-
if (!t.ok)
|
|
52
|
-
|
|
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
|
|
56
|
-
if (
|
|
58
|
+
const n = await t.json();
|
|
59
|
+
if (a)
|
|
57
60
|
try {
|
|
58
|
-
return
|
|
59
|
-
} catch (
|
|
60
|
-
throw new
|
|
61
|
+
return a.parse(n);
|
|
62
|
+
} catch (r) {
|
|
63
|
+
throw new o(r.message, 0);
|
|
61
64
|
}
|
|
62
|
-
return
|
|
65
|
+
return n;
|
|
63
66
|
}
|
|
64
|
-
async put(
|
|
65
|
-
const
|
|
66
|
-
...
|
|
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
|
-
...
|
|
74
|
+
...i?.headers,
|
|
72
75
|
...e?.headers
|
|
73
76
|
}
|
|
74
|
-
}, t = await fetch(
|
|
75
|
-
throw new
|
|
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
|
|
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
|
|
83
|
-
if (
|
|
85
|
+
const n = await t.json();
|
|
86
|
+
if (a)
|
|
84
87
|
try {
|
|
85
|
-
return
|
|
86
|
-
} catch (
|
|
87
|
-
throw new
|
|
88
|
+
return a.parse(n);
|
|
89
|
+
} catch (r) {
|
|
90
|
+
throw new o(r.message, 0);
|
|
88
91
|
}
|
|
89
|
-
return
|
|
92
|
+
return n;
|
|
90
93
|
}
|
|
91
|
-
async delete(
|
|
92
|
-
const
|
|
93
|
-
...
|
|
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
|
-
...
|
|
101
|
+
...a?.headers,
|
|
99
102
|
...e?.headers
|
|
100
103
|
}
|
|
101
|
-
},
|
|
102
|
-
throw new
|
|
104
|
+
}, s = await fetch(c, i).catch(() => {
|
|
105
|
+
throw new o(u.FAILED_TO_DELETE_URL, 0);
|
|
103
106
|
});
|
|
104
|
-
if (!
|
|
105
|
-
|
|
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(
|
|
108
|
-
const
|
|
109
|
-
...
|
|
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
|
-
...
|
|
119
|
+
...a?.headers,
|
|
114
120
|
...e?.headers
|
|
115
121
|
}
|
|
116
|
-
},
|
|
117
|
-
throw new
|
|
122
|
+
}, s = await fetch(c, i).catch(() => {
|
|
123
|
+
throw new o("Failed to patch url", 0);
|
|
118
124
|
});
|
|
119
|
-
if (!
|
|
120
|
-
|
|
121
|
-
|
|
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
|
|
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:
|
|
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
|
-
}),
|
|
51
|
-
tokenAddress:
|
|
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:
|
|
68
|
-
token1:
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
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
|
-
|
|
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
|
-
|
|
149
|
+
o as apiDefiDecompositionToken,
|
|
149
150
|
b as apiDefiPositionSchema,
|
|
150
151
|
U as apiDefiPositionsSchema,
|
|
151
|
-
|
|
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
|
-
|
|
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>;
|