@gearbox-protocol/sdk 11.2.0 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abi/router/infinifiWorker.js +541 -0
- package/dist/cjs/abi/router/uniswapV4Worker.js +574 -0
- package/dist/cjs/permissionless/chains/chunked-log-transport.js +5 -1
- package/dist/cjs/permissionless/utils/price-update/get-price-feeds.js +5 -3
- package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +5 -3
- package/dist/cjs/permissionless/utils/price-update/get-prices.js +7 -2
- package/dist/cjs/plugins/adapters/AdaptersPlugin.js +9 -0
- package/dist/cjs/plugins/adapters/abi/actionAbi.js +9 -0
- package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +17 -8
- package/dist/cjs/plugins/adapters/abi/conctructorAbiPatterns.js +4 -4
- package/dist/cjs/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.js +2 -1
- package/dist/cjs/plugins/adapters/contracts/InfinifiGatewayAdapterContract.js +58 -0
- package/dist/cjs/plugins/adapters/contracts/InfinifiUnwindingGatewayAdapterContract.js +49 -0
- package/dist/cjs/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.js +2 -1
- package/dist/cjs/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +2 -1
- package/dist/cjs/plugins/adapters/contracts/UniswapV4AdapterContract.js +62 -0
- package/dist/cjs/plugins/adapters/types.js +3 -0
- package/dist/esm/abi/router/infinifiWorker.js +517 -0
- package/dist/esm/abi/router/uniswapV4Worker.js +550 -0
- package/dist/esm/permissionless/chains/chunked-log-transport.js +5 -1
- package/dist/esm/permissionless/utils/price-update/get-price-feeds.js +5 -3
- package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +5 -3
- package/dist/esm/permissionless/utils/price-update/get-prices.js +10 -3
- package/dist/esm/plugins/adapters/AdaptersPlugin.js +9 -0
- package/dist/esm/plugins/adapters/abi/actionAbi.js +9 -0
- package/dist/esm/plugins/adapters/abi/conctructorAbi.js +18 -9
- package/dist/esm/plugins/adapters/abi/conctructorAbiPatterns.js +3 -3
- package/dist/esm/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.js +2 -1
- package/dist/esm/plugins/adapters/contracts/InfinifiGatewayAdapterContract.js +34 -0
- package/dist/esm/plugins/adapters/contracts/InfinifiUnwindingGatewayAdapterContract.js +25 -0
- package/dist/esm/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.js +2 -1
- package/dist/esm/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +2 -1
- package/dist/esm/plugins/adapters/contracts/UniswapV4AdapterContract.js +38 -0
- package/dist/esm/plugins/adapters/types.js +3 -0
- package/dist/types/abi/router/infinifiWorker.d.ts +726 -0
- package/dist/types/abi/router/uniswapV4Worker.d.ts +774 -0
- package/dist/types/permissionless/utils/price-update/get-price-feeds.d.ts +2 -1
- package/dist/types/permissionless/utils/price-update/get-price-update-tx.d.ts +2 -1
- package/dist/types/permissionless/utils/price-update/get-prices.d.ts +2 -1
- package/dist/types/plugins/adapters/abi/conctructorAbiPatterns.d.ts +2 -2
- package/dist/types/plugins/adapters/contracts/BalancerV3RouterAdapterContract.d.ts +139 -13
- package/dist/types/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.d.ts +117 -1
- package/dist/types/plugins/adapters/contracts/InfinifiGatewayAdapterContract.d.ts +351 -0
- package/dist/types/plugins/adapters/contracts/InfinifiUnwindingGatewayAdapterContract.d.ts +208 -0
- package/dist/types/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.d.ts +180 -1
- package/dist/types/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.d.ts +276 -1
- package/dist/types/plugins/adapters/contracts/PendleRouterAdapterContract.d.ts +559 -0
- package/dist/types/plugins/adapters/contracts/UniswapV4AdapterContract.d.ts +320 -0
- package/dist/types/plugins/adapters/types.d.ts +4 -1
- package/package.json +2 -2
|
@@ -42,6 +42,12 @@ const adapterActionSignatures = {
|
|
|
42
42
|
[import_types.AdapterType.EQUALIZER_ROUTER]: {
|
|
43
43
|
310: "function setPoolStatusBatch((address,address,bool,bool)[])"
|
|
44
44
|
},
|
|
45
|
+
[import_types.AdapterType.INFINIFI_GATEWAY]: {
|
|
46
|
+
310: "function setLockedTokenBatchStatus((address,uint32,bool)[])"
|
|
47
|
+
},
|
|
48
|
+
[import_types.AdapterType.INFINIFI_UNWINDING]: {
|
|
49
|
+
310: "function setLockedTokenBatchStatus((address,uint32,bool)[])"
|
|
50
|
+
},
|
|
45
51
|
[import_types.AdapterType.KODIAK_ISLAND_GATEWAY]: {
|
|
46
52
|
310: "function setIslandStatusBatch((address,uint8)[])"
|
|
47
53
|
},
|
|
@@ -70,6 +76,9 @@ const adapterActionSignatures = {
|
|
|
70
76
|
[import_types.AdapterType.UNISWAP_V3_ROUTER]: {
|
|
71
77
|
310: "function setPoolStatusBatch((address,address,uint24,bool)[])"
|
|
72
78
|
},
|
|
79
|
+
[import_types.AdapterType.UNISWAP_V4_GATEWAY]: {
|
|
80
|
+
310: "function setPoolKeyStatusBatch(((address,address,uint24,int24,address),bool)[])"
|
|
81
|
+
},
|
|
73
82
|
[import_types.AdapterType.VELODROME_V2_ROUTER]: {
|
|
74
83
|
310: "function setPoolStatusBatch((address,address,bool,address,bool)[])"
|
|
75
84
|
}
|
|
@@ -50,6 +50,9 @@ const adapterConstructorAbi = {
|
|
|
50
50
|
[import_types.AdapterType.FLUID_DEX]: {
|
|
51
51
|
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
52
52
|
},
|
|
53
|
+
[import_types.AdapterType.INFINIFI_GATEWAY]: {
|
|
54
|
+
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
55
|
+
},
|
|
53
56
|
[import_types.AdapterType.KODIAK_ISLAND_GATEWAY]: {
|
|
54
57
|
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
55
58
|
},
|
|
@@ -78,6 +81,9 @@ const adapterConstructorAbi = {
|
|
|
78
81
|
[import_types.AdapterType.UNISWAP_V3_ROUTER]: {
|
|
79
82
|
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
80
83
|
},
|
|
84
|
+
[import_types.AdapterType.UNISWAP_V4_GATEWAY]: {
|
|
85
|
+
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
86
|
+
},
|
|
81
87
|
[import_types.AdapterType.VELODROME_V2_ROUTER]: {
|
|
82
88
|
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
83
89
|
},
|
|
@@ -124,8 +130,8 @@ const adapterConstructorAbi = {
|
|
|
124
130
|
// Mellow adapters
|
|
125
131
|
[import_types.AdapterType.MELLOW_ERC4626_VAULT]: {
|
|
126
132
|
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI,
|
|
127
|
-
311: import_conctructorAbiPatterns.
|
|
128
|
-
312: import_conctructorAbiPatterns.
|
|
133
|
+
311: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI,
|
|
134
|
+
312: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI
|
|
129
135
|
},
|
|
130
136
|
[import_types.AdapterType.MELLOW_CLAIMER]: {
|
|
131
137
|
310: import_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
@@ -142,19 +148,22 @@ const adapterConstructorAbi = {
|
|
|
142
148
|
// Other adapters
|
|
143
149
|
// address pattern [creditManager, target, address]
|
|
144
150
|
[import_types.AdapterType.CVX_V1_BASE_REWARD_POOL]: {
|
|
145
|
-
310: import_conctructorAbiPatterns.
|
|
146
|
-
311: import_conctructorAbiPatterns.
|
|
151
|
+
310: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI,
|
|
152
|
+
311: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI
|
|
147
153
|
},
|
|
148
154
|
[import_types.AdapterType.INFRARED_VAULT]: {
|
|
149
|
-
310: import_conctructorAbiPatterns.
|
|
150
|
-
311: import_conctructorAbiPatterns.
|
|
155
|
+
310: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI,
|
|
156
|
+
311: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI
|
|
151
157
|
},
|
|
152
158
|
[import_types.AdapterType.UPSHIFT_VAULT]: {
|
|
153
|
-
310: import_conctructorAbiPatterns.
|
|
159
|
+
310: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI
|
|
160
|
+
},
|
|
161
|
+
[import_types.AdapterType.INFINIFI_UNWINDING]: {
|
|
162
|
+
310: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI
|
|
154
163
|
},
|
|
155
164
|
// other patterns
|
|
156
165
|
[import_types.AdapterType.STAKING_REWARDS]: {
|
|
157
|
-
310: import_conctructorAbiPatterns.
|
|
166
|
+
310: import_conctructorAbiPatterns.PHANTOM_TOKEN_ADAPTER_ABI,
|
|
158
167
|
311: import_conctructorAbiPatterns.STAKING_REWARDS_ADAPTER_ABI,
|
|
159
168
|
312: import_conctructorAbiPatterns.STAKING_REWARDS_ADAPTER_ABI
|
|
160
169
|
},
|
|
@@ -25,8 +25,8 @@ __export(conctructorAbiPatterns_exports, {
|
|
|
25
25
|
CURVE_V1_WRAPPER_ADAPTER_ABI: () => CURVE_V1_WRAPPER_ADAPTER_ABI,
|
|
26
26
|
GATEWAY_ADAPTER_ABI: () => GATEWAY_ADAPTER_ABI,
|
|
27
27
|
LP_ADAPTER_ABI: () => LP_ADAPTER_ABI,
|
|
28
|
+
PHANTOM_TOKEN_ADAPTER_ABI: () => PHANTOM_TOKEN_ADAPTER_ABI,
|
|
28
29
|
REFERER_ID_ADAPTER_ABI: () => REFERER_ID_ADAPTER_ABI,
|
|
29
|
-
STAKED_TOKEN_ADAPTER_ABI: () => STAKED_TOKEN_ADAPTER_ABI,
|
|
30
30
|
STAKING_REWARDS_ADAPTER_ABI: () => STAKING_REWARDS_ADAPTER_ABI,
|
|
31
31
|
UINT_REFERRAL_ADAPTER_ABI: () => UINT_REFERRAL_ADAPTER_ABI
|
|
32
32
|
});
|
|
@@ -35,10 +35,10 @@ const BASIC_ADAPTER_ABI = [
|
|
|
35
35
|
{ type: "address", name: "creditManager" },
|
|
36
36
|
{ type: "address", name: "target" }
|
|
37
37
|
];
|
|
38
|
-
const
|
|
38
|
+
const PHANTOM_TOKEN_ADAPTER_ABI = [
|
|
39
39
|
{ type: "address", name: "creditManager" },
|
|
40
40
|
{ type: "address", name: "target" },
|
|
41
|
-
{ type: "address", name: "
|
|
41
|
+
{ type: "address", name: "phantomToken" }
|
|
42
42
|
];
|
|
43
43
|
const LP_ADAPTER_ABI = [
|
|
44
44
|
{ type: "address", name: "creditManager" },
|
|
@@ -99,8 +99,8 @@ const STAKING_REWARDS_ADAPTER_ABI = [
|
|
|
99
99
|
CURVE_V1_WRAPPER_ADAPTER_ABI,
|
|
100
100
|
GATEWAY_ADAPTER_ABI,
|
|
101
101
|
LP_ADAPTER_ABI,
|
|
102
|
+
PHANTOM_TOKEN_ADAPTER_ABI,
|
|
102
103
|
REFERER_ID_ADAPTER_ABI,
|
|
103
|
-
STAKED_TOKEN_ADAPTER_ABI,
|
|
104
104
|
STAKING_REWARDS_ADAPTER_ABI,
|
|
105
105
|
UINT_REFERRAL_ADAPTER_ABI
|
|
106
106
|
});
|
|
@@ -21,9 +21,10 @@ __export(BalancerV3WrapperAdapterContract_exports, {
|
|
|
21
21
|
BalancerV3WrapperAdapterContract: () => BalancerV3WrapperAdapterContract
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(BalancerV3WrapperAdapterContract_exports);
|
|
24
|
+
var import_integrations_v3 = require("@gearbox-protocol/integrations-v3");
|
|
24
25
|
var import_viem = require("viem");
|
|
25
26
|
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
26
|
-
const abi =
|
|
27
|
+
const abi = import_integrations_v3.iBalancerV3WrapperAdapterAbi;
|
|
27
28
|
class BalancerV3WrapperAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
28
29
|
balancerPoolToken;
|
|
29
30
|
constructor(sdk, args) {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var InfinifiGatewayAdapterContract_exports = {};
|
|
20
|
+
__export(InfinifiGatewayAdapterContract_exports, {
|
|
21
|
+
InfinifiGatewayAdapterContract: () => InfinifiGatewayAdapterContract
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(InfinifiGatewayAdapterContract_exports);
|
|
24
|
+
var import_integrations_v3 = require("@gearbox-protocol/integrations-v3");
|
|
25
|
+
var import_viem = require("viem");
|
|
26
|
+
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
27
|
+
const abi = import_integrations_v3.iInfinifiGatewayAdapterAbi;
|
|
28
|
+
class InfinifiGatewayAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
29
|
+
usdc;
|
|
30
|
+
iusd;
|
|
31
|
+
siusd;
|
|
32
|
+
allowedLockedTokens;
|
|
33
|
+
constructor(sdk, args) {
|
|
34
|
+
super(sdk, { ...args, abi });
|
|
35
|
+
const decoded = (0, import_viem.decodeAbiParameters)(
|
|
36
|
+
[
|
|
37
|
+
{ type: "address", name: "creditManager" },
|
|
38
|
+
{ type: "address", name: "targetContract" },
|
|
39
|
+
{ type: "address", name: "usdc" },
|
|
40
|
+
{ type: "address", name: "iusd" },
|
|
41
|
+
{ type: "address", name: "siusd" },
|
|
42
|
+
{
|
|
43
|
+
type: "address[]",
|
|
44
|
+
name: "allowedLockedTokens"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
args.baseParams.serializedParams
|
|
48
|
+
);
|
|
49
|
+
this.usdc = decoded[2];
|
|
50
|
+
this.iusd = decoded[3];
|
|
51
|
+
this.siusd = decoded[4];
|
|
52
|
+
this.allowedLockedTokens = [...decoded[5]];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
InfinifiGatewayAdapterContract
|
|
58
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var InfinifiUnwindingGatewayAdapterContract_exports = {};
|
|
20
|
+
__export(InfinifiUnwindingGatewayAdapterContract_exports, {
|
|
21
|
+
InfinifiUnwindingGatewayAdapterContract: () => InfinifiUnwindingGatewayAdapterContract
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(InfinifiUnwindingGatewayAdapterContract_exports);
|
|
24
|
+
var import_integrations_v3 = require("@gearbox-protocol/integrations-v3");
|
|
25
|
+
var import_viem = require("viem");
|
|
26
|
+
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
27
|
+
const abi = import_integrations_v3.iInfinifiUnwindingGatewayAdapterAbi;
|
|
28
|
+
class InfinifiUnwindingGatewayAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
29
|
+
allowedLockedTokens;
|
|
30
|
+
constructor(sdk, args) {
|
|
31
|
+
super(sdk, { ...args, abi });
|
|
32
|
+
const decoded = (0, import_viem.decodeAbiParameters)(
|
|
33
|
+
[
|
|
34
|
+
{ type: "address", name: "creditManager" },
|
|
35
|
+
{ type: "address", name: "targetContract" },
|
|
36
|
+
{
|
|
37
|
+
type: "address[]",
|
|
38
|
+
name: "allowedLockedTokens"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
args.baseParams.serializedParams
|
|
42
|
+
);
|
|
43
|
+
this.allowedLockedTokens = [...decoded[2]];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
InfinifiUnwindingGatewayAdapterContract
|
|
49
|
+
});
|
|
@@ -21,9 +21,10 @@ __export(MidasIssuanceVaultAdapterContract_exports, {
|
|
|
21
21
|
MidasIssuanceVaultAdapterContract: () => MidasIssuanceVaultAdapterContract
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(MidasIssuanceVaultAdapterContract_exports);
|
|
24
|
+
var import_integrations_v3 = require("@gearbox-protocol/integrations-v3");
|
|
24
25
|
var import_viem = require("viem");
|
|
25
26
|
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
26
|
-
const abi =
|
|
27
|
+
const abi = import_integrations_v3.iMidasIssuanceVaultAdapterAbi;
|
|
27
28
|
class MidasIssuanceVaultAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
28
29
|
mToken;
|
|
29
30
|
referrerId;
|
|
@@ -21,9 +21,10 @@ __export(MidasRedemptionVaultAdapterContract_exports, {
|
|
|
21
21
|
MidasRedemptionVaultAdapterContract: () => MidasRedemptionVaultAdapterContract
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(MidasRedemptionVaultAdapterContract_exports);
|
|
24
|
+
var import_integrations_v3 = require("@gearbox-protocol/integrations-v3");
|
|
24
25
|
var import_viem = require("viem");
|
|
25
26
|
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
26
|
-
const abi =
|
|
27
|
+
const abi = import_integrations_v3.iMidasRedemptionVaultAdapterAbi;
|
|
27
28
|
class MidasRedemptionVaultAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
28
29
|
gateway;
|
|
29
30
|
mToken;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var UniswapV4AdapterContract_exports = {};
|
|
20
|
+
__export(UniswapV4AdapterContract_exports, {
|
|
21
|
+
UniswapV4AdapterContract: () => UniswapV4AdapterContract
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(UniswapV4AdapterContract_exports);
|
|
24
|
+
var import_integrations_v3 = require("@gearbox-protocol/integrations-v3");
|
|
25
|
+
var import_viem = require("viem");
|
|
26
|
+
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
27
|
+
const abi = import_integrations_v3.iUniswapV4AdapterAbi;
|
|
28
|
+
class UniswapV4AdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
29
|
+
supportedPoolKeys;
|
|
30
|
+
constructor(sdk, args) {
|
|
31
|
+
super(sdk, { ...args, abi });
|
|
32
|
+
const decoded = (0, import_viem.decodeAbiParameters)(
|
|
33
|
+
[
|
|
34
|
+
{ type: "address", name: "creditManager" },
|
|
35
|
+
{ type: "address", name: "targetContract" },
|
|
36
|
+
{
|
|
37
|
+
type: "tuple[]",
|
|
38
|
+
name: "supportedPools",
|
|
39
|
+
components: [
|
|
40
|
+
{ type: "address", name: "token0" },
|
|
41
|
+
{ type: "address", name: "token1" },
|
|
42
|
+
{ type: "uint24", name: "fee" },
|
|
43
|
+
{ type: "int24", name: "tickSpacing" },
|
|
44
|
+
{ type: "address", name: "hooks" }
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
args.baseParams.serializedParams
|
|
49
|
+
);
|
|
50
|
+
this.supportedPoolKeys = decoded[2].map((pool) => ({
|
|
51
|
+
token0: pool.token0,
|
|
52
|
+
token1: pool.token1,
|
|
53
|
+
fee: pool.fee,
|
|
54
|
+
tickSpacing: pool.tickSpacing,
|
|
55
|
+
hooks: pool.hooks
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
UniswapV4AdapterContract
|
|
62
|
+
});
|
|
@@ -40,6 +40,8 @@ var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
|
|
|
40
40
|
AdapterType2["ERC4626_VAULT"] = "ERC4626_VAULT";
|
|
41
41
|
AdapterType2["ERC4626_VAULT_REFERRAL"] = "ERC4626_VAULT_REFERRAL";
|
|
42
42
|
AdapterType2["FLUID_DEX"] = "FLUID_DEX";
|
|
43
|
+
AdapterType2["INFINIFI_GATEWAY"] = "INFINIFI_GATEWAY";
|
|
44
|
+
AdapterType2["INFINIFI_UNWINDING"] = "INFINIFI_UNWINDING";
|
|
43
45
|
AdapterType2["INFRARED_VAULT"] = "INFRARED_VAULT";
|
|
44
46
|
AdapterType2["KODIAK_ISLAND_GATEWAY"] = "KODIAK_ISLAND_GATEWAY";
|
|
45
47
|
AdapterType2["LIDO_V1"] = "LIDO_V1";
|
|
@@ -56,6 +58,7 @@ var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
|
|
|
56
58
|
AdapterType2["TRADERJOE_ROUTER"] = "TRADERJOE_ROUTER";
|
|
57
59
|
AdapterType2["UNISWAP_V2_ROUTER"] = "UNISWAP_V2_ROUTER";
|
|
58
60
|
AdapterType2["UNISWAP_V3_ROUTER"] = "UNISWAP_V3_ROUTER";
|
|
61
|
+
AdapterType2["UNISWAP_V4_GATEWAY"] = "UNISWAP_V4_GATEWAY";
|
|
59
62
|
AdapterType2["UPSHIFT_VAULT"] = "UPSHIFT_VAULT";
|
|
60
63
|
AdapterType2["VELODROME_V2_ROUTER"] = "VELODROME_V2_ROUTER";
|
|
61
64
|
AdapterType2["YEARN_V2"] = "YEARN_V2";
|