@gearbox-protocol/sdk 13.3.0-next.3 → 13.3.1
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/common-utils/charts/credit-manager-payload.js +16 -0
- package/dist/cjs/common-utils/charts/credit-manager.js +134 -0
- package/dist/cjs/common-utils/charts/credit-session.js +257 -0
- package/dist/cjs/common-utils/charts/credit-sessions-payload.js +16 -0
- package/dist/cjs/common-utils/charts/graph-payload.js +16 -0
- package/dist/cjs/common-utils/charts/index.js +36 -0
- package/dist/cjs/common-utils/charts/pool-payload.js +16 -0
- package/dist/cjs/common-utils/charts/pool.js +199 -0
- package/dist/cjs/common-utils/charts/token-data.js +91 -0
- package/dist/cjs/common-utils/index.js +4 -0
- package/dist/cjs/common-utils/static/index.js +28 -0
- package/dist/cjs/common-utils/static/migration-config.js +16 -0
- package/dist/cjs/common-utils/static/pool-config.js +16 -0
- package/dist/cjs/common-utils/static/strategy.js +16 -0
- package/dist/cjs/common-utils/static/trading-pair.js +16 -0
- package/dist/cjs/common-utils/utils/{assetsMath.js → assets-math.js} +13 -13
- package/dist/cjs/common-utils/utils/{bigintMath.js → bigint-math.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +9 -9
- package/dist/cjs/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +8 -8
- package/dist/cjs/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/debt.js +4 -4
- package/dist/cjs/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/index.js +16 -16
- package/dist/cjs/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +3 -3
- package/dist/cjs/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +8 -8
- package/dist/cjs/common-utils/utils/creditAccount/sort.js +3 -3
- package/dist/cjs/common-utils/utils/index.js +6 -8
- package/dist/cjs/common-utils/utils/{priceMath.js → price-math.js} +3 -3
- package/dist/cjs/dev/AccountOpener.js +5 -45
- package/dist/cjs/plugins/zappers/ZappersPlugin.js +144 -0
- package/dist/cjs/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +6 -110
- package/dist/cjs/plugins/zappers/index.js +26 -0
- package/dist/cjs/plugins/zappers/package.json +1 -0
- package/dist/cjs/rewards/apy/index.js +24 -0
- package/dist/cjs/rewards/apy/output-details.js +16 -0
- package/dist/cjs/rewards/apy/output.js +16 -0
- package/dist/cjs/rewards/index.js +24 -0
- package/dist/cjs/rewards/package.json +1 -0
- package/dist/cjs/rewards/rewards/api.js +226 -0
- package/dist/cjs/rewards/rewards/apy.js +177 -0
- package/dist/cjs/rewards/rewards/common.js +16 -0
- package/dist/cjs/rewards/rewards/extra-apy.js +132 -0
- package/dist/cjs/rewards/rewards/index.js +28 -0
- package/dist/cjs/rewards/rewards/merkl-api.js +52 -0
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +104 -462
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +5 -16
- package/dist/cjs/sdk/base/ChainContractsRegister.js +1 -1
- package/dist/cjs/sdk/base/TokensMeta.js +32 -255
- package/dist/cjs/sdk/base/index.js +0 -2
- package/dist/cjs/sdk/chain/chains.js +1 -2
- package/dist/cjs/sdk/constants/index.js +2 -0
- package/dist/cjs/sdk/{base/token-types.js → constants/phantom-tokens.js} +3 -9
- package/dist/cjs/sdk/market/MarketRegister.js +2 -2
- package/dist/cjs/sdk/market/MarketSuite.js +0 -6
- package/dist/cjs/sdk/market/index.js +1 -3
- package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -17
- package/dist/cjs/sdk/market/pool/index.js +0 -4
- package/dist/cjs/sdk/pools/AbstractPoolService.js +137 -0
- package/dist/cjs/{abi/iStateSerializer.js → sdk/pools/PoolServiceV310.js} +8 -14
- package/dist/cjs/sdk/pools/createPoolService.js +35 -0
- package/dist/cjs/sdk/pools/index.js +4 -2
- package/dist/cjs/sdk/utils/AddressMap.js +1 -1
- package/dist/cjs/sdk/utils/viem/sendRawTx.js +0 -16
- package/dist/esm/common-utils/charts/credit-manager.js +115 -0
- package/dist/esm/common-utils/charts/credit-session.js +233 -0
- package/dist/esm/common-utils/charts/credit-sessions-payload.js +0 -0
- package/dist/esm/common-utils/charts/graph-payload.js +0 -0
- package/dist/esm/common-utils/charts/index.js +8 -0
- package/dist/esm/common-utils/charts/pool-payload.js +0 -0
- package/dist/esm/common-utils/charts/pool.js +179 -0
- package/dist/esm/common-utils/charts/token-data.js +67 -0
- package/dist/esm/common-utils/index.js +2 -0
- package/dist/esm/common-utils/static/index.js +4 -0
- package/dist/esm/common-utils/static/migration-config.js +0 -0
- package/dist/esm/common-utils/static/pool-config.js +0 -0
- package/dist/esm/common-utils/static/strategy.js +0 -0
- package/dist/esm/common-utils/static/trading-pair.js +0 -0
- package/dist/esm/common-utils/utils/{assetsMath.js → assets-math.js} +2 -2
- package/dist/esm/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +2 -2
- package/dist/esm/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +1 -1
- package/dist/esm/common-utils/utils/creditAccount/debt.js +2 -2
- package/dist/esm/common-utils/utils/creditAccount/index.js +8 -8
- package/dist/esm/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +1 -1
- package/dist/esm/common-utils/utils/creditAccount/sort.js +1 -1
- package/dist/esm/common-utils/utils/index.js +3 -4
- package/dist/esm/dev/AccountOpener.js +6 -47
- package/dist/esm/plugins/zappers/ZappersPlugin.js +126 -0
- package/dist/esm/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +2 -109
- package/dist/esm/plugins/zappers/index.js +3 -0
- package/dist/esm/plugins/zappers/package.json +1 -0
- package/dist/esm/plugins/zappers/types.js +0 -0
- package/dist/esm/rewards/apy/index.js +2 -0
- package/dist/esm/rewards/apy/output-details.js +0 -0
- package/dist/esm/rewards/apy/output.js +0 -0
- package/dist/esm/rewards/index.js +2 -0
- package/dist/esm/rewards/package.json +1 -0
- package/dist/esm/rewards/rewards/api.js +204 -0
- package/dist/esm/rewards/rewards/apy.js +160 -0
- package/dist/esm/rewards/rewards/common.js +0 -0
- package/dist/esm/rewards/rewards/extra-apy.js +101 -0
- package/dist/esm/rewards/rewards/index.js +4 -0
- package/dist/esm/rewards/rewards/merkl-api.js +18 -0
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +104 -462
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +5 -16
- package/dist/esm/sdk/base/ChainContractsRegister.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +32 -261
- package/dist/esm/sdk/base/index.js +0 -1
- package/dist/esm/sdk/chain/chains.js +1 -2
- package/dist/esm/sdk/constants/index.js +1 -0
- package/dist/esm/sdk/{base/token-types.js → constants/phantom-tokens.js} +0 -4
- package/dist/esm/sdk/market/MarketRegister.js +2 -2
- package/dist/esm/sdk/market/MarketSuite.js +0 -6
- package/dist/esm/sdk/market/index.js +0 -1
- package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
- package/dist/esm/sdk/market/pool/index.js +0 -2
- package/dist/esm/sdk/pools/AbstractPoolService.js +113 -0
- package/dist/esm/sdk/pools/PoolServiceV310.js +6 -0
- package/dist/esm/sdk/pools/createPoolService.js +11 -0
- package/dist/esm/sdk/pools/index.js +2 -1
- package/dist/esm/sdk/utils/AddressMap.js +1 -1
- package/dist/esm/sdk/utils/viem/sendRawTx.js +1 -19
- package/dist/types/common-utils/charts/credit-manager-payload.d.ts +50 -0
- package/dist/types/common-utils/charts/credit-manager.d.ts +48 -0
- package/dist/types/common-utils/charts/credit-session.d.ts +111 -0
- package/dist/types/common-utils/charts/credit-sessions-payload.d.ts +111 -0
- package/dist/types/common-utils/charts/graph-payload.d.ts +10 -0
- package/dist/types/common-utils/charts/index.d.ts +8 -0
- package/dist/types/common-utils/charts/pool-payload.d.ts +111 -0
- package/dist/types/common-utils/charts/pool.d.ts +91 -0
- package/dist/types/common-utils/charts/token-data.d.ts +20 -0
- package/dist/types/common-utils/index.d.ts +2 -0
- package/dist/types/common-utils/static/index.d.ts +4 -0
- package/dist/types/common-utils/static/migration-config.d.ts +10 -0
- package/dist/types/common-utils/static/pool-config.d.ts +11 -0
- package/dist/types/common-utils/static/strategy.d.ts +78 -0
- package/dist/types/common-utils/static/trading-pair.d.ts +15 -0
- package/dist/types/common-utils/utils/creditAccount/index.d.ts +8 -8
- package/dist/types/common-utils/utils/index.d.ts +3 -4
- package/dist/types/plugins/zappers/ZappersPlugin.d.ts +18 -0
- package/dist/types/plugins/zappers/extraZappers.d.ts +6 -0
- package/dist/types/plugins/zappers/index.d.ts +3 -0
- package/dist/types/plugins/zappers/types.d.ts +12 -0
- package/dist/types/rewards/apy/index.d.ts +2 -0
- package/dist/types/rewards/apy/output-details.d.ts +96 -0
- package/dist/types/rewards/apy/output.d.ts +22 -0
- package/dist/types/rewards/index.d.ts +2 -0
- package/dist/types/rewards/rewards/api.d.ts +49 -0
- package/dist/types/rewards/rewards/apy.d.ts +41 -0
- package/dist/types/rewards/rewards/common.d.ts +16 -0
- package/dist/types/rewards/rewards/extra-apy.d.ts +30 -0
- package/dist/types/rewards/rewards/index.d.ts +4 -0
- package/dist/types/rewards/rewards/merkl-api.d.ts +45 -0
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +27 -123
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +8 -108
- package/dist/types/sdk/base/TokensMeta.d.ts +18 -34
- package/dist/types/sdk/base/index.d.ts +0 -1
- package/dist/types/sdk/base/types.d.ts +1 -0
- package/dist/types/sdk/chain/chains.d.ts +1 -1
- package/dist/types/sdk/constants/index.d.ts +1 -0
- package/dist/types/sdk/constants/phantom-tokens.d.ts +2 -0
- package/dist/types/sdk/market/MarketRegister.d.ts +2 -2
- package/dist/types/sdk/market/MarketSuite.d.ts +0 -3
- package/dist/types/sdk/market/index.d.ts +0 -1
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
- package/dist/types/sdk/market/pool/index.d.ts +0 -2
- package/dist/types/sdk/pools/AbstractPoolService.d.ts +9 -0
- package/dist/types/sdk/pools/PoolServiceV310.d.ts +4 -0
- package/dist/types/sdk/pools/createPoolService.d.ts +3 -0
- package/dist/types/sdk/pools/index.d.ts +2 -1
- package/dist/types/sdk/pools/types.d.ts +63 -84
- package/dist/types/sdk/utils/AddressMap.d.ts +1 -1
- package/dist/types/sdk/utils/viem/sendRawTx.d.ts +1 -5
- package/package.json +6 -1
- package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
- package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
- package/dist/cjs/common-utils/utils/endpoints.js +0 -65
- package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
- package/dist/cjs/sdk/pools/PoolService.js +0 -391
- package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
- package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
- package/dist/esm/abi/iStateSerializer.js +0 -12
- package/dist/esm/common-utils/utils/endpoints.js +0 -41
- package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
- package/dist/esm/sdk/pools/PoolService.js +0 -371
- package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
- package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
- package/dist/types/abi/iStateSerializer.d.ts +0 -11
- package/dist/types/common-utils/utils/endpoints.d.ts +0 -27
- package/dist/types/sdk/base/token-types.d.ts +0 -33
- package/dist/types/sdk/market/ZapperRegister.d.ts +0 -17
- package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
- package/dist/types/sdk/market/types.d.ts +0 -10
- package/dist/types/sdk/pools/PoolService.d.ts +0 -14
- /package/dist/cjs/{sdk/market → plugins/zappers}/types.js +0 -0
- /package/dist/esm/{sdk/market/types.js → common-utils/charts/credit-manager-payload.js} +0 -0
- /package/dist/esm/common-utils/utils/{bigintMath.js → bigint-math.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +0 -0
- /package/dist/esm/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +0 -0
- /package/dist/esm/common-utils/utils/{priceMath.js → price-math.js} +0 -0
- /package/dist/types/common-utils/utils/{assetsMath.d.ts → assets-math.d.ts} +0 -0
- /package/dist/types/common-utils/utils/{bigintMath.d.ts → bigint-math.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcHealthFactor.d.ts → calc-health-factor.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcOverallAPY.d.ts → calc-overall-apy.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcQuotaBorrowRate.d.ts → calc-quota-borrow-rate.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.d.ts → calc-relative-base-borrow-rate.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{getTimeToLiquidation.d.ts → get-time-to-liquidation.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{liquidationPrice.d.ts → liquidation-price.d.ts} +0 -0
- /package/dist/types/common-utils/utils/creditAccount/{quotaUtils.d.ts → quota-utils.d.ts} +0 -0
- /package/dist/types/common-utils/utils/{priceMath.d.ts → price-math.d.ts} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { PartialRecord } from "../../sdk/index.js";
|
|
3
|
+
export type TokenTypeStrategy = "eth" | "s" | "btc" | "stable" | "wbnb" | "wxtz" | "bfBTC" | "mon";
|
|
4
|
+
export interface StrategyConfigPayload {
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* Token symbol of the strategy, is used as key in the strategies list.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Token address of the strategy
|
|
12
|
+
*/
|
|
13
|
+
tokenOutAddress: Address;
|
|
14
|
+
/**
|
|
15
|
+
* Chain id and network type as they are written in sdk. Wrong entries are being omitted
|
|
16
|
+
*/
|
|
17
|
+
chainId: number;
|
|
18
|
+
network: string;
|
|
19
|
+
/**
|
|
20
|
+
* Credit managers strategy can be opened on. If it doesn't present - strategy won't be shown
|
|
21
|
+
*/
|
|
22
|
+
creditManagers: Array<Address>;
|
|
23
|
+
/**
|
|
24
|
+
* Strategy type. Used for filtering
|
|
25
|
+
*/
|
|
26
|
+
strategyType: [TokenTypeStrategy];
|
|
27
|
+
/**
|
|
28
|
+
* undefined - released;
|
|
29
|
+
* number - one value for the current chain.
|
|
30
|
+
* In ms, for example: 1740398400_000;
|
|
31
|
+
*/
|
|
32
|
+
releaseAt?: number;
|
|
33
|
+
/**
|
|
34
|
+
* An option to show strategies in dev environment only.
|
|
35
|
+
* undefined, false = no.
|
|
36
|
+
*/
|
|
37
|
+
hideInProd?: boolean;
|
|
38
|
+
/** An option to show strategies in main app only.
|
|
39
|
+
* undefined, true = yes; false = no.
|
|
40
|
+
*/
|
|
41
|
+
showInMainApp?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* undefined - no restrictions.
|
|
44
|
+
* number - one value for the current chain.
|
|
45
|
+
*/
|
|
46
|
+
maxLeverage?: number;
|
|
47
|
+
/**
|
|
48
|
+
* undefined, false = no.
|
|
49
|
+
* PartialRecord<number, boolean> - delayed withdrawal for each chain separately.
|
|
50
|
+
*/
|
|
51
|
+
delayedWithdrawal?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* previously known as "bad asset", an asset closing account with may need extra capital.
|
|
54
|
+
* undefined, false = no.
|
|
55
|
+
* VersionRange - problems only in this range.
|
|
56
|
+
*/
|
|
57
|
+
issuesOnClose?: boolean | VersionRange;
|
|
58
|
+
/**
|
|
59
|
+
* pools in which current token has zero slippage.
|
|
60
|
+
* pool - boolean.
|
|
61
|
+
*/
|
|
62
|
+
zeroSlippage?: PartialRecord<Address, boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* pools in which additional quota should be bought for current token.
|
|
65
|
+
* pool - boolean
|
|
66
|
+
*/
|
|
67
|
+
additionalRewardQuotas?: PartialRecord<Address, Address[]>;
|
|
68
|
+
/**
|
|
69
|
+
* If address provided - it is considered that this collateral can be used across all listed cms.
|
|
70
|
+
* If object provided - it is considered that this collateral can be used only on the specified cm.
|
|
71
|
+
*/
|
|
72
|
+
additionalCollaterals?: Array<Address | {
|
|
73
|
+
token: Address;
|
|
74
|
+
cm: Address;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
type VersionRange = [number, number];
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
export type TradingType = "long" | "short";
|
|
3
|
+
export interface TradingPairConfigPayload {
|
|
4
|
+
name: string;
|
|
5
|
+
type: TradingType;
|
|
6
|
+
id: string;
|
|
7
|
+
tokenOutAddress: Address;
|
|
8
|
+
baseOfTokenOutAddress?: Address;
|
|
9
|
+
pricePair: [string, string];
|
|
10
|
+
chainId: number;
|
|
11
|
+
network: string;
|
|
12
|
+
creditManagers: Array<Address>;
|
|
13
|
+
hideInProd?: boolean;
|
|
14
|
+
maxLeverage?: number;
|
|
15
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
1
|
+
export * from "./calc-health-factor.js";
|
|
2
|
+
export * from "./calc-overall-apy.js";
|
|
3
|
+
export * from "./calc-quota-borrow-rate.js";
|
|
4
|
+
export * from "./calc-quota-borrow-rate.js";
|
|
5
|
+
export * from "./calc-relative-base-borrow-rate.js";
|
|
6
6
|
export * from "./debt.js";
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
7
|
+
export * from "./get-time-to-liquidation.js";
|
|
8
|
+
export * from "./liquidation-price.js";
|
|
9
|
+
export * from "./quota-utils.js";
|
|
10
10
|
export * from "./sort.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./assets-math.js";
|
|
2
|
+
export * from "./bigint-math.js";
|
|
3
3
|
export * from "./creditAccount/index.js";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./priceMath.js";
|
|
4
|
+
export * from "./price-math.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { IGearboxSDKPlugin } from "../../sdk/index.js";
|
|
3
|
+
import { AddressMap, BasePlugin } from "../../sdk/index.js";
|
|
4
|
+
import type { ZapperDataFull, ZapperStateHuman } from "./types.js";
|
|
5
|
+
export interface ZappersPluginState {
|
|
6
|
+
zappers: Record<Address, ZapperDataFull[]>;
|
|
7
|
+
}
|
|
8
|
+
export declare class ZappersPlugin extends BasePlugin<ZappersPluginState> implements IGearboxSDKPlugin<ZappersPluginState> {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(extraZappers?: ZapperDataFull[], loadOnAttach?: boolean);
|
|
11
|
+
load(force?: boolean): Promise<ZappersPluginState>;
|
|
12
|
+
get extraZappers(): AddressMap<ZapperDataFull[]>;
|
|
13
|
+
get zappers(): AddressMap<ZapperDataFull[]>;
|
|
14
|
+
get loaded(): boolean;
|
|
15
|
+
stateHuman(_?: boolean): ZapperStateHuman[];
|
|
16
|
+
get state(): ZappersPluginState;
|
|
17
|
+
hydrate(state: ZappersPluginState): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
|
|
2
|
+
import type { Address } from "viem";
|
|
3
|
+
import type { peripheryCompressorAbi } from "../../abi/compressors/peripheryCompressor.js";
|
|
4
|
+
import type { BaseContractStateHuman, Unarray } from "../../sdk/index.js";
|
|
5
|
+
export type ZapperData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof peripheryCompressorAbi, "getZappers">["outputs"]>>;
|
|
6
|
+
export interface ZapperDataFull extends ZapperData {
|
|
7
|
+
pool: Address;
|
|
8
|
+
}
|
|
9
|
+
export interface ZapperStateHuman extends BaseContractStateHuman {
|
|
10
|
+
tokenIn: string;
|
|
11
|
+
tokenOut: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
export interface GearAPY {
|
|
3
|
+
base: number;
|
|
4
|
+
crv: number;
|
|
5
|
+
gear: number;
|
|
6
|
+
gearPrice: number;
|
|
7
|
+
}
|
|
8
|
+
export type GearAPYDetails = GearAPY & {
|
|
9
|
+
lastUpdated: string;
|
|
10
|
+
};
|
|
11
|
+
export interface TokenOutputDetails<T extends string> {
|
|
12
|
+
chainId: number;
|
|
13
|
+
address: string;
|
|
14
|
+
symbol: string;
|
|
15
|
+
rewards: {
|
|
16
|
+
apy: Array<Omit<ApyDetails, "symbol" | "address">>;
|
|
17
|
+
points: Array<Omit<PointsInfo<T>, "symbol" | "address">>;
|
|
18
|
+
extraRewards: Array<Omit<FarmInfo, "symbol" | "address">>;
|
|
19
|
+
extraCollateralAPY: Array<Omit<ExtraCollateralAPY, "symbol" | "address">>;
|
|
20
|
+
extraCollateralPoints: Array<Omit<ExtraCollateralPointsInfo<T>, "symbol" | "address">>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export type ApyDetails = Apy & {
|
|
24
|
+
lastUpdated: string;
|
|
25
|
+
};
|
|
26
|
+
export interface FarmInfo {
|
|
27
|
+
address: Address;
|
|
28
|
+
symbol: string;
|
|
29
|
+
rewardToken: Address;
|
|
30
|
+
rewardSymbol: string;
|
|
31
|
+
duration: bigint;
|
|
32
|
+
finished: bigint;
|
|
33
|
+
reward: bigint;
|
|
34
|
+
balance: bigint;
|
|
35
|
+
}
|
|
36
|
+
export interface Apy {
|
|
37
|
+
address: Address;
|
|
38
|
+
symbol: string;
|
|
39
|
+
protocol: string;
|
|
40
|
+
value: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ExtraCollateralAPY extends Omit<Apy, "protocol"> {
|
|
43
|
+
pool: Address;
|
|
44
|
+
type: "relative" | "absolute";
|
|
45
|
+
}
|
|
46
|
+
export interface PointsReward<T extends string> {
|
|
47
|
+
name: string;
|
|
48
|
+
units: string;
|
|
49
|
+
multiplier: bigint | "soon";
|
|
50
|
+
type: T;
|
|
51
|
+
}
|
|
52
|
+
export interface DebtReward<T extends string> extends PointsReward<T> {
|
|
53
|
+
cm: Address | "any";
|
|
54
|
+
}
|
|
55
|
+
export interface PointsInfo<T extends string> {
|
|
56
|
+
symbol: string;
|
|
57
|
+
address: Address;
|
|
58
|
+
rewards: Array<PointsReward<T>>;
|
|
59
|
+
debtRewards?: Array<DebtReward<T>>;
|
|
60
|
+
}
|
|
61
|
+
export interface ExtraCollateralPointsInfo<T extends string> extends PointsInfo<T> {
|
|
62
|
+
pool: Address;
|
|
63
|
+
}
|
|
64
|
+
export interface PoolOutputDetails<T extends string> {
|
|
65
|
+
chainId: number;
|
|
66
|
+
pool: Address;
|
|
67
|
+
rewards: {
|
|
68
|
+
points: Array<Omit<PoolPointsInfo<T>, "pool">>;
|
|
69
|
+
externalAPY: Array<Omit<ExternalApy, "pool">>;
|
|
70
|
+
extraAPY: Array<Omit<PoolExtraApy, "pool">>;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export interface PoolPointsInfo<T extends string> {
|
|
74
|
+
pool: Address;
|
|
75
|
+
token: Address;
|
|
76
|
+
symbol: string;
|
|
77
|
+
amount: bigint;
|
|
78
|
+
duration: string | undefined;
|
|
79
|
+
name: string;
|
|
80
|
+
type: T;
|
|
81
|
+
estimation: "absolute" | "relative";
|
|
82
|
+
condition: "deposit" | "cross-chain-deposit" | "holding";
|
|
83
|
+
}
|
|
84
|
+
export interface ExternalApy {
|
|
85
|
+
value: number;
|
|
86
|
+
name: string;
|
|
87
|
+
pool: Address;
|
|
88
|
+
}
|
|
89
|
+
export interface PoolExtraApy {
|
|
90
|
+
token: Address;
|
|
91
|
+
apy: number;
|
|
92
|
+
rewardToken: Address;
|
|
93
|
+
rewardTokenSymbol: string;
|
|
94
|
+
endTimestamp?: number;
|
|
95
|
+
lastUpdated: string;
|
|
96
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { GearAPYDetails, PoolOutputDetails, TokenOutputDetails } from "./output-details.js";
|
|
2
|
+
export interface Output<POOL_POINTS_TYPE extends string, TOKEN_POINTS_TYPE extends string> {
|
|
3
|
+
gearApy: DataResult<GearAPYDetails>;
|
|
4
|
+
chains: Record<string, {
|
|
5
|
+
tokens: DataResult<TokenOutputDetails<TOKEN_POINTS_TYPE>[]>;
|
|
6
|
+
pools: DataResult<PoolOutputDetails<POOL_POINTS_TYPE>[]>;
|
|
7
|
+
}>;
|
|
8
|
+
timestamp: string;
|
|
9
|
+
metadata: {
|
|
10
|
+
totalChains: number;
|
|
11
|
+
successfulChains: number;
|
|
12
|
+
failedChains: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export type DataResult<T> = {
|
|
16
|
+
status: "ok";
|
|
17
|
+
data: T;
|
|
18
|
+
} | {
|
|
19
|
+
status: "error";
|
|
20
|
+
message: string;
|
|
21
|
+
code?: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from "viem";
|
|
2
|
+
import { type NetworkType } from "../../sdk/index.js";
|
|
3
|
+
import type { PoolData, TokenData } from "./common.js";
|
|
4
|
+
export interface GearboxExtraMerkleLmReward {
|
|
5
|
+
pool: Address;
|
|
6
|
+
poolToken: Address;
|
|
7
|
+
rewardTokenSymbol: string;
|
|
8
|
+
rewardTokenDecimals: number;
|
|
9
|
+
rewardToken: Address;
|
|
10
|
+
amount: bigint;
|
|
11
|
+
type: "extraMerkle";
|
|
12
|
+
}
|
|
13
|
+
export interface GearboxStakedV3LmReward {
|
|
14
|
+
pool: Address;
|
|
15
|
+
poolToken: Address;
|
|
16
|
+
rewardTokenSymbol: string;
|
|
17
|
+
rewardTokenDecimals: number;
|
|
18
|
+
rewardToken: Address;
|
|
19
|
+
amount: bigint;
|
|
20
|
+
type: "stakedV3";
|
|
21
|
+
}
|
|
22
|
+
export type GearboxLmReward = GearboxStakedV3LmReward | GearboxExtraMerkleLmReward;
|
|
23
|
+
type ReportHandler = (e: unknown, description?: string) => void;
|
|
24
|
+
export interface GetLmRewardsV3Props {
|
|
25
|
+
pools: Record<`0x${string}`, PoolData>;
|
|
26
|
+
tokensList: Record<Address, TokenData>;
|
|
27
|
+
account: Address;
|
|
28
|
+
provider: PublicClient;
|
|
29
|
+
reportError?: ReportHandler;
|
|
30
|
+
}
|
|
31
|
+
export interface GetLmRewardsMerkleProps {
|
|
32
|
+
pools: Record<Address, PoolData>;
|
|
33
|
+
account: Address;
|
|
34
|
+
network: NetworkType;
|
|
35
|
+
reportError?: ReportHandler;
|
|
36
|
+
}
|
|
37
|
+
export interface ClaimLmRewardsV3Props {
|
|
38
|
+
reward: GearboxStakedV3LmReward;
|
|
39
|
+
account: Address;
|
|
40
|
+
signer: WalletClient;
|
|
41
|
+
}
|
|
42
|
+
export declare class GearboxRewardsApi {
|
|
43
|
+
private constructor();
|
|
44
|
+
static getLmRewardsV3({ pools, tokensList, provider, account, reportError, }: GetLmRewardsV3Props): Promise<(GearboxLmReward | GearboxLmReward[])[]>;
|
|
45
|
+
static getLmRewardsMerkle({ pools, account, network, reportError, }: GetLmRewardsMerkleProps): Promise<GearboxLmReward[]>;
|
|
46
|
+
private static extractFulfilled;
|
|
47
|
+
static claimLmRewardsV3({ reward, signer, account, }: ClaimLmRewardsV3Props): Promise<`0x${string}`>;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import { type Asset } from "../../sdk/index.js";
|
|
3
|
+
import type { FarmInfo } from "../index.js";
|
|
4
|
+
import type { PoolData, TokenData } from "./common.js";
|
|
5
|
+
interface InnerFarmInfo extends FarmInfo {
|
|
6
|
+
token: Address;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtraRewardApy {
|
|
9
|
+
token: Address;
|
|
10
|
+
balance: bigint | null;
|
|
11
|
+
apy: number;
|
|
12
|
+
rewardToken: Address;
|
|
13
|
+
rewardTokenSymbol: string;
|
|
14
|
+
endTimestamp?: number;
|
|
15
|
+
}
|
|
16
|
+
interface GetPoolExtraAPY_V3Props {
|
|
17
|
+
stakedDieselToken: Address | undefined;
|
|
18
|
+
pool: PoolData;
|
|
19
|
+
prices: Record<Address, bigint>;
|
|
20
|
+
rewardPoolsInfo: Record<Address, Array<InnerFarmInfo>> | Record<Address, InnerFarmInfo>;
|
|
21
|
+
rewardPoolsSupply: Record<Address, bigint>;
|
|
22
|
+
tokensList: Record<Address, TokenData>;
|
|
23
|
+
currentTimestamp: number;
|
|
24
|
+
}
|
|
25
|
+
interface GetCAExtraAPYProps {
|
|
26
|
+
assets: Array<Asset>;
|
|
27
|
+
supply: Record<Address, bigint> | Record<Address, Asset>;
|
|
28
|
+
rewardInfo: Record<Address, Array<InnerFarmInfo>>;
|
|
29
|
+
currentTimestamp: number;
|
|
30
|
+
prices: Record<Address, bigint>;
|
|
31
|
+
tokensList: Record<Address, TokenData>;
|
|
32
|
+
}
|
|
33
|
+
export declare class GearboxRewardsApy {
|
|
34
|
+
private constructor();
|
|
35
|
+
static getPoolExtraAPY_V3({ rewardPoolsInfo, stakedDieselToken, ...restProps }: GetPoolExtraAPY_V3Props): Array<ExtraRewardApy>;
|
|
36
|
+
private static getPoolSingleExtraLmAPY_V3;
|
|
37
|
+
private static calculateAPY_V3;
|
|
38
|
+
static getCAExtraAPY_V3({ rewardInfo, assets, ...restProps }: GetCAExtraAPYProps): Array<ExtraRewardApy>;
|
|
39
|
+
private static getCASingleExtraAPY_V3;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
export interface TokenData {
|
|
3
|
+
address: Address;
|
|
4
|
+
symbol: string;
|
|
5
|
+
decimals: number;
|
|
6
|
+
}
|
|
7
|
+
export interface PoolData {
|
|
8
|
+
address: Address;
|
|
9
|
+
version: number;
|
|
10
|
+
underlyingToken: Address;
|
|
11
|
+
dieselRateRay: bigint;
|
|
12
|
+
dieselToken: Address;
|
|
13
|
+
stakedDieselToken: Address[];
|
|
14
|
+
stakedDieselToken_old: Address[];
|
|
15
|
+
expectedLiquidity: bigint;
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import { type Asset, type NetworkType } from "../../sdk/index.js";
|
|
3
|
+
import type { PoolPointsInfo } from "../index.js";
|
|
4
|
+
import type { PoolData, TokenData } from "./common.js";
|
|
5
|
+
type PartialPool = Pick<PoolData, "expectedLiquidity" | "underlyingToken" | "address">;
|
|
6
|
+
export interface GetPointsByPoolProps {
|
|
7
|
+
poolRewards: Record<Address, Array<PoolPointsInfo<string>>>;
|
|
8
|
+
totalTokenBalances: Record<Address, Asset>;
|
|
9
|
+
pools: Array<PartialPool>;
|
|
10
|
+
tokensList: Record<Address, TokenData>;
|
|
11
|
+
}
|
|
12
|
+
export interface GetTotalTokensOnProtocolProps {
|
|
13
|
+
tokensToCheck: Array<Address>;
|
|
14
|
+
tokensList: Record<Address, TokenData>;
|
|
15
|
+
network: NetworkType;
|
|
16
|
+
}
|
|
17
|
+
export type PoolPointsBase = Record<Address, Array<{
|
|
18
|
+
key: string;
|
|
19
|
+
info: PoolPointsInfo<string>;
|
|
20
|
+
points: bigint;
|
|
21
|
+
}>>;
|
|
22
|
+
export declare function getKeyForPoolPointsInfo(i: PoolPointsInfo<string>): string;
|
|
23
|
+
export declare class GearboxRewardsExtraApy {
|
|
24
|
+
private constructor();
|
|
25
|
+
static getTotalTokensOnProtocol({ tokensToCheck, tokensList, network, }: GetTotalTokensOnProtocolProps): Promise<[`0x${string}`, PromiseSettledResult<Asset>][]>;
|
|
26
|
+
private static getTokenTotal;
|
|
27
|
+
static getPointsByPool({ poolRewards, totalTokenBalances, pools, tokensList, }: GetPointsByPoolProps): PoolPointsBase;
|
|
28
|
+
private static getPoolTokenPoints;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
interface UserOptions {
|
|
3
|
+
params: {
|
|
4
|
+
user: string;
|
|
5
|
+
chainId: number;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface MerkleXYZUserRewardsV4 {
|
|
9
|
+
chain: MerkleXYZChain;
|
|
10
|
+
rewards: Array<{
|
|
11
|
+
root: Address;
|
|
12
|
+
recipient: Address;
|
|
13
|
+
amount: string;
|
|
14
|
+
claimed: string;
|
|
15
|
+
pending: string;
|
|
16
|
+
proofs: Array<Address>;
|
|
17
|
+
token: {
|
|
18
|
+
address: Address;
|
|
19
|
+
chainId: number;
|
|
20
|
+
symbol: string;
|
|
21
|
+
decimals: number;
|
|
22
|
+
};
|
|
23
|
+
breakdowns: Array<{
|
|
24
|
+
reason: string;
|
|
25
|
+
amount: string;
|
|
26
|
+
claimed: string;
|
|
27
|
+
pending: string;
|
|
28
|
+
campaignId: Address;
|
|
29
|
+
}>;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
export type MerkleXYZUserRewardsV4Response = Array<MerkleXYZUserRewardsV4>;
|
|
33
|
+
interface MerkleXYZChain {
|
|
34
|
+
id: number;
|
|
35
|
+
name: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
}
|
|
38
|
+
export declare class MerkleXYZApi {
|
|
39
|
+
private constructor();
|
|
40
|
+
static defaultDomain: string;
|
|
41
|
+
static angleDomain: string;
|
|
42
|
+
static fetchWithFallback: <T>(getUrl: (domain: string) => string) => Promise<import("axios").AxiosResponse<T, any, {}>>;
|
|
43
|
+
static getUserRewardsUrl: (options: UserOptions) => (domain: string) => string;
|
|
44
|
+
}
|
|
45
|
+
export {};
|