@carrot-protocol/boost-http-client 0.2.3 → 0.2.4-fe-math-dev-63c38da
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 -0
- package/dist/index.js +29 -1
- package/dist/types.d.ts +4 -0
- package/package.json +6 -1
- package/src/index.ts +7 -0
- package/src/types.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AnchorProvider, web3 } from "@coral-xyz/anchor";
|
|
|
2
2
|
import { GetBankResponse, GetUserResponse, GetGroupResponse, GetUserRequest } from "./types";
|
|
3
3
|
export * from "./types";
|
|
4
4
|
export * from "./utils";
|
|
5
|
+
export * as Common from "@carrot-protocol/clend-common";
|
|
5
6
|
/**
|
|
6
7
|
* HTTP Client for Carrot Boost API
|
|
7
8
|
*/
|
package/dist/index.js
CHANGED
|
@@ -10,20 +10,44 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
13
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
20
|
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
16
38
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
40
|
};
|
|
19
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.Client = void 0;
|
|
42
|
+
exports.Client = exports.Common = void 0;
|
|
21
43
|
const axios_1 = __importDefault(require("axios"));
|
|
22
44
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
23
45
|
const bs58_1 = __importDefault(require("bs58"));
|
|
24
46
|
// Re-export types
|
|
25
47
|
__exportStar(require("./types"), exports);
|
|
26
48
|
__exportStar(require("./utils"), exports);
|
|
49
|
+
// re-export clend-common
|
|
50
|
+
exports.Common = __importStar(require("@carrot-protocol/clend-common"));
|
|
27
51
|
/**
|
|
28
52
|
* HTTP Client for Carrot Boost API
|
|
29
53
|
*/
|
|
@@ -292,8 +316,12 @@ function parseBank(bankJson) {
|
|
|
292
316
|
utilizationRate: Number(bankJson.utilizationRate),
|
|
293
317
|
assetAmount: new anchor_1.BN(bankJson.assetAmount, "hex"),
|
|
294
318
|
assetAmountUi: Number(bankJson.assetAmountUi),
|
|
319
|
+
assetInitWeight: Number(bankJson.assetInitWeight),
|
|
320
|
+
assetMaintWeight: Number(bankJson.assetMaintWeight),
|
|
295
321
|
liabilityAmount: new anchor_1.BN(bankJson.liabilityAmount, "hex"),
|
|
296
322
|
liabilityAmountUi: Number(bankJson.liabilityAmountUi),
|
|
323
|
+
liabilityInitWeight: Number(bankJson.liabilityInitWeight),
|
|
324
|
+
liabilityMaintWeight: Number(bankJson.liabilityMaintWeight),
|
|
297
325
|
price: Number(bankJson.price),
|
|
298
326
|
depositLimit: new anchor_1.BN(bankJson.depositLimit, "hex"),
|
|
299
327
|
depositLimitUi: Number(bankJson.depositLimitUi),
|
package/dist/types.d.ts
CHANGED
|
@@ -106,8 +106,12 @@ export interface Bank {
|
|
|
106
106
|
utilizationRate: number;
|
|
107
107
|
assetAmount: BN;
|
|
108
108
|
assetAmountUi: number;
|
|
109
|
+
assetInitWeight: number;
|
|
110
|
+
assetMaintWeight: number;
|
|
109
111
|
liabilityAmount: BN;
|
|
110
112
|
liabilityAmountUi: number;
|
|
113
|
+
liabilityInitWeight: number;
|
|
114
|
+
liabilityMaintWeight: number;
|
|
111
115
|
price: number;
|
|
112
116
|
depositLimit: BN;
|
|
113
117
|
depositLimitUi: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carrot-protocol/boost-http-client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4-fe-math-dev-63c38da",
|
|
4
4
|
"description": "HTTP client for Carrot Boost API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@coral-xyz/anchor": "^0.29.0",
|
|
17
|
+
"@carrot-protocol/clend-common": "0.1.0-fe-math-dev-62e8e32",
|
|
17
18
|
"axios": "^1.8.3",
|
|
18
19
|
"bs58": "^6.0.0",
|
|
19
20
|
"decimal.js": "^10.5.0"
|
|
@@ -22,5 +23,9 @@
|
|
|
22
23
|
"@types/node": "^20.11.19",
|
|
23
24
|
"prettier": "^3.2.5",
|
|
24
25
|
"typescript": "^5.3.3"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@coral-xyz/anchor": "^0.29.0",
|
|
29
|
+
"@carrot-protocol/clend-common": "0.1.0-fe-math-dev-62e8e32"
|
|
25
30
|
}
|
|
26
31
|
}
|
package/src/index.ts
CHANGED
|
@@ -24,6 +24,9 @@ import encode from "bs58";
|
|
|
24
24
|
export * from "./types";
|
|
25
25
|
export * from "./utils";
|
|
26
26
|
|
|
27
|
+
// re-export clend-common
|
|
28
|
+
export * as Common from "@carrot-protocol/clend-common";
|
|
29
|
+
|
|
27
30
|
/**
|
|
28
31
|
* HTTP Client for Carrot Boost API
|
|
29
32
|
*/
|
|
@@ -388,8 +391,12 @@ function parseBank(bankJson: any): Bank {
|
|
|
388
391
|
utilizationRate: Number(bankJson.utilizationRate),
|
|
389
392
|
assetAmount: new BN(bankJson.assetAmount, "hex"),
|
|
390
393
|
assetAmountUi: Number(bankJson.assetAmountUi),
|
|
394
|
+
assetInitWeight: Number(bankJson.assetInitWeight),
|
|
395
|
+
assetMaintWeight: Number(bankJson.assetMaintWeight),
|
|
391
396
|
liabilityAmount: new BN(bankJson.liabilityAmount, "hex"),
|
|
392
397
|
liabilityAmountUi: Number(bankJson.liabilityAmountUi),
|
|
398
|
+
liabilityInitWeight: Number(bankJson.liabilityInitWeight),
|
|
399
|
+
liabilityMaintWeight: Number(bankJson.liabilityMaintWeight),
|
|
393
400
|
price: Number(bankJson.price),
|
|
394
401
|
depositLimit: new BN(bankJson.depositLimit, "hex"),
|
|
395
402
|
depositLimitUi: Number(bankJson.depositLimitUi),
|
package/src/types.ts
CHANGED
|
@@ -123,8 +123,12 @@ export interface Bank {
|
|
|
123
123
|
utilizationRate: number;
|
|
124
124
|
assetAmount: BN;
|
|
125
125
|
assetAmountUi: number;
|
|
126
|
+
assetInitWeight: number;
|
|
127
|
+
assetMaintWeight: number;
|
|
126
128
|
liabilityAmount: BN;
|
|
127
129
|
liabilityAmountUi: number;
|
|
130
|
+
liabilityInitWeight: number;
|
|
131
|
+
liabilityMaintWeight: number;
|
|
128
132
|
price: number;
|
|
129
133
|
depositLimit: BN;
|
|
130
134
|
depositLimitUi: number;
|