Replies - Activity - humblefool - Algorand

Address malformed error

Order of function params looks to be incorrect.

makeAssetCreateTxnWithSuggestedParams(from,note,assetTotal,assetDecimals,assetDefaultFrozen,assetManager,assetReserve,assetFreeze,assetClawback,assetUnitName,assetName,assetURL,assetMetadataHash,suggestedParams,reKeyTo);

Swagger url for algod and indexer

How to segerate the NFT Collections from the assets of the same wallet address

async isArc69(asset: A_Asset): Promise<A_Nft_MetaData_Arc69> {
const {transactions} = await this.indexer.searchForTransactions().assetID(asset.index).txType("acfg").do();
transactions.sort((a, b) => b["round-time"] - a["round-time"]);

for (const transaction of transactions) …
}

How to tell whether an asset is NFT

There are 2 standards for NFT’s on algorand.

How to create a custom indexer?

I think this is the possible solution that many are using.

// Sample code for custom indexer

I had a similar requirement for fundstack. I have written a CronJob in node JS, which gets executed every minute. It will query the required data using the OOB indexer and store the data in mongo DB. My front-end app will query data from MongoDB using Express JS. This made the app blazing fast.

How to build a database on Algorand?

If you want your data on-chain, then it should be either in the application global/local state or NOTE field of the transaction (which is not preferred). Another way could be to have this data on decentralized storage services like IPFS/filecoin etc and save the hash in the asset URL.

Get correct Token balance

You must multiply the amount by the 10 power decimal before preparing the transaction. EX: if you want to transfer 1.2, and the decimal of the asset is 1, then you need to do: 1.2 * 10 power 1, which makes it 12.

Get assets using Algorand's Indexer REST API 2.0

You need to set the request header "x-indexer-api-token" to an empty string. If you have used any algorand SDK, it will set it internally. So it is preferred to use SDK unless there is a need of functionality that is not supported by SDK.

Get amount of transactions for that day

AFAIK indexer doesn’t have support to get the transaction count. You need to write a custom script in node JS or python to get transactions in the last 24 hours page by page until the next token is empty.

Send transaction created using python sdk to algosigner?

It would be best if you used JS SDK to build transactions. Using python SDK you need to send that transaction to frontend and you will have serialization issues.

Why do I get the error: should have been authorized by XXX but was actually authorized by XXX

txn1 should be signed by the private key of address-1 txn2 should be signed by the private key of address -2 if you get this error even after doing the same, then one of the accounts was rekey-ed to a different account.

Is it possible to decompile application approval program?

Thanks, Ben. When can we expect this to be available in JS SDK? Just the rough timeline if possible.

AssetParam not working pyteal

assetClawbackExpr = AssetParam.clawback(Int(0))
assetClawbackAddr = Seq([
assetClawbackExpr,
assetClawbackExpr.value()
])
Assert(assetClawbackAddr == verifiedaddr)

AssetParam.clawback() will not return the clawback address, instead it returns the MayBeValue expression. You need to call .value() on the MayBeValue expression to get the exact value. Here is the documentation for it: AssetParam documentation

indexer.searchForTransactions().limit(10).do() is returning older transactions

This is not an efficient solution in the case of a local sandbox environment. Because transactions will be very less and I end up querying more and more blocks until I get 1000 txns. Can we submit this as a requirement for the indexer team? This is an important feature for my project.