Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SignedParcel

A Parcel signed by a private key. It is possible to request the CodeChain network to process this parcel with the sendSignedParcel function.

Parcels signed with a regular key has the same effect as those signed with the original key. The original key is the key of the account that registered the regular key.

If any of the following is true, the Parcel will not be processed:

  • The Parcel's processing fee is less than 10.
  • A network ID is not identical.
  • A nonce is not identical to the signer's nonce.

Hierarchy

  • SignedParcel

Index

Constructors

constructor

  • new SignedParcel(unsigned: Parcel, sig: string, blockNumber?: undefined | number, blockHash?: H256, parcelIndex?: undefined | number): SignedParcel
  • Parameters

    • unsigned: Parcel

      A Parcel.

    • sig: string

      An ECDSA signature which is a 65 byte hexadecimal string.

    • Optional blockNumber: undefined | number

      The block number of the block that contains the parcel.

    • Optional blockHash: H256

      The hash of the block that contains the parcel.

    • Optional parcelIndex: undefined | number

      The index(location) of the parcel within the block.

    Returns SignedParcel

Properties

blockHash

blockHash: H256 | null

blockNumber

blockNumber: number | null

parcelIndex

parcelIndex: number | null

r

r: U256

s

s: U256

unsigned

unsigned: Parcel

v

v: number

Methods

getSignerAccountId

  • getSignerAccountId(): H160

getSignerAddress

hash

rlpBytes

  • rlpBytes(): Buffer

signature

  • signature(): object

toEncodeObject

  • toEncodeObject(): any[]

toJSON

  • toJSON(): object
  • Convert to a SignedParcel JSON object.

    Returns object

    A SignedParcel JSON object.

    • action: object
      • action: string
    • blockHash: null | string
    • blockNumber: null | number
    • fee: string
    • hash: string
    • networkId: string
    • nonce: string
    • parcelIndex: null | number
    • sig: string

Static convertRsvToSignatureString

  • convertRsvToSignatureString(params: object): string
  • Convert r, s, v values of an ECDSA signature to a string.

    Parameters

    • params: object
      • r: string

        The r value of an ECDSA signature, which is up to 32 bytes of hexadecimal string.

      • s: string

        The s value of an ECDSA signature, which is up to 32 bytes of hexadecimal string.

      • v: number

        The recovery parameter of an ECDSA signature.

    Returns string

    A 65 byte hexadecimal string.

Static fromJSON

  • Create a SignedParcel from a SignedParcel JSON object.

    Parameters

    • data: any

      A SignedParcel JSON object.

    Returns SignedParcel

    A SignedParcel.

Generated using TypeDoc