# Class Nip46Broker

#### Hierarchy (View Summary)

- Emitter
  - Nip46Broker

- Defined in packages/signer/src/signers/nip46.ts:216

#####
Index

### Constructors

constructor

### Properties

params
receiver
sender
signer
defaultMaxListeners

### Methods

addListener
connect
createAccount
emit
enqueue
eventNames
getMaxListeners
getPublicKey
hasParams
listenerCount
listeners
makeNostrconnectUrl
makeReceiver
makeSender
makeSigner
nip04Decrypt
nip04Encrypt
nip44Decrypt
nip44Encrypt
off
on
once
parseBunkerUrl
ping
prependListener
prependOnceListener
rawListeners
removeAllListeners
removeListener
send
setMaxListeners
setParams
signEvent
teardown
waitForNostrconnect
get
listenerCount

##
Constructors

### constructor

- new Nip46Broker(params: Nip46BrokerParams ): Nip46Broker

- #### Parameters

  - params: Nip46BrokerParams

  #### Returns Nip46Broker

  Overrides Emitter.constructor

  - Defined in packages/signer/src/signers/nip46.ts:221

##
Properties

### params

params: Nip46BrokerParams

- Defined in packages/signer/src/signers/nip46.ts:221

### receiver

receiver: Nip46Receiver

- Defined in packages/signer/src/signers/nip46.ts:219

### sender

sender: Nip46Sender

- Defined in packages/signer/src/signers/nip46.ts:218

### signer

signer: ISigner

- Defined in packages/signer/src/signers/nip46.ts:217

### `Static` defaultMaxListeners

defaultMaxListeners: number

Inherited from Emitter.defaultMaxListeners

- Defined in node_modules/@types/events/index.d.ts:5

##
Methods

### addListener

- addListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.addListener

  - Defined in node_modules/@types/events/index.d.ts:11

### connect

- connect(
  signerPubkey: string,
  connectSecret?: string,
  perms?: string,
  ): Promise<string>

- #### Parameters

  - signerPubkey: string
  - connectSecret: string = ""
  - perms: string = ""

  #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:381

### createAccount

- createAccount(username: string, domain: string, perms?: string): Promise<string>

- #### Parameters

  - username: string
  - domain: string
  - perms: string = ""

  #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:378

### emit

- emit(type: string, ...args: any[]): boolean

- #### Parameters

  - type: string
  - ...args: any[]

  #### Returns boolean

  Inherited from Emitter.emit

  - Defined in packages/lib/build/src/Emitter.d.ts:3

### enqueue

- enqueue(method: string, params: string[]): Promise< Nip46Request >

- #### Parameters

  - method: string
  - params: string[]

  #### Returns Promise< Nip46Request >

  - Defined in packages/signer/src/signers/nip46.ts:290

### eventNames

- eventNames(): (string | number)[]

- #### Returns (string | number)[]

  Inherited from Emitter.eventNames

  - Defined in node_modules/@types/events/index.d.ts:7

### getMaxListeners

- getMaxListeners(): number

- #### Returns number

  Inherited from Emitter.getMaxListeners

  - Defined in node_modules/@types/events/index.d.ts:9

### getPublicKey

- getPublicKey(): Promise<string>

- #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:376

### hasParams

- hasParams(params: Nip46BrokerParams ): boolean

- #### Parameters

  - params: Nip46BrokerParams

  #### Returns boolean

  - Defined in packages/signer/src/signers/nip46.ts:242

### listenerCount

- listenerCount(type: string | number): number

- #### Parameters

  - type: string | number

  #### Returns number

  Inherited from Emitter.listenerCount

  - Defined in node_modules/@types/events/index.d.ts:20

### listeners

- listeners(type: string | number): Listener[]

- #### Parameters

  - type: string | number

  #### Returns Listener[]

  Inherited from Emitter.listeners

  - Defined in node_modules/@types/events/index.d.ts:19

### makeNostrconnectUrl

- makeNostrconnectUrl(meta?: Record<string, string>): Promise<string>

- #### Parameters

  - meta: Record<string, string> = {}

  #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:326

### makeReceiver

- makeReceiver(): Nip46Receiver

- #### Returns Nip46Receiver

  - Defined in packages/signer/src/signers/nip46.ts:260

### makeSender

- makeSender(): Nip46Sender

- #### Returns Nip46Sender

  - Defined in packages/signer/src/signers/nip46.ts:250

### makeSigner

- makeSigner(): Nip01Signer

- #### Returns Nip01Signer

  - Defined in packages/signer/src/signers/nip46.ts:248

### nip04Decrypt

- nip04Decrypt(pk: string, message: string): Promise<string>

- #### Parameters

  - pk: string
  - message: string

  #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:389

### nip04Encrypt

- nip04Encrypt(pk: string, message: string): Promise<string>

- #### Parameters

  - pk: string
  - message: string

  #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:387

### nip44Decrypt

- nip44Decrypt(pk: string, message: string): Promise<string>

- #### Parameters

  - pk: string
  - message: string

  #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:393

### nip44Encrypt

- nip44Encrypt(pk: string, message: string): Promise<string>

- #### Parameters

  - pk: string
  - message: string

  #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:391

### off

- off(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.off

  - Defined in node_modules/@types/events/index.d.ts:17

### on

- on(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.on

  - Defined in node_modules/@types/events/index.d.ts:12

### once

- once(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.once

  - Defined in node_modules/@types/events/index.d.ts:13

### parseBunkerUrl

- parseBunkerUrl(
  url: string,
  ): { connectSecret: string; relays: string[]; signerPubkey: string }

- #### Parameters

  - url: string

  #### Returns { connectSecret: string; relays: string[]; signerPubkey: string }

  - Defined in packages/signer/src/signers/nip46.ts:308

### ping

- ping(): Promise<string>

- #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:374

### prependListener

- prependListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.prependListener

  - Defined in node_modules/@types/events/index.d.ts:14

### prependOnceListener

- prependOnceListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.prependOnceListener

  - Defined in node_modules/@types/events/index.d.ts:15

### rawListeners

- rawListeners(type: string | number): Listener[]

- #### Parameters

  - type: string | number

  #### Returns Listener[]

  Inherited from Emitter.rawListeners

  - Defined in node_modules/@types/events/index.d.ts:21

### removeAllListeners

- removeAllListeners(type?: string | number): this

- #### Parameters

  - `Optional` type: string | number

  #### Returns this

  Inherited from Emitter.removeAllListeners

  - Defined in node_modules/@types/events/index.d.ts:18

### removeListener

- removeListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.removeListener

  - Defined in node_modules/@types/events/index.d.ts:16

### send

- send(method: string, params: string[]): Promise<string>

- #### Parameters

  - method: string
  - params: string[]

  #### Returns Promise<string>

  - Defined in packages/signer/src/signers/nip46.ts:299

### setMaxListeners

- setMaxListeners(n: number): this

- #### Parameters

  - n: number

  #### Returns this

  Inherited from Emitter.setMaxListeners

  - Defined in node_modules/@types/events/index.d.ts:8

### setParams

- setParams(params: Partial< Nip46BrokerParams >): void

- #### Parameters

  - params: Partial< Nip46BrokerParams >

  #### Returns void

  - Defined in packages/signer/src/signers/nip46.ts:272

### signEvent

- signEvent(event: StampedEvent ): Promise<any>

- #### Parameters

  - event: StampedEvent

  #### Returns Promise<any>

  - Defined in packages/signer/src/signers/nip46.ts:384

### teardown

- teardown(): void

- #### Returns void

  - Defined in packages/signer/src/signers/nip46.ts:283

### waitForNostrconnect

- waitForNostrconnect(
  url: string,
  abort?: AbortController,
  ): CustomPromise < Nip46ResponseWithResult , undefined | Nip46Response >

- #### Parameters

  - url: string
  - `Optional` abort: AbortController

  #### Returns CustomPromise < Nip46ResponseWithResult , undefined | Nip46Response >

  - Defined in packages/signer/src/signers/nip46.ts:338

### `Static` get

- get(params: Nip46BrokerParams ): Nip46Broker

- #### Parameters

  - params: Nip46BrokerParams

  #### Returns Nip46Broker

  - Defined in packages/signer/src/signers/nip46.ts:231

### `Static` listenerCount

- listenerCount(emitter: EventEmitter, type: string | number): number

- #### Parameters

  - emitter: EventEmitter
  - type: string | number

  #### Returns number

  Inherited from Emitter.listenerCount

  - Defined in node_modules/@types/events/index.d.ts:4