Documentation
¶
Index ¶
- Variables
- func Decode(hexEncoded string) (map[string]any, error)
- func DecodeQuality(quality string) (string, error)
- func Encode(json map[string]any) (string, error)
- func EncodeForMultisigning(json map[string]any, xrpAccountID string) (string, error)
- func EncodeForSigning(json map[string]any) (string, error)
- func EncodeForSigningBatch(json map[string]any) (string, error)
- func EncodeForSigningClaim(json map[string]any) (string, error)
- func EncodeQuality(quality string) (string, error)
- type LedgerData
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSigningClaimFieldNotFound is returned when the 'Channel' & 'Amount' fields are both required, but were not found. ErrSigningClaimFieldNotFound = errors.New("'Channel' & 'Amount' fields are both required, but were not found") // ErrBatchFlagsFieldNotFound is returned when the 'flags' field is missing. ErrBatchFlagsFieldNotFound = errors.New("no field `flags`") // ErrBatchTxIDsFieldNotFound is returned when the 'txIDs' field is missing. ErrBatchTxIDsFieldNotFound = errors.New("no field `txIDs`") // ErrBatchTxIDsNotArray is returned when the 'txIDs' field is not an array. ErrBatchTxIDsNotArray = errors.New("txIDs field must be an array") // ErrBatchTxIDNotString is returned when a txID is not a string. ErrBatchTxIDNotString = errors.New("each txID must be a string") // ErrBatchFlagsNotUInt32 is returned when the 'flags' field is not a uint32. ErrBatchFlagsNotUInt32 = errors.New("flags field must be a uint32") // ErrBatchTxIDsLengthTooLong is returned when the 'txIDs' field is too long. ErrBatchTxIDsLengthTooLong = errors.New("txIDs length exceeds maximum uint32 value") )
var ( // ErrInvalidQuality is returned when the quality is invalid. ErrInvalidQuality = errors.New("invalid quality") )
Functions ¶
func Decode ¶
Decode decodes a hex string in the canonical binary format into a JSON transaction object.
func DecodeQuality ¶
Decode a quality amount from a hex string to a string.
func Encode ¶
Encode converts a JSON transaction object to a hex string in the canonical binary format. The binary format is defined in XRPL's core codebase.
func EncodeForMultisigning ¶
EncodeForMultiSign: encodes a transaction into binary format in preparation for providing one signature towards a multi-signed transaction. (Only encodes fields that are intended to be signed.)
func EncodeForSigning ¶
Encodes a transaction into binary format in preparation for signing.
func EncodeForSigningBatch ¶ added in v0.1.11
EncodeForSigningBatch encodes a batch transaction into binary format in preparation for signing.
func EncodeForSigningClaim ¶
EncodeForPaymentChannelClaim: encodes a payment channel claim into binary format in preparation for signing.
func EncodeQuality ¶
EncodeQuality encodes a quality amount to a hex string.
Types ¶
type LedgerData ¶
type LedgerData struct { LedgerIndex uint32 TotalCoins string ParentHash string TransactionHash string AccountHash string ParentCloseTime uint32 CloseTime uint32 CloseTimeResolution uint8 CloseFlags uint8 }
LedgerData represents the data of a ledger.
func DecodeLedgerData ¶
func DecodeLedgerData(data string) (LedgerData, error)
DecodeLedgerData decodes a hex string in the canonical binary format into a LedgerData object. The hex string should represent a ledger data object.