Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports.transactionWithCreatedOffer = function(options) {
options = options || {};
_.defaults(options, {
account: addresses.ACCOUNT,
amount: '1.9951'
});
const takerGets = new IOUValue(options.amount);
const takerPays = new IOUValue(module.exports.TAKER_PAYS);
const quality = takerPays.divide(takerGets);
const BookDirectory = binary.encodeQuality(quality.toString());
const meta = new Meta({
AffectedNodes: [
{
CreatedNode: {
LedgerEntryType: 'Offer',
LedgerIndex: 'AF3C702057C9C47DB9E809FD8C76CD22521012C5CC7AE95D914EC9E226F1D7E5',
NewFields: {
Account: options.account,
BookDirectory: BookDirectory,
Flags: 131072,
Sequence: 1404,
TakerGets: {
currency: 'USD',
issuer: addresses.ISSUER,
value: options.amount
OrderBookUtils.convertOfferQualityToHexFromText = function(quality) {
return binary.encodeQuality(quality);
};