lib/wallet.driver.mongoose.js
function objectToSignature(source) {
  function sortObject(input) {
      if(typeof input !== 'object' ||input===null)
          return input
      var output = {};
       Object.keys(input).sort().forEach(function (key) {
        output[key] = sortObject(input[key]);
      });
      return output;
  }
  var signature={};
  //
  // what about transactions and transfers ??
  // FIXME append 'amount_negative',
  ['balance','card','id','wid','email','apikey'].forEach(function (key) {
    signature[key]=source[key];
  });

  return sortObject(signature);
}
function objectToSignature(source) {
  function sortObject(input) {
      if(typeof input !== 'object' ||input===null)
          return input
      var output = {};
       Object.keys(input).sort().forEach(function (key) {
        output[key] = sortObject(input[key]);
      });
      return output;
  }
  var signature={};
  //
  // what about transactions and transfers ??
  // FIXME append 'amount_negative',
  ['balance','card','id','wid','email','apikey'].forEach(function (key) {
    signature[key]=source[key];
  });

  return sortObject(signature);
}
function objectToSignature ( source ) { function sortObject ( input ) { if ( typeof input !== 'object' || input === null ) return input var output = { } ; Object . keys ( input ) . sort ( ) . forEach ( function ( key ) { output [ key ] = sortObject ( input [ key ] ) ; } ) ; return output ; } var signature = { } ; // // what about transactions and transfers ?? // FIXME append 'amount_negative', [ 'balance' , 'card' , 'id' , 'wid' , 'email' , 'apikey' ] . forEach ( function ( key ) { signature [ key ] = source [ key ] ; } ) ; return sortObject ( signature ) ; }
this is used to prepare the object signature
this is used to prepare the object signature