@defisaver/sdk 1.3.26-uniswap-dev-dev → 1.3.27-midnight-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/Action.js +23 -5
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.d.ts +18 -0
- package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.js +28 -0
- package/esm/src/actions/midnight/MidnightPaybackDirectAction.d.ts +16 -0
- package/esm/src/actions/midnight/MidnightPaybackDirectAction.js +24 -0
- package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.d.ts +18 -0
- package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.js +28 -0
- package/esm/src/actions/midnight/MidnightSupplyCollateralAction.d.ts +17 -0
- package/esm/src/actions/midnight/MidnightSupplyCollateralAction.js +26 -0
- package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.d.ts +17 -0
- package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.js +26 -0
- package/esm/src/actions/midnight/index.d.ts +5 -0
- package/esm/src/actions/midnight/index.js +5 -0
- package/esm/src/actions/uniswap/index.d.ts +0 -1
- package/esm/src/actions/uniswap/index.js +0 -1
- package/esm/src/addresses.d.ts +36 -6
- package/esm/src/addresses.js +6 -1
- package/esm/src/index.d.ts +144 -24
- package/package.json +1 -1
- package/src/Action.ts +21 -5
- package/src/actions/index.ts +2 -0
- package/src/actions/midnight/MidnightBorrowFromOrdersAction.ts +44 -0
- package/src/actions/midnight/MidnightPaybackDirectAction.ts +36 -0
- package/src/actions/midnight/MidnightPaybackFromOrdersAction.ts +44 -0
- package/src/actions/midnight/MidnightSupplyCollateralAction.ts +39 -0
- package/src/actions/midnight/MidnightWithdrawCollateralAction.ts +39 -0
- package/src/actions/midnight/index.ts +5 -0
- package/src/actions/uniswap/index.ts +1 -2
- package/src/addresses.ts +7 -1
- package/umd/index.js +877 -704
- package/esm/src/actions/uniswap/UniswapClaimAction.d.ts +0 -16
- package/esm/src/actions/uniswap/UniswapClaimAction.js +0 -23
- package/src/actions/uniswap/UniswapClaimAction.ts +0 -31
- package/test/actions/uniswap/UniswapClaimAction.js +0 -31
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MidnightSupplyCollateralAction
|
|
7
|
+
*
|
|
8
|
+
* @category MidnightSupplyCollateral
|
|
9
|
+
*/
|
|
10
|
+
export class MidnightSupplyCollateralAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param marketId Market id.
|
|
13
|
+
* @param onBehalf Address to supply tokens on behalf of.
|
|
14
|
+
* @param from Address from which to pull collateral asset.
|
|
15
|
+
* @param amount Amount of tokens to supply.
|
|
16
|
+
* @param collateralIndex Collateral index (0-based).
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
marketId: bytes32,
|
|
20
|
+
onBehalf: EthAddress,
|
|
21
|
+
from: EthAddress,
|
|
22
|
+
amount: uint256,
|
|
23
|
+
collateralIndex: uint256,
|
|
24
|
+
) {
|
|
25
|
+
super(
|
|
26
|
+
'MidnightSupplyCollateral',
|
|
27
|
+
getAddr('MidnightSupplyCollateral'),
|
|
28
|
+
['bytes32', 'address', 'address', 'uint256', 'uint256'],
|
|
29
|
+
[marketId, onBehalf, from, amount, collateralIndex],
|
|
30
|
+
);
|
|
31
|
+
this.mappableArgs = [
|
|
32
|
+
this.args[0],
|
|
33
|
+
this.args[1],
|
|
34
|
+
this.args[2],
|
|
35
|
+
this.args[3],
|
|
36
|
+
this.args[4],
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, bytes32, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MidnightWithdrawCollateralAction
|
|
7
|
+
*
|
|
8
|
+
* @category MidnightWithdrawCollateral
|
|
9
|
+
*/
|
|
10
|
+
export class MidnightWithdrawCollateralAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param marketId Market id.
|
|
13
|
+
* @param onBehalf Address to withdraw tokens on behalf of.
|
|
14
|
+
* @param to Address that will receive the withdrawn tokens.
|
|
15
|
+
* @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
|
|
16
|
+
* @param collateralIndex Collateral index (0-based).
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
marketId: bytes32,
|
|
20
|
+
onBehalf: EthAddress,
|
|
21
|
+
to: EthAddress,
|
|
22
|
+
amount: uint256,
|
|
23
|
+
collateralIndex: uint256,
|
|
24
|
+
) {
|
|
25
|
+
super(
|
|
26
|
+
'MidnightWithdrawCollateral',
|
|
27
|
+
getAddr('MidnightWithdrawCollateral'),
|
|
28
|
+
['bytes32', 'address', 'address', 'uint256', 'uint256'],
|
|
29
|
+
[marketId, onBehalf, to, amount, collateralIndex],
|
|
30
|
+
);
|
|
31
|
+
this.mappableArgs = [
|
|
32
|
+
this.args[0],
|
|
33
|
+
this.args[1],
|
|
34
|
+
this.args[2],
|
|
35
|
+
this.args[3],
|
|
36
|
+
this.args[4],
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
}
|
package/src/addresses.ts
CHANGED
|
@@ -161,7 +161,6 @@ export const actionAddresses = {
|
|
|
161
161
|
// uniswap
|
|
162
162
|
UniSupply: '0x9935e12F0218E61c27D7f23eAC9A9D6881a078eC',
|
|
163
163
|
UniWithdraw: '0xf8bb8F68b0A45DC315F3f7602a60cfb274B00951',
|
|
164
|
-
UniswapClaim: '0x4Eed50e142BFaE83b2d05ce960C55F4c536d123f',
|
|
165
164
|
|
|
166
165
|
// uniswap V3
|
|
167
166
|
UniCollectV3: '0x331D7C3F6E710cB6cFE94c4Aa04AC3345AC00e00',
|
|
@@ -678,6 +677,13 @@ export const actionAddresses = {
|
|
|
678
677
|
SFApproveTokens: '0x03EDC9A683f37BFB7516FF234223fFb6E38D5eb9',
|
|
679
678
|
SummerfiUnsub: '0x0000000000000000000000000000000000000000', // Only exists for Maker on Mainnet
|
|
680
679
|
SummerfiUnsubV2: '0x60587B8Fe62Fc149d285a611822263206b4138da',
|
|
680
|
+
|
|
681
|
+
MidnightPaybackDirect: '0xC1B049A038f9E9811dc1Ad1D335369844d4268D9',
|
|
682
|
+
MidnightBorrowFromOrders: '0x82F9dd7eA821463178A2c7bC4047057Bd338E5e5',
|
|
683
|
+
MidnightPaybackFromOrders: '0x4B0c242195B1C941A2e7a871Bfa242c40dbf032F',
|
|
684
|
+
MidnightSupplyCollateral: '0xC83C7Ca37203FC30636EDcd3Ef127194542504c5',
|
|
685
|
+
MidnightWithdrawCollateral: '0x4fA4DA5fDD813279409B4Bf0Bde5Fe9ca8006A9C',
|
|
686
|
+
MidnightView: '0x3aa272f329E8B562A3bA56Bb6979a44D23A28839',
|
|
681
687
|
},
|
|
682
688
|
[NETWORKS.linea.chainId]: {
|
|
683
689
|
// Basic
|