@koralabs/kora-labs-common 5.1.32 → 5.1.33
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/handles/policies.d.ts +3 -4
- package/handles/policies.js +1 -1
- package/package.json +1 -1
package/handles/policies.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Network } from '../types';
|
|
2
|
-
interface PolicyIds {
|
|
2
|
+
export interface PolicyIds {
|
|
3
3
|
[key: string]: {
|
|
4
4
|
firstMintingSlot: number;
|
|
5
5
|
lastMintingSlot: number | null;
|
|
@@ -7,12 +7,11 @@ interface PolicyIds {
|
|
|
7
7
|
isDeMi?: boolean;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
interface HandlePolicies {
|
|
10
|
+
export interface HandlePolicies {
|
|
11
11
|
'preview': PolicyIds;
|
|
12
12
|
'preprod': PolicyIds;
|
|
13
13
|
'mainnet': PolicyIds;
|
|
14
|
-
getActivePolicy(network: Network, atSlot?: number): string | undefined;
|
|
14
|
+
getActivePolicy(network: Network, isDemi?: boolean, atSlot?: number): string | undefined;
|
|
15
15
|
contains(network: Network, policyId: string): boolean;
|
|
16
16
|
}
|
|
17
17
|
export declare const HANDLE_POLICIES: HandlePolicies;
|
|
18
|
-
export {};
|
package/handles/policies.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.HANDLE_POLICIES = {
|
|
|
9
9
|
},
|
|
10
10
|
'preprod': { 'f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a': { firstMintingSlot: 0, lastMintingSlot: null, sunsetSlot: null } },
|
|
11
11
|
'mainnet': { 'f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a': { firstMintingSlot: 0, lastMintingSlot: null, sunsetSlot: null } },
|
|
12
|
-
getActivePolicy(network,
|
|
12
|
+
getActivePolicy(network, isDeMi = false, atSlot) {
|
|
13
13
|
var _a;
|
|
14
14
|
const theSlot = atSlot ? atSlot : (0, utils_1.getSlotNumberFromDate)(new Date(Date.now()));
|
|
15
15
|
return (_a = Object.entries(this[network]).find(([, value]) => { var _a; return value.firstMintingSlot <= theSlot && ((_a = value.lastMintingSlot) !== null && _a !== void 0 ? _a : Number.POSITIVE_INFINITY) >= theSlot && value.isDeMi == isDeMi; })) === null || _a === void 0 ? void 0 : _a[0];
|