@gearbox-protocol/sdk 8.1.0 → 8.1.2
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/dev/AccountOpener.js +14 -5
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/convex.js +2 -8
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/token.js +0 -29
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/yearn.js +0 -3
- package/dist/cjs/sdk/sdk-legacy/index.js +0 -2
- package/dist/esm/dev/AccountOpener.js +13 -5
- package/dist/esm/sdk/sdk-gov-legacy/tokens/convex.js +1 -5
- package/dist/esm/sdk/sdk-gov-legacy/tokens/token.js +0 -27
- package/dist/esm/sdk/sdk-gov-legacy/tokens/yearn.js +0 -2
- package/dist/esm/sdk/sdk-legacy/index.js +0 -1
- package/dist/types/dev/AccountOpener.d.ts +7 -2
- package/dist/types/sdk/sdk-gov-legacy/tokens/convex.d.ts +0 -2
- package/dist/types/sdk/sdk-gov-legacy/tokens/token.d.ts +15 -18
- package/dist/types/sdk/sdk-gov-legacy/tokens/yearn.d.ts +0 -1
- package/dist/types/sdk/sdk-legacy/core/creditAccount.d.ts +1 -2
- package/dist/types/sdk/sdk-legacy/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/sdk/sdk-legacy/apy/index.js +0 -86
- package/dist/esm/sdk/sdk-legacy/apy/index.js +0 -60
- package/dist/types/sdk/sdk-legacy/apy/index.d.ts +0 -14
|
@@ -18,7 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var AccountOpener_exports = {};
|
|
20
20
|
__export(AccountOpener_exports, {
|
|
21
|
-
AccountOpener: () => AccountOpener
|
|
21
|
+
AccountOpener: () => AccountOpener,
|
|
22
|
+
OpenTxRevertedError: () => OpenTxRevertedError
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(AccountOpener_exports);
|
|
24
25
|
var import_viem = require("viem");
|
|
@@ -28,6 +29,13 @@ var import_v300 = require("../abi/v300.js");
|
|
|
28
29
|
var import_sdk = require("../sdk/index.js");
|
|
29
30
|
var import_abi = require("./abi.js");
|
|
30
31
|
var import_createAnvilClient = require("./createAnvilClient.js");
|
|
32
|
+
class OpenTxRevertedError extends import_viem.BaseError {
|
|
33
|
+
txHash;
|
|
34
|
+
constructor(txHash) {
|
|
35
|
+
super("open credit account tx reverted");
|
|
36
|
+
this.txHash = txHash;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
31
39
|
class AccountOpener extends import_sdk.SDKConstruct {
|
|
32
40
|
#service;
|
|
33
41
|
#anvil;
|
|
@@ -95,7 +103,7 @@ class AccountOpener extends import_sdk.SDKConstruct {
|
|
|
95
103
|
} catch (e) {
|
|
96
104
|
results.push({
|
|
97
105
|
input: target,
|
|
98
|
-
error:
|
|
106
|
+
error: e
|
|
99
107
|
});
|
|
100
108
|
}
|
|
101
109
|
}
|
|
@@ -123,7 +131,7 @@ class AccountOpener extends import_sdk.SDKConstruct {
|
|
|
123
131
|
} catch (e) {
|
|
124
132
|
return {
|
|
125
133
|
input,
|
|
126
|
-
error:
|
|
134
|
+
error: e,
|
|
127
135
|
rawTx: tx
|
|
128
136
|
};
|
|
129
137
|
}
|
|
@@ -131,7 +139,7 @@ class AccountOpener extends import_sdk.SDKConstruct {
|
|
|
131
139
|
if (receipt.status === "reverted") {
|
|
132
140
|
return {
|
|
133
141
|
input,
|
|
134
|
-
error:
|
|
142
|
+
error: new OpenTxRevertedError(hash),
|
|
135
143
|
txHash: hash,
|
|
136
144
|
rawTx: tx
|
|
137
145
|
};
|
|
@@ -590,5 +598,6 @@ class AccountOpener extends import_sdk.SDKConstruct {
|
|
|
590
598
|
}
|
|
591
599
|
// Annotate the CommonJS export names for ESM import in node:
|
|
592
600
|
0 && (module.exports = {
|
|
593
|
-
AccountOpener
|
|
601
|
+
AccountOpener,
|
|
602
|
+
OpenTxRevertedError
|
|
594
603
|
});
|
|
@@ -22,9 +22,7 @@ __export(convex_exports, {
|
|
|
22
22
|
convexLpTokens: () => convexLpTokens,
|
|
23
23
|
convexStakedPhantomTokens: () => convexStakedPhantomTokens,
|
|
24
24
|
convexTokens: () => convexTokens,
|
|
25
|
-
|
|
26
|
-
isConvexStakedPhantomToken: () => isConvexStakedPhantomToken,
|
|
27
|
-
isConvexToken: () => isConvexToken
|
|
25
|
+
isConvexStakedPhantomToken: () => isConvexStakedPhantomToken
|
|
28
26
|
});
|
|
29
27
|
module.exports = __toCommonJS(convex_exports);
|
|
30
28
|
var import_tokenType = require("./tokenType.js");
|
|
@@ -445,8 +443,6 @@ const convexTokens = {
|
|
|
445
443
|
...convexStakedPhantomTokens,
|
|
446
444
|
...convexL2StakedTokens
|
|
447
445
|
};
|
|
448
|
-
const isConvexToken = (t) => typeof t === "string" && !!convexTokens[t];
|
|
449
|
-
const isConvexLPToken = (t) => typeof t === "string" && !!convexLpTokens[t];
|
|
450
446
|
const isConvexStakedPhantomToken = (t) => typeof t === "string" && !!convexStakedPhantomTokens[t];
|
|
451
447
|
// Annotate the CommonJS export names for ESM import in node:
|
|
452
448
|
0 && (module.exports = {
|
|
@@ -454,7 +450,5 @@ const isConvexStakedPhantomToken = (t) => typeof t === "string" && !!convexStake
|
|
|
454
450
|
convexLpTokens,
|
|
455
451
|
convexStakedPhantomTokens,
|
|
456
452
|
convexTokens,
|
|
457
|
-
|
|
458
|
-
isConvexStakedPhantomToken,
|
|
459
|
-
isConvexToken
|
|
453
|
+
isConvexStakedPhantomToken
|
|
460
454
|
});
|
|
@@ -20,38 +20,12 @@ var token_exports = {};
|
|
|
20
20
|
__export(token_exports, {
|
|
21
21
|
ETH_ADDRESS: () => ETH_ADDRESS,
|
|
22
22
|
getTokenSymbol: () => getTokenSymbol,
|
|
23
|
-
isLPToken: () => isLPToken,
|
|
24
|
-
lpTokens: () => lpTokens,
|
|
25
23
|
tickerInfoTokensByNetwork: () => tickerInfoTokensByNetwork,
|
|
26
24
|
tokenDataByNetwork: () => tokenDataByNetwork,
|
|
27
25
|
tokenSymbolByAddress: () => tokenSymbolByAddress
|
|
28
26
|
});
|
|
29
27
|
module.exports = __toCommonJS(token_exports);
|
|
30
28
|
var import_constants = require("../../constants/index.js");
|
|
31
|
-
var import_aave = require("./aave.js");
|
|
32
|
-
var import_aura = require("./aura.js");
|
|
33
|
-
var import_balancer = require("./balancer.js");
|
|
34
|
-
var import_compound = require("./compound.js");
|
|
35
|
-
var import_convex = require("./convex.js");
|
|
36
|
-
var import_curveLP = require("./curveLP.js");
|
|
37
|
-
var import_erc4626 = require("./erc4626.js");
|
|
38
|
-
var import_stakingRewards = require("./stakingRewards.js");
|
|
39
|
-
var import_yearn = require("./yearn.js");
|
|
40
|
-
var import_zircuit = require("./zircuit.js");
|
|
41
|
-
const lpTokens = {
|
|
42
|
-
...import_curveLP.curveTokens,
|
|
43
|
-
...import_convex.convexTokens,
|
|
44
|
-
...import_yearn.yearnTokens,
|
|
45
|
-
...import_balancer.balancerLpTokens,
|
|
46
|
-
...import_aave.aaveV2Tokens,
|
|
47
|
-
...import_aave.wrappedAaveV2Tokens,
|
|
48
|
-
...import_compound.compoundV2Tokens,
|
|
49
|
-
...import_erc4626.erc4626Tokens,
|
|
50
|
-
...import_aura.auraLpTokens,
|
|
51
|
-
...import_aura.auraStakedTokens,
|
|
52
|
-
...import_zircuit.zircuitStakedPhantomTokens,
|
|
53
|
-
...import_stakingRewards.stakingRewardsPhantomTokens
|
|
54
|
-
};
|
|
55
29
|
const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
56
30
|
const tokenDataByNetwork = {
|
|
57
31
|
//
|
|
@@ -2072,13 +2046,10 @@ const tokenSymbolByAddress = Object.entries(tokenDataByNetwork).reduce(
|
|
|
2072
2046
|
function getTokenSymbol(address) {
|
|
2073
2047
|
return tokenSymbolByAddress[address.toLowerCase()];
|
|
2074
2048
|
}
|
|
2075
|
-
const isLPToken = (t) => typeof t === "string" && !!lpTokens[t];
|
|
2076
2049
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2077
2050
|
0 && (module.exports = {
|
|
2078
2051
|
ETH_ADDRESS,
|
|
2079
2052
|
getTokenSymbol,
|
|
2080
|
-
isLPToken,
|
|
2081
|
-
lpTokens,
|
|
2082
2053
|
tickerInfoTokensByNetwork,
|
|
2083
2054
|
tokenDataByNetwork,
|
|
2084
2055
|
tokenSymbolByAddress
|
|
@@ -18,7 +18,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var yearn_exports = {};
|
|
20
20
|
__export(yearn_exports, {
|
|
21
|
-
isYearnLPToken: () => isYearnLPToken,
|
|
22
21
|
yearnTokens: () => yearnTokens
|
|
23
22
|
});
|
|
24
23
|
module.exports = __toCommonJS(yearn_exports);
|
|
@@ -90,9 +89,7 @@ const yearnTokens = {
|
|
|
90
89
|
vault: "YEARN_CURVE_FRAX_VAULT"
|
|
91
90
|
}
|
|
92
91
|
};
|
|
93
|
-
const isYearnLPToken = (t) => typeof t === "string" && !!yearnTokens[t];
|
|
94
92
|
// Annotate the CommonJS export names for ESM import in node:
|
|
95
93
|
0 && (module.exports = {
|
|
96
|
-
isYearnLPToken,
|
|
97
94
|
yearnTokens
|
|
98
95
|
});
|
|
@@ -15,7 +15,6 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
15
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
16
|
var sdk_legacy_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(sdk_legacy_exports);
|
|
18
|
-
__reExport(sdk_legacy_exports, require("./apy/index.js"), module.exports);
|
|
19
18
|
__reExport(sdk_legacy_exports, require("./core/assets.js"), module.exports);
|
|
20
19
|
__reExport(sdk_legacy_exports, require("./core/creditAccount.js"), module.exports);
|
|
21
20
|
__reExport(sdk_legacy_exports, require("./core/creditManager.js"), module.exports);
|
|
@@ -36,7 +35,6 @@ __reExport(sdk_legacy_exports, require("./tokens/tokenData.js"), module.exports)
|
|
|
36
35
|
__reExport(sdk_legacy_exports, require("./utils/index.js"), module.exports);
|
|
37
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
37
|
0 && (module.exports = {
|
|
39
|
-
...require("./apy/index.js"),
|
|
40
38
|
...require("./core/assets.js"),
|
|
41
39
|
...require("./core/creditAccount.js"),
|
|
42
40
|
...require("./core/creditManager.js"),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAddress, parseEther, parseEventLogs } from "viem";
|
|
1
|
+
import { BaseError, isAddress, parseEther, parseEventLogs } from "viem";
|
|
2
2
|
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
|
|
3
3
|
import { ierc20Abi } from "../abi/iERC20.js";
|
|
4
4
|
import { iCreditFacadeV300Abi, iPoolV300Abi } from "../abi/v300.js";
|
|
@@ -14,6 +14,13 @@ import {
|
|
|
14
14
|
} from "../sdk/index.js";
|
|
15
15
|
import { iDegenNftv2Abi } from "./abi.js";
|
|
16
16
|
import { createAnvilClient } from "./createAnvilClient.js";
|
|
17
|
+
class OpenTxRevertedError extends BaseError {
|
|
18
|
+
txHash;
|
|
19
|
+
constructor(txHash) {
|
|
20
|
+
super("open credit account tx reverted");
|
|
21
|
+
this.txHash = txHash;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
17
24
|
class AccountOpener extends SDKConstruct {
|
|
18
25
|
#service;
|
|
19
26
|
#anvil;
|
|
@@ -81,7 +88,7 @@ class AccountOpener extends SDKConstruct {
|
|
|
81
88
|
} catch (e) {
|
|
82
89
|
results.push({
|
|
83
90
|
input: target,
|
|
84
|
-
error:
|
|
91
|
+
error: e
|
|
85
92
|
});
|
|
86
93
|
}
|
|
87
94
|
}
|
|
@@ -109,7 +116,7 @@ class AccountOpener extends SDKConstruct {
|
|
|
109
116
|
} catch (e) {
|
|
110
117
|
return {
|
|
111
118
|
input,
|
|
112
|
-
error:
|
|
119
|
+
error: e,
|
|
113
120
|
rawTx: tx
|
|
114
121
|
};
|
|
115
122
|
}
|
|
@@ -117,7 +124,7 @@ class AccountOpener extends SDKConstruct {
|
|
|
117
124
|
if (receipt.status === "reverted") {
|
|
118
125
|
return {
|
|
119
126
|
input,
|
|
120
|
-
error:
|
|
127
|
+
error: new OpenTxRevertedError(hash),
|
|
121
128
|
txHash: hash,
|
|
122
129
|
rawTx: tx
|
|
123
130
|
};
|
|
@@ -575,5 +582,6 @@ class AccountOpener extends SDKConstruct {
|
|
|
575
582
|
}
|
|
576
583
|
}
|
|
577
584
|
export {
|
|
578
|
-
AccountOpener
|
|
585
|
+
AccountOpener,
|
|
586
|
+
OpenTxRevertedError
|
|
579
587
|
};
|
|
@@ -416,15 +416,11 @@ const convexTokens = {
|
|
|
416
416
|
...convexStakedPhantomTokens,
|
|
417
417
|
...convexL2StakedTokens
|
|
418
418
|
};
|
|
419
|
-
const isConvexToken = (t) => typeof t === "string" && !!convexTokens[t];
|
|
420
|
-
const isConvexLPToken = (t) => typeof t === "string" && !!convexLpTokens[t];
|
|
421
419
|
const isConvexStakedPhantomToken = (t) => typeof t === "string" && !!convexStakedPhantomTokens[t];
|
|
422
420
|
export {
|
|
423
421
|
convexL2StakedTokens,
|
|
424
422
|
convexLpTokens,
|
|
425
423
|
convexStakedPhantomTokens,
|
|
426
424
|
convexTokens,
|
|
427
|
-
|
|
428
|
-
isConvexStakedPhantomToken,
|
|
429
|
-
isConvexToken
|
|
425
|
+
isConvexStakedPhantomToken
|
|
430
426
|
};
|
|
@@ -1,28 +1,4 @@
|
|
|
1
1
|
import { NOT_DEPLOYED } from "../../constants/index.js";
|
|
2
|
-
import { aaveV2Tokens, wrappedAaveV2Tokens } from "./aave.js";
|
|
3
|
-
import { auraLpTokens, auraStakedTokens } from "./aura.js";
|
|
4
|
-
import { balancerLpTokens } from "./balancer.js";
|
|
5
|
-
import { compoundV2Tokens } from "./compound.js";
|
|
6
|
-
import { convexTokens } from "./convex.js";
|
|
7
|
-
import { curveTokens } from "./curveLP.js";
|
|
8
|
-
import { erc4626Tokens } from "./erc4626.js";
|
|
9
|
-
import { stakingRewardsPhantomTokens } from "./stakingRewards.js";
|
|
10
|
-
import { yearnTokens } from "./yearn.js";
|
|
11
|
-
import { zircuitStakedPhantomTokens } from "./zircuit.js";
|
|
12
|
-
const lpTokens = {
|
|
13
|
-
...curveTokens,
|
|
14
|
-
...convexTokens,
|
|
15
|
-
...yearnTokens,
|
|
16
|
-
...balancerLpTokens,
|
|
17
|
-
...aaveV2Tokens,
|
|
18
|
-
...wrappedAaveV2Tokens,
|
|
19
|
-
...compoundV2Tokens,
|
|
20
|
-
...erc4626Tokens,
|
|
21
|
-
...auraLpTokens,
|
|
22
|
-
...auraStakedTokens,
|
|
23
|
-
...zircuitStakedPhantomTokens,
|
|
24
|
-
...stakingRewardsPhantomTokens
|
|
25
|
-
};
|
|
26
2
|
const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
27
3
|
const tokenDataByNetwork = {
|
|
28
4
|
//
|
|
@@ -2043,12 +2019,9 @@ const tokenSymbolByAddress = Object.entries(tokenDataByNetwork).reduce(
|
|
|
2043
2019
|
function getTokenSymbol(address) {
|
|
2044
2020
|
return tokenSymbolByAddress[address.toLowerCase()];
|
|
2045
2021
|
}
|
|
2046
|
-
const isLPToken = (t) => typeof t === "string" && !!lpTokens[t];
|
|
2047
2022
|
export {
|
|
2048
2023
|
ETH_ADDRESS,
|
|
2049
2024
|
getTokenSymbol,
|
|
2050
|
-
isLPToken,
|
|
2051
|
-
lpTokens,
|
|
2052
2025
|
tickerInfoTokensByNetwork,
|
|
2053
2026
|
tokenDataByNetwork,
|
|
2054
2027
|
tokenSymbolByAddress
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type { Address, PrivateKeyAccount } from "viem";
|
|
1
|
+
import type { Address, Hash, PrivateKeyAccount } from "viem";
|
|
2
|
+
import { BaseError } from "viem";
|
|
2
3
|
import type { CreditAccountData, CreditAccountsService, RawTx } from "../sdk/index.js";
|
|
3
4
|
import { SDKConstruct } from "../sdk/index.js";
|
|
5
|
+
export declare class OpenTxRevertedError extends BaseError {
|
|
6
|
+
readonly txHash: Hash;
|
|
7
|
+
constructor(txHash: Hash);
|
|
8
|
+
}
|
|
4
9
|
export interface AccountOpenerOptions {
|
|
5
10
|
faucet?: Address;
|
|
6
11
|
borrower?: PrivateKeyAccount;
|
|
@@ -25,7 +30,7 @@ export interface TargetAccount {
|
|
|
25
30
|
}
|
|
26
31
|
export interface OpenAccountResult {
|
|
27
32
|
input: TargetAccount;
|
|
28
|
-
error?:
|
|
33
|
+
error?: Error;
|
|
29
34
|
txHash?: string;
|
|
30
35
|
rawTx?: RawTx;
|
|
31
36
|
account?: CreditAccountData;
|
|
@@ -29,7 +29,5 @@ export declare const convexLpTokens: Record<ConvexLPToken, ConvexLPTokenData>;
|
|
|
29
29
|
export declare const convexStakedPhantomTokens: Record<ConvexStakedPhantomToken, ConvexPhantomTokenData>;
|
|
30
30
|
export declare const convexL2StakedTokens: Record<ConvexL2StakedToken, ConvexL2StakedTokenData>;
|
|
31
31
|
export declare const convexTokens: Record<ConvexLPToken | ConvexStakedPhantomToken | ConvexL2StakedToken, ConvexLPTokenData | ConvexPhantomTokenData | ConvexL2StakedTokenData>;
|
|
32
|
-
export declare const isConvexToken: (t: unknown) => t is ConvexLPToken | ConvexStakedPhantomToken | ConvexL2StakedToken;
|
|
33
|
-
export declare const isConvexLPToken: (t: unknown) => t is ConvexLPToken;
|
|
34
32
|
export declare const isConvexStakedPhantomToken: (t: unknown) => t is ConvexStakedPhantomToken;
|
|
35
33
|
export {};
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { NetworkType } from "../../chain/index.js";
|
|
3
|
-
import type { AaveV2LPToken,
|
|
4
|
-
import type { AuraLPToken,
|
|
5
|
-
import type { BalancerLPToken
|
|
6
|
-
import type { CompoundV2LPToken
|
|
7
|
-
import type { ConvexL2StakedToken,
|
|
8
|
-
import type { CurveLPToken
|
|
9
|
-
import type { ERC4626LPToken
|
|
10
|
-
import type {
|
|
11
|
-
import type { NormalToken
|
|
12
|
-
import type { StakingRewardsPhantomToken
|
|
13
|
-
import type { WrappedToken
|
|
14
|
-
import type { YearnLPToken
|
|
15
|
-
import type {
|
|
16
|
-
|
|
3
|
+
import type { AaveV2LPToken, WrappedAaveV2LPToken } from "./aave.js";
|
|
4
|
+
import type { AuraLPToken, AuraStakedToken } from "./aura.js";
|
|
5
|
+
import type { BalancerLPToken } from "./balancer.js";
|
|
6
|
+
import type { CompoundV2LPToken } from "./compound.js";
|
|
7
|
+
import type { ConvexL2StakedToken, ConvexLPToken, ConvexStakedPhantomToken } from "./convex.js";
|
|
8
|
+
import type { CurveLPToken } from "./curveLP.js";
|
|
9
|
+
import type { ERC4626LPToken } from "./erc4626.js";
|
|
10
|
+
import type { DieselStakedTokenTypes, DieselTokenTypes, GearboxToken } from "./gear.js";
|
|
11
|
+
import type { NormalToken } from "./normal.js";
|
|
12
|
+
import type { StakingRewardsPhantomToken } from "./stakingRewards.js";
|
|
13
|
+
import type { WrappedToken } from "./wrapped.js";
|
|
14
|
+
import type { YearnLPToken } from "./yearn.js";
|
|
15
|
+
import type { ZircuitStakedPhantomToken } from "./zircuit.js";
|
|
16
|
+
type LPTokens = YearnLPToken | CurveLPToken | ConvexLPToken | ConvexStakedPhantomToken | ConvexL2StakedToken | BalancerLPToken | AaveV2LPToken | WrappedAaveV2LPToken | CompoundV2LPToken | ERC4626LPToken | AuraLPToken | AuraStakedToken | ZircuitStakedPhantomToken | StakingRewardsPhantomToken;
|
|
17
17
|
export type SupportedToken = NormalToken | WrappedToken | LPTokens | DieselTokenTypes | DieselStakedTokenTypes | GearboxToken;
|
|
18
18
|
export interface TokenBase {
|
|
19
19
|
name: string;
|
|
20
20
|
symbol: string;
|
|
21
21
|
}
|
|
22
|
-
export type LPTokenDataI = CurveLPTokenData | MetaCurveLPTokenData | YearnVaultTokenData | YearnVaultOfCurveLPTokenData | YearnVaultOfMetaCurveLPTokenData | ConvexLPTokenData | ConvexPhantomTokenData | ConvexL2StakedTokenData | BalancerLpTokenData | AaveV2PoolTokenData | WrappedAaveV2PoolTokenData | CompoundV2PoolTokenData | ERC4626VaultTokenData | ERC4626VaultOfCurveLPTokenData | AuraLPTokenData | AuraStakedTokenData | ZircuitPhantomTokenData | StakingRewardsPhantomTokenData;
|
|
23
|
-
export type TokenDataI = NormalTokenData | WrappedTokenData | LPTokenDataI | DieselTokenData | DieselStakedTokenData | GearboxTokenData;
|
|
24
|
-
export declare const lpTokens: Record<LPTokens, LPTokenDataI>;
|
|
25
22
|
export declare const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
|
26
23
|
export declare const tokenDataByNetwork: Record<NetworkType, Record<SupportedToken, Address>>;
|
|
27
24
|
export type TickerToken = "weETH/ETH" | "ezETH/ETH" | "rsETH/ETH" | "pufETH/ETH" | "rswETH/ETH" | "LBTC/BTC" | "eBTC/BTC" | "solvBTC/BTC" | "pumpBTC/BTC" | "beraSTONE/ETH" | "crvUSD" | "USDC" | "USDT" | "DAI" | "LBTC" | "eBTC" | "ETH" | "USDe" | "BTC" | "PushUSDe" | "stS/S";
|
|
@@ -35,4 +32,4 @@ export interface TickerInfo {
|
|
|
35
32
|
export declare const tickerInfoTokensByNetwork: Record<NetworkType, Partial<Record<SupportedToken, Array<TickerInfo>>>>;
|
|
36
33
|
export declare const tokenSymbolByAddress: Record<string, SupportedToken>;
|
|
37
34
|
export declare function getTokenSymbol(address: Address): SupportedToken | undefined;
|
|
38
|
-
export
|
|
35
|
+
export {};
|
|
@@ -24,4 +24,3 @@ export type YearnVaultOfMetaCurveLPTokenData = {
|
|
|
24
24
|
vault: YearnVaultContract;
|
|
25
25
|
} & TokenBase;
|
|
26
26
|
export declare const yearnTokens: Record<YearnLPToken, YearnVaultTokenData | YearnVaultOfCurveLPTokenData | YearnVaultOfMetaCurveLPTokenData>;
|
|
27
|
-
export declare const isYearnLPToken: (t: unknown) => t is YearnLPToken;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { NetworkType } from "../../chain/chains.js";
|
|
3
3
|
import type { Asset } from "../../router/index.js";
|
|
4
|
-
import type { TokensAPYList } from "../apy/index.js";
|
|
5
4
|
import type { CaTokenBalance, CreditAccountDataPayload } from "../payload/creditAccount.js";
|
|
6
5
|
import type { QuotaInfo } from "../payload/creditManager.js";
|
|
7
6
|
import type { TokenData } from "../tokens/tokenData.js";
|
|
8
7
|
import type { AssetWithAmountInTarget } from "./assets.js";
|
|
9
8
|
export interface CalcOverallAPYProps {
|
|
10
9
|
caAssets: Array<Asset>;
|
|
11
|
-
lpAPY:
|
|
10
|
+
lpAPY: Record<Address, number> | undefined;
|
|
12
11
|
quotas: Record<Address, Asset>;
|
|
13
12
|
quotaRates: Record<Address, Pick<QuotaInfo, "isActive" | "rate">>;
|
|
14
13
|
feeInterest: number;
|
package/package.json
CHANGED
|
@@ -1,86 +0,0 @@
|
|
|
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 apy_exports = {};
|
|
20
|
-
__export(apy_exports, {
|
|
21
|
-
isExtraFarmToken: () => isExtraFarmToken,
|
|
22
|
-
isFarmToken: () => isFarmToken,
|
|
23
|
-
isLRT_LSTToken: () => isLRT_LSTToken
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(apy_exports);
|
|
26
|
-
var import_sdk_gov_legacy = require("../../sdk-gov-legacy/index.js");
|
|
27
|
-
const EXTRA_FARM_TOKENS = {
|
|
28
|
-
STETH: true,
|
|
29
|
-
rETH: true,
|
|
30
|
-
osETH: true,
|
|
31
|
-
cbETH: true,
|
|
32
|
-
wstETH: true,
|
|
33
|
-
weETH: true,
|
|
34
|
-
ezETH: true,
|
|
35
|
-
sfrxETH: true,
|
|
36
|
-
USDe: true,
|
|
37
|
-
rsETH: true,
|
|
38
|
-
rswETH: true,
|
|
39
|
-
pufETH: true,
|
|
40
|
-
pzETH: true,
|
|
41
|
-
rstETH: true,
|
|
42
|
-
steakLRT: true,
|
|
43
|
-
amphrETH: true,
|
|
44
|
-
LBTC: true,
|
|
45
|
-
Re7LRT: true,
|
|
46
|
-
cp0xLRT: true,
|
|
47
|
-
PT_ezETH_26DEC2024: true,
|
|
48
|
-
PT_eETH_26DEC2024: true,
|
|
49
|
-
PT_sUSDe_26DEC2024: true,
|
|
50
|
-
PT_eBTC_26DEC2024: true,
|
|
51
|
-
PT_LBTC_27MAR2025: true,
|
|
52
|
-
eBTC: true,
|
|
53
|
-
PT_cornLBTC_26DEC2024: true,
|
|
54
|
-
PT_corn_eBTC_27MAR2025: true,
|
|
55
|
-
PT_corn_pumpBTC_26DEC2024: true,
|
|
56
|
-
pumpBTC: true,
|
|
57
|
-
PT_sUSDe_27MAR2025: true,
|
|
58
|
-
DVstETH: true,
|
|
59
|
-
beraSTONE: true,
|
|
60
|
-
PT_sUSDe_29MAY2025: true,
|
|
61
|
-
tETH: true,
|
|
62
|
-
PT_beraSTONE_10APR2025: true,
|
|
63
|
-
stS: true,
|
|
64
|
-
csUSDL: true,
|
|
65
|
-
scUSD: true,
|
|
66
|
-
ynBNBx: true
|
|
67
|
-
};
|
|
68
|
-
const isExtraFarmToken = (t) => {
|
|
69
|
-
if (typeof t !== "string") return false;
|
|
70
|
-
return !!EXTRA_FARM_TOKENS[t];
|
|
71
|
-
};
|
|
72
|
-
const { USDe, ...rest } = EXTRA_FARM_TOKENS;
|
|
73
|
-
const LRT_LST = rest;
|
|
74
|
-
const isLRT_LSTToken = (t) => {
|
|
75
|
-
if (typeof t !== "string") return false;
|
|
76
|
-
return !!LRT_LST[t];
|
|
77
|
-
};
|
|
78
|
-
const isFarmToken = (t) => {
|
|
79
|
-
return (0, import_sdk_gov_legacy.isLPToken)(t) || isExtraFarmToken(t);
|
|
80
|
-
};
|
|
81
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
-
0 && (module.exports = {
|
|
83
|
-
isExtraFarmToken,
|
|
84
|
-
isFarmToken,
|
|
85
|
-
isLRT_LSTToken
|
|
86
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { isLPToken } from "../../sdk-gov-legacy/index.js";
|
|
2
|
-
const EXTRA_FARM_TOKENS = {
|
|
3
|
-
STETH: true,
|
|
4
|
-
rETH: true,
|
|
5
|
-
osETH: true,
|
|
6
|
-
cbETH: true,
|
|
7
|
-
wstETH: true,
|
|
8
|
-
weETH: true,
|
|
9
|
-
ezETH: true,
|
|
10
|
-
sfrxETH: true,
|
|
11
|
-
USDe: true,
|
|
12
|
-
rsETH: true,
|
|
13
|
-
rswETH: true,
|
|
14
|
-
pufETH: true,
|
|
15
|
-
pzETH: true,
|
|
16
|
-
rstETH: true,
|
|
17
|
-
steakLRT: true,
|
|
18
|
-
amphrETH: true,
|
|
19
|
-
LBTC: true,
|
|
20
|
-
Re7LRT: true,
|
|
21
|
-
cp0xLRT: true,
|
|
22
|
-
PT_ezETH_26DEC2024: true,
|
|
23
|
-
PT_eETH_26DEC2024: true,
|
|
24
|
-
PT_sUSDe_26DEC2024: true,
|
|
25
|
-
PT_eBTC_26DEC2024: true,
|
|
26
|
-
PT_LBTC_27MAR2025: true,
|
|
27
|
-
eBTC: true,
|
|
28
|
-
PT_cornLBTC_26DEC2024: true,
|
|
29
|
-
PT_corn_eBTC_27MAR2025: true,
|
|
30
|
-
PT_corn_pumpBTC_26DEC2024: true,
|
|
31
|
-
pumpBTC: true,
|
|
32
|
-
PT_sUSDe_27MAR2025: true,
|
|
33
|
-
DVstETH: true,
|
|
34
|
-
beraSTONE: true,
|
|
35
|
-
PT_sUSDe_29MAY2025: true,
|
|
36
|
-
tETH: true,
|
|
37
|
-
PT_beraSTONE_10APR2025: true,
|
|
38
|
-
stS: true,
|
|
39
|
-
csUSDL: true,
|
|
40
|
-
scUSD: true,
|
|
41
|
-
ynBNBx: true
|
|
42
|
-
};
|
|
43
|
-
const isExtraFarmToken = (t) => {
|
|
44
|
-
if (typeof t !== "string") return false;
|
|
45
|
-
return !!EXTRA_FARM_TOKENS[t];
|
|
46
|
-
};
|
|
47
|
-
const { USDe, ...rest } = EXTRA_FARM_TOKENS;
|
|
48
|
-
const LRT_LST = rest;
|
|
49
|
-
const isLRT_LSTToken = (t) => {
|
|
50
|
-
if (typeof t !== "string") return false;
|
|
51
|
-
return !!LRT_LST[t];
|
|
52
|
-
};
|
|
53
|
-
const isFarmToken = (t) => {
|
|
54
|
-
return isLPToken(t) || isExtraFarmToken(t);
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
isExtraFarmToken,
|
|
58
|
-
isFarmToken,
|
|
59
|
-
isLRT_LSTToken
|
|
60
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Address } from "viem";
|
|
2
|
-
import type { LPTokens, SupportedToken } from "../../sdk-gov-legacy/index.js";
|
|
3
|
-
type ExtraFarmTokens = Extract<SupportedToken, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "weETH" | "ezETH" | "sfrxETH" | "USDe" | "rsETH" | "rswETH" | "pufETH" | "pzETH" | "rstETH" | "steakLRT" | "amphrETH" | "LBTC" | "Re7LRT" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "eBTC" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_corn_pumpBTC_26DEC2024" | "pumpBTC" | "PT_sUSDe_27MAR2025" | "DVstETH" | "beraSTONE" | "PT_sUSDe_29MAY2025" | "tETH" | "PT_beraSTONE_10APR2025" | "stS" | "csUSDL" | "scUSD" | "ynBNBx" | "cp0xLRT">;
|
|
4
|
-
type LRTAndLSTTokens = Exclude<ExtraFarmTokens, "USDe">;
|
|
5
|
-
export declare const isExtraFarmToken: (t: unknown) => t is ExtraFarmTokens;
|
|
6
|
-
export declare const isLRT_LSTToken: (t: unknown) => t is LRTAndLSTTokens;
|
|
7
|
-
interface Branding<T> {
|
|
8
|
-
_type: T;
|
|
9
|
-
}
|
|
10
|
-
export type Brand<T, A> = T & Branding<A>;
|
|
11
|
-
export type TokensAPYList = Brand<Record<Address, number>, "apyList">;
|
|
12
|
-
export type AllLPTokens = LPTokens | ExtraFarmTokens;
|
|
13
|
-
export declare const isFarmToken: (t: unknown) => t is AllLPTokens;
|
|
14
|
-
export {};
|