@pendle/sdk-boros 1.7.1 → 1.8.1-open-api-migration-v2-20260818044048
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/CHANGELOG.md +37 -0
- package/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +1 -0
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/openApi/generated/OpenApiSdk.d.ts +1485 -0
- package/dist/backend/openApi/generated/OpenApiSdk.js +714 -0
- package/dist/backend/openApi/generated/OpenApiSdk.js.map +1 -0
- package/dist/backend/openApi/index.d.ts +1 -0
- package/dist/backend/openApi/index.js +18 -0
- package/dist/backend/openApi/index.js.map +1 -0
- package/dist/backend/openApi/module.d.ts +7 -0
- package/dist/backend/openApi/module.js +67 -0
- package/dist/backend/openApi/module.js.map +1 -0
- package/dist/backend/secrettune/module.d.ts +1 -0
- package/dist/backend/secrettune/module.js +4 -0
- package/dist/backend/secrettune/module.js.map +1 -1
- package/dist/entities/Calculator/exchangeFees.d.ts +3 -3
- package/dist/entities/Calculator/exchangeFees.js +21 -13
- package/dist/entities/Calculator/exchangeFees.js.map +1 -1
- package/dist/entities/Calculator/marginCalculator.d.ts +2 -2
- package/dist/entities/Calculator/marginCalculator.js.map +1 -1
- package/dist/entities/Calculator/strategyFinder.d.ts +2 -2
- package/dist/entities/Calculator/strategyFinder.js +15 -14
- package/dist/entities/Calculator/strategyFinder.js.map +1 -1
- package/dist/entities/Calculator/strategyUtils.d.ts +1 -1
- package/dist/entities/Calculator/strategyUtils.js +4 -4
- package/dist/entities/Calculator/strategyUtils.js.map +1 -1
- package/dist/entities/Calculator/types.d.ts +3 -3
- package/dist/entities/aggregatorHelpers/AggregatorHelperErrors.d.ts +45 -48
- package/dist/entities/aggregatorHelpers/AggregatorHelperErrors.js +107 -90
- package/dist/entities/aggregatorHelpers/AggregatorHelperErrors.js.map +1 -1
- package/dist/entities/aggregatorHelpers/PendleSwap/PendleSwapAggregatorHelper.d.ts +1 -1
- package/dist/entities/aggregatorHelpers/PendleSwap/PendleSwapAggregatorHelper.js +3 -3
- package/dist/entities/aggregatorHelpers/PendleSwap/PendleSwapAggregatorHelper.js.map +1 -1
- package/dist/entities/aggregatorHelpers/index.d.ts +1 -0
- package/dist/entities/aggregatorHelpers/index.js +1 -0
- package/dist/entities/aggregatorHelpers/index.js.map +1 -1
- package/dist/entities/collateralSwapper/CollateralSwapper.js +9 -9
- package/dist/entities/collateralSwapper/CollateralSwapper.js.map +1 -1
- package/dist/entities/crossChainDeposit/aggregators/Boros/BorosHelper.d.ts +1 -1
- package/dist/entities/crossChainDeposit/aggregators/Boros/BorosHelper.js +3 -3
- package/dist/entities/crossChainDeposit/aggregators/Boros/BorosHelper.js.map +1 -1
- package/dist/entities/crossChainDeposit/aggregators/Bungee/index.d.ts +1 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/index.js +28 -9
- package/dist/entities/crossChainDeposit/aggregators/Bungee/index.js.map +1 -1
- package/dist/entities/crossChainDeposit/aggregators/Lifi/index.js +4 -4
- package/dist/entities/crossChainDeposit/aggregators/Lifi/index.js.map +1 -1
- package/dist/entities/crossChainDeposit/aggregators/Pendle/index.d.ts +1 -1
- package/dist/entities/crossChainDeposit/aggregators/Pendle/index.js +4 -4
- package/dist/entities/crossChainDeposit/aggregators/Pendle/index.js.map +1 -1
- package/dist/entities/exchange/exchange.d.ts +30 -27
- package/dist/entities/exchange/exchange.js +212 -134
- package/dist/entities/exchange/exchange.js.map +1 -1
- package/dist/entities/token/Token.d.ts +3 -3
- package/dist/entities/token/Token.js +9 -3
- package/dist/entities/token/Token.js.map +1 -1
- package/dist/errors/AggregatorErrorCodes.d.ts +9 -0
- package/dist/errors/AggregatorErrorCodes.js +12 -0
- package/dist/errors/AggregatorErrorCodes.js.map +1 -0
- package/dist/errors/ErrorCodes.d.ts +28 -16
- package/dist/errors/ErrorCodes.js +2 -0
- package/dist/errors/ErrorCodes.js.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.js +1 -0
- package/dist/errors/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @pendle/sdk-boros
|
|
2
2
|
|
|
3
|
+
## 1.8.1-open-api-migration-v2-20260818044048
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 47ce2b8: feat(sdk): migrate Exchange to the public Open API (/apis)
|
|
8
|
+
|
|
9
|
+
## 1.8.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 39fcae2: Aggregator failures now throw a single displayable `AggregatorHelperError` carrying a stable `code`, user-facing `shortMessage`, and structured fields — and it is exported, so consumers can finally catch it.
|
|
14
|
+
|
|
15
|
+
- `AggregatorHelperError` — `code`, `shortMessage`, `retryable`, `aggregator`, `requestType`, `requestData`, `status`, `providerMessage`, `providerCode`, `responseData`, plus `.is(err, code?)` and `.isFrom(err, aggregator, requestType?)` narrowing helpers.
|
|
16
|
+
- `AggregatorErrorCodes` — `AGGREGATOR_TIMEOUT`, `AGGREGATOR_NETWORK_ERROR`, `AGGREGATOR_RATE_LIMITED`, `AGGREGATOR_SERVER_ERROR`, `AGGREGATOR_REQUEST_REJECTED`, `AGGREGATOR_UNKNOWN_ERROR`. Merged into `ErrorCodes`, so `ErrorCodes.AGGREGATOR_TIMEOUT` is the same value.
|
|
17
|
+
- `defaultAggregatorErrorMessageHandler` — the copy table, keyed by code, exported so a caller can render the default text for a code itself. The copy is fixed for now: there is deliberately no way to install a replacement handler.
|
|
18
|
+
- `PendleSdkError` is now exported too — it was the base class of every aggregator error and unreachable.
|
|
19
|
+
|
|
20
|
+
Nothing was removed from the public surface. `AggregatorHelperRequestError`, `AggregatorHelperServerError`, `UnknownAggregatorHelperError`, `WrappedAxiosError` and `AggregatorHelperAxiosError` are gone, but none of them were exported — a consumer could not name or `instanceof` them, only read their `.message`. That message is the thing this changes.
|
|
21
|
+
|
|
22
|
+
A 503 from Bungee used to surface as `BUNGEE: BUNGEE server error, error code unknown` on `.message`, and `BUNGEE: BUNGEE: BUNGEE server error, error code unknown` from `String(err)` and the stack header. The class set `name` to the `AggregatorName`, so `Error.prototype.toString()` (`${name}: ${message}`) stacked the provider on top of a message that already self-prefixed twice. `name` is now the class name, which also stops every aggregator failure collapsing into one `BUNGEE` group in log aggregators. The same error now reads `Bungee is temporarily unavailable. Please try again or pick another route.` on `shortMessage`, with `[AGGREGATOR_SERVER_ERROR aggregator=BUNGEE requestType=quote status=503]` appended on `message` for logs.
|
|
23
|
+
|
|
24
|
+
Errors are classified by failure mode rather than by the shape of the underlying axios object, because that is what a caller has to act on — retry, fall back to another route, or fix the request. `classifyAggregatorError` drops its `errorStatuses` and `errorDataCheckingFn` parameters: `classifyAggregatorError(aggregator, error, requestType, requestData)`. Every call site passed the same hardcoded `[500, 502, 503, 504]`, which quietly classified 501/507/599 as unknown, and all 15 passed `() => undefined` as the data checker — which made `AggregatorHelperRequestError` unreachable and threw away every 4xx body the provider sent. A default extractor now reads the provider's own reason off `message`/`error` and its code off `code`/`errorCode`/`statusCode`, the shapes Socket, LI.FI and the Boros API actually return.
|
|
25
|
+
|
|
26
|
+
The provider's reason becomes the display copy for `AGGREGATOR_REQUEST_REJECTED` — it is specific and the user can act on it — but is deliberately kept off `shortMessage` for `AGGREGATOR_SERVER_ERROR`, where a 5xx body is an internal detail (`upstream pod OOMKilled` is not for users). It is always available on `providerMessage`. Response bodies live on `responseData` instead of being `JSON.stringify`'d into the message, which previously inlined an unbounded blob into every log line.
|
|
27
|
+
|
|
28
|
+
The codes live in `src/errors/AggregatorErrorCodes.ts`, a leaf module with no imports, spread into `ApiErrorCodes`. Handling a swap error should not pull the contract error ABI into the bundle, which is what importing them from `ErrorCodes` would have done.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- b09c3c5: Bungee quotes round the slippage they send to 3 decimal places. Socket's backend started rejecting anything longer (`400 Validation Error : slippage must have at most 3 decimal places`), which broke every quote whose slippage came out of the dynamic auto-slippage formulas — `8 / inputValueUsd` on a $999 deposit produces `0.8008006885764801%`.
|
|
33
|
+
|
|
34
|
+
Both `quoteDeposit` and `quoteWithdraw` now go through `toBungeeSlippage`, which converts the SDK's decimal (`0.005`) to Socket's percentage (`0.5`) and rounds to nearest 3 dp.
|
|
35
|
+
|
|
36
|
+
Rounding is decimal (`toFixed`), not `Math.ceil(x * 1000) / 1000` — the latter bumps 648 of the first 5000 already-valid 3 dp values a full step up on a float ULP, so a caller asking for `0.009%` would have been quoted at `0.01%`.
|
|
37
|
+
|
|
38
|
+
A nonzero tolerance that rounds to `0` is floored at `0.001%`, since a zero tolerance makes every route revert. An explicitly requested `0` is passed through unchanged.
|
|
39
|
+
|
|
3
40
|
## 1.7.1
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
package/dist/backend/index.d.ts
CHANGED
package/dist/backend/index.js
CHANGED
|
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./secrettune"), exports);
|
|
18
|
+
__exportStar(require("./openApi"), exports);
|
|
18
19
|
__exportStar(require("./LogStore"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/backend/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B"}
|