feat: add environment-specific relayUrl configuration in nostrZap.js

This commit is contained in:
fsociety
2024-10-02 14:26:49 +02:00
parent 1fb59bd1d6
commit e8820d7c29

View File

@@ -8,7 +8,18 @@ export default (livewireComponent) => ({
invoice: livewireComponent.entangle('invoice', true),
async zap(message, sender, amountToPay, env) {
const relayUrl = env === 'production' ? 'wss://simple-relay.steuernsindraub21.xyz' : 'wss://simple-relay.steuernsindraub21.xyz';
const config = {
production: {
relayUrl: 'wss://simple-relay.steuernsindraub21.xyz',
},
staging: {
relayUrl: 'wss://simple-test-relay.steuernsindraub21.xyz',
},
local: {
relayUrl: 'ws://simple-test-relay.steuernsindraub21.xyz',
},
};
const relayUrl = config[env]?.relayUrl || config['local'].relayUrl;
const ndk = new NDK({
explicitRelayUrls: [