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 ¶ added in v0.29.0
Types ¶
type BunkerClient ¶ added in v0.28.4
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 ¶ added in v0.28.4
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 ¶ added in v0.28.4
func (bunker *BunkerClient) GetPublicKey(ctx context.Context) (string, error)
func (*BunkerClient) NIP04Decrypt ¶ added in v0.36.3
func (*BunkerClient) NIP04Encrypt ¶ added in v0.36.3
func (*BunkerClient) NIP44Decrypt ¶ added in v0.36.0
func (*BunkerClient) NIP44Encrypt ¶ added in v0.36.0
func (*BunkerClient) Ping ¶ added in v0.28.4
func (bunker *BunkerClient) Ping(ctx context.Context) error
type DynamicSigner ¶ added in v0.28.0
func NewDynamicSigner ¶ added in v0.28.0
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 ¶ added in v0.28.0
func (p *DynamicSigner) GetSession(clientPubkey string) (Session, bool)
func (*DynamicSigner) HandleRequest ¶ added in v0.28.0
type RelayReadWrite ¶ added in v0.28.0
type Request ¶
type Response ¶
type StaticKeySigner ¶ added in v0.28.0
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 ¶ added in v0.28.0
func NewStaticKeySigner(secretKey string) StaticKeySigner
func (*StaticKeySigner) GetSession ¶ added in v0.28.0
func (p *StaticKeySigner) GetSession(clientPubkey string) (Session, bool)
func (*StaticKeySigner) HandleRequest ¶ added in v0.28.0
Click to show internal directories.
Click to hide internal directories.