@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/DripApi.d.ts +4 -12
- package/dist/DripApi.js +29 -87
- package/dist/DripConfig.d.ts +1 -0
- package/dist/DripConfig.js +6 -2
- package/dist/DripSdk.d.ts +8 -14
- package/dist/DripSdk.js +77 -136
- package/dist/contracts/DripSwapAndRecyclerContract.d.ts +7 -0
- package/dist/contracts/DripSwapAndRecyclerContract.js +40 -0
- package/dist/contracts/abi/DripSwapAndRecyclerAbi.json +516 -0
- package/dist/index.d.ts +2 -3
- package/dist/test.js +12 -42
- package/dist/types/BeanEntry.d.ts +12 -0
- package/dist/utils.d.ts +0 -2
- package/dist/utils.js +0 -47
- package/package.json +1 -1
- package/dist/types/DeployedMetaVault.d.ts +0 -6
- package/dist/types/MetaVault.d.ts +0 -17
- package/dist/types/MetaVault.js +0 -2
- package/dist/types/UserMetaVaultBalance.d.ts +0 -6
- package/dist/types/UserMetaVaultBalance.js +0 -2
- /package/dist/types/{DeployedMetaVault.js → BeanEntry.js} +0 -0
package/dist/utils.d.ts
CHANGED
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,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 {};
|
package/dist/types/MetaVault.js
DELETED
File without changes
|