@gearbox-protocol/sdk 3.0.0-next.264 → 3.0.0-next.266

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 (34) hide show
  1. package/contracts/index.sol +1 -0
  2. package/lib/apy/defiLamaAPY.js +1 -0
  3. package/lib/core/endpoint.d.ts +1 -0
  4. package/lib/core/endpoint.js +3 -0
  5. package/lib/pathfinder/pathfinder.d.ts +13 -1
  6. package/lib/pathfinder/pathfinder.js +74 -11
  7. package/lib/types/IPToken.d.ts +21 -0
  8. package/lib/types/{IPendleSY.js → IPToken.js} +11 -4
  9. package/lib/types/IPendleMarket.d.ts +3 -27
  10. package/lib/types/IPendleMarket.js +3 -19
  11. package/lib/types/IPendleRouter.d.ts +536 -0
  12. package/lib/types/IPendleRouter.js +370 -0
  13. package/lib/types/IPendleRouterAdapter.d.ts +831 -0
  14. package/lib/types/IPendleRouterAdapter.js +572 -0
  15. package/lib/types/IPendleRouterAdapterEvents.d.ts +26 -0
  16. package/lib/types/IPendleRouterAdapterEvents.js +39 -0
  17. package/lib/types/IPendleRouterAdapterExceptions.d.ts +9 -0
  18. package/lib/types/IPendleRouterAdapterExceptions.js +10 -0
  19. package/lib/types/{IPendleYT.d.ts → IRouterComponent.d.ts} +8 -8
  20. package/lib/types/{IPendleYT.js → IRouterComponent.js} +8 -8
  21. package/lib/types/IRouterStatic.d.ts +128 -0
  22. package/lib/types/IRouterStatic.js +68 -0
  23. package/lib/types/ISwapper.d.ts +100 -0
  24. package/lib/types/ISwapper.js +75 -0
  25. package/lib/types/IYToken.d.ts +21 -0
  26. package/lib/types/IYToken.js +22 -0
  27. package/lib/types/PendleSwapper.d.ts +182 -0
  28. package/lib/types/PendleSwapper.js +130 -0
  29. package/lib/types/RouterComponentConfigurator.d.ts +61 -0
  30. package/lib/types/RouterComponentConfigurator.js +48 -0
  31. package/lib/types/index.d.ts +11 -2
  32. package/lib/types/index.js +11 -2
  33. package/package.json +6 -6
  34. package/lib/types/IPendleSY.d.ts +0 -11
@@ -1,27 +1,27 @@
1
- export declare const iPendleYtAbi: readonly [{
1
+ export declare const iRouterComponentAbi: readonly [{
2
2
  readonly type: "function";
3
3
  readonly inputs: readonly [];
4
- readonly name: "doCacheIndexSameBlock";
4
+ readonly name: "getComponentId";
5
5
  readonly outputs: readonly [{
6
6
  readonly name: "";
7
- readonly internalType: "bool";
8
- readonly type: "bool";
7
+ readonly internalType: "uint8";
8
+ readonly type: "uint8";
9
9
  }];
10
10
  readonly stateMutability: "view";
11
11
  }, {
12
12
  readonly type: "function";
13
13
  readonly inputs: readonly [];
14
- readonly name: "pyIndexLastUpdatedBlock";
14
+ readonly name: "needsComponentUpdate";
15
15
  readonly outputs: readonly [{
16
16
  readonly name: "";
17
- readonly internalType: "uint256";
18
- readonly type: "uint256";
17
+ readonly internalType: "bool";
18
+ readonly type: "bool";
19
19
  }];
20
20
  readonly stateMutability: "view";
21
21
  }, {
22
22
  readonly type: "function";
23
23
  readonly inputs: readonly [];
24
- readonly name: "pyIndexStored";
24
+ readonly name: "version";
25
25
  readonly outputs: readonly [{
26
26
  readonly name: "";
27
27
  readonly internalType: "uint256";
@@ -1,28 +1,28 @@
1
1
  "use strict";
2
2
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3
- // IPendleYT
3
+ // IRouterComponent
4
4
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.iPendleYtAbi = void 0;
7
- exports.iPendleYtAbi = [
6
+ exports.iRouterComponentAbi = void 0;
7
+ exports.iRouterComponentAbi = [
8
8
  {
9
9
  type: "function",
10
10
  inputs: [],
11
- name: "doCacheIndexSameBlock",
12
- outputs: [{ name: "", internalType: "bool", type: "bool" }],
11
+ name: "getComponentId",
12
+ outputs: [{ name: "", internalType: "uint8", type: "uint8" }],
13
13
  stateMutability: "view",
14
14
  },
15
15
  {
16
16
  type: "function",
17
17
  inputs: [],
18
- name: "pyIndexLastUpdatedBlock",
19
- outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
18
+ name: "needsComponentUpdate",
19
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
20
20
  stateMutability: "view",
21
21
  },
22
22
  {
23
23
  type: "function",
24
24
  inputs: [],
25
- name: "pyIndexStored",
25
+ name: "version",
26
26
  outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
27
27
  stateMutability: "view",
28
28
  },
@@ -0,0 +1,128 @@
1
+ export declare const iRouterStaticAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly inputs: readonly [{
4
+ readonly name: "YT";
5
+ readonly internalType: "address";
6
+ readonly type: "address";
7
+ }, {
8
+ readonly name: "netPYToRedeem";
9
+ readonly internalType: "uint256";
10
+ readonly type: "uint256";
11
+ }, {
12
+ readonly name: "tokenOut";
13
+ readonly internalType: "address";
14
+ readonly type: "address";
15
+ }];
16
+ readonly name: "redeemPyToTokenStatic";
17
+ readonly outputs: readonly [{
18
+ readonly name: "netTokenOut";
19
+ readonly internalType: "uint256";
20
+ readonly type: "uint256";
21
+ }];
22
+ readonly stateMutability: "view";
23
+ }, {
24
+ readonly type: "function";
25
+ readonly inputs: readonly [{
26
+ readonly name: "market";
27
+ readonly internalType: "address";
28
+ readonly type: "address";
29
+ }, {
30
+ readonly name: "exactPtIn";
31
+ readonly internalType: "uint256";
32
+ readonly type: "uint256";
33
+ }, {
34
+ readonly name: "tokenOut";
35
+ readonly internalType: "address";
36
+ readonly type: "address";
37
+ }];
38
+ readonly name: "swapExactPtForTokenStatic";
39
+ readonly outputs: readonly [{
40
+ readonly name: "netTokenOut";
41
+ readonly internalType: "uint256";
42
+ readonly type: "uint256";
43
+ }, {
44
+ readonly name: "netSyToRedeem";
45
+ readonly internalType: "uint256";
46
+ readonly type: "uint256";
47
+ }, {
48
+ readonly name: "netSyFee";
49
+ readonly internalType: "uint256";
50
+ readonly type: "uint256";
51
+ }, {
52
+ readonly name: "priceImpact";
53
+ readonly internalType: "uint256";
54
+ readonly type: "uint256";
55
+ }, {
56
+ readonly name: "exchangeRateAfter";
57
+ readonly internalType: "uint256";
58
+ readonly type: "uint256";
59
+ }];
60
+ readonly stateMutability: "view";
61
+ }, {
62
+ readonly type: "function";
63
+ readonly inputs: readonly [{
64
+ readonly name: "market";
65
+ readonly internalType: "address";
66
+ readonly type: "address";
67
+ }, {
68
+ readonly name: "tokenIn";
69
+ readonly internalType: "address";
70
+ readonly type: "address";
71
+ }, {
72
+ readonly name: "amountTokenIn";
73
+ readonly internalType: "uint256";
74
+ readonly type: "uint256";
75
+ }, {
76
+ readonly name: "slippage";
77
+ readonly internalType: "uint256";
78
+ readonly type: "uint256";
79
+ }];
80
+ readonly name: "swapExactTokenForPtStaticAndGenerateApproxParams";
81
+ readonly outputs: readonly [{
82
+ readonly name: "netPtOut";
83
+ readonly internalType: "uint256";
84
+ readonly type: "uint256";
85
+ }, {
86
+ readonly name: "netSyMinted";
87
+ readonly internalType: "uint256";
88
+ readonly type: "uint256";
89
+ }, {
90
+ readonly name: "netSyFee";
91
+ readonly internalType: "uint256";
92
+ readonly type: "uint256";
93
+ }, {
94
+ readonly name: "priceImpact";
95
+ readonly internalType: "uint256";
96
+ readonly type: "uint256";
97
+ }, {
98
+ readonly name: "exchangeRateAfter";
99
+ readonly internalType: "uint256";
100
+ readonly type: "uint256";
101
+ }, {
102
+ readonly name: "approxParams";
103
+ readonly internalType: "struct ApproxParams";
104
+ readonly type: "tuple";
105
+ readonly components: readonly [{
106
+ readonly name: "guessMin";
107
+ readonly internalType: "uint256";
108
+ readonly type: "uint256";
109
+ }, {
110
+ readonly name: "guessMax";
111
+ readonly internalType: "uint256";
112
+ readonly type: "uint256";
113
+ }, {
114
+ readonly name: "guessOffchain";
115
+ readonly internalType: "uint256";
116
+ readonly type: "uint256";
117
+ }, {
118
+ readonly name: "maxIteration";
119
+ readonly internalType: "uint256";
120
+ readonly type: "uint256";
121
+ }, {
122
+ readonly name: "eps";
123
+ readonly internalType: "uint256";
124
+ readonly type: "uint256";
125
+ }];
126
+ }];
127
+ readonly stateMutability: "view";
128
+ }];
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3
+ // IRouterStatic
4
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.iRouterStaticAbi = void 0;
7
+ exports.iRouterStaticAbi = [
8
+ {
9
+ type: "function",
10
+ inputs: [
11
+ { name: "YT", internalType: "address", type: "address" },
12
+ { name: "netPYToRedeem", internalType: "uint256", type: "uint256" },
13
+ { name: "tokenOut", internalType: "address", type: "address" },
14
+ ],
15
+ name: "redeemPyToTokenStatic",
16
+ outputs: [
17
+ { name: "netTokenOut", internalType: "uint256", type: "uint256" },
18
+ ],
19
+ stateMutability: "view",
20
+ },
21
+ {
22
+ type: "function",
23
+ inputs: [
24
+ { name: "market", internalType: "address", type: "address" },
25
+ { name: "exactPtIn", internalType: "uint256", type: "uint256" },
26
+ { name: "tokenOut", internalType: "address", type: "address" },
27
+ ],
28
+ name: "swapExactPtForTokenStatic",
29
+ outputs: [
30
+ { name: "netTokenOut", internalType: "uint256", type: "uint256" },
31
+ { name: "netSyToRedeem", internalType: "uint256", type: "uint256" },
32
+ { name: "netSyFee", internalType: "uint256", type: "uint256" },
33
+ { name: "priceImpact", internalType: "uint256", type: "uint256" },
34
+ { name: "exchangeRateAfter", internalType: "uint256", type: "uint256" },
35
+ ],
36
+ stateMutability: "view",
37
+ },
38
+ {
39
+ type: "function",
40
+ inputs: [
41
+ { name: "market", internalType: "address", type: "address" },
42
+ { name: "tokenIn", internalType: "address", type: "address" },
43
+ { name: "amountTokenIn", internalType: "uint256", type: "uint256" },
44
+ { name: "slippage", internalType: "uint256", type: "uint256" },
45
+ ],
46
+ name: "swapExactTokenForPtStaticAndGenerateApproxParams",
47
+ outputs: [
48
+ { name: "netPtOut", internalType: "uint256", type: "uint256" },
49
+ { name: "netSyMinted", internalType: "uint256", type: "uint256" },
50
+ { name: "netSyFee", internalType: "uint256", type: "uint256" },
51
+ { name: "priceImpact", internalType: "uint256", type: "uint256" },
52
+ { name: "exchangeRateAfter", internalType: "uint256", type: "uint256" },
53
+ {
54
+ name: "approxParams",
55
+ internalType: "struct ApproxParams",
56
+ type: "tuple",
57
+ components: [
58
+ { name: "guessMin", internalType: "uint256", type: "uint256" },
59
+ { name: "guessMax", internalType: "uint256", type: "uint256" },
60
+ { name: "guessOffchain", internalType: "uint256", type: "uint256" },
61
+ { name: "maxIteration", internalType: "uint256", type: "uint256" },
62
+ { name: "eps", internalType: "uint256", type: "uint256" },
63
+ ],
64
+ },
65
+ ],
66
+ stateMutability: "view",
67
+ },
68
+ ];
@@ -0,0 +1,100 @@
1
+ export declare const iSwapperAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly inputs: readonly [{
4
+ readonly name: "swapTask";
5
+ readonly internalType: "struct SwapTask";
6
+ readonly type: "tuple";
7
+ readonly components: readonly [{
8
+ readonly name: "swapOperation";
9
+ readonly internalType: "enum SwapOperation";
10
+ readonly type: "uint8";
11
+ }, {
12
+ readonly name: "creditAccount";
13
+ readonly internalType: "address";
14
+ readonly type: "address";
15
+ }, {
16
+ readonly name: "tokenIn";
17
+ readonly internalType: "address";
18
+ readonly type: "address";
19
+ }, {
20
+ readonly name: "tokenOut";
21
+ readonly internalType: "address";
22
+ readonly type: "address";
23
+ }, {
24
+ readonly name: "connectors";
25
+ readonly internalType: "address[]";
26
+ readonly type: "address[]";
27
+ }, {
28
+ readonly name: "amount";
29
+ readonly internalType: "uint256";
30
+ readonly type: "uint256";
31
+ }, {
32
+ readonly name: "leftoverAmount";
33
+ readonly internalType: "uint256";
34
+ readonly type: "uint256";
35
+ }];
36
+ }, {
37
+ readonly name: "adapter";
38
+ readonly internalType: "address";
39
+ readonly type: "address";
40
+ }];
41
+ readonly name: "getBestDirectPairSwap";
42
+ readonly outputs: readonly [{
43
+ readonly name: "quote";
44
+ readonly internalType: "struct SwapQuote";
45
+ readonly type: "tuple";
46
+ readonly components: readonly [{
47
+ readonly name: "multiCall";
48
+ readonly internalType: "struct MultiCall";
49
+ readonly type: "tuple";
50
+ readonly components: readonly [{
51
+ readonly name: "target";
52
+ readonly internalType: "address";
53
+ readonly type: "address";
54
+ }, {
55
+ readonly name: "callData";
56
+ readonly internalType: "bytes";
57
+ readonly type: "bytes";
58
+ }];
59
+ }, {
60
+ readonly name: "amount";
61
+ readonly internalType: "uint256";
62
+ readonly type: "uint256";
63
+ }, {
64
+ readonly name: "found";
65
+ readonly internalType: "bool";
66
+ readonly type: "bool";
67
+ }];
68
+ }];
69
+ readonly stateMutability: "nonpayable";
70
+ }, {
71
+ readonly type: "function";
72
+ readonly inputs: readonly [];
73
+ readonly name: "getComponentId";
74
+ readonly outputs: readonly [{
75
+ readonly name: "";
76
+ readonly internalType: "uint8";
77
+ readonly type: "uint8";
78
+ }];
79
+ readonly stateMutability: "view";
80
+ }, {
81
+ readonly type: "function";
82
+ readonly inputs: readonly [];
83
+ readonly name: "needsComponentUpdate";
84
+ readonly outputs: readonly [{
85
+ readonly name: "";
86
+ readonly internalType: "bool";
87
+ readonly type: "bool";
88
+ }];
89
+ readonly stateMutability: "view";
90
+ }, {
91
+ readonly type: "function";
92
+ readonly inputs: readonly [];
93
+ readonly name: "version";
94
+ readonly outputs: readonly [{
95
+ readonly name: "";
96
+ readonly internalType: "uint256";
97
+ readonly type: "uint256";
98
+ }];
99
+ readonly stateMutability: "view";
100
+ }];
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3
+ // ISwapper
4
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.iSwapperAbi = void 0;
7
+ exports.iSwapperAbi = [
8
+ {
9
+ type: "function",
10
+ inputs: [
11
+ {
12
+ name: "swapTask",
13
+ internalType: "struct SwapTask",
14
+ type: "tuple",
15
+ components: [
16
+ {
17
+ name: "swapOperation",
18
+ internalType: "enum SwapOperation",
19
+ type: "uint8",
20
+ },
21
+ { name: "creditAccount", internalType: "address", type: "address" },
22
+ { name: "tokenIn", internalType: "address", type: "address" },
23
+ { name: "tokenOut", internalType: "address", type: "address" },
24
+ { name: "connectors", internalType: "address[]", type: "address[]" },
25
+ { name: "amount", internalType: "uint256", type: "uint256" },
26
+ { name: "leftoverAmount", internalType: "uint256", type: "uint256" },
27
+ ],
28
+ },
29
+ { name: "adapter", internalType: "address", type: "address" },
30
+ ],
31
+ name: "getBestDirectPairSwap",
32
+ outputs: [
33
+ {
34
+ name: "quote",
35
+ internalType: "struct SwapQuote",
36
+ type: "tuple",
37
+ components: [
38
+ {
39
+ name: "multiCall",
40
+ internalType: "struct MultiCall",
41
+ type: "tuple",
42
+ components: [
43
+ { name: "target", internalType: "address", type: "address" },
44
+ { name: "callData", internalType: "bytes", type: "bytes" },
45
+ ],
46
+ },
47
+ { name: "amount", internalType: "uint256", type: "uint256" },
48
+ { name: "found", internalType: "bool", type: "bool" },
49
+ ],
50
+ },
51
+ ],
52
+ stateMutability: "nonpayable",
53
+ },
54
+ {
55
+ type: "function",
56
+ inputs: [],
57
+ name: "getComponentId",
58
+ outputs: [{ name: "", internalType: "uint8", type: "uint8" }],
59
+ stateMutability: "view",
60
+ },
61
+ {
62
+ type: "function",
63
+ inputs: [],
64
+ name: "needsComponentUpdate",
65
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
66
+ stateMutability: "view",
67
+ },
68
+ {
69
+ type: "function",
70
+ inputs: [],
71
+ name: "version",
72
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
73
+ stateMutability: "view",
74
+ },
75
+ ];
@@ -0,0 +1,21 @@
1
+ export declare const iyTokenAbi: readonly [{
2
+ readonly type: "function";
3
+ readonly inputs: readonly [];
4
+ readonly name: "PT";
5
+ readonly outputs: readonly [{
6
+ readonly name: "";
7
+ readonly internalType: "address";
8
+ readonly type: "address";
9
+ }];
10
+ readonly stateMutability: "view";
11
+ }, {
12
+ readonly type: "function";
13
+ readonly inputs: readonly [];
14
+ readonly name: "expiry";
15
+ readonly outputs: readonly [{
16
+ readonly name: "";
17
+ readonly internalType: "uint256";
18
+ readonly type: "uint256";
19
+ }];
20
+ readonly stateMutability: "view";
21
+ }];
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3
+ // IYToken
4
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.iyTokenAbi = void 0;
7
+ exports.iyTokenAbi = [
8
+ {
9
+ type: "function",
10
+ inputs: [],
11
+ name: "PT",
12
+ outputs: [{ name: "", internalType: "address", type: "address" }],
13
+ stateMutability: "view",
14
+ },
15
+ {
16
+ type: "function",
17
+ inputs: [],
18
+ name: "expiry",
19
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
20
+ stateMutability: "view",
21
+ },
22
+ ];