Interface that should be implemented by ABI serializable objects.

Hierarchy

  • Bytes

Implements

Constructors

  • Parameters

    • Optional array: Uint8Array

    Returns Bytes

Properties

array: Uint8Array
abiName: string

Accessors

  • get hexString(): string
  • Hex string representation of this instance.

    Returns string

  • get length(): number
  • Number of bytes in this instance.

    Returns number

  • get utf8String(): string
  • UTF-8 string representation of this instance.

    Returns string

Methods

  • Mutating. Append bytes to this instance.

    Parameters

    • other: AnyBytes

    Returns void

  • Non-mutating, returns a copy of this instance with appended bytes.

    Parameters

    • other: AnyBytes

    Returns Bytes

  • Returns Bytes

  • Mutating. Drop bytes from the start of this instance.

    Parameters

    • Optional n: number

    Returns void

  • Non-mutating, returns a copy of this instance with dropped bytes from the start.

    Parameters

    • Optional n: number

    Returns Bytes

  • Return true if the object equals the other object passed.

    Parameters

    • other: AnyBytes

    Returns boolean

  • Called when encoding to binary abi format.

    Parameters

    Returns void

  • Called when encoding to json abi format.

    Returns string

  • Parameters

    Returns string

  • Mutating. Pad this instance to length.

    Parameters

    • n: number
    • Optional truncate: boolean

    Returns void

  • Non-mutating, returns a copy of this instance with zeros padded.

    Parameters

    • n: number
    • Optional truncate: boolean

    Returns Bytes

  • Returns Bytes

  • Create a new Bytes instance.

    Note

    Make sure to take a copy before mutating the bytes as the underlying source is not copied here.

    Parameters

    Returns Bytes

  • Parameters

    Returns Bytes

  • Return true if given value is a valid BytesType.

    Parameters

    • value: any

    Returns value is BytesType

  • Parameters

    • length: number

    Returns Bytes