Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
How can I get all the assets in an address using algorand-js-sdk?

I'm new to blockchain dev and am using the JS SDK for Algorand. Is it possible to retrieve all the assets in a wallet by its address?

Thank you

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Yes, you can use this: GET /v2/accounts/{address}

This will return an assets array, as well as some other things - you can read more here.

about 4 years ago · Santiago Trujillo Denunciar

0

You can use an endpoint from either algod (algo daemon of the node) or indexer (Postgres database) to get this information.

Algod method:

const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
const accountInfo = await algodClient.accountInformation(address).do();

https://algorand.github.io/js-algorand-sdk/classes/Algodv2.html#accountInformation

Indexer method:

const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
const accountAssets = await indexerClient.lookupAccountAssets(address).do();

https://algorand.github.io/js-algorand-sdk/classes/Indexer.html#lookupAccountAssets

For demonstration purpose, I just randomly found an address from Algoexplorer.

const token  = "";
const port   = "";
const algodServer = "https://mainnet-api.algonode.cloud";
const indexerServer = "https://mainnet-idx.algonode.cloud";
const algodClient = new algosdk.Algodv2(token, algodServer, port);
const indexerClient = new algosdk.Indexer(token, indexerServer, port);

(async () => {
  const address = "A4YW55ZEC2TTIN2TEVN56IRVGLWQYQRUNJTPG37OTWE4EJWNAH3EUKHZKA";
  const algodAccountAssets = await algodClient.accountInformation(address).do();
 
  const indexerAccountAssets = await indexerClient.lookupAccountAssets(address).do();

  console.log("algod results: ", algodAccountAssets)
  console.log("indexer results: ", indexerAccountAssets)
})();
<script src="https://unpkg.com/algosdk@v1.18.1/dist/browser/algosdk.min.js"></script>

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda