@dripfi/drip-sdk 1.2.5-dev.1 → 1.2.5

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/utils.d.ts CHANGED
@@ -1,3 +1 @@
1
1
  export declare function insertDot(numberString: string, decimals: number): string;
2
- export declare function getMonthDayUTCTimeString(dateString: string | number): string;
3
- export declare const hasPoolEnded: (date: string) => boolean;
package/dist/utils.js CHANGED
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasPoolEnded = void 0;
4
3
  exports.insertDot = insertDot;
5
- exports.getMonthDayUTCTimeString = getMonthDayUTCTimeString;
6
4
  function insertDot(numberString, decimals) {
7
5
  if (numberString.length < decimals + 1) {
8
6
  numberString = '0'.repeat(decimals + 1 - numberString.length) + numberString;
@@ -13,48 +11,3 @@ function insertDot(numberString, decimals) {
13
11
  const afterDecimal = numberString.slice(indexToInsertDot);
14
12
  return `${beforeDecimal}.${afterDecimal}`;
15
13
  }
16
- function getMonthDayUTCTimeString(dateString) {
17
- // Parse the input string into a Date object
18
- const date = new Date(typeof dateString === 'number' ? dateString * 1000 : dateString);
19
- if (isNaN(date.getTime())) {
20
- return 'Unknown Date';
21
- }
22
- // Options for formatting time (12-hour with AM/PM)
23
- const options = {
24
- month: 'long', // Full month name
25
- day: 'numeric', // Day of the month
26
- hour: 'numeric', // Hour (12-hour format)
27
- minute: '2-digit', // Minute with leading zero
28
- hour12: true, // 12-hour time format
29
- };
30
- // Format the date and time to US format using the previous options
31
- const localeTimeString = date.toLocaleString('en-US', options);
32
- // localeTimeString will look like this: May 8 at 8:00 PM
33
- // Format the date and time to US format using the previous options
34
- const [monthDay, time] = localeTimeString.split(' at ');
35
- const [month, day] = monthDay.split(' ');
36
- const dayNum = parseInt(day, 10);
37
- const daySuffix = getDaySuffix(dayNum);
38
- return `${month} ${day}${daySuffix}, ${time}`;
39
- }
40
- function getDaySuffix(day) {
41
- if (day >= 11 && day <= 13) {
42
- return 'th';
43
- }
44
- switch (day % 10) {
45
- case 1:
46
- return 'st';
47
- case 2:
48
- return 'nd';
49
- case 3:
50
- return 'rd';
51
- default:
52
- return 'th';
53
- }
54
- }
55
- const hasPoolEnded = (date) => {
56
- const endDate = new Date(date).getTime();
57
- const currentDate = new Date().getTime();
58
- return endDate <= currentDate;
59
- };
60
- exports.hasPoolEnded = hasPoolEnded;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dripfi/drip-sdk",
3
- "version": "1.2.5-dev.1",
3
+ "version": "1.2.5",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +0,0 @@
1
- export type DeployedMetaVault = {
2
- address: string;
3
- liveUntil: string;
4
- liveFrom: string;
5
- depositTokenId: string;
6
- };
@@ -1,17 +0,0 @@
1
- import { VaultDepositToken } from './VaultDepositToken';
2
- type VaultAllocation = {
3
- address: string;
4
- name: string;
5
- allocation: number;
6
- };
7
- export type MetaVault = {
8
- name: string;
9
- address: string;
10
- depositToken: VaultDepositToken;
11
- liveUntil: string;
12
- liveUntilFormatted: string;
13
- liveFrom: string;
14
- hasPoolEnded: boolean;
15
- allocations: VaultAllocation[];
16
- };
17
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- export type UserMetaVaultBalance = {
2
- userBalance: string;
3
- pendingUserBalance: string;
4
- pendingWithdrawalBalance: string;
5
- claimable: string;
6
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });