@dripfi/drip-sdk 1.2.6 → 1.2.7
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/dist/DripSdk.d.ts +1 -0
- package/dist/DripSdk.js +12 -0
- package/package.json +1 -1
package/dist/DripSdk.d.ts
CHANGED
@@ -64,6 +64,7 @@ export default class DripSdk {
|
|
64
64
|
approveTokenForDeposit(tokenAddress: string, amount: string): Promise<string>;
|
65
65
|
getDripTokenContractAddress(): string;
|
66
66
|
getSwapPerqForBeansInfo(): Promise<PerqToBeansSwapInfo>;
|
67
|
+
transferErc20Token(tokenAddress: string, amount: string, receiver: string): Promise<string>;
|
67
68
|
private generateRedeemBagStruct;
|
68
69
|
private getERC20Precission;
|
69
70
|
private calculatePendingDeposits;
|
package/dist/DripSdk.js
CHANGED
@@ -524,6 +524,18 @@ class DripSdk {
|
|
524
524
|
return this.dripApi.getSwapPerqForBeansInfo();
|
525
525
|
});
|
526
526
|
}
|
527
|
+
transferErc20Token(tokenAddress, amount, receiver) {
|
528
|
+
return __awaiter(this, void 0, void 0, function* () {
|
529
|
+
if (!this.signer) {
|
530
|
+
throw Error('No signer provided');
|
531
|
+
}
|
532
|
+
const decimals = yield this.getERC20Precission(tokenAddress);
|
533
|
+
const erc20Instance = spool_v2_sdk_1.ERC20__factory.connect(tokenAddress, this.signer);
|
534
|
+
const approveTx = yield erc20Instance.transfer(receiver, ethers_1.ethers.utils.parseUnits(amount, decimals));
|
535
|
+
const receipt = yield approveTx.wait();
|
536
|
+
return receipt.transactionHash;
|
537
|
+
});
|
538
|
+
}
|
527
539
|
generateRedeemBagStruct(vault, signerAddress, amountToWithdraw) {
|
528
540
|
return __awaiter(this, void 0, void 0, function* () {
|
529
541
|
if (!this.spoolSdk) {
|