@defisaver/sdk 1.2.20 → 1.2.21
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/fluid/FluidVaultT1OpenAction.d.ts +7 -1
- package/esm/src/actions/fluid/FluidVaultT1OpenAction.js +21 -1
- package/esm/src/actions/fluid/FluidVaultT1PaybackAction.d.ts +7 -1
- package/esm/src/actions/fluid/FluidVaultT1PaybackAction.js +21 -1
- package/esm/src/actions/fluid/FluidVaultT1SupplyAction.d.ts +7 -1
- package/esm/src/actions/fluid/FluidVaultT1SupplyAction.js +21 -1
- package/package.json +1 -1
- package/src/actions/fluid/FluidVaultT1OpenAction.ts +12 -0
- package/src/actions/fluid/FluidVaultT1PaybackAction.ts +12 -0
- package/src/actions/fluid/FluidVaultT1SupplyAction.ts +12 -0
- package/umd/index.js +81 -15
- package/yarn-error.log +3976 -0
|
@@ -6,6 +6,7 @@ import { EthAddress, uint256 } from '../../types';
|
|
|
6
6
|
* @category Fluid
|
|
7
7
|
*/
|
|
8
8
|
export declare class FluidVaultT1OpenAction extends Action {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
9
10
|
/**
|
|
10
11
|
* @param vault The address of the Fluid Vault T1
|
|
11
12
|
* @param collAmount Amount of collateral to deposit.
|
|
@@ -13,6 +14,11 @@ export declare class FluidVaultT1OpenAction extends Action {
|
|
|
13
14
|
* @param from Address to pull the collateral from.
|
|
14
15
|
* @param to Address to send the borrowed assets to.
|
|
15
16
|
* @param wrapBorrowedEth Whether to wrap the borrowed ETH into WETH if the borrowed asset is ETH.
|
|
17
|
+
* @param collToken Address of the collateral token.
|
|
16
18
|
*/
|
|
17
|
-
constructor(vault: EthAddress, collAmount: uint256, debtAmount: uint256, from: EthAddress, to: EthAddress, wrapBorrowedEth: boolean);
|
|
19
|
+
constructor(vault: EthAddress, collAmount: uint256, debtAmount: uint256, from: EthAddress, to: EthAddress, wrapBorrowedEth: boolean, collToken: EthAddress);
|
|
20
|
+
getAssetsToApprove(): Promise<{
|
|
21
|
+
asset: string;
|
|
22
|
+
owner: any;
|
|
23
|
+
}[]>;
|
|
18
24
|
}
|
|
@@ -1,3 +1,13 @@
|
|
|
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 { getAssetInfoByAddress } from '@defisaver/tokens';
|
|
1
11
|
import { Action } from '../../Action';
|
|
2
12
|
import { getAddr } from '../../addresses';
|
|
3
13
|
/**
|
|
@@ -13,8 +23,9 @@ export class FluidVaultT1OpenAction extends Action {
|
|
|
13
23
|
* @param from Address to pull the collateral from.
|
|
14
24
|
* @param to Address to send the borrowed assets to.
|
|
15
25
|
* @param wrapBorrowedEth Whether to wrap the borrowed ETH into WETH if the borrowed asset is ETH.
|
|
26
|
+
* @param collToken Address of the collateral token.
|
|
16
27
|
*/
|
|
17
|
-
constructor(vault, collAmount, debtAmount, from, to, wrapBorrowedEth) {
|
|
28
|
+
constructor(vault, collAmount, debtAmount, from, to, wrapBorrowedEth, collToken) {
|
|
18
29
|
super('FluidVaultT1Open', getAddr('FluidVaultT1Open'), ['address', 'uint256', 'uint256', 'address', 'address', 'bool'], [vault, collAmount, debtAmount, from, to, wrapBorrowedEth]);
|
|
19
30
|
this.mappableArgs = [
|
|
20
31
|
this.args[0],
|
|
@@ -24,5 +35,14 @@ export class FluidVaultT1OpenAction extends Action {
|
|
|
24
35
|
this.args[4],
|
|
25
36
|
this.args[5],
|
|
26
37
|
];
|
|
38
|
+
this.tokenForApproval = collToken;
|
|
39
|
+
}
|
|
40
|
+
getAssetsToApprove() {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
43
|
+
if (asset.symbol !== 'ETH')
|
|
44
|
+
return [{ asset: this.tokenForApproval, owner: this.args[3] }];
|
|
45
|
+
return [];
|
|
46
|
+
});
|
|
27
47
|
}
|
|
28
48
|
}
|
|
@@ -6,11 +6,17 @@ import { EthAddress, uint256 } from '../../types';
|
|
|
6
6
|
* @category Fluid
|
|
7
7
|
*/
|
|
8
8
|
export declare class FluidVaultT1PaybackAction extends Action {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
9
10
|
/**
|
|
10
11
|
* @param vault The address of the Fluid Vault T1
|
|
11
12
|
* @param nftId ID of the NFT representing the position
|
|
12
13
|
* @param amount Amount to payback
|
|
13
14
|
* @param from Address to pull the tokens from
|
|
15
|
+
* @param debtToken Address of the debt token
|
|
14
16
|
*/
|
|
15
|
-
constructor(vault: EthAddress, nftId: uint256, amount: uint256, from: EthAddress);
|
|
17
|
+
constructor(vault: EthAddress, nftId: uint256, amount: uint256, from: EthAddress, debtToken: EthAddress);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
asset: string;
|
|
20
|
+
owner: any;
|
|
21
|
+
}[]>;
|
|
16
22
|
}
|
|
@@ -1,3 +1,13 @@
|
|
|
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 { getAssetInfoByAddress } from '@defisaver/tokens';
|
|
1
11
|
import { Action } from '../../Action';
|
|
2
12
|
import { getAddr } from '../../addresses';
|
|
3
13
|
/**
|
|
@@ -11,8 +21,9 @@ export class FluidVaultT1PaybackAction extends Action {
|
|
|
11
21
|
* @param nftId ID of the NFT representing the position
|
|
12
22
|
* @param amount Amount to payback
|
|
13
23
|
* @param from Address to pull the tokens from
|
|
24
|
+
* @param debtToken Address of the debt token
|
|
14
25
|
*/
|
|
15
|
-
constructor(vault, nftId, amount, from) {
|
|
26
|
+
constructor(vault, nftId, amount, from, debtToken) {
|
|
16
27
|
super('FluidVaultT1Payback', getAddr('FluidVaultT1Payback'), ['address', 'uint256', 'uint256', 'address'], [vault, nftId, amount, from]);
|
|
17
28
|
this.mappableArgs = [
|
|
18
29
|
this.args[0],
|
|
@@ -20,5 +31,14 @@ export class FluidVaultT1PaybackAction extends Action {
|
|
|
20
31
|
this.args[2],
|
|
21
32
|
this.args[3],
|
|
22
33
|
];
|
|
34
|
+
this.tokenForApproval = debtToken;
|
|
35
|
+
}
|
|
36
|
+
getAssetsToApprove() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
39
|
+
if (asset.symbol !== 'ETH')
|
|
40
|
+
return [{ asset: this.tokenForApproval, owner: this.args[3] }];
|
|
41
|
+
return [];
|
|
42
|
+
});
|
|
23
43
|
}
|
|
24
44
|
}
|
|
@@ -6,11 +6,17 @@ import { EthAddress, uint256 } from '../../types';
|
|
|
6
6
|
* @category Fluid
|
|
7
7
|
*/
|
|
8
8
|
export declare class FluidVaultT1SupplyAction extends Action {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
9
10
|
/**
|
|
10
11
|
* @param vault The address of the Fluid Vault T1
|
|
11
12
|
* @param nftId ID of the NFT representing the position
|
|
12
13
|
* @param amount Amount to supply
|
|
13
14
|
* @param from Address to pull the tokens from
|
|
15
|
+
* @param collToken Address of the collateral token
|
|
14
16
|
*/
|
|
15
|
-
constructor(vault: EthAddress, nftId: uint256, amount: uint256, from: EthAddress);
|
|
17
|
+
constructor(vault: EthAddress, nftId: uint256, amount: uint256, from: EthAddress, collToken: EthAddress);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
asset: string;
|
|
20
|
+
owner: any;
|
|
21
|
+
}[]>;
|
|
16
22
|
}
|
|
@@ -1,3 +1,13 @@
|
|
|
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 { getAssetInfoByAddress } from '@defisaver/tokens';
|
|
1
11
|
import { Action } from '../../Action';
|
|
2
12
|
import { getAddr } from '../../addresses';
|
|
3
13
|
/**
|
|
@@ -11,8 +21,9 @@ export class FluidVaultT1SupplyAction extends Action {
|
|
|
11
21
|
* @param nftId ID of the NFT representing the position
|
|
12
22
|
* @param amount Amount to supply
|
|
13
23
|
* @param from Address to pull the tokens from
|
|
24
|
+
* @param collToken Address of the collateral token
|
|
14
25
|
*/
|
|
15
|
-
constructor(vault, nftId, amount, from) {
|
|
26
|
+
constructor(vault, nftId, amount, from, collToken) {
|
|
16
27
|
super('FluidVaultT1Supply', getAddr('FluidVaultT1Supply'), ['address', 'uint256', 'uint256', 'address'], [vault, nftId, amount, from]);
|
|
17
28
|
this.mappableArgs = [
|
|
18
29
|
this.args[0],
|
|
@@ -20,5 +31,14 @@ export class FluidVaultT1SupplyAction extends Action {
|
|
|
20
31
|
this.args[2],
|
|
21
32
|
this.args[3],
|
|
22
33
|
];
|
|
34
|
+
this.tokenForApproval = collToken;
|
|
35
|
+
}
|
|
36
|
+
getAssetsToApprove() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
39
|
+
if (asset.symbol !== 'ETH')
|
|
40
|
+
return [{ asset: this.tokenForApproval, owner: this.args[3] }];
|
|
41
|
+
return [];
|
|
42
|
+
});
|
|
23
43
|
}
|
|
24
44
|
}
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAssetInfoByAddress } from '@defisaver/tokens';
|
|
1
2
|
import { Action } from '../../Action';
|
|
2
3
|
import { getAddr } from '../../addresses';
|
|
3
4
|
import { EthAddress, uint256 } from '../../types';
|
|
@@ -8,6 +9,8 @@ import { EthAddress, uint256 } from '../../types';
|
|
|
8
9
|
* @category Fluid
|
|
9
10
|
*/
|
|
10
11
|
export class FluidVaultT1OpenAction extends Action {
|
|
12
|
+
tokenForApproval: EthAddress;
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* @param vault The address of the Fluid Vault T1
|
|
13
16
|
* @param collAmount Amount of collateral to deposit.
|
|
@@ -15,6 +18,7 @@ export class FluidVaultT1OpenAction extends Action {
|
|
|
15
18
|
* @param from Address to pull the collateral from.
|
|
16
19
|
* @param to Address to send the borrowed assets to.
|
|
17
20
|
* @param wrapBorrowedEth Whether to wrap the borrowed ETH into WETH if the borrowed asset is ETH.
|
|
21
|
+
* @param collToken Address of the collateral token.
|
|
18
22
|
*/
|
|
19
23
|
constructor(
|
|
20
24
|
vault: EthAddress,
|
|
@@ -23,6 +27,7 @@ export class FluidVaultT1OpenAction extends Action {
|
|
|
23
27
|
from: EthAddress,
|
|
24
28
|
to: EthAddress,
|
|
25
29
|
wrapBorrowedEth: boolean,
|
|
30
|
+
collToken: EthAddress,
|
|
26
31
|
) {
|
|
27
32
|
super(
|
|
28
33
|
'FluidVaultT1Open',
|
|
@@ -39,5 +44,12 @@ export class FluidVaultT1OpenAction extends Action {
|
|
|
39
44
|
this.args[4],
|
|
40
45
|
this.args[5],
|
|
41
46
|
];
|
|
47
|
+
this.tokenForApproval = collToken;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async getAssetsToApprove() {
|
|
51
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
52
|
+
if (asset.symbol !== 'ETH') return [{ asset: this.tokenForApproval, owner: this.args[3] }];
|
|
53
|
+
return [];
|
|
42
54
|
}
|
|
43
55
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAssetInfoByAddress } from '@defisaver/tokens';
|
|
1
2
|
import { Action } from '../../Action';
|
|
2
3
|
import { getAddr } from '../../addresses';
|
|
3
4
|
import { EthAddress, uint256 } from '../../types';
|
|
@@ -8,17 +9,21 @@ import { EthAddress, uint256 } from '../../types';
|
|
|
8
9
|
* @category Fluid
|
|
9
10
|
*/
|
|
10
11
|
export class FluidVaultT1PaybackAction extends Action {
|
|
12
|
+
tokenForApproval: EthAddress;
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* @param vault The address of the Fluid Vault T1
|
|
13
16
|
* @param nftId ID of the NFT representing the position
|
|
14
17
|
* @param amount Amount to payback
|
|
15
18
|
* @param from Address to pull the tokens from
|
|
19
|
+
* @param debtToken Address of the debt token
|
|
16
20
|
*/
|
|
17
21
|
constructor(
|
|
18
22
|
vault: EthAddress,
|
|
19
23
|
nftId: uint256,
|
|
20
24
|
amount: uint256,
|
|
21
25
|
from: EthAddress,
|
|
26
|
+
debtToken: EthAddress,
|
|
22
27
|
) {
|
|
23
28
|
super(
|
|
24
29
|
'FluidVaultT1Payback',
|
|
@@ -33,5 +38,12 @@ export class FluidVaultT1PaybackAction extends Action {
|
|
|
33
38
|
this.args[2],
|
|
34
39
|
this.args[3],
|
|
35
40
|
];
|
|
41
|
+
this.tokenForApproval = debtToken;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async getAssetsToApprove() {
|
|
45
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
46
|
+
if (asset.symbol !== 'ETH') return [{ asset: this.tokenForApproval, owner: this.args[3] }];
|
|
47
|
+
return [];
|
|
36
48
|
}
|
|
37
49
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAssetInfoByAddress } from '@defisaver/tokens';
|
|
1
2
|
import { Action } from '../../Action';
|
|
2
3
|
import { getAddr } from '../../addresses';
|
|
3
4
|
import { EthAddress, uint256 } from '../../types';
|
|
@@ -8,17 +9,21 @@ import { EthAddress, uint256 } from '../../types';
|
|
|
8
9
|
* @category Fluid
|
|
9
10
|
*/
|
|
10
11
|
export class FluidVaultT1SupplyAction extends Action {
|
|
12
|
+
tokenForApproval: EthAddress;
|
|
13
|
+
|
|
11
14
|
/**
|
|
12
15
|
* @param vault The address of the Fluid Vault T1
|
|
13
16
|
* @param nftId ID of the NFT representing the position
|
|
14
17
|
* @param amount Amount to supply
|
|
15
18
|
* @param from Address to pull the tokens from
|
|
19
|
+
* @param collToken Address of the collateral token
|
|
16
20
|
*/
|
|
17
21
|
constructor(
|
|
18
22
|
vault: EthAddress,
|
|
19
23
|
nftId: uint256,
|
|
20
24
|
amount: uint256,
|
|
21
25
|
from: EthAddress,
|
|
26
|
+
collToken: EthAddress,
|
|
22
27
|
) {
|
|
23
28
|
super(
|
|
24
29
|
'FluidVaultT1Supply',
|
|
@@ -33,5 +38,12 @@ export class FluidVaultT1SupplyAction extends Action {
|
|
|
33
38
|
this.args[2],
|
|
34
39
|
this.args[3],
|
|
35
40
|
];
|
|
41
|
+
this.tokenForApproval = collToken;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async getAssetsToApprove() {
|
|
45
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
46
|
+
if (asset.symbol !== 'ETH') return [{ asset: this.tokenForApproval, owner: this.args[3] }];
|
|
47
|
+
return [];
|
|
36
48
|
}
|
|
37
49
|
}
|
package/umd/index.js
CHANGED
|
@@ -14874,8 +14874,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14874
14874
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14875
14875
|
/* harmony export */ FluidVaultT1OpenAction: () => (/* binding */ FluidVaultT1OpenAction)
|
|
14876
14876
|
/* harmony export */ });
|
|
14877
|
-
/* harmony import */ var
|
|
14878
|
-
/* harmony import */ var
|
|
14877
|
+
/* harmony import */ var _defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
|
14878
|
+
/* harmony import */ var _defisaver_tokens__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__);
|
|
14879
|
+
/* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
14880
|
+
/* harmony import */ var _addresses__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
|
|
14881
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
14882
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
14883
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14884
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14885
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14886
|
+
|
|
14879
14887
|
|
|
14880
14888
|
|
|
14881
14889
|
/**
|
|
@@ -14883,7 +14891,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14883
14891
|
*
|
|
14884
14892
|
* @category Fluid
|
|
14885
14893
|
*/
|
|
14886
|
-
class FluidVaultT1OpenAction extends
|
|
14894
|
+
class FluidVaultT1OpenAction extends _Action__WEBPACK_IMPORTED_MODULE_1__.Action {
|
|
14887
14895
|
/**
|
|
14888
14896
|
* @param vault The address of the Fluid Vault T1
|
|
14889
14897
|
* @param collAmount Amount of collateral to deposit.
|
|
@@ -14891,10 +14899,24 @@ class FluidVaultT1OpenAction extends _Action__WEBPACK_IMPORTED_MODULE_0__.Action
|
|
|
14891
14899
|
* @param from Address to pull the collateral from.
|
|
14892
14900
|
* @param to Address to send the borrowed assets to.
|
|
14893
14901
|
* @param wrapBorrowedEth Whether to wrap the borrowed ETH into WETH if the borrowed asset is ETH.
|
|
14902
|
+
* @param collToken Address of the collateral token.
|
|
14894
14903
|
*/
|
|
14895
|
-
constructor(vault, collAmount, debtAmount, from, to, wrapBorrowedEth) {
|
|
14896
|
-
super('FluidVaultT1Open', (0,
|
|
14904
|
+
constructor(vault, collAmount, debtAmount, from, to, wrapBorrowedEth, collToken) {
|
|
14905
|
+
super('FluidVaultT1Open', (0,_addresses__WEBPACK_IMPORTED_MODULE_2__.getAddr)('FluidVaultT1Open'), ['address', 'uint256', 'uint256', 'address', 'address', 'bool'], [vault, collAmount, debtAmount, from, to, wrapBorrowedEth]);
|
|
14906
|
+
_defineProperty(this, "tokenForApproval", void 0);
|
|
14897
14907
|
this.mappableArgs = [this.args[0], this.args[1], this.args[2], this.args[3], this.args[4], this.args[5]];
|
|
14908
|
+
this.tokenForApproval = collToken;
|
|
14909
|
+
}
|
|
14910
|
+
getAssetsToApprove() {
|
|
14911
|
+
var _this = this;
|
|
14912
|
+
return _asyncToGenerator(function* () {
|
|
14913
|
+
var asset = (0,_defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__.getAssetInfoByAddress)(_this.tokenForApproval);
|
|
14914
|
+
if (asset.symbol !== 'ETH') return [{
|
|
14915
|
+
asset: _this.tokenForApproval,
|
|
14916
|
+
owner: _this.args[3]
|
|
14917
|
+
}];
|
|
14918
|
+
return [];
|
|
14919
|
+
})();
|
|
14898
14920
|
}
|
|
14899
14921
|
}
|
|
14900
14922
|
|
|
@@ -14972,8 +14994,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14972
14994
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14973
14995
|
/* harmony export */ FluidVaultT1PaybackAction: () => (/* binding */ FluidVaultT1PaybackAction)
|
|
14974
14996
|
/* harmony export */ });
|
|
14975
|
-
/* harmony import */ var
|
|
14976
|
-
/* harmony import */ var
|
|
14997
|
+
/* harmony import */ var _defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
|
14998
|
+
/* harmony import */ var _defisaver_tokens__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__);
|
|
14999
|
+
/* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
15000
|
+
/* harmony import */ var _addresses__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
|
|
15001
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15002
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
15003
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15004
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15005
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15006
|
+
|
|
14977
15007
|
|
|
14978
15008
|
|
|
14979
15009
|
/**
|
|
@@ -14981,16 +15011,30 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14981
15011
|
*
|
|
14982
15012
|
* @category Fluid
|
|
14983
15013
|
*/
|
|
14984
|
-
class FluidVaultT1PaybackAction extends
|
|
15014
|
+
class FluidVaultT1PaybackAction extends _Action__WEBPACK_IMPORTED_MODULE_1__.Action {
|
|
14985
15015
|
/**
|
|
14986
15016
|
* @param vault The address of the Fluid Vault T1
|
|
14987
15017
|
* @param nftId ID of the NFT representing the position
|
|
14988
15018
|
* @param amount Amount to payback
|
|
14989
15019
|
* @param from Address to pull the tokens from
|
|
15020
|
+
* @param debtToken Address of the debt token
|
|
14990
15021
|
*/
|
|
14991
|
-
constructor(vault, nftId, amount, from) {
|
|
14992
|
-
super('FluidVaultT1Payback', (0,
|
|
15022
|
+
constructor(vault, nftId, amount, from, debtToken) {
|
|
15023
|
+
super('FluidVaultT1Payback', (0,_addresses__WEBPACK_IMPORTED_MODULE_2__.getAddr)('FluidVaultT1Payback'), ['address', 'uint256', 'uint256', 'address'], [vault, nftId, amount, from]);
|
|
15024
|
+
_defineProperty(this, "tokenForApproval", void 0);
|
|
14993
15025
|
this.mappableArgs = [this.args[0], this.args[1], this.args[2], this.args[3]];
|
|
15026
|
+
this.tokenForApproval = debtToken;
|
|
15027
|
+
}
|
|
15028
|
+
getAssetsToApprove() {
|
|
15029
|
+
var _this = this;
|
|
15030
|
+
return _asyncToGenerator(function* () {
|
|
15031
|
+
var asset = (0,_defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__.getAssetInfoByAddress)(_this.tokenForApproval);
|
|
15032
|
+
if (asset.symbol !== 'ETH') return [{
|
|
15033
|
+
asset: _this.tokenForApproval,
|
|
15034
|
+
owner: _this.args[3]
|
|
15035
|
+
}];
|
|
15036
|
+
return [];
|
|
15037
|
+
})();
|
|
14994
15038
|
}
|
|
14995
15039
|
}
|
|
14996
15040
|
|
|
@@ -15002,8 +15046,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15002
15046
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15003
15047
|
/* harmony export */ FluidVaultT1SupplyAction: () => (/* binding */ FluidVaultT1SupplyAction)
|
|
15004
15048
|
/* harmony export */ });
|
|
15005
|
-
/* harmony import */ var
|
|
15006
|
-
/* harmony import */ var
|
|
15049
|
+
/* harmony import */ var _defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
|
15050
|
+
/* harmony import */ var _defisaver_tokens__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__);
|
|
15051
|
+
/* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
15052
|
+
/* harmony import */ var _addresses__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
|
|
15053
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15054
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
15055
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15056
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15057
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15058
|
+
|
|
15007
15059
|
|
|
15008
15060
|
|
|
15009
15061
|
/**
|
|
@@ -15011,16 +15063,30 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15011
15063
|
*
|
|
15012
15064
|
* @category Fluid
|
|
15013
15065
|
*/
|
|
15014
|
-
class FluidVaultT1SupplyAction extends
|
|
15066
|
+
class FluidVaultT1SupplyAction extends _Action__WEBPACK_IMPORTED_MODULE_1__.Action {
|
|
15015
15067
|
/**
|
|
15016
15068
|
* @param vault The address of the Fluid Vault T1
|
|
15017
15069
|
* @param nftId ID of the NFT representing the position
|
|
15018
15070
|
* @param amount Amount to supply
|
|
15019
15071
|
* @param from Address to pull the tokens from
|
|
15072
|
+
* @param collToken Address of the collateral token
|
|
15020
15073
|
*/
|
|
15021
|
-
constructor(vault, nftId, amount, from) {
|
|
15022
|
-
super('FluidVaultT1Supply', (0,
|
|
15074
|
+
constructor(vault, nftId, amount, from, collToken) {
|
|
15075
|
+
super('FluidVaultT1Supply', (0,_addresses__WEBPACK_IMPORTED_MODULE_2__.getAddr)('FluidVaultT1Supply'), ['address', 'uint256', 'uint256', 'address'], [vault, nftId, amount, from]);
|
|
15076
|
+
_defineProperty(this, "tokenForApproval", void 0);
|
|
15023
15077
|
this.mappableArgs = [this.args[0], this.args[1], this.args[2], this.args[3]];
|
|
15078
|
+
this.tokenForApproval = collToken;
|
|
15079
|
+
}
|
|
15080
|
+
getAssetsToApprove() {
|
|
15081
|
+
var _this = this;
|
|
15082
|
+
return _asyncToGenerator(function* () {
|
|
15083
|
+
var asset = (0,_defisaver_tokens__WEBPACK_IMPORTED_MODULE_0__.getAssetInfoByAddress)(_this.tokenForApproval);
|
|
15084
|
+
if (asset.symbol !== 'ETH') return [{
|
|
15085
|
+
asset: _this.tokenForApproval,
|
|
15086
|
+
owner: _this.args[3]
|
|
15087
|
+
}];
|
|
15088
|
+
return [];
|
|
15089
|
+
})();
|
|
15024
15090
|
}
|
|
15025
15091
|
}
|
|
15026
15092
|
|