navio-blsct
    Preparing search index...

    Class SubAddr

    Represents a sub-address.

    Examples:

    const { SubAddr, PublicKey, DoublePublicKey, ViewKey, SubAddrId } = require('navio-blsct') 
    const seed = new Scalar()
    const viewKey = new ChildKey(seed).toTxKey().toViewKey()
    const spendingPubKey = new PublicKey()
    const subAddrId = new SubAddrId(123, 456)
    new SubAddr(viewKey, spendingPubKey, subAddrId)
    const dpk = new DoublePublicKey()
    const x = SubAddr.fromDoublePublicKey(dpk)
    const ser = x.serialize()
    const deser = SubAddr.deserialize(ser)
    ser === deser.serialize() // true

    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.

    • Serializes the instance to a hexadecimal string.

      Returns string

      A hexadecimal string representation 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.

    • Deserializes a SubAddr from its hexadecimal representation.

      Parameters

      • this: new (obj: any) => SubAddr
      • hex: string

        The hexadecimal string to deserialize.

      Returns SubAddr

      A new SubAddr 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.

    • Generates a new SubAddr instance.

      Parameters

      • viewKey: ViewKey

        The view key used for deriving the sub-address.

      • spendingPubKey: PublicKey

        The spending public key used for deriving the sub-address.

      • subAddrId: SubAddrId

        The sub-address ID used for deriving the sub-address.

      Returns SubAddr

      A new SubAddr instance with the specified view key, spending public key, and sub-address ID.