How to use the ripple-lib.SerializedObject.from_json function in ripple-lib

To help you get started, we’ve selected a few ripple-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ripple / ripple-rest / test / fixtures / notifications.js View on Github external
module.exports.accountTxLedgerResponse = function(request) {
  return JSON.stringify({
    id: request.id,
    status: 'success',
    type: 'response',
    result: {
      account: addresses.VALID,
      ledger_index_max: request.ledger_index_min,
      ledger_index_min: request.ledger_index_max,
      limit: request.limit,
      transactions: [
        {
          ledger_index: LEDGER,
          meta: SerializedObject.from_json(METADATA).to_hex(),
          tx_blob: SerializedObject.from_json(BINARY_TRANSACTION).to_hex(),
          validated: true
        }
      ]
    }
  });
};
github ripple / ripple-rest / test / fixtures / mock.js View on Github external
module.exports.transactionResponse = function(request) {
  return JSON.stringify({
    id: request.id,
    status: 'success',
    type: 'response',
    result: _.extend({
      meta: SerializedObject.from_json(METADATA).to_hex(),
      tx: SerializedObject.from_json(BINARY_TRANSACTION).to_hex()
    }, BINARY_TRANSACTION_SYNTH)
  });
};
github ripple / ripple-rest / test / fixtures / mock.js View on Github external
module.exports.transactionResponse = function(request) {
  return JSON.stringify({
    id: request.id,
    status: 'success',
    type: 'response',
    result: _.extend({
      meta: SerializedObject.from_json(METADATA).to_hex(),
      tx: SerializedObject.from_json(BINARY_TRANSACTION).to_hex()
    }, BINARY_TRANSACTION_SYNTH)
  });
};
github ripple / ripple-rest / test / fixtures / notifications.js View on Github external
module.exports.accountTxPreviousResponse = function(request) {
  return JSON.stringify({
    id: request.id,
    status: 'success',
    type: 'response',
    result: {
      account: addresses.VALID,
      ledger_index_max: request.ledger_index_min,
      ledger_index_min: request.ledger_index_max,
      limit: request.limit,
      forward: request.forward,
      transactions: [
        {
          ledger_index: request.ledger_index_max - 2,
          meta: SerializedObject.from_json(METADATA).to_hex(),
          tx_blob: SerializedObject.from_json(_.extend({}, TRANSACTION, {
            Destination: addresses.VALID
          })).to_hex(),
          validated: true
        }
      ]
    }
  });
};
github ripple / ripple-rest / test / fixtures / payments.js View on Github external
module.exports.transactionResponse = function(request, options) {
  options = options || {};
  _.defaults(options, {
    memos: [],
    hash: module.exports.VALID_TRANSACTION_HASH,
    validated: true
  });

  return JSON.stringify({
    id: request.id,
    status: 'success',
    type: 'response',
    result: _.extend({
      meta: SerializedObject.from_json(METADATA).to_hex(),
      tx: SerializedObject.from_json(module.exports.binaryTransaction(options)).to_hex()
    }, module.exports.binaryTransactionSynth(options))
  });
};
github ripple / rippled-historical-database / lib / db working.js View on Github external
function to_hex(input){
		hex = new SerializedObject.from_json(input).to_hex();
		return hex;
	}
github ripple / ripple-rest / api / transaction / sign.js View on Github external
function serialize(txJSON) {
  return SerializedObject.from_json(txJSON);
}