navio-blsct
    Preparing search index...

    Class DoublePublicKey

    The unique source from which an address is derived. A DoublePublicKey is a pair of PublicKeys that can be used to derive an address.

    Instantiating a DoublePublicKey object without a parameter returns a DoublePublicKey consisting of two randomly generated PublicKeys.

    Examples:

    const { DoublePublicKey, PublicKey, ViewKey } = require('navio-blsct')
    const dpk = new DoublePublicKey()
    const pk1 = PublicKey.random()
    const pk2 = PublicKey.random()
    const dpk2 = DoublePublicKey.from_public_keys(pk1, pk2)
    const vk = new ViewKey()
    const spendingPk = PublicKey.random()
    const dpk3 = DoublePublicKey.fromKeysAndAcctAddr(vk, spendingPk, 1, 2)
    const ser = dpk3.serialize()
    const deser = DoublePublicKey.deserialize(ser)
    deser.serialize() == ser

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    obj: any
    objSize: number

    Methods

    • Returns the underlying C++ object, transferring ownership from this instance to the caller.

      Returns any

      The underlying object of the instance.

    • Returns the size of the underlying C++ object.

      Returns number

      The size of the underlying C++ object in bytes.

    • Returns a string representation of the instance.

      Returns string

      A string representation of the instance.

    • Generates a DoublePublicKey from the provided ViewKey, PublicKey, account, and address

      Parameters

      • viewKey: ViewKey

        The ViewKey used to derive the DoublePublicKey.

      • spendingPubKey: PublicKey

        The PublicKey used for spending.

      • account: number

        The account.

      • address: number

        The address.

      Returns DoublePublicKey

      A new DoublePublicKey instance.

    • Constucts a new instance using the provided object.

      Type Parameters

      Parameters

      • this: new (obj: any, objSize?: number) => T
      • obj: any

        The object to use for the new instance.

      Returns T

      A new instance of the class.

    • Constructs a new instance using the provided object and size.

      Type Parameters

      Parameters

      • this: new (obj: any) => T
      • obj: any

        The object to use for the new instance.

      • objSize: number

        The size of the object.

      Returns T

      A new instance of the class.