Transactions for an Address from Algorand node

I tried the below address to fetch transactions from node and algoexplorer
Address -NJCLL5UPIZKXTHQ42M52B72DSO3PATJ2DEQOZQXJMWFMZPDLGUYV3PBJ5Q

  • The transactions in the Algoexplorer are more then the transactions from node . Can any one let me know the reason for this .

curl -v http://127.0.0.1:8887/v1/account/NJCLL5UPIZKXTHQ42M52B72DSO3PATJ2DEQOZQXJMWFMZPDLGUYV3PBJ5Q/transactions -H “X-Algo-API-Token:xxx”

Your node, unless set to archival, only has visibility to the last 1000 blocks.

1 Like

Also note that the above queries return only the last 100 transactions by default.
See parameter max in https://developer.algorand.org/docs/reference/rest-apis/algod/#get-v1accountaddresstransactions

1 Like

@fabrice Thanks for the info but how do i get the count of transactions for a block so that i know what do provide the max parameter. For example if there are 1000 transactions and i want to pull out all of them so in max i need to provide 1000 but how do i know there are 1000 transactions.

That’s a good question. I don’t know of a better way than doing it manually right now:

If you want to get the list of transactions of many different addresses, it is usually faster to query blocks directly https://developer.algorand.org/docs/reference/rest-apis/algod/#get-v1blockround and to filter the transactions you are interested in (or to store all the relevant transaction details for your application in a database that you can later query more easily).

1 Like

@fabrice Thanks i think fetching the block info and pulling transactions would be the good one to proceed for getting all transactions.like below . please let me know if i am on the right track.
curl -v http://xxx/v1/block/4795723 -H "X-Algo-API-Token:"xxx"
output:

{“hash”:“D2DCLK6SSZ6VJE7RU533BOBIZ64TY3E5R5PIDQTMKIWROKZMESDQ”,“previousBlockHash”:“4SHPYNHN4Z67CTCDIUKMA56XHBC2IJIVF7PB7OXBFHD3PBEQ4CJQ”,“seed”:“IMHQP4WWX6SGKAZR36QFKX34XW6DM6HVCCIZFS6WGPB5K4MFPFAQ”,“proposer”:“DYATVHCICZA7VVOWZN6OLFFSKUAZ64TZ7WZWCJQBFWL3JL4VBBV6R7Z6IE”,
“round”:4795723,“period”:0,“txnRoot”:“GKBUH3NRWPZIWUTB2NHRN524D7WENDDTCP6RO2AA7PP5ZEL7OODA”,“reward”:103745,“rate”:35999981,“frac”:134135517,“txns”:{“transactions”:[{“type”:“pay”,“tx”:“ENT72UQOJC4TA2P2MZ7DAWV4QPZPA4PFRIUFL43B3HTGS4B7PX5A”,“from”:“NJCLL5UPIZKXTHQ42M52B72DSO3PATJ2DEQOZQXJMWFMZPDLGUYV3PBJ5Q”,“fee”:1000,“first-round”:4795721,“last-round”:4796721,“noteb64”:“6G7vg8SfNhk=”,“round”:4795723,“payment”:{“to”:“Q4DV7XSZHLOI6FFDJIQHDP7PQCVW5UCVYVV4D2ASUSIV74M55VCB2W4VR4”,“amount”:0,“torewards”:74354832,“closerewards”:0},“fromrewards”:60,“genesisID”:“mainnet-v1.0”,“genesishashb64”:“wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=”},{“type”:“pay”,“tx”:“IEWEGVUXSZLV6Y2JBLK3ECOA34YN75SYAKVWJASGIGGCOLCUZ5OQ”,“from”:“NJCLL5UPIZKXTHQ42M52B72DSO3PATJ2DEQOZQXJMWFMZPDLGUYV3PBJ5Q”,“fee”:1000,“first-round”:4795721,“last-round”:4796721,“noteb64”:“RoYLVuPOn1k=”,“round”:4795723,“payment”:{“to”:“W2TVRKTHYB7HDVUGI6E6AVAXDGFT3RJT3XZGB2TVOT53TAISPBO2F5R3HE”,“amount”:0,“torewards”:207784356,“closerewards”:0},“fromrewards”:0,“genesisID”:“mainnet-v1.0”,“genesishashb64”:“wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=”}]},
“timestamp”:1581325990,“currentProtocol”:“https://github.com/algorandfoundation/specs/tree/4a9db6a25595c6fd097cf9cc137cc83027787eaa",“nextProtocol”:"",“nextProtocolApprovals”:0,“nextProtocolVoteBefore”:0,“nextProtocolSwitchOn”:0,“upgradePropose”:"","upgradeApprove”:false}

  1. I can pull the transactions as highlighted ?
  2. As the block falls between 4500001 - 5000000 the reward for the block should be 72 but the reward is 103475. Could you help me understand the gap.
  1. Yes, this is a good way to get transactions.
  2. "reward":103745 means that if you had an account in the genesis block (round 0) with 1 Algo and you never made any transaction, then, at round 4795723, you would have 103745 microAlgos = 0.103745 Algos pending rewards for this account. See Reward, Rate ,Fraction and Proposer for details.
1 Like

@fabrice - i think you mixed up rewards(block level) and pending rewards(account level).

  1. Rate - is the reward for a particular block .Please correct if wrong.
  2. For account level we have specific reward and pending rewards fields.

So as per the above question rate is “rate”:35999981 - i.e 35.999981 algos but as per the reward distribution block falls between 4500001 - 5000000 the reward for the block should be 72 but why is it 35.999981 algos .

Hi @debasish,

The distributed rewards for period 10 (blocks 4,500,000 to 4,999,999) are 18M Algos as per https://algorand.foundation/algo-dynamics. This corresponds to 18,000,000 / 500,000 = 36 Algos per round.