@defisaver/sdk 1.3.1 → 1.3.3

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,8 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256 } from '../types';
3
+ /**
4
+ * @category Triggers
5
+ */
6
+ export declare class LiquityV2AdjustRateDebtInFrontTrigger extends Action {
7
+ constructor(market: EthAddress, troveId: uint256, criticalDebtInFrontLimit: uint256, nonCriticalDebtInFrontLimit: uint256);
8
+ }
@@ -0,0 +1,10 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ * @category Triggers
5
+ */
6
+ export class LiquityV2AdjustRateDebtInFrontTrigger extends Action {
7
+ constructor(market, troveId, criticalDebtInFrontLimit, nonCriticalDebtInFrontLimit) {
8
+ super('LiquityV2AdjustRateDebtInFrontTrigger', getAddr('Empty'), ['address', 'uint256', 'uint256', 'uint256'], [market, troveId, criticalDebtInFrontLimit, nonCriticalDebtInFrontLimit]);
9
+ }
10
+ }
@@ -27,3 +27,4 @@ export * from './LiquityV2QuotePriceTrigger';
27
27
  export * from './FluidRatioTrigger';
28
28
  export * from './CompV3PriceTrigger';
29
29
  export * from './CompV3PriceRangeTrigger';
30
+ export * from './LiquityV2AdjustRateDebtInFrontTrigger';
@@ -27,3 +27,4 @@ export * from './LiquityV2QuotePriceTrigger';
27
27
  export * from './FluidRatioTrigger';
28
28
  export * from './CompV3PriceTrigger';
29
29
  export * from './CompV3PriceRangeTrigger';
30
+ export * from './LiquityV2AdjustRateDebtInFrontTrigger';
@@ -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.1",
3
+ "version": "1.3.3",
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",
@@ -0,0 +1,30 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { uint256, EthAddress } from '../../types';
4
+
5
+ /**
6
+ * LiquityV2NewInterestRateCheckerAction - Checks new interest rate for user position and reverts if faulty
7
+ *
8
+ * @category Checkers
9
+ */
10
+ export class LiquityV2NewInterestRateCheckerAction extends Action {
11
+ /**
12
+ * @param market Address of the market
13
+ * @param troveId Trove id of the user
14
+ * @param interestRateChange The interest rate change to check
15
+ */
16
+ constructor(market: EthAddress, troveId: uint256, interestRateChange: uint256) {
17
+ super(
18
+ 'LiquityV2NewInterestRateChecker',
19
+ getAddr('Empty'),
20
+ ['address', 'uint256', 'uint256'],
21
+ [market, troveId, interestRateChange],
22
+ );
23
+
24
+ this.mappableArgs = [
25
+ this.args[0],
26
+ this.args[1],
27
+ this.args[2],
28
+ ];
29
+ }
30
+ }
@@ -13,4 +13,5 @@ export * from './AaveV3OpenRatioCheckAction';
13
13
  export * from './MorphoBlueTargetRatioCheckAction';
14
14
  export * from './LiquityV2RatioCheckAction';
15
15
  export * from './LiquityV2TargetRatioCheckAction';
16
+ export * from './LiquityV2NewInterestRateCheckerAction';
16
17
  export * from './FluidRatioCheckAction';
package/src/addresses.ts CHANGED
@@ -597,6 +597,42 @@ export const actionAddresses = {
597
597
  // summer.fi
598
598
  SFApproveTokens: '0x03EDC9A683f37BFB7516FF234223fFb6E38D5eb9',
599
599
  },
600
+ [NETWORKS.linea.chainId]: {
601
+ // Basic
602
+ DFSSell: '0x0a9b2080c14daf008ae87c977dfdf5f5d6d0937f',
603
+ DFSSellNoFee: '0x0000000000000000000000000000000000000000',
604
+ WrapEth: '0xB8af168883D049FF9C811ab5B5DE179f3e7d6Fb7',
605
+ UnwrapEth: '0xc5D0FF89e950a364207fC5be1b070170C874Dd87',
606
+ SendToken: '0x93A6E0dC4C4a6033922d386e4cbd9e31278A2BBa',
607
+ SendTokens: '0x3455057cE720b4c9B53D77509361E87f0F17b971',
608
+ SendTokenAndUnwrap: '0x520E8b0573a03D26D0E39a409E85E28459e24C0E',
609
+ PullToken: '0x75198244Ad7b3ebFCbFd67e6e06B1452bd6Fa831',
610
+ ApproveToken: '0x13976feAeC930Cc51986605D6f479d97a3b90FA9',
611
+ SumInputs: '0xA5b3aA3f06C2c0986E1f45ae36CD6C20392798f1',
612
+ SubInputs: '0x4C0607dAD18c0DE19f6d7b25c0B0f1990818e9d7',
613
+ TokenBalance: '0x16c9de87215D2198614dbC5419658eAdf4465025',
614
+ PermitToken: '0xcc0f04e8c34b670a1d06f4978c843952f690d3f4',
615
+ MerklClaim: '0x4E1946059Dc2426Ef3a9AE82fB30B7718a09B7E1',
616
+ TransferNFT: '0xAC17f651591f417934EeA04CF6629584Eb50A4bB',
617
+ TokenizedVaultAdapter: '0x1155BF929D78F1DeF999ACedE1867f79A7C66066',
618
+
619
+ // Flashloan
620
+ FLAction: '0x27c0bae2338ce28097122393faf90375b9395dd1', // fix temp
621
+ FLAaveV3: '0x27c0bae2338ce28097122393faf90375b9395dd1',
622
+
623
+ // AaveV3
624
+ AaveV3Withdraw: '0xae56474aBe3C271579b513b6668864e39f65Ae15',
625
+ AaveV3Supply: '0x7dFF34190d0307fC234fc7E8C152C9715083eB02',
626
+ AaveV3SetEMode: '0xa2ABA81e65543d18dd1a1E4A31Bc41C4a86453cf',
627
+ AaveV3Payback: '0x125b8b832bd7f2ebd77eef148a6319ade751c44b',
628
+ AaveV3CollateralSwitch: '0xa898078f369A78CE6b8023715e8f6d2Ad7d2719f',
629
+ AaveV3ClaimRewards: '0x4839d021A24820e57C31D386d430e2e82694F73B',
630
+ AaveV3Borrow: '0x9D95de57631DD8Ac071892843DA67FEe52EA3962',
631
+ AaveV3ATokenPayback: '0xedfc68e2874b0afc0963e18ae4d68522aec7f97d',
632
+ AaveV3View: '0xc9d6efa6e08b66a5cdc516bcd5807c2fa69e0f2a',
633
+ AaveV3DelegateWithSig: '0x169D6E128238ebabF86032Ae9da65938eaD7F69e',
634
+ AaveV3DelegateCredit: '0x2A588cBCBd5e6c6ba7ED0E260B8107F599017DDE',
635
+ },
600
636
  };
601
637
 
602
638
  export const otherAddresses = {
@@ -654,6 +690,14 @@ export const otherAddresses = {
654
690
  DefisaverLogger: '0xc9D6EfA6e08B66a5Cdc516Bcd5807c2fa69E0f2A',
655
691
  Empty: '0x0000000000000000000000000000000000000000',
656
692
  },
693
+ [NETWORKS.linea.chainId]: {
694
+ RecipeExecutor: '0x50bCFC115283dF48Ab6382551B9B93b08E197747',
695
+ DFSRegistry: '0x09fBeC68D216667C3262211D2E5609578951dCE0',
696
+ DSGuardFactory: '0x02a516861f41262f22617511d00b6fccab65f762',
697
+ AdminVault: '0x71a9ef13c960c2f1dd17962d3592a5bcdfad6de0',
698
+ DefisaverLogger: '0x44e98bb58d725f2ef93a195f518b335dcb784c78',
699
+ Empty: '0x0000000000000000000000000000000000000000',
700
+ },
657
701
  };
658
702
 
659
703
  /**
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
  /**
@@ -0,0 +1,17 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ import { EthAddress, uint256 } from '../types';
4
+
5
+ /**
6
+ * @category Triggers
7
+ */
8
+ export class LiquityV2AdjustRateDebtInFrontTrigger extends Action {
9
+ constructor(market: EthAddress, troveId: uint256, criticalDebtInFrontLimit: uint256, nonCriticalDebtInFrontLimit: uint256) {
10
+ super(
11
+ 'LiquityV2AdjustRateDebtInFrontTrigger',
12
+ getAddr('Empty'),
13
+ ['address', 'uint256', 'uint256', 'uint256'],
14
+ [market, troveId, criticalDebtInFrontLimit, nonCriticalDebtInFrontLimit],
15
+ );
16
+ }
17
+ }
@@ -27,3 +27,4 @@ export * from './LiquityV2QuotePriceTrigger';
27
27
  export * from './FluidRatioTrigger';
28
28
  export * from './CompV3PriceTrigger';
29
29
  export * from './CompV3PriceRangeTrigger';
30
+ export * from './LiquityV2AdjustRateDebtInFrontTrigger';
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 = {