@pendle/sdk-boros 0.4.35 → 0.4.36
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/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/vePendle/index.d.ts +1 -0
- package/dist/entities/vePendle/index.js +18 -0
- package/dist/entities/vePendle/index.js.map +1 -0
- package/dist/entities/vePendle/vePendle.d.ts +6 -0
- package/dist/entities/vePendle/vePendle.js +28 -0
- package/dist/entities/vePendle/vePendle.js.map +1 -0
- package/package.json +1 -1
package/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
|
@@ -23,4 +23,5 @@ __exportStar(require("./Distributor"), exports);
|
|
|
23
23
|
__exportStar(require("./multiTokenMerkleDistributor"), exports);
|
|
24
24
|
__exportStar(require("./wrappedEth"), exports);
|
|
25
25
|
__exportStar(require("./subaccount"), exports);
|
|
26
|
+
__exportStar(require("./vePendle"), exports);
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,6CAA2B;AAC3B,wCAAsB;AACtB,+CAA6B;AAC7B,gDAA8B;AAC9B,gEAA8C;AAC9C,+CAA6B;AAC7B,+CAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2CAAyB;AACzB,6CAA2B;AAC3B,wCAAsB;AACtB,+CAA6B;AAC7B,gDAA8B;AAC9B,gEAA8C;AAC9C,+CAA6B;AAC7B,+CAA6B;AAC7B,6CAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './vePendle';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./vePendle"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/vePendle/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VePendle = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const contracts_1 = require("../../contracts");
|
|
6
|
+
const chains_1 = require("viem/chains");
|
|
7
|
+
const boros_offchain_math_1 = require("@pendle/boros-offchain-math");
|
|
8
|
+
const VE_PENDLE_ADDRESS = '0x4f30A9D41B80ecC5B94306AB4364951AE3170210';
|
|
9
|
+
const ETH_RPC_URL = 'https://eth.llamarpc.com';
|
|
10
|
+
class VePendle {
|
|
11
|
+
vePendleContract;
|
|
12
|
+
constructor(rpcUrl) {
|
|
13
|
+
this.vePendleContract = (0, viem_1.getContract)({
|
|
14
|
+
address: VE_PENDLE_ADDRESS,
|
|
15
|
+
abi: contracts_1.iPVeTokenAbi,
|
|
16
|
+
client: (0, viem_1.createPublicClient)({
|
|
17
|
+
chain: chains_1.mainnet,
|
|
18
|
+
transport: (0, viem_1.http)(rpcUrl ?? ETH_RPC_URL),
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async getVePendleBalance(userAddress) {
|
|
23
|
+
const balance = await this.vePendleContract.read.balanceOf([userAddress]);
|
|
24
|
+
return boros_offchain_math_1.FixedX18.fromRawValue(balance).toNumber();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.VePendle = VePendle;
|
|
28
|
+
//# sourceMappingURL=vePendle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vePendle.js","sourceRoot":"","sources":["../../../src/entities/vePendle/vePendle.ts"],"names":[],"mappings":";;;AAAA,+BAAsE;AACtE,+CAA+C;AAC/C,wCAAsC;AACtC,qEAAuD;AAEvD,MAAM,iBAAiB,GAAG,4CAA4C,CAAC;AACvE,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAE/C,MAAa,QAAQ;IACX,gBAAgB,CAAC;IACzB,YAAY,MAAe;QACzB,IAAI,CAAC,gBAAgB,GAAG,IAAA,kBAAW,EAAC;YAClC,OAAO,EAAE,iBAAiB;YAC1B,GAAG,EAAE,wBAAY;YACjB,MAAM,EAAE,IAAA,yBAAkB,EAAC;gBACzB,KAAK,EAAE,gBAAO;gBACd,SAAS,EAAE,IAAA,WAAI,EAAC,MAAM,IAAI,WAAW,CAAC;aACvC,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,WAAoB;QAC3C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;QAC1E,OAAO,8BAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnD,CAAC;CACF;AAjBD,4BAiBC"}
|