@defisaver/sdk 1.3.2 → 1.3.4-dev.0

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.
Files changed (36) hide show
  1. package/esm/src/actions/sky/SkyClaimRewardsAction.d.ts +2 -2
  2. package/esm/src/actions/sky/SkyClaimRewardsAction.js +2 -2
  3. package/esm/src/actions/sky/SkyStakingEngineClaimRewards.d.ts +16 -0
  4. package/esm/src/actions/sky/SkyStakingEngineClaimRewards.js +24 -0
  5. package/esm/src/actions/sky/SkyStakingEngineOpen.d.ts +13 -0
  6. package/esm/src/actions/sky/SkyStakingEngineOpen.js +18 -0
  7. package/esm/src/actions/sky/SkyStakingEngineSelectFarm.d.ts +15 -0
  8. package/esm/src/actions/sky/SkyStakingEngineSelectFarm.js +22 -0
  9. package/esm/src/actions/sky/SkyStakingEngineStake.d.ts +16 -0
  10. package/esm/src/actions/sky/SkyStakingEngineStake.js +24 -0
  11. package/esm/src/actions/sky/SkyStakingEngineUnstake.d.ts +16 -0
  12. package/esm/src/actions/sky/SkyStakingEngineUnstake.js +24 -0
  13. package/esm/src/actions/sky/SkyUnstakeAction.d.ts +1 -1
  14. package/esm/src/actions/sky/SkyUnstakeAction.js +1 -1
  15. package/esm/src/actions/sky/index.d.ts +5 -0
  16. package/esm/src/actions/sky/index.js +6 -0
  17. package/esm/src/addresses.d.ts +321 -0
  18. package/esm/src/addresses.js +48 -1
  19. package/esm/src/config.js +8 -0
  20. package/esm/src/index.d.ts +1674 -390
  21. package/esm/src/types.d.ts +1 -0
  22. package/package.json +2 -2
  23. package/src/actions/sky/SkyClaimRewardsAction.ts +3 -4
  24. package/src/actions/sky/SkyStakeAction.ts +0 -1
  25. package/src/actions/sky/SkyStakingEngineClaimRewards.ts +36 -0
  26. package/src/actions/sky/SkyStakingEngineOpen.ts +25 -0
  27. package/src/actions/sky/SkyStakingEngineSelectFarm.ts +29 -0
  28. package/src/actions/sky/SkyStakingEngineStake.ts +36 -0
  29. package/src/actions/sky/SkyStakingEngineUnstake.ts +36 -0
  30. package/src/actions/sky/SkyUnstakeAction.ts +1 -2
  31. package/src/actions/sky/index.ts +8 -1
  32. package/src/addresses.ts +50 -1
  33. package/src/config.ts +8 -0
  34. package/src/types.ts +1 -0
  35. package/umd/index.js +407 -179
  36. package/yarn-error.log +0 -3976
@@ -28,6 +28,7 @@ declare type Networks = {
28
28
  optimism: Network;
29
29
  arbitrum: Network;
30
30
  base: Network;
31
+ linea: Network;
31
32
  };
32
33
  declare type TxSaverData = {
33
34
  maxTxCostInFeeToken: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.3.2",
3
+ "version": "1.3.4-dev.0",
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.7.0",
27
27
  "@ethersproject/address": "^5.0.10",
28
28
  "@ethersproject/solidity": "^5.0.9",
29
29
  "@types/web3-eth-abi": "^1.2.2",
@@ -1,17 +1,16 @@
1
1
  import { Action } from '../../Action';
2
- import { requireAddress } from '../../utils/general';
3
- import { uint256, EthAddress } from '../../types';
2
+ import { EthAddress } from '../../types';
4
3
  import { getAddr } from '../../addresses';
5
4
 
6
5
  /**
7
- * SkyStakeAction
6
+ * SkyClaimRewardsAction
8
7
  *
9
8
  * @category Sky
10
9
  */
11
10
  export class SkyClaimRewardsAction extends Action {
12
11
  /**
13
12
  * @param stakingContract
14
- * @param stakingToken
13
+ * @param rewardToken
15
14
  * @param to
16
15
  */
17
16
  constructor(stakingContract:EthAddress, rewardToken:EthAddress, to:EthAddress) {
@@ -1,5 +1,4 @@
1
1
  import { Action } from '../../Action';
2
- import { requireAddress } from '../../utils/general';
3
2
  import { uint256, EthAddress } from '../../types';
4
3
  import { getAddr } from '../../addresses';
5
4
 
@@ -0,0 +1,36 @@
1
+ import { Action } from '../../Action';
2
+ import { uint256, EthAddress } from '../../types';
3
+ import { getAddr } from '../../addresses';
4
+
5
+ /**
6
+ * SkyStakingEngineClaimRewardsAction
7
+ *
8
+ * @category Sky
9
+ */
10
+ export class SkyStakingEngineClaimRewardsAction extends Action {
11
+ /**
12
+ * @param stakingContract
13
+ * @param index
14
+ * @param farm
15
+ * @param to
16
+ */
17
+ constructor(
18
+ stakingContract: EthAddress,
19
+ index: uint256,
20
+ farm: EthAddress,
21
+ to: EthAddress,
22
+ ) {
23
+ super(
24
+ 'SkyStakingEngineClaimRewards',
25
+ getAddr('SkyStakingEngineClaimRewards'),
26
+ ['address', 'uint256', 'address', 'address'],
27
+ [stakingContract, index, farm, to],
28
+ );
29
+ this.mappableArgs = [
30
+ this.args[0],
31
+ this.args[1],
32
+ this.args[2],
33
+ this.args[3],
34
+ ];
35
+ }
36
+ }
@@ -0,0 +1,25 @@
1
+ import { Action } from '../../Action';
2
+ import { EthAddress } from '../../types';
3
+ import { getAddr } from '../../addresses';
4
+
5
+ /**
6
+ * SkyStakingEngineOpenAction
7
+ *
8
+ * @category Sky
9
+ */
10
+ export class SkyStakingEngineOpenAction extends Action {
11
+ /**
12
+ * @param stakingContract
13
+ */
14
+ constructor(stakingContract: EthAddress) {
15
+ super(
16
+ 'SkyStakingEngineOpen',
17
+ getAddr('SkyStakingEngineOpen'),
18
+ ['address'],
19
+ [stakingContract],
20
+ );
21
+ this.mappableArgs = [
22
+ this.args[0],
23
+ ];
24
+ }
25
+ }
@@ -0,0 +1,29 @@
1
+ import { Action } from '../../Action';
2
+ import { uint256, EthAddress } from '../../types';
3
+ import { getAddr } from '../../addresses';
4
+
5
+ /**
6
+ * SkyStakingEngineSelectFarmAction
7
+ *
8
+ * @category Sky
9
+ */
10
+ export class SkyStakingEngineSelectFarmAction extends Action {
11
+ /**
12
+ * @param stakingContract
13
+ * @param index
14
+ * @param farm
15
+ */
16
+ constructor(stakingContract: EthAddress, index: uint256, farm: EthAddress) {
17
+ super(
18
+ 'SkyStakingEngineSelectFarm',
19
+ getAddr('SkyStakingEngineSelectFarm'),
20
+ ['address', 'uint256', 'address'],
21
+ [stakingContract, index, farm],
22
+ );
23
+ this.mappableArgs = [
24
+ this.args[0],
25
+ this.args[1],
26
+ this.args[2],
27
+ ];
28
+ }
29
+ }
@@ -0,0 +1,36 @@
1
+ import { Action } from '../../Action';
2
+ import { uint256, EthAddress } from '../../types';
3
+ import { getAddr } from '../../addresses';
4
+
5
+ /**
6
+ * SkyStakingEngineStakeAction
7
+ *
8
+ * @category Sky
9
+ */
10
+ export class SkyStakingEngineStakeAction extends Action {
11
+ /**
12
+ * @param stakingContract
13
+ * @param index
14
+ * @param amount
15
+ * @param from
16
+ */
17
+ constructor(
18
+ stakingContract: EthAddress,
19
+ index: uint256,
20
+ amount: uint256,
21
+ from: EthAddress,
22
+ ) {
23
+ super(
24
+ 'SkyStakingEngineStake',
25
+ getAddr('SkyStakingEngineStake'),
26
+ ['address', 'uint256', 'uint256', 'address'],
27
+ [stakingContract, index, amount, from],
28
+ );
29
+ this.mappableArgs = [
30
+ this.args[0],
31
+ this.args[1],
32
+ this.args[2],
33
+ this.args[3],
34
+ ];
35
+ }
36
+ }
@@ -0,0 +1,36 @@
1
+ import { Action } from '../../Action';
2
+ import { uint256, EthAddress } from '../../types';
3
+ import { getAddr } from '../../addresses';
4
+
5
+ /**
6
+ * SkyStakingEngineUnstakeAction
7
+ *
8
+ * @category Sky
9
+ */
10
+ export class SkyStakingEngineUnstakeAction extends Action {
11
+ /**
12
+ * @param stakingContract
13
+ * @param index
14
+ * @param amount
15
+ * @param to
16
+ */
17
+ constructor(
18
+ stakingContract: EthAddress,
19
+ index: uint256,
20
+ amount: uint256,
21
+ to: EthAddress,
22
+ ) {
23
+ super(
24
+ 'SkyStakingEngineUnstake',
25
+ getAddr('SkyStakingEngineUnstake'),
26
+ ['address', 'uint256', 'uint256', 'address'],
27
+ [stakingContract, index, amount, to],
28
+ );
29
+ this.mappableArgs = [
30
+ this.args[0],
31
+ this.args[1],
32
+ this.args[2],
33
+ this.args[3],
34
+ ];
35
+ }
36
+ }
@@ -1,10 +1,9 @@
1
1
  import { Action } from '../../Action';
2
- import { requireAddress } from '../../utils/general';
3
2
  import { uint256, EthAddress } from '../../types';
4
3
  import { getAddr } from '../../addresses';
5
4
 
6
5
  /**
7
- * SkyStakeAction
6
+ * SkyUnstakeAction
8
7
  *
9
8
  * @category Sky
10
9
  */
@@ -1,3 +1,10 @@
1
1
  export * from './SkyClaimRewardsAction';
2
2
  export * from './SkyStakeAction';
3
- export * from './SkyUnstakeAction';
3
+ export * from './SkyUnstakeAction';
4
+
5
+ // Sky Staking Engine
6
+ export * from './SkyStakingEngineOpen';
7
+ export * from './SkyStakingEngineSelectFarm';
8
+ export * from './SkyStakingEngineStake';
9
+ export * from './SkyStakingEngineUnstake';
10
+ export * from './SkyStakingEngineClaimRewards';
package/src/addresses.ts CHANGED
@@ -34,6 +34,11 @@ export const actionAddresses = {
34
34
  SkyStake: '0x5803C399EE9f887C8b81075E4C185c448361c235',
35
35
  SkyUnstake: '0x4b6d3A01465fa88D7D596333D15832434a568452',
36
36
  SkyClaimRewards: '0x8A2A23DfC0CD1738bD4408F1668E2B12ACD95369',
37
+ SkyStakingEngineOpen: '0x7F7669d926beeba495e8D97C6DAF6C000F05AEC0',
38
+ SkyStakingEngineSelectFarm: '0x44fe1615294E9D50faeb690D2a944EAF8B500892',
39
+ SkyStakingEngineStake: '0xBb7F34F8A7809Ffe0775D13a783fE885EBB9aea5',
40
+ SkyStakingEngineUnstake: '0x5456F09bBbBDB6bFad50A22256bAC7f3DDaab121',
41
+ SkyStakingEngineClaimRewards: '0x0aF3F032A8544c63c35FD2995be8EE2Df68d2c21',
37
42
 
38
43
  // maker
39
44
  McdGenerate: '0xCb50a91C0f12f439b8bf11E9474B9c1ED62Bf7a3',
@@ -46,7 +51,7 @@ export const actionAddresses = {
46
51
  McdClaim: '0xc0FC0f5Ba156E16217F8C7f400AEc0a658419C13',
47
52
  McdDsrDeposit: '0x64bde7F73e05c6a28b701D7f569f0c0Ae4f6aD33',
48
53
  McdDsrWithdraw: '0x96190d1f1c040fd8449250b90778Aa360f2e0Ec1',
49
- McdTokenConverter: '0x8064B61A4DCc913C21Ca9bf7fF56314993d10849',
54
+ McdTokenConverter: '0x81f9DB43EbA7E8EE6a8d9d399d5ca886C567F9dd',
50
55
 
51
56
  // reflexer
52
57
  ReflexerSupply: '0xd7a36CD4ce7CCc2F1376Dc5C48BaC84380A4f698',
@@ -597,6 +602,42 @@ export const actionAddresses = {
597
602
  // summer.fi
598
603
  SFApproveTokens: '0x03EDC9A683f37BFB7516FF234223fFb6E38D5eb9',
599
604
  },
605
+ [NETWORKS.linea.chainId]: {
606
+ // Basic
607
+ DFSSell: '0x0a9b2080c14daf008ae87c977dfdf5f5d6d0937f',
608
+ DFSSellNoFee: '0x0000000000000000000000000000000000000000',
609
+ WrapEth: '0xB8af168883D049FF9C811ab5B5DE179f3e7d6Fb7',
610
+ UnwrapEth: '0xc5D0FF89e950a364207fC5be1b070170C874Dd87',
611
+ SendToken: '0x93A6E0dC4C4a6033922d386e4cbd9e31278A2BBa',
612
+ SendTokens: '0x3455057cE720b4c9B53D77509361E87f0F17b971',
613
+ SendTokenAndUnwrap: '0x520E8b0573a03D26D0E39a409E85E28459e24C0E',
614
+ PullToken: '0x75198244Ad7b3ebFCbFd67e6e06B1452bd6Fa831',
615
+ ApproveToken: '0x13976feAeC930Cc51986605D6f479d97a3b90FA9',
616
+ SumInputs: '0xA5b3aA3f06C2c0986E1f45ae36CD6C20392798f1',
617
+ SubInputs: '0x4C0607dAD18c0DE19f6d7b25c0B0f1990818e9d7',
618
+ TokenBalance: '0x16c9de87215D2198614dbC5419658eAdf4465025',
619
+ PermitToken: '0xcc0f04e8c34b670a1d06f4978c843952f690d3f4',
620
+ MerklClaim: '0x4E1946059Dc2426Ef3a9AE82fB30B7718a09B7E1',
621
+ TransferNFT: '0xAC17f651591f417934EeA04CF6629584Eb50A4bB',
622
+ TokenizedVaultAdapter: '0x1155BF929D78F1DeF999ACedE1867f79A7C66066',
623
+
624
+ // Flashloan
625
+ FLAction: '0x27c0bae2338ce28097122393faf90375b9395dd1', // fix temp
626
+ FLAaveV3: '0x27c0bae2338ce28097122393faf90375b9395dd1',
627
+
628
+ // AaveV3
629
+ AaveV3Withdraw: '0xae56474aBe3C271579b513b6668864e39f65Ae15',
630
+ AaveV3Supply: '0x7dFF34190d0307fC234fc7E8C152C9715083eB02',
631
+ AaveV3SetEMode: '0xa2ABA81e65543d18dd1a1E4A31Bc41C4a86453cf',
632
+ AaveV3Payback: '0x125b8b832bd7f2ebd77eef148a6319ade751c44b',
633
+ AaveV3CollateralSwitch: '0xa898078f369A78CE6b8023715e8f6d2Ad7d2719f',
634
+ AaveV3ClaimRewards: '0x4839d021A24820e57C31D386d430e2e82694F73B',
635
+ AaveV3Borrow: '0x9D95de57631DD8Ac071892843DA67FEe52EA3962',
636
+ AaveV3ATokenPayback: '0xedfc68e2874b0afc0963e18ae4d68522aec7f97d',
637
+ AaveV3View: '0xc9d6efa6e08b66a5cdc516bcd5807c2fa69e0f2a',
638
+ AaveV3DelegateWithSig: '0x169D6E128238ebabF86032Ae9da65938eaD7F69e',
639
+ AaveV3DelegateCredit: '0x2A588cBCBd5e6c6ba7ED0E260B8107F599017DDE',
640
+ },
600
641
  };
601
642
 
602
643
  export const otherAddresses = {
@@ -654,6 +695,14 @@ export const otherAddresses = {
654
695
  DefisaverLogger: '0xc9D6EfA6e08B66a5Cdc516Bcd5807c2fa69E0f2A',
655
696
  Empty: '0x0000000000000000000000000000000000000000',
656
697
  },
698
+ [NETWORKS.linea.chainId]: {
699
+ RecipeExecutor: '0x50bCFC115283dF48Ab6382551B9B93b08E197747',
700
+ DFSRegistry: '0x09fBeC68D216667C3262211D2E5609578951dCE0',
701
+ DSGuardFactory: '0x02a516861f41262f22617511d00b6fccab65f762',
702
+ AdminVault: '0x71a9ef13c960c2f1dd17962d3592a5bcdfad6de0',
703
+ DefisaverLogger: '0x44e98bb58d725f2ef93a195f518b335dcb784c78',
704
+ Empty: '0x0000000000000000000000000000000000000000',
705
+ },
657
706
  };
658
707
 
659
708
  /**
package/src/config.ts CHANGED
@@ -46,6 +46,14 @@ export const NETWORKS : Networks = {
46
46
  rpcUrls: [],
47
47
  nativeCurrency: { name: 'Ethereum', decimals: 18, symbol: 'ETH' },
48
48
  },
49
+ linea: {
50
+ chainId: 59144,
51
+ chainName: 'Linea',
52
+ blockExplorerUrls: ['https://lineascan.build/'],
53
+ iconUrls: ['https://bridge.base.org/icons/base.svg'],
54
+ rpcUrls: [],
55
+ nativeCurrency: { name: 'Ethereum', decimals: 18, symbol: 'ETH' },
56
+ },
49
57
  };
50
58
 
51
59
  /**
package/src/types.ts CHANGED
@@ -30,6 +30,7 @@ type Networks = {
30
30
  optimism:Network,
31
31
  arbitrum:Network,
32
32
  base:Network,
33
+ linea:Network,
33
34
  };
34
35
 
35
36
  type TxSaverData = {