Documentation
¶
Index ¶
- func IsValidBunkerURL(input string) bool
- type BunkerClient
- func (bunker *BunkerClient) GetPublicKey(ctx context.Context) (string, error)
- func (bunker *BunkerClient) NIP04Decrypt(ctx context.Context, targetPublicKey string, ciphertext string) (string, error)
- func (bunker *BunkerClient) NIP04Encrypt(ctx context.Context, targetPublicKey string, plaintext string) (string, error)
- func (bunker *BunkerClient) NIP44Decrypt(ctx context.Context, targetPublicKey string, ciphertext string) (string, error)
- func (bunker *BunkerClient) NIP44Encrypt(ctx context.Context, targetPublicKey string, plaintext string) (string, error)
- func (bunker *BunkerClient) Ping(ctx context.Context) error
- func (bunker *BunkerClient) RPC(ctx context.Context, method string, params []string) (string, error)
- func (bunker *BunkerClient) SignEvent(ctx context.Context, evt *nostr.Event) error
- type DynamicSigner
- type RelayReadWrite
- type Request
- type Response
- type Session
- type Signer
- type StaticKeySigner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidBunkerURL ¶
Types ¶
type BunkerClient ¶
type BunkerClient struct { // SkipSignatureCheck can be set if you don't want to double-check incoming signatures SkipSignatureCheck bool // contains filtered or unexported fields }
func ConnectBunker ¶
func ConnectBunker( ctx context.Context, clientSecretKey string, bunkerURLOrNIP05 string, pool *nostr.SimplePool, onAuth func(string), ) (*BunkerClient, error)
ConnectBunker establishes an RPC connection to a NIP-46 signer using the relays and secret provided in the bunkerURL. pool can be passed to reuse an existing pool, otherwise a new pool will be created.
func (*BunkerClient) GetPublicKey ¶
func (bunker *BunkerClient) GetPublicKey(ctx context.Context) (string, error)
func (*BunkerClient) NIP04Decrypt ¶
func (*BunkerClient) NIP04Encrypt ¶
func (*BunkerClient) NIP44Decrypt ¶
func (*BunkerClient) NIP44Encrypt ¶
type DynamicSigner ¶
func NewDynamicSigner ¶
func NewDynamicSigner( getHandlerSecretKey func(handlerPubkey string) (string, error), getUserKeyer func(handlerPubkey string) (nostr.Keyer, error), authorizeSigning func(event nostr.Event, from string, secret string) bool, authorizeEncryption func(from string, secret string) bool, onEventSigned func(event nostr.Event), getRelays func(pubkey string) map[string]RelayReadWrite, ) DynamicSigner
func (*DynamicSigner) GetSession ¶
func (p *DynamicSigner) GetSession(clientPubkey string) (Session, bool)
func (*DynamicSigner) HandleRequest ¶
type RelayReadWrite ¶
type Request ¶
type Response ¶
type StaticKeySigner ¶
type StaticKeySigner struct { sync.Mutex RelaysToAdvertise map[string]RelayReadWrite AuthorizeRequest func(harmless bool, from string, secret string) bool // contains filtered or unexported fields }
func NewStaticKeySigner ¶
func NewStaticKeySigner(secretKey string) StaticKeySigner
func (*StaticKeySigner) GetSession ¶
func (p *StaticKeySigner) GetSession(clientPubkey string) (Session, bool)
func (*StaticKeySigner) HandleRequest ¶
Click to show internal directories.
Click to hide internal directories.