Documentation
¶
Index ¶
- Variables
- func CheckNameAvailability(ctx context.Context, name, domain string) bool
- func IsValidBunkerURL(input string) bool
- type BunkerClient
- func ConnectBunker(ctx context.Context, clientSecretKey string, bunkerURLOrNIP05 string, ...) (*BunkerClient, error)
- func CreateAccount(ctx context.Context, clientSecretKey string, name string, domain string, ...) (*BunkerClient, []string, error)
- func NewBunker(ctx context.Context, clientSecretKey string, targetPublicKey string, ...) *BunkerClient
- func (bunker *BunkerClient) GetPublicKey(ctx context.Context) (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 CreateAccountOptions
- type DynamicSigner
- type RelayReadWrite
- type Request
- type Response
- type Session
- type Signer
- type StaticKeySigner
Constants ¶
This section is empty.
Variables ¶
View Source
var BUNKER_REGEX = regexp.MustCompile(`^bunker:\/\/([0-9a-f]{64})\??([?\/\w:.=&%]*)$`)
Functions ¶
func CheckNameAvailability ¶ added in v0.29.0
func IsValidBunkerURL ¶ added in v0.29.0
Types ¶
type BunkerClient ¶ added in v0.28.4
type BunkerClient struct {
// 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 CreateAccount ¶ added in v0.29.0
func CreateAccount( ctx context.Context, clientSecretKey string, name string, domain string, pool *nostr.SimplePool, extraOpts *CreateAccountOptions, onAuth func(string), ) (*BunkerClient, []string, error)
func (*BunkerClient) GetPublicKey ¶ added in v0.28.4
func (bunker *BunkerClient) GetPublicKey(ctx context.Context) (string, error)
func (*BunkerClient) Ping ¶ added in v0.28.4
func (bunker *BunkerClient) Ping(ctx context.Context) error
type CreateAccountOptions ¶ added in v0.29.0
type CreateAccountOptions struct {
Email string
}
type DynamicSigner ¶ added in v0.28.0
type DynamicSigner struct { sync.Mutex RelaysToAdvertise map[string]RelayReadWrite // contains filtered or unexported fields }
func NewDynamicSigner ¶ added in v0.28.0
func (*DynamicSigner) GetSession ¶ added in v0.28.0
func (p *DynamicSigner) GetSession(clientPubkey string) (Session, bool)
func (*DynamicSigner) HandleRequest ¶ added in v0.28.0
func (p *DynamicSigner) HandleRequest(event *nostr.Event) ( req Request, resp Response, eventResponse nostr.Event, err error, )
type RelayReadWrite ¶ added in v0.28.0
type Session ¶
type Session struct { ConversationKey []byte // nip44 }
func (Session) MakeResponse ¶
func (Session) ParseRequest ¶
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
func (p *StaticKeySigner) HandleRequest(event *nostr.Event) ( req Request, resp Response, eventResponse nostr.Event, err error, )
Click to show internal directories.
Click to hide internal directories.