# encode | xrpl
Documentation for xrpl

# Function encode

- encode(object: Transaction | LedgerEntry ): string

- Encodes a LedgerEntry or Transaction into a hex string

  ### Returns

  A hex string representing the encoded object.

  #### Parameters

  - ##### object: Transaction | LedgerEntry

    LedgerEntry or Transaction in JSON format.

  #### Returns string

  - Defined in packages/xrpl/src/utils/index.ts:84

Generated using TypeDoc