@pendle/sdk-boros 0.1.36 → 0.1.37
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/README.md
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
# Pendle SDK Boros
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Overview
|
|
4
4
|
|
|
5
5
|
Below is the documentation for the SDK. For more details about the overall architecture, contracts, API, and more, please refer to the [documentation](documentation/) folder.
|
|
6
6
|
|
|
7
|
+
The repository is organized as follows:
|
|
8
|
+
|
|
9
|
+
- [documentation](documentation/):
|
|
10
|
+
- [lite-paper](documentation/lite-paper.md): lite paper for how boros works
|
|
11
|
+
- [contracts-docs](documentation/contracts-docs/): contains the documentation to deep dive into the contracts, the overall architecture, and terminology
|
|
12
|
+
- [API.docs.md](documentation/API.docs.md): API documentation
|
|
13
|
+
- [SDK.docs.md](documentation/SDK.docs.md): SDK documentation
|
|
14
|
+
- [example](documentation/example/): example code for the SDK
|
|
15
|
+
- [src](src/): contains the source code of the SDK
|
|
16
|
+
|
|
7
17
|
You can start with the [lite paper](documentation/lite-paper.md) to understand the overall architecture and mechanics of the platform.
|
|
18
|
+
|
|
8
19
|
Then you can go to the [API docs](documentation/API.docs.md) to understand the API and parameters.
|
|
9
20
|
After that, you can refer to [SDK docs](documentation/SDK.docs.md) and [example](documentation/example/) to see how to use the SDK.
|
|
10
21
|
|
|
11
22
|
## Installation
|
|
12
23
|
|
|
24
|
+
To use the SDK, you can install it using yarn. Our SDK is yet to be published to npm, so you need to config private credentials to install it. Can have a look at [.yarnrc.yml](.yarnrc.yml) for more details.
|
|
25
|
+
|
|
13
26
|
```bash
|
|
27
|
+
export PENDLE_SDK_BOROS_NPM_AUTH_TOKEN=<your-npm-auth-token>
|
|
28
|
+
# config your .yarnrc.yml follow our .yarnrc.yml file
|
|
29
|
+
# then install the package
|
|
14
30
|
yarn add @pendle/sdk-boros
|
|
15
|
-
|
|
16
31
|
```
|
|
17
32
|
|
|
33
|
+
|
|
18
34
|
## Initialization
|
|
19
35
|
|
|
20
36
|
```typescript
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Hex, Log } from 'viem';
|
|
1
|
+
import { Address, Hex, Log, PublicClient } from 'viem';
|
|
2
|
+
import { SimulateReturnType } from 'viem/actions';
|
|
2
3
|
export declare function parseEvents(txHash: Hex): Promise<{
|
|
3
4
|
hub: import("viem").ParseEventLogsReturnType<readonly [{
|
|
4
5
|
readonly anonymous: false;
|
|
@@ -3600,3 +3601,4 @@ export declare function getTransactionData(txHash: Hex): Promise<{
|
|
|
3600
3601
|
};
|
|
3601
3602
|
} | null)[];
|
|
3602
3603
|
}>;
|
|
3604
|
+
export declare function simulate(publicClient: PublicClient, to: Address, data: Hex): Promise<SimulateReturnType>;
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.parseEvents = parseEvents;
|
|
37
37
|
exports.decodeLog = decodeLog;
|
|
38
38
|
exports.getTransactionData = getTransactionData;
|
|
39
|
+
exports.simulate = simulate;
|
|
39
40
|
const viem_1 = require("viem");
|
|
40
41
|
const Abis = __importStar(require("../../contracts/viemAbis"));
|
|
41
42
|
const publicClient_1 = require("../publicClient");
|
|
@@ -63,4 +64,15 @@ async function getTransactionData(txHash) {
|
|
|
63
64
|
const decodedLogs = receipt.logs.map((log) => decodeLog(log));
|
|
64
65
|
return { decodedLogs };
|
|
65
66
|
}
|
|
67
|
+
async function simulate(publicClient, to, data) {
|
|
68
|
+
const result = await publicClient.simulate({
|
|
69
|
+
blocks: [{
|
|
70
|
+
calls: [{
|
|
71
|
+
to,
|
|
72
|
+
data,
|
|
73
|
+
}]
|
|
74
|
+
}]
|
|
75
|
+
});
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
66
78
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/entities/exchange/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/entities/exchange/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,kCAMC;AAED,8BAUC;AAED,gDAIC;AAED,4BAUC;AAzCD,+BAAuF;AACvF,+DAAiD;AACjD,kDAA+C;AAGxC,KAAK,UAAU,WAAW,CAAC,MAAW;IAC3C,MAAM,OAAO,GAAG,MAAM,2BAAY,CAAC,yBAAyB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/E,OAAO;QACL,GAAG,EAAE,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QACpE,MAAM,EAAE,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;KACxE,CAAC;AACJ,CAAC;AAED,SAAgB,SAAS,CAAC,GAA+B;IACvD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,OAAO,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACrE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAEM,KAAK,UAAU,kBAAkB,CAAC,MAAW;IAClD,MAAM,OAAO,GAAG,MAAM,2BAAY,CAAC,q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