@defisaver/sdk 1.2.17-dev-fluid-5 → 1.2.18
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/esm/src/actions/basic/KingClaimAction.d.ts +16 -0
- package/esm/src/actions/basic/KingClaimAction.js +25 -0
- package/esm/src/actions/basic/index.d.ts +1 -0
- package/esm/src/actions/basic/index.js +1 -0
- package/esm/src/actions/morpho-blue/MorphoBlueClaimAction.d.ts +17 -0
- package/esm/src/actions/morpho-blue/MorphoBlueClaimAction.js +19 -0
- package/esm/src/actions/morpho-blue/index.d.ts +1 -0
- package/esm/src/actions/morpho-blue/index.js +1 -0
- package/esm/src/addresses.d.ts +8 -0
- package/esm/src/addresses.js +3 -0
- package/esm/src/index.d.ts +32 -0
- package/package.json +1 -1
- package/src/actions/basic/KingClaimAction.ts +32 -0
- package/src/actions/basic/index.ts +2 -1
- package/src/actions/morpho-blue/MorphoBlueClaimAction.ts +32 -0
- package/src/actions/morpho-blue/index.ts +2 -1
- package/src/addresses.ts +4 -0
- package/test/actions/morpho-blue/MorphoBlueClaimAction.js +46 -0
- package/umd/index.js +695 -624
- package/yarn-error.log +0 -3976
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { bytes32, EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Action to Claim KING token as EtherFi reward on behalf of smart wallet
|
|
5
|
+
*
|
|
6
|
+
* @category BasicActions
|
|
7
|
+
*/
|
|
8
|
+
export declare class KingClaimAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param to
|
|
11
|
+
* @param amount
|
|
12
|
+
* @param merkleRoot
|
|
13
|
+
* @param merkleProof
|
|
14
|
+
*/
|
|
15
|
+
constructor(to: EthAddress, amount: uint256, merkleRoot: bytes32, merkleProof: Array<bytes32>);
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { requireAddress } from '../../utils/general';
|
|
2
|
+
import { Action } from '../../Action';
|
|
3
|
+
import { getAddr } from '../../addresses';
|
|
4
|
+
/**
|
|
5
|
+
* Action to Claim KING token as EtherFi reward on behalf of smart wallet
|
|
6
|
+
*
|
|
7
|
+
* @category BasicActions
|
|
8
|
+
*/
|
|
9
|
+
export class KingClaimAction extends Action {
|
|
10
|
+
/**
|
|
11
|
+
* @param to
|
|
12
|
+
* @param amount
|
|
13
|
+
* @param merkleRoot
|
|
14
|
+
* @param merkleProof
|
|
15
|
+
*/
|
|
16
|
+
constructor(to, amount, merkleRoot, merkleProof) {
|
|
17
|
+
requireAddress(to);
|
|
18
|
+
super('KingClaim', getAddr('KingClaim'), [
|
|
19
|
+
'address',
|
|
20
|
+
'uint256',
|
|
21
|
+
'bytes32',
|
|
22
|
+
'bytes32[]',
|
|
23
|
+
], [to, amount, merkleRoot, merkleProof]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -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
|
+
}
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -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;
|
|
@@ -245,6 +246,7 @@ export declare const actionAddresses: {
|
|
|
245
246
|
EtherFiStake: string;
|
|
246
247
|
EtherFiWrap: string;
|
|
247
248
|
EtherFiUnwrap: string;
|
|
249
|
+
KingClaim: string;
|
|
248
250
|
FluidVaultT1Open: string;
|
|
249
251
|
FluidVaultT1Adjust: string;
|
|
250
252
|
FluidVaultT1Borrow: string;
|
|
@@ -484,6 +486,7 @@ export declare const actionAddresses: {
|
|
|
484
486
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
485
487
|
MorphoTokenWrap?: undefined;
|
|
486
488
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
489
|
+
MorphoBlueClaim?: undefined;
|
|
487
490
|
LlamaLendCreate?: undefined;
|
|
488
491
|
LlamaLendSupply?: undefined;
|
|
489
492
|
LlamaLendBorrow?: undefined;
|
|
@@ -506,6 +509,7 @@ export declare const actionAddresses: {
|
|
|
506
509
|
EtherFiStake?: undefined;
|
|
507
510
|
EtherFiWrap?: undefined;
|
|
508
511
|
EtherFiUnwrap?: undefined;
|
|
512
|
+
KingClaim?: undefined;
|
|
509
513
|
FluidVaultT1Open?: undefined;
|
|
510
514
|
FluidVaultT1Adjust?: undefined;
|
|
511
515
|
FluidVaultT1Borrow?: undefined;
|
|
@@ -757,6 +761,7 @@ export declare const actionAddresses: {
|
|
|
757
761
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
758
762
|
MorphoTokenWrap?: undefined;
|
|
759
763
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
764
|
+
MorphoBlueClaim?: undefined;
|
|
760
765
|
EulerV2Supply?: undefined;
|
|
761
766
|
EulerV2Withdraw?: undefined;
|
|
762
767
|
EulerV2Borrow?: undefined;
|
|
@@ -768,6 +773,7 @@ export declare const actionAddresses: {
|
|
|
768
773
|
EtherFiStake?: undefined;
|
|
769
774
|
EtherFiWrap?: undefined;
|
|
770
775
|
EtherFiUnwrap?: undefined;
|
|
776
|
+
KingClaim?: undefined;
|
|
771
777
|
AaveV3DelegateCredit?: undefined;
|
|
772
778
|
AaveV3RatioTrigger?: undefined;
|
|
773
779
|
MorphoBlueView?: undefined;
|
|
@@ -824,6 +830,7 @@ export declare const actionAddresses: {
|
|
|
824
830
|
MorphoBlueSetAuthWithSig: string;
|
|
825
831
|
MorphoBlueView: string;
|
|
826
832
|
MorphoBlueReallocateLiquidity: string;
|
|
833
|
+
MorphoBlueClaim: string;
|
|
827
834
|
FluidVaultT1Open: string;
|
|
828
835
|
FluidVaultT1Adjust: string;
|
|
829
836
|
FluidVaultT1Borrow: string;
|
|
@@ -1025,6 +1032,7 @@ export declare const actionAddresses: {
|
|
|
1025
1032
|
EtherFiStake?: undefined;
|
|
1026
1033
|
EtherFiWrap?: undefined;
|
|
1027
1034
|
EtherFiUnwrap?: undefined;
|
|
1035
|
+
KingClaim?: undefined;
|
|
1028
1036
|
AaveV3DelegateCredit?: undefined;
|
|
1029
1037
|
AaveV3RatioTrigger?: undefined;
|
|
1030
1038
|
AaveV3RatioCheck?: undefined;
|
package/esm/src/addresses.js
CHANGED
|
@@ -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',
|
|
@@ -280,6 +281,7 @@ export const actionAddresses = {
|
|
|
280
281
|
EtherFiStake: '0xcadB650B6a60C89f7847Cba555A7eeCC220EA2e8',
|
|
281
282
|
EtherFiWrap: '0x086464be5c73f66cfbe6b64ec23aa5a86749ef58',
|
|
282
283
|
EtherFiUnwrap: '0x6Eb09948DDf9332d628d156950b9B1C0c091e8D8',
|
|
284
|
+
KingClaim: '0x483816678e2348bf87f88b0f4eb6a923017de0d6',
|
|
283
285
|
// fluid
|
|
284
286
|
FluidVaultT1Open: '0x372404335C05C2493Ff156Ef60cC0B286f6f2971',
|
|
285
287
|
FluidVaultT1Adjust: '0x792D40CAE821905A2B57522BF8a77347e7BB0c0a',
|
|
@@ -475,6 +477,7 @@ export const actionAddresses = {
|
|
|
475
477
|
MorphoBlueSetAuthWithSig: '0x80be65342f6172a6cd0b6a2653e8a887e3f46cab',
|
|
476
478
|
MorphoBlueView: '0xdbcacf59c5063da8b15481f88e7d70e13c92f2a1',
|
|
477
479
|
MorphoBlueReallocateLiquidity: '0x5Ea7F30E40F6A25BE2aD23A6FC1C31A6c95F3dc8',
|
|
480
|
+
MorphoBlueClaim: '0xE279E9100d6d524602f98E8736BA5F8f065Dd3e0',
|
|
478
481
|
// fluid
|
|
479
482
|
FluidVaultT1Open: '0xCd4d5896AEAf97e738d3E7215ac01c2CF97474bc',
|
|
480
483
|
FluidVaultT1Adjust: '0x93bFBf44b87be48D46b25Fe0C7F549A79Ca05167',
|
package/esm/src/index.d.ts
CHANGED
|
@@ -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;
|
|
@@ -256,6 +257,7 @@ declare const actionAddressesAllChains: {
|
|
|
256
257
|
EtherFiStake: string;
|
|
257
258
|
EtherFiWrap: string;
|
|
258
259
|
EtherFiUnwrap: string;
|
|
260
|
+
KingClaim: string;
|
|
259
261
|
FluidVaultT1Open: string;
|
|
260
262
|
FluidVaultT1Adjust: string;
|
|
261
263
|
FluidVaultT1Borrow: string;
|
|
@@ -495,6 +497,7 @@ declare const actionAddressesAllChains: {
|
|
|
495
497
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
496
498
|
MorphoTokenWrap?: undefined;
|
|
497
499
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
500
|
+
MorphoBlueClaim?: undefined;
|
|
498
501
|
LlamaLendCreate?: undefined;
|
|
499
502
|
LlamaLendSupply?: undefined;
|
|
500
503
|
LlamaLendBorrow?: undefined;
|
|
@@ -517,6 +520,7 @@ declare const actionAddressesAllChains: {
|
|
|
517
520
|
EtherFiStake?: undefined;
|
|
518
521
|
EtherFiWrap?: undefined;
|
|
519
522
|
EtherFiUnwrap?: undefined;
|
|
523
|
+
KingClaim?: undefined;
|
|
520
524
|
FluidVaultT1Open?: undefined;
|
|
521
525
|
FluidVaultT1Adjust?: undefined;
|
|
522
526
|
FluidVaultT1Borrow?: undefined;
|
|
@@ -768,6 +772,7 @@ declare const actionAddressesAllChains: {
|
|
|
768
772
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
769
773
|
MorphoTokenWrap?: undefined;
|
|
770
774
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
775
|
+
MorphoBlueClaim?: undefined;
|
|
771
776
|
EulerV2Supply?: undefined;
|
|
772
777
|
EulerV2Withdraw?: undefined;
|
|
773
778
|
EulerV2Borrow?: undefined;
|
|
@@ -779,6 +784,7 @@ declare const actionAddressesAllChains: {
|
|
|
779
784
|
EtherFiStake?: undefined;
|
|
780
785
|
EtherFiWrap?: undefined;
|
|
781
786
|
EtherFiUnwrap?: undefined;
|
|
787
|
+
KingClaim?: undefined;
|
|
782
788
|
AaveV3DelegateCredit?: undefined;
|
|
783
789
|
AaveV3RatioTrigger?: undefined;
|
|
784
790
|
MorphoBlueView?: undefined;
|
|
@@ -835,6 +841,7 @@ declare const actionAddressesAllChains: {
|
|
|
835
841
|
MorphoBlueSetAuthWithSig: string;
|
|
836
842
|
MorphoBlueView: string;
|
|
837
843
|
MorphoBlueReallocateLiquidity: string;
|
|
844
|
+
MorphoBlueClaim: string;
|
|
838
845
|
FluidVaultT1Open: string;
|
|
839
846
|
FluidVaultT1Adjust: string;
|
|
840
847
|
FluidVaultT1Borrow: string;
|
|
@@ -1036,6 +1043,7 @@ declare const actionAddressesAllChains: {
|
|
|
1036
1043
|
EtherFiStake?: undefined;
|
|
1037
1044
|
EtherFiWrap?: undefined;
|
|
1038
1045
|
EtherFiUnwrap?: undefined;
|
|
1046
|
+
KingClaim?: undefined;
|
|
1039
1047
|
AaveV3DelegateCredit?: undefined;
|
|
1040
1048
|
AaveV3RatioTrigger?: undefined;
|
|
1041
1049
|
AaveV3RatioCheck?: undefined;
|
|
@@ -1264,6 +1272,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1264
1272
|
MorphoBlueSetAuthWithSig: string;
|
|
1265
1273
|
MorphoTokenWrap: string;
|
|
1266
1274
|
MorphoBlueReallocateLiquidity: string;
|
|
1275
|
+
MorphoBlueClaim: string;
|
|
1267
1276
|
LlamaLendCreate: string;
|
|
1268
1277
|
LlamaLendSupply: string;
|
|
1269
1278
|
LlamaLendBorrow: string;
|
|
@@ -1286,6 +1295,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1286
1295
|
EtherFiStake: string;
|
|
1287
1296
|
EtherFiWrap: string;
|
|
1288
1297
|
EtherFiUnwrap: string;
|
|
1298
|
+
KingClaim: string;
|
|
1289
1299
|
FluidVaultT1Open: string;
|
|
1290
1300
|
FluidVaultT1Adjust: string;
|
|
1291
1301
|
FluidVaultT1Borrow: string;
|
|
@@ -1525,6 +1535,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1525
1535
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
1526
1536
|
MorphoTokenWrap?: undefined;
|
|
1527
1537
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
1538
|
+
MorphoBlueClaim?: undefined;
|
|
1528
1539
|
LlamaLendCreate?: undefined;
|
|
1529
1540
|
LlamaLendSupply?: undefined;
|
|
1530
1541
|
LlamaLendBorrow?: undefined;
|
|
@@ -1547,6 +1558,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1547
1558
|
EtherFiStake?: undefined;
|
|
1548
1559
|
EtherFiWrap?: undefined;
|
|
1549
1560
|
EtherFiUnwrap?: undefined;
|
|
1561
|
+
KingClaim?: undefined;
|
|
1550
1562
|
FluidVaultT1Open?: undefined;
|
|
1551
1563
|
FluidVaultT1Adjust?: undefined;
|
|
1552
1564
|
FluidVaultT1Borrow?: undefined;
|
|
@@ -1798,6 +1810,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1798
1810
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
1799
1811
|
MorphoTokenWrap?: undefined;
|
|
1800
1812
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
1813
|
+
MorphoBlueClaim?: undefined;
|
|
1801
1814
|
EulerV2Supply?: undefined;
|
|
1802
1815
|
EulerV2Withdraw?: undefined;
|
|
1803
1816
|
EulerV2Borrow?: undefined;
|
|
@@ -1809,6 +1822,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1809
1822
|
EtherFiStake?: undefined;
|
|
1810
1823
|
EtherFiWrap?: undefined;
|
|
1811
1824
|
EtherFiUnwrap?: undefined;
|
|
1825
|
+
KingClaim?: undefined;
|
|
1812
1826
|
AaveV3DelegateCredit?: undefined;
|
|
1813
1827
|
AaveV3RatioTrigger?: undefined;
|
|
1814
1828
|
MorphoBlueView?: undefined;
|
|
@@ -1865,6 +1879,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1865
1879
|
MorphoBlueSetAuthWithSig: string;
|
|
1866
1880
|
MorphoBlueView: string;
|
|
1867
1881
|
MorphoBlueReallocateLiquidity: string;
|
|
1882
|
+
MorphoBlueClaim: string;
|
|
1868
1883
|
FluidVaultT1Open: string;
|
|
1869
1884
|
FluidVaultT1Adjust: string;
|
|
1870
1885
|
FluidVaultT1Borrow: string;
|
|
@@ -2066,6 +2081,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
2066
2081
|
EtherFiStake?: undefined;
|
|
2067
2082
|
EtherFiWrap?: undefined;
|
|
2068
2083
|
EtherFiUnwrap?: undefined;
|
|
2084
|
+
KingClaim?: undefined;
|
|
2069
2085
|
AaveV3DelegateCredit?: undefined;
|
|
2070
2086
|
AaveV3RatioTrigger?: undefined;
|
|
2071
2087
|
AaveV3RatioCheck?: undefined;
|
|
@@ -2437,6 +2453,7 @@ declare const _default: {
|
|
|
2437
2453
|
MorphoBlueSetAuthWithSig: string;
|
|
2438
2454
|
MorphoTokenWrap: string;
|
|
2439
2455
|
MorphoBlueReallocateLiquidity: string;
|
|
2456
|
+
MorphoBlueClaim: string;
|
|
2440
2457
|
LlamaLendCreate: string;
|
|
2441
2458
|
LlamaLendSupply: string;
|
|
2442
2459
|
LlamaLendBorrow: string;
|
|
@@ -2459,6 +2476,7 @@ declare const _default: {
|
|
|
2459
2476
|
EtherFiStake: string;
|
|
2460
2477
|
EtherFiWrap: string;
|
|
2461
2478
|
EtherFiUnwrap: string;
|
|
2479
|
+
KingClaim: string;
|
|
2462
2480
|
FluidVaultT1Open: string;
|
|
2463
2481
|
FluidVaultT1Adjust: string;
|
|
2464
2482
|
FluidVaultT1Borrow: string;
|
|
@@ -2698,6 +2716,7 @@ declare const _default: {
|
|
|
2698
2716
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
2699
2717
|
MorphoTokenWrap?: undefined;
|
|
2700
2718
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
2719
|
+
MorphoBlueClaim?: undefined;
|
|
2701
2720
|
LlamaLendCreate?: undefined;
|
|
2702
2721
|
LlamaLendSupply?: undefined;
|
|
2703
2722
|
LlamaLendBorrow?: undefined;
|
|
@@ -2720,6 +2739,7 @@ declare const _default: {
|
|
|
2720
2739
|
EtherFiStake?: undefined;
|
|
2721
2740
|
EtherFiWrap?: undefined;
|
|
2722
2741
|
EtherFiUnwrap?: undefined;
|
|
2742
|
+
KingClaim?: undefined;
|
|
2723
2743
|
FluidVaultT1Open?: undefined;
|
|
2724
2744
|
FluidVaultT1Adjust?: undefined;
|
|
2725
2745
|
FluidVaultT1Borrow?: undefined;
|
|
@@ -2971,6 +2991,7 @@ declare const _default: {
|
|
|
2971
2991
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
2972
2992
|
MorphoTokenWrap?: undefined;
|
|
2973
2993
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
2994
|
+
MorphoBlueClaim?: undefined;
|
|
2974
2995
|
EulerV2Supply?: undefined;
|
|
2975
2996
|
EulerV2Withdraw?: undefined;
|
|
2976
2997
|
EulerV2Borrow?: undefined;
|
|
@@ -2982,6 +3003,7 @@ declare const _default: {
|
|
|
2982
3003
|
EtherFiStake?: undefined;
|
|
2983
3004
|
EtherFiWrap?: undefined;
|
|
2984
3005
|
EtherFiUnwrap?: undefined;
|
|
3006
|
+
KingClaim?: undefined;
|
|
2985
3007
|
AaveV3DelegateCredit?: undefined;
|
|
2986
3008
|
AaveV3RatioTrigger?: undefined;
|
|
2987
3009
|
MorphoBlueView?: undefined;
|
|
@@ -3038,6 +3060,7 @@ declare const _default: {
|
|
|
3038
3060
|
MorphoBlueSetAuthWithSig: string;
|
|
3039
3061
|
MorphoBlueView: string;
|
|
3040
3062
|
MorphoBlueReallocateLiquidity: string;
|
|
3063
|
+
MorphoBlueClaim: string;
|
|
3041
3064
|
FluidVaultT1Open: string;
|
|
3042
3065
|
FluidVaultT1Adjust: string;
|
|
3043
3066
|
FluidVaultT1Borrow: string;
|
|
@@ -3239,6 +3262,7 @@ declare const _default: {
|
|
|
3239
3262
|
EtherFiStake?: undefined;
|
|
3240
3263
|
EtherFiWrap?: undefined;
|
|
3241
3264
|
EtherFiUnwrap?: undefined;
|
|
3265
|
+
KingClaim?: undefined;
|
|
3242
3266
|
AaveV3DelegateCredit?: undefined;
|
|
3243
3267
|
AaveV3RatioTrigger?: undefined;
|
|
3244
3268
|
AaveV3RatioCheck?: undefined;
|
|
@@ -3467,6 +3491,7 @@ declare const _default: {
|
|
|
3467
3491
|
MorphoBlueSetAuthWithSig: string;
|
|
3468
3492
|
MorphoTokenWrap: string;
|
|
3469
3493
|
MorphoBlueReallocateLiquidity: string;
|
|
3494
|
+
MorphoBlueClaim: string;
|
|
3470
3495
|
LlamaLendCreate: string;
|
|
3471
3496
|
LlamaLendSupply: string;
|
|
3472
3497
|
LlamaLendBorrow: string;
|
|
@@ -3489,6 +3514,7 @@ declare const _default: {
|
|
|
3489
3514
|
EtherFiStake: string;
|
|
3490
3515
|
EtherFiWrap: string;
|
|
3491
3516
|
EtherFiUnwrap: string;
|
|
3517
|
+
KingClaim: string;
|
|
3492
3518
|
FluidVaultT1Open: string;
|
|
3493
3519
|
FluidVaultT1Adjust: string;
|
|
3494
3520
|
FluidVaultT1Borrow: string;
|
|
@@ -3728,6 +3754,7 @@ declare const _default: {
|
|
|
3728
3754
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
3729
3755
|
MorphoTokenWrap?: undefined;
|
|
3730
3756
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
3757
|
+
MorphoBlueClaim?: undefined;
|
|
3731
3758
|
LlamaLendCreate?: undefined;
|
|
3732
3759
|
LlamaLendSupply?: undefined;
|
|
3733
3760
|
LlamaLendBorrow?: undefined;
|
|
@@ -3750,6 +3777,7 @@ declare const _default: {
|
|
|
3750
3777
|
EtherFiStake?: undefined;
|
|
3751
3778
|
EtherFiWrap?: undefined;
|
|
3752
3779
|
EtherFiUnwrap?: undefined;
|
|
3780
|
+
KingClaim?: undefined;
|
|
3753
3781
|
FluidVaultT1Open?: undefined;
|
|
3754
3782
|
FluidVaultT1Adjust?: undefined;
|
|
3755
3783
|
FluidVaultT1Borrow?: undefined;
|
|
@@ -4001,6 +4029,7 @@ declare const _default: {
|
|
|
4001
4029
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
4002
4030
|
MorphoTokenWrap?: undefined;
|
|
4003
4031
|
MorphoBlueReallocateLiquidity?: undefined;
|
|
4032
|
+
MorphoBlueClaim?: undefined;
|
|
4004
4033
|
EulerV2Supply?: undefined;
|
|
4005
4034
|
EulerV2Withdraw?: undefined;
|
|
4006
4035
|
EulerV2Borrow?: undefined;
|
|
@@ -4012,6 +4041,7 @@ declare const _default: {
|
|
|
4012
4041
|
EtherFiStake?: undefined;
|
|
4013
4042
|
EtherFiWrap?: undefined;
|
|
4014
4043
|
EtherFiUnwrap?: undefined;
|
|
4044
|
+
KingClaim?: undefined;
|
|
4015
4045
|
AaveV3DelegateCredit?: undefined;
|
|
4016
4046
|
AaveV3RatioTrigger?: undefined;
|
|
4017
4047
|
MorphoBlueView?: undefined;
|
|
@@ -4068,6 +4098,7 @@ declare const _default: {
|
|
|
4068
4098
|
MorphoBlueSetAuthWithSig: string;
|
|
4069
4099
|
MorphoBlueView: string;
|
|
4070
4100
|
MorphoBlueReallocateLiquidity: string;
|
|
4101
|
+
MorphoBlueClaim: string;
|
|
4071
4102
|
FluidVaultT1Open: string;
|
|
4072
4103
|
FluidVaultT1Adjust: string;
|
|
4073
4104
|
FluidVaultT1Borrow: string;
|
|
@@ -4269,6 +4300,7 @@ declare const _default: {
|
|
|
4269
4300
|
EtherFiStake?: undefined;
|
|
4270
4301
|
EtherFiWrap?: undefined;
|
|
4271
4302
|
EtherFiUnwrap?: undefined;
|
|
4303
|
+
KingClaim?: undefined;
|
|
4272
4304
|
AaveV3DelegateCredit?: undefined;
|
|
4273
4305
|
AaveV3RatioTrigger?: undefined;
|
|
4274
4306
|
AaveV3RatioCheck?: undefined;
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { requireAddress } from '../../utils/general';
|
|
2
|
+
import { Action } from '../../Action';
|
|
3
|
+
import { getAddr } from '../../addresses';
|
|
4
|
+
import { bytes32, EthAddress, uint256 } from '../../types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Action to Claim KING token as EtherFi reward on behalf of smart wallet
|
|
8
|
+
*
|
|
9
|
+
* @category BasicActions
|
|
10
|
+
*/
|
|
11
|
+
export class KingClaimAction extends Action {
|
|
12
|
+
/**
|
|
13
|
+
* @param to
|
|
14
|
+
* @param amount
|
|
15
|
+
* @param merkleRoot
|
|
16
|
+
* @param merkleProof
|
|
17
|
+
*/
|
|
18
|
+
constructor(to:EthAddress, amount:uint256, merkleRoot:bytes32, merkleProof: Array<bytes32>) {
|
|
19
|
+
requireAddress(to);
|
|
20
|
+
super(
|
|
21
|
+
'KingClaim',
|
|
22
|
+
getAddr('KingClaim'),
|
|
23
|
+
[
|
|
24
|
+
'address',
|
|
25
|
+
'uint256',
|
|
26
|
+
'bytes32',
|
|
27
|
+
'bytes32[]',
|
|
28
|
+
],
|
|
29
|
+
[to, amount, merkleRoot, merkleProof],
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -30,4 +30,5 @@ export * from './RemoveTokenApprovalAction';
|
|
|
30
30
|
export * from './PermitTokenAction';
|
|
31
31
|
export * from './StarknetClaimAction';
|
|
32
32
|
export * from './HandleAuthAction';
|
|
33
|
-
export * from './SendTokensAndUnwrapAction';
|
|
33
|
+
export * from './SendTokensAndUnwrapAction';
|
|
34
|
+
export * from './KingClaimAction';
|
|
@@ -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',
|
|
@@ -324,6 +325,8 @@ export const actionAddresses = {
|
|
|
324
325
|
EtherFiWrap: '0x086464be5c73f66cfbe6b64ec23aa5a86749ef58',
|
|
325
326
|
EtherFiUnwrap: '0x6Eb09948DDf9332d628d156950b9B1C0c091e8D8',
|
|
326
327
|
|
|
328
|
+
KingClaim: '0x483816678e2348bf87f88b0f4eb6a923017de0d6',
|
|
329
|
+
|
|
327
330
|
// fluid
|
|
328
331
|
FluidVaultT1Open: '0x372404335C05C2493Ff156Ef60cC0B286f6f2971',
|
|
329
332
|
FluidVaultT1Adjust: '0x792D40CAE821905A2B57522BF8a77347e7BB0c0a',
|
|
@@ -539,6 +542,7 @@ export const actionAddresses = {
|
|
|
539
542
|
MorphoBlueSetAuthWithSig: '0x80be65342f6172a6cd0b6a2653e8a887e3f46cab',
|
|
540
543
|
MorphoBlueView: '0xdbcacf59c5063da8b15481f88e7d70e13c92f2a1',
|
|
541
544
|
MorphoBlueReallocateLiquidity: '0x5Ea7F30E40F6A25BE2aD23A6FC1C31A6c95F3dc8',
|
|
545
|
+
MorphoBlueClaim: '0xE279E9100d6d524602f98E8736BA5F8f065Dd3e0',
|
|
542
546
|
|
|
543
547
|
// fluid
|
|
544
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
|
+
})
|