@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
|
@@ -17,6 +17,12 @@ const adapterActionSignatures = {
|
|
|
17
17
|
[AdapterType.EQUALIZER_ROUTER]: {
|
|
18
18
|
310: "function setPoolStatusBatch((address,address,bool,bool)[])"
|
|
19
19
|
},
|
|
20
|
+
[AdapterType.INFINIFI_GATEWAY]: {
|
|
21
|
+
310: "function setLockedTokenBatchStatus((address,uint32,bool)[])"
|
|
22
|
+
},
|
|
23
|
+
[AdapterType.INFINIFI_UNWINDING]: {
|
|
24
|
+
310: "function setLockedTokenBatchStatus((address,uint32,bool)[])"
|
|
25
|
+
},
|
|
20
26
|
[AdapterType.KODIAK_ISLAND_GATEWAY]: {
|
|
21
27
|
310: "function setIslandStatusBatch((address,uint8)[])"
|
|
22
28
|
},
|
|
@@ -45,6 +51,9 @@ const adapterActionSignatures = {
|
|
|
45
51
|
[AdapterType.UNISWAP_V3_ROUTER]: {
|
|
46
52
|
310: "function setPoolStatusBatch((address,address,uint24,bool)[])"
|
|
47
53
|
},
|
|
54
|
+
[AdapterType.UNISWAP_V4_GATEWAY]: {
|
|
55
|
+
310: "function setPoolKeyStatusBatch(((address,address,uint24,int24,address),bool)[])"
|
|
56
|
+
},
|
|
48
57
|
[AdapterType.VELODROME_V2_ROUTER]: {
|
|
49
58
|
310: "function setPoolStatusBatch((address,address,bool,address,bool)[])"
|
|
50
59
|
}
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
CURVE_V1_WRAPPER_ADAPTER_ABI,
|
|
8
8
|
GATEWAY_ADAPTER_ABI,
|
|
9
9
|
LP_ADAPTER_ABI,
|
|
10
|
+
PHANTOM_TOKEN_ADAPTER_ABI,
|
|
10
11
|
REFERER_ID_ADAPTER_ABI,
|
|
11
|
-
STAKED_TOKEN_ADAPTER_ABI,
|
|
12
12
|
STAKING_REWARDS_ADAPTER_ABI,
|
|
13
13
|
UINT_REFERRAL_ADAPTER_ABI
|
|
14
14
|
} from "./conctructorAbiPatterns.js";
|
|
@@ -39,6 +39,9 @@ const adapterConstructorAbi = {
|
|
|
39
39
|
[AdapterType.FLUID_DEX]: {
|
|
40
40
|
310: BASIC_ADAPTER_ABI
|
|
41
41
|
},
|
|
42
|
+
[AdapterType.INFINIFI_GATEWAY]: {
|
|
43
|
+
310: BASIC_ADAPTER_ABI
|
|
44
|
+
},
|
|
42
45
|
[AdapterType.KODIAK_ISLAND_GATEWAY]: {
|
|
43
46
|
310: BASIC_ADAPTER_ABI
|
|
44
47
|
},
|
|
@@ -67,6 +70,9 @@ const adapterConstructorAbi = {
|
|
|
67
70
|
[AdapterType.UNISWAP_V3_ROUTER]: {
|
|
68
71
|
310: BASIC_ADAPTER_ABI
|
|
69
72
|
},
|
|
73
|
+
[AdapterType.UNISWAP_V4_GATEWAY]: {
|
|
74
|
+
310: BASIC_ADAPTER_ABI
|
|
75
|
+
},
|
|
70
76
|
[AdapterType.VELODROME_V2_ROUTER]: {
|
|
71
77
|
310: BASIC_ADAPTER_ABI
|
|
72
78
|
},
|
|
@@ -113,8 +119,8 @@ const adapterConstructorAbi = {
|
|
|
113
119
|
// Mellow adapters
|
|
114
120
|
[AdapterType.MELLOW_ERC4626_VAULT]: {
|
|
115
121
|
310: BASIC_ADAPTER_ABI,
|
|
116
|
-
311:
|
|
117
|
-
312:
|
|
122
|
+
311: PHANTOM_TOKEN_ADAPTER_ABI,
|
|
123
|
+
312: PHANTOM_TOKEN_ADAPTER_ABI
|
|
118
124
|
},
|
|
119
125
|
[AdapterType.MELLOW_CLAIMER]: {
|
|
120
126
|
310: BASIC_ADAPTER_ABI
|
|
@@ -131,19 +137,22 @@ const adapterConstructorAbi = {
|
|
|
131
137
|
// Other adapters
|
|
132
138
|
// address pattern [creditManager, target, address]
|
|
133
139
|
[AdapterType.CVX_V1_BASE_REWARD_POOL]: {
|
|
134
|
-
310:
|
|
135
|
-
311:
|
|
140
|
+
310: PHANTOM_TOKEN_ADAPTER_ABI,
|
|
141
|
+
311: PHANTOM_TOKEN_ADAPTER_ABI
|
|
136
142
|
},
|
|
137
143
|
[AdapterType.INFRARED_VAULT]: {
|
|
138
|
-
310:
|
|
139
|
-
311:
|
|
144
|
+
310: PHANTOM_TOKEN_ADAPTER_ABI,
|
|
145
|
+
311: PHANTOM_TOKEN_ADAPTER_ABI
|
|
140
146
|
},
|
|
141
147
|
[AdapterType.UPSHIFT_VAULT]: {
|
|
142
|
-
310:
|
|
148
|
+
310: PHANTOM_TOKEN_ADAPTER_ABI
|
|
149
|
+
},
|
|
150
|
+
[AdapterType.INFINIFI_UNWINDING]: {
|
|
151
|
+
310: PHANTOM_TOKEN_ADAPTER_ABI
|
|
143
152
|
},
|
|
144
153
|
// other patterns
|
|
145
154
|
[AdapterType.STAKING_REWARDS]: {
|
|
146
|
-
310:
|
|
155
|
+
310: PHANTOM_TOKEN_ADAPTER_ABI,
|
|
147
156
|
311: STAKING_REWARDS_ADAPTER_ABI,
|
|
148
157
|
312: STAKING_REWARDS_ADAPTER_ABI
|
|
149
158
|
},
|
|
@@ -2,10 +2,10 @@ const BASIC_ADAPTER_ABI = [
|
|
|
2
2
|
{ type: "address", name: "creditManager" },
|
|
3
3
|
{ type: "address", name: "target" }
|
|
4
4
|
];
|
|
5
|
-
const
|
|
5
|
+
const PHANTOM_TOKEN_ADAPTER_ABI = [
|
|
6
6
|
{ type: "address", name: "creditManager" },
|
|
7
7
|
{ type: "address", name: "target" },
|
|
8
|
-
{ type: "address", name: "
|
|
8
|
+
{ type: "address", name: "phantomToken" }
|
|
9
9
|
];
|
|
10
10
|
const LP_ADAPTER_ABI = [
|
|
11
11
|
{ type: "address", name: "creditManager" },
|
|
@@ -65,8 +65,8 @@ export {
|
|
|
65
65
|
CURVE_V1_WRAPPER_ADAPTER_ABI,
|
|
66
66
|
GATEWAY_ADAPTER_ABI,
|
|
67
67
|
LP_ADAPTER_ABI,
|
|
68
|
+
PHANTOM_TOKEN_ADAPTER_ABI,
|
|
68
69
|
REFERER_ID_ADAPTER_ABI,
|
|
69
|
-
STAKED_TOKEN_ADAPTER_ABI,
|
|
70
70
|
STAKING_REWARDS_ADAPTER_ABI,
|
|
71
71
|
UINT_REFERRAL_ADAPTER_ABI
|
|
72
72
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { iBalancerV3WrapperAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
1
2
|
import { decodeAbiParameters } from "viem";
|
|
2
3
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
3
|
-
const abi =
|
|
4
|
+
const abi = iBalancerV3WrapperAdapterAbi;
|
|
4
5
|
class BalancerV3WrapperAdapterContract extends AbstractAdapterContract {
|
|
5
6
|
balancerPoolToken;
|
|
6
7
|
constructor(sdk, args) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { iInfinifiGatewayAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iInfinifiGatewayAdapterAbi;
|
|
5
|
+
class InfinifiGatewayAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
usdc;
|
|
7
|
+
iusd;
|
|
8
|
+
siusd;
|
|
9
|
+
allowedLockedTokens;
|
|
10
|
+
constructor(sdk, args) {
|
|
11
|
+
super(sdk, { ...args, abi });
|
|
12
|
+
const decoded = decodeAbiParameters(
|
|
13
|
+
[
|
|
14
|
+
{ type: "address", name: "creditManager" },
|
|
15
|
+
{ type: "address", name: "targetContract" },
|
|
16
|
+
{ type: "address", name: "usdc" },
|
|
17
|
+
{ type: "address", name: "iusd" },
|
|
18
|
+
{ type: "address", name: "siusd" },
|
|
19
|
+
{
|
|
20
|
+
type: "address[]",
|
|
21
|
+
name: "allowedLockedTokens"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
args.baseParams.serializedParams
|
|
25
|
+
);
|
|
26
|
+
this.usdc = decoded[2];
|
|
27
|
+
this.iusd = decoded[3];
|
|
28
|
+
this.siusd = decoded[4];
|
|
29
|
+
this.allowedLockedTokens = [...decoded[5]];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
InfinifiGatewayAdapterContract
|
|
34
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { iInfinifiUnwindingGatewayAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iInfinifiUnwindingGatewayAdapterAbi;
|
|
5
|
+
class InfinifiUnwindingGatewayAdapterContract extends AbstractAdapterContract {
|
|
6
|
+
allowedLockedTokens;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{
|
|
14
|
+
type: "address[]",
|
|
15
|
+
name: "allowedLockedTokens"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
args.baseParams.serializedParams
|
|
19
|
+
);
|
|
20
|
+
this.allowedLockedTokens = [...decoded[2]];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
InfinifiUnwindingGatewayAdapterContract
|
|
25
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { iMidasIssuanceVaultAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
1
2
|
import { decodeAbiParameters } from "viem";
|
|
2
3
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
3
|
-
const abi =
|
|
4
|
+
const abi = iMidasIssuanceVaultAdapterAbi;
|
|
4
5
|
class MidasIssuanceVaultAdapterContract extends AbstractAdapterContract {
|
|
5
6
|
mToken;
|
|
6
7
|
referrerId;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { iMidasRedemptionVaultAdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
1
2
|
import { decodeAbiParameters } from "viem";
|
|
2
3
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
3
|
-
const abi =
|
|
4
|
+
const abi = iMidasRedemptionVaultAdapterAbi;
|
|
4
5
|
class MidasRedemptionVaultAdapterContract extends AbstractAdapterContract {
|
|
5
6
|
gateway;
|
|
6
7
|
mToken;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { iUniswapV4AdapterAbi } from "@gearbox-protocol/integrations-v3";
|
|
2
|
+
import { decodeAbiParameters } from "viem";
|
|
3
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
4
|
+
const abi = iUniswapV4AdapterAbi;
|
|
5
|
+
class UniswapV4AdapterContract extends AbstractAdapterContract {
|
|
6
|
+
supportedPoolKeys;
|
|
7
|
+
constructor(sdk, args) {
|
|
8
|
+
super(sdk, { ...args, abi });
|
|
9
|
+
const decoded = decodeAbiParameters(
|
|
10
|
+
[
|
|
11
|
+
{ type: "address", name: "creditManager" },
|
|
12
|
+
{ type: "address", name: "targetContract" },
|
|
13
|
+
{
|
|
14
|
+
type: "tuple[]",
|
|
15
|
+
name: "supportedPools",
|
|
16
|
+
components: [
|
|
17
|
+
{ type: "address", name: "token0" },
|
|
18
|
+
{ type: "address", name: "token1" },
|
|
19
|
+
{ type: "uint24", name: "fee" },
|
|
20
|
+
{ type: "int24", name: "tickSpacing" },
|
|
21
|
+
{ type: "address", name: "hooks" }
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
args.baseParams.serializedParams
|
|
26
|
+
);
|
|
27
|
+
this.supportedPoolKeys = decoded[2].map((pool) => ({
|
|
28
|
+
token0: pool.token0,
|
|
29
|
+
token1: pool.token1,
|
|
30
|
+
fee: pool.fee,
|
|
31
|
+
tickSpacing: pool.tickSpacing,
|
|
32
|
+
hooks: pool.hooks
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
UniswapV4AdapterContract
|
|
38
|
+
};
|
|
@@ -17,6 +17,8 @@ var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
|
|
|
17
17
|
AdapterType2["ERC4626_VAULT"] = "ERC4626_VAULT";
|
|
18
18
|
AdapterType2["ERC4626_VAULT_REFERRAL"] = "ERC4626_VAULT_REFERRAL";
|
|
19
19
|
AdapterType2["FLUID_DEX"] = "FLUID_DEX";
|
|
20
|
+
AdapterType2["INFINIFI_GATEWAY"] = "INFINIFI_GATEWAY";
|
|
21
|
+
AdapterType2["INFINIFI_UNWINDING"] = "INFINIFI_UNWINDING";
|
|
20
22
|
AdapterType2["INFRARED_VAULT"] = "INFRARED_VAULT";
|
|
21
23
|
AdapterType2["KODIAK_ISLAND_GATEWAY"] = "KODIAK_ISLAND_GATEWAY";
|
|
22
24
|
AdapterType2["LIDO_V1"] = "LIDO_V1";
|
|
@@ -33,6 +35,7 @@ var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
|
|
|
33
35
|
AdapterType2["TRADERJOE_ROUTER"] = "TRADERJOE_ROUTER";
|
|
34
36
|
AdapterType2["UNISWAP_V2_ROUTER"] = "UNISWAP_V2_ROUTER";
|
|
35
37
|
AdapterType2["UNISWAP_V3_ROUTER"] = "UNISWAP_V3_ROUTER";
|
|
38
|
+
AdapterType2["UNISWAP_V4_GATEWAY"] = "UNISWAP_V4_GATEWAY";
|
|
36
39
|
AdapterType2["UPSHIFT_VAULT"] = "UPSHIFT_VAULT";
|
|
37
40
|
AdapterType2["VELODROME_V2_ROUTER"] = "VELODROME_V2_ROUTER";
|
|
38
41
|
AdapterType2["YEARN_V2"] = "YEARN_V2";
|