Moonstream API mantle support

pull/1102/head
kompotkot 2024-06-25 14:17:38 +00:00
rodzic 8d81a5d674
commit ec36ec6fed
9 zmienionych plików z 102 dodań i 3 usunięć

Wyświetl plik

@ -34,6 +34,8 @@ export MOONSTREAM_AVALANCHE_WEB3_PROVIDER_URI="https://<connection_path_uri_to_n
export MOONSTREAM_AVALANCHE_FUJI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_BLAST_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_BLAST_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_MANTLE_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_MANTLE_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
export MOONSTREAM_QUERIES_JOURNAL_ID="<bugout_journal_id_where_store_queries_for_executing>"
export MOONSTREAM_USAGE_REPORTS_JOURNAL_ID="<bugout_journal_id_where_save_generated_reports>"

Wyświetl plik

@ -260,6 +260,28 @@ CANONICAL_SUBSCRIPTION_TYPES = {
stripe_price_id=None,
active=False,
),
"mantle_smartcontract": SubscriptionTypeResourceData(
id="mantle_smartcontract",
name="Mantle smartcontract",
blockchain="mantle",
choices=["input:address", "tag:erc721"],
description="Contracts events and tx_calls of contract of Mantle blockchain.",
icon_url="https://static.simiotics.com/moonstream/assets/mantle-logo.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"mantle_sepolia_smartcontract": SubscriptionTypeResourceData(
id="mantle_sepolia_smartcontract",
name="Mantle Sepolia smartcontract",
blockchain="mantle_sepolia",
choices=["input:address", "tag:erc721"],
description="Contracts events and tx_calls of contract of Mantle Sepolia blockchain.",
icon_url="https://static.simiotics.com/moonstream/assets/mantle-sepolia-logo.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"mumbai_blockchain": SubscriptionTypeResourceData(
id="mumbai_blockchain",
name="Mumbai transactions",
@ -470,6 +492,28 @@ CANONICAL_SUBSCRIPTION_TYPES = {
stripe_price_id=None,
active=True,
),
"mantle_blockchain": SubscriptionTypeResourceData(
id="mantle_blockchain",
name="Mantle smartcontract",
blockchain="mantle",
choices=["input:address", "tag:erc721"],
description="Mantle chain transactions subscription.",
icon_url="https://static.simiotics.com/moonstream/assets/mantle-logo.png",
stripe_product_id=None,
stripe_price_id=None,
active=False,
),
"mantle_sepolia_blockchain": SubscriptionTypeResourceData(
id="mantle_sepolia_blockchain",
name="Mantle Sepolia transactions",
blockchain="mantle_sepolia",
choices=["input:address", "tag:erc721"],
description="Mantle Sepolia chain transactions subscription.",
icon_url="https://static.simiotics.com/moonstream/assets/mantle-logo.png",
stripe_product_id=None,
stripe_price_id=None,
active=False,
),
}

Wyświetl plik

@ -65,6 +65,8 @@ event_providers: Dict[str, Any] = {
moonworm_provider.AvalancheFujiMoonwormProvider.event_type: moonworm_provider.AvalancheFujiMoonwormProvider,
moonworm_provider.BlastMoonwormProvider.event_type: moonworm_provider.BlastMoonwormProvider,
moonworm_provider.BlastSepoliaMoonwormProvider.event_type: moonworm_provider.BlastSepoliaMoonwormProvider,
moonworm_provider.MantleMoonwormProvider.event_type: moonworm_provider.MantleMoonwormProvider,
moonworm_provider.MantleSepoliaMoonwormProvider.event_type: moonworm_provider.MantleSepoliaMoonwormProvider,
transactions.EthereumTransactions.event_type: transactions.EthereumTransactions,
transactions.PolygonTransactions.event_type: transactions.PolygonTransactions,
transactions.ProofOfPlayApexTransactions.event_type: transactions.ProofOfPlayApexTransactions,
@ -83,6 +85,8 @@ event_providers: Dict[str, Any] = {
transactions.AvalancheFujiTransactions.event_type: transactions.AvalancheFujiTransactions,
transactions.BlastTransactions.event_type: transactions.BlastTransactions,
transactions.BlastSepoliaTransactions.event_type: transactions.BlastSepoliaTransactions,
transactions.MantleTransactions.event_type: transactions.MantleTransactions,
transactions.MantleSepoliaTransactions.event_type: transactions.MantleSepoliaTransactions,
bugout.polygon_whalewatch_provider.event_type: bugout.polygon_whalewatch_provider,
bugout.ethereum_txpool_provider.event_type: bugout.ethereum_txpool_provider,
bugout.ethereum_whalewatch_provider.event_type: bugout.ethereum_whalewatch_provider,

Wyświetl plik

@ -35,6 +35,8 @@ avalanche_event_type = "avalanche_blockchain"
avalanche_fuji_sepolia_event_type = "avalanche_fuji_sepolia_blockchain"
blast_event_type = "blast_blockchain"
blast_sepolia_event_type = "blast_sepolia_blockchain"
mantle_event_type = "mantle_blockchain"
mantle_sepolia_event_type = "mantle_sepolia_blockchain"
allowed_tags = ["tag:erc721"]
@ -526,3 +528,17 @@ ProofOfPlayApexMoonwormProvider = MoonwormProvider(
description="Provider for reviving transactions from Proof of Play Apex tables.",
streamboaundary_range_limit=2 * 60 * 60,
)
MantleMoonwormProvider = MoonwormProvider(
event_type="mantle_smartcontract",
blockchain=AvailableBlockchainType("mantle"),
description="Provider for reviving transactions from Mantle tables.",
streamboaundary_range_limit=2 * 60 * 60,
)
MantleSepoliaMoonwormProvider = MoonwormProvider(
event_type="mantle_sepolia_smartcontract",
blockchain=AvailableBlockchainType("mantle_sepolia"),
description="Provider for reviving transactions from Mantle Sepolia tables.",
streamboaundary_range_limit=2 * 60 * 60,
)

Wyświetl plik

@ -573,3 +573,17 @@ ProofOfPlayApexTransactions = TransactionsProvider(
description="Provider for resiving transactions from Proof of Play Apex tables.",
streamboaundary_range_limit=2 * 60 * 60,
)
MantleTransactions = TransactionsProvider(
event_type="mantle_blockchain",
blockchain=AvailableBlockchainType("mantle"),
description="Provider for resiving transactions from Mantle tables.",
streamboaundary_range_limit=2 * 60 * 60,
)
MantleSepoliaTransactions = TransactionsProvider(
event_type="mantle_sepolia_blockchain",
blockchain=AvailableBlockchainType("mantle_sepolia"),
description="Provider for resiving transactions from Mantle Sepolia tables.",
streamboaundary_range_limit=2 * 60 * 60,
)

Wyświetl plik

@ -228,6 +228,19 @@ if MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI == "":
raise Exception(
"MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI env variable is not set"
)
MOONSTREAM_MANTLE_WEB3_PROVIDER_URI = os.environ.get(
"MOONSTREAM_MANTLE_WEB3_PROVIDER_URI", ""
)
if MOONSTREAM_MANTLE_WEB3_PROVIDER_URI == "":
raise Exception("MOONSTREAM_MANTLE_WEB3_PROVIDER_URI env variable is not set")
MOONSTREAM_MANTLE_SEPOLIA_WEB3_PROVIDER_URI = os.environ.get(
"MOONSTREAM_MANTLE_SEPOLIA_WEB3_PROVIDER_URI", ""
)
if MOONSTREAM_MANTLE_SEPOLIA_WEB3_PROVIDER_URI == "":
raise Exception(
"MOONSTREAM_MANTLE_SEPOLIA_WEB3_PROVIDER_URI env variable is not set"
)
## QueryAPI

Wyświetl plik

@ -13,14 +13,16 @@ from web3.providers.rpc import HTTPProvider
from .settings import (
MOONSTREAM_AMOY_WEB3_PROVIDER_URI,
MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI,
MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI,
MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI,
MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI,
MOONSTREAM_AVALANCHE_FUJI_WEB3_PROVIDER_URI,
MOONSTREAM_AVALANCHE_WEB3_PROVIDER_URI,
MOONSTREAM_BLAST_SEPOLIA_WEB3_PROVIDER_URI,
MOONSTREAM_BLAST_WEB3_PROVIDER_URI,
MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI,
MOONSTREAM_MANTLE_SEPOLIA_WEB3_PROVIDER_URI,
MOONSTREAM_MANTLE_WEB3_PROVIDER_URI,
MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI,
MOONSTREAM_POLYGON_WEB3_PROVIDER_URI,
MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI,
@ -109,6 +111,10 @@ def connect(
web3_uri = MOONSTREAM_BLAST_SEPOLIA_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX:
web3_uri = MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.MANTLE:
web3_uri = MOONSTREAM_MANTLE_WEB3_PROVIDER_URI
elif blockchain_type == AvailableBlockchainType.MANTLE_SEPOLIA:
web3_uri = MOONSTREAM_MANTLE_SEPOLIA_WEB3_PROVIDER_URI
else:
raise Exception("Wrong blockchain type provided for web3 URI")

Wyświetl plik

@ -37,7 +37,7 @@ lru-dict==1.1.8
Mako==1.2.3
MarkupSafe==2.1.1
moonstream==0.1.1
moonstreamdb==0.4.4
moonstreamdb==0.4.5
moonstreamdb-v3==0.0.9
multiaddr==0.0.9
multidict==6.0.2

Wyświetl plik

@ -16,7 +16,7 @@ setup(
"bugout>=0.2.15",
"fastapi",
"moonstream",
"moonstreamdb>=0.4.4",
"moonstreamdb>=0.4.5",
"moonstreamdb-v3>=0.0.9",
"humbug",
"pydantic==1.10.2",