mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-13 05:26:47 +00:00
feat: add dynamic relay url based on environment
This commit is contained in:
@@ -7,9 +7,13 @@ export default (livewireComponent) => ({
|
||||
|
||||
invoice: livewireComponent.entangle('invoice', true),
|
||||
|
||||
async zap(message, sender, amountToPay) {
|
||||
async zap(message, sender, amountToPay, env) {
|
||||
const relayUrl = env === 'production' ? 'wss://nostr.einundzwanzig.space' : 'wss://simple-relay.steuernsindraub21.xyz';
|
||||
|
||||
const ndk = new NDK({
|
||||
explicitRelayUrls: ['wss://simple-relay.steuernsindraub21.xyz'],
|
||||
explicitRelayUrls: [
|
||||
relayUrl
|
||||
],
|
||||
enableOutboxModel: false,
|
||||
});
|
||||
// Now connect to specified relays
|
||||
@@ -27,7 +31,7 @@ export default (livewireComponent) => ({
|
||||
profile: sender,
|
||||
event: event.id,
|
||||
amount: amount,
|
||||
relays: ['wss://simple-relay.steuernsindraub21.xyz'],
|
||||
relays: [relayUrl],
|
||||
comment: message,
|
||||
});
|
||||
console.log('zapEvent', zapEvent);
|
||||
|
||||
Reference in New Issue
Block a user