@pendle/sdk-boros 1.1.26 → 1.1.28
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 +13 -0
- package/dist/entities/crossChainDeposit/AggregatorHelper.d.ts +2 -1
- package/dist/entities/crossChainDeposit/AggregatorHelper.js +1 -0
- package/dist/entities/crossChainDeposit/AggregatorHelper.js.map +1 -1
- package/dist/entities/crossChainDeposit/AggregatorHelperErrors.d.ts +11 -0
- package/dist/entities/crossChainDeposit/AggregatorHelperErrors.js.map +1 -1
- package/dist/entities/crossChainDeposit/Depositor.d.ts +2 -0
- package/dist/entities/crossChainDeposit/Depositor.js +8 -3
- package/dist/entities/crossChainDeposit/Depositor.js.map +1 -1
- package/dist/entities/crossChainDeposit/Withdrawer.d.ts +2 -0
- package/dist/entities/crossChainDeposit/Withdrawer.js +8 -3
- package/dist/entities/crossChainDeposit/Withdrawer.js.map +1 -1
- package/dist/entities/crossChainDeposit/aggregators/Bungee/address.d.ts +3 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/address.js +12 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/address.js.map +1 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/index.d.ts +50 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/index.js +283 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/index.js.map +1 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/types.d.ts +136 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/types.js +11 -0
- package/dist/entities/crossChainDeposit/aggregators/Bungee/types.js.map +1 -0
- package/dist/entities/crossChainDeposit/constants.d.ts +1 -0
- package/dist/entities/crossChainDeposit/constants.js +2 -1
- package/dist/entities/crossChainDeposit/constants.js.map +1 -1
- package/dist/utils/signing/index.d.ts +1 -1
- package/dist/utils/signing/index.js +2 -1
- package/dist/utils/signing/index.js.map +1 -1
- package/dist/utils/signing/otc.d.ts +1 -0
- package/dist/utils/signing/otc.js +28 -0
- package/dist/utils/signing/otc.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @pendle/sdk-boros
|
|
2
2
|
|
|
3
|
+
## 1.1.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1933d78: feat: bungee integration
|
|
8
|
+
- 8cd18e4: fix: minor bungee fixes
|
|
9
|
+
|
|
10
|
+
## 1.1.27
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 380acd5: OTC sign approve
|
|
15
|
+
|
|
3
16
|
## 1.1.26
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ var AggregatorName;
|
|
|
6
6
|
AggregatorName["LIFI"] = "LIFI";
|
|
7
7
|
AggregatorName["PENDLE"] = "PENDLE";
|
|
8
8
|
AggregatorName["BOROS"] = "BOROS";
|
|
9
|
+
AggregatorName["BUNGEE"] = "BUNGEE";
|
|
9
10
|
})(AggregatorName || (exports.AggregatorName = AggregatorName = {}));
|
|
10
11
|
var AggregatorRouteStatus;
|
|
11
12
|
(function (AggregatorRouteStatus) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregatorHelper.js","sourceRoot":"","sources":["../../../src/entities/crossChainDeposit/AggregatorHelper.ts"],"names":[],"mappings":";;;AA8FA,IAAY,
|
|
1
|
+
{"version":3,"file":"AggregatorHelper.js","sourceRoot":"","sources":["../../../src/entities/crossChainDeposit/AggregatorHelper.ts"],"names":[],"mappings":";;;AA8FA,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,iCAAe,CAAA;IACf,mCAAiB,CAAA;AACnB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAmBD,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,4CAAmB,CAAA;IACnB,sCAAa,CAAA;IACb,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;AACrB,CAAC,EANW,qBAAqB,qCAArB,qBAAqB,QAMhC;AAED,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;AACrB,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB"}
|
|
@@ -4,12 +4,14 @@ import { QuoteBscBridgeV2Dto, QuoteWithdrawBscDto } from '../../backend/secrettu
|
|
|
4
4
|
import { PendleSwapDtoV2 } from '../../backend/secrettune/PendleV2SDK';
|
|
5
5
|
import { PendleSdkError, PendleSdkErrorParams } from '../../errors/PendleSdkError';
|
|
6
6
|
import { AggregatorName, QuoteDepositParams, QuoteWithdrawParams } from './AggregatorHelper';
|
|
7
|
+
import { BungeeQuoteRequest, BungeeStatusRequest } from './aggregators/Bungee/types';
|
|
7
8
|
import { GetTokensRequest, LifiGetRouteStatusRequest, LifiGetRoutesRequest, LifiGetRoutesStep } from './aggregators/Lifi/types';
|
|
8
9
|
export type AggregatorRequestType = 'getTokens' | 'quote' | 'quoteWithdraw' | 'assemble' | 'getRouteStatus' | 'getIntentStatus' | 'prepareTransferCall';
|
|
9
10
|
export type AggregatorErrorCodeType = {
|
|
10
11
|
[AggregatorName.LIFI]: number;
|
|
11
12
|
[AggregatorName.PENDLE]: number;
|
|
12
13
|
[AggregatorName.BOROS]: number;
|
|
14
|
+
[AggregatorName.BUNGEE]: number;
|
|
13
15
|
};
|
|
14
16
|
export type AggregatorRequestData = {
|
|
15
17
|
[AggregatorName.LIFI]: {
|
|
@@ -39,6 +41,15 @@ export type AggregatorRequestData = {
|
|
|
39
41
|
getIntentStatus: string;
|
|
40
42
|
prepareTransferCall: QuoteDepositParams;
|
|
41
43
|
};
|
|
44
|
+
[AggregatorName.BUNGEE]: {
|
|
45
|
+
getTokens: undefined;
|
|
46
|
+
quote: BungeeQuoteRequest;
|
|
47
|
+
quoteWithdraw: BungeeQuoteRequest;
|
|
48
|
+
assemble: undefined;
|
|
49
|
+
getRouteStatus: BungeeStatusRequest;
|
|
50
|
+
getIntentStatus: undefined;
|
|
51
|
+
prepareTransferCall: undefined;
|
|
52
|
+
};
|
|
42
53
|
};
|
|
43
54
|
export type ErrorDataCheckingFnReturnType<T extends AggregatorName> = {
|
|
44
55
|
errorCode?: AggregatorErrorCodeType[T];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AggregatorHelperErrors.js","sourceRoot":"","sources":["../../../src/entities/crossChainDeposit/AggregatorHelperErrors.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"AggregatorHelperErrors.js","sourceRoot":"","sources":["../../../src/entities/crossChainDeposit/AggregatorHelperErrors.ts"],"names":[],"mappings":";;;;;;AAqLA,0DA0CC;AA/ND,kDAA0C;AAI1C,gEAAmF;AACnF,yDAA6F;AAoE7F,MAAa,qBAAsB,SAAQ,+BAAc;IAEnC;IACA;IAFpB,YACoB,IAAoB,EACpB,OAAe,EACjC,MAA6B;QAE7B,KAAK,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;QAJnB,SAAI,GAAJ,IAAI,CAAgB;QACpB,YAAO,GAAP,OAAO,CAAQ;IAInC,CAAC;CACF;AARD,sDAQC;AAED,MAAa,4BAGX,SAAQ,qBAAqB;IAET;IACT;IACA;IACA;IACA;IALX,YACoB,IAAO,EAChB,WAAe,EACf,mBAA2B,EAC3B,WAAyC,EACzC,SAAsC,EAC/C,MAA6B;QAE7B,KAAK,CACH,IAAI,EACJ,GAAG,IAAI,IAAI,WAAW,8BAA8B,SAAS,IAAI,SAAS,KAAK,mBAAmB,EAAE,EACpG,MAAM,CACP,CAAC;QAXgB,SAAI,GAAJ,IAAI,CAAG;QAChB,gBAAW,GAAX,WAAW,CAAI;QACf,wB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BAA6E;IAM7E,IAAI,eAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,MAAM,SAAS,GAAG,2BAA2B,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC;QACvF,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,IAAI,CAAC,eAAK,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjH,IAAI,eAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,IAAI,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,IAAI,4BAA4B,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,IAAI,GAAY,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC1C,MAAM,eAAe,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAClD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,IAAI,4BAA4B,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,IAAI,4BAA4B,CACrC,IAAI,EACJ,WAAW,EACX,eAAe,CAAC,OAAO,EACvB,WAAW,EACX,eAAe,CAAC,SAAS,EACzB;QACE,KAAK,EAAE,KAAK;KACb,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { TokenId } from '../../types';
|
|
|
4
4
|
import { Token } from '../token';
|
|
5
5
|
import { AggregatorName, AggregatorResult, AggregatorRouteStatus, QuoteDepositParams } from './AggregatorHelper';
|
|
6
6
|
import { BorosLzBridgeHelper } from './aggregators/Boros';
|
|
7
|
+
import { BungeeAggregatorHelper } from './aggregators/Bungee';
|
|
7
8
|
import { LifiAggregatorHelper } from './aggregators/Lifi';
|
|
8
9
|
import { PendleSwapHelper } from './aggregators/Pendle';
|
|
9
10
|
export declare class Depositor {
|
|
@@ -13,6 +14,7 @@ export declare class Depositor {
|
|
|
13
14
|
private readonly tokenHelper;
|
|
14
15
|
private readonly coreSdk;
|
|
15
16
|
readonly lifiAggregatorHelper: LifiAggregatorHelper;
|
|
17
|
+
readonly bungeeAggregatorHelper: BungeeAggregatorHelper;
|
|
16
18
|
readonly pendleSwapHelper: PendleSwapHelper;
|
|
17
19
|
readonly borosLzBridgeHelper: BorosLzBridgeHelper;
|
|
18
20
|
constructor(root: Address, rpcUrls: string[]);
|
|
@@ -8,6 +8,7 @@ const module_1 = require("../../backend/secrettune/module");
|
|
|
8
8
|
const contracts_factory_1 = require("../../contracts/contracts.factory");
|
|
9
9
|
const AggregatorHelper_1 = require("./AggregatorHelper");
|
|
10
10
|
const Boros_1 = require("./aggregators/Boros");
|
|
11
|
+
const Bungee_1 = require("./aggregators/Bungee");
|
|
11
12
|
const Lifi_1 = require("./aggregators/Lifi");
|
|
12
13
|
const Pendle_1 = require("./aggregators/Pendle");
|
|
13
14
|
const TokenHelper_1 = require("./helpers/TokenHelper");
|
|
@@ -18,6 +19,7 @@ class Depositor {
|
|
|
18
19
|
tokenHelper;
|
|
19
20
|
coreSdk;
|
|
20
21
|
lifiAggregatorHelper;
|
|
22
|
+
bungeeAggregatorHelper;
|
|
21
23
|
pendleSwapHelper;
|
|
22
24
|
borosLzBridgeHelper;
|
|
23
25
|
constructor(root, rpcUrls) {
|
|
@@ -27,6 +29,7 @@ class Depositor {
|
|
|
27
29
|
this.coreSdk = (0, module_1.getCoreSdk)();
|
|
28
30
|
this.depositBoxFactoryContract = this.contractsFactory.getDepositBoxFactoryContract((0, addresses_1.getDepositBoxFactoryAddress)());
|
|
29
31
|
this.lifiAggregatorHelper = new Lifi_1.LifiAggregatorHelper(this.depositBoxFactoryContract);
|
|
32
|
+
this.bungeeAggregatorHelper = new Bungee_1.BungeeAggregatorHelper(this.depositBoxFactoryContract);
|
|
30
33
|
this.pendleSwapHelper = new Pendle_1.PendleSwapHelper((0, module_1.getPendleV2Sdk)(), this.coreSdk, this.contractsFactory.getRpcClient(), this.tokenHelper, this.depositBoxFactoryContract);
|
|
31
34
|
this.borosLzBridgeHelper = new Boros_1.BorosLzBridgeHelper(this.coreSdk, this.tokenHelper);
|
|
32
35
|
}
|
|
@@ -41,18 +44,18 @@ class Depositor {
|
|
|
41
44
|
if (fromChainId === chains_1.bsc.id && (0, viem_1.isAddressEqual)(fromToken, viem_1.zeroAddress)) {
|
|
42
45
|
return this.borosLzBridgeHelper;
|
|
43
46
|
}
|
|
44
|
-
return this.
|
|
47
|
+
return this.bungeeAggregatorHelper;
|
|
45
48
|
}
|
|
46
49
|
if ((0, viem_1.isAddressEqual)(toToken, hypeOftAddress)) {
|
|
47
50
|
if (fromChainId === chains_1.hyperEvm.id && (0, viem_1.isAddressEqual)(fromToken, viem_1.zeroAddress)) {
|
|
48
51
|
return this.borosLzBridgeHelper;
|
|
49
52
|
}
|
|
50
|
-
return this.
|
|
53
|
+
return this.bungeeAggregatorHelper;
|
|
51
54
|
}
|
|
52
55
|
if (fromChainId === chains_1.arbitrum.id) {
|
|
53
56
|
return this.pendleSwapHelper;
|
|
54
57
|
}
|
|
55
|
-
return this.
|
|
58
|
+
return this.bungeeAggregatorHelper;
|
|
56
59
|
}
|
|
57
60
|
async getRoutes(params) {
|
|
58
61
|
const aggregatorHelper = this.getAggregatorHelper(params);
|
|
@@ -68,6 +71,8 @@ class Depositor {
|
|
|
68
71
|
switch (aggregatorName) {
|
|
69
72
|
case AggregatorHelper_1.AggregatorName.LIFI:
|
|
70
73
|
return this.lifiAggregatorHelper.getRouteStatus(txHash, options);
|
|
74
|
+
case AggregatorHelper_1.AggregatorName.BUNGEE:
|
|
75
|
+
return this.bungeeAggregatorHelper.getRouteStatus(txHash, options);
|
|
71
76
|
case AggregatorHelper_1.AggregatorName.BOROS:
|
|
72
77
|
return this.borosLzBridgeHelper.getRouteStatus(txHash);
|
|
73
78
|
case AggregatorHelper_1.AggregatorName.PENDLE:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Depositor.js","sourceRoot":"","sources":["../../../src/entities/crossChainDeposit/Depositor.ts"],"names":[],"mappings":";;;AAAA,+BAAiE;AACjE,wCAAsD;AACtD,+CAAmG;AACnG,4DAA2F;AAE3F,yEAAqE;AAIrE,yDAM4B;AAC5B,+CAA0D;AAC1D,6CAA0D;AAC1D,iDAAwD;AACxD,uDAAoD;AAEpD,MAAa,SAAS;IACH,IAAI,CAAU;IACd,gBAAgB,CAAmB;IACnC,yBAAyB,CAA4B;IACrD,WAAW,CAAc;IACzB,OAAO,CAAe;IAE9B,oBAAoB,CAAuB;IAC3C,gBAAgB,CAAmB;IACnC,mBAAmB,CAAsB;IAElD,YAAY,IAAa,EAAE,OAAiB;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,IAAI,oCAAgB,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,CAAC,IAAA,mBAAU,GAAE,CAAC,CAAC;QACjD,IAAI,CAAC,OAAO,GAAG,IAAA,mBAAU,GAAE,CAAC;QAC5B,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,IAAA,uCAA2B,GAAE,CAAC,CAAC;QACnH,IAAI,CAAC,oBAAoB,GAAG,IAAI,2BAAoB,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACrF,IAAI,CAAC,gBAAgB,GAAG,IAAI,yBAAgB,CAC1C,IAAA,uBAAc,GAAE,EAChB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAA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EACX,OAA+B;QAE/B,QAAQ,cAAc,EAAE,CAAC;YACvB,KAAK,iCAAc,CAAC,IAAI;gBACtB,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACnE,KAAK,iCAAc,CAAC,MAAM;gBACxB,OAAO,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACrE,KAAK,iCAAc,CAAC,KAAK;gBACvB,OAAO,IAAI,CAAC,mBAAmB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACzD,KAAK,iCAAc,CAAC,MAAM;gBACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAAa;QACnC,OAAO,IAAI,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;CACF;AA9FD,8BA8FC"}
|
|
@@ -4,6 +4,7 @@ import { TokenId } from '../../types';
|
|
|
4
4
|
import { Token } from '../token';
|
|
5
5
|
import { AggregatorName, AggregatorResult, AggregatorRouteStatus, QuoteWithdrawParams } from './AggregatorHelper';
|
|
6
6
|
import { BorosLzBridgeHelper } from './aggregators/Boros';
|
|
7
|
+
import { BungeeAggregatorHelper } from './aggregators/Bungee';
|
|
7
8
|
import { LifiAggregatorHelper } from './aggregators/Lifi';
|
|
8
9
|
import { PendleSwapHelper } from './aggregators/Pendle';
|
|
9
10
|
export declare class Withdrawer {
|
|
@@ -12,6 +13,7 @@ export declare class Withdrawer {
|
|
|
12
13
|
private readonly depositBoxFactoryContract;
|
|
13
14
|
private readonly tokenHelper;
|
|
14
15
|
readonly lifiAggregatorHelper: LifiAggregatorHelper;
|
|
16
|
+
readonly bungeeAggregatorHelper: BungeeAggregatorHelper;
|
|
15
17
|
readonly pendleSwapHelper: PendleSwapHelper;
|
|
16
18
|
readonly borosLzBridgeHelper: BorosLzBridgeHelper;
|
|
17
19
|
constructor(rpcUrls: string[]);
|
|
@@ -8,6 +8,7 @@ const module_1 = require("../../backend/secrettune/module");
|
|
|
8
8
|
const contracts_factory_1 = require("../../contracts/contracts.factory");
|
|
9
9
|
const AggregatorHelper_1 = require("./AggregatorHelper");
|
|
10
10
|
const Boros_1 = require("./aggregators/Boros");
|
|
11
|
+
const Bungee_1 = require("./aggregators/Bungee");
|
|
11
12
|
const Lifi_1 = require("./aggregators/Lifi");
|
|
12
13
|
const Pendle_1 = require("./aggregators/Pendle");
|
|
13
14
|
const TokenHelper_1 = require("./helpers/TokenHelper");
|
|
@@ -17,6 +18,7 @@ class Withdrawer {
|
|
|
17
18
|
depositBoxFactoryContract;
|
|
18
19
|
tokenHelper;
|
|
19
20
|
lifiAggregatorHelper;
|
|
21
|
+
bungeeAggregatorHelper;
|
|
20
22
|
pendleSwapHelper;
|
|
21
23
|
borosLzBridgeHelper;
|
|
22
24
|
constructor(rpcUrls) {
|
|
@@ -25,6 +27,7 @@ class Withdrawer {
|
|
|
25
27
|
this.depositBoxFactoryContract = this.contractsFactory.getDepositBoxFactoryContract((0, addresses_1.getDepositBoxFactoryAddress)());
|
|
26
28
|
this.tokenHelper = new TokenHelper_1.TokenHelper(this.coreSdk);
|
|
27
29
|
this.lifiAggregatorHelper = new Lifi_1.LifiAggregatorHelper(this.contractsFactory.getDepositBoxFactoryContract((0, addresses_1.getDepositBoxFactoryAddress)()));
|
|
30
|
+
this.bungeeAggregatorHelper = new Bungee_1.BungeeAggregatorHelper(this.contractsFactory.getDepositBoxFactoryContract((0, addresses_1.getDepositBoxFactoryAddress)()));
|
|
28
31
|
this.pendleSwapHelper = new Pendle_1.PendleSwapHelper((0, module_1.getPendleV2Sdk)(), this.coreSdk, this.contractsFactory.getRpcClient(), this.tokenHelper, this.depositBoxFactoryContract);
|
|
29
32
|
this.borosLzBridgeHelper = new Boros_1.BorosLzBridgeHelper(this.coreSdk, this.tokenHelper);
|
|
30
33
|
}
|
|
@@ -38,17 +41,17 @@ class Withdrawer {
|
|
|
38
41
|
if ((0, viem_1.isAddressEqual)(fromToken, bnbOftAddress)) {
|
|
39
42
|
return this.borosLzBridgeHelper;
|
|
40
43
|
}
|
|
41
|
-
return this.
|
|
44
|
+
return this.bungeeAggregatorHelper;
|
|
42
45
|
}
|
|
43
46
|
case chains_1.hyperEvm.id: {
|
|
44
47
|
const hypeOftAddress = (0, addresses_1.getHypeOftAddress)();
|
|
45
48
|
if ((0, viem_1.isAddressEqual)(fromToken, hypeOftAddress)) {
|
|
46
49
|
return this.borosLzBridgeHelper;
|
|
47
50
|
}
|
|
48
|
-
return this.
|
|
51
|
+
return this.bungeeAggregatorHelper;
|
|
49
52
|
}
|
|
50
53
|
default:
|
|
51
|
-
return this.
|
|
54
|
+
return this.bungeeAggregatorHelper;
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
async getRoutes(params) {
|
|
@@ -62,6 +65,8 @@ class Withdrawer {
|
|
|
62
65
|
switch (aggregatorName) {
|
|
63
66
|
case AggregatorHelper_1.AggregatorName.LIFI:
|
|
64
67
|
return this.lifiAggregatorHelper.getRouteStatus(txHash, options);
|
|
68
|
+
case AggregatorHelper_1.AggregatorName.BUNGEE:
|
|
69
|
+
return this.bungeeAggregatorHelper.getRouteStatus(txHash, options);
|
|
65
70
|
case AggregatorHelper_1.AggregatorName.BOROS:
|
|
66
71
|
return this.borosLzBridgeHelper.getRouteStatus(txHash);
|
|
67
72
|
case AggregatorHelper_1.AggregatorName.PENDLE:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Withdrawer.js","sourceRoot":"","sources":["../../../src/entities/crossChainDeposit/Withdrawer.ts"],"names":[],"mappings":";;;AAAA,+BAA2C;AAC3C,wCAAsD;AACtD,+CAAmG;AACnG,4DAA2F;AAE3F,yEAAqE;AAIrE,yDAM4B;AAC5B,+CAA0D;AAC1D,6CA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C,MAAM,CAAC,CAAC;QAC1D,OAAO,gBAAgB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAwD;QACtE,OAAO,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,cAA8B,EAC9B,MAAW,EACX,OAA+B;QAE/B,QAAQ,cAAc,EAAE,CAAC;YACvB,KAAK,iCAAc,CAAC,IAAI;gBACtB,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACnE,KAAK,iCAAc,CAAC,MAAM;gBACxB,OAAO,IAAI,CAAC,sBAAsB,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACrE,KAAK,iCAAc,CAAC,KAAK;gBACvB,OAAO,IAAI,CAAC,mBAAmB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACzD,KAAK,iCAAc,CAAC,MAAM;gBACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;CACF;AAlFD,gCAkFC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toBungeeAddress = toBungeeAddress;
|
|
4
|
+
exports.fromBungeeAddress = fromBungeeAddress;
|
|
5
|
+
const viem_1 = require("viem");
|
|
6
|
+
function toBungeeAddress(address) {
|
|
7
|
+
return (0, viem_1.isAddressEqual)(address, viem_1.zeroAddress) ? viem_1.ethAddress : address;
|
|
8
|
+
}
|
|
9
|
+
function fromBungeeAddress(address) {
|
|
10
|
+
return (0, viem_1.isAddressEqual)(address, viem_1.ethAddress) ? viem_1.zeroAddress : address;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../../src/entities/crossChainDeposit/aggregators/Bungee/address.ts"],"names":[],"mappings":";;AAGA,0CAEC;AAGD,8CAEC;AAVD,+BAAwE;AAGxE,SAAgB,eAAe,CAAC,OAAgB;IAC9C,OAAO,IAAA,qBAAc,EAAC,OAAO,EAAE,kBAAW,CAAC,CAAC,CAAC,CAAC,iBAAU,CAAC,CAAC,CAAC,OAAO,CAAC;AACrE,CAAC;AAGD,SAAgB,iBAAiB,CAAC,OAAgB;IAChD,OAAO,IAAA,qBAAc,EAAC,OAAO,EAAE,iBAAU,CAAC,CAAC,CAAC,CAAC,kBAAW,CAAC,CAAC,CAAC,OAAO,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { DepositBoxFactoryContract } from '../../../../contracts/deposit-box-factory';
|
|
3
|
+
import { AggregatorHelper, AggregatorName, AggregatorResult, AggregatorRoute, AggregatorRouteStatus, AggregatorSwapData, AggregatorTransferData, QuoteDepositParams, QuoteWithdrawParams } from '../../AggregatorHelper';
|
|
4
|
+
import { BungeeQuoteRequest, BungeeQuoteResponse } from './types';
|
|
5
|
+
export declare class BungeeDepositResult implements AggregatorResult {
|
|
6
|
+
private readonly aggregatorHelper;
|
|
7
|
+
routes: AggregatorRoute[];
|
|
8
|
+
private rawResult;
|
|
9
|
+
private req;
|
|
10
|
+
private inputToken;
|
|
11
|
+
private finalToken;
|
|
12
|
+
constructor(params: {
|
|
13
|
+
req: BungeeQuoteRequest;
|
|
14
|
+
res: NonNullable<BungeeQuoteResponse['result']>;
|
|
15
|
+
aggregatorHelper: BungeeAggregatorHelper;
|
|
16
|
+
finalToken: Address;
|
|
17
|
+
});
|
|
18
|
+
getAggregatorName(): AggregatorName;
|
|
19
|
+
getRouteData: (routeId: string) => Promise<{
|
|
20
|
+
transferData: AggregatorTransferData;
|
|
21
|
+
swapData: AggregatorSwapData;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export declare class BungeeWithdrawResult implements AggregatorResult {
|
|
25
|
+
private readonly aggregatorHelper;
|
|
26
|
+
routes: AggregatorRoute[];
|
|
27
|
+
private rawResult;
|
|
28
|
+
private req;
|
|
29
|
+
constructor(params: {
|
|
30
|
+
req: BungeeQuoteRequest;
|
|
31
|
+
res: NonNullable<BungeeQuoteResponse['result']>;
|
|
32
|
+
aggregatorHelper: BungeeAggregatorHelper;
|
|
33
|
+
});
|
|
34
|
+
getAggregatorName(): AggregatorName;
|
|
35
|
+
getRouteData: (routeId: string) => Promise<{
|
|
36
|
+
transferData: AggregatorTransferData;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export declare class BungeeAggregatorHelper implements AggregatorHelper {
|
|
40
|
+
private readonly depositBoxFactoryContract;
|
|
41
|
+
private readonly apiUrl;
|
|
42
|
+
aggregatorName: AggregatorName;
|
|
43
|
+
private readonly axios;
|
|
44
|
+
constructor(depositBoxFactoryContract: DepositBoxFactoryContract, apiUrl?: string);
|
|
45
|
+
quoteDeposit(params: QuoteDepositParams): Promise<BungeeDepositResult>;
|
|
46
|
+
quoteWithdraw(params: QuoteWithdrawParams): Promise<BungeeWithdrawResult>;
|
|
47
|
+
getRouteStatus(txHash: Hex, options?: {
|
|
48
|
+
fromChain: number;
|
|
49
|
+
}): Promise<AggregatorRouteStatus>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
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.BungeeAggregatorHelper = exports.BungeeWithdrawResult = exports.BungeeDepositResult = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const viem_1 = require("viem");
|
|
9
|
+
const chains_1 = require("viem/chains");
|
|
10
|
+
const addresses_1 = require("../../../../addresses");
|
|
11
|
+
const Token_1 = require("../../../token/Token");
|
|
12
|
+
const AggregatorHelper_1 = require("../../AggregatorHelper");
|
|
13
|
+
const AggregatorHelperErrors_1 = require("../../AggregatorHelperErrors");
|
|
14
|
+
const constants_1 = require("../../constants");
|
|
15
|
+
const utils_1 = require("../../helpers/utils");
|
|
16
|
+
const address_1 = require("./address");
|
|
17
|
+
const types_1 = require("./types");
|
|
18
|
+
function wrapQuoteDeposit(params, callback) {
|
|
19
|
+
const { toToken, fromChainId } = params;
|
|
20
|
+
if ((0, viem_1.isAddressEqual)(toToken, (0, addresses_1.getBnbOftAddress)()) && fromChainId !== chains_1.bsc.id) {
|
|
21
|
+
return callback({ ...params, toChainId: chains_1.bsc.id, toToken: viem_1.zeroAddress, finalToken: toToken });
|
|
22
|
+
}
|
|
23
|
+
if ((0, viem_1.isAddressEqual)(toToken, (0, addresses_1.getHypeOftAddress)()) && fromChainId !== chains_1.hyperEvm.id) {
|
|
24
|
+
return callback({ ...params, toChainId: chains_1.hyperEvm.id, toToken: viem_1.zeroAddress, finalToken: toToken });
|
|
25
|
+
}
|
|
26
|
+
return callback({ ...params, toChainId: chains_1.arbitrum.id, toToken: params.toToken, finalToken: params.toToken });
|
|
27
|
+
}
|
|
28
|
+
function createTokenFromBungee(token, priceInUsd) {
|
|
29
|
+
return new Token_1.Token(token.chainId, (0, address_1.fromBungeeAddress)(token.address), token.decimals, token.symbol, token.name, token.logoURI ?? token.icon, priceInUsd);
|
|
30
|
+
}
|
|
31
|
+
function createTokenAmountFromBungee(token, amount, priceInUsd) {
|
|
32
|
+
return new Token_1.TokenAmount(createTokenFromBungee(token, priceInUsd), BigInt(amount));
|
|
33
|
+
}
|
|
34
|
+
class BungeeDepositResult {
|
|
35
|
+
aggregatorHelper;
|
|
36
|
+
routes;
|
|
37
|
+
rawResult;
|
|
38
|
+
req;
|
|
39
|
+
inputToken;
|
|
40
|
+
finalToken;
|
|
41
|
+
constructor(params) {
|
|
42
|
+
const { req, res, aggregatorHelper, finalToken } = params;
|
|
43
|
+
this.req = req;
|
|
44
|
+
this.rawResult = res.autoRoutes ?? [];
|
|
45
|
+
this.aggregatorHelper = aggregatorHelper;
|
|
46
|
+
this.inputToken = res.input.token;
|
|
47
|
+
this.finalToken = finalToken;
|
|
48
|
+
this.routes = this.rawResult.map((route) => ({
|
|
49
|
+
id: route.quoteId,
|
|
50
|
+
inputTokenAmount: createTokenAmountFromBungee(res.input.token, res.input.amount, res.input.priceInUsd),
|
|
51
|
+
outputTokenAmount: createTokenAmountFromBungee(route.output.token, route.output.amount, route.output.priceInUsd),
|
|
52
|
+
minOutputTokenAmount: createTokenAmountFromBungee(route.output.token, route.output.minAmountOut, route.output.priceInUsd),
|
|
53
|
+
steps: [
|
|
54
|
+
{
|
|
55
|
+
fromTokenAmount: createTokenAmountFromBungee(res.input.token, res.input.amount, res.input.priceInUsd),
|
|
56
|
+
toTokenAmount: createTokenAmountFromBungee(route.output.token, route.output.amount, route.output.priceInUsd),
|
|
57
|
+
executionDuration: route.estimatedTime + constants_1.BOROS_PROCESSING_s,
|
|
58
|
+
feeCosts: route.routeDetails.routeFee
|
|
59
|
+
? [
|
|
60
|
+
{
|
|
61
|
+
name: 'Bridge Fee',
|
|
62
|
+
amountUSD: route.routeDetails.routeFee.feeInUsd,
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
: [],
|
|
66
|
+
gasCosts: route.gasFee == null
|
|
67
|
+
? []
|
|
68
|
+
: [
|
|
69
|
+
{
|
|
70
|
+
tokenAmount: createTokenAmountFromBungee(route.gasFee.gasToken, route.gasFee.estimatedFee),
|
|
71
|
+
amountUSD: route.gasFee.feeInUsd,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
tool: {
|
|
75
|
+
key: route.routeDetails.name.toLowerCase().replace(/\s+/g, '-'),
|
|
76
|
+
name: route.routeDetails.name,
|
|
77
|
+
logoURI: route.routeDetails.logoURI !== '' ? route.routeDetails.logoURI : constants_1.BUNGEE_LOGO_URI,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
getAggregatorName() {
|
|
84
|
+
return AggregatorHelper_1.AggregatorName.BUNGEE;
|
|
85
|
+
}
|
|
86
|
+
getRouteData = async (routeId) => {
|
|
87
|
+
const route = this.rawResult.find((route) => route.quoteId === routeId);
|
|
88
|
+
if (route == null) {
|
|
89
|
+
throw new Error(`Route not found: ${routeId}`);
|
|
90
|
+
}
|
|
91
|
+
if (route.txData == null) {
|
|
92
|
+
throw new Error(`Route has no tx data: ${routeId}`);
|
|
93
|
+
}
|
|
94
|
+
(0, utils_1.ensureCalldataHasBoxAddress)(route.txData.data, this.req.receiverAddress);
|
|
95
|
+
return {
|
|
96
|
+
transferData: {
|
|
97
|
+
aggregatorName: AggregatorHelper_1.AggregatorName.BUNGEE,
|
|
98
|
+
approvalAddress: route.approvalData?.spenderAddress ?? viem_1.zeroAddress,
|
|
99
|
+
calldata: route.txData.data,
|
|
100
|
+
value: BigInt(route.txData.value),
|
|
101
|
+
from: this.req.userAddress,
|
|
102
|
+
to: route.txData.to,
|
|
103
|
+
chainId: route.txData.chainId,
|
|
104
|
+
},
|
|
105
|
+
swapData: {
|
|
106
|
+
tokenSpent: this.finalToken,
|
|
107
|
+
amountSpent: BigInt(route.output.amount),
|
|
108
|
+
minAmountSpent: BigInt(route.output.minAmountOut),
|
|
109
|
+
extRouter: viem_1.zeroAddress,
|
|
110
|
+
extCalldata: '0x',
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
exports.BungeeDepositResult = BungeeDepositResult;
|
|
116
|
+
class BungeeWithdrawResult {
|
|
117
|
+
aggregatorHelper;
|
|
118
|
+
routes;
|
|
119
|
+
rawResult;
|
|
120
|
+
req;
|
|
121
|
+
constructor(params) {
|
|
122
|
+
const { req, res, aggregatorHelper } = params;
|
|
123
|
+
this.req = req;
|
|
124
|
+
this.rawResult = res.autoRoutes ?? [];
|
|
125
|
+
this.aggregatorHelper = aggregatorHelper;
|
|
126
|
+
this.routes = this.rawResult.map((route) => ({
|
|
127
|
+
id: route.quoteId,
|
|
128
|
+
inputTokenAmount: createTokenAmountFromBungee(res.input.token, res.input.amount, res.input.priceInUsd),
|
|
129
|
+
outputTokenAmount: createTokenAmountFromBungee(route.output.token, route.output.amount, route.output.priceInUsd),
|
|
130
|
+
minOutputTokenAmount: createTokenAmountFromBungee(route.output.token, route.output.minAmountOut, route.output.priceInUsd),
|
|
131
|
+
steps: [
|
|
132
|
+
{
|
|
133
|
+
fromTokenAmount: createTokenAmountFromBungee(res.input.token, res.input.amount, res.input.priceInUsd),
|
|
134
|
+
toTokenAmount: createTokenAmountFromBungee(route.output.token, route.output.amount, route.output.priceInUsd),
|
|
135
|
+
executionDuration: route.estimatedTime,
|
|
136
|
+
feeCosts: route.routeDetails.routeFee
|
|
137
|
+
? [
|
|
138
|
+
{
|
|
139
|
+
name: 'Bridge Fee',
|
|
140
|
+
amountUSD: route.routeDetails.routeFee.feeInUsd,
|
|
141
|
+
},
|
|
142
|
+
]
|
|
143
|
+
: [],
|
|
144
|
+
gasCosts: route.gasFee == null
|
|
145
|
+
? []
|
|
146
|
+
: [
|
|
147
|
+
{
|
|
148
|
+
tokenAmount: createTokenAmountFromBungee(route.gasFee.gasToken, route.gasFee.estimatedFee),
|
|
149
|
+
amountUSD: route.gasFee.feeInUsd,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
tool: {
|
|
153
|
+
key: route.routeDetails.name.toLowerCase().replace(/\s+/g, '-'),
|
|
154
|
+
name: route.routeDetails.name,
|
|
155
|
+
logoURI: route.routeDetails.logoURI !== '' ? route.routeDetails.logoURI : constants_1.BUNGEE_LOGO_URI,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
getAggregatorName() {
|
|
162
|
+
return AggregatorHelper_1.AggregatorName.BUNGEE;
|
|
163
|
+
}
|
|
164
|
+
getRouteData = async (routeId) => {
|
|
165
|
+
const route = this.rawResult.find((route) => route.quoteId === routeId);
|
|
166
|
+
if (route == null) {
|
|
167
|
+
throw new Error(`Route not found: ${routeId}`);
|
|
168
|
+
}
|
|
169
|
+
if (route.txData == null) {
|
|
170
|
+
throw new Error(`Route has no tx data: ${routeId}`);
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
transferData: {
|
|
174
|
+
aggregatorName: AggregatorHelper_1.AggregatorName.BUNGEE,
|
|
175
|
+
approvalAddress: route.approvalData?.spenderAddress ?? viem_1.zeroAddress,
|
|
176
|
+
calldata: route.txData.data,
|
|
177
|
+
value: BigInt(route.txData.value),
|
|
178
|
+
from: this.req.userAddress,
|
|
179
|
+
to: route.txData.to,
|
|
180
|
+
chainId: route.txData.chainId,
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
exports.BungeeWithdrawResult = BungeeWithdrawResult;
|
|
186
|
+
class BungeeAggregatorHelper {
|
|
187
|
+
depositBoxFactoryContract;
|
|
188
|
+
apiUrl;
|
|
189
|
+
aggregatorName = AggregatorHelper_1.AggregatorName.BUNGEE;
|
|
190
|
+
axios;
|
|
191
|
+
constructor(depositBoxFactoryContract, apiUrl = types_1.BUNGEE_API) {
|
|
192
|
+
this.depositBoxFactoryContract = depositBoxFactoryContract;
|
|
193
|
+
this.apiUrl = apiUrl;
|
|
194
|
+
this.axios = axios_1.default.create();
|
|
195
|
+
}
|
|
196
|
+
async quoteDeposit(params) {
|
|
197
|
+
return wrapQuoteDeposit(params, async (resolved) => {
|
|
198
|
+
const { box } = await this.depositBoxFactoryContract.computeDepositBox(params.fromAddress, params.boxId);
|
|
199
|
+
const callParams = {
|
|
200
|
+
originChainId: params.fromChainId,
|
|
201
|
+
destinationChainId: resolved.toChainId,
|
|
202
|
+
inputToken: (0, address_1.toBungeeAddress)(params.fromToken),
|
|
203
|
+
outputToken: (0, address_1.toBungeeAddress)(resolved.toToken),
|
|
204
|
+
inputAmount: params.fromAmount.toString(),
|
|
205
|
+
userAddress: params.fromAddress,
|
|
206
|
+
receiverAddress: box,
|
|
207
|
+
enableManual: false,
|
|
208
|
+
enableMultipleAutoRoutes: true,
|
|
209
|
+
useInbox: true,
|
|
210
|
+
slippage: params.slippage,
|
|
211
|
+
};
|
|
212
|
+
(0, utils_1.ensureDepositBoxAddress)(callParams.userAddress, params.boxId, callParams.receiverAddress);
|
|
213
|
+
try {
|
|
214
|
+
const { data } = await this.axios.get(`${this.apiUrl}/api/v1/bungee/quote`, {
|
|
215
|
+
params: callParams,
|
|
216
|
+
});
|
|
217
|
+
if (data.result == null) {
|
|
218
|
+
throw new Error(data.message);
|
|
219
|
+
}
|
|
220
|
+
return new BungeeDepositResult({
|
|
221
|
+
req: callParams,
|
|
222
|
+
res: data.result,
|
|
223
|
+
aggregatorHelper: this,
|
|
224
|
+
finalToken: resolved.finalToken,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.BUNGEE, error, [500, 502, 503, 504], 'quote', callParams, () => undefined);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
async quoteWithdraw(params) {
|
|
233
|
+
const callParams = {
|
|
234
|
+
originChainId: chains_1.arbitrum.id,
|
|
235
|
+
destinationChainId: params.toChainId,
|
|
236
|
+
inputToken: (0, address_1.toBungeeAddress)(params.fromToken),
|
|
237
|
+
outputToken: (0, address_1.toBungeeAddress)(params.toToken),
|
|
238
|
+
inputAmount: params.fromAmount.toString(),
|
|
239
|
+
userAddress: params.fromAddress,
|
|
240
|
+
receiverAddress: params.fromAddress,
|
|
241
|
+
enableManual: false,
|
|
242
|
+
enableMultipleAutoRoutes: true,
|
|
243
|
+
useInbox: true,
|
|
244
|
+
slippage: params.slippage,
|
|
245
|
+
};
|
|
246
|
+
try {
|
|
247
|
+
const { data } = await this.axios.get(`${this.apiUrl}/api/v1/bungee/quote`, {
|
|
248
|
+
params: callParams,
|
|
249
|
+
});
|
|
250
|
+
if (data.result == null) {
|
|
251
|
+
throw new Error(data.message);
|
|
252
|
+
}
|
|
253
|
+
return new BungeeWithdrawResult({ req: callParams, res: data.result, aggregatorHelper: this });
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.BUNGEE, error, [500, 502, 503, 504], 'quoteWithdraw', callParams, () => undefined);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
async getRouteStatus(txHash, options) {
|
|
260
|
+
try {
|
|
261
|
+
const { data } = await this.axios.get(`${this.apiUrl}/api/v1/bungee/status`, {
|
|
262
|
+
params: { txHash, originChainId: options?.fromChain },
|
|
263
|
+
});
|
|
264
|
+
if (!data.result?.length) {
|
|
265
|
+
return AggregatorHelper_1.AggregatorRouteStatus.NOT_FOUND;
|
|
266
|
+
}
|
|
267
|
+
const status = data.result[0];
|
|
268
|
+
if (status.destinationData.status === types_1.BungeeRequestStatus.COMPLETED) {
|
|
269
|
+
return AggregatorHelper_1.AggregatorRouteStatus.DONE;
|
|
270
|
+
}
|
|
271
|
+
if (status.originData.status === types_1.BungeeRequestStatus.FAILED ||
|
|
272
|
+
status.destinationData.status === types_1.BungeeRequestStatus.FAILED) {
|
|
273
|
+
return AggregatorHelper_1.AggregatorRouteStatus.FAILED;
|
|
274
|
+
}
|
|
275
|
+
return AggregatorHelper_1.AggregatorRouteStatus.PENDING;
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
throw (0, AggregatorHelperErrors_1.classifyAggregatorError)(AggregatorHelper_1.AggregatorName.BUNGEE, error, [500, 502, 503, 504], 'getRouteStatus', { txHash }, () => undefined);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
exports.BungeeAggregatorHelper = BungeeAggregatorHelper;
|
|
283
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/entities/crossChainDeposit/aggregators/Bungee/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAC7C,+BAAiE;AACjE,wCAAsD;AACtD,qDAA4E;AAE5E,gDAA0D;AAC1D,6DAUgC;AAChC,yEAAuE;AACvE,+CAAsE;AACtE,+CAA2F;AAC3F,uCAA+D;AAC/D,mCAQiB;AAQjB,SAAS,gBAAgB,CAAI,MAA0B,EAAE,QAAgD;IACvG,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAExC,IAAI,IAAA,qBAAc,EAAC,OAAO,EAAE,IAAA,4BAAgB,GAAE,CAAC,IAAI,WAAW,KAAK,YAAG,CAAC,EAAE,EAAE,CAAC;QAC1E,OAAO,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,YAAG,CAAC,EAAE,EAAE,OAAO,EAAE,kBAAW,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/F,CAAC;IAED,IAAI,IAAA,qBAAc,EAAC,OAAO,EAAE,IAAA,6BAAiB,GAAE,CAAC,IAAI,WAAW,KAAK,iBAAQ,CAAC,EAAE,EAAE,CAAC;QAChF,OAAO,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,iBAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,kBAAW,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,OAAO,QAAQ,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,EAAE,iBAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,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,KAAK,EAAE,CAAC;YACf,MAAM,IAAA,gDAAuB,EAC3B,iCAAc,CAAC,MAAM,EACrB,KAAK,EACL,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACpB,gBAAgB,EAChB,EAAE,MAAM,EAAE,EACV,GAAG,EAAE,CAAC,SAAS,CAChB,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAlID,wDAkIC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
export declare const BUNGEE_API = "https://public-backend.bungee.exchange";
|
|
3
|
+
export type BungeeToken = {
|
|
4
|
+
chainId: number;
|
|
5
|
+
address: Address;
|
|
6
|
+
name: string;
|
|
7
|
+
symbol: string;
|
|
8
|
+
decimals: number;
|
|
9
|
+
logoURI: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
};
|
|
12
|
+
export type BungeeQuoteRequest = {
|
|
13
|
+
userAddress: Address;
|
|
14
|
+
originChainId: number;
|
|
15
|
+
destinationChainId: number;
|
|
16
|
+
inputAmount: string;
|
|
17
|
+
inputToken: Address;
|
|
18
|
+
receiverAddress: Address;
|
|
19
|
+
outputToken: Address;
|
|
20
|
+
slippage?: number;
|
|
21
|
+
refuel?: boolean;
|
|
22
|
+
enableManual?: boolean;
|
|
23
|
+
enableMultipleAutoRoutes?: boolean;
|
|
24
|
+
excludeBridges?: string[];
|
|
25
|
+
useInbox?: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type BungeeTxData = {
|
|
28
|
+
data: Hex;
|
|
29
|
+
to: Address;
|
|
30
|
+
chainId: number;
|
|
31
|
+
value: string;
|
|
32
|
+
type?: string;
|
|
33
|
+
};
|
|
34
|
+
export type BungeeAutoRoute = {
|
|
35
|
+
userOp: string;
|
|
36
|
+
requestHash: string;
|
|
37
|
+
output: {
|
|
38
|
+
token: BungeeToken;
|
|
39
|
+
amount: string;
|
|
40
|
+
priceInUsd: number;
|
|
41
|
+
valueInUsd: number;
|
|
42
|
+
minAmountOut: string;
|
|
43
|
+
effectiveReceivedInUsd: number;
|
|
44
|
+
};
|
|
45
|
+
requestType: 'SINGLE_OUTPUT_REQUEST' | 'SWAP_REQUEST';
|
|
46
|
+
approvalData?: {
|
|
47
|
+
spenderAddress: Address;
|
|
48
|
+
amount: string;
|
|
49
|
+
tokenAddress: Address;
|
|
50
|
+
userAddress: Address;
|
|
51
|
+
};
|
|
52
|
+
affiliateFee?: {
|
|
53
|
+
token: BungeeToken;
|
|
54
|
+
amount: string;
|
|
55
|
+
feeTakerAddress: Address;
|
|
56
|
+
};
|
|
57
|
+
gasFee?: {
|
|
58
|
+
gasToken: BungeeToken;
|
|
59
|
+
gasLimit: string;
|
|
60
|
+
gasPrice: string;
|
|
61
|
+
estimatedFee: string;
|
|
62
|
+
feeInUsd: number;
|
|
63
|
+
};
|
|
64
|
+
slippage: number;
|
|
65
|
+
txData?: BungeeTxData;
|
|
66
|
+
estimatedTime: number;
|
|
67
|
+
routeDetails: {
|
|
68
|
+
name: string;
|
|
69
|
+
logoURI: string;
|
|
70
|
+
routeFee: {
|
|
71
|
+
token: BungeeToken;
|
|
72
|
+
amount: string;
|
|
73
|
+
feeInUsd: number;
|
|
74
|
+
priceInUsd: number;
|
|
75
|
+
} | null;
|
|
76
|
+
};
|
|
77
|
+
quoteId: string;
|
|
78
|
+
quoteExpiry: number;
|
|
79
|
+
routeTags: ('MAX_OUTPUT' | 'SUGGESTED' | 'FASTEST')[];
|
|
80
|
+
};
|
|
81
|
+
export type BungeeQuoteResponse = {
|
|
82
|
+
success: boolean;
|
|
83
|
+
statusCode: number;
|
|
84
|
+
result?: {
|
|
85
|
+
originChainId: number;
|
|
86
|
+
destinationChainId: number;
|
|
87
|
+
userAddress: Address;
|
|
88
|
+
receiverAddress: Address;
|
|
89
|
+
input: {
|
|
90
|
+
token: BungeeToken;
|
|
91
|
+
amount: string;
|
|
92
|
+
priceInUsd: number;
|
|
93
|
+
valueInUsd: number;
|
|
94
|
+
};
|
|
95
|
+
destinationExec?: unknown;
|
|
96
|
+
autoRoute?: unknown;
|
|
97
|
+
autoRoutes?: BungeeAutoRoute[];
|
|
98
|
+
};
|
|
99
|
+
message?: string;
|
|
100
|
+
};
|
|
101
|
+
export type BungeeStatusRequest = {
|
|
102
|
+
txHash: Hex;
|
|
103
|
+
originChainId?: number;
|
|
104
|
+
};
|
|
105
|
+
export type BungeeStatusResponse = {
|
|
106
|
+
success: boolean;
|
|
107
|
+
statusCode: number;
|
|
108
|
+
result: Array<{
|
|
109
|
+
hash: Hex;
|
|
110
|
+
originData: {
|
|
111
|
+
txHash: Hex;
|
|
112
|
+
input: unknown | null;
|
|
113
|
+
status: BungeeRequestStatus;
|
|
114
|
+
originChainId: number | null;
|
|
115
|
+
userAddress: Address | null;
|
|
116
|
+
timestamp: number | null;
|
|
117
|
+
};
|
|
118
|
+
destinationData: {
|
|
119
|
+
output: unknown | null;
|
|
120
|
+
status: BungeeRequestStatus;
|
|
121
|
+
destinationChainId: number | null;
|
|
122
|
+
receiverAddress: Address | null;
|
|
123
|
+
txHash: Hex | null;
|
|
124
|
+
timestamp: number | null;
|
|
125
|
+
};
|
|
126
|
+
routeDetails: unknown | null;
|
|
127
|
+
bungeeStatusCode: number;
|
|
128
|
+
refund: unknown | null;
|
|
129
|
+
}>;
|
|
130
|
+
message: string | null;
|
|
131
|
+
};
|
|
132
|
+
export declare enum BungeeRequestStatus {
|
|
133
|
+
PENDING = "PENDING",
|
|
134
|
+
COMPLETED = "COMPLETED",
|
|
135
|
+
FAILED = "FAILED"
|
|
136
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BungeeRequestStatus = exports.BUNGEE_API = void 0;
|
|
4
|
+
exports.BUNGEE_API = 'https://public-backend.bungee.exchange';
|
|
5
|
+
var BungeeRequestStatus;
|
|
6
|
+
(function (BungeeRequestStatus) {
|
|
7
|
+
BungeeRequestStatus["PENDING"] = "PENDING";
|
|
8
|
+
BungeeRequestStatus["COMPLETED"] = "COMPLETED";
|
|
9
|
+
BungeeRequestStatus["FAILED"] = "FAILED";
|
|
10
|
+
})(BungeeRequestStatus || (exports.BungeeRequestStatus = BungeeRequestStatus = {}));
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/entities/crossChainDeposit/aggregators/Bungee/types.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,wCAAwC,CAAC;AA2InE,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8CAAuB,CAAA;IACvB,wCAAiB,CAAA;AACnB,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BOROS_PROCESSING_s = void 0;
|
|
3
|
+
exports.BUNGEE_LOGO_URI = exports.BOROS_PROCESSING_s = void 0;
|
|
4
4
|
exports.BOROS_PROCESSING_s = 10;
|
|
5
|
+
exports.BUNGEE_LOGO_URI = 'https://storage.googleapis.com/pendle-v3/Bungee%20Logo%20Mark%20Yellow%20(1).svg';
|
|
5
6
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/entities/crossChainDeposit/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/entities/crossChainDeposit/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG,EAAE,CAAC;AACxB,QAAA,eAAe,GAAG,kFAAkF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { bulkSignWithAgent, bulkSignWithAgentV2, getAgentSignature, signCancelStopOrderRequest, signCancelStopOrderV2Request, signStopOrderRequest, signUpdateSettings, signWithAgent, type SignedAgentExecution, } from './agent';
|
|
2
2
|
export { createPendleBorosRouterDomain, EIP712_DOMAIN_TYPES, hashStopOrderRequest } from './common';
|
|
3
|
-
export { type OTCTradeReq, type AcceptOTCTradeMessage, type ApproveOTCTradeMessage, type ExecuteOTCTradeMessage, type CancelOTCTradeMessage, OTC_TRADE_REQ_TYPES, ACCEPT_OTC_TRADE_MESSAGE_TYPES, APPROVE_OTC_TRADE_MESSAGE_TYPES, EXECUTE_OTC_TRADE_MESSAGE_TYPES, CANCEL_OTC_TRADE_MESSAGE_TYPES, generateOrderSalt, hashAcceptOTCTradeMessage, signAcceptOTCTradeMessage, signCancelOTCTradeMessage, } from './otc';
|
|
3
|
+
export { type OTCTradeReq, type AcceptOTCTradeMessage, type ApproveOTCTradeMessage, type ExecuteOTCTradeMessage, type CancelOTCTradeMessage, OTC_TRADE_REQ_TYPES, ACCEPT_OTC_TRADE_MESSAGE_TYPES, APPROVE_OTC_TRADE_MESSAGE_TYPES, EXECUTE_OTC_TRADE_MESSAGE_TYPES, CANCEL_OTC_TRADE_MESSAGE_TYPES, generateOrderSalt, hashAcceptOTCTradeMessage, signAcceptOTCTradeMessage, signApproveOTCTradeMessage, signCancelOTCTradeMessage, } from './otc';
|
|
4
4
|
export { signApproveAgentMessage, signDepositFromBoxMessage, signSetAccManagerMessage, } from './sensitive';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.signSetAccManagerMessage = exports.signDepositFromBoxMessage = exports.signApproveAgentMessage = exports.signCancelOTCTradeMessage = exports.signAcceptOTCTradeMessage = exports.hashAcceptOTCTradeMessage = exports.generateOrderSalt = exports.CANCEL_OTC_TRADE_MESSAGE_TYPES = exports.EXECUTE_OTC_TRADE_MESSAGE_TYPES = exports.APPROVE_OTC_TRADE_MESSAGE_TYPES = exports.ACCEPT_OTC_TRADE_MESSAGE_TYPES = exports.OTC_TRADE_REQ_TYPES = exports.hashStopOrderRequest = exports.EIP712_DOMAIN_TYPES = exports.createPendleBorosRouterDomain = exports.signWithAgent = exports.signUpdateSettings = exports.signStopOrderRequest = exports.signCancelStopOrderV2Request = exports.signCancelStopOrderRequest = exports.getAgentSignature = exports.bulkSignWithAgentV2 = exports.bulkSignWithAgent = void 0;
|
|
3
|
+
exports.signSetAccManagerMessage = exports.signDepositFromBoxMessage = exports.signApproveAgentMessage = exports.signCancelOTCTradeMessage = exports.signApproveOTCTradeMessage = exports.signAcceptOTCTradeMessage = exports.hashAcceptOTCTradeMessage = exports.generateOrderSalt = exports.CANCEL_OTC_TRADE_MESSAGE_TYPES = exports.EXECUTE_OTC_TRADE_MESSAGE_TYPES = exports.APPROVE_OTC_TRADE_MESSAGE_TYPES = exports.ACCEPT_OTC_TRADE_MESSAGE_TYPES = exports.OTC_TRADE_REQ_TYPES = exports.hashStopOrderRequest = exports.EIP712_DOMAIN_TYPES = exports.createPendleBorosRouterDomain = exports.signWithAgent = exports.signUpdateSettings = exports.signStopOrderRequest = exports.signCancelStopOrderV2Request = exports.signCancelStopOrderRequest = exports.getAgentSignature = exports.bulkSignWithAgentV2 = exports.bulkSignWithAgent = void 0;
|
|
4
4
|
var agent_1 = require("./agent");
|
|
5
5
|
Object.defineProperty(exports, "bulkSignWithAgent", { enumerable: true, get: function () { return agent_1.bulkSignWithAgent; } });
|
|
6
6
|
Object.defineProperty(exports, "bulkSignWithAgentV2", { enumerable: true, get: function () { return agent_1.bulkSignWithAgentV2; } });
|
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "CANCEL_OTC_TRADE_MESSAGE_TYPES", { enumerable: t
|
|
|
23
23
|
Object.defineProperty(exports, "generateOrderSalt", { enumerable: true, get: function () { return otc_1.generateOrderSalt; } });
|
|
24
24
|
Object.defineProperty(exports, "hashAcceptOTCTradeMessage", { enumerable: true, get: function () { return otc_1.hashAcceptOTCTradeMessage; } });
|
|
25
25
|
Object.defineProperty(exports, "signAcceptOTCTradeMessage", { enumerable: true, get: function () { return otc_1.signAcceptOTCTradeMessage; } });
|
|
26
|
+
Object.defineProperty(exports, "signApproveOTCTradeMessage", { enumerable: true, get: function () { return otc_1.signApproveOTCTradeMessage; } });
|
|
26
27
|
Object.defineProperty(exports, "signCancelOTCTradeMessage", { enumerable: true, get: function () { return otc_1.signCancelOTCTradeMessage; } });
|
|
27
28
|
var sensitive_1 = require("./sensitive");
|
|
28
29
|
Object.defineProperty(exports, "signApproveAgentMessage", { enumerable: true, get: function () { return sensitive_1.signApproveAgentMessage; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/signing/index.ts"],"names":[],"mappings":";;;AAAA,iCAUiB;AATf,0GAAA,iBAAiB,OAAA;AACjB,4GAAA,mBAAmB,OAAA;AACnB,0GAAA,iBAAiB,OAAA;AACjB,mHAAA,0BAA0B,OAAA;AAC1B,qHAAA,4BAA4B,OAAA;AAC5B,6GAAA,oBAAoB,OAAA;AACpB,2GAAA,kBAAkB,OAAA;AAClB,sGAAA,aAAa,OAAA;AAGf,mCAAoG;AAA3F,uHAAA,6BAA6B,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAAE,8GAAA,oBAAoB,OAAA;AACjF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/signing/index.ts"],"names":[],"mappings":";;;AAAA,iCAUiB;AATf,0GAAA,iBAAiB,OAAA;AACjB,4GAAA,mBAAmB,OAAA;AACnB,0GAAA,iBAAiB,OAAA;AACjB,mHAAA,0BAA0B,OAAA;AAC1B,qHAAA,4BAA4B,OAAA;AAC5B,6GAAA,oBAAoB,OAAA;AACpB,2GAAA,kBAAkB,OAAA;AAClB,sGAAA,aAAa,OAAA;AAGf,mCAAoG;AAA3F,uHAAA,6BAA6B,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAAE,8GAAA,oBAAoB,OAAA;AACjF,6BAgBe;AAVb,0GAAA,mBAAmB,OAAA;AACnB,qHAAA,8BAA8B,OAAA;AAC9B,sHAAA,+BAA+B,OAAA;AAC/B,sHAAA,+BAA+B,OAAA;AAC/B,qHAAA,8BAA8B,OAAA;AAC9B,wGAAA,iBAAiB,OAAA;AACjB,gHAAA,yBAAyB,OAAA;AACzB,gHAAA,yBAAyB,OAAA;AACzB,iHAAA,0BAA0B,OAAA;AAC1B,gHAAA,yBAAyB,OAAA;AAE3B,yCAIqB;AAHnB,oHAAA,uBAAuB,OAAA;AACvB,sHAAA,yBAAyB,OAAA;AACzB,qHAAA,wBAAwB,OAAA"}
|
|
@@ -102,6 +102,7 @@ export interface ExecuteOTCTradeMessage {
|
|
|
102
102
|
}
|
|
103
103
|
export declare function hashAcceptOTCTradeMessage(message: AcceptOTCTradeMessage, routerAddress?: Address): Hex;
|
|
104
104
|
export declare function signAcceptOTCTradeMessage(walletClient: WalletClient, message: AcceptOTCTradeMessage): Promise<Hex>;
|
|
105
|
+
export declare function signApproveOTCTradeMessage(walletClient: WalletClient, message: ApproveOTCTradeMessage): Promise<Hex>;
|
|
105
106
|
export declare const CANCEL_OTC_TRADE_MESSAGE_TYPES: readonly [{
|
|
106
107
|
readonly name: "tradeId";
|
|
107
108
|
readonly type: "bytes32";
|
|
@@ -4,6 +4,7 @@ exports.CANCEL_OTC_TRADE_MESSAGE_TYPES = exports.EXECUTE_OTC_TRADE_MESSAGE_TYPES
|
|
|
4
4
|
exports.generateOrderSalt = generateOrderSalt;
|
|
5
5
|
exports.hashAcceptOTCTradeMessage = hashAcceptOTCTradeMessage;
|
|
6
6
|
exports.signAcceptOTCTradeMessage = signAcceptOTCTradeMessage;
|
|
7
|
+
exports.signApproveOTCTradeMessage = signApproveOTCTradeMessage;
|
|
7
8
|
exports.signCancelOTCTradeMessage = signCancelOTCTradeMessage;
|
|
8
9
|
const node_crypto_1 = require("node:crypto");
|
|
9
10
|
const viem_1 = require("viem");
|
|
@@ -87,6 +88,33 @@ async function signAcceptOTCTradeMessage(walletClient, message) {
|
|
|
87
88
|
},
|
|
88
89
|
});
|
|
89
90
|
}
|
|
91
|
+
async function signApproveOTCTradeMessage(walletClient, message) {
|
|
92
|
+
const account = await (0, __1.getUserAddressFromWalletClient)(walletClient);
|
|
93
|
+
const trade = {
|
|
94
|
+
...message.trade,
|
|
95
|
+
salt: message.trade.salt ?? 0n,
|
|
96
|
+
};
|
|
97
|
+
return walletClient.signTypedData({
|
|
98
|
+
account: walletClient.account ?? account,
|
|
99
|
+
domain: (0, common_1.createPendleBorosRouterDomain)(),
|
|
100
|
+
types: {
|
|
101
|
+
EIP712Domain: common_1.EIP712_DOMAIN_TYPES,
|
|
102
|
+
OTCTradeReq: exports.OTC_TRADE_REQ_TYPES,
|
|
103
|
+
ApproveOTCTradeMessage: exports.APPROVE_OTC_TRADE_MESSAGE_TYPES,
|
|
104
|
+
},
|
|
105
|
+
primaryType: 'ApproveOTCTradeMessage',
|
|
106
|
+
message: {
|
|
107
|
+
trade,
|
|
108
|
+
makerAccountId: message.makerAccountId,
|
|
109
|
+
makerCross: message.makerCross,
|
|
110
|
+
takerAccountId: message.takerAccountId,
|
|
111
|
+
takerCross: message.takerCross,
|
|
112
|
+
minHRMaker: message.minHRMaker,
|
|
113
|
+
minHRTaker: message.minHRTaker,
|
|
114
|
+
expiry: message.expiry,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
90
118
|
exports.CANCEL_OTC_TRADE_MESSAGE_TYPES = [{ name: 'tradeId', type: 'bytes32' }];
|
|
91
119
|
async function signCancelOTCTradeMessage(walletClient, message) {
|
|
92
120
|
const account = await (0, __1.getUserAddressFromWalletClient)(walletClient);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otc.js","sourceRoot":"","sources":["../../../src/utils/signing/otc.ts"],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