diff --git a/src/app/_services/transaction.service.ts b/src/app/_services/transaction.service.ts index bcd4ca6..f3a271c 100644 --- a/src/app/_services/transaction.service.ts +++ b/src/app/_services/transaction.service.ts @@ -46,7 +46,7 @@ export class TransactionService { } getAddressTransactions(address: string, offset: number, limit: number): Observable { - return this.httpClient.get(`${environment.cicCacheUrl}/tx/${address}/${offset}/${limit}`); + return this.httpClient.get(`${environment.cicCacheUrl}/tx/user/${address}/${offset}/${limit}`); } async setTransaction(transaction, cacheSize: number): Promise { @@ -61,7 +61,7 @@ export class TransactionService { .pipe(first()) .subscribe( (res) => { - transaction.sender = this.getAccountInfo(res.body); + transaction.sender = this.getAccountInfo(res); }, (error) => { transaction.sender = defaultAccount; @@ -72,7 +72,7 @@ export class TransactionService { .pipe(first()) .subscribe( (res) => { - transaction.recipient = this.getAccountInfo(res.body); + transaction.recipient = this.getAccountInfo(res); }, (error) => { transaction.recipient = defaultAccount; @@ -96,7 +96,7 @@ export class TransactionService { .pipe(first()) .subscribe( (res) => { - conversion.sender = conversion.recipient = this.getAccountInfo(res.body); + conversion.sender = conversion.recipient = this.getAccountInfo(res); }, (error) => { conversion.sender = conversion.recipient = defaultAccount; @@ -126,7 +126,7 @@ export class TransactionService { } getAccountInfo(account: string): any { - const accountInfo = Envelope.fromJSON(JSON.stringify(account)).unwrap().m.data; + const accountInfo = JSON.parse(Envelope.fromJSON(JSON.stringify(account)).unwrap().m.data); accountInfo.vcard = vCard.parse(atob(accountInfo.vcard)); return accountInfo; } diff --git a/src/app/_services/user.service.ts b/src/app/_services/user.service.ts index f632866..68941fa 100644 --- a/src/app/_services/user.service.ts +++ b/src/app/_services/user.service.ts @@ -103,6 +103,7 @@ export class UserService { .subscribe( async (res) => { const syncableAccount: Syncable = Envelope.fromJSON(JSON.stringify(res)).unwrap(); + syncableAccount.m.data = JSON.parse(syncableAccount.m.data); const update: Array = []; for (const prop of Object.keys(accountInfo)) { update.push(new ArgPair(prop, accountInfo[prop])); diff --git a/src/assets/js/block-sync/data/Declarator.json b/src/assets/js/block-sync/data/AddressDeclarator.json similarity index 100% rename from src/assets/js/block-sync/data/Declarator.json rename to src/assets/js/block-sync/data/AddressDeclarator.json diff --git a/src/assets/js/block-sync/driver.js b/src/assets/js/block-sync/driver.js index 3f65340..f6f8bf7 100644 --- a/src/assets/js/block-sync/driver.js +++ b/src/assets/js/block-sync/driver.js @@ -42,7 +42,7 @@ Driver.prototype.sync = function (n) { const processor = async (b, t) => { return await self.process(b, t); }; - self.syncer(self, self.lo, self.hi, self.filters[0], self.filters[1], countGetter, processor); + self.syncer(self.lo, self.hi, self.filters[0], self.filters[1], countGetter, processor); }; Driver.prototype.process = function (b, t) {