Options
All
  • Public
  • Public/Protected
  • All
Menu

Class QRCodeGenerator describes a NIP-7 compliant QR Code generator (factory).

since

0.2.0

Hierarchy

  • QRCodeGenerator

Index

Constructors

Private constructor

  • Factory/Singleton pattern, constructor is private.

    access

    private

    Returns QRCodeGenerator

Methods

Static createAddContact

  • createAddContact(name: string, accountPublicKey: string, networkType: number, generationHash: string): ContactQR
  • Create a Contact QR Code from a contact name and account.

    see

    {ContactQR}

    Parameters

    • name: string

      the name

    • accountPublicKey: string

      the account public key

    • networkType: number
    • generationHash: string

    Returns ContactQR

Static createExportAccount

  • createExportAccount(accountPrivateKey: string, networkType: number, generationHash: string, password?: string): AccountQR
  • Create an Account Export QR Code from an Account instance, encrypted with given password.

    see

    {AccountQR}

    Parameters

    • accountPrivateKey: string

      the account private key.

    • networkType: number
    • generationHash: string
    • Optional password: string

    Returns AccountQR

Static createExportAddress

  • createExportAddress(name: string, address: string, networkType: number, generationHash: string): AddressQR
  • Create an Address QR Code from a contact name and address.

    see

    {AddressQR}

    Parameters

    • name: string

      the name

    • address: string

      the account address

    • networkType: number
    • generationHash: string

    Returns AddressQR

Static createExportMnemonic

  • createExportMnemonic(mnemonicPlainText: string, networkType: number, generationHash: string, password: string): MnemonicQR
  • Create a Mnemonic Export QR Code from a MnemonicPassPhrase instance, encrypted with given password.

    see

    {MnemonicQR}

    Parameters

    • mnemonicPlainText: string
    • networkType: number
    • generationHash: string
    • password: string

    Returns MnemonicQR

Static createExportObject

  • createExportObject(object: object, networkType: number, generationHash: string): ObjectQR
  • Create a JSON object QR Code from a JSON object.

    see

    {ObjectQR}

    Parameters

    • object: object
    • networkType: number
    • generationHash: string

    Returns ObjectQR

Static createTransactionRequest

  • Create a Transaction Request QR Code from a Transaction instance.

    see

    {TransactionQR}

    Parameters

    • transaction: ITransaction
    • networkType: number
    • generationHash: string

    Returns TransactionQR

Static fromJSON

  • fromJSON(json: string, transactionCreateFromPayload: (payload: string) => ITransaction, password?: string, signedTransactionCreateFromPayload?: (payload: string) => ISignedTransaction, cosignatureSignedTransactionCreateFromPayload?: (payload: string) => any): QRCode
  • Parse a JSON QR code content into a sub-class of QRCode.

    throws

    {Error} On empty json given.

    throws

    {Error} On missing type field value.

    throws

    {Error} On unrecognized QR code type field value.

    Parameters

    • json: string
    • transactionCreateFromPayload: (payload: string) => ITransaction

      the transaction factory to create ITransaction from a binary payload if the qr is a transaction based one.

    • Optional password: string

      to decrypt private keys.

    • Optional signedTransactionCreateFromPayload: (payload: string) => ISignedTransaction
    • Optional cosignatureSignedTransactionCreateFromPayload: (payload: string) => any
        • (payload: string): any
        • Parameters

          • payload: string

          Returns any

    Returns QRCode

Generated using TypeDoc