'''
Find card transfers for <deck>.
'''

import sys
import pypeerassets as pa
provider = pa.RpcNode(testnet=True)

print("Searching for deck {deck}.".format(deck=sys.argv[1]))
deck = pa.find_deck(provider, sys.argv[1])[0]
cards = pa.find_card_transfers(provider, deck)

print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("This deck issuer has issued: {cards} cards in {transfers} card issue transactions.".format(
      cards=sum((i.amount[0] for i in cards if i.type == "CardIssue")),
      transfers=len([i for i in cards if i.type == "CardIssue"])
      ))

print("Peers on this deck have transacted {cards} cards in {transfers} card transactions.".format(
      cards=sum((i.amount[0] for i in cards if i.type == "CardTransfer")),
      transfers=len([i for i in cards if i.type == "CardTransfer"])
      ))

print("Peers on this deck have burned {cards} cards in {transfers} card transactions.".format(
      cards=sum((i.amount[0] for i in cards if i.type == "CardBurn")),
      transfers=len([i for i in cards if i.type == "CardBurn"])
     ))

print("~~~~~~~~~~~~~~~~~~~~~~~~~~~")

@@ -405,32 +405,38 @@
 at(%0A      cards=
+round(
 sum((i.amount%5B0%5D
@@ -474,24 +474,50 @@
 ardIssue%22)),
+ deck.number_of_decimals),
 %0A      trans
@@ -683,32 +683,38 @@
 at(%0A      cards=
+round(
 sum((i.amount%5B0%5D
@@ -755,24 +755,50 @@
 Transfer%22)),
+ deck.number_of_decimals),
 %0A      trans
@@ -971,16 +971,22 @@
   cards=
+round(
 sum((i.a
@@ -1035,16 +1035,42 @@
 Burn%22)),
+ deck.number_of_decimals),
 %0A      t

round to deck.number_of_decimals