Skip to main content
4 of 4
deleted 8 characters in body
cesarm
  • 1.5k
  • 7
  • 20

I think it is a feature with NodeJS. They don't go deep to reveal every detail down an object.

Note the difference at console.log: offerResult.records VS offerResult


server.offers('accounts', distributor.publicKey).call().then(function (offerResult) {
    console.log( offerResult.records );
})  

gives

> [ { _links: { self: [Object], offer_maker: [Object] },
    id: 234710,
    paging_token: '234710',
    seller: 'GCBCTFOR2GES3JI5SKCYSDP7ZRIB523WQXZ5QC5FWXSK2FEMFMLJULIT',
    selling:
     { asset_type: 'credit_alphanum12',
       asset_code: 'MCoin',
       asset_issuer: 'GCBCTFOR2GES3JI5SKCYSDP7ZRIB523WQXZ5QC5FWXSK2FEMFMLJULIT' },
    buying: { asset_type: 'native' },
    amount: '200.0000000',
    price_r: { n: 2, d: 1 },
    price: '2.0000000',
    self: [Function],
    offer_maker: [Function] },
  { _links: { self: [Object], offer_maker: [Object] },
    id: 235067,
    paging_token: '235067',
    seller: 'GCBCTFOR2GES3JI5SKCYSDP7ZRIB523WQXZ5QC5FWXSK2FEMFMLJULIT',
    selling:
     { asset_type: 'credit_alphanum12',
       asset_code: 'MCoin',
       asset_issuer: 'GCBCTFOR2GES3JI5SKCYSDP7ZRIB523WQXZ5QC5FWXSK2FEMFMLJULIT' },
    buying: { asset_type: 'native' },
    amount: '200.0000000',
    price_r: { n: 2, d: 1 },
    price: '2.0000000',
    self: [Function],
    offer_maker: [Function] } ]

WHEREAS

server.offers('accounts', distributor.publicKey).call().then(function (offerResult) {
    console.log( offerResult );
})  

gives

{ records:
   [ { _links: [Object],
       id: 234710,
       paging_token: '234710',
       seller: 'GCBCTFOR2GES3JI5SKCYSDP7ZRIB523WQXZ5QC5FWXSK2FEMFMLJULIT',
       selling: [Object],
       buying: [Object],
       amount: '200.0000000',
       price_r: [Object],
       price: '2.0000000',
       self: [Function],
       offer_maker: [Function] },
     { _links: [Object],
       id: 235067,
       paging_token: '235067',
       seller: 'GCBCTFOR2GES3JI5SKCYSDP7ZRIB523WQXZ5QC5FWXSK2FEMFMLJULIT',
       selling: [Object],
       buying: [Object],
       amount: '200.0000000',
       price_r: [Object],
       price: '2.0000000',
       self: [Function],
       offer_maker: [Function] } ],
  next: [Function: next],
  prev: [Function: prev] }
cesarm
  • 1.5k
  • 7
  • 20