kopia lustrzana https://github.com/bugout-dev/moonstream
Add filter for blockchains by subscription_id. Add polygon subscription.
rodzic
5f9e7f4188
commit
bece7be92e
|
@ -27,6 +27,16 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"polygon_blockchain": SubscriptionTypeResourceData(
|
||||
id="polygon_blockchain",
|
||||
name="Polygon transactions",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Transactions that have been mined into the Polygon blockchain",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"ethereum_whalewatch": SubscriptionTypeResourceData(
|
||||
id="ethereum_whalewatch",
|
||||
name="Ethereum whale watch",
|
||||
|
|
|
@ -27,6 +27,12 @@ logger.setLevel(logging.INFO)
|
|||
lable_filters = {"Transfer": "nft_transfer"}
|
||||
|
||||
|
||||
subscription_id_by_blockchain = {
|
||||
"ethereum": "ethereum_blockchain",
|
||||
"polygon": "polygon_blockchain",
|
||||
}
|
||||
|
||||
|
||||
class TimeScale(Enum):
|
||||
year = "year"
|
||||
month = "month"
|
||||
|
@ -364,7 +370,11 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
# read all subscriptions
|
||||
required_subscriptions: BugoutResources = bc.list_resources(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
params={"type": BUGOUT_RESOURCE_TYPE_SUBSCRIPTION, "abi": "true"},
|
||||
params={
|
||||
"type": BUGOUT_RESOURCE_TYPE_SUBSCRIPTION,
|
||||
"abi": "true",
|
||||
"id": subscription_id_by_blockchain[blockchain_type],
|
||||
},
|
||||
timeout=10,
|
||||
)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue