@pendle/sdk-boros 1.0.12-cross-deposit-2 → 1.0.12

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.
Files changed (98) hide show
  1. package/dist/addresses.d.ts +1 -11
  2. package/dist/addresses.js +1 -23
  3. package/dist/addresses.js.map +1 -1
  4. package/dist/backend/secrettune/BorosCoreSDK.d.ts +21 -257
  5. package/dist/backend/secrettune/BorosCoreSDK.js +7 -125
  6. package/dist/backend/secrettune/BorosCoreSDK.js.map +1 -1
  7. package/dist/backend/secrettune/BorosSendTxsBotSDK.d.ts +4 -10
  8. package/dist/backend/secrettune/BorosSendTxsBotSDK.js +1 -1
  9. package/dist/backend/secrettune/BorosSendTxsBotSDK.js.map +1 -1
  10. package/dist/backend/secrettune/module.d.ts +0 -6
  11. package/dist/backend/secrettune/module.js +0 -25
  12. package/dist/backend/secrettune/module.js.map +1 -1
  13. package/dist/contracts/contracts.factory.d.ts +3 -9
  14. package/dist/contracts/contracts.factory.js +4 -16
  15. package/dist/contracts/contracts.factory.js.map +1 -1
  16. package/dist/entities/index.d.ts +0 -2
  17. package/dist/entities/index.js +0 -2
  18. package/dist/entities/index.js.map +1 -1
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +1 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/types/common.d.ts +0 -24
  23. package/dist/utils/signing/index.d.ts +1 -1
  24. package/dist/utils/signing/index.js +1 -2
  25. package/dist/utils/signing/index.js.map +1 -1
  26. package/dist/utils/signing/sensitive.d.ts +1 -2
  27. package/dist/utils/signing/sensitive.js +0 -29
  28. package/dist/utils/signing/sensitive.js.map +1 -1
  29. package/package.json +1 -1
  30. package/dist/backend/secrettune/PendleV2SDK.d.ts +0 -2281
  31. package/dist/backend/secrettune/PendleV2SDK.js +0 -970
  32. package/dist/backend/secrettune/PendleV2SDK.js.map +0 -1
  33. package/dist/common/chainId.d.ts +0 -12
  34. package/dist/common/chainId.js +0 -17
  35. package/dist/common/chainId.js.map +0 -1
  36. package/dist/contracts/abis/viemAbiDepositBoxFactory.d.ts +0 -75
  37. package/dist/contracts/abis/viemAbiDepositBoxFactory.js +0 -103
  38. package/dist/contracts/abis/viemAbiDepositBoxFactory.js.map +0 -1
  39. package/dist/contracts/abis/viemAbiRouter.d.ts +0 -1983
  40. package/dist/contracts/abis/viemAbiRouter.js +0 -2549
  41. package/dist/contracts/abis/viemAbiRouter.js.map +0 -1
  42. package/dist/contracts/deposit-box-factory.d.ts +0 -86
  43. package/dist/contracts/deposit-box-factory.js +0 -16
  44. package/dist/contracts/deposit-box-factory.js.map +0 -1
  45. package/dist/contracts/erc20.d.ts +0 -158
  46. package/dist/contracts/erc20.js +0 -52
  47. package/dist/contracts/erc20.js.map +0 -1
  48. package/dist/contracts/router.d.ts +0 -1987
  49. package/dist/contracts/router.js +0 -12
  50. package/dist/contracts/router.js.map +0 -1
  51. package/dist/entities/crossChainDeposit/AggregatorHelper.d.ts +0 -119
  52. package/dist/entities/crossChainDeposit/AggregatorHelper.js +0 -26
  53. package/dist/entities/crossChainDeposit/AggregatorHelper.js.map +0 -1
  54. package/dist/entities/crossChainDeposit/AggregatorHelperErrors.d.ts +0 -83
  55. package/dist/entities/crossChainDeposit/AggregatorHelperErrors.js +0 -116
  56. package/dist/entities/crossChainDeposit/AggregatorHelperErrors.js.map +0 -1
  57. package/dist/entities/crossChainDeposit/Depositor.d.ts +0 -31
  58. package/dist/entities/crossChainDeposit/Depositor.js +0 -64
  59. package/dist/entities/crossChainDeposit/Depositor.js.map +0 -1
  60. package/dist/entities/crossChainDeposit/Withdrawer.d.ts +0 -28
  61. package/dist/entities/crossChainDeposit/Withdrawer.js +0 -59
  62. package/dist/entities/crossChainDeposit/Withdrawer.js.map +0 -1
  63. package/dist/entities/crossChainDeposit/aggregators/Boros/BorosHelper.d.ts +0 -53
  64. package/dist/entities/crossChainDeposit/aggregators/Boros/BorosHelper.js +0 -272
  65. package/dist/entities/crossChainDeposit/aggregators/Boros/BorosHelper.js.map +0 -1
  66. package/dist/entities/crossChainDeposit/aggregators/Boros/index.d.ts +0 -2
  67. package/dist/entities/crossChainDeposit/aggregators/Boros/index.js +0 -19
  68. package/dist/entities/crossChainDeposit/aggregators/Boros/index.js.map +0 -1
  69. package/dist/entities/crossChainDeposit/aggregators/Boros/types.d.ts +0 -10
  70. package/dist/entities/crossChainDeposit/aggregators/Boros/types.js +0 -3
  71. package/dist/entities/crossChainDeposit/aggregators/Boros/types.js.map +0 -1
  72. package/dist/entities/crossChainDeposit/aggregators/Lifi/index.d.ts +0 -56
  73. package/dist/entities/crossChainDeposit/aggregators/Lifi/index.js +0 -244
  74. package/dist/entities/crossChainDeposit/aggregators/Lifi/index.js.map +0 -1
  75. package/dist/entities/crossChainDeposit/aggregators/Lifi/types.d.ts +0 -186
  76. package/dist/entities/crossChainDeposit/aggregators/Lifi/types.js +0 -28
  77. package/dist/entities/crossChainDeposit/aggregators/Lifi/types.js.map +0 -1
  78. package/dist/entities/crossChainDeposit/aggregators/Pendle/index.d.ts +0 -54
  79. package/dist/entities/crossChainDeposit/aggregators/Pendle/index.js +0 -250
  80. package/dist/entities/crossChainDeposit/aggregators/Pendle/index.js.map +0 -1
  81. package/dist/entities/crossChainDeposit/helpers/TokenHelper.d.ts +0 -28
  82. package/dist/entities/crossChainDeposit/helpers/TokenHelper.js +0 -97
  83. package/dist/entities/crossChainDeposit/helpers/TokenHelper.js.map +0 -1
  84. package/dist/entities/crossChainDeposit/helpers/utils.d.ts +0 -4
  85. package/dist/entities/crossChainDeposit/helpers/utils.js +0 -25
  86. package/dist/entities/crossChainDeposit/helpers/utils.js.map +0 -1
  87. package/dist/entities/crossChainDeposit/index.d.ts +0 -3
  88. package/dist/entities/crossChainDeposit/index.js +0 -20
  89. package/dist/entities/crossChainDeposit/index.js.map +0 -1
  90. package/dist/entities/token/Token.d.ts +0 -32
  91. package/dist/entities/token/Token.js +0 -63
  92. package/dist/entities/token/Token.js.map +0 -1
  93. package/dist/entities/token/index.d.ts +0 -1
  94. package/dist/entities/token/index.js +0 -18
  95. package/dist/entities/token/index.js.map +0 -1
  96. package/dist/errors/PendleSdkError.d.ts +0 -7
  97. package/dist/errors/PendleSdkError.js +0 -15
  98. package/dist/errors/PendleSdkError.js.map +0 -1
@@ -1,272 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.BorosLzBridgeHelper = exports.BorosWithdrawResult = exports.BorosLzBridgeResult = exports.LAYER_ZERO_SCAN_API = void 0;
13
- const axios_1 = __importDefault(require("axios"));
14
- const viem_1 = require("viem");
15
- const chains_1 = require("viem/chains");
16
- const addresses_1 = require("../../../../addresses");
17
- const cacheDecorators_1 = require("../../../../common/cacheDecorators");
18
- const constants_1 = require("../../../../multicall/constants");
19
- const token_1 = require("../../../token");
20
- const AggregatorHelper_1 = require("../../AggregatorHelper");
21
- const AggregatorHelperErrors_1 = require("../../AggregatorHelperErrors");
22
- const utils_1 = require("../../helpers/utils");
23
- exports.LAYER_ZERO_SCAN_API = 'https://scan.layerzero-api.com/v1';
24
- class BorosLzBridgeResult {
25
- routes = [];
26
- rawResult;
27
- req;
28
- isDeposit;
29
- constructor(params) {
30
- const { isDeposit, req, res, tokenLookupTable } = params;
31
- this.isDeposit = isDeposit;
32
- this.req = req;
33
- this.rawResult = res;
34
- const fromToken = tokenLookupTable.lookup(chains_1.bsc.id, res.fromToken, true);
35
- const toToken = tokenLookupTable.lookup(chains_1.arbitrum.id, res.toToken, true);
36
- this.routes = [
37
- {
38
- id: 'boros',
39
- inputTokenAmount: new token_1.TokenAmount(fromToken, BigInt(res.fromAmount)),
40
- outputTokenAmount: new token_1.TokenAmount(toToken, BigInt(res.toAmount)),
41
- minOutputTokenAmount: new token_1.TokenAmount(toToken, BigInt(res.minToAmount)),
42
- steps: [
43
- {
44
- fromTokenAmount: new token_1.TokenAmount(fromToken, BigInt(res.fromAmount)),
45
- toTokenAmount: new token_1.TokenAmount(toToken, BigInt(res.toAmount)),
46
- executionDuration: 20,
47
- feeCosts: res.feeCosts.map((feeCost) => ({
48
- name: feeCost.name,
49
- amountUSD: Number(feeCost.amountUsd),
50
- })),
51
- gasCosts: res.gasCosts.flatMap((gasCost) => {
52
- const token = tokenLookupTable.lookup(gasCost.chainId, gasCost.token);
53
- if (token == null) {
54
- return [];
55
- }
56
- return {
57
- tokenAmount: new token_1.TokenAmount(token, BigInt(gasCost.amount)),
58
- amountUSD: Number(gasCost.amountUsd),
59
- };
60
- }),
61
- tool: {
62
- key: 'boros',
63
- name: 'LayerZero',
64
- logoURI: 'https://storage.googleapis.com/prod-pendle-bucket-a/images/assets/pro/ea33e392-1876-46a5-b7ce-c8434b5a7e71.svg',
65
- },
66
- },
67
- ],
68
- },
69
- ];
70
- }
71
- getAggregatorName() {
72
- return AggregatorHelper_1.AggregatorName.BOROS;
73
- }
74
- selectRoute() {
75
- return this.rawResult;
76
- }
77
- async getRouteData() {
78
- if (this.isDeposit) {
79
- (0, utils_1.ensureDepositBoxAddress)(this.req.fromAddress, this.req.boxId, this.rawResult.tx.to);
80
- }
81
- return {
82
- transferData: {
83
- aggregatorName: AggregatorHelper_1.AggregatorName.BOROS,
84
- approvalAddress: (0, addresses_1.toAddress)(this.rawResult.tx.to),
85
- calldata: this.rawResult.tx.calldata,
86
- value: BigInt(this.rawResult.tx.value),
87
- from: (0, addresses_1.toAddress)(this.rawResult.tx.from),
88
- to: (0, addresses_1.toAddress)(this.rawResult.tx.to),
89
- chainId: chains_1.bsc.id,
90
- },
91
- swapData: {
92
- tokenSpent: (0, addresses_1.toAddress)(this.req.toToken),
93
- amountSpent: BigInt(this.rawResult.toAmount),
94
- minAmountSpent: BigInt(this.rawResult.minToAmount),
95
- extRouter: viem_1.zeroAddress,
96
- extCalldata: '0x',
97
- },
98
- };
99
- }
100
- }
101
- exports.BorosLzBridgeResult = BorosLzBridgeResult;
102
- class BorosWithdrawResult {
103
- routes = [];
104
- rawResult;
105
- req;
106
- constructor(params) {
107
- const { req, res, tokenLookupTable } = params;
108
- this.req = req;
109
- this.rawResult = res;
110
- const fromToken = tokenLookupTable.lookup(chains_1.arbitrum.id, res.fromToken, true);
111
- const toToken = tokenLookupTable.lookup(chains_1.bsc.id, res.toToken, true);
112
- this.routes = [
113
- {
114
- id: 'boros',
115
- inputTokenAmount: new token_1.TokenAmount(fromToken, BigInt(res.fromAmount)),
116
- outputTokenAmount: new token_1.TokenAmount(toToken, BigInt(res.toAmount)),
117
- minOutputTokenAmount: new token_1.TokenAmount(toToken, BigInt(res.minToAmount)),
118
- steps: [
119
- {
120
- fromTokenAmount: new token_1.TokenAmount(fromToken, BigInt(res.fromAmount)),
121
- toTokenAmount: new token_1.TokenAmount(toToken, BigInt(res.toAmount)),
122
- executionDuration: 20,
123
- feeCosts: res.feeCosts.map((feeCost) => ({
124
- name: feeCost.name,
125
- amountUSD: Number(feeCost.amountUsd),
126
- })),
127
- gasCosts: res.gasCosts.flatMap((gasCost) => {
128
- const token = tokenLookupTable.lookup(gasCost.chainId, gasCost.token);
129
- if (token == null) {
130
- return [];
131
- }
132
- return {
133
- tokenAmount: new token_1.TokenAmount(token, BigInt(gasCost.amount)),
134
- amountUSD: Number(gasCost.amountUsd),
135
- };
136
- }),
137
- tool: {
138
- key: 'boros',
139
- name: 'LayerZero',
140
- logoURI: 'https://storage.googleapis.com/prod-pendle-bucket-a/images/assets/pro/ea33e392-1876-46a5-b7ce-c8434b5a7e71.svg',
141
- },
142
- },
143
- ],
144
- },
145
- ];
146
- }
147
- getAggregatorName() {
148
- return AggregatorHelper_1.AggregatorName.BOROS;
149
- }
150
- selectRoute() {
151
- return this.rawResult;
152
- }
153
- async getRouteData(_routeId) {
154
- return {
155
- transferData: {
156
- aggregatorName: AggregatorHelper_1.AggregatorName.BOROS,
157
- approvalAddress: (0, addresses_1.toAddress)(this.rawResult.tx.to),
158
- calldata: this.rawResult.tx.calldata,
159
- value: BigInt(this.rawResult.tx.value),
160
- from: (0, addresses_1.toAddress)(this.rawResult.tx.from),
161
- to: (0, addresses_1.toAddress)(this.rawResult.tx.to),
162
- chainId: chains_1.arbitrum.id,
163
- },
164
- };
165
- }
166
- }
167
- exports.BorosWithdrawResult = BorosWithdrawResult;
168
- class BorosLzBridgeHelper {
169
- borosCoreSdk;
170
- tokenHelper;
171
- layerZeroApiUrl;
172
- aggregatorName = AggregatorHelper_1.AggregatorName.BOROS;
173
- axios;
174
- constructor(borosCoreSdk, tokenHelper, layerZeroApiUrl = exports.LAYER_ZERO_SCAN_API) {
175
- this.borosCoreSdk = borosCoreSdk;
176
- this.tokenHelper = tokenHelper;
177
- this.layerZeroApiUrl = layerZeroApiUrl;
178
- this.axios = axios_1.default.create();
179
- }
180
- async getChains() {
181
- return [
182
- {
183
- chainId: chains_1.bsc.id,
184
- name: 'Binance Smart Chain',
185
- key: 'bsc',
186
- coin: 'BNB',
187
- logoURI: 'https://raw.githubusercontent.com/lifinance/types/main/src/assets/icons/chains/bsc.svg',
188
- },
189
- ];
190
- }
191
- async getTokenLookupTable() {
192
- return this.tokenHelper.getTokenLookupTable();
193
- }
194
- async getRouteStatus(txHash) {
195
- try {
196
- let lzData;
197
- try {
198
- const response = await this.axios.get(`${this.layerZeroApiUrl}/messages/tx/${txHash}`);
199
- lzData = response.data;
200
- }
201
- catch (lzError) {
202
- if (axios_1.default.isAxiosError(lzError) && lzError.response?.status === 404) {
203
- return AggregatorHelper_1.AggregatorRouteStatus.PENDING;
204
- }
205
- throw lzError;
206
- }
207
- switch (lzData.data[0].status.name) {
208
- case 'DELIVERED':
209
- return AggregatorHelper_1.AggregatorRouteStatus.DONE;
210
- case 'FAILED':
211
- return AggregatorHelper_1.AggregatorRouteStatus.FAILED;
212
- case 'UNKNOWN':
213
- return AggregatorHelper_1.AggregatorRouteStatus.NOT_FOUND;
214
- case 'PAYLOAD_STORED':
215
- case 'CONFIRMING':
216
- case 'INFLIGHT':
217
- return AggregatorHelper_1.AggregatorRouteStatus.PENDING;
218
- }
219
- }
220
- catch (error) {
221
- throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.BOROS, error, [500, 502, 503, 504], 'getRouteStatus', txHash, () => undefined);
222
- }
223
- }
224
- async getLayerZeroStatus(txHash) {
225
- const response = await this.axios.get(`${this.layerZeroApiUrl}/messages/tx/${txHash}`);
226
- return response.data;
227
- }
228
- async quoteDeposit(params) {
229
- const req = {
230
- fromToken: params.fromToken,
231
- toToken: params.toToken,
232
- amount: params.fromAmount.toString(),
233
- fromAddress: params.fromAddress,
234
- boxId: params.boxId,
235
- };
236
- try {
237
- const [{ data }, tokenLookupTable] = await Promise.all([
238
- this.borosCoreSdk.depositBox.depositBoxControllerQuoteBscBridgeV2(req),
239
- this.getTokenLookupTable(),
240
- ]);
241
- return new BorosLzBridgeResult({ isDeposit: true, req, res: data, tokenLookupTable });
242
- }
243
- catch (error) {
244
- throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.BOROS, error, [500, 502, 503, 504], 'quote', req, () => undefined);
245
- }
246
- }
247
- async quoteWithdraw(params) {
248
- const tokenLookupTable = await this.getTokenLookupTable();
249
- const tokenId = tokenLookupTable.lookupTokenId(chains_1.arbitrum.id, params.fromToken);
250
- const req = {
251
- fromAddress: params.fromAddress,
252
- tokenId,
253
- amount: params.fromAmount.toString(),
254
- toAddress: params.fromAddress,
255
- };
256
- try {
257
- const { data } = await this.borosCoreSdk.depositBox.depositBoxControllerQuoteWithdrawBsc(req);
258
- return new BorosWithdrawResult({ req: params, res: data, tokenLookupTable });
259
- }
260
- catch (error) {
261
- throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.BOROS, error, [500, 502, 503, 504], 'quoteWithdraw', req, () => undefined);
262
- }
263
- }
264
- }
265
- exports.BorosLzBridgeHelper = BorosLzBridgeHelper;
266
- __decorate([
267
- (0, cacheDecorators_1.GlobalCache)({
268
- generateLookupKey: () => 'BorosLzBridgeHelper.getTokenLookupTable',
269
- ttl_ms: constants_1.MILLISECONDS_IN_A_MINUTE * 10,
270
- })
271
- ], BorosLzBridgeHelper.prototype, "getTokenLookupTable", null);
272
- //# sourceMappingURL=BorosHelper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BorosHelper.js","sourceRoot":"","sources":["../../../../../src/entities/crossChainDeposit/aggregators/Boros/BorosHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+BAAiD;AACjD,wCAA4C;AAC5C,qDAAkD;AAQlD,wEAAiE;AAEjE,+DAA2E;AAC3E,0CAA6C;AAC7C,6DAWgC;AAChC,yEAAuE;AAEvE,+CAA8D;AAGjD,QAAA,mBAAmB,GAAG,mCAAmC,CAAC;AAEvE,MAAa,mBAAmB;IAC9B,MAAM,GAAsB,EAAE,CAAC;IACvB,SAAS,CAAyB;IAClC,GAAG,CAAsB;IACzB,SAAS,CAAU;IAE3B,YAAY,MAKX;QACC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;QAErB,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,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,EAAE;YACpC,SAAS,EAAE,MAAM,CAAC,WAAW;SAC9B,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,oCAAoC,CAAC,GAAG,CAAC,CAAC;YAE9F,OAAO,IAAI,mBAAmB,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAA,gDAAuB,EAC3B,iCAAc,CAAC,KAAK,EACpB,KAAK,EACL,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACpB,eAAe,EACf,GAAG,EACH,GAAG,EAAE,CAAC,SAAS,CAChB,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA5HD,kDA4HC;AA/FO;IAJL,IAAA,6BAAW,EAA6C;QACvD,iBAAiB,EAAE,GAAG,EAAE,CAAC,yCAAyC;QAClE,MAAM,EAAE,oCAAwB,GAAG,EAAE;KACtC,CAAC;8DAGD"}
@@ -1,2 +0,0 @@
1
- export * from './BorosHelper';
2
- export * from './types';
@@ -1,19 +0,0 @@
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("./BorosHelper"), exports);
18
- __exportStar(require("./types"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/entities/crossChainDeposit/aggregators/Boros/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,0CAAwB"}
@@ -1,10 +0,0 @@
1
- export type LayerZeroMessageStatus = 'UNKNOWN' | 'CONFIRMING' | 'INFLIGHT' | 'DELIVERED' | 'FAILED' | 'PAYLOAD_STORED';
2
- export type LayerZeroMessageResponse = {
3
- data: [
4
- {
5
- status: {
6
- name: LayerZeroMessageStatus;
7
- };
8
- }
9
- ];
10
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/entities/crossChainDeposit/aggregators/Boros/types.ts"],"names":[],"mappings":""}
@@ -1,56 +0,0 @@
1
- import { Hex } from 'viem';
2
- import { DepositBoxFactoryContract } from '../../../../contracts/deposit-box-factory';
3
- import { AggregatorTransferData, AggregatorHelper, AggregatorName, AggregatorResult, AggregatorRoute, AggregatorRouteStatus, AggregatorSwapData, QuoteDepositParams, QuoteWithdrawParams } from '../../AggregatorHelper';
4
- import { LifiGetRoutesRequest, LifiGetRoutesResponse, LifiGetRoutesStep } from './types';
5
- export declare const LIFI_API = "https://li.quest/v1";
6
- export declare class LifiAggregatorResult implements AggregatorResult {
7
- private readonly aggregatorHelper;
8
- routes: AggregatorRoute[];
9
- private rawResult;
10
- private req;
11
- private isDeposit;
12
- constructor(params: {
13
- isDeposit: boolean;
14
- req: LifiGetRoutesRequest;
15
- res: LifiGetRoutesResponse;
16
- aggregatorHelper: LifiAggregatorHelper;
17
- });
18
- private isValidRoute;
19
- getAggregatorName(): AggregatorName;
20
- getRouteData: (routeId: string) => Promise<{
21
- transferData: AggregatorTransferData;
22
- swapData: AggregatorSwapData;
23
- }>;
24
- }
25
- export declare class LifiWithdrawResult implements AggregatorResult {
26
- private readonly aggregatorHelper;
27
- routes: AggregatorRoute[];
28
- private rawResult;
29
- private req;
30
- constructor(params: {
31
- req: LifiGetRoutesRequest;
32
- res: LifiGetRoutesResponse;
33
- aggregatorHelper: LifiAggregatorHelper;
34
- });
35
- private isValidRoute;
36
- getAggregatorName(): AggregatorName;
37
- getRouteData: (routeId: string) => Promise<{
38
- transferData: AggregatorTransferData;
39
- }>;
40
- }
41
- export declare class LifiAggregatorHelper implements AggregatorHelper {
42
- private readonly depositBoxFactoryContract;
43
- private readonly apiUrl;
44
- aggregatorName: AggregatorName;
45
- private readonly axios;
46
- constructor(depositBoxFactoryContract: DepositBoxFactoryContract, apiUrl?: string);
47
- quoteDeposit(params: QuoteDepositParams): Promise<LifiAggregatorResult>;
48
- quoteWithdraw(params: QuoteWithdrawParams): Promise<LifiWithdrawResult>;
49
- quote(callParams: LifiGetRoutesRequest, params: {
50
- isDeposit: boolean;
51
- }): Promise<LifiAggregatorResult>;
52
- assemble(params: LifiGetRoutesStep): Promise<AggregatorTransferData>;
53
- getRouteStatus(txHash: Hex, options?: {
54
- fromChain: number;
55
- }): Promise<AggregatorRouteStatus>;
56
- }
@@ -1,244 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LifiAggregatorHelper = exports.LifiWithdrawResult = exports.LifiAggregatorResult = exports.LIFI_API = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const viem_1 = require("viem");
9
- const chains_1 = require("viem/chains");
10
- const Token_1 = require("../../../token/Token");
11
- const AggregatorHelper_1 = require("../../AggregatorHelper");
12
- const AggregatorHelperErrors_1 = require("../../AggregatorHelperErrors");
13
- const utils_1 = require("../../helpers/utils");
14
- const types_1 = require("./types");
15
- const addresses_1 = require("../../../../addresses");
16
- exports.LIFI_API = 'https://li.quest/v1';
17
- class LifiAggregatorResult {
18
- aggregatorHelper;
19
- routes;
20
- rawResult;
21
- req;
22
- isDeposit;
23
- constructor(params) {
24
- const { isDeposit, req, res, aggregatorHelper } = params;
25
- this.isDeposit = isDeposit;
26
- this.req = req;
27
- const validRoutes = res.routes.filter((route) => this.isValidRoute(route));
28
- this.routes = validRoutes.map(({ id, fromAmount, fromToken, toAmount, toToken, steps, toAmountMin }) => ({
29
- id,
30
- inputTokenAmount: Token_1.TokenAmount.createFromLifi(fromToken, fromAmount),
31
- outputTokenAmount: Token_1.TokenAmount.createFromLifi(toToken, toAmount),
32
- minOutputTokenAmount: Token_1.TokenAmount.createFromLifi(toToken, toAmountMin),
33
- steps: steps.map((step) => ({
34
- fromTokenAmount: Token_1.TokenAmount.createFromLifi(step.action.fromToken, step.action.fromAmount),
35
- toTokenAmount: Token_1.TokenAmount.createFromLifi(step.action.toToken, step.estimate.toAmount),
36
- executionDuration: step.estimate.executionDuration,
37
- feeCosts: step.estimate.feeCosts?.map((feeCost) => ({
38
- name: feeCost.name,
39
- amountUSD: Number(feeCost.amountUSD),
40
- })),
41
- gasCosts: step.estimate.gasCosts?.map((gasCost) => ({
42
- tokenAmount: Token_1.TokenAmount.createFromLifi(gasCost.token, gasCost.amount),
43
- amountUSD: Number(gasCost.amountUSD),
44
- })),
45
- tool: {
46
- key: step.toolDetails.key,
47
- name: step.toolDetails.name,
48
- logoURI: step.toolDetails.logoURI,
49
- },
50
- })),
51
- }));
52
- this.rawResult = validRoutes;
53
- this.aggregatorHelper = aggregatorHelper;
54
- }
55
- isValidRoute(route) {
56
- return route.steps.length === 1;
57
- }
58
- getAggregatorName() {
59
- return AggregatorHelper_1.AggregatorName.LIFI;
60
- }
61
- getRouteData = async (routeId) => {
62
- const route = this.rawResult.find((route) => route.id === routeId);
63
- if (route == null) {
64
- throw new Error(`Route not found: ${routeId}`);
65
- }
66
- const [step] = route.steps;
67
- const result = await this.aggregatorHelper.assemble(step);
68
- if (this.isDeposit) {
69
- (0, utils_1.ensureCalldataHasBoxAddress)(result.calldata, this.req.toAddress);
70
- }
71
- return {
72
- transferData: result,
73
- swapData: {
74
- tokenSpent: (0, addresses_1.toAddress)(this.req.toTokenAddress),
75
- amountSpent: BigInt(route.toAmount),
76
- minAmountSpent: BigInt(route.toAmountMin),
77
- extRouter: viem_1.zeroAddress,
78
- extCalldata: '0x',
79
- },
80
- };
81
- };
82
- }
83
- exports.LifiAggregatorResult = LifiAggregatorResult;
84
- class LifiWithdrawResult {
85
- aggregatorHelper;
86
- routes;
87
- rawResult;
88
- req;
89
- constructor(params) {
90
- const { req, res, aggregatorHelper } = params;
91
- this.req = req;
92
- const validRoutes = res.routes.filter((route) => this.isValidRoute(route));
93
- this.routes = validRoutes.map(({ id, fromAmount, fromToken, toAmount, toToken, steps, toAmountMin }) => ({
94
- id,
95
- inputTokenAmount: Token_1.TokenAmount.createFromLifi(fromToken, fromAmount),
96
- outputTokenAmount: Token_1.TokenAmount.createFromLifi(toToken, toAmount),
97
- minOutputTokenAmount: Token_1.TokenAmount.createFromLifi(toToken, toAmountMin),
98
- steps: steps.map((step) => ({
99
- fromTokenAmount: Token_1.TokenAmount.createFromLifi(step.action.fromToken, step.action.fromAmount),
100
- toTokenAmount: Token_1.TokenAmount.createFromLifi(step.action.toToken, step.estimate.toAmount),
101
- executionDuration: step.estimate.executionDuration,
102
- feeCosts: step.estimate.feeCosts?.map((feeCost) => ({
103
- name: feeCost.name,
104
- amountUSD: Number(feeCost.amountUSD),
105
- })),
106
- gasCosts: step.estimate.gasCosts?.map((gasCost) => ({
107
- tokenAmount: Token_1.TokenAmount.createFromLifi(gasCost.token, gasCost.amount),
108
- amountUSD: Number(gasCost.amountUSD),
109
- })),
110
- tool: {
111
- key: step.toolDetails.key,
112
- name: step.toolDetails.name,
113
- logoURI: step.toolDetails.logoURI,
114
- },
115
- })),
116
- }));
117
- this.rawResult = validRoutes;
118
- this.aggregatorHelper = aggregatorHelper;
119
- }
120
- isValidRoute(route) {
121
- return route.steps.length === 1;
122
- }
123
- getAggregatorName() {
124
- return AggregatorHelper_1.AggregatorName.LIFI;
125
- }
126
- getRouteData = async (routeId) => {
127
- const route = this.rawResult.find((route) => route.id === routeId);
128
- if (route == null) {
129
- throw new Error(`Route not found: ${routeId}`);
130
- }
131
- const [step] = route.steps;
132
- const result = await this.aggregatorHelper.assemble(step);
133
- return {
134
- transferData: result,
135
- };
136
- };
137
- }
138
- exports.LifiWithdrawResult = LifiWithdrawResult;
139
- class LifiAggregatorHelper {
140
- depositBoxFactoryContract;
141
- apiUrl;
142
- aggregatorName = AggregatorHelper_1.AggregatorName.LIFI;
143
- axios;
144
- constructor(depositBoxFactoryContract, apiUrl = exports.LIFI_API) {
145
- this.depositBoxFactoryContract = depositBoxFactoryContract;
146
- this.apiUrl = apiUrl;
147
- this.axios = axios_1.default.create();
148
- }
149
- async quoteDeposit(params) {
150
- const { box } = await this.depositBoxFactoryContract.computeDepositBox(params.fromAddress, params.boxId);
151
- const callParams = {
152
- fromChainId: params.fromChainId,
153
- toChainId: chains_1.arbitrum.id,
154
- fromTokenAddress: params.fromToken,
155
- toTokenAddress: params.toToken,
156
- fromAmount: params.fromAmount.toString(),
157
- fromAddress: params.fromAddress,
158
- toAddress: box,
159
- options: {
160
- integrator: 'pendle',
161
- allowDestinationCall: false,
162
- order: types_1.GetRoutesOrder.FASTEST,
163
- slippage: params.slippage,
164
- maxPriceImpact: 0.005,
165
- },
166
- };
167
- (0, utils_1.ensureDepositBoxAddress)(callParams.fromAddress, params.boxId, callParams.toAddress);
168
- return this.quote(callParams, { isDeposit: true });
169
- }
170
- async quoteWithdraw(params) {
171
- const callParams = {
172
- fromChainId: chains_1.arbitrum.id,
173
- toChainId: params.toChainId,
174
- fromTokenAddress: params.fromToken,
175
- toTokenAddress: params.toToken,
176
- fromAmount: params.fromAmount.toString(),
177
- fromAddress: params.fromAddress,
178
- toAddress: params.fromAddress,
179
- options: {
180
- integrator: 'pendle',
181
- allowDestinationCall: false,
182
- order: types_1.GetRoutesOrder.FASTEST,
183
- slippage: params.slippage,
184
- maxPriceImpact: 0.005,
185
- },
186
- };
187
- try {
188
- const { data } = await this.axios.post(`${this.apiUrl}/advanced/routes`, callParams);
189
- return new LifiWithdrawResult({
190
- req: callParams,
191
- res: data,
192
- aggregatorHelper: this,
193
- });
194
- }
195
- catch (error) {
196
- throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.LIFI, error, [500, 502, 503, 504], 'quote', callParams, () => undefined);
197
- }
198
- }
199
- async quote(callParams, params) {
200
- try {
201
- const { data } = await this.axios.post(`${this.apiUrl}/advanced/routes`, callParams);
202
- return new LifiAggregatorResult({
203
- isDeposit: params.isDeposit,
204
- req: callParams,
205
- res: data,
206
- aggregatorHelper: this,
207
- });
208
- }
209
- catch (error) {
210
- throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.LIFI, error, [500, 502, 503, 504], 'quote', callParams, () => undefined);
211
- }
212
- }
213
- async assemble(params) {
214
- try {
215
- const { data } = await this.axios.post(`${this.apiUrl}/advanced/stepTransaction`, params);
216
- return {
217
- aggregatorName: AggregatorHelper_1.AggregatorName.LIFI,
218
- approvalAddress: params.estimate.approvalAddress,
219
- calldata: data.transactionRequest.data,
220
- value: BigInt(data.transactionRequest.value),
221
- from: data.transactionRequest.from,
222
- to: data.transactionRequest.to,
223
- chainId: data.transactionRequest.chainId,
224
- gasPrice: BigInt(data.transactionRequest.gasPrice),
225
- gasLimit: BigInt(data.transactionRequest.gasLimit),
226
- };
227
- }
228
- catch (error) {
229
- throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.LIFI, error, [500, 502, 503, 504], 'assemble', params, () => undefined);
230
- }
231
- }
232
- async getRouteStatus(txHash, options) {
233
- const params = { txHash, fromChain: options?.fromChain };
234
- try {
235
- const { data } = await this.axios.get(`${this.apiUrl}/status`, { params });
236
- return data.status;
237
- }
238
- catch (error) {
239
- throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.LIFI, error, [500, 502, 503, 504], 'getRouteStatus', { txHash }, () => undefined);
240
- }
241
- }
242
- }
243
- exports.LifiAggregatorHelper = LifiAggregatorHelper;
244
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/entities/crossChainDeposit/aggregators/Lifi/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAC7C,+BAAwC;AACxC,wCAAuC;AAEvC,gDAAmD;AACnD,6DAUgC;AAChC,yEAAuE;AACvE,+CAA2F;AAC3F,mCAQiB;AACjB,qDAAkD;AAErC,QAAA,QAAQ,GAAG,qBAAqB,CAAC;AAE9C,MAAa,oBAAoB;IACd,gBAAgB,CAAuB;IAExD,MAAM,CAAoB;IAClB,SAAS,CAAyB;IAClC,GAAG,CAAuB;IAC1B,SAAS,CAAU;IAE3B,YAAY,MAKX;QACC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;QAE3E,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;YACvG,EAAE;YACF,gBAAgB,EAAE,mBAAW,CAAC,cAAc,CAAC,SAAS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