Get Account Resources

Once an application is connected to Martian wallet via connect method, an app can fetch an account resources using window.martian.getAccountResources()and it will return a Promise that resolves when the request is successful and reject (throw when awaited) when the request is not valid/fails. It takes two parameter listed below

  • address: Any valid aptos address

  • query?: { version?: Types.LedgerVersion }

    • query.version Specifies ledger version of transactions. By default latest version will be used

Below is an example code describing the way to fetch an account resources.

// Fetch user transactions
const response = await window.martian.connect();
const address = response.address;
const transactions = await window.martian.getAccountResources(address);

Last updated