@carrot-protocol/http-client 0.2.52-add-wallet-performance-dev-a005859 → 0.2.52-add-wallet-performance-dev-9e0ad92
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/index.d.ts +1 -1
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -163,13 +163,17 @@ class Client {
|
|
|
163
163
|
}
|
|
164
164
|
async getUserPerformance(vault, wallets) {
|
|
165
165
|
const walletsString = wallets.map((wallet) => wallet.toString()).join(",");
|
|
166
|
-
const url = new URL(`${this.baseUrl}/userPerformance?vault=${vault.toString()}&
|
|
166
|
+
const url = new URL(`${this.baseUrl}/userPerformance?vault=${vault.toString()}&wallets=${walletsString}`);
|
|
167
167
|
const response = await (0, cross_fetch_1.default)(url, {
|
|
168
168
|
method: "GET",
|
|
169
169
|
headers: this.headers,
|
|
170
170
|
});
|
|
171
171
|
checkResponse(response);
|
|
172
|
-
|
|
172
|
+
let body = await response.json();
|
|
173
|
+
body.holderSince = new Date(body.holderSince);
|
|
174
|
+
body.portfolioTracker.forEach((value) => {
|
|
175
|
+
value.date = new Date(value.date);
|
|
176
|
+
});
|
|
173
177
|
const getUserPerformanceResponse = {
|
|
174
178
|
vault,
|
|
175
179
|
wallets,
|