Metagraph Layer 0 API

Parameters

Description

host

Metagraph layer 0 base url, e.g. https://metagraph-layer0-url.com

client

Non-default REST client injection of type RESTClient, see pypergraph.core.cross_platform.api.rest_client.


Reconfigure Client and Host

from pypergraph import MetagraphTokenNetwork
from pypergraph.core.cross_platform.di.RESTClient

class InjectClient(RESTClient)
    ...

inject_client = InjectClient()

network = MetagraphTokenNetwork(...)
network.l0_api.config(host=..., client=inject_client)

All Methods

Inherits from L0Api.

class pypergraph.network.api.metagraph_layer_0_api.ML0Api(host: str, client: RESTClient | None = None, timeout: int = 25)[source]

Bases: L0Api

async get_address_balance(address: str) Balance[source]
async get_address_balance_at_ordinal(ordinal: int, address: str) Balance[source]
async get_total_supply() TotalSupply[source]
async get_total_supply_at_ordinal(ordinal: int) TotalSupply[source]