23 lines
		
	
	
		
			451 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			451 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
require "nostr"
 | 
						|
 | 
						|
class NostrManagerService < ApplicationService
 | 
						|
  def parse_tags(tags)
 | 
						|
    out = {}
 | 
						|
    tags.each do |tag|
 | 
						|
      out[tag[0].to_sym] = tag[1, tag.length]
 | 
						|
    end
 | 
						|
    out
 | 
						|
  end
 | 
						|
 | 
						|
  def site_keypair
 | 
						|
    Nostr::KeyPair.new(
 | 
						|
      private_key: Nostr::PrivateKey.new(Setting.nostr_private_key),
 | 
						|
      public_key: Nostr::PublicKey.new(Setting.nostr_public_key)
 | 
						|
    )
 | 
						|
  end
 | 
						|
 | 
						|
  def site_user
 | 
						|
    Nostr::User.new(keypair: site_keypair)
 | 
						|
  end
 | 
						|
end
 |