Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.d.ts 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { decodeLedgerData } from './ledger-hashes';
  2. import { JsonObject } from './types/serialized-type';
  3. import { TRANSACTION_TYPES } from './enums';
  4. /**
  5. * Decode a transaction
  6. *
  7. * @param binary hex-string of the encoded transaction
  8. * @returns the JSON representation of the transaction
  9. */
  10. declare function decode(binary: string): JsonObject;
  11. /**
  12. * Encode a transaction
  13. *
  14. * @param json The JSON representation of a transaction
  15. * @returns A hex-string of the encoded transaction
  16. */
  17. declare function encode(json: object): string;
  18. /**
  19. * Encode a transaction and prepare for signing
  20. *
  21. * @param json JSON object representing the transaction
  22. * @param signer string representing the account to sign the transaction with
  23. * @returns a hex string of the encoded transaction
  24. */
  25. declare function encodeForSigning(json: object): string;
  26. /**
  27. * Encode a transaction and prepare for signing with a claim
  28. *
  29. * @param json JSON object representing the transaction
  30. * @param signer string representing the account to sign the transaction with
  31. * @returns a hex string of the encoded transaction
  32. */
  33. declare function encodeForSigningClaim(json: object): string;
  34. /**
  35. * Encode a transaction and prepare for multi-signing
  36. *
  37. * @param json JSON object representing the transaction
  38. * @param signer string representing the account to sign the transaction with
  39. * @returns a hex string of the encoded transaction
  40. */
  41. declare function encodeForMultisigning(json: object, signer: string): string;
  42. /**
  43. * Encode a quality value
  44. *
  45. * @param value string representation of a number
  46. * @returns a hex-string representing the quality
  47. */
  48. declare function encodeQuality(value: string): string;
  49. /**
  50. * Decode a quality value
  51. *
  52. * @param value hex-string of a quality
  53. * @returns a string representing the quality
  54. */
  55. declare function decodeQuality(value: string): string;
  56. export { decode, encode, encodeForSigning, encodeForSigningClaim, encodeForMultisigning, encodeQuality, decodeQuality, decodeLedgerData, TRANSACTION_TYPES, };