diff --git a/src/providers/tari_universe/provider.ts b/src/providers/tari_universe/provider.ts index 7925f6c..f055a9b 100644 --- a/src/providers/tari_universe/provider.ts +++ b/src/providers/tari_universe/provider.ts @@ -97,7 +97,21 @@ export class TariUniverseProvider implements TariProvider { } public async getAccount(): Promise { - return this.sendRequest({ methodName: "getAccount", args: [] }); + const { account_id, address, public_key } = await this.sendRequest({ methodName: "getAccount", args: [] }); + const { balances } = await this.getAccountBalances(address); + + return { + account_id, + address, + public_key, + resources: balances.map((b: any) => ({ + type: b.resource_type, + resource_address: b.resource_address, + balance: b.balance + b.confidential_balance, + vault_id: "Vault" in b.vault_address ? b.vault_address.Vault : b.vault_address, + token_symbol: b.token_symbol, + })), + }; } public async getAccountBalances(componentAddress: string): Promise {