feat: close relays

This commit is contained in:
2024-09-11 21:41:37 +01:00
parent 623e5f68a0
commit 4c80fb78ec
10 changed files with 182 additions and 16 deletions

View File

@ -160,3 +160,13 @@ export const MaxAboutLength = 1000;
* Snort backend publishes rates
*/
export const SnortPubkey = "npub1sn0rtcjcf543gj4wsg7fa59s700d5ztys5ctj0g69g2x6802npjqhjjtws";
/**
* List of relay monitor relays
*/
export const MonitorRelays = [
"wss://relaypag.es",
"wss://relay.nostr.watch",
"wss://history.nostr.watch",
"wss://monitorlizard.nostr1.com",
];

View File

@ -530,6 +530,22 @@ export function getCountry() {
};
}
export function calculateDistance(lat1: number, lon1: number, lat2: number, lon2: number): number {
const R = 6371000; // Radius of the Earth in meters
const dLat = toRadians(lat2 - lat1);
const dLon = toRadians(lon2 - lon1);
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(toRadians(lat1)) * Math.cos(toRadians(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return R * c;
}
function toRadians(degrees: number): number {
return degrees * (Math.PI / 180);
}
export function trackEvent(
event: string,
props?: Record<string, string | boolean>,