@defisaver/sdk 1.3.24 → 1.3.26-uniswap-dev-dev
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/uniswap/UniswapClaimAction.d.ts +16 -0
- package/esm/src/actions/uniswap/UniswapClaimAction.js +23 -0
- package/esm/src/actions/uniswap/index.d.ts +1 -0
- package/esm/src/actions/uniswap/index.js +1 -0
- package/esm/src/addresses.d.ts +6 -0
- package/esm/src/addresses.js +1 -0
- package/esm/src/index.d.ts +24 -0
- package/package.json +1 -1
- package/src/actions/uniswap/UniswapClaimAction.ts +31 -0
- package/src/actions/uniswap/index.ts +2 -1
- package/src/addresses.ts +1 -0
- package/test/actions/uniswap/UniswapClaimAction.js +31 -0
- package/umd/index.js +699 -665
|
@@ -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
|
+
}
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export declare const actionAddresses: {
|
|
|
123
123
|
FLMorphoBlue: string;
|
|
124
124
|
UniSupply: string;
|
|
125
125
|
UniWithdraw: string;
|
|
126
|
+
UniswapClaim: string;
|
|
126
127
|
UniCollectV3: string;
|
|
127
128
|
UniMintV3: string;
|
|
128
129
|
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;
|
|
@@ -759,6 +761,7 @@ export declare const actionAddresses: {
|
|
|
759
761
|
FLGho?: undefined;
|
|
760
762
|
UniSupply?: undefined;
|
|
761
763
|
UniWithdraw?: undefined;
|
|
764
|
+
UniswapClaim?: undefined;
|
|
762
765
|
DyDxWithdraw?: undefined;
|
|
763
766
|
YearnSupply?: undefined;
|
|
764
767
|
YearnWithdraw?: undefined;
|
|
@@ -1034,6 +1037,7 @@ export declare const actionAddresses: {
|
|
|
1034
1037
|
FLGho?: undefined;
|
|
1035
1038
|
UniSupply?: undefined;
|
|
1036
1039
|
UniWithdraw?: undefined;
|
|
1040
|
+
UniswapClaim?: undefined;
|
|
1037
1041
|
UniCollectV3?: undefined;
|
|
1038
1042
|
UniMintV3?: undefined;
|
|
1039
1043
|
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;
|
package/esm/src/addresses.js
CHANGED
|
@@ -138,6 +138,7 @@ export const actionAddresses = {
|
|
|
138
138
|
// uniswap
|
|
139
139
|
UniSupply: '0x9935e12F0218E61c27D7f23eAC9A9D6881a078eC',
|
|
140
140
|
UniWithdraw: '0xf8bb8F68b0A45DC315F3f7602a60cfb274B00951',
|
|
141
|
+
UniswapClaim: '0x4Eed50e142BFaE83b2d05ce960C55F4c536d123f',
|
|
141
142
|
// uniswap V3
|
|
142
143
|
UniCollectV3: '0x331D7C3F6E710cB6cFE94c4Aa04AC3345AC00e00',
|
|
143
144
|
UniMintV3: '0x3dF75BE8Fb0a6186BE9705cACaa6dD2a4Ec3e40C',
|
package/esm/src/index.d.ts
CHANGED
|
@@ -134,6 +134,7 @@ declare const actionAddressesAllChains: {
|
|
|
134
134
|
FLMorphoBlue: string;
|
|
135
135
|
UniSupply: string;
|
|
136
136
|
UniWithdraw: string;
|
|
137
|
+
UniswapClaim: string;
|
|
137
138
|
UniCollectV3: string;
|
|
138
139
|
UniMintV3: string;
|
|
139
140
|
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;
|
|
@@ -770,6 +772,7 @@ declare const actionAddressesAllChains: {
|
|
|
770
772
|
FLGho?: undefined;
|
|
771
773
|
UniSupply?: undefined;
|
|
772
774
|
UniWithdraw?: undefined;
|
|
775
|
+
UniswapClaim?: undefined;
|
|
773
776
|
DyDxWithdraw?: undefined;
|
|
774
777
|
YearnSupply?: undefined;
|
|
775
778
|
YearnWithdraw?: undefined;
|
|
@@ -1045,6 +1048,7 @@ declare const actionAddressesAllChains: {
|
|
|
1045
1048
|
FLGho?: undefined;
|
|
1046
1049
|
UniSupply?: undefined;
|
|
1047
1050
|
UniWithdraw?: undefined;
|
|
1051
|
+
UniswapClaim?: undefined;
|
|
1048
1052
|
UniCollectV3?: undefined;
|
|
1049
1053
|
UniMintV3?: undefined;
|
|
1050
1054
|
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;
|
|
@@ -1888,6 +1894,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1888
1894
|
FLMorphoBlue: string;
|
|
1889
1895
|
UniSupply: string;
|
|
1890
1896
|
UniWithdraw: string;
|
|
1897
|
+
UniswapClaim: string;
|
|
1891
1898
|
UniCollectV3: string;
|
|
1892
1899
|
UniMintV3: string;
|
|
1893
1900
|
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;
|
|
@@ -2524,6 +2532,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
2524
2532
|
FLGho?: undefined;
|
|
2525
2533
|
UniSupply?: undefined;
|
|
2526
2534
|
UniWithdraw?: undefined;
|
|
2535
|
+
UniswapClaim?: undefined;
|
|
2527
2536
|
DyDxWithdraw?: undefined;
|
|
2528
2537
|
YearnSupply?: undefined;
|
|
2529
2538
|
YearnWithdraw?: undefined;
|
|
@@ -2799,6 +2808,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
2799
2808
|
FLGho?: undefined;
|
|
2800
2809
|
UniSupply?: undefined;
|
|
2801
2810
|
UniWithdraw?: undefined;
|
|
2811
|
+
UniswapClaim?: undefined;
|
|
2802
2812
|
UniCollectV3?: undefined;
|
|
2803
2813
|
UniMintV3?: undefined;
|
|
2804
2814
|
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;
|
|
@@ -3879,6 +3891,7 @@ declare const _default: {
|
|
|
3879
3891
|
FLMorphoBlue: string;
|
|
3880
3892
|
UniSupply: string;
|
|
3881
3893
|
UniWithdraw: string;
|
|
3894
|
+
UniswapClaim: string;
|
|
3882
3895
|
UniCollectV3: string;
|
|
3883
3896
|
UniMintV3: string;
|
|
3884
3897
|
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;
|
|
@@ -4515,6 +4529,7 @@ declare const _default: {
|
|
|
4515
4529
|
FLGho?: undefined;
|
|
4516
4530
|
UniSupply?: undefined;
|
|
4517
4531
|
UniWithdraw?: undefined;
|
|
4532
|
+
UniswapClaim?: undefined;
|
|
4518
4533
|
DyDxWithdraw?: undefined;
|
|
4519
4534
|
YearnSupply?: undefined;
|
|
4520
4535
|
YearnWithdraw?: undefined;
|
|
@@ -4790,6 +4805,7 @@ declare const _default: {
|
|
|
4790
4805
|
FLGho?: undefined;
|
|
4791
4806
|
UniSupply?: undefined;
|
|
4792
4807
|
UniWithdraw?: undefined;
|
|
4808
|
+
UniswapClaim?: undefined;
|
|
4793
4809
|
UniCollectV3?: undefined;
|
|
4794
4810
|
UniMintV3?: undefined;
|
|
4795
4811
|
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;
|
|
@@ -5633,6 +5651,7 @@ declare const _default: {
|
|
|
5633
5651
|
FLMorphoBlue: string;
|
|
5634
5652
|
UniSupply: string;
|
|
5635
5653
|
UniWithdraw: string;
|
|
5654
|
+
UniswapClaim: string;
|
|
5636
5655
|
UniCollectV3: string;
|
|
5637
5656
|
UniMintV3: string;
|
|
5638
5657
|
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;
|
|
@@ -6269,6 +6289,7 @@ declare const _default: {
|
|
|
6269
6289
|
FLGho?: undefined;
|
|
6270
6290
|
UniSupply?: undefined;
|
|
6271
6291
|
UniWithdraw?: undefined;
|
|
6292
|
+
UniswapClaim?: undefined;
|
|
6272
6293
|
DyDxWithdraw?: undefined;
|
|
6273
6294
|
YearnSupply?: undefined;
|
|
6274
6295
|
YearnWithdraw?: undefined;
|
|
@@ -6544,6 +6565,7 @@ declare const _default: {
|
|
|
6544
6565
|
FLGho?: undefined;
|
|
6545
6566
|
UniSupply?: undefined;
|
|
6546
6567
|
UniWithdraw?: undefined;
|
|
6568
|
+
UniswapClaim?: undefined;
|
|
6547
6569
|
UniCollectV3?: undefined;
|
|
6548
6570
|
UniMintV3?: undefined;
|
|
6549
6571
|
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
|
@@ -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
|
+
}
|
package/src/addresses.ts
CHANGED
|
@@ -161,6 +161,7 @@ export const actionAddresses = {
|
|
|
161
161
|
// uniswap
|
|
162
162
|
UniSupply: '0x9935e12F0218E61c27D7f23eAC9A9D6881a078eC',
|
|
163
163
|
UniWithdraw: '0xf8bb8F68b0A45DC315F3f7602a60cfb274B00951',
|
|
164
|
+
UniswapClaim: '0x4Eed50e142BFaE83b2d05ce960C55F4c536d123f',
|
|
164
165
|
|
|
165
166
|
// uniswap V3
|
|
166
167
|
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
|
+
})
|