mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 12:15:50 +00:00
- Initial commit, should be quite complete
This commit is contained in:
21
content/_code-samples/tx-serialization/js/helpers.js
Normal file
21
content/_code-samples/tx-serialization/js/helpers.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'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
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user