Methods

Get Asset By Authority

Returns the list of assets given an authority address.

Parameters

NameRequiredDescription
authorityAddressThe address of the authority of the assets.
sortBySorting criteria. This is specified as an object { sortBy: <value>, sortDirection: <value> }, where sortBy is one of ["created", "updated", "recentAction", "none"] and sortDirection is one of ["asc", "desc"]
limitThe maximum number of assets to retrieve.
pageThe index of the "page" to retrieve.
beforeRetrieve assets before the specified ID.
afterRetrieve assets after the specified ID.

Example

getAssetByAuthority Example

import { publicKey } from '@metaplex-foundation/umi';
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
import { dasApi } from '@metaplex-foundation/digital-asset-standard-api';

const umi = createUmi('<ENDPOINT>').use(dasApi());
const authority = publicKey('mRdta4rc2RtsxEUDYuvKLamMZAdW6qHcwuq866Skxxv');

const assets = await umi.rpc.getAssetsByAuthority(
  { 
    authority,
    sortBy, // optional
    limit, // optional
    page, // optional
    before, // optional
    after, // optional
  }
);
console.log(assets.items.length > 0);
Previous
Get Asset Proof