@argent/x-shared 1.34.4 → 1.34.6
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/features/simulation/activity/schema.d.ts +858 -96
- package/dist/index.js +2 -2
- package/dist/index.mjs +844 -855
- package/dist/nfts/BackendNftService.d.ts +2 -4
- package/dist/nfts/INFTService.d.ts +1 -1
- package/dist/simulation.js +1 -1
- package/dist/simulation.mjs +42 -42
- package/dist/tokens/service/implementation.d.ts +3 -3
- package/dist/tokens/service/interface.d.ts +2 -2
- package/dist/tokens/service/types/defiPosition.model.d.ts +117 -0
- package/dist/tokens/service/types/index.d.ts +1 -0
- package/dist/tokens/service/types/{token.model.d.ts → webToken.model.d.ts} +27 -18
- package/dist/transactionVersion-CKz-zi84.js +1 -0
- package/dist/{transactionVersion-tQTwHiJA.mjs → transactionVersion-cwkr7wat.mjs} +544 -532
- package/package.json +2 -2
- package/dist/transactionVersion-FKKSXkzh.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ArgentBackendNetworkId } from '../backend';
|
|
2
2
|
import { Address } from '../chains';
|
|
3
|
+
import { IHttpService } from '../http';
|
|
3
4
|
import { Collection, NftItem, INFTService, PaginatedItems, PaginatedCollections } from './INFTService';
|
|
4
5
|
export type BackendCollectionType = "erc721" | "erc1155" | "starknetErc721" | "starknetErc1155";
|
|
5
6
|
interface ImageUrls {
|
|
@@ -38,10 +39,8 @@ interface NftResponse {
|
|
|
38
39
|
}
|
|
39
40
|
export declare class BackendNftService implements INFTService {
|
|
40
41
|
protected readonly apiBase: string;
|
|
41
|
-
private readonly headers;
|
|
42
|
-
protected readonly imageOptimizationUrl: string;
|
|
43
42
|
private readonly httpService;
|
|
44
|
-
constructor(apiBase: string,
|
|
43
|
+
constructor(apiBase: string, httpService: IHttpService);
|
|
45
44
|
getNfts(chain: string, network: ArgentBackendNetworkId, _address: string, page?: number): Promise<PaginatedItems>;
|
|
46
45
|
getCollection(chain: string, network: ArgentBackendNetworkId, _collectionAddress: string): Promise<Collection>;
|
|
47
46
|
getNft(chain: string, network: ArgentBackendNetworkId, _collectionAddress: string, itemId: string): Promise<NftItem>;
|
|
@@ -49,7 +48,6 @@ export declare class BackendNftService implements INFTService {
|
|
|
49
48
|
private getCollectionMetrics;
|
|
50
49
|
protected normalizeAddress(address: string): Address;
|
|
51
50
|
protected pageToPageIndex(page: number): number;
|
|
52
|
-
optimizeImage(image?: string, w?: number, h?: number): string | undefined;
|
|
53
51
|
mapItem(input: NftsItem | NftResponse, address?: string): NftItem;
|
|
54
52
|
}
|
|
55
53
|
export {};
|
package/dist/simulation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./transactionVersion-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./transactionVersion-CKz-zi84.js"),h=require("lodash-es");require("starknet");require("zod");require("@scure/base");require("react");require("object-hash");require("swr");function u(e){return e.error?e.error:e.message&&e.code?`${e.code}: ${e.message}`:"Unknown error"}function p(e){if(!e)return;const n=e.transactions.flatMap(d=>i.isTransactionSimulationError(d)?d.simulationError:!1),t=n==null?void 0:n[n.length-1];if(!t)return;const s=u(t),r=t.message||t.error,c=i.getPrettyRpcError(r),o=c||t.label;return{message:c?r:s,label:o}}const l=e=>e.map(f),f=e=>{var s,r,c,o;if(i.isActivitySummary(e))return i.activitySummarySchema.parse(e);const n=!!e.sent;if(e.token.type!=="ERC20"){const a={asset:{type:"nft",tokenAddress:e.token.address,tokenId:e.tokenId?parseInt(e.tokenId):0,amount:e.value,collectionName:e.token.name,collectionPreviewImage:(s=e.token.imageUrls)==null?void 0:s.preview,nftName:(r=e.tokenIdDetails)==null?void 0:r.name,nftPreviewImage:(o=(c=e.tokenIdDetails)==null?void 0:c.imageUrls)==null?void 0:o.preview},sent:n};return i.activitySummarySchema.parse(a)}const t={asset:{type:"token",tokenAddress:e.token.address,amount:e.value,fiatAmount:{currency:"USD",currencyAmount:e.usdValue||"0"}},sent:n};return i.activitySummarySchema.parse(t)};function A(e){var s,r;const n=(r=(s=e.transactions)==null?void 0:s[0].reviewOfTransaction)==null?void 0:r.reviews;return n?n.map(c=>c.action):void 0}function g({simulateAndReview:e,...n}){var s,r;const t={type:i.NativeActivityTypeNative,...n};if(e&&!h.isEmpty(e.transactions)){const c=e.transactions[e.transactions.length-1],o=(s=c.simulation)==null?void 0:s.summary;if(o){const S=l(o);t.transferSummary=S}const a=(r=c.reviewOfTransaction)==null?void 0:r.targetedDapp;a&&(t.dapp=a);const d=A(e);d&&(t.actions=d)}return i.nativeActivitySchema.parse(t)}function m(e){const n=k(e),t=T(e);return n||t}const k=e=>{var o;if(!((o=e.actions)!=null&&o.length))return!1;const n=e.actions[0];if(n.name!=="ERC20_transfer")return!1;let t,s,r,c;return n.defaultProperties&&n.defaultProperties.forEach(a=>{a.type==="token_address"&&a.token.address===i.ETH_TOKEN_ADDRESS&&(s=!0),a.type==="calldata"&&(t=a.calldata[0])}),n.properties.length>1&&n.properties.forEach(a=>{a.type==="amount"&&a.label==="ERC20_transfer_amount"&&a.amount==="0"&&(r=!0),a.type==="address"&&a.label==="ERC20_transfer_recipient"&&i.isEqualAddress(a.address,t)&&(c=!0)}),s&&r&&c},T=e=>{var n,t;return!!("meta"in e&&(t=(n=e.meta)==null?void 0:n.title)!=null&&t.includes("On-chain rejection"))};function v(e,n=!1){var t,s;if(e.type===i.NativeActivityTypeNative){if(n&&((t=e.meta)!=null&&t.shortTitle))return e.meta.shortTitle;if((s=e.meta)!=null&&s.title)return e.meta.title}else{if(m(e))return"On-chain rejection";if(e.title)return e.title}return"Contract interaction"}function E(e){return v(e,!0)}function N(e){return e.map(s=>s.lastModified).sort().pop()}const D=e=>{var t,s;return!!((s=(t=e.details)==null?void 0:t.calls)==null?void 0:s.some(r=>{var c,o,a;return(o=(c=r==null?void 0:r.details)==null?void 0:c.function)!=null&&o.name?((a=r==null?void 0:r.details)==null?void 0:a.function.name)==="lock_and_delegate_by_sig":!1}))},y=e=>{var n;return e.type==="multicall"&&"calls"in e.details&&((n=e.details.calls)==null?void 0:n.some(t=>{var s;return((s=t==null?void 0:t.details)==null?void 0:s.type)==="deploy"&&i.isEqualAddress((t==null?void 0:t.details.contractAddress)||"",e.wallet)}))};function O(e){const n=M(e),t=w(e);return n||t}const M=e=>{var t;if(!((t=e.actions)!=null&&t.length))return!1;const n=e.actions[0];if(n.name!=="account_upgrade")return!1;n.defaultProperties&&n.defaultProperties.forEach(s=>{if(s.type==="calldata"&&s.entrypoint==="upgrade")return!0})},w=e=>{var n,t;return!!("meta"in e&&(t=(n=e.meta)==null?void 0:n.title)!=null&&t.includes("Upgrade account"))};function R({activities:e,accountAddressesOnNetwork:n}){const t={};return e.forEach(s=>{const r=s.wallet,c=s.type==="deploy"?s.type:s.details.type==="security"?s.details.action:void 0;s.group==="security"&&i.includesAddress(r,n)&&c&&(t[c]=t[c]||[],i.includesAddress(r,t[c])||(t[c]=i.ensureArray(t[c]).concat(r))),y(s)&&(t.deploy=i.ensureArray(t.deploy).concat(r))}),t}function _({activities:e,accountAddressesOnNetwork:n,tokenAddressesOnNetwork:t}){const s={tokenActivity:{accountAddresses:[],tokenAddresses:[],newTokenAddresses:[]},nftActivity:{accountAddresses:[],tokenAddresses:[]}};return e.forEach(r=>{if(r.group==="finance"&&r.relatedAddresses){const c=r.transfers.some(o=>o.asset.type==="token");r.relatedAddresses.forEach(({type:o,address:a})=>{o==="token"?i.includesAddress(a,t)&&(i.includesAddress(a,s.tokenActivity.tokenAddresses)||s.tokenActivity.tokenAddresses.push(a)):o==="wallet"&&i.includesAddress(a,n)&&(c?i.includesAddress(a,s.tokenActivity.accountAddresses)||s.tokenActivity.accountAddresses.push(a):i.includesAddress(a,s.nftActivity.accountAddresses)||s.nftActivity.accountAddresses.push(a))}),r.transfers.forEach(o=>{if(o.asset.type==="token"){const a=o.asset.tokenAddress;!i.includesAddress(a,t)&&!i.includesAddress(a,s.tokenActivity.newTokenAddresses)&&s.tokenActivity.newTokenAddresses.push(a)}else if(o.asset.type==="nft"){const a=o.asset.tokenAddress;i.includesAddress(a,s.nftActivity.tokenAddresses)||s.nftActivity.tokenAddresses.push(a)}})}}),s}const j=e=>{if(e.length===0)return null;const n=["critical","high","caution","info"];return e.reduce((t,s)=>{const r=n.indexOf(s.severity),c=n.indexOf(t.severity);return r<c?s:t},e[0])};exports.NativeActivityStatusCancelled=i.NativeActivityStatusCancelled;exports.NativeActivityStatusQueued=i.NativeActivityStatusQueued;exports.NativeActivityStatusRejected=i.NativeActivityStatusRejected;exports.NativeActivityTypeNative=i.NativeActivityTypeNative;exports.actionSchema=i.actionSchema;exports.activitiesSchema=i.activitiesSchema;exports.activityDappSchema=i.activityDappSchema;exports.activityDetailsSchema=i.activityDetailsSchema;exports.activityResponseSchema=i.activityResponseSchema;exports.activitySchema=i.activitySchema;exports.activitySummarySchema=i.activitySummarySchema;exports.activityTransferSchema=i.activityTransferSchema;exports.assessmentSchema=i.assessmentSchema;exports.enrichedSimulateAndReviewSchema=i.enrichedSimulateAndReviewSchema;exports.estimatedFeeSchema=i.estimatedFeeSchema;exports.estimatedFeesSchema=i.estimatedFeesSchema;exports.feeEstimationSchema=i.feeEstimationSchema;exports.feeSchema=i.feeSchema;exports.isActivityDetailsAction=i.isActivityDetailsAction;exports.isActivitySummary=i.isActivitySummary;exports.isNftActivitySummary=i.isNftActivitySummary;exports.isNotTransactionSimulationError=i.isNotTransactionSimulationError;exports.isTokenActivitySummary=i.isTokenActivitySummary;exports.isTransactionSimulationError=i.isTransactionSimulationError;exports.nativeActivityMetaSchema=i.nativeActivityMetaSchema;exports.nativeActivitySchema=i.nativeActivitySchema;exports.propertySchema=i.propertySchema;exports.reasonsSchema=i.reasonsSchema;exports.reviewSchema=i.reviewSchema;exports.severitySchema=i.severitySchema;exports.simulateAndReviewSchema=i.simulateAndReviewSchema;exports.targetedDappSchema=i.targetedDappSchema;exports.warningDetailsSchema=i.warningDetailsSchema;exports.warningSchema=i.warningSchema;exports.createNativeActivity=g;exports.getAnyActivityShortTitle=E;exports.getAnyActivityTitle=v;exports.getErrorMessageAndLabelFromSimulation=p;exports.getHighestSeverity=j;exports.getMessageFromSimulationError=u;exports.getOverallLastModified=N;exports.hasDelegationActivity=D;exports.isMulticallWithDeploymentActivity=y;exports.isRejectOnChainActivity=m;exports.isUpgradeActivity=O;exports.normalizeActions=A;exports.normalizeActivitySummary=f;exports.normalizeActivitySummaryCollection=l;exports.parseAccountActivities=R;exports.parseFinanceActivities=_;
|
package/dist/simulation.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Q as m,
|
|
2
|
-
import {
|
|
3
|
-
import { isEmpty as
|
|
1
|
+
import { Q as m, b6 as h, b$ as v, c0 as f, c1 as l, c2 as g, I as y, h as p, a0 as c, v as u } from "./transactionVersion-cwkr7wat.mjs";
|
|
2
|
+
import { ca as X, cb as Y, c9 as I, ck as ee, cc as te, c5 as se, c4 as ne, cd as ie, c7 as ae, c3 as re, cl as oe, cq as ce, ch as de, ci as fe, K as ue, c6 as le, ce as pe, cg as Ae, cr as me, cf as he, c8 as ve, cj as ge, ct as ye, co as Se, cs as ke, P as Te, cp as Ee, cm as Oe, cn as we } from "./transactionVersion-cwkr7wat.mjs";
|
|
3
|
+
import { isEmpty as S } from "lodash-es";
|
|
4
4
|
import "starknet";
|
|
5
5
|
import "zod";
|
|
6
6
|
import "@scure/base";
|
|
@@ -62,13 +62,13 @@ function O(e) {
|
|
|
62
62
|
const n = (a = (s = e.transactions) == null ? void 0 : s[0].reviewOfTransaction) == null ? void 0 : a.reviews;
|
|
63
63
|
return n ? n.map((r) => r.action) : void 0;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function $({ simulateAndReview: e, ...n }) {
|
|
66
66
|
var s, a;
|
|
67
67
|
const t = {
|
|
68
68
|
type: l,
|
|
69
69
|
...n
|
|
70
70
|
};
|
|
71
|
-
if (e && !
|
|
71
|
+
if (e && !S(e.transactions)) {
|
|
72
72
|
const r = e.transactions[e.transactions.length - 1], o = (s = r.simulation) == null ? void 0 : s.summary;
|
|
73
73
|
if (o) {
|
|
74
74
|
const A = T(o);
|
|
@@ -79,13 +79,13 @@ function W({ simulateAndReview: e, ...n }) {
|
|
|
79
79
|
const d = O(e);
|
|
80
80
|
d && (t.actions = d);
|
|
81
81
|
}
|
|
82
|
-
return
|
|
82
|
+
return g.parse(t);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
const n =
|
|
84
|
+
function w(e) {
|
|
85
|
+
const n = D(e), t = M(e);
|
|
86
86
|
return n || t;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const D = (e) => {
|
|
89
89
|
var o;
|
|
90
90
|
if (!((o = e.actions) != null && o.length))
|
|
91
91
|
return !1;
|
|
@@ -94,15 +94,15 @@ const w = (e) => {
|
|
|
94
94
|
return !1;
|
|
95
95
|
let t, s, a, r;
|
|
96
96
|
return n.defaultProperties && n.defaultProperties.forEach((i) => {
|
|
97
|
-
i.type === "token_address" && i.token.address ===
|
|
97
|
+
i.type === "token_address" && i.token.address === y && (s = !0), i.type === "calldata" && (t = i.calldata[0]);
|
|
98
98
|
}), n.properties.length > 1 && n.properties.forEach((i) => {
|
|
99
99
|
i.type === "amount" && i.label === "ERC20_transfer_amount" && i.amount === "0" && (a = !0), i.type === "address" && i.label === "ERC20_transfer_recipient" && p(i.address, t) && (r = !0);
|
|
100
100
|
}), s && a && r;
|
|
101
|
-
},
|
|
101
|
+
}, M = (e) => {
|
|
102
102
|
var n, t;
|
|
103
103
|
return !!("meta" in e && (t = (n = e.meta) == null ? void 0 : n.title) != null && t.includes("On-chain rejection"));
|
|
104
104
|
};
|
|
105
|
-
function
|
|
105
|
+
function R(e, n = !1) {
|
|
106
106
|
var t, s;
|
|
107
107
|
if (e.type === l) {
|
|
108
108
|
if (n && ((t = e.meta) != null && t.shortTitle))
|
|
@@ -110,37 +110,37 @@ function M(e, n = !1) {
|
|
|
110
110
|
if ((s = e.meta) != null && s.title)
|
|
111
111
|
return e.meta.title;
|
|
112
112
|
} else {
|
|
113
|
-
if (
|
|
113
|
+
if (w(e))
|
|
114
114
|
return "On-chain rejection";
|
|
115
115
|
if (e.title)
|
|
116
116
|
return e.title;
|
|
117
117
|
}
|
|
118
118
|
return "Contract interaction";
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
return
|
|
120
|
+
function q(e) {
|
|
121
|
+
return R(e, !0);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function H(e) {
|
|
124
124
|
return e.map((s) => s.lastModified).sort().pop();
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const K = (e) => {
|
|
127
127
|
var t, s;
|
|
128
128
|
return !!((s = (t = e.details) == null ? void 0 : t.calls) == null ? void 0 : s.some((a) => {
|
|
129
129
|
var r, o, i;
|
|
130
130
|
return (o = (r = a == null ? void 0 : a.details) == null ? void 0 : r.function) != null && o.name ? ((i = a == null ? void 0 : a.details) == null ? void 0 : i.function.name) === "lock_and_delegate_by_sig" : !1;
|
|
131
131
|
}));
|
|
132
|
-
},
|
|
132
|
+
}, _ = (e) => {
|
|
133
133
|
var n;
|
|
134
134
|
return e.type === "multicall" && "calls" in e.details && ((n = e.details.calls) == null ? void 0 : n.some((t) => {
|
|
135
135
|
var s;
|
|
136
136
|
return ((s = t == null ? void 0 : t.details) == null ? void 0 : s.type) === "deploy" && p((t == null ? void 0 : t.details.contractAddress) || "", e.wallet);
|
|
137
137
|
}));
|
|
138
138
|
};
|
|
139
|
-
function
|
|
140
|
-
const n =
|
|
139
|
+
function Q(e) {
|
|
140
|
+
const n = N(e), t = B(e);
|
|
141
141
|
return n || t;
|
|
142
142
|
}
|
|
143
|
-
const
|
|
143
|
+
const N = (e) => {
|
|
144
144
|
var t;
|
|
145
145
|
if (!((t = e.actions) != null && t.length))
|
|
146
146
|
return !1;
|
|
@@ -151,15 +151,15 @@ const _ = (e) => {
|
|
|
151
151
|
if (s.type === "calldata" && s.entrypoint === "upgrade")
|
|
152
152
|
return !0;
|
|
153
153
|
});
|
|
154
|
-
},
|
|
154
|
+
}, B = (e) => {
|
|
155
155
|
var n, t;
|
|
156
156
|
return !!("meta" in e && (t = (n = e.meta) == null ? void 0 : n.title) != null && t.includes("Upgrade account"));
|
|
157
157
|
};
|
|
158
|
-
function
|
|
158
|
+
function W({ activities: e, accountAddressesOnNetwork: n }) {
|
|
159
159
|
const t = {};
|
|
160
160
|
return e.forEach((s) => {
|
|
161
161
|
const a = s.wallet, r = s.type === "deploy" ? s.type : s.details.type === "security" ? s.details.action : void 0;
|
|
162
|
-
s.group === "security" && c(a, n) && r && (t[r] = t[r] || [], c(a, t[r]) || (t[r] = u(t[r]).concat(a))),
|
|
162
|
+
s.group === "security" && c(a, n) && r && (t[r] = t[r] || [], c(a, t[r]) || (t[r] = u(t[r]).concat(a))), _(s) && (t.deploy = u(t.deploy).concat(a));
|
|
163
163
|
}), t;
|
|
164
164
|
}
|
|
165
165
|
function V({ activities: e, accountAddressesOnNetwork: n, tokenAddressesOnNetwork: t }) {
|
|
@@ -191,7 +191,7 @@ function V({ activities: e, accountAddressesOnNetwork: n, tokenAddressesOnNetwor
|
|
|
191
191
|
}
|
|
192
192
|
}), s;
|
|
193
193
|
}
|
|
194
|
-
const
|
|
194
|
+
const Z = (e) => {
|
|
195
195
|
if (e.length === 0)
|
|
196
196
|
return null;
|
|
197
197
|
const n = ["critical", "high", "caution", "info"];
|
|
@@ -201,8 +201,8 @@ const q = (e) => {
|
|
|
201
201
|
}, e[0]);
|
|
202
202
|
};
|
|
203
203
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
X as NativeActivityStatusCancelled,
|
|
205
|
+
Y as NativeActivityStatusQueued,
|
|
206
206
|
I as NativeActivityStatusRejected,
|
|
207
207
|
l as NativeActivityTypeNative,
|
|
208
208
|
ee as actionSchema,
|
|
@@ -214,41 +214,41 @@ export {
|
|
|
214
214
|
f as activitySummarySchema,
|
|
215
215
|
re as activityTransferSchema,
|
|
216
216
|
oe as assessmentSchema,
|
|
217
|
-
|
|
217
|
+
$ as createNativeActivity,
|
|
218
218
|
ce as enrichedSimulateAndReviewSchema,
|
|
219
219
|
de as estimatedFeeSchema,
|
|
220
220
|
fe as estimatedFeesSchema,
|
|
221
221
|
ue as feeEstimationSchema,
|
|
222
222
|
le as feeSchema,
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
q as getAnyActivityShortTitle,
|
|
224
|
+
R as getAnyActivityTitle,
|
|
225
225
|
P as getErrorMessageAndLabelFromSimulation,
|
|
226
|
-
|
|
226
|
+
Z as getHighestSeverity,
|
|
227
227
|
k as getMessageFromSimulationError,
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
H as getOverallLastModified,
|
|
229
|
+
K as hasDelegationActivity,
|
|
230
230
|
pe as isActivityDetailsAction,
|
|
231
231
|
v as isActivitySummary,
|
|
232
|
-
|
|
232
|
+
_ as isMulticallWithDeploymentActivity,
|
|
233
233
|
Ae as isNftActivitySummary,
|
|
234
234
|
me as isNotTransactionSimulationError,
|
|
235
|
-
|
|
235
|
+
w as isRejectOnChainActivity,
|
|
236
236
|
he as isTokenActivitySummary,
|
|
237
237
|
m as isTransactionSimulationError,
|
|
238
|
-
|
|
238
|
+
Q as isUpgradeActivity,
|
|
239
239
|
ve as nativeActivityMetaSchema,
|
|
240
|
-
|
|
240
|
+
g as nativeActivitySchema,
|
|
241
241
|
O as normalizeActions,
|
|
242
242
|
E as normalizeActivitySummary,
|
|
243
243
|
T as normalizeActivitySummaryCollection,
|
|
244
|
-
|
|
244
|
+
W as parseAccountActivities,
|
|
245
245
|
V as parseFinanceActivities,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
ge as propertySchema,
|
|
247
|
+
ye as reasonsSchema,
|
|
248
|
+
Se as reviewSchema,
|
|
249
249
|
ke as severitySchema,
|
|
250
250
|
Te as simulateAndReviewSchema,
|
|
251
251
|
Ee as targetedDappSchema,
|
|
252
252
|
Oe as warningDetailsSchema,
|
|
253
|
-
|
|
253
|
+
we as warningSchema
|
|
254
254
|
};
|
|
@@ -4,7 +4,7 @@ import { Address } from '../../chains/starknet/address';
|
|
|
4
4
|
import { IHttpService } from '../../http';
|
|
5
5
|
import { ITokenServiceWeb } from './interface';
|
|
6
6
|
import { ApiTokenInfo } from './types/backend.model';
|
|
7
|
-
import {
|
|
7
|
+
import { WebBaseTokenWithBalance } from './types/webToken.model';
|
|
8
8
|
/**
|
|
9
9
|
* TokenService class implements ITokenService interface.
|
|
10
10
|
*/
|
|
@@ -23,9 +23,9 @@ export declare class TokenServiceWeb implements ITokenServiceWeb {
|
|
|
23
23
|
/**
|
|
24
24
|
* Fetch list of tokens and balances for given account from backend
|
|
25
25
|
* @param {Address} address - The account address.
|
|
26
|
-
* @returns {Promise<
|
|
26
|
+
* @returns {Promise<WebBaseTokenWithBalance[]>} - The fetched balances for the account address.
|
|
27
27
|
*/
|
|
28
|
-
fetchAddressTokenBalancesFromBackend(address: string, network: ArgentBackendNetworkId, opts?: retry.Options): Promise<
|
|
28
|
+
fetchAddressTokenBalancesFromBackend(address: string, network: ArgentBackendNetworkId, opts?: retry.Options): Promise<WebBaseTokenWithBalance[]>;
|
|
29
29
|
fetchDefiDecomposition(address: Address): Promise<{
|
|
30
30
|
dappId: string;
|
|
31
31
|
products: {
|
|
@@ -2,7 +2,7 @@ import { default as retry } from 'async-retry';
|
|
|
2
2
|
import { ArgentBackendNetworkId } from '../../backend';
|
|
3
3
|
import { Address } from '../../chains/starknet/address';
|
|
4
4
|
import { ApiDefiDecompositionSchema, ApiTokenInfo } from './types/backend.model';
|
|
5
|
-
import {
|
|
5
|
+
import { WebBaseTokenWithBalance } from './types/webToken.model';
|
|
6
6
|
export type SelectorFn<T> = (value: T) => boolean;
|
|
7
7
|
export interface ITokenServiceDefiDecomposition {
|
|
8
8
|
fetchDefiDecomposition: (address: Address) => Promise<ApiDefiDecompositionSchema[]>;
|
|
@@ -17,6 +17,6 @@ export interface ITokenServiceWeb extends ITokenServiceDefiDecomposition {
|
|
|
17
17
|
* fetchTokensInfoFromBackend: Fetch tokens info from backend
|
|
18
18
|
* fetchDefiDecomposition: Fetch DeFi decomposition for given account from backend
|
|
19
19
|
*/
|
|
20
|
-
fetchAddressTokenBalancesFromBackend: (address: Address, network: ArgentBackendNetworkId, opts?: retry.Options) => Promise<
|
|
20
|
+
fetchAddressTokenBalancesFromBackend: (address: Address, network: ArgentBackendNetworkId, opts?: retry.Options) => Promise<WebBaseTokenWithBalance[]>;
|
|
21
21
|
fetchTokensInfoFromBackend(tokenAddress?: Address): Promise<ApiTokenInfo[] | undefined>;
|
|
22
22
|
}
|