@defisaver/sdk 1.3.7 → 1.3.9-dev-plasma

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 (91) hide show
  1. package/esm/src/actions/checkers/AaveV3OpenRatioCheckAction.d.ts +3 -2
  2. package/esm/src/actions/checkers/AaveV3OpenRatioCheckAction.js +5 -7
  3. package/esm/src/actions/checkers/AaveV3RatioCheckAction.d.ts +4 -2
  4. package/esm/src/actions/checkers/AaveV3RatioCheckAction.js +6 -2
  5. package/esm/src/actions/checkers/LiquityV2NewInterestRateCheckerAction.d.ts +15 -0
  6. package/esm/src/actions/checkers/LiquityV2NewInterestRateCheckerAction.js +22 -0
  7. package/esm/src/actions/checkers/index.d.ts +1 -0
  8. package/esm/src/actions/checkers/index.js +1 -0
  9. package/esm/src/actions/fluid/FluidDexOpenAction.d.ts +20 -0
  10. package/esm/src/actions/fluid/FluidDexOpenAction.js +45 -0
  11. package/esm/src/actions/fluid/FluidDexRegularBorrowAction.d.ts +17 -0
  12. package/esm/src/actions/fluid/FluidDexRegularBorrowAction.js +36 -0
  13. package/esm/src/actions/fluid/FluidDexRegularPaybackAction.d.ts +16 -0
  14. package/esm/src/actions/fluid/FluidDexRegularPaybackAction.js +34 -0
  15. package/esm/src/actions/fluid/FluidDexRegularSupplyAction.d.ts +16 -0
  16. package/esm/src/actions/fluid/FluidDexRegularSupplyAction.js +33 -0
  17. package/esm/src/actions/fluid/FluidDexRegularWithdrawAction.d.ts +17 -0
  18. package/esm/src/actions/fluid/FluidDexRegularWithdrawAction.js +37 -0
  19. package/esm/src/actions/fluid/FluidDexSmartCollSupplyAction.d.ts +16 -0
  20. package/esm/src/actions/fluid/FluidDexSmartCollSupplyAction.js +33 -0
  21. package/esm/src/actions/fluid/FluidDexSmartCollWithdrawAction.d.ts +17 -0
  22. package/esm/src/actions/fluid/FluidDexSmartCollWithdrawAction.js +37 -0
  23. package/esm/src/actions/fluid/FluidDexSmartDebtBorrowAction.d.ts +17 -0
  24. package/esm/src/actions/fluid/FluidDexSmartDebtBorrowAction.js +36 -0
  25. package/esm/src/actions/fluid/FluidDexSmartDebtPaybackAction.d.ts +16 -0
  26. package/esm/src/actions/fluid/FluidDexSmartDebtPaybackAction.js +34 -0
  27. package/esm/src/actions/fluid/index.d.ts +9 -0
  28. package/esm/src/actions/fluid/index.js +9 -0
  29. package/esm/src/actions/index.d.ts +3 -1
  30. package/esm/src/actions/index.js +3 -1
  31. package/esm/src/actions/sky/SkyClaimRewardsAction.d.ts +2 -2
  32. package/esm/src/actions/sky/SkyClaimRewardsAction.js +2 -2
  33. package/esm/src/actions/sky/SkyStakingEngineClaimRewards.d.ts +16 -0
  34. package/esm/src/actions/sky/SkyStakingEngineClaimRewards.js +24 -0
  35. package/esm/src/actions/sky/SkyStakingEngineOpen.d.ts +13 -0
  36. package/esm/src/actions/sky/SkyStakingEngineOpen.js +18 -0
  37. package/esm/src/actions/sky/SkyStakingEngineSelectFarm.d.ts +15 -0
  38. package/esm/src/actions/sky/SkyStakingEngineSelectFarm.js +22 -0
  39. package/esm/src/actions/sky/SkyStakingEngineStake.d.ts +16 -0
  40. package/esm/src/actions/sky/SkyStakingEngineStake.js +24 -0
  41. package/esm/src/actions/sky/SkyStakingEngineUnstake.d.ts +16 -0
  42. package/esm/src/actions/sky/SkyStakingEngineUnstake.js +24 -0
  43. package/esm/src/actions/sky/SkyUnstakeAction.d.ts +1 -1
  44. package/esm/src/actions/sky/SkyUnstakeAction.js +1 -1
  45. package/esm/src/actions/sky/index.d.ts +5 -0
  46. package/esm/src/actions/sky/index.js +6 -0
  47. package/esm/src/actions/spark/SparkSPKClaimAction.d.ts +20 -0
  48. package/esm/src/actions/spark/SparkSPKClaimAction.js +25 -0
  49. package/esm/src/actions/spark/index.d.ts +1 -0
  50. package/esm/src/actions/spark/index.js +1 -0
  51. package/esm/src/actions/stkgho/GhoStakeAction.d.ts +15 -0
  52. package/esm/src/actions/stkgho/GhoStakeAction.js +25 -0
  53. package/esm/src/actions/stkgho/index.d.ts +1 -0
  54. package/esm/src/actions/stkgho/index.js +1 -0
  55. package/esm/src/actions/summerfi/SFApproveTokensAction.d.ts +14 -0
  56. package/esm/src/actions/summerfi/SFApproveTokensAction.js +17 -0
  57. package/esm/src/actions/summerfi/index.d.ts +1 -0
  58. package/esm/src/actions/summerfi/index.js +1 -0
  59. package/esm/src/actions/umbrella/UmbrellaClaimRewardsAction.d.ts +16 -0
  60. package/esm/src/actions/umbrella/UmbrellaClaimRewardsAction.js +22 -0
  61. package/esm/src/actions/umbrella/UmbrellaFinalizeUnstakeAction.d.ts +18 -0
  62. package/esm/src/actions/umbrella/UmbrellaFinalizeUnstakeAction.js +31 -0
  63. package/esm/src/actions/umbrella/UmbrellaStakeAction.d.ts +19 -0
  64. package/esm/src/actions/umbrella/UmbrellaStakeAction.js +29 -0
  65. package/esm/src/actions/umbrella/UmbrellaStartUnstakeAction.d.ts +13 -0
  66. package/esm/src/actions/umbrella/UmbrellaStartUnstakeAction.js +18 -0
  67. package/esm/src/actions/umbrella/index.d.ts +4 -0
  68. package/esm/src/actions/umbrella/index.js +4 -0
  69. package/esm/src/addresses.d.ts +737 -71
  70. package/esm/src/addresses.js +145 -10
  71. package/esm/src/config.js +18 -2
  72. package/esm/src/index.d.ts +3794 -1130
  73. package/esm/src/triggers/AaveV3QuotePriceRangeTrigger.d.ts +13 -0
  74. package/esm/src/triggers/AaveV3QuotePriceRangeTrigger.js +15 -0
  75. package/esm/src/triggers/CompV3PriceRangeTrigger.d.ts +10 -0
  76. package/esm/src/triggers/CompV3PriceRangeTrigger.js +12 -0
  77. package/esm/src/triggers/CompV3PriceTrigger.d.ts +10 -0
  78. package/esm/src/triggers/CompV3PriceTrigger.js +12 -0
  79. package/esm/src/triggers/LiquityV2AdjustRateDebtInFrontTrigger.d.ts +8 -0
  80. package/esm/src/triggers/LiquityV2AdjustRateDebtInFrontTrigger.js +10 -0
  81. package/esm/src/triggers/index.d.ts +4 -0
  82. package/esm/src/triggers/index.js +4 -0
  83. package/esm/src/types.d.ts +2 -0
  84. package/package.json +2 -2
  85. package/src/actions/checkers/AaveV3OpenRatioCheckAction.ts +10 -8
  86. package/src/actions/checkers/AaveV3RatioCheckAction.ts +18 -4
  87. package/src/addresses.ts +19 -0
  88. package/src/triggers/AaveV3QuotePriceRangeTrigger.ts +27 -0
  89. package/src/triggers/index.ts +1 -0
  90. package/umd/index.js +1620 -578
  91. package/yarn-error.log +3976 -0
@@ -0,0 +1,13 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256 } from '../types';
3
+ /**
4
+ * AaveV3QuotePriceRangeTrigger
5
+ * @param baseTokenAddr - The address of the base token
6
+ * @param quoteTokenAddr - The address of the quote token
7
+ * @param lowerPrice - The lower price of the range
8
+ * @param upperPrice - The upper price of the range
9
+ * @category Triggers
10
+ */
11
+ export declare class AaveV3QuotePriceRangeTrigger extends Action {
12
+ constructor(baseTokenAddr: EthAddress, quoteTokenAddr: EthAddress, lowerPrice: uint256, upperPrice: uint256);
13
+ }
@@ -0,0 +1,15 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ * AaveV3QuotePriceRangeTrigger
5
+ * @param baseTokenAddr - The address of the base token
6
+ * @param quoteTokenAddr - The address of the quote token
7
+ * @param lowerPrice - The lower price of the range
8
+ * @param upperPrice - The upper price of the range
9
+ * @category Triggers
10
+ */
11
+ export class AaveV3QuotePriceRangeTrigger extends Action {
12
+ constructor(baseTokenAddr, quoteTokenAddr, lowerPrice, upperPrice) {
13
+ super('AaveV3QuotePriceRangeTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint256']], [[baseTokenAddr, quoteTokenAddr, lowerPrice, upperPrice]]);
14
+ }
15
+ }
@@ -0,0 +1,10 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256 } from '../types';
3
+ /**
4
+ *
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export declare class CompV3PriceRangeTrigger extends Action {
9
+ constructor(market: EthAddress, collToken: EthAddress, lowerPrice: uint256, upperPrice: uint256);
10
+ }
@@ -0,0 +1,12 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ *
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export class CompV3PriceRangeTrigger extends Action {
9
+ constructor(market, collToken, lowerPrice, upperPrice) {
10
+ super('CompV3PriceRangeTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint256']], [[market, collToken, lowerPrice, upperPrice]]);
11
+ }
12
+ }
@@ -0,0 +1,10 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256, uint8 } from '../types';
3
+ /**
4
+ *
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export declare class CompV3PriceTrigger extends Action {
9
+ constructor(market: EthAddress, collToken: EthAddress, user: EthAddress, price: uint256, state: uint8);
10
+ }
@@ -0,0 +1,12 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ *
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export class CompV3PriceTrigger extends Action {
9
+ constructor(market, collToken, user, price, state) {
10
+ super('CompV3PriceTrigger', getAddr('Empty'), [['address', 'address', 'address', 'uint256', 'uint8']], [[market, collToken, user, price, state]]);
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256 } from '../types';
3
+ /**
4
+ * @category Triggers
5
+ */
6
+ export declare class LiquityV2AdjustRateDebtInFrontTrigger extends Action {
7
+ constructor(market: EthAddress, troveId: uint256, criticalDebtInFrontLimit: uint256, nonCriticalDebtInFrontLimit: uint256);
8
+ }
@@ -0,0 +1,10 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ * @category Triggers
5
+ */
6
+ export class LiquityV2AdjustRateDebtInFrontTrigger extends Action {
7
+ constructor(market, troveId, criticalDebtInFrontLimit, nonCriticalDebtInFrontLimit) {
8
+ super('LiquityV2AdjustRateDebtInFrontTrigger', getAddr('Empty'), ['address', 'uint256', 'uint256', 'uint256'], [market, troveId, criticalDebtInFrontLimit, nonCriticalDebtInFrontLimit]);
9
+ }
10
+ }
@@ -25,3 +25,7 @@ export * from './LiquityV2RatioTrigger';
25
25
  export * from './ClosePriceTrigger';
26
26
  export * from './LiquityV2QuotePriceTrigger';
27
27
  export * from './FluidRatioTrigger';
28
+ export * from './CompV3PriceTrigger';
29
+ export * from './CompV3PriceRangeTrigger';
30
+ export * from './LiquityV2AdjustRateDebtInFrontTrigger';
31
+ export * from './AaveV3QuotePriceRangeTrigger';
@@ -25,3 +25,7 @@ export * from './LiquityV2RatioTrigger';
25
25
  export * from './ClosePriceTrigger';
26
26
  export * from './LiquityV2QuotePriceTrigger';
27
27
  export * from './FluidRatioTrigger';
28
+ export * from './CompV3PriceTrigger';
29
+ export * from './CompV3PriceRangeTrigger';
30
+ export * from './LiquityV2AdjustRateDebtInFrontTrigger';
31
+ export * from './AaveV3QuotePriceRangeTrigger';
@@ -28,6 +28,8 @@ declare type Networks = {
28
28
  optimism: Network;
29
29
  arbitrum: Network;
30
30
  base: Network;
31
+ linea: Network;
32
+ plasma: Network;
31
33
  };
32
34
  declare type TxSaverData = {
33
35
  maxTxCostInFeeToken: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.3.7",
3
+ "version": "1.3.9-dev-plasma",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/src/index.js",
@@ -23,7 +23,7 @@
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
25
  "@defisaver/eslint-config": "^1.0.0",
26
- "@defisaver/tokens": "^1.7.5",
26
+ "@defisaver/tokens": "^1.7.6",
27
27
  "@ethersproject/address": "^5.0.10",
28
28
  "@ethersproject/solidity": "^5.0.9",
29
29
  "@types/web3-eth-abi": "^1.2.2",
@@ -3,7 +3,7 @@ import { getAddr } from '../../addresses';
3
3
  import { EthAddress, uint256 } from '../../types';
4
4
 
5
5
  /**
6
- * AaveV3OpenRatioCheckAction - Checks aave V3 ratio for users proxy position and reverts if faulty.
6
+ * AaveV3OpenRatioCheckAction - Checks aave V3 ratio for position of `user` and reverts if faulty.
7
7
  *
8
8
  * @dev This checker action is different from AaveV3RatioCheckAction in that it checks current ratio without checking previous ratio.
9
9
  *
@@ -13,18 +13,20 @@ export class AaveV3OpenRatioCheckAction extends Action {
13
13
  /**
14
14
  * @param targetRatio The ratio user want to be at
15
15
  * @param market Address provider for specific market
16
+ * @param user Address of the user (EOA/SW). This param was added later
16
17
  */
17
- constructor(targetRatio:uint256, market:EthAddress) {
18
+ constructor(
19
+ targetRatio: uint256,
20
+ market: EthAddress,
21
+ user: EthAddress = getAddr('Empty'),
22
+ ) {
18
23
  super(
19
24
  'AaveV3OpenRatioCheck',
20
25
  getAddr('Empty'),
21
- ['uint256', 'address'],
22
- [targetRatio, market],
26
+ ['uint256', 'address', 'address'],
27
+ [targetRatio, market, user],
23
28
  );
24
29
 
25
- this.mappableArgs = [
26
- this.args[0],
27
- this.args[1],
28
- ];
30
+ this.mappableArgs = [this.args[0], this.args[1], this.args[2]];
29
31
  }
30
32
  }
@@ -1,6 +1,6 @@
1
1
  import { Action } from '../../Action';
2
2
  import { getAddr } from '../../addresses';
3
- import { uint8, uint256 } from '../../types';
3
+ import { uint8, uint256, EthAddress } from '../../types';
4
4
 
5
5
  /**
6
6
  * AaveV3RatioCheckAction - Checks aave V3 ratio for users proxy position and reverts if faulty
@@ -11,13 +11,27 @@ export class AaveV3RatioCheckAction extends Action {
11
11
  /**
12
12
  * @param ratioState If it should lower/higher
13
13
  * @param targetRatio The ratio user want to be at
14
+ * @param market Address provider for specific market. This param was added later
15
+ * @param user Address of the user (EOA/SW). This param was added later
14
16
  */
15
- constructor(ratioState:uint8, targetRatio:uint256) {
16
- super('AaveV3RatioCheck', getAddr('AaveV3RatioCheck'), ['uint8', 'uint256'], [ratioState, targetRatio]);
17
+ constructor(
18
+ ratioState: uint8,
19
+ targetRatio: uint256,
20
+ market: EthAddress = getAddr('Empty'),
21
+ user: EthAddress = getAddr('Empty'),
22
+ ) {
23
+ super(
24
+ 'AaveV3RatioCheck',
25
+ getAddr('Empty'),
26
+ ['uint8', 'uint256', 'address', 'address'],
27
+ [ratioState, targetRatio, market, user],
28
+ );
17
29
 
18
30
  this.mappableArgs = [
19
31
  this.args[0],
20
32
  this.args[1],
33
+ this.args[2],
34
+ this.args[3],
21
35
  ];
22
36
  }
23
- }
37
+ }
package/src/addresses.ts CHANGED
@@ -379,6 +379,7 @@ export const actionAddresses = {
379
379
  ApproveToken: '0x842a81d2cfe26d401CD63Cc14e9DEf275c197C1a',
380
380
  SendTokenAndUnwrap: '0xd4f69250cb4d1f083Dd372FEace391A16ABbfBDc',
381
381
  ToggleSub: '0xfc19a12e35bb0b5e6a3d3017be9e9022a6486eee',
382
+ UpdateSub: '0xAe6ea1d13dF2bE60dC7933DB56067Cb89d6A2cDe',
382
383
  CreateSub: '0x2daED8030BFC87B3d27c02E2f044B9CF4841Ff3e',
383
384
  TokenBalance: '0xC6FF5b01f7c7b35b6e093fF70D2332B361C5Be5A',
384
385
  TokenizedVaultAdapter: '0xdf31669FEd440f5BfF658ca0bBF0D22B8abdeb73',
@@ -596,6 +597,11 @@ export const actionAddresses = {
596
597
  FluidVaultT1Withdraw: '0x26bE6a2EdE97aE826ed9DA8Fb79428037fe55cEB',
597
598
  FluidVaultT1Supply: '0x028ACA45244d4897ff80ef65ed0b735Bb0D4B0A5',
598
599
  FluidView: '0x6cd4D6af4F292817eA2A2311F099dF26cd015028',
600
+ FluidDexOpen: '0x5eA8Da9679145D51F5eAEC8Bf2f42f47003A8799',
601
+ FluidDexSupply: '0x2fCb7db80d3Be5C1B0049dF074b1AcFbcA93A867',
602
+ FluidDexBorrow: '0x9D40776a876fA67C6757DA386434844cB6616C5F',
603
+ FluidDexPayback: '0xc177c885872592EDA598276bD3FAe5B6d27F80Bf',
604
+ FluidDexWithdraw: '0xEaBA867c49FE8e53F5716fFF8857F239bd7202e1',
599
605
 
600
606
  TokenizedVaultAdapter: '0x88cf6cfa51b6f771570f6df450edf1c886212d3e',
601
607
 
@@ -674,6 +680,19 @@ export const actionAddresses = {
674
680
  AaveV3DelegateWithSig: '0x49658E0CF3883c338397C7257619B280dF581057',
675
681
  AaveV3DelegateCredit: '0x0a9b2080C14DaF008AE87C977dFDf5f5D6D0937F',
676
682
 
683
+ // Fluid
684
+ FluidVaultT1Open: '0x491cc4AFbE0081C3464DeF1114ba27BE114b2401',
685
+ FluidVaultT1Adjust: '0xD37d4DB98E67305ef92f34886B25500500E04Aed',
686
+ FluidVaultT1Borrow: '0x95a8665Ba58aa13A58c60B0803572772cda153dB',
687
+ FluidVaultT1Payback: '0x1420f4977E7B71AFddccBFc6F6e1505CefdF99F0',
688
+ FluidVaultT1Withdraw: '0xcF91546046F16B3c38b890CC508E280BEffa66b9',
689
+ FluidVaultT1Supply: '0x54D1b51d2d68CD0Dc877296527780CA6aff68a39',
690
+ FluidView: '0x27C0BAe2338cE28097122393faF90375B9395dd1',
691
+ FluidDexOpen: '0xF32d5d8D81f2662A02955CE537537088DF29daf5',
692
+ FluidDexSupply: '0x903F7C93FFC4AAbaBB096a7A722F1f057816B399',
693
+ FluidDexBorrow: '0xa2A878a09639D1ab3AF544566c0CA4D0FeAEE65E',
694
+ FluidDexPayback: '0x04ce4b2a9F524d976a8eD8a49B9313C5a2C3ccAD',
695
+ FluidDexWithdraw: '0x17B4ecd173b3Df2F5cB02c53Df8AA34e23Bcb92E',
677
696
  // Pendle
678
697
  PendleTokenRedeem: '0xB4c5f33bb5791D0174Df1879b809Bf57eE540B62',
679
698
  },
@@ -0,0 +1,27 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ import { EthAddress, uint256 } from '../types';
4
+
5
+ /**
6
+ * AaveV3QuotePriceRangeTrigger
7
+ * @param baseTokenAddr - The address of the base token
8
+ * @param quoteTokenAddr - The address of the quote token
9
+ * @param lowerPrice - The lower price of the range
10
+ * @param upperPrice - The upper price of the range
11
+ * @category Triggers
12
+ */
13
+ export class AaveV3QuotePriceRangeTrigger extends Action {
14
+ constructor(
15
+ baseTokenAddr: EthAddress,
16
+ quoteTokenAddr: EthAddress,
17
+ lowerPrice: uint256,
18
+ upperPrice: uint256,
19
+ ) {
20
+ super(
21
+ 'AaveV3QuotePriceRangeTrigger',
22
+ getAddr('Empty'),
23
+ [['address', 'address', 'uint256', 'uint256']],
24
+ [[baseTokenAddr, quoteTokenAddr, lowerPrice, upperPrice]],
25
+ );
26
+ }
27
+ }
@@ -28,3 +28,4 @@ export * from './FluidRatioTrigger';
28
28
  export * from './CompV3PriceTrigger';
29
29
  export * from './CompV3PriceRangeTrigger';
30
30
  export * from './LiquityV2AdjustRateDebtInFrontTrigger';
31
+ export * from './AaveV3QuotePriceRangeTrigger';