impermax-sdk 2.1.26 → 2.1.27
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ethers, BigNumber } from "ethers";
|
|
2
|
-
import { Contract, Permits } from "../onchainTypes";
|
|
2
|
+
import { Contract, Permit, Permits } from "../onchainTypes";
|
|
3
3
|
import OnchainInteractions from './index';
|
|
4
4
|
import OnchainPoolToken from '../onchainPoolToken';
|
|
5
5
|
import OnchainAccountPoolToken from '../account/onchainAccountPoolToken';
|
|
@@ -21,6 +21,7 @@ export default abstract class OnchainInteractionsPoolToken {
|
|
|
21
21
|
getPoolTokenAllowance(): Promise<ethers.BigNumber>;
|
|
22
22
|
getUnderlyingAllowance(): Promise<ethers.BigNumber>;
|
|
23
23
|
approvePoolToken(amount: BigNumber, onTransactionHash: Function): Promise<any>;
|
|
24
|
+
permitPoolToken(amount: BigNumber, callBack: (permit: Permit | null) => void): Promise<void>;
|
|
24
25
|
approveUnderlying(amount: BigNumber, onTransactionHash: Function): Promise<any>;
|
|
25
26
|
protected getSendData(permits: Permits): Promise<{
|
|
26
27
|
router: any;
|
|
@@ -79,6 +79,13 @@ class OnchainInteractionsPoolToken {
|
|
|
79
79
|
return this.send(poolToken.methods.approve(spender, amount), onTransactionHash);
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
+
permitPoolToken(amount, callBack) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const { owner, spender } = this.getOwnerSpender();
|
|
85
|
+
const poolToken = yield this.poolToken.getPoolToken();
|
|
86
|
+
this.getPermitHelper().getTokenPermit(poolToken, owner, spender, amount, callBack);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
82
89
|
approveUnderlying(amount, onTransactionHash) {
|
|
83
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
91
|
const { spender } = this.getOwnerSpender();
|