I'm using web3js (via Truffle) to make a call to a contract, to access a struct in a mapping.
mapping (bytes32 => entry) public entries;
struct entry {
Mode status;
Deed deed;
uint registrationDate;
uint value;
uint highestBid;
}
Here is the call:
var myEntry = Registrar.deployed().entries.call("0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4af")
Which returns:
[ { [String: '1'] s: 1, e: 0, c: [ 1 ] },
'0x0000000000000000000000000000000000000000',
{ [String: '1482956489'] s: 1, e: 9, c: [ 1482956489 ] },
{ [String: '0'] s: 1, e: 0, c: [ 0 ] },
{ [String: '0'] s: 1, e: 0, c: [ 0 ] } ]
Which looks to me like an array, but:
truffle(default)> myEntry;
// [ { [String: '1'] s: 1, e: 0, c: [ 1 ] },
// '0x0000000000000000000000000000000000000000',
// { [String: '1482956489'] s: 1, e: 9, c: [ 1482956489 ] },
// { [String: '0'] s: 1, e: 0, c: [ 0 ] },
// { [String: '0'] s: 1, e: 0, c: [ 0 ] } ]
truffle(default)> myEntry[0];
// undefined
truffle(default)> myEntry[1];
// undefined
truffle(default)> typeof(myEntry);
'object'
How can I access any of the properties (members?) of this object?
Note: I can't update the contract, it's the ENS' Initial Registrar.