@defisaver/sdk 1.2.34-dev-1 → 1.2.35-dev-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.
@@ -14,4 +14,3 @@ export * from './MorphoBlueTargetRatioCheckAction';
14
14
  export * from './LiquityV2RatioCheckAction';
15
15
  export * from './LiquityV2TargetRatioCheckAction';
16
16
  export * from './FluidRatioCheckAction';
17
- export * from './CompV3TargetRatioCheck';
@@ -14,4 +14,3 @@ export * from './MorphoBlueTargetRatioCheckAction';
14
14
  export * from './LiquityV2RatioCheckAction';
15
15
  export * from './LiquityV2TargetRatioCheckAction';
16
16
  export * from './FluidRatioCheckAction';
17
- export * from './CompV3TargetRatioCheck';
@@ -0,0 +1,15 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * GhoStakeAction - stakes GHO tokens
5
+ *
6
+ * @category StkGHO
7
+ */
8
+ export declare class GhoStakeAction extends Action {
9
+ /**
10
+ * @param from - Address to pull the GHO tokens from
11
+ * @param to - Address to send the stkGHO tokens to
12
+ * @param amount - Amount of GHO tokens to stake
13
+ */
14
+ constructor(from: EthAddress, to: EthAddress, amount: uint256);
15
+ }
@@ -0,0 +1,25 @@
1
+ import { Action } from '../../Action';
2
+ import { requireAddress } from '../../utils/general';
3
+ import { getAddr } from '../../addresses';
4
+ /**
5
+ * GhoStakeAction - stakes GHO tokens
6
+ *
7
+ * @category StkGHO
8
+ */
9
+ export class GhoStakeAction extends Action {
10
+ /**
11
+ * @param from - Address to pull the GHO tokens from
12
+ * @param to - Address to send the stkGHO tokens to
13
+ * @param amount - Amount of GHO tokens to stake
14
+ */
15
+ constructor(from, to, amount) {
16
+ requireAddress(from);
17
+ requireAddress(to);
18
+ super('GhoStake', getAddr('GhoStake'), ['address', 'address', 'uint256'], [from, to, amount]);
19
+ this.mappableArgs = [
20
+ this.args[0],
21
+ this.args[1],
22
+ this.args[2],
23
+ ];
24
+ }
25
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './GhoClaimAAVEAction';
2
2
  export * from './GhoFinalizeUnstakeAction';
3
3
  export * from './GhoStartUnstakeAction';
4
+ export * from './GhoStakeAction';
@@ -1,3 +1,4 @@
1
1
  export * from './GhoClaimAAVEAction';
2
2
  export * from './GhoFinalizeUnstakeAction';
3
3
  export * from './GhoStartUnstakeAction';
4
+ export * from './GhoStakeAction';
@@ -69,6 +69,7 @@ export declare const actionAddresses: {
69
69
  AaveV3DelegateWithSig: string;
70
70
  GhoClaimAAVE: string;
71
71
  GhoUnstake: string;
72
+ GhoStake: string;
72
73
  LSVWithdraw: string;
73
74
  LSVBorrow: string;
74
75
  LSVSupply: string;
@@ -365,6 +366,7 @@ export declare const actionAddresses: {
365
366
  AaveV3View?: undefined;
366
367
  GhoClaimAAVE?: undefined;
367
368
  GhoUnstake?: undefined;
369
+ GhoStake?: undefined;
368
370
  LSVWithdraw?: undefined;
369
371
  LSVBorrow?: undefined;
370
372
  LSVSupply?: undefined;
@@ -661,6 +663,7 @@ export declare const actionAddresses: {
661
663
  AaveV3View?: undefined;
662
664
  GhoClaimAAVE?: undefined;
663
665
  GhoUnstake?: undefined;
666
+ GhoStake?: undefined;
664
667
  LSVWithdraw?: undefined;
665
668
  LSVBorrow?: undefined;
666
669
  LSVSupply?: undefined;
@@ -924,6 +927,7 @@ export declare const actionAddresses: {
924
927
  AaveClaimStkAave?: undefined;
925
928
  GhoClaimAAVE?: undefined;
926
929
  GhoUnstake?: undefined;
930
+ GhoStake?: undefined;
927
931
  LSVWithdraw?: undefined;
928
932
  LSVBorrow?: undefined;
929
933
  LSVSupply?: undefined;
@@ -77,6 +77,7 @@ export const actionAddresses = {
77
77
  AaveV3DelegateWithSig: '0x9253E22Ce4f0AeE541301CF8cC29843f9083a1F4',
78
78
  GhoClaimAAVE: '0xA53060d822cB31AFd5B26D899130a14E8Efc5917',
79
79
  GhoUnstake: '0x3fD02e65B4fb12381946D03815Ff3FF8Ebe2fC63',
80
+ GhoStake: '0x6cfBFd04702f3b7d4fc52D457eDf91D6E4A081bb',
80
81
  // LSV action
81
82
  LSVWithdraw: '0xB0197CF09cc4c9891B0c2fCbE4AD7323154cA8a5',
82
83
  LSVBorrow: '0x7dFB434527Fdb39854156cDBa9bF4799E36E7e82',
@@ -80,6 +80,7 @@ declare const actionAddressesAllChains: {
80
80
  AaveV3DelegateWithSig: string;
81
81
  GhoClaimAAVE: string;
82
82
  GhoUnstake: string;
83
+ GhoStake: string;
83
84
  LSVWithdraw: string;
84
85
  LSVBorrow: string;
85
86
  LSVSupply: string;
@@ -376,6 +377,7 @@ declare const actionAddressesAllChains: {
376
377
  AaveV3View?: undefined;
377
378
  GhoClaimAAVE?: undefined;
378
379
  GhoUnstake?: undefined;
380
+ GhoStake?: undefined;
379
381
  LSVWithdraw?: undefined;
380
382
  LSVBorrow?: undefined;
381
383
  LSVSupply?: undefined;
@@ -672,6 +674,7 @@ declare const actionAddressesAllChains: {
672
674
  AaveV3View?: undefined;
673
675
  GhoClaimAAVE?: undefined;
674
676
  GhoUnstake?: undefined;
677
+ GhoStake?: undefined;
675
678
  LSVWithdraw?: undefined;
676
679
  LSVBorrow?: undefined;
677
680
  LSVSupply?: undefined;
@@ -935,6 +938,7 @@ declare const actionAddressesAllChains: {
935
938
  AaveClaimStkAave?: undefined;
936
939
  GhoClaimAAVE?: undefined;
937
940
  GhoUnstake?: undefined;
941
+ GhoStake?: undefined;
938
942
  LSVWithdraw?: undefined;
939
943
  LSVBorrow?: undefined;
940
944
  LSVSupply?: undefined;
@@ -1178,6 +1182,7 @@ declare const actionAddresses: (chainId?: null) => {
1178
1182
  AaveV3DelegateWithSig: string;
1179
1183
  GhoClaimAAVE: string;
1180
1184
  GhoUnstake: string;
1185
+ GhoStake: string;
1181
1186
  LSVWithdraw: string;
1182
1187
  LSVBorrow: string;
1183
1188
  LSVSupply: string;
@@ -1474,6 +1479,7 @@ declare const actionAddresses: (chainId?: null) => {
1474
1479
  AaveV3View?: undefined;
1475
1480
  GhoClaimAAVE?: undefined;
1476
1481
  GhoUnstake?: undefined;
1482
+ GhoStake?: undefined;
1477
1483
  LSVWithdraw?: undefined;
1478
1484
  LSVBorrow?: undefined;
1479
1485
  LSVSupply?: undefined;
@@ -1770,6 +1776,7 @@ declare const actionAddresses: (chainId?: null) => {
1770
1776
  AaveV3View?: undefined;
1771
1777
  GhoClaimAAVE?: undefined;
1772
1778
  GhoUnstake?: undefined;
1779
+ GhoStake?: undefined;
1773
1780
  LSVWithdraw?: undefined;
1774
1781
  LSVBorrow?: undefined;
1775
1782
  LSVSupply?: undefined;
@@ -2033,6 +2040,7 @@ declare const actionAddresses: (chainId?: null) => {
2033
2040
  AaveClaimStkAave?: undefined;
2034
2041
  GhoClaimAAVE?: undefined;
2035
2042
  GhoUnstake?: undefined;
2043
+ GhoStake?: undefined;
2036
2044
  LSVWithdraw?: undefined;
2037
2045
  LSVBorrow?: undefined;
2038
2046
  LSVSupply?: undefined;
@@ -2419,6 +2427,7 @@ declare const _default: {
2419
2427
  AaveV3DelegateWithSig: string;
2420
2428
  GhoClaimAAVE: string;
2421
2429
  GhoUnstake: string;
2430
+ GhoStake: string;
2422
2431
  LSVWithdraw: string;
2423
2432
  LSVBorrow: string;
2424
2433
  LSVSupply: string;
@@ -2715,6 +2724,7 @@ declare const _default: {
2715
2724
  AaveV3View?: undefined;
2716
2725
  GhoClaimAAVE?: undefined;
2717
2726
  GhoUnstake?: undefined;
2727
+ GhoStake?: undefined;
2718
2728
  LSVWithdraw?: undefined;
2719
2729
  LSVBorrow?: undefined;
2720
2730
  LSVSupply?: undefined;
@@ -3011,6 +3021,7 @@ declare const _default: {
3011
3021
  AaveV3View?: undefined;
3012
3022
  GhoClaimAAVE?: undefined;
3013
3023
  GhoUnstake?: undefined;
3024
+ GhoStake?: undefined;
3014
3025
  LSVWithdraw?: undefined;
3015
3026
  LSVBorrow?: undefined;
3016
3027
  LSVSupply?: undefined;
@@ -3274,6 +3285,7 @@ declare const _default: {
3274
3285
  AaveClaimStkAave?: undefined;
3275
3286
  GhoClaimAAVE?: undefined;
3276
3287
  GhoUnstake?: undefined;
3288
+ GhoStake?: undefined;
3277
3289
  LSVWithdraw?: undefined;
3278
3290
  LSVBorrow?: undefined;
3279
3291
  LSVSupply?: undefined;
@@ -3517,6 +3529,7 @@ declare const _default: {
3517
3529
  AaveV3DelegateWithSig: string;
3518
3530
  GhoClaimAAVE: string;
3519
3531
  GhoUnstake: string;
3532
+ GhoStake: string;
3520
3533
  LSVWithdraw: string;
3521
3534
  LSVBorrow: string;
3522
3535
  LSVSupply: string;
@@ -3813,6 +3826,7 @@ declare const _default: {
3813
3826
  AaveV3View?: undefined;
3814
3827
  GhoClaimAAVE?: undefined;
3815
3828
  GhoUnstake?: undefined;
3829
+ GhoStake?: undefined;
3816
3830
  LSVWithdraw?: undefined;
3817
3831
  LSVBorrow?: undefined;
3818
3832
  LSVSupply?: undefined;
@@ -4109,6 +4123,7 @@ declare const _default: {
4109
4123
  AaveV3View?: undefined;
4110
4124
  GhoClaimAAVE?: undefined;
4111
4125
  GhoUnstake?: undefined;
4126
+ GhoStake?: undefined;
4112
4127
  LSVWithdraw?: undefined;
4113
4128
  LSVBorrow?: undefined;
4114
4129
  LSVSupply?: undefined;
@@ -4372,6 +4387,7 @@ declare const _default: {
4372
4387
  AaveClaimStkAave?: undefined;
4373
4388
  GhoClaimAAVE?: undefined;
4374
4389
  GhoUnstake?: undefined;
4390
+ GhoStake?: undefined;
4375
4391
  LSVWithdraw?: undefined;
4376
4392
  LSVBorrow?: undefined;
4377
4393
  LSVSupply?: undefined;
@@ -25,5 +25,3 @@ 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';
@@ -25,5 +25,3 @@ 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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.2.34-dev-1",
3
+ "version": "1.2.35-dev-1",
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.6.19",
26
+ "@defisaver/tokens": "^1.6.15",
27
27
  "@ethersproject/address": "^5.0.10",
28
28
  "@ethersproject/solidity": "^5.0.9",
29
29
  "@types/web3-eth-abi": "^1.2.2",
@@ -14,4 +14,3 @@ export * from './MorphoBlueTargetRatioCheckAction';
14
14
  export * from './LiquityV2RatioCheckAction';
15
15
  export * from './LiquityV2TargetRatioCheckAction';
16
16
  export * from './FluidRatioCheckAction';
17
- export * from './CompV3TargetRatioCheck';
@@ -0,0 +1,32 @@
1
+ import { Action } from '../../Action';
2
+ import { requireAddress } from '../../utils/general';
3
+ import { getAddr } from '../../addresses';
4
+ import { EthAddress, uint256 } from '../../types';
5
+
6
+ /**
7
+ * GhoStakeAction - stakes GHO tokens
8
+ *
9
+ * @category StkGHO
10
+ */
11
+ export class GhoStakeAction extends Action {
12
+ /**
13
+ * @param from - Address to pull the GHO tokens from
14
+ * @param to - Address to send the stkGHO tokens to
15
+ * @param amount - Amount of GHO tokens to stake
16
+ */
17
+ constructor(from: EthAddress, to: EthAddress, amount: uint256) {
18
+ requireAddress(from);
19
+ requireAddress(to);
20
+ super(
21
+ 'GhoStake',
22
+ getAddr('GhoStake'),
23
+ ['address', 'address', 'uint256'],
24
+ [from, to, amount],
25
+ );
26
+ this.mappableArgs = [
27
+ this.args[0],
28
+ this.args[1],
29
+ this.args[2],
30
+ ];
31
+ }
32
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './GhoClaimAAVEAction';
2
2
  export * from './GhoFinalizeUnstakeAction';
3
- export * from './GhoStartUnstakeAction';
3
+ export * from './GhoStartUnstakeAction';
4
+ export * from './GhoStakeAction';
package/src/addresses.ts CHANGED
@@ -84,6 +84,7 @@ export const actionAddresses = {
84
84
  AaveV3DelegateWithSig: '0x9253E22Ce4f0AeE541301CF8cC29843f9083a1F4',
85
85
  GhoClaimAAVE: '0xA53060d822cB31AFd5B26D899130a14E8Efc5917',
86
86
  GhoUnstake: '0x3fD02e65B4fb12381946D03815Ff3FF8Ebe2fC63',
87
+ GhoStake: '0x6cfBFd04702f3b7d4fc52D457eDf91D6E4A081bb',
87
88
 
88
89
  // LSV action
89
90
  LSVWithdraw: '0xB0197CF09cc4c9891B0c2fCbE4AD7323154cA8a5',
@@ -25,5 +25,3 @@ 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';
@@ -1,6 +1,6 @@
1
1
  const AbiCoder = require('web3-eth-abi');
2
2
  const { BN, padLeft, toHex } = require('web3-utils');
3
- const {getAssetInfo, utils: {compare}} = require("@defisaver/tokens");
3
+ const {getAssetInfo, utils} = require("@defisaver/tokens");
4
4
  const RecipeAbi = require('../../src/abis/Recipe.json');
5
5
  const MockAccessLists = require('./MockAccessLists');
6
6
  const dfs = require("../../src");
@@ -86,7 +86,7 @@ class Recipe {
86
86
  }
87
87
  }
88
88
  }
89
- return uniqueAssetOwnerPairs.filter(({ address }) => !compare(address, getAssetInfo('ETH').address));
89
+ return uniqueAssetOwnerPairs.filter(({ address }) => !utils.compare(address, getAssetInfo('ETH').address));
90
90
  }
91
91
 
92
92
  /**