mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
34 lines
619 B
TypeScript
34 lines
619 B
TypeScript
import type { Feature } from './types';
|
|
|
|
import { getEnvValue } from '../utils';
|
|
|
|
function getApiUrl(): string | undefined {
|
|
try {
|
|
const envValue = getEnvValue('NEXT_PUBLIC_SAFE_TX_SERVICE_URL');
|
|
return new URL('/api/v1/safes', envValue).toString();
|
|
} catch (error) {
|
|
return;
|
|
}
|
|
}
|
|
|
|
const title = 'Safe address tags';
|
|
|
|
const config: Feature<{ apiUrl: string }> = (() => {
|
|
const apiUrl = getApiUrl();
|
|
|
|
if (apiUrl) {
|
|
return Object.freeze({
|
|
title,
|
|
isEnabled: true,
|
|
apiUrl,
|
|
});
|
|
}
|
|
|
|
return Object.freeze({
|
|
title,
|
|
isEnabled: false,
|
|
});
|
|
})();
|
|
|
|
export default config;
|