DevelopersContextsServices Context

Services Context

The ServicesContext trait provides a standardized interface for interacting with the Tangle network in your Blueprint through a Subxt OnlineClient with a PolkadotConfig.

Overview

The ServicesContext trait provides access to a Subxt client that enables:

  • Fetching Blueprints - Retrieve Blueprints by ID
  • Querying Blueprints - Query Blueprints for an operator
  • Retrieving Blueprint Owners - Return the Owner for a Blueprint
  • Fetching Service Operators - Return a list of operators for a service

Using the Context

1. Define Your Context

First, define your context struct that implements the ServicesContext trait:

2. Access Services Client Functionality

You can then use this context to access the services client and interact with Tangle services: