@carrot-protocol/http-client 0.2.12-hva-dev-a84f07d → 0.2.12-hva-dev-dfefb01

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 CHANGED
@@ -9,7 +9,7 @@ export declare class Client {
9
9
  getVault(vault: anchor.web3.PublicKey): Promise<Vault>;
10
10
  getVaultPerformance(vault: anchor.web3.PublicKey): Promise<VaultPerformance>;
11
11
  getUser(vault: anchor.web3.PublicKey): Promise<UserResponse>;
12
- getHistoricalVaultApy(vault: anchor.web3.PublicKey, interval: string): Promise<HistoricalVaultApyResponse>;
12
+ getHistoricalVaultApy(vault: anchor.web3.PublicKey, interval: VaultHistoricalApyInterval): Promise<HistoricalVaultApyResponse>;
13
13
  issue(vault: anchor.web3.PublicKey, assetMint: anchor.web3.PublicKey, amount: anchor.BN): Promise<string>;
14
14
  redeem(vault: anchor.web3.PublicKey, assetMint: anchor.web3.PublicKey, amount: anchor.BN): Promise<string>;
15
15
  private send;
@@ -57,6 +57,6 @@ export interface VaultApy {
57
57
  }
58
58
  declare const allowedIntervals: readonly ["HOUR", "DAY", "WEEK"];
59
59
  export type VaultHistoricalApyInterval = (typeof allowedIntervals)[number];
60
- export declare function isValidVaultHistoricalApyInterval(interval: any): interval is VaultHistoricalApyInterval;
60
+ export declare function isValidVaultHistoricalApyInterval(interval: string): interval is VaultHistoricalApyInterval;
61
61
  export declare function prepareUnsignedTx(connection: anchor.web3.Connection, payer: anchor.web3.PublicKey, ixns: anchor.web3.TransactionInstruction[], lutAddr?: anchor.web3.PublicKey, additionalSigner?: anchor.AnchorProvider): Promise<string>;
62
62
  export {};
package/dist/index.js CHANGED
@@ -128,9 +128,12 @@ class Client {
128
128
  headers: this.headers,
129
129
  });
130
130
  checkResponse(response);
131
- const body = JSON.parse(JSON.stringify(await response.json()));
132
- body.vault = new anchor.web3.PublicKey(body.vault);
133
- return body;
131
+ const body = await response.json();
132
+ const historicalVaultApyResponse = {
133
+ vault,
134
+ data: body,
135
+ };
136
+ return historicalVaultApyResponse;
134
137
  }
135
138
  async issue(vault, assetMint, amount) {
136
139
  const url = new URL(`${this.baseUrl}/issue`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrot-protocol/http-client",
3
- "version": "0.2.12-hva-dev-a84f07d",
3
+ "version": "0.2.12-hva-dev-dfefb01",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",