reach-sh/reach-lang

Feature Request: Use algod for asset information if reading is allowed.

Closed this issue · 2 comments

Similar to how

const getAccountInfo = async (acc: Account | Address): Promise<AccountInfo> => {
// Note restrictions on AccountInfo responses due to 'MaxAPIResourcesPerAccount' setting in the node and indexer
// https://developer.algorand.org/articles/algorand-unlimited-assets-and-smart-contracts/
const addr = extractAddrConvert(acc);
const dhead = 'getAddressInfo';
try {
await ensureNodeCanRead();
and
const getApplicationInfoM = async (idn:BigNumber): Promise<OrExn<AppInfo>> => {
const id = bigNumberToNumber(idn);
const dhead = 'getApplicationInfo';
// First, lookup application in algod
try {
await ensureNodeCanRead();
work,

getAssetInfo should check if the node can read, and if so, fetch asset info from the node instead of the indexer.

Thank you for the request! This issue will be updated when we do it!

This was added in the last release.