@gearbox-protocol/sdk 10.0.0 → 10.2.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.
Files changed (38) hide show
  1. package/dist/cjs/abi/router/midasWorker.js +541 -0
  2. package/dist/cjs/plugins/adapters/AdaptersPlugin.js +5 -2
  3. package/dist/cjs/plugins/adapters/abi/actionAbi.js +6 -0
  4. package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +6 -0
  5. package/dist/cjs/plugins/adapters/abi/conctructorAbiPatterns.js +7 -0
  6. package/dist/cjs/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.js +51 -0
  7. package/dist/cjs/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +51 -0
  8. package/dist/cjs/plugins/adapters/contracts/index.js +6 -0
  9. package/dist/cjs/plugins/adapters/types.js +2 -0
  10. package/dist/cjs/sdk/router/AbstractRouterContract.js +6 -3
  11. package/dist/cjs/sdk/router/RouterV310Contract.js +7 -3
  12. package/dist/cjs/sdk/utils/filterDust.js +21 -2
  13. package/dist/cjs/sdk/utils/index.js +2 -0
  14. package/dist/cjs/sdk/utils/isDust.js +40 -0
  15. package/dist/esm/abi/router/midasWorker.js +517 -0
  16. package/dist/esm/plugins/adapters/AdaptersPlugin.js +7 -1
  17. package/dist/esm/plugins/adapters/abi/actionAbi.js +6 -0
  18. package/dist/esm/plugins/adapters/abi/conctructorAbi.js +7 -0
  19. package/dist/esm/plugins/adapters/abi/conctructorAbiPatterns.js +6 -0
  20. package/dist/esm/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.js +27 -0
  21. package/dist/esm/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +27 -0
  22. package/dist/esm/plugins/adapters/contracts/index.js +3 -0
  23. package/dist/esm/plugins/adapters/types.js +2 -0
  24. package/dist/esm/sdk/router/AbstractRouterContract.js +7 -4
  25. package/dist/esm/sdk/router/RouterV310Contract.js +7 -3
  26. package/dist/esm/sdk/utils/filterDust.js +19 -1
  27. package/dist/esm/sdk/utils/index.js +1 -0
  28. package/dist/esm/sdk/utils/isDust.js +16 -0
  29. package/dist/types/abi/router/midasWorker.d.ts +726 -0
  30. package/dist/types/plugins/adapters/abi/conctructorAbiPatterns.d.ts +10 -0
  31. package/dist/types/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.d.ts +13 -0
  32. package/dist/types/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.d.ts +13 -0
  33. package/dist/types/plugins/adapters/contracts/index.d.ts +3 -0
  34. package/dist/types/plugins/adapters/types.d.ts +3 -1
  35. package/dist/types/sdk/utils/filterDust.d.ts +10 -0
  36. package/dist/types/sdk/utils/index.d.ts +1 -0
  37. package/dist/types/sdk/utils/isDust.d.ts +18 -0
  38. package/package.json +7 -7
@@ -55,6 +55,16 @@ export declare const UINT_REFERRAL_ADAPTER_ABI: readonly [{
55
55
  readonly type: "uint16";
56
56
  readonly name: "referral";
57
57
  }];
58
+ export declare const REFERER_ID_ADAPTER_ABI: readonly [{
59
+ readonly type: "address";
60
+ readonly name: "creditManager";
61
+ }, {
62
+ readonly type: "address";
63
+ readonly name: "target";
64
+ }, {
65
+ readonly type: "bytes32";
66
+ readonly name: "referrerId";
67
+ }];
58
68
  export declare const CURVE_V1_ADAPTER_310_ABI: readonly [{
59
69
  readonly type: "address";
60
70
  readonly name: "creditManager";
@@ -0,0 +1,13 @@
1
+ import { type Address } from "viem";
2
+ import type { GearboxSDK } from "../../../sdk/index.js";
3
+ import type { AbstractAdapterContractOptions } from "./AbstractAdapter.js";
4
+ import { AbstractAdapterContract } from "./AbstractAdapter.js";
5
+ declare const abi: readonly [];
6
+ type abi = typeof abi;
7
+ export declare class MidasIssuanceVaultAdapterContract extends AbstractAdapterContract<abi> {
8
+ readonly mToken: Address;
9
+ readonly referrerId: string;
10
+ readonly allowedTokens: Address[];
11
+ constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<abi>, "abi">);
12
+ }
13
+ export {};
@@ -0,0 +1,13 @@
1
+ import { type Address } from "viem";
2
+ import type { GearboxSDK } from "../../../sdk/index.js";
3
+ import type { AbstractAdapterContractOptions } from "./AbstractAdapter.js";
4
+ import { AbstractAdapterContract } from "./AbstractAdapter.js";
5
+ declare const abi: readonly [];
6
+ type abi = typeof abi;
7
+ export declare class MidasRedemptionVaultAdapterContract extends AbstractAdapterContract<abi> {
8
+ readonly gateway: Address;
9
+ readonly mToken: Address;
10
+ readonly allowedTokens: Address[];
11
+ constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<abi>, "abi">);
12
+ }
13
+ export {};
@@ -1,6 +1,7 @@
1
1
  export * from "./AbstractAdapter.js";
2
2
  export * from "./BalancerV2VaultAdapterContract.js";
3
3
  export * from "./BalancerV3RouterAdapterContract.js";
4
+ export * from "./BalancerV3WrapperAdapterContract.js";
4
5
  export * from "./CamelotV3AdapterContract.js";
5
6
  export * from "./ConvexV1BaseRewardPoolAdapterContract.js";
6
7
  export * from "./ConvexV1BoosterAdapterContract.js";
@@ -23,6 +24,8 @@ export * from "./MellowDVVAdapterContract.js";
23
24
  export * from "./MellowERC4626VaultAdapterContract.js";
24
25
  export * from "./MellowVaultAdapterContract.js";
25
26
  export * from "./MellowWrapperAdapterContract.js";
27
+ export * from "./MidasIssuanceVaultAdapterContract.js";
28
+ export * from "./MidasRedemptionVaultAdapterContract.js";
26
29
  export * from "./PendleRouterAdapterContract.js";
27
30
  export * from "./StakingRewardsAdapterContract.js";
28
31
  export * from "./TraderJoeRouterAdapterContract.js";
@@ -1,7 +1,7 @@
1
1
  import type { AbiParameter } from "viem";
2
2
  export type VersionedAbi = Record<number, readonly AbiParameter[]>;
3
3
  export type AdapterContractTypeLegacy = "AD_AAVE_V3_LENDING_POOL" | "AD_BALANCER_VAULT" | "AD_CAMELOT_V3_ROUTER" | "AD_CONVEX_L2_BOOSTER" | "AD_CONVEX_L2_REWARD_POOL" | "AD_CONVEX_V1_BASE_REWARD_POOL" | "AD_CONVEX_V1_BOOSTER" | "AD_CURVE_STABLE_NG" | "AD_CURVE_V1_2ASSETS" | "AD_CURVE_V1_3ASSETS" | "AD_CURVE_V1_4ASSETS" | "AD_CURVE_V1_EXCHANGE_ONLY" | "AD_CURVE_V1_STECRV_POOL" | "AD_CURVE_V1_WRAPPER" | "AD_DAI_USDS_EXCHANGE" | "AD_EQUALIZER_ROUTER" | "AD_ERC4626_VAULT" | "AD_LIDO_V1" | "AD_LIDO_WSTETH_V1" | "AD_MELLOW_ERC4626_VAULT" | "AD_MELLOW_LRT_VAULT" | "AD_PENDLE_ROUTER" | "AD_STAKING_REWARDS" | "AD_SYMBIOTIC_DEFAULT_COLLATERAL" | "AD_UNISWAP_V2_ROUTER" | "AD_UNISWAP_V3_ROUTER" | "AD_VELODROME_V2_ROUTER" | "AD_YEARN_V2" | "AD_ZIRCUIT_POOL";
4
- export type AdapterContractType = "ADAPTER::BALANCER_V3_ROUTER" | "ADAPTER::BALANCER_V3_WRAPPER" | "ADAPTER::BALANCER_VAULT" | "ADAPTER::CAMELOT_V3_ROUTER" | "ADAPTER::CURVE_STABLE_NG" | "ADAPTER::CURVE_V1_2ASSETS" | "ADAPTER::CURVE_V1_3ASSETS" | "ADAPTER::CURVE_V1_4ASSETS" | "ADAPTER::CURVE_V1_STECRV_POOL" | "ADAPTER::CURVE_V1_WRAPPER" | "ADAPTER::CVX_V1_BASE_REWARD_POOL" | "ADAPTER::CVX_V1_BOOSTER" | "ADAPTER::DAI_USDS_EXCHANGE" | "ADAPTER::EQUALIZER_ROUTER" | "ADAPTER::ERC4626_VAULT" | "ADAPTER::ERC4626_VAULT_REFERRAL" | "ADAPTER::FLUID_DEX" | "ADAPTER::INFRARED_VAULT" | "ADAPTER::KODIAK_ISLAND_GATEWAY" | "ADAPTER::LIDO_V1" | "ADAPTER::LIDO_WSTETH_V1" | "ADAPTER::MELLOW_CLAIMER" | "ADAPTER::MELLOW_DVV" | "ADAPTER::MELLOW_ERC4626_VAULT" | "ADAPTER::MELLOW_LRT_VAULT" | "ADAPTER::MELLOW_WRAPPER" | "ADAPTER::PENDLE_ROUTER" | "ADAPTER::STAKING_REWARDS" | "ADAPTER::TRADERJOE_ROUTER" | "ADAPTER::UNISWAP_V2_ROUTER" | "ADAPTER::UNISWAP_V3_ROUTER" | "ADAPTER::UPSHIFT_VAULT" | "ADAPTER::VELODROME_V2_ROUTER" | "ADAPTER::YEARN_V2";
4
+ export type AdapterContractType = "ADAPTER::BALANCER_V3_ROUTER" | "ADAPTER::BALANCER_V3_WRAPPER" | "ADAPTER::BALANCER_VAULT" | "ADAPTER::CAMELOT_V3_ROUTER" | "ADAPTER::CURVE_STABLE_NG" | "ADAPTER::CURVE_V1_2ASSETS" | "ADAPTER::CURVE_V1_3ASSETS" | "ADAPTER::CURVE_V1_4ASSETS" | "ADAPTER::CURVE_V1_STECRV_POOL" | "ADAPTER::CURVE_V1_WRAPPER" | "ADAPTER::CVX_V1_BASE_REWARD_POOL" | "ADAPTER::CVX_V1_BOOSTER" | "ADAPTER::DAI_USDS_EXCHANGE" | "ADAPTER::EQUALIZER_ROUTER" | "ADAPTER::ERC4626_VAULT" | "ADAPTER::ERC4626_VAULT_REFERRAL" | "ADAPTER::FLUID_DEX" | "ADAPTER::INFRARED_VAULT" | "ADAPTER::KODIAK_ISLAND_GATEWAY" | "ADAPTER::LIDO_V1" | "ADAPTER::LIDO_WSTETH_V1" | "ADAPTER::MELLOW_CLAIMER" | "ADAPTER::MELLOW_DVV" | "ADAPTER::MELLOW_ERC4626_VAULT" | "ADAPTER::MELLOW_LRT_VAULT" | "ADAPTER::MELLOW_WRAPPER" | "ADAPTER::MIDAS_ISSUANCE_VAULT" | "ADAPTER::MIDAS_REDEMPTION_VAULT" | "ADAPTER::PENDLE_ROUTER" | "ADAPTER::STAKING_REWARDS" | "ADAPTER::TRADERJOE_ROUTER" | "ADAPTER::UNISWAP_V2_ROUTER" | "ADAPTER::UNISWAP_V3_ROUTER" | "ADAPTER::UPSHIFT_VAULT" | "ADAPTER::VELODROME_V2_ROUTER" | "ADAPTER::YEARN_V2";
5
5
  export declare enum AdapterType {
6
6
  BALANCER_V3_ROUTER = "BALANCER_V3_ROUTER",
7
7
  BALANCER_V3_WRAPPER = "BALANCER_V3_WRAPPER",
@@ -29,6 +29,8 @@ export declare enum AdapterType {
29
29
  MELLOW_ERC4626_VAULT = "MELLOW_ERC4626_VAULT",
30
30
  MELLOW_LRT_VAULT = "MELLOW_LRT_VAULT",
31
31
  MELLOW_WRAPPER = "MELLOW_WRAPPER",
32
+ MIDAS_ISSUANCE_VAULT = "MIDAS_ISSUANCE_VAULT",
33
+ MIDAS_REDEMPTION_VAULT = "MIDAS_REDEMPTION_VAULT",
32
34
  PENDLE_ROUTER = "PENDLE_ROUTER",
33
35
  STAKING_REWARDS = "STAKING_REWARDS",
34
36
  TRADERJOE_ROUTER = "TRADERJOE_ROUTER",
@@ -1,8 +1,18 @@
1
1
  import type { Address } from "viem";
2
2
  import type { CreditAccountData } from "../base/index.js";
3
+ import type { GearboxSDK } from "../GearboxSDK.js";
3
4
  /**
4
5
  * Helper function to filter out low-balance assets
5
6
  * @param account
6
7
  * @returns
7
8
  */
8
9
  export declare function filterDust(account: CreditAccountData): Record<Address, bigint>;
10
+ export interface FilterDustUSDOptions {
11
+ sdk: GearboxSDK;
12
+ account: CreditAccountData;
13
+ /**
14
+ * Dust threshold in USD, without decimals
15
+ */
16
+ minBalanceUSD?: bigint;
17
+ }
18
+ export declare function filterDustUSD(opts: FilterDustUSDOptions): Record<Address, bigint>;
@@ -7,6 +7,7 @@ export * from "./etherscan.js";
7
7
  export * from "./filterDust.js";
8
8
  export * from "./formatter.js";
9
9
  export * from "./hex.js";
10
+ export * from "./isDust.js";
10
11
  export * from "./json.js";
11
12
  export * from "./mappers.js";
12
13
  export * from "./retry.js";
@@ -0,0 +1,18 @@
1
+ import type { Address } from "viem";
2
+ import type { GearboxSDK } from "../GearboxSDK.js";
3
+ export interface IsDustOptions {
4
+ sdk: GearboxSDK;
5
+ token: Address;
6
+ balance: bigint;
7
+ creditManager: Address;
8
+ /**
9
+ * Dust threshold in USD, without decimals
10
+ */
11
+ minBalanceUSD?: bigint;
12
+ }
13
+ /**
14
+ * Checks if balance of token is dust, by checking getting usd prices from oracle
15
+ * @param opts
16
+ * @returns
17
+ */
18
+ export declare function isDust(opts: IsDustOptions): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "10.0.0",
3
+ "version": "10.2.0",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",
@@ -51,7 +51,7 @@
51
51
  "typecheck:ci": "tsc --noEmit"
52
52
  },
53
53
  "dependencies": {
54
- "@gearbox-protocol/integrations-v3": "1.48.0",
54
+ "@gearbox-protocol/integrations-v3": "1.49.0",
55
55
  "@redstone-finance/evm-connector": "^0.9.0",
56
56
  "@redstone-finance/protocol": "^0.9.0",
57
57
  "@redstone-finance/sdk": "^0.9.0",
@@ -65,22 +65,22 @@
65
65
  "zod": "^4.1.12"
66
66
  },
67
67
  "devDependencies": {
68
- "@biomejs/biome": "^2.2.6",
68
+ "@biomejs/biome": "^2.3.1",
69
69
  "@commitlint/cli": "^20.1.0",
70
70
  "@commitlint/config-conventional": "^20.0.0",
71
- "@gearbox-protocol/biome-config": "^1.0.5",
71
+ "@gearbox-protocol/biome-config": "^1.0.7",
72
72
  "@types/cross-spawn": "^6.0.6",
73
73
  "axios": "^1.12.2",
74
74
  "cross-spawn": "^7.0.6",
75
75
  "husky": "^9.1.7",
76
- "lint-staged": "^16.2.4",
77
- "pino": "^10.0.0",
76
+ "lint-staged": "^16.2.6",
77
+ "pino": "^10.1.0",
78
78
  "pino-pretty": "^13.1.2",
79
79
  "tsup": "^8.5.0",
80
80
  "tsx": "^4.20.6",
81
81
  "typescript": "^5.9.3",
82
82
  "viem-deal": "^2.0.4",
83
- "vitest": "^3.2.4"
83
+ "vitest": "^4.0.4"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "axios": "^1.0.0",