Layout for a public key

Export

Hierarchy

  • Layout<PublicKey>
    • PubkeyField

Constructors

Properties

boundConstructor_?: any
property?: string
span: number

Methods

  • TODO:

    Returns

    Memberof

    PubkeyField

    Parameters

    • b: Uint8Array
    • Optional offset: number

    Returns PublicKey

  • TODO:

    Returns

    Memberof

    PubkeyField

    Parameters

    • src: PublicKey
    • b: Uint8Array
    • Optional offset: number

    Returns number

  • Create an object from layout properties and an array of values.

    NOTE This function returns undefined if invoked on a layout that does not return its value as an Object. Objects are returned for things that are a Structure, which includes VariantLayout|variant layouts if they are structures, and excludes Unions. If you want this feature for a union you must use Union.getVariant|getVariant to select the desired layout.

    Returns

    Parameters

    • values: any[]

      an array of values that correspond to the default order for properties. As with Layout#decode|decode layout elements that have no property name are skipped when iterating over the array values. Only the top-level properties are assigned; arguments are not assigned to properties of contained layouts. Any unused values are ignored.

    Returns undefined | LayoutObject

  • Calculate the span of a specific instance of a layout.

    Returns

    • the number of bytes covered by the layout instance. If this method is not overridden in a subclass the definition-time constant Layout#span|span will be returned.

    Throws

    • if the length of the value cannot be determined.

    Parameters

    • Optional b: Uint8Array

      the buffer that contains an encoded instance.

    • Optional offset: number

      the offset at which the encoded instance starts. If absent a zero offset is inferred.

    Returns number

  • Function to create an Object into which decoded properties will be written.

    Used only for layouts that Layout#decode|decode to Object instances, which means:

    • Structure
    • Union
    • VariantLayout
    • BitStructure

    If left undefined the JavaScript representation of these layouts will be Object instances.

    See bindConstructorLayout.

    Returns LayoutObject

  • Replicate the layout using a new property.

    This function must be used to get a structurally-equivalent layout with a different name since all Layout instances are immutable.

    NOTE This is a shallow copy. All fields except Layout#property|property are strictly equal to the origin layout.

    Returns

    • the copy with Layout#property|property set to property.

    Parameters

    • property: string

      the value for Layout#property|property in the replica.

    Returns PubkeyField

Generated using TypeDoc