fetchDetails() {
    return fetch(ACCOUNT_URL + this.address).then(response => {
      return response.json();
    }).then(details => {
      if('error' in details.info && details.info.error === 'Account not found') {
        details.info.balance = '0';
        details.history = [];
      } else if('error' in details.info) {
        throw new Error(details.info.error);
      }

      // Add balance to each block, convert amounts to Xrb
      if(details.history.length) {
        for(let i=0; i<details.history.length; i++) {
          extraBlockValues(details, i);
        }
      }

      this.detailsCache = details;
      return details;
    });
  }
/*
    Perform backend call to fetch account balance, transactions, etc.
    @return Promise
   */
Perform backend call to fetch account balance, transactions, etc.
Perform backend call to fetch account balance transactions etc .
fetchDetails() {
    return fetch(ACCOUNT_URL + this.address).then(response => {
      return response.json();
    }).then(details => {
      if('error' in details.info && details.info.error === 'Account not found') {
        details.info.balance = '0';
        details.history = [];
      } else if('error' in details.info) {
        throw new Error(details.info.error);
      }
      if(details.history.length) {
        for(let i=0; i<details.history.length; i++) {
          extraBlockValues(details, i);
        }
      }
      this.detailsCache = details;
      return details;
    });
  }
fetchDetails ( ) { return fetch ( ACCOUNT_URL + this . address ) . then ( response => { return response . json ( ) ; } ) . then ( details => { if ( 'error' in details . info && details . info . error === 'Account not found' ) { details . info . balance = '0' ; details . history = [ ] ; } else if ( 'error' in details . info ) { throw new Error ( details . info . error ) ; } if ( details . history . length ) { for ( let i = 0 ; i < details . history . length ; i ++ ) { extraBlockValues ( details , i ) ; } } this . detailsCache = details ; return details ; } ) ; }
Perform backend call to fetch account balance, transactions, etc.
Perform backend call to fetch account balance transactions etc .
// Add balance to each block, convert amounts to Xrb