@defisaver/sdk 1.2.19 → 1.2.20

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.
@@ -0,0 +1,17 @@
1
+ import { Action } from '../../Action';
2
+ import { bytes32, EthAddress, uint256 } from '../../types';
3
+ /**
4
+ * MorphoBlueClaimAction - Claim rewards for MorphoBlue users
5
+ *
6
+ * @category MorphoBlue
7
+ */
8
+ export declare class MorphoBlueClaimAction extends Action {
9
+ /**
10
+ * @param to The address to which to send the reward tokens. Only used if claiming for the smart wallet.
11
+ * @param token The address of the token to claim.
12
+ * @param distributor The address of the morpho distributor contract.
13
+ * @param claimable The overall claimable amount of token rewards.
14
+ * @param merkleProof The merkle proof to claim the rewards.
15
+ */
16
+ constructor(to: EthAddress, token: EthAddress, distributor: EthAddress, claimable: uint256, merkleProof: Array<bytes32>);
17
+ }
@@ -0,0 +1,19 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * MorphoBlueClaimAction - Claim rewards for MorphoBlue users
5
+ *
6
+ * @category MorphoBlue
7
+ */
8
+ export class MorphoBlueClaimAction extends Action {
9
+ /**
10
+ * @param to The address to which to send the reward tokens. Only used if claiming for the smart wallet.
11
+ * @param token The address of the token to claim.
12
+ * @param distributor The address of the morpho distributor contract.
13
+ * @param claimable The overall claimable amount of token rewards.
14
+ * @param merkleProof The merkle proof to claim the rewards.
15
+ */
16
+ constructor(to, token, distributor, claimable, merkleProof) {
17
+ super('MorphoBlueClaim', getAddr('MorphoBlueClaim'), ['address', 'address', 'address', 'uint256', 'bytes32[]'], [to, token, distributor, claimable, merkleProof]);
18
+ }
19
+ }
@@ -8,3 +8,4 @@ export * from './MorphoBlueSetAuthAction';
8
8
  export * from './MorphoBlueSetAuthWithSigAction';
9
9
  export * from './MorphoTokenWrapAction';
10
10
  export * from './MorphoBlueReallocateLiquidityAction';
11
+ export * from './MorphoBlueClaimAction';
@@ -8,3 +8,4 @@ export * from './MorphoBlueSetAuthAction';
8
8
  export * from './MorphoBlueSetAuthWithSigAction';
9
9
  export * from './MorphoTokenWrapAction';
10
10
  export * from './MorphoBlueReallocateLiquidityAction';
11
+ export * from './MorphoBlueClaimAction';
@@ -223,6 +223,7 @@ export declare const actionAddresses: {
223
223
  MorphoBlueSetAuthWithSig: string;
224
224
  MorphoTokenWrap: string;
225
225
  MorphoBlueReallocateLiquidity: string;
226
+ MorphoBlueClaim: string;
226
227
  LlamaLendCreate: string;
227
228
  LlamaLendSupply: string;
228
229
  LlamaLendBorrow: string;
@@ -485,6 +486,7 @@ export declare const actionAddresses: {
485
486
  MorphoBlueSetAuthWithSig?: undefined;
486
487
  MorphoTokenWrap?: undefined;
487
488
  MorphoBlueReallocateLiquidity?: undefined;
489
+ MorphoBlueClaim?: undefined;
488
490
  LlamaLendCreate?: undefined;
489
491
  LlamaLendSupply?: undefined;
490
492
  LlamaLendBorrow?: undefined;
@@ -759,6 +761,7 @@ export declare const actionAddresses: {
759
761
  MorphoBlueSetAuthWithSig?: undefined;
760
762
  MorphoTokenWrap?: undefined;
761
763
  MorphoBlueReallocateLiquidity?: undefined;
764
+ MorphoBlueClaim?: undefined;
762
765
  EulerV2Supply?: undefined;
763
766
  EulerV2Withdraw?: undefined;
764
767
  EulerV2Borrow?: undefined;
@@ -827,6 +830,7 @@ export declare const actionAddresses: {
827
830
  MorphoBlueSetAuthWithSig: string;
828
831
  MorphoBlueView: string;
829
832
  MorphoBlueReallocateLiquidity: string;
833
+ MorphoBlueClaim: string;
830
834
  FluidVaultT1Open: string;
831
835
  FluidVaultT1Adjust: string;
832
836
  FluidVaultT1Borrow: string;
@@ -255,6 +255,7 @@ export const actionAddresses = {
255
255
  MorphoBlueSetAuthWithSig: '0xE2d5fCDBf73BAd24A0FCAf6B2733933A98021808',
256
256
  MorphoTokenWrap: '0x71b6d268c2Aabcb0dA16CbA4c77e65d9e29b0644',
257
257
  MorphoBlueReallocateLiquidity: '0x17cCA8194602020e855CC8Bc11ffA82d8F998A93',
258
+ MorphoBlueClaim: '0xBB562a790AD7773D54A423bD2A10E4073cb98142',
258
259
  // llamalend
259
260
  LlamaLendCreate: '0x4349be191ea63173eD98b7fC1b0DeC1ef9Bc6c11',
260
261
  LlamaLendSupply: '0x1900eF943bD1b038c58d9F35C3825F119F9BB730',
@@ -476,6 +477,7 @@ export const actionAddresses = {
476
477
  MorphoBlueSetAuthWithSig: '0x80be65342f6172a6cd0b6a2653e8a887e3f46cab',
477
478
  MorphoBlueView: '0xdbcacf59c5063da8b15481f88e7d70e13c92f2a1',
478
479
  MorphoBlueReallocateLiquidity: '0x5Ea7F30E40F6A25BE2aD23A6FC1C31A6c95F3dc8',
480
+ MorphoBlueClaim: '0xE279E9100d6d524602f98E8736BA5F8f065Dd3e0',
479
481
  // fluid
480
482
  FluidVaultT1Open: '0xCd4d5896AEAf97e738d3E7215ac01c2CF97474bc',
481
483
  FluidVaultT1Adjust: '0x93bFBf44b87be48D46b25Fe0C7F549A79Ca05167',
@@ -234,6 +234,7 @@ declare const actionAddressesAllChains: {
234
234
  MorphoBlueSetAuthWithSig: string;
235
235
  MorphoTokenWrap: string;
236
236
  MorphoBlueReallocateLiquidity: string;
237
+ MorphoBlueClaim: string;
237
238
  LlamaLendCreate: string;
238
239
  LlamaLendSupply: string;
239
240
  LlamaLendBorrow: string;
@@ -496,6 +497,7 @@ declare const actionAddressesAllChains: {
496
497
  MorphoBlueSetAuthWithSig?: undefined;
497
498
  MorphoTokenWrap?: undefined;
498
499
  MorphoBlueReallocateLiquidity?: undefined;
500
+ MorphoBlueClaim?: undefined;
499
501
  LlamaLendCreate?: undefined;
500
502
  LlamaLendSupply?: undefined;
501
503
  LlamaLendBorrow?: undefined;
@@ -770,6 +772,7 @@ declare const actionAddressesAllChains: {
770
772
  MorphoBlueSetAuthWithSig?: undefined;
771
773
  MorphoTokenWrap?: undefined;
772
774
  MorphoBlueReallocateLiquidity?: undefined;
775
+ MorphoBlueClaim?: undefined;
773
776
  EulerV2Supply?: undefined;
774
777
  EulerV2Withdraw?: undefined;
775
778
  EulerV2Borrow?: undefined;
@@ -838,6 +841,7 @@ declare const actionAddressesAllChains: {
838
841
  MorphoBlueSetAuthWithSig: string;
839
842
  MorphoBlueView: string;
840
843
  MorphoBlueReallocateLiquidity: string;
844
+ MorphoBlueClaim: string;
841
845
  FluidVaultT1Open: string;
842
846
  FluidVaultT1Adjust: string;
843
847
  FluidVaultT1Borrow: string;
@@ -1268,6 +1272,7 @@ declare const actionAddresses: (chainId?: null) => {
1268
1272
  MorphoBlueSetAuthWithSig: string;
1269
1273
  MorphoTokenWrap: string;
1270
1274
  MorphoBlueReallocateLiquidity: string;
1275
+ MorphoBlueClaim: string;
1271
1276
  LlamaLendCreate: string;
1272
1277
  LlamaLendSupply: string;
1273
1278
  LlamaLendBorrow: string;
@@ -1530,6 +1535,7 @@ declare const actionAddresses: (chainId?: null) => {
1530
1535
  MorphoBlueSetAuthWithSig?: undefined;
1531
1536
  MorphoTokenWrap?: undefined;
1532
1537
  MorphoBlueReallocateLiquidity?: undefined;
1538
+ MorphoBlueClaim?: undefined;
1533
1539
  LlamaLendCreate?: undefined;
1534
1540
  LlamaLendSupply?: undefined;
1535
1541
  LlamaLendBorrow?: undefined;
@@ -1804,6 +1810,7 @@ declare const actionAddresses: (chainId?: null) => {
1804
1810
  MorphoBlueSetAuthWithSig?: undefined;
1805
1811
  MorphoTokenWrap?: undefined;
1806
1812
  MorphoBlueReallocateLiquidity?: undefined;
1813
+ MorphoBlueClaim?: undefined;
1807
1814
  EulerV2Supply?: undefined;
1808
1815
  EulerV2Withdraw?: undefined;
1809
1816
  EulerV2Borrow?: undefined;
@@ -1872,6 +1879,7 @@ declare const actionAddresses: (chainId?: null) => {
1872
1879
  MorphoBlueSetAuthWithSig: string;
1873
1880
  MorphoBlueView: string;
1874
1881
  MorphoBlueReallocateLiquidity: string;
1882
+ MorphoBlueClaim: string;
1875
1883
  FluidVaultT1Open: string;
1876
1884
  FluidVaultT1Adjust: string;
1877
1885
  FluidVaultT1Borrow: string;
@@ -2445,6 +2453,7 @@ declare const _default: {
2445
2453
  MorphoBlueSetAuthWithSig: string;
2446
2454
  MorphoTokenWrap: string;
2447
2455
  MorphoBlueReallocateLiquidity: string;
2456
+ MorphoBlueClaim: string;
2448
2457
  LlamaLendCreate: string;
2449
2458
  LlamaLendSupply: string;
2450
2459
  LlamaLendBorrow: string;
@@ -2707,6 +2716,7 @@ declare const _default: {
2707
2716
  MorphoBlueSetAuthWithSig?: undefined;
2708
2717
  MorphoTokenWrap?: undefined;
2709
2718
  MorphoBlueReallocateLiquidity?: undefined;
2719
+ MorphoBlueClaim?: undefined;
2710
2720
  LlamaLendCreate?: undefined;
2711
2721
  LlamaLendSupply?: undefined;
2712
2722
  LlamaLendBorrow?: undefined;
@@ -2981,6 +2991,7 @@ declare const _default: {
2981
2991
  MorphoBlueSetAuthWithSig?: undefined;
2982
2992
  MorphoTokenWrap?: undefined;
2983
2993
  MorphoBlueReallocateLiquidity?: undefined;
2994
+ MorphoBlueClaim?: undefined;
2984
2995
  EulerV2Supply?: undefined;
2985
2996
  EulerV2Withdraw?: undefined;
2986
2997
  EulerV2Borrow?: undefined;
@@ -3049,6 +3060,7 @@ declare const _default: {
3049
3060
  MorphoBlueSetAuthWithSig: string;
3050
3061
  MorphoBlueView: string;
3051
3062
  MorphoBlueReallocateLiquidity: string;
3063
+ MorphoBlueClaim: string;
3052
3064
  FluidVaultT1Open: string;
3053
3065
  FluidVaultT1Adjust: string;
3054
3066
  FluidVaultT1Borrow: string;
@@ -3479,6 +3491,7 @@ declare const _default: {
3479
3491
  MorphoBlueSetAuthWithSig: string;
3480
3492
  MorphoTokenWrap: string;
3481
3493
  MorphoBlueReallocateLiquidity: string;
3494
+ MorphoBlueClaim: string;
3482
3495
  LlamaLendCreate: string;
3483
3496
  LlamaLendSupply: string;
3484
3497
  LlamaLendBorrow: string;
@@ -3741,6 +3754,7 @@ declare const _default: {
3741
3754
  MorphoBlueSetAuthWithSig?: undefined;
3742
3755
  MorphoTokenWrap?: undefined;
3743
3756
  MorphoBlueReallocateLiquidity?: undefined;
3757
+ MorphoBlueClaim?: undefined;
3744
3758
  LlamaLendCreate?: undefined;
3745
3759
  LlamaLendSupply?: undefined;
3746
3760
  LlamaLendBorrow?: undefined;
@@ -4015,6 +4029,7 @@ declare const _default: {
4015
4029
  MorphoBlueSetAuthWithSig?: undefined;
4016
4030
  MorphoTokenWrap?: undefined;
4017
4031
  MorphoBlueReallocateLiquidity?: undefined;
4032
+ MorphoBlueClaim?: undefined;
4018
4033
  EulerV2Supply?: undefined;
4019
4034
  EulerV2Withdraw?: undefined;
4020
4035
  EulerV2Borrow?: undefined;
@@ -4083,6 +4098,7 @@ declare const _default: {
4083
4098
  MorphoBlueSetAuthWithSig: string;
4084
4099
  MorphoBlueView: string;
4085
4100
  MorphoBlueReallocateLiquidity: string;
4101
+ MorphoBlueClaim: string;
4086
4102
  FluidVaultT1Open: string;
4087
4103
  FluidVaultT1Adjust: string;
4088
4104
  FluidVaultT1Borrow: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.2.19",
3
+ "version": "1.2.20",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/src/index.js",
@@ -0,0 +1,32 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { bytes32, EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * MorphoBlueClaimAction - Claim rewards for MorphoBlue users
7
+ *
8
+ * @category MorphoBlue
9
+ */
10
+ export class MorphoBlueClaimAction extends Action {
11
+ /**
12
+ * @param to The address to which to send the reward tokens. Only used if claiming for the smart wallet.
13
+ * @param token The address of the token to claim.
14
+ * @param distributor The address of the morpho distributor contract.
15
+ * @param claimable The overall claimable amount of token rewards.
16
+ * @param merkleProof The merkle proof to claim the rewards.
17
+ */
18
+ constructor(
19
+ to:EthAddress,
20
+ token:EthAddress,
21
+ distributor:EthAddress,
22
+ claimable:uint256,
23
+ merkleProof: Array<bytes32>,
24
+ ) {
25
+ super(
26
+ 'MorphoBlueClaim',
27
+ getAddr('MorphoBlueClaim'),
28
+ ['address', 'address', 'address', 'uint256', 'bytes32[]'],
29
+ [to, token, distributor, claimable, merkleProof],
30
+ );
31
+ }
32
+ }
@@ -7,4 +7,5 @@ export * from './MorphoBlueWithdrawAction';
7
7
  export * from './MorphoBlueSetAuthAction';
8
8
  export * from './MorphoBlueSetAuthWithSigAction';
9
9
  export * from './MorphoTokenWrapAction';
10
- export * from './MorphoBlueReallocateLiquidityAction';
10
+ export * from './MorphoBlueReallocateLiquidityAction';
11
+ export * from './MorphoBlueClaimAction';
package/src/addresses.ts CHANGED
@@ -293,6 +293,7 @@ export const actionAddresses = {
293
293
  MorphoBlueSetAuthWithSig: '0xE2d5fCDBf73BAd24A0FCAf6B2733933A98021808',
294
294
  MorphoTokenWrap: '0x71b6d268c2Aabcb0dA16CbA4c77e65d9e29b0644',
295
295
  MorphoBlueReallocateLiquidity: '0x17cCA8194602020e855CC8Bc11ffA82d8F998A93',
296
+ MorphoBlueClaim: '0xBB562a790AD7773D54A423bD2A10E4073cb98142',
296
297
 
297
298
  // llamalend
298
299
  LlamaLendCreate: '0x4349be191ea63173eD98b7fC1b0DeC1ef9Bc6c11',
@@ -541,6 +542,7 @@ export const actionAddresses = {
541
542
  MorphoBlueSetAuthWithSig: '0x80be65342f6172a6cd0b6a2653e8a887e3f46cab',
542
543
  MorphoBlueView: '0xdbcacf59c5063da8b15481f88e7d70e13c92f2a1',
543
544
  MorphoBlueReallocateLiquidity: '0x5Ea7F30E40F6A25BE2aD23A6FC1C31A6c95F3dc8',
545
+ MorphoBlueClaim: '0xE279E9100d6d524602f98E8736BA5F8f065Dd3e0',
544
546
 
545
547
  // fluid
546
548
  FluidVaultT1Open: '0xCd4d5896AEAf97e738d3E7215ac01c2CF97474bc',
@@ -0,0 +1,46 @@
1
+ const dfs = require('../../../src');
2
+ const {getAssetInfo} = require("@defisaver/tokens");
3
+ const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
+ const {assert} = require('chai');
5
+
6
+ describe('Action: MorphoBlueClaimAction', () => {
7
+ let action;
8
+ context('Claim encoding', () => {
9
+ it('constructor', () => {
10
+ const to = '0xC093dFcC2cBc4e9488589B7c2245a7F1DA043389';
11
+ const claimable = '4809093062235489680';
12
+ const rewardToken = '0x58d97b57bb95320f9a05dc918aef65434969c2b2';
13
+ const distributorContract = '0x330eefa8a787552DC5cAd3C3cA644844B1E61Ddb';
14
+ const proofs = [
15
+ '0xd496d2a15cf30a2af545b0fd4ced50fb4224bb54e7c9add4885c7b7408c907a1',
16
+ '0x6a8fc6432934b1f2c9f9aed040f4389c0450dd94aff92b16864060e95fba4290',
17
+ '0xb7491e5e898e774e11c50044140df4c1c74bf9cd7855bac78f0709699ed0e6b7',
18
+ '0xc8cd758ed1b442458a4bf192598e1bc6409b4c7c234a89d343ca47e35c027a58',
19
+ '0x67ad524dd5256feff4322b22e13d2b169bce720accedaf441b5151d03eede9ea',
20
+ '0x01c9e73be64a955a74b847b5d842be13815b8c057c96793df609581cf744a303',
21
+ '0x48056ed0d5975f309d2cfa166f5ef7e0a927445708aa04bd2c572cd583a6a6c9',
22
+ '0x1ca9e9f414cdc19dd87fa5a78225cce4a8b2ca332a814e2240172c82159ba86e',
23
+ '0x98290a0226d9dcca1fa16f5187393edd00bba4cae92a41ea608739ae804d41f0',
24
+ '0x5c4b48ece06d268a3a151db9392dff6b087a041eb002e4f41f04e98b6a9350ea',
25
+ '0xb18f55aa8bf9d073eab748bb54f7629551df5a8df04f03d677b1005c8b606ec1',
26
+ '0x844d1e6cac34639fc9e192fc7d94015472661d264f640df6e56d47ff800b66ed',
27
+ '0xef63a6a4f186536ca66dbd3af102630029e7bf10830268d6d90bc4415e0238e2',
28
+ '0x9b2fc088dde10283dc02fef8e9eb1a76c22ca3df5bfaec0ba88d712dac926ce5',
29
+ '0xf7889f06c88c1c1006a7b9710fb95745b8df7279cdca977331a75aac7f9416cd',
30
+ ];
31
+ action = new dfs.actions.morphoblue.MorphoBlueClaimAction(
32
+ to,
33
+ rewardToken,
34
+ distributorContract,
35
+ claimable,
36
+ proofs,
37
+ );
38
+ })
39
+ it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
40
+ it('encodeForRecipe', () => encodeForRecipe(action));
41
+ it('getEthValue', async () => {
42
+ const ethValue = await action.getEthValue();
43
+ assert.equal(ethValue, '0');
44
+ })
45
+ })
46
+ })