Getting all resources for a user address #744
Unanswered
Rachit-lcx
asked this question in
Questions
Replies: 2 comments
-
I am also facing the same issue, Is there any other API's to fetch all the resources a particular address has |
Beta Was this translation helpful? Give feedback.
0 replies
-
make sure you update to the latest version of the sdk, the resources endpoint should provide all of the resources assuming that you're not rate limited. Keep in mind that balances with fungible assets will be stored at a (different) fungible store address |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Discord user ID
rachitgod
Describe your question in detail.
Hi All,
I am using ts-sdk via @aptos-labs/ts-sdk. Strangely I am able to fetch tx count but not the resource details:
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({
network: Network.TESTNET,
fullnode: "https://fullnode.testnet.aptoslabs.com/v1"
});
const aptos = new Aptos(config);
async function checkTransactions() {
const accountAddress = "0x6b7c82b6c0a51de77e27349a6863071744cf05db718518c916ad4a528704387e";
try {
const resource = await aptos.getAccountResources({
accountAddress: address,
});
console.log('resources',resources)
const transactionsCount = await aptos.getAccountTransactionsCount({ accountAddress });
console.log("Count:", transactionsCount);
const transactions = await aptos.getAccountTransactions({ accountAddress });
console.log("Transactions:", transactions);
} catch (error) {
console.error("Error fetching transactions:", error);
}
}
checkTransactions().catch(console.error);
Am I doing something wrong?
Logs show: Count: 2 but Transactions: [] and resources: []
What error, if any, are you getting?
Neither function nor api returning resources
What have you tried or looked at? Or how can we reproduce the error?
https://fullnode.testnet.aptoslabs.com/v1/accounts/0x6b7c82b6c0a51de77e27349a6863071744cf05db718518c916ad4a528704387e/balance/0x1::aptos_coin::AptosCoin Works
https://fullnode.testnet.aptoslabs.com/v1/accounts/0x6b7c82b6c0a51de77e27349a6863071744cf05db718518c916ad4a528704387e/resources returns []
Which operating system are you using?
macOS
Which SDK or tool are you using? (if any)
TypeScript SDK
Describe your environment or tooling in detail
No response
Beta Was this translation helpful? Give feedback.
All reactions