@dripfi/drip-sdk 1.2.15 → 1.2.17

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 CHANGED
@@ -67,6 +67,7 @@ export default class DripSdk {
67
67
  getDripTokenContractAddress(): string;
68
68
  getSwapPerqForBeansInfo(): Promise<PerqToBeansSwapInfo>;
69
69
  transferErc20Token(tokenAddress: string, amount: string, receiver: string): Promise<string>;
70
+ wrapEther(amount: string, tokenAddress: string): Promise<string>;
70
71
  getVestingStart(): Promise<string>;
71
72
  getVestingEnd(): Promise<string>;
72
73
  getVestedAmount(beneficiary: string): Promise<string>;
package/dist/DripSdk.js CHANGED
@@ -24,6 +24,7 @@ const DripSwapAndRecyclerContract_1 = __importDefault(require("./contracts/DripS
24
24
  const PerqVestingContract_1 = __importDefault(require("./contracts/PerqVestingContract"));
25
25
  const utils_1 = require("ethers/lib/utils");
26
26
  const AuthenticationStatus_1 = require("./types/AuthenticationStatus");
27
+ const WethTokenAbi_json_1 = __importDefault(require("./contracts/abi/WethTokenAbi.json"));
27
28
  class DripSdk {
28
29
  constructor(chain, signer, dripRoute) {
29
30
  this.signer = signer;
@@ -537,6 +538,19 @@ class DripSdk {
537
538
  return receipt.transactionHash;
538
539
  });
539
540
  }
541
+ wrapEther(amount, tokenAddress) {
542
+ return __awaiter(this, void 0, void 0, function* () {
543
+ if (!this.signer) {
544
+ throw Error('No signer provided');
545
+ }
546
+ const wethContract = new ethers_1.ethers.Contract(tokenAddress, WethTokenAbi_json_1.default, this.signer);
547
+ const decimals = yield wethContract.decimals();
548
+ const amountWithDecimals = ethers_1.ethers.utils.parseUnits(amount, decimals);
549
+ const depositTx = yield wethContract.deposit({ value: amountWithDecimals });
550
+ const receipt = yield depositTx.wait();
551
+ return receipt.transactionHash;
552
+ });
553
+ }
540
554
  getVestingStart() {
541
555
  return __awaiter(this, void 0, void 0, function* () {
542
556
  try {
@@ -0,0 +1 @@
1
+ [{ "constant": true, "inputs": [], "name": "name", "outputs": [{ "name": "", "type": "string" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "guy", "type": "address" }, { "name": "wad", "type": "uint256" }], "name": "approve", "outputs": [{ "name": "", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "src", "type": "address" }, { "name": "dst", "type": "address" }, { "name": "wad", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "name": "", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [{ "name": "wad", "type": "uint256" }], "name": "withdraw", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "decimals", "outputs": [{ "name": "", "type": "uint8" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "address" }], "name": "balanceOf", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "symbol", "outputs": [{ "name": "", "type": "string" }], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [{ "name": "dst", "type": "address" }, { "name": "wad", "type": "uint256" }], "name": "transfer", "outputs": [{ "name": "", "type": "bool" }], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "deposit", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": true, "inputs": [{ "name": "", "type": "address" }, { "name": "", "type": "address" }], "name": "allowance", "outputs": [{ "name": "", "type": "uint256" }], "payable": false, "stateMutability": "view", "type": "function" }, { "payable": true, "stateMutability": "payable", "type": "fallback" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "src", "type": "address" }, { "indexed": true, "name": "guy", "type": "address" }, { "indexed": false, "name": "wad", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "src", "type": "address" }, { "indexed": true, "name": "dst", "type": "address" }, { "indexed": false, "name": "wad", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "dst", "type": "address" }, { "indexed": false, "name": "wad", "type": "uint256" }], "name": "Deposit", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "name": "src", "type": "address" }, { "indexed": false, "name": "wad", "type": "uint256" }], "name": "Withdrawal", "type": "event" }]
@@ -34,5 +34,6 @@ export type Vault = {
34
34
  avgTvl: string;
35
35
  peakTvl: string;
36
36
  amountOfDepositors: number;
37
+ boostedTvl: number;
37
38
  projectVAPY?: number;
38
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dripfi/drip-sdk",
3
- "version": "1.2.15",
3
+ "version": "1.2.17",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",