@defisaver/sdk 1.3.25 → 1.3.26

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,16 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress, uint256, bytes32 } from '../../types';
3
+ /**
4
+ * UniswapClaimAction - Claims UNI tokens from the Uniswap merkle distributor
5
+ *
6
+ * @category Uniswap
7
+ */
8
+ export declare class UniswapClaimAction extends Action {
9
+ /**
10
+ * @param index - Index of the claim in the merkle tree
11
+ * @param to - Address where to send the claimed UNI
12
+ * @param amount - Amount of UNI allocated to the smart wallet in the merkle tree
13
+ * @param merkleProof - Merkle proof of the claim
14
+ */
15
+ constructor(index: uint256, to: EthAddress, amount: uint256, merkleProof: Array<bytes32>);
16
+ }
@@ -0,0 +1,23 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ /**
4
+ * UniswapClaimAction - Claims UNI tokens from the Uniswap merkle distributor
5
+ *
6
+ * @category Uniswap
7
+ */
8
+ export class UniswapClaimAction extends Action {
9
+ /**
10
+ * @param index - Index of the claim in the merkle tree
11
+ * @param to - Address where to send the claimed UNI
12
+ * @param amount - Amount of UNI allocated to the smart wallet in the merkle tree
13
+ * @param merkleProof - Merkle proof of the claim
14
+ */
15
+ constructor(index, to, amount, merkleProof) {
16
+ super('UniswapClaim', getAddr('UniswapClaim'), ['uint256', 'address', 'uint256', 'bytes32[]'], [index, to, amount, merkleProof]);
17
+ this.mappableArgs = [
18
+ this.args[0],
19
+ this.args[1],
20
+ this.args[2],
21
+ ];
22
+ }
23
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './UniswapSupplyAction';
2
2
  export * from './UniswapWithdrawAction';
3
+ export * from './UniswapClaimAction';
@@ -1,2 +1,3 @@
1
1
  export * from './UniswapSupplyAction';
2
2
  export * from './UniswapWithdrawAction';
3
+ export * from './UniswapClaimAction';
@@ -124,6 +124,7 @@ export declare const actionAddresses: {
124
124
  FLMorphoBlue: string;
125
125
  UniSupply: string;
126
126
  UniWithdraw: string;
127
+ UniswapClaim: string;
127
128
  UniCollectV3: string;
128
129
  UniMintV3: string;
129
130
  UniSupplyV3: string;
@@ -435,6 +436,7 @@ export declare const actionAddresses: {
435
436
  FLMorphoBlue?: undefined;
436
437
  UniSupply?: undefined;
437
438
  UniWithdraw?: undefined;
439
+ UniswapClaim?: undefined;
438
440
  DyDxWithdraw?: undefined;
439
441
  YearnSupply?: undefined;
440
442
  YearnWithdraw?: undefined;
@@ -760,6 +762,7 @@ export declare const actionAddresses: {
760
762
  FLGho?: undefined;
761
763
  UniSupply?: undefined;
762
764
  UniWithdraw?: undefined;
765
+ UniswapClaim?: undefined;
763
766
  DyDxWithdraw?: undefined;
764
767
  YearnSupply?: undefined;
765
768
  YearnWithdraw?: undefined;
@@ -1035,6 +1038,7 @@ export declare const actionAddresses: {
1035
1038
  FLGho?: undefined;
1036
1039
  UniSupply?: undefined;
1037
1040
  UniWithdraw?: undefined;
1041
+ UniswapClaim?: undefined;
1038
1042
  UniCollectV3?: undefined;
1039
1043
  UniMintV3?: undefined;
1040
1044
  UniSupplyV3?: undefined;
@@ -1293,6 +1297,7 @@ export declare const actionAddresses: {
1293
1297
  FLMorphoBlue?: undefined;
1294
1298
  UniSupply?: undefined;
1295
1299
  UniWithdraw?: undefined;
1300
+ UniswapClaim?: undefined;
1296
1301
  UniCollectV3?: undefined;
1297
1302
  UniMintV3?: undefined;
1298
1303
  UniSupplyV3?: undefined;
@@ -1598,6 +1603,7 @@ export declare const actionAddresses: {
1598
1603
  FLMorphoBlue?: undefined;
1599
1604
  UniSupply?: undefined;
1600
1605
  UniWithdraw?: undefined;
1606
+ UniswapClaim?: undefined;
1601
1607
  UniCollectV3?: undefined;
1602
1608
  UniMintV3?: undefined;
1603
1609
  UniSupplyV3?: undefined;
@@ -139,6 +139,7 @@ export const actionAddresses = {
139
139
  // uniswap
140
140
  UniSupply: '0x9935e12F0218E61c27D7f23eAC9A9D6881a078eC',
141
141
  UniWithdraw: '0xf8bb8F68b0A45DC315F3f7602a60cfb274B00951',
142
+ UniswapClaim: '0x4Eed50e142BFaE83b2d05ce960C55F4c536d123f',
142
143
  // uniswap V3
143
144
  UniCollectV3: '0x331D7C3F6E710cB6cFE94c4Aa04AC3345AC00e00',
144
145
  UniMintV3: '0x3dF75BE8Fb0a6186BE9705cACaa6dD2a4Ec3e40C',
@@ -135,6 +135,7 @@ declare const actionAddressesAllChains: {
135
135
  FLMorphoBlue: string;
136
136
  UniSupply: string;
137
137
  UniWithdraw: string;
138
+ UniswapClaim: string;
138
139
  UniCollectV3: string;
139
140
  UniMintV3: string;
140
141
  UniSupplyV3: string;
@@ -446,6 +447,7 @@ declare const actionAddressesAllChains: {
446
447
  FLMorphoBlue?: undefined;
447
448
  UniSupply?: undefined;
448
449
  UniWithdraw?: undefined;
450
+ UniswapClaim?: undefined;
449
451
  DyDxWithdraw?: undefined;
450
452
  YearnSupply?: undefined;
451
453
  YearnWithdraw?: undefined;
@@ -771,6 +773,7 @@ declare const actionAddressesAllChains: {
771
773
  FLGho?: undefined;
772
774
  UniSupply?: undefined;
773
775
  UniWithdraw?: undefined;
776
+ UniswapClaim?: undefined;
774
777
  DyDxWithdraw?: undefined;
775
778
  YearnSupply?: undefined;
776
779
  YearnWithdraw?: undefined;
@@ -1046,6 +1049,7 @@ declare const actionAddressesAllChains: {
1046
1049
  FLGho?: undefined;
1047
1050
  UniSupply?: undefined;
1048
1051
  UniWithdraw?: undefined;
1052
+ UniswapClaim?: undefined;
1049
1053
  UniCollectV3?: undefined;
1050
1054
  UniMintV3?: undefined;
1051
1055
  UniSupplyV3?: undefined;
@@ -1304,6 +1308,7 @@ declare const actionAddressesAllChains: {
1304
1308
  FLMorphoBlue?: undefined;
1305
1309
  UniSupply?: undefined;
1306
1310
  UniWithdraw?: undefined;
1311
+ UniswapClaim?: undefined;
1307
1312
  UniCollectV3?: undefined;
1308
1313
  UniMintV3?: undefined;
1309
1314
  UniSupplyV3?: undefined;
@@ -1609,6 +1614,7 @@ declare const actionAddressesAllChains: {
1609
1614
  FLMorphoBlue?: undefined;
1610
1615
  UniSupply?: undefined;
1611
1616
  UniWithdraw?: undefined;
1617
+ UniswapClaim?: undefined;
1612
1618
  UniCollectV3?: undefined;
1613
1619
  UniMintV3?: undefined;
1614
1620
  UniSupplyV3?: undefined;
@@ -1889,6 +1895,7 @@ declare const actionAddresses: (chainId?: null) => {
1889
1895
  FLMorphoBlue: string;
1890
1896
  UniSupply: string;
1891
1897
  UniWithdraw: string;
1898
+ UniswapClaim: string;
1892
1899
  UniCollectV3: string;
1893
1900
  UniMintV3: string;
1894
1901
  UniSupplyV3: string;
@@ -2200,6 +2207,7 @@ declare const actionAddresses: (chainId?: null) => {
2200
2207
  FLMorphoBlue?: undefined;
2201
2208
  UniSupply?: undefined;
2202
2209
  UniWithdraw?: undefined;
2210
+ UniswapClaim?: undefined;
2203
2211
  DyDxWithdraw?: undefined;
2204
2212
  YearnSupply?: undefined;
2205
2213
  YearnWithdraw?: undefined;
@@ -2525,6 +2533,7 @@ declare const actionAddresses: (chainId?: null) => {
2525
2533
  FLGho?: undefined;
2526
2534
  UniSupply?: undefined;
2527
2535
  UniWithdraw?: undefined;
2536
+ UniswapClaim?: undefined;
2528
2537
  DyDxWithdraw?: undefined;
2529
2538
  YearnSupply?: undefined;
2530
2539
  YearnWithdraw?: undefined;
@@ -2800,6 +2809,7 @@ declare const actionAddresses: (chainId?: null) => {
2800
2809
  FLGho?: undefined;
2801
2810
  UniSupply?: undefined;
2802
2811
  UniWithdraw?: undefined;
2812
+ UniswapClaim?: undefined;
2803
2813
  UniCollectV3?: undefined;
2804
2814
  UniMintV3?: undefined;
2805
2815
  UniSupplyV3?: undefined;
@@ -3058,6 +3068,7 @@ declare const actionAddresses: (chainId?: null) => {
3058
3068
  FLMorphoBlue?: undefined;
3059
3069
  UniSupply?: undefined;
3060
3070
  UniWithdraw?: undefined;
3071
+ UniswapClaim?: undefined;
3061
3072
  UniCollectV3?: undefined;
3062
3073
  UniMintV3?: undefined;
3063
3074
  UniSupplyV3?: undefined;
@@ -3363,6 +3374,7 @@ declare const actionAddresses: (chainId?: null) => {
3363
3374
  FLMorphoBlue?: undefined;
3364
3375
  UniSupply?: undefined;
3365
3376
  UniWithdraw?: undefined;
3377
+ UniswapClaim?: undefined;
3366
3378
  UniCollectV3?: undefined;
3367
3379
  UniMintV3?: undefined;
3368
3380
  UniSupplyV3?: undefined;
@@ -3880,6 +3892,7 @@ declare const _default: {
3880
3892
  FLMorphoBlue: string;
3881
3893
  UniSupply: string;
3882
3894
  UniWithdraw: string;
3895
+ UniswapClaim: string;
3883
3896
  UniCollectV3: string;
3884
3897
  UniMintV3: string;
3885
3898
  UniSupplyV3: string;
@@ -4191,6 +4204,7 @@ declare const _default: {
4191
4204
  FLMorphoBlue?: undefined;
4192
4205
  UniSupply?: undefined;
4193
4206
  UniWithdraw?: undefined;
4207
+ UniswapClaim?: undefined;
4194
4208
  DyDxWithdraw?: undefined;
4195
4209
  YearnSupply?: undefined;
4196
4210
  YearnWithdraw?: undefined;
@@ -4516,6 +4530,7 @@ declare const _default: {
4516
4530
  FLGho?: undefined;
4517
4531
  UniSupply?: undefined;
4518
4532
  UniWithdraw?: undefined;
4533
+ UniswapClaim?: undefined;
4519
4534
  DyDxWithdraw?: undefined;
4520
4535
  YearnSupply?: undefined;
4521
4536
  YearnWithdraw?: undefined;
@@ -4791,6 +4806,7 @@ declare const _default: {
4791
4806
  FLGho?: undefined;
4792
4807
  UniSupply?: undefined;
4793
4808
  UniWithdraw?: undefined;
4809
+ UniswapClaim?: undefined;
4794
4810
  UniCollectV3?: undefined;
4795
4811
  UniMintV3?: undefined;
4796
4812
  UniSupplyV3?: undefined;
@@ -5049,6 +5065,7 @@ declare const _default: {
5049
5065
  FLMorphoBlue?: undefined;
5050
5066
  UniSupply?: undefined;
5051
5067
  UniWithdraw?: undefined;
5068
+ UniswapClaim?: undefined;
5052
5069
  UniCollectV3?: undefined;
5053
5070
  UniMintV3?: undefined;
5054
5071
  UniSupplyV3?: undefined;
@@ -5354,6 +5371,7 @@ declare const _default: {
5354
5371
  FLMorphoBlue?: undefined;
5355
5372
  UniSupply?: undefined;
5356
5373
  UniWithdraw?: undefined;
5374
+ UniswapClaim?: undefined;
5357
5375
  UniCollectV3?: undefined;
5358
5376
  UniMintV3?: undefined;
5359
5377
  UniSupplyV3?: undefined;
@@ -5634,6 +5652,7 @@ declare const _default: {
5634
5652
  FLMorphoBlue: string;
5635
5653
  UniSupply: string;
5636
5654
  UniWithdraw: string;
5655
+ UniswapClaim: string;
5637
5656
  UniCollectV3: string;
5638
5657
  UniMintV3: string;
5639
5658
  UniSupplyV3: string;
@@ -5945,6 +5964,7 @@ declare const _default: {
5945
5964
  FLMorphoBlue?: undefined;
5946
5965
  UniSupply?: undefined;
5947
5966
  UniWithdraw?: undefined;
5967
+ UniswapClaim?: undefined;
5948
5968
  DyDxWithdraw?: undefined;
5949
5969
  YearnSupply?: undefined;
5950
5970
  YearnWithdraw?: undefined;
@@ -6270,6 +6290,7 @@ declare const _default: {
6270
6290
  FLGho?: undefined;
6271
6291
  UniSupply?: undefined;
6272
6292
  UniWithdraw?: undefined;
6293
+ UniswapClaim?: undefined;
6273
6294
  DyDxWithdraw?: undefined;
6274
6295
  YearnSupply?: undefined;
6275
6296
  YearnWithdraw?: undefined;
@@ -6545,6 +6566,7 @@ declare const _default: {
6545
6566
  FLGho?: undefined;
6546
6567
  UniSupply?: undefined;
6547
6568
  UniWithdraw?: undefined;
6569
+ UniswapClaim?: undefined;
6548
6570
  UniCollectV3?: undefined;
6549
6571
  UniMintV3?: undefined;
6550
6572
  UniSupplyV3?: undefined;
@@ -6803,6 +6825,7 @@ declare const _default: {
6803
6825
  FLMorphoBlue?: undefined;
6804
6826
  UniSupply?: undefined;
6805
6827
  UniWithdraw?: undefined;
6828
+ UniswapClaim?: undefined;
6806
6829
  UniCollectV3?: undefined;
6807
6830
  UniMintV3?: undefined;
6808
6831
  UniSupplyV3?: undefined;
@@ -7108,6 +7131,7 @@ declare const _default: {
7108
7131
  FLMorphoBlue?: undefined;
7109
7132
  UniSupply?: undefined;
7110
7133
  UniWithdraw?: undefined;
7134
+ UniswapClaim?: undefined;
7111
7135
  UniCollectV3?: undefined;
7112
7136
  UniMintV3?: undefined;
7113
7137
  UniSupplyV3?: undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.3.25",
3
+ "version": "1.3.26",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/src/index.js",
@@ -0,0 +1,31 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256, bytes32 } from '../../types';
4
+
5
+ /**
6
+ * UniswapClaimAction - Claims UNI tokens from the Uniswap merkle distributor
7
+ *
8
+ * @category Uniswap
9
+ */
10
+ export class UniswapClaimAction extends Action {
11
+ /**
12
+ * @param index - Index of the claim in the merkle tree
13
+ * @param to - Address where to send the claimed UNI
14
+ * @param amount - Amount of UNI allocated to the smart wallet in the merkle tree
15
+ * @param merkleProof - Merkle proof of the claim
16
+ */
17
+ constructor(index: uint256, to: EthAddress, amount: uint256, merkleProof: Array<bytes32>) {
18
+ super(
19
+ 'UniswapClaim',
20
+ getAddr('UniswapClaim'),
21
+ ['uint256', 'address', 'uint256', 'bytes32[]'],
22
+ [index, to, amount, merkleProof],
23
+ );
24
+
25
+ this.mappableArgs = [
26
+ this.args[0],
27
+ this.args[1],
28
+ this.args[2],
29
+ ];
30
+ }
31
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './UniswapSupplyAction';
2
- export * from './UniswapWithdrawAction';
2
+ export * from './UniswapWithdrawAction';
3
+ export * from './UniswapClaimAction';
package/src/addresses.ts CHANGED
@@ -162,6 +162,7 @@ export const actionAddresses = {
162
162
  // uniswap
163
163
  UniSupply: '0x9935e12F0218E61c27D7f23eAC9A9D6881a078eC',
164
164
  UniWithdraw: '0xf8bb8F68b0A45DC315F3f7602a60cfb274B00951',
165
+ UniswapClaim: '0x4Eed50e142BFaE83b2d05ce960C55F4c536d123f',
165
166
 
166
167
  // uniswap V3
167
168
  UniCollectV3: '0x331D7C3F6E710cB6cFE94c4Aa04AC3345AC00e00',
@@ -0,0 +1,31 @@
1
+ const dfs = require('../../../src');
2
+ const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
3
+ const {assert} = require('chai');
4
+
5
+ describe('Action: UniswapClaimAction', () => {
6
+ let action;
7
+ context('Claim encoding', () => {
8
+ it('constructor', () => {
9
+ const index = '137';
10
+ const to = '0xC093dFcC2cBc4e9488589B7c2245a7F1DA043389';
11
+ const amount = '4809093062235489680';
12
+ const merkleProof = [
13
+ '0xd496d2a15cf30a2af545b0fd4ced50fb4224bb54e7c9add4885c7b7408c907a1',
14
+ '0x6a8fc6432934b1f2c9f9aed040f4389c0450dd94aff92b16864060e95fba4290',
15
+ '0xb7491e5e898e774e11c50044140df4c1c74bf9cd7855bac78f0709699ed0e6b7',
16
+ ];
17
+ action = new dfs.actions.uniswap.UniswapClaimAction(
18
+ index,
19
+ to,
20
+ amount,
21
+ merkleProof,
22
+ );
23
+ })
24
+ it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
25
+ it('encodeForRecipe', () => encodeForRecipe(action));
26
+ it('getEthValue', async () => {
27
+ const ethValue = await action.getEthValue();
28
+ assert.equal(ethValue, '0');
29
+ })
30
+ })
31
+ })