Files
xrpl-dev-portal/content/_code-samples/tx-serialization/js/helpers.js
2023-01-12 16:24:36 +01:00

21 lines
476 B
JavaScript

'use strict';
module.exports = {
isAmountObject : function (arg) {
const keys = Object.keys(arg).sort()
return (
keys.length === 3 &&
keys[0] === 'currency' &&
keys[1] === 'issuer' &&
keys[2] === 'value'
)
},
sortFuncCanonical : function (a, b) {
a = this.fieldSortKey(a)
b = this.fieldSortKey(b)
return a.typeCode - b.typeCode || a.fieldCode - b.fieldCode
}
}