I have an issuer account I1 and a distributor account D1. I have added trust of an asset DummyAsset issued by I1 with trust limit of 5000 DummyAsset.

How can I later verify/check the trust limit of a particular asset programmatically?

1 Answer 1


Horizon /account/{account} endpoint returns current balances, including trust limit for each asset in the list.

Each balance record looks like the following:

  "balance": "126.8107491",
  "limit": "5000.0000000",
  "asset_type": "credit_alphanum4",
  "asset_code": "BAR",

In order to retrieve the limit for the specified balance you need to load an account and enumerate through balance entries to find your asset. Check this sample code (JS):

  .then(account => account.balances.filter(balanceRecord => balanceRecord.asset_code === 'BAR' && 
    balanceRecord.asset_issuer === 'GBAUUA74H4XOQYRSOW2RZUA4QL5PB37U3JS5NE3RTB2ELJVMIF5RLMAG')[0])
  .then(balanceRecord => {
    if (!balanceRecord) return Promise.reject('Trustline does not exist.')
  .catch(err => console.error(err))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.