@defisaver/sdk 1.0.40 → 1.0.41
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/basic/TokenizedVaultAdapterDepositAction.d.ts +22 -0
- package/esm/src/actions/basic/TokenizedVaultAdapterDepositAction.js +35 -0
- package/esm/src/actions/basic/TokenizedVaultAdapterMintAction.d.ts +22 -0
- package/esm/src/actions/basic/TokenizedVaultAdapterMintAction.js +35 -0
- package/esm/src/actions/basic/TokenizedVaultAdapterRedeemAction.d.ts +20 -0
- package/esm/src/actions/basic/TokenizedVaultAdapterRedeemAction.js +33 -0
- package/esm/src/actions/basic/TokenizedVaultAdapterWithdrawAction.d.ts +20 -0
- package/esm/src/actions/basic/TokenizedVaultAdapterWithdrawAction.js +33 -0
- package/esm/src/actions/basic/index.d.ts +4 -0
- package/esm/src/actions/basic/index.js +4 -0
- package/esm/src/addresses.d.ts +3 -0
- package/esm/src/addresses.js +3 -0
- package/esm/src/index.d.ts +12 -0
- package/esm/src/utils/basic-utils.d.ts +6 -0
- package/esm/src/utils/basic-utils.js +7 -0
- package/esm/src/utils/index.d.ts +2 -1
- package/esm/src/utils/index.js +2 -1
- package/package.json +1 -1
- package/src/actions/basic/TokenizedVaultAdapterDepositAction.ts +38 -0
- package/src/actions/basic/TokenizedVaultAdapterMintAction.ts +38 -0
- package/src/actions/basic/TokenizedVaultAdapterRedeemAction.ts +36 -0
- package/src/actions/basic/TokenizedVaultAdapterWithdrawAction.ts +36 -0
- package/src/actions/basic/index.ts +4 -0
- package/src/addresses.ts +3 -1
- package/src/utils/basic-utils.ts +6 -0
- package/src/utils/index.ts +2 -0
- package/umd/index.js +607 -397
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint256, EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* TokenizedVaultAdapterDepositAction - Action that handles ERC4626 vault deposits
|
|
5
|
+
* @category BasicActions
|
|
6
|
+
*/
|
|
7
|
+
export declare class TokenizedVaultAdapterDepositAction extends Action {
|
|
8
|
+
underlyingAssetAddress: EthAddress;
|
|
9
|
+
/**
|
|
10
|
+
* @param amount Amount of underlying asset to deposit
|
|
11
|
+
* @param minOut Min amount of shares to accept
|
|
12
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
13
|
+
* @param from Address from which to pull the underlying asset
|
|
14
|
+
* @param to Asset that will receive the minted shares
|
|
15
|
+
* @param underlyingAssetAddress Address of the underlying vault asset, only used in sdk for approvals
|
|
16
|
+
*/
|
|
17
|
+
constructor(amount: uint256, minOut: uint256, vaultAddress: EthAddress, from: EthAddress, to: EthAddress, underlyingAssetAddress: EthAddress);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
asset: string;
|
|
20
|
+
owner: any;
|
|
21
|
+
}[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Action } from '../../Action';
|
|
11
|
+
import { getAddr } from '../../addresses';
|
|
12
|
+
import { TokenizedVaultOperationId } from '../../utils/basic-utils';
|
|
13
|
+
/**
|
|
14
|
+
* TokenizedVaultAdapterDepositAction - Action that handles ERC4626 vault deposits
|
|
15
|
+
* @category BasicActions
|
|
16
|
+
*/
|
|
17
|
+
export class TokenizedVaultAdapterDepositAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param amount Amount of underlying asset to deposit
|
|
20
|
+
* @param minOut Min amount of shares to accept
|
|
21
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
22
|
+
* @param from Address from which to pull the underlying asset
|
|
23
|
+
* @param to Asset that will receive the minted shares
|
|
24
|
+
* @param underlyingAssetAddress Address of the underlying vault asset, only used in sdk for approvals
|
|
25
|
+
*/
|
|
26
|
+
constructor(amount, minOut, vaultAddress, from, to, underlyingAssetAddress) {
|
|
27
|
+
super('TokenizedVaultAdapter', getAddr('TokenizedVaultAdapter'), ['uint256', 'uint256', 'address', 'address', 'address', 'uint8'], [amount, minOut, vaultAddress, from, to, TokenizedVaultOperationId.DEPOSIT]);
|
|
28
|
+
this.underlyingAssetAddress = underlyingAssetAddress;
|
|
29
|
+
}
|
|
30
|
+
getAssetsToApprove() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return [{ asset: this.underlyingAssetAddress, owner: this.args[3] }];
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint256, EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* TokenizedVaultAdapterMintAction - Action that handles ERC4626 vault minting
|
|
5
|
+
* @category BasicActions
|
|
6
|
+
*/
|
|
7
|
+
export declare class TokenizedVaultAdapterMintAction extends Action {
|
|
8
|
+
underlyingAssetAddress: EthAddress;
|
|
9
|
+
/**
|
|
10
|
+
* @param amount Amount of shares to mint
|
|
11
|
+
* @param maxIn Max amount of underlying asset to deposit for minting
|
|
12
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
13
|
+
* @param from Address from which to pull the underlying asset
|
|
14
|
+
* @param to Asset that will receive the shares minted
|
|
15
|
+
* @param underlyingAssetAddress Address of the underlying vault asset, only used in sdk for approvals
|
|
16
|
+
*/
|
|
17
|
+
constructor(amount: uint256, maxIn: uint256, vaultAddress: EthAddress, from: EthAddress, to: EthAddress, underlyingAssetAddress: EthAddress);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
asset: string;
|
|
20
|
+
owner: any;
|
|
21
|
+
}[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Action } from '../../Action';
|
|
11
|
+
import { getAddr } from '../../addresses';
|
|
12
|
+
import { TokenizedVaultOperationId } from '../../utils/basic-utils';
|
|
13
|
+
/**
|
|
14
|
+
* TokenizedVaultAdapterMintAction - Action that handles ERC4626 vault minting
|
|
15
|
+
* @category BasicActions
|
|
16
|
+
*/
|
|
17
|
+
export class TokenizedVaultAdapterMintAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param amount Amount of shares to mint
|
|
20
|
+
* @param maxIn Max amount of underlying asset to deposit for minting
|
|
21
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
22
|
+
* @param from Address from which to pull the underlying asset
|
|
23
|
+
* @param to Asset that will receive the shares minted
|
|
24
|
+
* @param underlyingAssetAddress Address of the underlying vault asset, only used in sdk for approvals
|
|
25
|
+
*/
|
|
26
|
+
constructor(amount, maxIn, vaultAddress, from, to, underlyingAssetAddress) {
|
|
27
|
+
super('TokenizedVaultAdapter', getAddr('TokenizedVaultAdapter'), ['uint256', 'uint256', 'address', 'address', 'address', 'uint8'], [amount, maxIn, vaultAddress, from, to, TokenizedVaultOperationId.MINT]);
|
|
28
|
+
this.underlyingAssetAddress = underlyingAssetAddress;
|
|
29
|
+
}
|
|
30
|
+
getAssetsToApprove() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return [{ asset: this.underlyingAssetAddress, owner: this.args[3] }];
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint256, EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* TokenizedVaultAdapterRedeemAction - Action that handles ERC4626 vault redemptions
|
|
5
|
+
* @category BasicActions
|
|
6
|
+
*/
|
|
7
|
+
export declare class TokenizedVaultAdapterRedeemAction extends Action {
|
|
8
|
+
/**
|
|
9
|
+
* @param amount Amount of shares to redeem
|
|
10
|
+
* @param minOut Min amount of underlying asset to accept for the shares burned
|
|
11
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
12
|
+
* @param from Address from which to pull the shares
|
|
13
|
+
* @param to Asset that will receive the underlying asset
|
|
14
|
+
*/
|
|
15
|
+
constructor(amount: uint256, minOut: uint256, vaultAddress: EthAddress, from: EthAddress, to: EthAddress);
|
|
16
|
+
getAssetsToApprove(): Promise<{
|
|
17
|
+
asset: any;
|
|
18
|
+
owner: any;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Action } from '../../Action';
|
|
11
|
+
import { getAddr } from '../../addresses';
|
|
12
|
+
import { TokenizedVaultOperationId } from '../../utils/basic-utils';
|
|
13
|
+
/**
|
|
14
|
+
* TokenizedVaultAdapterRedeemAction - Action that handles ERC4626 vault redemptions
|
|
15
|
+
* @category BasicActions
|
|
16
|
+
*/
|
|
17
|
+
export class TokenizedVaultAdapterRedeemAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param amount Amount of shares to redeem
|
|
20
|
+
* @param minOut Min amount of underlying asset to accept for the shares burned
|
|
21
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
22
|
+
* @param from Address from which to pull the shares
|
|
23
|
+
* @param to Asset that will receive the underlying asset
|
|
24
|
+
*/
|
|
25
|
+
constructor(amount, minOut, vaultAddress, from, to) {
|
|
26
|
+
super('TokenizedVaultAdapter', getAddr('TokenizedVaultAdapter'), ['uint256', 'uint256', 'address', 'address', 'address', 'uint8'], [amount, minOut, vaultAddress, from, to, TokenizedVaultOperationId.REDEEM]);
|
|
27
|
+
}
|
|
28
|
+
getAssetsToApprove() {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return [{ asset: this.args[2], owner: this.args[3] }];
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { uint256, EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* TokenizedVaultAdapterWithdrawAction - Action that handles ERC4626 vault withdrawals
|
|
5
|
+
* @category BasicActions
|
|
6
|
+
*/
|
|
7
|
+
export declare class TokenizedVaultAdapterWithdrawAction extends Action {
|
|
8
|
+
/**
|
|
9
|
+
* @param amount Amount of underlying asset to withdraw
|
|
10
|
+
* @param maxIn Max amount of shares to burn for withdrawal
|
|
11
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
12
|
+
* @param from Address from which to pull the shares
|
|
13
|
+
* @param to Asset that will receive the underlying asset
|
|
14
|
+
*/
|
|
15
|
+
constructor(amount: uint256, maxIn: uint256, vaultAddress: EthAddress, from: EthAddress, to: EthAddress);
|
|
16
|
+
getAssetsToApprove(): Promise<{
|
|
17
|
+
asset: any;
|
|
18
|
+
owner: any;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Action } from '../../Action';
|
|
11
|
+
import { getAddr } from '../../addresses';
|
|
12
|
+
import { TokenizedVaultOperationId } from '../../utils/basic-utils';
|
|
13
|
+
/**
|
|
14
|
+
* TokenizedVaultAdapterWithdrawAction - Action that handles ERC4626 vault withdrawals
|
|
15
|
+
* @category BasicActions
|
|
16
|
+
*/
|
|
17
|
+
export class TokenizedVaultAdapterWithdrawAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param amount Amount of underlying asset to withdraw
|
|
20
|
+
* @param maxIn Max amount of shares to burn for withdrawal
|
|
21
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
22
|
+
* @param from Address from which to pull the shares
|
|
23
|
+
* @param to Asset that will receive the underlying asset
|
|
24
|
+
*/
|
|
25
|
+
constructor(amount, maxIn, vaultAddress, from, to) {
|
|
26
|
+
super('TokenizedVaultAdapter', getAddr('TokenizedVaultAdapter'), ['uint256', 'uint256', 'address', 'address', 'address', 'uint8'], [amount, maxIn, vaultAddress, from, to, TokenizedVaultOperationId.WITHDRAW]);
|
|
27
|
+
}
|
|
28
|
+
getAssetsToApprove() {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
return [{ asset: this.args[2], owner: this.args[3] }];
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -18,3 +18,7 @@ export * from './SendTokensAction';
|
|
|
18
18
|
export * from './CreateSubAction';
|
|
19
19
|
export * from './SDaiWrapAction';
|
|
20
20
|
export * from './SDaiUnwrapAction';
|
|
21
|
+
export * from './TokenizedVaultAdapterDepositAction';
|
|
22
|
+
export * from './TokenizedVaultAdapterMintAction';
|
|
23
|
+
export * from './TokenizedVaultAdapterRedeemAction';
|
|
24
|
+
export * from './TokenizedVaultAdapterWithdrawAction';
|
|
@@ -18,3 +18,7 @@ export * from './SendTokensAction';
|
|
|
18
18
|
export * from './CreateSubAction';
|
|
19
19
|
export * from './SDaiWrapAction';
|
|
20
20
|
export * from './SDaiUnwrapAction';
|
|
21
|
+
export * from './TokenizedVaultAdapterDepositAction';
|
|
22
|
+
export * from './TokenizedVaultAdapterMintAction';
|
|
23
|
+
export * from './TokenizedVaultAdapterRedeemAction';
|
|
24
|
+
export * from './TokenizedVaultAdapterWithdrawAction';
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const actionAddresses: {
|
|
|
17
17
|
CreateSub: string;
|
|
18
18
|
SDaiWrap: string;
|
|
19
19
|
SDaiUnwrap: string;
|
|
20
|
+
TokenizedVaultAdapter: string;
|
|
20
21
|
DFSSell: string;
|
|
21
22
|
McdGenerate: string;
|
|
22
23
|
McdGive: string;
|
|
@@ -178,6 +179,7 @@ export declare const actionAddresses: {
|
|
|
178
179
|
SendTokenAndUnwrap: string;
|
|
179
180
|
ToggleSub: string;
|
|
180
181
|
TokenBalance: string;
|
|
182
|
+
TokenizedVaultAdapter: string;
|
|
181
183
|
AaveV3ATokenPayback: string;
|
|
182
184
|
AaveV3Borrow: string;
|
|
183
185
|
AaveV3CollateralSwitch: string;
|
|
@@ -347,6 +349,7 @@ export declare const actionAddresses: {
|
|
|
347
349
|
SendTokenAndUnwrap: string;
|
|
348
350
|
ToggleSub: string;
|
|
349
351
|
TokenBalance: string;
|
|
352
|
+
TokenizedVaultAdapter: string;
|
|
350
353
|
AaveV3ATokenPayback: string;
|
|
351
354
|
AaveV3Borrow: string;
|
|
352
355
|
AaveV3CollateralSwitch: string;
|
package/esm/src/addresses.js
CHANGED
|
@@ -18,6 +18,7 @@ export const actionAddresses = {
|
|
|
18
18
|
CreateSub: '0x7308e88BB21B934478E75bB6A2143b8cfDFf2961',
|
|
19
19
|
SDaiWrap: '0xac7Ac294F29d818D26Bd9DF86d36904B1Ed346Ae',
|
|
20
20
|
SDaiUnwrap: '0xe8Cb536BB96075241c4bd8f1831A8577562F2B32',
|
|
21
|
+
TokenizedVaultAdapter: '0x3944364Ce3a273D269707484F3a676fCa17E08b8',
|
|
21
22
|
// exchange
|
|
22
23
|
DFSSell: '0x951D7B421f45FF0e4A8ddE0288aE3f9C2C69b784',
|
|
23
24
|
// maker
|
|
@@ -206,6 +207,7 @@ export const actionAddresses = {
|
|
|
206
207
|
SendTokenAndUnwrap: '0x8000174366066923D554cb466e190258A6FF3b1f',
|
|
207
208
|
ToggleSub: '0x988C5C24AE6348404196267e19962f36961CAc29',
|
|
208
209
|
TokenBalance: '0xC6FF5b01f7c7b35b6e093fF70D2332B361C5Be5A',
|
|
210
|
+
TokenizedVaultAdapter: '0xdf31669FEd440f5BfF658ca0bBF0D22B8abdeb73',
|
|
209
211
|
// aave v3
|
|
210
212
|
AaveV3ATokenPayback: '0x71B27114D1777298bD46c3770C42F9f807C49847',
|
|
211
213
|
AaveV3Borrow: '0x8CaDc8A911D19B9e4D36c9bAdE47d970f362BcEa',
|
|
@@ -241,6 +243,7 @@ export const actionAddresses = {
|
|
|
241
243
|
SendTokenAndUnwrap: '0x0fb867A5Ee1CA9426D3dAb95e613Be166218b977',
|
|
242
244
|
ToggleSub: '0x71015226EADFd4aC887fB56556F64338e352439b',
|
|
243
245
|
TokenBalance: '0x483B903E702F60698Dd8124558C6199922737f1F',
|
|
246
|
+
TokenizedVaultAdapter: '0xD05C512bDFf6D3eAc5328807B3bC075F35271167',
|
|
244
247
|
// aave v3
|
|
245
248
|
AaveV3ATokenPayback: '0x261906e5E0D0D38D9cBb5c10dB9c4031aabdf8C1',
|
|
246
249
|
AaveV3Borrow: '0x5786809DA660dB613994460F096F19fcd19eD4c9',
|
package/esm/src/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ declare const actionAddressesAllChains: {
|
|
|
28
28
|
CreateSub: string;
|
|
29
29
|
SDaiWrap: string;
|
|
30
30
|
SDaiUnwrap: string;
|
|
31
|
+
TokenizedVaultAdapter: string;
|
|
31
32
|
DFSSell: string;
|
|
32
33
|
McdGenerate: string;
|
|
33
34
|
McdGive: string;
|
|
@@ -189,6 +190,7 @@ declare const actionAddressesAllChains: {
|
|
|
189
190
|
SendTokenAndUnwrap: string;
|
|
190
191
|
ToggleSub: string;
|
|
191
192
|
TokenBalance: string;
|
|
193
|
+
TokenizedVaultAdapter: string;
|
|
192
194
|
AaveV3ATokenPayback: string;
|
|
193
195
|
AaveV3Borrow: string;
|
|
194
196
|
AaveV3CollateralSwitch: string;
|
|
@@ -358,6 +360,7 @@ declare const actionAddressesAllChains: {
|
|
|
358
360
|
SendTokenAndUnwrap: string;
|
|
359
361
|
ToggleSub: string;
|
|
360
362
|
TokenBalance: string;
|
|
363
|
+
TokenizedVaultAdapter: string;
|
|
361
364
|
AaveV3ATokenPayback: string;
|
|
362
365
|
AaveV3Borrow: string;
|
|
363
366
|
AaveV3CollateralSwitch: string;
|
|
@@ -537,6 +540,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
537
540
|
CreateSub: string;
|
|
538
541
|
SDaiWrap: string;
|
|
539
542
|
SDaiUnwrap: string;
|
|
543
|
+
TokenizedVaultAdapter: string;
|
|
540
544
|
DFSSell: string;
|
|
541
545
|
McdGenerate: string;
|
|
542
546
|
McdGive: string;
|
|
@@ -698,6 +702,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
698
702
|
SendTokenAndUnwrap: string;
|
|
699
703
|
ToggleSub: string;
|
|
700
704
|
TokenBalance: string;
|
|
705
|
+
TokenizedVaultAdapter: string;
|
|
701
706
|
AaveV3ATokenPayback: string;
|
|
702
707
|
AaveV3Borrow: string;
|
|
703
708
|
AaveV3CollateralSwitch: string;
|
|
@@ -867,6 +872,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
867
872
|
SendTokenAndUnwrap: string;
|
|
868
873
|
ToggleSub: string;
|
|
869
874
|
TokenBalance: string;
|
|
875
|
+
TokenizedVaultAdapter: string;
|
|
870
876
|
AaveV3ATokenPayback: string;
|
|
871
877
|
AaveV3Borrow: string;
|
|
872
878
|
AaveV3CollateralSwitch: string;
|
|
@@ -1147,6 +1153,7 @@ declare const _default: {
|
|
|
1147
1153
|
CreateSub: string;
|
|
1148
1154
|
SDaiWrap: string;
|
|
1149
1155
|
SDaiUnwrap: string;
|
|
1156
|
+
TokenizedVaultAdapter: string;
|
|
1150
1157
|
DFSSell: string;
|
|
1151
1158
|
McdGenerate: string;
|
|
1152
1159
|
McdGive: string;
|
|
@@ -1308,6 +1315,7 @@ declare const _default: {
|
|
|
1308
1315
|
SendTokenAndUnwrap: string;
|
|
1309
1316
|
ToggleSub: string;
|
|
1310
1317
|
TokenBalance: string;
|
|
1318
|
+
TokenizedVaultAdapter: string;
|
|
1311
1319
|
AaveV3ATokenPayback: string;
|
|
1312
1320
|
AaveV3Borrow: string;
|
|
1313
1321
|
AaveV3CollateralSwitch: string;
|
|
@@ -1477,6 +1485,7 @@ declare const _default: {
|
|
|
1477
1485
|
SendTokenAndUnwrap: string;
|
|
1478
1486
|
ToggleSub: string;
|
|
1479
1487
|
TokenBalance: string;
|
|
1488
|
+
TokenizedVaultAdapter: string;
|
|
1480
1489
|
AaveV3ATokenPayback: string;
|
|
1481
1490
|
AaveV3Borrow: string;
|
|
1482
1491
|
AaveV3CollateralSwitch: string;
|
|
@@ -1656,6 +1665,7 @@ declare const _default: {
|
|
|
1656
1665
|
CreateSub: string;
|
|
1657
1666
|
SDaiWrap: string;
|
|
1658
1667
|
SDaiUnwrap: string;
|
|
1668
|
+
TokenizedVaultAdapter: string;
|
|
1659
1669
|
DFSSell: string;
|
|
1660
1670
|
McdGenerate: string;
|
|
1661
1671
|
McdGive: string;
|
|
@@ -1817,6 +1827,7 @@ declare const _default: {
|
|
|
1817
1827
|
SendTokenAndUnwrap: string;
|
|
1818
1828
|
ToggleSub: string;
|
|
1819
1829
|
TokenBalance: string;
|
|
1830
|
+
TokenizedVaultAdapter: string;
|
|
1820
1831
|
AaveV3ATokenPayback: string;
|
|
1821
1832
|
AaveV3Borrow: string;
|
|
1822
1833
|
AaveV3CollateralSwitch: string;
|
|
@@ -1986,6 +1997,7 @@ declare const _default: {
|
|
|
1986
1997
|
SendTokenAndUnwrap: string;
|
|
1987
1998
|
ToggleSub: string;
|
|
1988
1999
|
TokenBalance: string;
|
|
2000
|
+
TokenizedVaultAdapter: string;
|
|
1989
2001
|
AaveV3ATokenPayback: string;
|
|
1990
2002
|
AaveV3Borrow: string;
|
|
1991
2003
|
AaveV3CollateralSwitch: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var TokenizedVaultOperationId;
|
|
2
|
+
(function (TokenizedVaultOperationId) {
|
|
3
|
+
TokenizedVaultOperationId[TokenizedVaultOperationId["DEPOSIT"] = 0] = "DEPOSIT";
|
|
4
|
+
TokenizedVaultOperationId[TokenizedVaultOperationId["MINT"] = 1] = "MINT";
|
|
5
|
+
TokenizedVaultOperationId[TokenizedVaultOperationId["WITHDRAW"] = 2] = "WITHDRAW";
|
|
6
|
+
TokenizedVaultOperationId[TokenizedVaultOperationId["REDEEM"] = 3] = "REDEEM";
|
|
7
|
+
})(TokenizedVaultOperationId || (TokenizedVaultOperationId = {}));
|
package/esm/src/utils/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ import * as convexUtils from './convex-utils';
|
|
|
5
5
|
import mstableAssetPairs from './mstableAssetPairs';
|
|
6
6
|
import * as curveUtils from './curve-utils';
|
|
7
7
|
import * as curveusdUtils from './curveusd-utils';
|
|
8
|
-
|
|
8
|
+
import * as basicUtils from './basic-utils';
|
|
9
|
+
export { zeroExExchange, uniswapLP, uniswapV3LP, mstableAssetPairs, convexUtils, curveUtils, curveusdUtils, basicUtils, };
|
package/esm/src/utils/index.js
CHANGED
|
@@ -5,4 +5,5 @@ import * as convexUtils from './convex-utils';
|
|
|
5
5
|
import mstableAssetPairs from './mstableAssetPairs';
|
|
6
6
|
import * as curveUtils from './curve-utils';
|
|
7
7
|
import * as curveusdUtils from './curveusd-utils';
|
|
8
|
-
|
|
8
|
+
import * as basicUtils from './basic-utils';
|
|
9
|
+
export { zeroExExchange, uniswapLP, uniswapV3LP, mstableAssetPairs, convexUtils, curveUtils, curveusdUtils, basicUtils, };
|
package/package.json
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint256, EthAddress } from '../../types';
|
|
4
|
+
import { TokenizedVaultOperationId } from '../../utils/basic-utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TokenizedVaultAdapterDepositAction - Action that handles ERC4626 vault deposits
|
|
8
|
+
* @category BasicActions
|
|
9
|
+
*/
|
|
10
|
+
export class TokenizedVaultAdapterDepositAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param amount Amount of underlying asset to deposit
|
|
13
|
+
* @param minOut Min amount of shares to accept
|
|
14
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
15
|
+
* @param from Address from which to pull the underlying asset
|
|
16
|
+
* @param to Asset that will receive the minted shares
|
|
17
|
+
* @param underlyingAssetAddress Address of the underlying vault asset, only used in sdk for approvals
|
|
18
|
+
*/
|
|
19
|
+
constructor(
|
|
20
|
+
amount: uint256,
|
|
21
|
+
minOut: uint256,
|
|
22
|
+
vaultAddress: EthAddress,
|
|
23
|
+
from: EthAddress,
|
|
24
|
+
to: EthAddress,
|
|
25
|
+
public underlyingAssetAddress: EthAddress,
|
|
26
|
+
) {
|
|
27
|
+
super(
|
|
28
|
+
'TokenizedVaultAdapter',
|
|
29
|
+
getAddr('TokenizedVaultAdapter'),
|
|
30
|
+
['uint256', 'uint256', 'address', 'address', 'address', 'uint8'],
|
|
31
|
+
[amount, minOut, vaultAddress, from, to, TokenizedVaultOperationId.DEPOSIT],
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getAssetsToApprove() {
|
|
36
|
+
return [{ asset: this.underlyingAssetAddress, owner: this.args[3] }];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint256, EthAddress } from '../../types';
|
|
4
|
+
import { TokenizedVaultOperationId } from '../../utils/basic-utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TokenizedVaultAdapterMintAction - Action that handles ERC4626 vault minting
|
|
8
|
+
* @category BasicActions
|
|
9
|
+
*/
|
|
10
|
+
export class TokenizedVaultAdapterMintAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param amount Amount of shares to mint
|
|
13
|
+
* @param maxIn Max amount of underlying asset to deposit for minting
|
|
14
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
15
|
+
* @param from Address from which to pull the underlying asset
|
|
16
|
+
* @param to Asset that will receive the shares minted
|
|
17
|
+
* @param underlyingAssetAddress Address of the underlying vault asset, only used in sdk for approvals
|
|
18
|
+
*/
|
|
19
|
+
constructor(
|
|
20
|
+
amount: uint256,
|
|
21
|
+
maxIn: uint256,
|
|
22
|
+
vaultAddress: EthAddress,
|
|
23
|
+
from: EthAddress,
|
|
24
|
+
to: EthAddress,
|
|
25
|
+
public underlyingAssetAddress: EthAddress,
|
|
26
|
+
) {
|
|
27
|
+
super(
|
|
28
|
+
'TokenizedVaultAdapter',
|
|
29
|
+
getAddr('TokenizedVaultAdapter'),
|
|
30
|
+
['uint256', 'uint256', 'address', 'address', 'address', 'uint8'],
|
|
31
|
+
[amount, maxIn, vaultAddress, from, to, TokenizedVaultOperationId.MINT],
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getAssetsToApprove() {
|
|
36
|
+
return [{ asset: this.underlyingAssetAddress, owner: this.args[3] }];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint256, EthAddress } from '../../types';
|
|
4
|
+
import { TokenizedVaultOperationId } from '../../utils/basic-utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TokenizedVaultAdapterRedeemAction - Action that handles ERC4626 vault redemptions
|
|
8
|
+
* @category BasicActions
|
|
9
|
+
*/
|
|
10
|
+
export class TokenizedVaultAdapterRedeemAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param amount Amount of shares to redeem
|
|
13
|
+
* @param minOut Min amount of underlying asset to accept for the shares burned
|
|
14
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
15
|
+
* @param from Address from which to pull the shares
|
|
16
|
+
* @param to Asset that will receive the underlying asset
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
amount: uint256,
|
|
20
|
+
minOut: uint256,
|
|
21
|
+
vaultAddress: EthAddress,
|
|
22
|
+
from: EthAddress,
|
|
23
|
+
to: EthAddress,
|
|
24
|
+
) {
|
|
25
|
+
super(
|
|
26
|
+
'TokenizedVaultAdapter',
|
|
27
|
+
getAddr('TokenizedVaultAdapter'),
|
|
28
|
+
['uint256', 'uint256', 'address', 'address', 'address', 'uint8'],
|
|
29
|
+
[amount, minOut, vaultAddress, from, to, TokenizedVaultOperationId.REDEEM],
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async getAssetsToApprove() {
|
|
34
|
+
return [{ asset: this.args[2], owner: this.args[3] }];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { uint256, EthAddress } from '../../types';
|
|
4
|
+
import { TokenizedVaultOperationId } from '../../utils/basic-utils';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TokenizedVaultAdapterWithdrawAction - Action that handles ERC4626 vault withdrawals
|
|
8
|
+
* @category BasicActions
|
|
9
|
+
*/
|
|
10
|
+
export class TokenizedVaultAdapterWithdrawAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param amount Amount of underlying asset to withdraw
|
|
13
|
+
* @param maxIn Max amount of shares to burn for withdrawal
|
|
14
|
+
* @param vaultAddress Address of the ERC4626 vault
|
|
15
|
+
* @param from Address from which to pull the shares
|
|
16
|
+
* @param to Asset that will receive the underlying asset
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
amount: uint256,
|
|
20
|
+
maxIn: uint256,
|
|
21
|
+
vaultAddress: EthAddress,
|
|
22
|
+
from: EthAddress,
|
|
23
|
+
to: EthAddress,
|
|
24
|
+
) {
|
|
25
|
+
super(
|
|
26
|
+
'TokenizedVaultAdapter',
|
|
27
|
+
getAddr('TokenizedVaultAdapter'),
|
|
28
|
+
['uint256', 'uint256', 'address', 'address', 'address', 'uint8'],
|
|
29
|
+
[amount, maxIn, vaultAddress, from, to, TokenizedVaultOperationId.WITHDRAW],
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async getAssetsToApprove() {
|
|
34
|
+
return [{ asset: this.args[2], owner: this.args[3] }];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -18,3 +18,7 @@ export * from './SendTokensAction';
|
|
|
18
18
|
export * from './CreateSubAction';
|
|
19
19
|
export * from './SDaiWrapAction';
|
|
20
20
|
export * from './SDaiUnwrapAction';
|
|
21
|
+
export * from './TokenizedVaultAdapterDepositAction';
|
|
22
|
+
export * from './TokenizedVaultAdapterMintAction';
|
|
23
|
+
export * from './TokenizedVaultAdapterRedeemAction';
|
|
24
|
+
export * from './TokenizedVaultAdapterWithdrawAction';
|
package/src/addresses.ts
CHANGED
|
@@ -20,6 +20,7 @@ export const actionAddresses = {
|
|
|
20
20
|
CreateSub: '0x7308e88BB21B934478E75bB6A2143b8cfDFf2961',
|
|
21
21
|
SDaiWrap: '0xac7Ac294F29d818D26Bd9DF86d36904B1Ed346Ae',
|
|
22
22
|
SDaiUnwrap: '0xe8Cb536BB96075241c4bd8f1831A8577562F2B32',
|
|
23
|
+
TokenizedVaultAdapter: '0x3944364Ce3a273D269707484F3a676fCa17E08b8',
|
|
23
24
|
|
|
24
25
|
// exchange
|
|
25
26
|
DFSSell: '0x951D7B421f45FF0e4A8ddE0288aE3f9C2C69b784',
|
|
@@ -242,7 +243,7 @@ export const actionAddresses = {
|
|
|
242
243
|
SendTokenAndUnwrap: '0x8000174366066923D554cb466e190258A6FF3b1f',
|
|
243
244
|
ToggleSub: '0x988C5C24AE6348404196267e19962f36961CAc29',
|
|
244
245
|
TokenBalance: '0xC6FF5b01f7c7b35b6e093fF70D2332B361C5Be5A',
|
|
245
|
-
|
|
246
|
+
TokenizedVaultAdapter: '0xdf31669FEd440f5BfF658ca0bBF0D22B8abdeb73',
|
|
246
247
|
|
|
247
248
|
// aave v3
|
|
248
249
|
AaveV3ATokenPayback: '0x71B27114D1777298bD46c3770C42F9f807C49847',
|
|
@@ -284,6 +285,7 @@ export const actionAddresses = {
|
|
|
284
285
|
SendTokenAndUnwrap: '0x0fb867A5Ee1CA9426D3dAb95e613Be166218b977',
|
|
285
286
|
ToggleSub: '0x71015226EADFd4aC887fB56556F64338e352439b',
|
|
286
287
|
TokenBalance: '0x483B903E702F60698Dd8124558C6199922737f1F',
|
|
288
|
+
TokenizedVaultAdapter: '0xD05C512bDFf6D3eAc5328807B3bC075F35271167',
|
|
287
289
|
|
|
288
290
|
// aave v3
|
|
289
291
|
AaveV3ATokenPayback: '0x261906e5E0D0D38D9cBb5c10dB9c4031aabdf8C1',
|
package/src/utils/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as convexUtils from './convex-utils';
|
|
|
5
5
|
import mstableAssetPairs from './mstableAssetPairs';
|
|
6
6
|
import * as curveUtils from './curve-utils';
|
|
7
7
|
import * as curveusdUtils from './curveusd-utils';
|
|
8
|
+
import * as basicUtils from './basic-utils';
|
|
8
9
|
|
|
9
10
|
export {
|
|
10
11
|
zeroExExchange,
|
|
@@ -14,4 +15,5 @@ export {
|
|
|
14
15
|
convexUtils,
|
|
15
16
|
curveUtils,
|
|
16
17
|
curveusdUtils,
|
|
18
|
+
basicUtils,
|
|
17
19
|
};
|