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

Methods

Static createAddContact

  • createAddContact(name: string, account: Account | PublicAccount, networkType?: NetworkType, generationHash?: string): ContactQR
  • Create a Contact QR Code from a contact name and account.

    see

    {ContactQR}

    Parameters

    • name: string
    • account: Account | PublicAccount
    • Default value networkType: NetworkType = NetworkType.MIJIN_TEST
    • Default value generationHash: string = "17FA4747F5014B50413CCF968749604D728D7065DC504291EEE556899A534CBB"

    Returns ContactQR

Static createExportAccount

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

    see

    {AccountQR}

    Parameters

    • account: Account
    • password: string
    • Default value networkType: NetworkType = NetworkType.MIJIN_TEST
    • Default value generationHash: string = "17FA4747F5014B50413CCF968749604D728D7065DC504291EEE556899A534CBB"

    Returns AccountQR

Static createExportMnemonic

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

    see

    {MnemonicQR}

    Parameters

    • mnemonic: MnemonicPassPhrase
    • password: string
    • Default value networkType: NetworkType = NetworkType.MIJIN_TEST
    • Default value generationHash: string = "17FA4747F5014B50413CCF968749604D728D7065DC504291EEE556899A534CBB"

    Returns MnemonicQR

Static createExportObject

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

    see

    {ObjectQR}

    Parameters

    • object: object
    • Default value networkType: NetworkType = NetworkType.MIJIN_TEST
    • Default value generationHash: string = "17FA4747F5014B50413CCF968749604D728D7065DC504291EEE556899A534CBB"

    Returns ObjectQR

Static createTransactionRequest

  • createTransactionRequest(transaction: Transaction, networkType?: NetworkType, generationHash?: string): TransactionQR
  • Create a Transaction Request QR Code from a Transaction instance.

    see

    {TransactionQR}

    Parameters

    • transaction: Transaction
    • Default value networkType: NetworkType = NetworkType.MIJIN_TEST
    • Default value generationHash: string = "17FA4747F5014B50413CCF968749604D728D7065DC504291EEE556899A534CBB"

    Returns TransactionQR

Static fromJSON

  • fromJSON(json: string, password?: string): 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
    • Optional password: string

    Returns QRCode

Generated using TypeDoc