Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda