Skip to main content
Glama
account.ts985 B
import { Agent } from '../../agent'; export async function getAccountInfo(agent: Agent, address: string) { try { const response = await agent.client.request({ command: 'account_info', account: address, ledger_index: 'current' }); return { account: response.result.account_data.Account, balance: response.result.account_data.Balance, flags: response.result.account_data.Flags, ledgerEntryType: response.result.account_data.LedgerEntryType, ownerCount: response.result.account_data.OwnerCount, previousTxnID: response.result.account_data.PreviousTxnID, previousTxnLgrSeq: response.result.account_data.PreviousTxnLgrSeq, sequence: response.result.account_data.Sequence }; } catch (error) { throw new Error(`Failed to get account info: ${error instanceof Error ? error.message : 'Unknown error'}`); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tamago-labs/xrpl-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server